]> andersk Git - moira.git/blobdiff - gen/aliases.dc
Diane Delgado's changes for a fixed table-locking order
[moira.git] / gen / aliases.dc
index a65cff59d31a345069a2708d1eb5dfb0810d8567..5fa8f8be667d74d97ef6ebb3316354c5d64bfa55 100644 (file)
@@ -139,15 +139,17 @@ get_info()
     EXEC SQL WHENEVER SQLERROR GOTO sqlerr;
 
     /* get locks */
-    EXEC SQL SELECT modtime INTO :buf FROM list WHERE LIST_ID = 0;
+    EXEC SQL SELECT modtime INTO :buf FROM imembers WHERE list_id = 0;
     EXEC SQL SELECT modtime INTO :buf FROM users WHERE USERS_ID = 0;
+    EXEC SQL SELECT modtime INTO :buf FROM machine WHERE mach_id = 0;
+    EXEC SQL SELECT modtime INTO :buf FROM list WHERE LIST_ID = 0;
 
     fprintf(stderr, "Loading machines\n");
     machines = create_hash(1000);
 
     EXEC SQL DECLARE m_cursor CURSOR FOR 
       SELECT mach_id, name 
-      FROM machine
+      FROM machine WHERE mach_id != 0
       ORDER BY mach_id;
     EXEC SQL OPEN m_cursor;
     while (1) {
@@ -218,7 +220,7 @@ get_info()
 
     EXEC SQL DECLARE l_cursor CURSOR FOR
       SELECT list_id, name, maillist, description, acl_type, acl_id
-      FROM list WHERE active != 0
+      FROM list WHERE active != 0 AND list_id != 0
       ORDER BY list_id;
     EXEC SQL OPEN l_cursor;
     while (1) {
@@ -247,6 +249,8 @@ get_info()
     while (1) {
         EXEC SQL FETCH mem_cursor INTO :id, :type, :mid;
        if (sqlca.sqlcode != 0) break;
+        if (id == 0)
+            continue;
        if (l = (struct list *) hash_lookup(lists, id)) {
            m = (struct member *) malloc(sizeof(struct member));
            if (type[0] == 'U' &&
@@ -457,3 +461,6 @@ register char *string;
 
     (void) fputc('\n', aliases);
 }
+
+
+
This page took 0.048562 seconds and 4 git commands to generate.