]> andersk Git - moira.git/blobdiff - server/increment.dc
put the name of the database in a variable
[moira.git] / server / increment.dc
index 7e3a5282ef95488acdb34ae3a40a427dc307f3ff..555ed7e8a4ddee1a404a3968583d3d38929640ae 100644 (file)
@@ -133,7 +133,7 @@ char **argv;
          FROM users u WHERE :qual;
        beforec = 9;
     } else if (!strcmp(table, "machine")) {
-       EXEC SQL SELECT n.name, n.type INTO :barg0, :barg1 FROM machine m
+       EXEC SQL SELECT m.name, m.type INTO :barg0, :barg1 FROM machine m
          WHERE :qual;
        beforec = 2;
     } else if (!strcmp(table, "cluster")) {
@@ -233,6 +233,7 @@ char **argv;
 {
     char buffer[2048], *name;
 EXEC SQL BEGIN DECLARE SECTION; 
+    char *type;
     int id, i;
 EXEC SQL END DECLARE SECTION; 
     struct iupdate *iu;
@@ -286,7 +287,12 @@ EXEC SQL END DECLARE SECTION;
        strcpy(aarg0, "?");
        strcpy(aarg1, argv[1]);
        strcpy(aarg2, "?");
-       sprintf(buffer, "%s and fs.filsys_id = q.filsys_id", qual);
+       if (!strcmp(argv[1], "ANY"))
+         type = "NONE";
+       else
+         type = argv[1];
+       sprintf(buffer, "%s and fs.filsys_id = q.filsys_id and q.type = '%s'",
+               qual, type);
        qual = buffer;
        EXEC SQL SELECT CHAR(q.quota), fs.name INTO :aarg3, :aarg4
          FROM quota q, filesys fs WHERE :qual;
@@ -396,6 +402,7 @@ incremental_update()
            cache = c;
        }
        EXEC SQL CLOSE inc;
+       EXEC SQL COMMIT WORK;
     }
 
     while (sq_remove_data(incremental_sq, &iu)) {
This page took 0.04697 seconds and 4 git commands to generate.