]> andersk Git - moira.git/blobdiff - server/qsupport.pc
Changes from dtanner.
[moira.git] / server / qsupport.pc
index c6bbe15f9e9e424d47986312de2e46e9c72a35b8..85c5449018d18d5d5fa6693b771c6a16e9a44600 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];
@@ -1882,6 +1883,10 @@ int update_container(struct query *q, char *argv[], client *cl)
   /* trim off the trailing spaces */
    strcpy(name, strtrim(name));
 
+   qual = xmalloc(MAX_FIELD_WIDTH);    
+   sprintf(qual, "name = '%s'", name);
+   incremental_before(CONTAINERS_TABLE, qual, argv);
+
   /* if we are renaming the container */
   if (strcmp(name, newname))
   {
@@ -1923,7 +1928,8 @@ int update_container(struct query *q, char *argv[], client *cl)
       EXEC SQL FETCH csr_ucon INTO :childname, :childid;
       if (sqlca.sqlcode)
              break;
-      
+
+      strcpy(childname, strtrim(childname));
       /* concatenate the new parent name with the existing sub-container name
        * we get the sub-containers new name */
       tmpchar = childname + strlen(name);
@@ -1954,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;
 }
@@ -1975,7 +1984,7 @@ int get_machines_of_container(struct query *q, char *argv[], client *cl,
   rargv[1] = containername;
 
   cnt_id = *(int *)argv[0];
-  isrecursive = *(int *)argv[1];
+  isrecursive = atoi(argv[1]);
 
   /* get the container name */
   
@@ -2029,14 +2038,14 @@ int get_subcontainers_of_container(struct query *q, char *argv[], client *cl,
   char *qs;
   EXEC SQL END DECLARE SECTION;
 
-  char querystring[512], tmp [256];
+  char querystring[2048], tmp [1024];
   char *rargv[1];
   int found = 0;
   
   rargv[0] = subcontainername;
 
   cnt_id = *(int *)argv[0];
-  isrecursive = *(int *)argv[1];
+  isrecursive = atoi(argv[1]);
 
   /* get the container name */
   
This page took 0.033878 seconds and 4 git commands to generate.