]> andersk Git - moira.git/commitdiff
Cause incrementals to happen on container add/delete/modify.
authorzacheiss <zacheiss>
Sun, 29 Jul 2001 15:14:26 +0000 (15:14 +0000)
committerzacheiss <zacheiss>
Sun, 29 Jul 2001 15:14:26 +0000 (15:14 +0000)
server/increment.pc
server/qsupport.pc

index d1c3b144e5b8d5c589dfac3824e024d9c7363fb6..b7a27c099a99dd960624090439c69f652e455ced 100644 (file)
@@ -110,6 +110,13 @@ void incremental_before(enum tables table, char *qual, char **argv)
       dosql(before);
       beforec = 4;
       break;
+    case CONTAINERS_TABLE:
+      sprintf(stmt_buf, "SELECT c.name, c.description, c.location, c.contact, "
+             "c.acl_type, c.acl_id, c.cnt_id FROM containers c WHERE %s", 
+             qual);
+      dosql(before);
+      beforec = 7;
+      break;
     case MCMAP_TABLE:
       strcpy(before[0], argv[0]);
       strcpy(before[1], argv[1]);
@@ -243,6 +250,13 @@ void incremental_after(enum tables table, char *qual, char **argv)
       dosql(after);
       afterc = 4;
       break;
+    case CONTAINERS_TABLE:
+      sprintf(stmt_buf, "SELECT c.name, c.description, c.location, c.contact, "
+             "c.acl_type, c.acl_id, c.cnt_id FROM containers c WHERE %s",
+             qual);
+      dosql(after);
+      afterc = 7;
+      break;
     case MCMAP_TABLE:
       strcpy(after[0], argv[0]);
       strcpy(after[1], argv[1]);
index 5dd8b4542bca70bb2dffc258bd899632ec672fcc..9fd7edcaf27d3713a6f25eebde4a8ace7e7c8002 100644 (file)
@@ -1862,6 +1862,7 @@ int update_container(struct query *q, char *argv[], client *cl)
   char* tmpchar;
   int cnt, childid;
   char childname[CONTAINERS_NAME_SIZE];
+  char *qual;
 
   cnt_id = *(int *)argv[0];
   newname = argv[1];
@@ -1902,6 +1903,10 @@ int update_container(struct query *q, char *argv[], client *cl)
         return MR_NEW_CONTAINER_NAME;
     }
 
+    qual = xmalloc(CONTAINERS_NAME_SIZE + 10);
+    sprintf(qual, "name = '%s'", name);
+    incremental_before(CONTAINERS_TABLE, qual, argv);
+
     /* update the name for this container */
     EXEC SQL UPDATE containers
       SET name = :newname
@@ -1955,6 +1960,9 @@ int update_container(struct query *q, char *argv[], client *cl)
 
   if (dbms_errno)
     return mr_errcode;
+
+  sprintf(qual, "name = '%s'", newname);
+  incremental_after(CONTAINERS_TABLE, qual, argv);
     
   return MR_SUCCESS;
 }
This page took 0.045628 seconds and 5 git commands to generate.