]> andersk Git - moira.git/commitdiff
Make update_printer work.
authorzacheiss <zacheiss>
Thu, 5 Nov 2009 22:12:02 +0000 (22:12 +0000)
committerzacheiss <zacheiss>
Thu, 5 Nov 2009 22:12:02 +0000 (22:12 +0000)
server/qfollow.pc
server/queries2.c

index 6ae39f92014324f7d6edcdbc6c4a84e00309f76c..480d287fc72e8c9d8fa5e1d11eb126f6b66a8125 100644 (file)
@@ -42,12 +42,16 @@ EXEC SQL WHENEVER SQLERROR DO dbmserr();
 int set_modtime(struct query *q, char *argv[], client *cl)
 {
   char *name, *entity, *table;
-  int who;
+  int who, row = 0;
 
   entity = cl->entity;
   who = cl->client_id;
   table = table_name[q->rtable];
-  name = argv[0];
+
+  if (q->type == MR_Q_UPDATE)
+    row = 1;
+
+  name = argv[0 + row];
 
   sprintf(stmt_buf, "UPDATE %s SET modtime = SYSDATE, modby = %d, "
          "modwith = '%s' WHERE name = '%s'", table, who, entity, name);
index 10436cbd9cf7ea05e9065a39236282b3b77012f8..43c6d97aad9dfdc3db6c113714c98007cb203c67 100644 (file)
@@ -7445,11 +7445,11 @@ struct query Queries[] = {
     MR_Q_UPDATE,
     "pr",
     PRINTERS_TABLE,
-    "printers SET name = '%s', type = '%s', hwtype = '%s', duplexname = NVL('%s', CHR(0)), mach_id = %d, loghost = %d, rm = %d, rp = NVL('%s', CHR(0)), rq = %d, ka = %d, pc = %d, ac = %d, lpc_acl = %d, banner = %d, location = NVL('%s', CHR(0)), contact = NVL('%s', CHR(0))",
+    "printers SET name = '%s', type = '%s', hwtype = '%s', duplexname = NVL('%s', CHR(0)), mach_id = %d, loghost = %d, rm = %d, rp = NVL('%s', CHR(0)), rq = %d, ka = %s, pc = %s, ac = %d, lpc_acl = %d, banner = %s, location = NVL('%s', CHR(0)), contact = NVL('%s', CHR(0))",
     uprn_fields,
     16,
-    0,
-    0,
+    "name = '%s'",
+    1,
     NULL,
     &uprn_validate,
   },
This page took 0.047229 seconds and 5 git commands to generate.