]> andersk Git - moira.git/blobdiff - server/queries2.c
After synchronizing with opssrc as it was on 8/4/92.
[moira.git] / server / queries2.c
index 349674d70173191242d0487051c79480bfdadc4e..2f79f144cecc941d270c94dd52e06952e8599cb2 100644 (file)
@@ -26,6 +26,7 @@ int access_filesys();
 
 /* Query Setup Routines */
 int prefetch_value();
+int prefetch_filesys();
 int setup_ausr();
 int setup_dusr();
 int setup_spop();
@@ -39,6 +40,7 @@ int setup_dshi();
 int setup_afil();
 int setup_ufil();
 int setup_dfil();
+int setup_aftg();
 int setup_dnfp();
 int setup_dqot();
 int setup_sshi();
@@ -132,7 +134,45 @@ static char UID[] = "uid";
  */
 
 static struct valobj VOsort0[] = {
-  {V_SORT, 0, 0, 0, 0, 0},
+  {V_SORT, 0},
+};
+
+static struct valobj VOwild0[] = {
+  {V_WILD, 0},
+};
+
+static struct valobj VOupwild0[] = {
+  {V_UPWILD, 0},
+};
+
+static struct valobj VOwild0sort[] = {
+  {V_WILD, 0},
+  {V_SORT, 0},
+};
+
+static struct valobj VOupwild0sort[] = {
+  {V_UPWILD, 0},
+  {V_SORT, 0},
+};
+
+static struct valobj VOwild01sort0[] = {
+  {V_WILD, 0},
+  {V_WILD, 1},
+  {V_SORT, 0},
+};
+
+static struct valobj VOwild01sort01[] = {
+  {V_WILD, 0},
+  {V_WILD, 1},
+  {V_SORT, 0},
+  {V_SORT, 1}, 
+};
+
+static struct valobj VOwild012sort0[] = {  /* get_alias */
+    {V_WILD, 0},
+    {V_WILD, 1},
+    {V_WILD, 2},
+    {V_SORT, 0},
 };
 
 static struct valobj VOdate1[] = {
@@ -191,7 +231,12 @@ static struct valobj VOfilsys0user1[] = {
  */
 
 static struct validate VDmach = { VOmach0, 1 };
+static struct validate VDsort0= { VOsort0, 1 };
+static struct validate VDwild0= { VOwild0, 1 };
+static struct validate VDupwild0= { VOupwild0, 1 };
 static struct validate VDsort2= { VOsort01,2 };
+static struct validate VDwild2sort2 = { VOwild01sort01,4 };
+static struct validate VDwild3sort1 = { VOwild012sort0,4 };
 static struct validate VDsortf = { 
     VOsort0,
     1,
@@ -204,6 +249,30 @@ static struct validate VDsortf = {
     followup_fix_modby,
 };
 
+static struct validate VDwildsortf = { 
+    VOwild0sort,
+    2,
+    0,
+    0,
+    0,
+    0,
+    0,
+    0,
+    followup_fix_modby,
+};
+
+static struct validate VDupwildsortf = { 
+    VOupwild0sort,
+    2,
+    0,
+    0,
+    0,
+    0,
+    0,
+    0,
+    followup_fix_modby,
+};
+
 
 \f
 /* Query data */
@@ -218,10 +287,10 @@ static char *gubl_fields[] = {
   MIT_ID, CLASS, MOD1, MOD2, MOD3
 };
 
-static struct validate gubx_validate = /* gubl, gubu */
+static struct validate gubl_validate = 
 {
-  VOsort0,
-  1,
+  VOwild0sort,
+  2,
   0,
   0,
   0,
@@ -237,12 +306,38 @@ static char *gubu_fields[] = {
   MIT_ID, CLASS, MOD1, MOD2, MOD3,
 };
 
+static struct validate gubu_validate = 
+{
+  VOsort0,
+  1,
+  0,
+  0,
+  0,
+  0,
+  access_login,
+  0,
+  followup_fix_modby,
+};
+
 static char *gubn_fields[] = {
   FIRST, LAST,
   LOGIN, UID, SHELL, LAST, FIRST, MIDDLE, STATUS, 
   MIT_ID, CLASS, MOD1, MOD2, MOD3,
 };
 
+static struct validate gubn_validate =
+{
+    VOwild01sort0,
+    3,
+    0,
+    0,
+    0,
+    0,
+    0,
+    0,
+    followup_fix_modby,
+};
+
 static char *gubc_fields[] = {
   CLASS,
   LOGIN, UID, SHELL, LAST, FIRST, MIDDLE, STATUS, 
@@ -274,7 +369,7 @@ static struct validate ausr_validate = {
   ausr_valobj,
   7,
   LOGIN,
-  "users.login = '%s'",
+  "users.login = LEFT('%s',SIZE(users.login))",
   1,
   USERS_ID,
   0,
@@ -421,7 +516,7 @@ static struct validate akum_validate =
     akum_valobj,
     1,
     USERS_ID,
-    "kerberos.users_id = %d or kerberos.string_id = %d",
+    "krbmap.users_id = %d or krbmap.string_id = %d",
     2,
     USERS_ID,
     access_user,
@@ -434,7 +529,7 @@ static struct validate dkum_validate =
     akum_valobj,
     2,
     USERS_ID,
-    "kerberos.users_id = %d and kerberos.string_id = %d",
+    "krbmap.users_id = %d and krbmap.string_id = %d",
     2,
     USERS_ID,
     access_user,
@@ -581,7 +676,7 @@ static struct validate amac_validate = {
   amac_valobj,
   3,
   NAME,
-  "machine.name = uppercase('%s')",
+  "machine.name = UPPERCASE(LEFT('%s',SIZE(machine.name)))",
   1,
   MACH_ID,
   0,
@@ -648,12 +743,12 @@ static struct valobj aclu_valobj[] = {
   {V_CHAR, 0}
 };
 
-static struct validate aclu_validate = /* for aclu  */
+static struct validate aclu_validate = 
 {
   aclu_valobj,
   2,
   NAME,
-  "cluster.name = '%s'",
+  "cluster.name = LEFT('%s',SIZE(cluster.name))",
   1,
   CLU_ID,
   0,
@@ -705,6 +800,16 @@ static char *gmcm_fields[] = {
   MACHINE, CLUSTER,
 };
 
+static struct valobj gmcm_valobj[] =
+{
+  {V_UPWILD, 0},
+  {V_WILD, 1},
+  {V_SORT, 0},
+  {V_SORT, 1},
+};
+
+static struct validate gmcm_validate = { gmcm_valobj, 4 };
+
 static struct valobj amtc_valobj[] =   /* ADD_MACHINE_TO_CLUSTER */
 {                                      /* DELETE_MACHINE_FROM_CLUSTER */
   {V_ID, 0, MACHINE, NAME, MACH_ID, MR_MACHINE},
@@ -736,15 +841,35 @@ static char *acld_fields[] = {
 static struct valobj acld_valobj[] =
 {
   {V_ID, 0, CLUSTER, NAME, CLU_ID, MR_CLUSTER},
+  {V_CHAR, 1},
   {V_CHAR, 2},
 };
 
-static struct validate acld_validate = /* ADD_CLUSTER_DATA */
-{                                      /* DELETE_CLUSTER_DATA */
+static struct validate acld_validate = 
+{                                      
   acld_valobj,
+  3,
+  CLU_ID,
+  "svc.clu_id = %d AND svc.serv_label = '%s' AND svc.serv_cluster = LEFT('%s',SIZE(svc.serv_cluster))",
+  3,
+  0,
+  0,
+  0,
+  set_cluster_modtime_by_id,
+};
+
+static struct valobj dcld_valobj[] =
+{
+  {V_ID, 0, CLUSTER, NAME, CLU_ID, MR_CLUSTER},
+  {V_CHAR, 2},
+};
+
+static struct validate dcld_validate = 
+{                                      
+  dcld_valobj,
   2,
   CLU_ID,
-  "svc.clu_id = %d and svc.serv_label = '%s' and svc.serv_cluster = '%s'",
+  "svc.clu_id = %d AND svc.serv_label = '%s' AND svc.serv_cluster = '%s'",
   3,
   0,
   0,
@@ -759,10 +884,15 @@ static char *gsin_fields[] = {
   ACE_TYPE, ACE_NAME, MOD1, MOD2, MOD3,
 };
 
+static struct valobj gsin_valobj[] =
+{
+  { V_UPWILD, 0 },
+};
+
 static struct validate gsin_validate = 
 {
-    0,
-    0,
+    gsin_valobj,
+    1,
     0,
     0,
     0,
@@ -813,7 +943,7 @@ static struct validate asin_validate =      /* for asin, usin */
   asin_valobj,
   5,
   NAME,
-  "services.name = uppercase('%s')",
+  "servers.name = UPPERCASE(LEFT('%s',SIZE(servers.name)))",
   1,
   0,
   0,
@@ -872,9 +1002,14 @@ static char *gshi_fields[] = {
   "value3", MOD1, MOD2, MOD3, 
 };
 
+static struct valobj gshi_valobj[] = {
+    { V_UPWILD, 0 },
+    { V_UPWILD, 1 },
+};
+
 static struct validate gshi_validate = {
-  0,
-  0,
+  gshi_valobj,
+  2,
   0,
   0,
   0,
@@ -924,7 +1059,7 @@ static struct validate ashi_validate = /* ashi & ushi */
   ashi_valobj,
   3,
   SERVICE,
-  "serverhosts.service = uppercase('%s') and serverhosts.mach_id = %d",
+  "serverhosts.service = UPPERCASE(LEFT('%s',SIZE(serverhosts.service))) and serverhosts.mach_id = %d",
   2,
   0,
   access_service,
@@ -965,12 +1100,13 @@ static char *sshi_fields[] = {
 
 static struct valobj sshi_valobj[] = {
   {V_NAME, 0, "servers", NAME, 0, MR_SERVICE},
+  {V_ID, 1, MACHINE, NAME, MACH_ID, MR_MACHINE},  /* Was this ok to add? */
 };
 
 static struct validate sshi_validate = 
 {
   sshi_valobj,
-  1,
+  2,
   0,
   0,
   0,
@@ -1004,8 +1140,8 @@ static char *gsha_fields[] = {
 
 static struct validate gsha_validate = 
 {
-  0,
-  0,
+  VOupwild0,
+  1,
   0,
   0,
   0,
@@ -1073,6 +1209,24 @@ static char *gfsn_fields[] = {
   "create", "lockertype", MOD1, MOD2, MOD3,
 };
 
+static struct valobj gfsn_valobj[] =
+{
+  {V_ID, 0, MACHINE, NAME, MACH_ID, MR_MACHINE},
+  {V_WILD, 1},
+};
+
+static struct validate gfsn_validate = {
+  gfsn_valobj,
+  2,
+  0,
+  0,
+  0,
+  0,
+  0,
+  0,
+  followup_fix_modby,
+};
+
 static char *gfsg_fields[] = {
   LIST,
   LABEL, TYPE, MACHINE, NAME, "mount", "access", "comments", "owner", "owners",
@@ -1111,7 +1265,7 @@ static struct validate afil_validate = {
   afil_valobj,
   8,
   LABEL,
-  "filesys.label = '%s'",
+  "filesys.label = LEFT('%s',SIZE(filesys.label))",
   1,
   FILSYS_ID,
   0,
@@ -1205,7 +1359,7 @@ static struct validate aftg_validate = {
     2,
     0,
     0,
-    0,
+    setup_aftg,
     0,
 };
 
@@ -1218,9 +1372,14 @@ static char *gnfp_fields[] = {
   MACHINE, DIR, DEVICE, STATUS, "allocated", "size", MOD1, MOD2, MOD3,
 };
 
+static struct valobj gnfp_valobj[] = {
+  {V_ID, 0, MACHINE, NAME, MACH_ID, MR_MACHINE},
+  {V_WILD, 1},
+};
+
 static struct validate gnfp_validate = {
-  VOmach0,
-  1,
+  gnfp_valobj,
+  2,
   0,
   0,
   0,
@@ -1239,7 +1398,7 @@ static struct validate anfp_validate = {
   anfp_valobj,
   2,
   DIR,
-  "nfsphys.mach_id = %d and nfsphys.dir = '%s'",
+  "nfsphys.mach_id = %d and nfsphys.dir = LEFT('%s',SIZE(nfsphys.dir))",
   2,
   "nfsphys_id",
   0,
@@ -1259,6 +1418,10 @@ static struct validate unfp_validate = {
   set_nfsphys_modtime,
 };
 
+static char *ajnf_fields[] = {
+  MACHINE, DIR, "adjustment",
+};
+
 static char *dnfp_fields[] = {
   MACHINE, DIR,
 };
@@ -1334,7 +1497,7 @@ static struct validate aqot_validate = {
   3,
   0,
   0,
-  0,
+  prefetch_filesys,
   followup_aqot,
 };
 
@@ -1368,8 +1531,8 @@ static char *gnfq_fields[] = {
 };
 
 static struct validate gnfq_validate = {
-  VOsort0,
-  1,
+  VOwild0sort,
+  2,
   0,
   0,
   0,
@@ -1384,6 +1547,13 @@ static char *gnqp_fields[] = {
   FILESYS, LOGIN, QUOTA, DIR, MACHINE, MOD1, MOD2, MOD3,
 };
 
+static struct valobj gnqp_valobj[] = {
+  {V_ID, 0, MACHINE, NAME, MACH_ID, MR_MACHINE},
+  {V_WILD, 1},
+};
+
+static struct validate gnqp_validate = { gnqp_valobj, 2, };
+
 static char *anfq_fields[] = {
   FILESYS, LOGIN, QUOTA,
 };
@@ -1396,7 +1566,7 @@ static struct validate anfq_validate = {
   2,
   0,
   0,
-  0,
+  prefetch_filesys,
   followup_aqot,
 };
 
@@ -1458,7 +1628,7 @@ static struct validate alis_validate = {
   alis_valobj,
   4,
   NAME,
-  "list.name = '%s'",
+  "list.name = LEFT('%s',SIZE(list.name))",
   1,
   LIST_ID,
   0,
@@ -1656,8 +1826,8 @@ static char *gzcl_fields[] = {
 };
 
 static struct validate gzcl_validate = {
-  VOsort0,
-  1,
+  VOwild0sort,
+  2,
   0,
   0,
   0,
@@ -1688,7 +1858,7 @@ static struct validate azcl_validate = {
   azcl_valobj,
   9,
   CLASS,
-  "zephyr.class = '%s'",
+  "zephyr.class = LEFT('%s',SIZE(zephyr.class))",
   1,
   0,
   0,
@@ -1750,7 +1920,7 @@ static struct validate asvc_validate = {
   VOchar0,
   1,
   NAME,
-  "services.name = '%s'",
+  "services.name = LEFT('%s',SIZE(services.name))",
   1,
   0,
   0,
@@ -1766,8 +1936,8 @@ static char *gpce_fields[] = {
 };
 
 static struct validate gpce_validate = {
-  VOsort0,
-  1,
+  VOwild0sort,
+  2,
   0,
   0,
   0,
@@ -1793,7 +1963,7 @@ static struct validate apce_validate = {
   apce_valobj,
   3,
   NAME,
-  "printcap.name = '%s'",
+  "printcap.name = LEFT('%s',SIZE(printcap.name))",
   1,
   0,
   0,
@@ -1837,7 +2007,7 @@ static struct validate apdm_validate = {
   apdm_valobj,
   2,
   NAME,
-  "palladium.name = '%s'",
+  "palladium.name = LEFT('%s',SIZE(palladium.name))",
   1,
   0,
   0,
@@ -1876,7 +2046,7 @@ static struct validate aali_validate = {
   aali_valobj,
   3,
   "trans",
-  "alias.name = '%s' and alias.type = '%s' and alias.trans = '%s'",
+  "alias.name = LEFT('%s',SIZE(alias.name)) and alias.type = '%s' and alias.trans = LEFT('%s',SIZE(alias.trans))",
   3,
   0,
   0,
@@ -1926,7 +2096,7 @@ static struct validate aval_validate =    /* for aval, uval, and dval */
   VOchar0,
   1,
   NAME,
-  "numvalues.name = '%s'",
+  "numvalues.name = LEFT('%s',SIZE(numvalues.name))",  /* LEFT() only needed for aval */
   1,
   0,
   0,
@@ -1946,6 +2116,10 @@ static char *gats_fields[] = {
 \f
 /* Generalized Query Definitions */
 
+/* Note: For any query which uses prefetch_value, the vcnt should be
+ * one less than the number of %-format specifiers in the tlist.
+ */
+
 struct query Queries2[] = {
   {
     /* Q_GALO - GET_ALL_LOGINS */
@@ -1954,12 +2128,12 @@ struct query Queries2[] = {
     RETRIEVE,
     "u",
     USERS,
-    "login, CHAR(uid), shell, last, first, middle FROM users",
+    "CHAR(login), CHAR(uid), shell, CHAR(last), CHAR(first), middle FROM users",
     galo_fields,
     6,
     "users_id != 0",
     0,
-    0,
+    &VDsort0,
   },
 
   {
@@ -1969,12 +2143,12 @@ struct query Queries2[] = {
     RETRIEVE,
     "u",
     USERS,
-    "login, CHAR(uid), shell, last, first, middle FROM users",
+    "CHAR(login), CHAR(uid), shell, CHAR(last), CHAR(first), middle FROM users",
     galo_fields,
     6,
     "status = 1",
     0,
-    0,
+    &VDsort0,
   },
 
   {
@@ -1984,12 +2158,12 @@ struct query Queries2[] = {
     RETRIEVE,
     "u",
     USERS,  
-    "login, CHAR(uid), shell, last, first, middle, CHAR(status), clearid, type, CHAR(modtime), CHAR(modby), modwith FROM users",
+    "CHAR(login), CHAR(uid), shell, CHAR(last), CHAR(first), middle, CHAR(status), CHAR(clearid), type, CHAR(modtime), CHAR(modby), modwith FROM users",
     gubl_fields,
     12,
-    "login = '%s' AND users_id != 0",
+    "login LIKE '%s' ESCAPE '*' AND users_id != 0",
     1,
-    &gubx_validate,
+    &gubl_validate,
   },
 
   {
@@ -1999,12 +2173,12 @@ struct query Queries2[] = {
     RETRIEVE,
     "u",
     USERS,
-    "login, CHAR(uid), shell, last, first, middle, CHAR(status), clearid, type, CHAR(modtime), CHAR(modby), modwith FROM users",
+    "CHAR(login), CHAR(uid), shell, CHAR(last), CHAR(first), middle, CHAR(status), CHAR(clearid), type, CHAR(modtime), CHAR(modby), modwith FROM users",
     gubu_fields,
     12,
     "uid = %s AND users_id != 0",
     1,
-    &gubx_validate,
+    &gubu_validate,
   },
 
   {
@@ -2014,12 +2188,12 @@ struct query Queries2[] = {
     RETRIEVE,
     "u",
     USERS,
-    "login, CHAR(uid), shell, last, first, middle, CHAR(status), clearid, type, CHAR(modtime), CHAR(modby), modwith FROM users",
+    "CHAR(login), CHAR(uid), shell, CHAR(last), CHAR(first), middle, CHAR(status), CHAR(clearid), type, CHAR(modtime), CHAR(modby), modwith FROM users",
     gubn_fields,
     12,
-    "first = '%s' AND last = '%s' AND users_id != 0",
+    "first LIKE '%s' ESCAPE '*' AND last LIKE '%s' ESCAPE '*' AND users_id != 0",
     2,
-    &VDsortf,
+    &gubn_validate,
   },
 
   {
@@ -2029,7 +2203,7 @@ struct query Queries2[] = {
     RETRIEVE,
     "u",
     USERS,
-    "login, CHAR(uid), shell, last, first, middle, CHAR(status), clearid, type, CHAR(modtime), CHAR(modby), modwith FROM users",
+    "CHAR(login), CHAR(uid), shell, CHAR(last), CHAR(first), middle, CHAR(status), CHAR(clearid), type, CHAR(modtime), CHAR(modby), modwith FROM users",
     gubc_fields,
     12,
     "type = uppercase('%s') AND users_id != 0",
@@ -2044,12 +2218,12 @@ struct query Queries2[] = {
     RETRIEVE,
     "u",
     USERS,
-    "login, CHAR(uid), shell, last, first, middle, CHAR(status), clearid, type, CHAR(modtime), CHAR(modby), modwith FROM users",
+    "CHAR(login), CHAR(uid), shell, CHAR(last), CHAR(first), middle, CHAR(status), CHAR(clearid), type, CHAR(modtime), CHAR(modby), modwith FROM users",
     gubm_fields,
     12,
-    "clearid = '%s' AND users_id != 0",
+    "clearid LIKE '%s' ESCAPE '*' AND users_id != 0",
     1,
-    &VDsortf,
+    &VDwildsortf,
   },
 
 
@@ -2153,7 +2327,7 @@ struct query Queries2[] = {
     (char *)0,
     dubu_fields,
     0,
-    "u.users_id = %d",
+    "users_id = %d",
     1,
     &dubu_validate,
   },
@@ -2165,12 +2339,12 @@ struct query Queries2[] = {
     RETRIEVE,
     "k",
     "krbmap",
-    "u.login, s.string FROM krbmap k, users u, strings s",
+    "CHAR(u.login), CHAR(s.string) FROM krbmap k, users u, strings s",
     gkum_fields,
     2,
-    "u.login = '%s' AND s.string = '%s' AND k.users_id = u.users_id AND k.string_id = s.string_id",
+    "u.login LIKE '%s' ESCAPE '*' AND s.string LIKE '%s' ESCAPE '*' AND k.users_id = u.users_id AND k.string_id = s.string_id",
     2,
-    &VDsort2,
+    &VDwild2sort2,
   },
 
   {
@@ -2180,7 +2354,7 @@ struct query Queries2[] = {
     APPEND,
     "k",
     "krbmap",
-    "INTO krbmap (users_id, string_id) VALUES (%s, %s)",
+    "INTO krbmap (users_id, string_id) VALUES (%d, %d)",
     akum_fields,
     2,
     0,
@@ -2198,7 +2372,7 @@ struct query Queries2[] = {
     0,
     akum_fields,
     0,
-    "k.users_id = %d AND k.string_id = %d",
+    "users_id = %d AND string_id = %d",
     2,
     &dkum_validate,
   },
@@ -2210,7 +2384,7 @@ struct query Queries2[] = {
     RETRIEVE,
     "u",
     USERS,
-    "login, fullname, nickname, home_addr, home_phone, office_addr, office_phone, department, affiliation, CHAR(fmodtime), CHAR(fmodby), fmodwith FROM users",
+    "CHAR(login), fullname, nickname, home_addr, home_phone, office_addr, office_phone, department, affiliation, CHAR(fmodtime), CHAR(fmodby), fmodwith FROM users",
     gfbl_fields,
     12,
     "users_id = %d",
@@ -2240,7 +2414,7 @@ struct query Queries2[] = {
     RETRIEVE,
     "u",
     USERS,
-    "login, potype, CHAR(pop_id) + ':' + CHAR(box_id), CHAR(pmodtime), CHAR(pmodby), pmodwith FROM users",
+    "CHAR(login), potype, CHAR(pop_id) + ':' + CHAR(box_id), CHAR(pmodtime), CHAR(pmodby), pmodwith FROM users",
     gpob_fields,
     6,
     "users_id = %d",
@@ -2255,7 +2429,7 @@ struct query Queries2[] = {
     RETRIEVE,
     "u",
     USERS,
-    "login, potype, CHAR(pop_id) + ':' + CHAR(box_id) FROM users",
+    "CHAR(login), potype, CHAR(pop_id) + ':' + CHAR(box_id) FROM users",
     gpox_fields,
     3,
     "potype != 'NONE'",
@@ -2270,7 +2444,7 @@ struct query Queries2[] = {
     RETRIEVE,
     "u",
     USERS,
-    "login, potype, CHAR(pop_id) + ':' + CHAR(box_id) FROM users",
+    "CHAR(login), potype, CHAR(pop_id) + ':' + CHAR(box_id) FROM users",
     gpox_fields,
     3,
     "potype = 'POP'",
@@ -2285,7 +2459,7 @@ struct query Queries2[] = {
     RETRIEVE,
     "u",
     USERS,
-    "login, potype, CHAR(pop_id) + ':' + CHAR(box_id) FROM users",
+    "CHAR(login), potype, CHAR(pop_id) + ':' + CHAR(box_id) FROM users",
     gpox_fields,
     3,
     "potype = 'SMTP'",
@@ -2345,13 +2519,12 @@ struct query Queries2[] = {
     RETRIEVE,
     "m",
     MACHINE,
-    "name, type, CHAR(modtime), CHAR(modby), modwith FROM machine",
+    "CHAR(name), type, CHAR(modtime), CHAR(modby), modwith FROM machine",
     gmac_fields,
     5,
-    "name = uppercase('%s') AND mach_id != 0",
-/*    "name LIKE '%s' ESCAPE '\\' AND mach_id != 0", */ /* Pattern matching */
+    "name LIKE '%s' ESCAPE '*' AND mach_id != 0", 
     1,
-    &VDsortf,
+    &VDupwildsortf,
   },
 
   {
@@ -2406,12 +2579,12 @@ struct query Queries2[] = {
     RETRIEVE,
     "c",
     CLUSTER,
-    "name, description, location, CHAR(modtime), CHAR(modby), modwith FROM cluster",
+    "CHAR(name), description, location, CHAR(modtime), CHAR(modby), modwith FROM cluster",
     gclu_fields,
     6,
-    "name = '%s' AND clu_id != 0",
+    "name LIKE '%s' ESCAPE '*' AND clu_id != 0",
     1,
-    &VDsortf,
+    &VDwildsortf,
   },
 
   {
@@ -2466,12 +2639,12 @@ struct query Queries2[] = {
     RETRIEVE,
     "map",
     "mcmap",
-    "m.name, c.name FROM machine m, cluster c, mcmap map",
+    "CHAR(m.name), CHAR(c.name) FROM machine m, cluster c, mcmap map",
     gmcm_fields,
     2,
-    "m.name = uppercase('%s') AND c.name = '%s' AND map.clu_id = c.clu_id AND map.mach_id = m.mach_id",
+    "m.name LIKE '%s' ESCAPE '*' AND c.name LIKE '%s' ESCAPE '*' AND map.clu_id = c.clu_id AND map.mach_id = m.mach_id",
     2,
-    &VDsort2,
+    &gmcm_validate, 
   },
                                            
   {
@@ -2511,12 +2684,12 @@ struct query Queries2[] = {
     RETRIEVE,
     "s",
     "svc",
-    "c.name, s.serv_label, s.serv_cluster FROM svc s, cluster c",
+    "CHAR(c.name), CHAR(s.serv_label), s.serv_cluster FROM svc s, cluster c",
     gcld_fields,
     3,
-    "c.clu_id = s.clu_id AND c.name = '%s' AND s.serv_label = '%s'",
+    "c.clu_id = s.clu_id AND c.name LIKE '%s' ESCAPE '*' AND s.serv_label LIKE '%s' ESCAPE '*'",
     2,
-    &VDsort2,
+    &VDwild2sort2,
   },
 
   {
@@ -2544,9 +2717,9 @@ struct query Queries2[] = {
     (char *)0,
     acld_fields,
     0,
-    "clu_id = %d AND serv_label = '%s' AND serv_cluster = '%s'",
+    "clu_id = %d AND serv_label = '%s' AND serv_cluster = '%s'",   
     3,
-    &acld_validate,
+    &dcld_validate,
   },
 
   {
@@ -2556,10 +2729,10 @@ struct query Queries2[] = {
     RETRIEVE,
     "s",
     "servers",
-    "name, CHAR(update_int), target_file, script, CHAR(dfgen), CHAR(dfcheck), type, CHAR(enable), CHAR(inprogress), CHAR(harderror), errmsg, acl_type, CHAR(acl_id), CHAR(modtime), CHAR(modby), modwith FROM servers",
+    "CHAR(name), CHAR(update_int), target_file, script, CHAR(dfgen), CHAR(dfcheck), type, CHAR(enable), CHAR(inprogress), CHAR(harderror), errmsg, acl_type, CHAR(acl_id), CHAR(modtime), CHAR(modby), modwith FROM servers",
     gsin_fields,
     16,
-    "name = uppercase('%s')",
+    "name LIKE '%s' ESCAPE '*'",
     1,
     &gsin_validate,
   },
@@ -2661,10 +2834,10 @@ struct query Queries2[] = {
     RETRIEVE,
     "sh",
     "serverhosts",
-    "sh.service, m.name, CHAR(sh.enable), CHAR(sh.override), CHAR(sh.success), CHAR(sh.inprogress), CHAR(sh.hosterror), sh.hosterrmsg, CHAR(sh.ltt), CHAR(sh.lts), CHAR(sh.value1), CHAR(sh.value2), sh.value, CHAR(sh.modtime), CHAR(sh.modby), sh.modwith FROM serverhosts sh, machine m",
+    "CHAR(sh.service), CHAR(m.name), CHAR(sh.enable), CHAR(sh.override), CHAR(sh.success), CHAR(sh.inprogress), CHAR(sh.hosterror), sh.hosterrmsg, CHAR(sh.ltt), CHAR(sh.lts), CHAR(sh.value1), CHAR(sh.value2), sh.value3, CHAR(sh.modtime), CHAR(sh.modby), sh.modwith FROM serverhosts sh, machine m",
     gshi_fields,
     16,
-    "sh.service = uppercase('%s') AND m.name = uppercase('%s') AND m.mach_id = sh.mach_id",
+    "sh.service LIKE '%s' ESCAPE '*' AND m.name LIKE '%s' ESCAPE '*' AND m.mach_id = sh.mach_id",
     2,
     &gshi_validate,
   },
@@ -2745,7 +2918,7 @@ struct query Queries2[] = {
   },
 
   {
-    /* Q_SSHI - SET_SERVER_HOST_INTERNAL */ /**! Would benefit from extra corr. names -- How to do it? */
+    /* Q_SSHI - SET_SERVER_HOST_INTERNAL */
     "set_server_host_internal",
     "sshi",
     UPDATE,
@@ -2754,7 +2927,7 @@ struct query Queries2[] = {
     "serverhosts SET override = %s, success = %s, inprogress = %s, hosterror = %s, hosterrmsg = '%s', ltt = %s, lts = %s",
     sshi_fields,
     7,
-    "s.service = uppercase('%s') AND s.mach_id = machine.mach_id AND machine.name = '%s'",
+    "service = uppercase('%s') AND mach_id = %d", 
     2,
     &sshi_validate,
   },
@@ -2781,10 +2954,10 @@ struct query Queries2[] = {
     RETRIEVE,
     "ha",
     "hostaccess",
-    "m.name, ha.acl_type, CHAR(ha.acl_id), CHAR(ha.modtime), CHAR(ha.modby), ha.modwith FROM hostaccess ha, machine m",
+    "CHAR(m.name), ha.acl_type, CHAR(ha.acl_id), CHAR(ha.modtime), CHAR(ha.modby), ha.modwith FROM hostaccess ha, machine m",
     gsha_fields,
     6,
-    "m.name = uppercase('%s') AND ha.mach_id = m.mach_id",
+    "m.name LIKE '%s' ESCAPE '*' AND ha.mach_id = m.mach_id",
     1,
     &gsha_validate,
   },
@@ -2841,12 +3014,12 @@ struct query Queries2[] = {
     RETRIEVE,
     "sh",
     "serverhosts",
-    "sh.service, m.name FROM serverhosts sh, machine m",
+    "CHAR(sh.service), CHAR(m.name) FROM serverhosts sh, machine m",
     gslo_fields,
     2,
-    "sh.service = uppercase('%s') AND sh.mach_id = m.mach_id",
+    "sh.service LIKE '%s' ESCAPE '*' AND sh.mach_id = m.mach_id",
     1,
-    0,
+    &VDupwild0,
   },
 
   {
@@ -2856,12 +3029,12 @@ struct query Queries2[] = {
     RETRIEVE,
     "fs",
     FILESYS,
-    "fs.label, fs.type, m.name, fs.name, fs.mount, fs.access, fs.comments, u.login, l.name, CHAR(fs.createflg), fs.lockertype, CHAR(fs.modtime), CHAR(fs.modby), fs.modwith FROM filesys fs, machine m, users u, list l",
+    "CHAR(fs.label), fs.type, CHAR(m.name), fs.name, fs.mount, fs.access, fs.comments, CHAR(u.login), CHAR(l.name), CHAR(fs.createflg), fs.lockertype, CHAR(fs.modtime), CHAR(fs.modby), fs.modwith FROM filesys fs, machine m, users u, list l",
     gfsl_fields,
     14,
-    "fs.label = '%s' AND fs.mach_id = m.mach_id AND fs.owner = u.users_id AND fs.owners = l.list_id",
+    "fs.label LIKE '%s' ESCAPE '*' AND fs.mach_id = m.mach_id AND fs.owner = u.users_id AND fs.owners = l.list_id",
     1,
-    &VDsortf,
+    &VDwildsortf,
   },
 
   {
@@ -2871,7 +3044,7 @@ struct query Queries2[] = {
     RETRIEVE,
     "fs",
     FILESYS,
-    "fs.label, fs.type, m.name, fs.name, fs.mount, fs.access, fs.comments, u.login, l.name, CHAR(fs.createflg), fs.lockertype, CHAR(fs.modtime), CHAR(fs.modby), fs.modwith FROM filesys fs, machine m, users u, list l",
+    "CHAR(fs.label), fs.type, CHAR(m.name), fs.name, fs.mount, fs.access, fs.comments, CHAR(u.login), CHAR(l.name), CHAR(fs.createflg), fs.lockertype, CHAR(fs.modtime), CHAR(fs.modby), fs.modwith FROM filesys fs, machine m, users u, list l",
     gfsm_fields,
     14,
     "fs.mach_id = %d AND m.mach_id = fs.mach_id AND fs.owner = u.users_id AND fs.owners = l.list_id",
@@ -2886,12 +3059,12 @@ struct query Queries2[] = {
     RETRIEVE,
     "fs",
     FILESYS,
-    "fs.label, fs.type, m.name, fs.name, fs.mount, fs.access, fs.comments, u.login, l.name, CHAR(fs.createflg), fs.lockertype, CHAR(fs.modtime), CHAR(fs.modby), fs.modwith FROM filesys fs, machine m, users u, list l, nfsphys np",
+    "CHAR(fs.label), fs.type, CHAR(m.name), fs.name, fs.mount, fs.access, fs.comments, CHAR(u.login), CHAR(l.name), CHAR(fs.createflg), fs.lockertype, CHAR(fs.modtime), CHAR(fs.modby), fs.modwith FROM filesys fs, machine m, users u, list l, nfsphys np",
     gfsn_fields,
     14,
-    "fs.mach_id = %d AND m.mach_id = fs.mach_id AND fs.owner = u.users_id AND fs.owners = l.list_id AND np.nfsphys_id = fs.phys_id AND np.dir = '%s' AND fs.type = 'NFS'",
+    "fs.mach_id = %d AND m.mach_id = fs.mach_id AND fs.owner = u.users_id AND fs.owners = l.list_id AND np.nfsphys_id = fs.phys_id AND np.dir LIKE '%s' ESCAPE '*' AND fs.type = 'NFS'", 
     2,
-    &gfsm_validate,
+    &gfsn_validate,
   },
 
   {
@@ -2901,7 +3074,7 @@ struct query Queries2[] = {
     RETRIEVE,
     "fs",
     FILESYS,
-    "fs.label, fs.type, m.name, fs.name, fs.mount, fs.access, fs.comments, u.login, l.name, CHAR(fs.createflg), fs.lockertype, CHAR(fs.modtime), CHAR(fs.modby), fs.modwith FROM filesys fs, machine m, users u, list l",
+    "CHAR(fs.label), fs.type, CHAR(m.name), fs.name, fs.mount, fs.access, fs.comments, CHAR(u.login), CHAR(l.name), CHAR(fs.createflg), fs.lockertype, CHAR(fs.modtime), CHAR(fs.modby), fs.modwith FROM filesys fs, machine m, users u, list l",
     gfsg_fields,
     14,
     "fs.owners = %d AND m.mach_id = fs.mach_id AND fs.owner = u.users_id AND fs.owners = l.list_id",
@@ -2955,13 +3128,13 @@ struct query Queries2[] = {
   },
 
   {
-    /* Q_GFGM - GET_FSGROUOP_MEMBERS */ 
+    /* Q_GFGM - GET_FSGROUP_MEMBERS */ 
     "get_fsgroup_members",
     "gfgm",
     RETRIEVE,
     "fg",
     "fsgroup",
-    "fs.label, fg.key FROM fsgroup fg, filesys fs",
+    "CHAR(fs.label), fg.key FROM fsgroup fg, filesys fs",
     gfgm_fields,
     2,
     "fg.group_id = %d AND fs.filsys_id = fg.filsys_id",
@@ -2976,10 +3149,10 @@ struct query Queries2[] = {
     APPEND,
     "fg",
     "fsgroup",
-    "INTO fsgroup (group_id,filsys_id,key) VALUES (filesys.filsys_id, %d, '%s')",
+    "INTO fsgroup (group_id,filsys_id,key) VALUES (%d, %d, '%s')",
     gfgm_fields,
     2,
-    "filesys.filsys_id = %d AND filesys.type = 'FSGROUP'",
+    (char *)0,
     1,
     &aftg_validate,
   },
@@ -3006,7 +3179,7 @@ struct query Queries2[] = {
     RETRIEVE,
     "np",
     "nfsphys",
-    "m.name, np.dir, np.device, CHAR(np.status), CHAR(np.allocated), CHAR(np.size), CHAR(np.modtime), CHAR(np.modby), np.modwith FROM nfsphys np, machine m",
+    "CHAR(m.name), CHAR(np.dir), np.device, CHAR(np.status), CHAR(np.allocated), CHAR(np.partsize), CHAR(np.modtime), CHAR(np.modby), np.modwith FROM nfsphys np, machine m",
     ganf_fields,
     9,
     "m.mach_id = np.mach_id",
@@ -3021,10 +3194,10 @@ struct query Queries2[] = {
     RETRIEVE,
     "np",
     "nfsphys",
-    "m.name, np.dir, np.device, CHAR(np.status), CHAR(np.allocated), CHAR(np.size), CHAR(np.modtime), CHAR(np.modby), np.modwith FROM nfsphys np, machine m",
+    "CHAR(m.name), CHAR(np.dir), np.device, CHAR(np.status), CHAR(np.allocated), CHAR(np.partsize), CHAR(np.modtime), CHAR(np.modby), np.modwith FROM nfsphys np, machine m",
     gnfp_fields,
     9,
-    "np.mach_id = %d AND np.dir = '%s' AND m.mach_id = np.mach_id",
+    "np.mach_id = %d AND np.dir LIKE '%s' ESCAPE '*' AND m.mach_id = np.mach_id", 
     2,
     &gnfp_validate,
   },
@@ -3036,7 +3209,7 @@ struct query Queries2[] = {
     APPEND,
     "np",
     "nfsphys",
-    "INTO nfsphys (mach_id, dir, device, status, allocated, size, nfsphys_id) VALUES (%d, '%s', '%s', %s, %s, %s, %s)",
+    "INTO nfsphys (mach_id, dir, device, status, allocated, partsize, nfsphys_id) VALUES (%d, '%s', '%s', %s, %s, %s, %s)",
     ganf_fields,
     6,
     0,
@@ -3051,10 +3224,10 @@ struct query Queries2[] = {
     UPDATE,
     "np",
     "nfsphys",
-    "nfsphys SET device = '%s', status = '%s', allocated = %s, size = %s",
+    "nfsphys SET device = '%s', status = '%s', allocated = %s, partsize = %s",
     gnfp_fields,
     4,
-    "mach_id = %d AND dir = '%s'",
+    "mach_id = %d AND dir = '%s'", 
     2,
     &unfp_validate,
   },
@@ -3067,7 +3240,7 @@ struct query Queries2[] = {
     "np",
     "nfsphys",
     "nfsphys SET allocated = allocated + %s",
-    dnfp_fields,
+    ajnf_fields,
     1,
     "mach_id = %d AND dir = '%s'",
     2,
@@ -3096,10 +3269,10 @@ struct query Queries2[] = {
     RETRIEVE,
     "q",
     QUOTA,
-    "fs.label, q.type, CHAR(q.entity_id), CHAR(q.quota), CHAR(q.phys_id), m.name, CHAR(q.modtime), CHAR(q.modby), q.modwith FROM quota q, filesys fs, machine m",
+    "CHAR(fs.label), q.type, CHAR(q.entity_id), CHAR(q.quota), CHAR(q.phys_id), CHAR(m.name), CHAR(q.modtime), CHAR(q.modby), q.modwith FROM quota q, filesys fs, machine m",
     gqot_fields,
     9,
-    "fs.label = '%s' AND q.type = '%s' AND q.entity_id = %d AND fs.filsys_id = q.filsys_id AND m.mach_id = fs.mach_id",
+    "fs.label LIKE '%s' ESCAPE '*' AND q.type = '%s' AND q.entity_id = %d AND fs.filsys_id = q.filsys_id AND m.mach_id = fs.mach_id",
     3,
     &gqot_validate,
   },
@@ -3111,25 +3284,25 @@ struct query Queries2[] = {
     RETRIEVE,
     "q",
     QUOTA,
-    "fs.label, q.type, CHAR(q.entity_id), CHAR(q.quota), CHAR(q.phys_id), m.name, CHAR(q.modtime), CHAR(q.modby), q.modwith FROM quota q, filesys fs, machine m",
+    "CHAR(fs.label), q.type, CHAR(q.entity_id), CHAR(q.quota), CHAR(q.phys_id), CHAR(m.name), CHAR(q.modtime), CHAR(q.modby), q.modwith FROM quota q, filesys fs, machine m",
     gqbf_fields,
     9,
-    "fs.label = '%s' AND fs.filsys_id = q.filsys_id AND m.mach_id = fs.mach_id",
+    "fs.label LIKE '%s' ESCAPE '*' AND fs.filsys_id = q.filsys_id AND m.mach_id = fs.mach_id",
     1,
     &gqbf_validate,
   },
 
   {
-    /* Q_AQOT - ADD_QUOTA */ /** Needs subselect */
+    /* Q_AQOT - ADD_QUOTA */ /* prefetch_filsys() gets last 2 values */
     "add_quota",
     "aqot",
     APPEND,
     "q",
     QUOTA,
-    "INTO quota (filsys_id, type, entity_id, quota, phys_id) VALUES (filesys.filsys_id, '%s', %d, %s, filesys.phys_id)",
+    "INTO quota (type, entity_id, quota, filsys_id, phys_id) VALUES (filesys.filsys_id, '%s', %d, %s, %s, %s)",
     aqot_fields,
     3,
-    "filesys.filsys_id = %d",
+    (char *)0,
     1,
     &aqot_validate,
   },
@@ -3171,10 +3344,10 @@ struct query Queries2[] = {
     RETRIEVE,
     "q",
     QUOTA,
-    "fs.label, u.login, CHAR(q.quota), CHAR(q.phys_id), m.name, CHAR(q.modtime), CHAR(q.modby), q.modwith FROM quota q, filesys fs, users u, machine m",
+    "CHAR(fs.label), CHAR(u.login), CHAR(q.quota), CHAR(q.phys_id), CHAR(m.name), CHAR(q.modtime), CHAR(q.modby), q.modwith FROM quota q, filesys fs, users u, machine m",
     gnfq_fields,
     8,
-    "fs.label = '%s' AND q.type = 'USER' AND q.entity_id = u.users_id AND fs.filsys_id = q.filsys_id AND m.mach_id = fs.mach_id AND u.login = '%s'",
+    "fs.label LIKE '%s' ESCAPE '*' AND q.type = 'USER' AND q.entity_id = u.users_id AND fs.filsys_id = q.filsys_id AND m.mach_id = fs.mach_id AND u.login = '%s'",
     2,
     &gnfq_validate,
   },
@@ -3186,25 +3359,25 @@ struct query Queries2[] = {
     RETRIEVE,
     "q",
     QUOTA,
-    "fs.label, u.login, CHAR(q.quota), np.dir, m.name FROM quota q, filesys fs, users u, nfsphys np, machine m",
+    "CHAR(fs.label), CHAR(u.login), CHAR(q.quota), CHAR(np.dir), CHAR(m.name) FROM quota q, filesys fs, users u, nfsphys np, machine m",
     gnqp_fields,
     5,
-    "np.mach_id = %d AND np.dir = '%s' AND q.phys_id = np.nfsphys_id AND fs.filsys_id = q.filsys_id AND q.type = 'USER' AND u.users_id = q.entity_id AND m.mach_id = np.mach_id",
+    "np.mach_id = %d AND np.dir LIKE '%s' ESCAPE '*' AND q.phys_id = np.nfsphys_id AND fs.filsys_id = q.filsys_id AND q.type = 'USER' AND u.users_id = q.entity_id AND m.mach_id = np.mach_id",
     2,
-    &VDmach,
+    &gnqp_validate,
   },
 
   {
-    /* Q_ANFQ - ADD_NFS_QUOTA */ /** Needs subselect */
+    /* Q_ANFQ - ADD_NFS_QUOTA */ /* prefetch_filsys() gets last 2 values */
     "add_nfs_quota",
     "anfq",
     APPEND,
     "q",
     QUOTA,
-    "INTO quota (filsys_id, type, entity_id, quota, phys_id) VALUES (filesys.filsys_id, 'USER', %d, %s, filesys.phys_id)",
+    "INTO quota (type, entity_id, quota, filsys_id, phys_id) VALUES ('USER', %d, %s, %s, %s)",
     anfq_fields,
     2,
-    "filesys.filsys_id = %d",
+    (char *)0,
     1,
     &anfq_validate,
   },
@@ -3250,8 +3423,8 @@ struct query Queries2[] = {
     glin_fields,
     13,
     0,
-    1,
-    &glin_validate,
+    1,              
+    &glin_validate, 
   },
     
   {
@@ -3261,12 +3434,12 @@ struct query Queries2[] = {
     RETRIEVE,
     "l",
     LIST,
-    "l.name FROM list l",
+    "CHAR(name) FROM list",
     glin_fields,
     1,
-    "l.name = '%s' AND l.list_id != 0",
+    "name LIKE '%s' ESCAPE '*' AND list_id != 0",
     1,
-    0
+    &VDwild0,
   },
     
   {
@@ -3294,7 +3467,7 @@ struct query Queries2[] = {
     "list SET name='%s', active=%s, publicflg=%s, hidden=%s, maillist=%s, grouplist=%s, gid=%s, acl_type='%s', acl_id=%d, description='%s'",
     ulis_fields,
     10,
-    "list.list_id = %d",
+    "list_id = %d",
     1,
     &ulis_validate,
   },
@@ -3383,7 +3556,7 @@ struct query Queries2[] = {
     "imembers",
     (char *)0,
     gmol_fields,
-    0,
+    2,
     (char *)0,
     1,
     &gmol_validate,
@@ -3426,10 +3599,10 @@ struct query Queries2[] = {
     RETRIEVE,
     "z",
     "zephyr",
-    "class, xmt_type, CHAR(xmt_id),sub_type, CHAR(sub_id),iws_type, CHAR(iws_id),iui_type, CHAR(iui_id), CHAR(modtime), CHAR(modby), modwith FROM zephyr",
+    "CHAR(class), xmt_type, CHAR(xmt_id),sub_type, CHAR(sub_id),iws_type, CHAR(iws_id),iui_type, CHAR(iui_id), CHAR(modtime), CHAR(modby), modwith FROM zephyr",
     gzcl_fields,
     12,
-    "class = '%s'",
+    "class LIKE '%s' ESCAPE '*'",
     1,
     &gzcl_validate,
   },    
@@ -3486,12 +3659,12 @@ struct query Queries2[] = {
     RETRIEVE,
     "s",
     "services",
-    "name, protocol, CHAR(port), description, CHAR(modtime), CHAR(modby), modwith FROM services",
+    "CHAR(name), protocol, CHAR(port), description, CHAR(modtime), CHAR(modby), modwith FROM services",
     gsvc_fields,
     7,
-    "name = '%s'",
+    "name LIKE '%s' ESCAPE '*'",
     1,
-    &VDsortf,
+    &VDwildsortf,
   },
 
   {
@@ -3531,10 +3704,10 @@ struct query Queries2[] = {
     RETRIEVE,
     "p",
     "printcap",
-    "p.name, m.name, p.dir, p.rp, CHAR(p.quotaserver), CHAR(p.auth), CHAR(p.price), p.comments, CHAR(p.modtime), CHAR(p.modby), p.modwith FROM printcap p, machine m",
+    "CHAR(p.name), CHAR(m.name), p.dir, p.rp, CHAR(p.quotaserver), CHAR(p.auth), CHAR(p.price), p.comments, CHAR(p.modtime), CHAR(p.modby), p.modwith FROM printcap p, machine m",
     gpce_fields,
     11,
-    "p.name = '%s' AND m.mach_id = p.mach_id",
+    "p.name LIKE '%s' ESCAPE '*' AND m.mach_id = p.mach_id",
     1,
     &gpce_validate,
   },
@@ -3576,12 +3749,12 @@ struct query Queries2[] = {
     RETRIEVE,
     "p",
     "printcap",
-    "p.name, m.name, p.dir, p.rp, p.comments, CHAR(p.modtime), CHAR(p.modby), p.modwith FROM printcap p, machine m",
+    "CHAR(p.name), CHAR(m.name), p.dir, p.rp, p.comments, CHAR(p.modtime), CHAR(p.modby), p.modwith FROM printcap p, machine m",
     gpcp_fields,
     8,
-    "p.name = '%s' AND m.mach_id = p.mach_id",
+    "p.name LIKE '%s' ESCAPE '*' AND m.mach_id = p.mach_id",
     1,
-    &VDsortf,
+    &VDwildsortf,
   },
 
   {
@@ -3606,12 +3779,12 @@ struct query Queries2[] = {
     RETRIEVE,
     "p",
     "palladium",
-    "p.name, CHAR(p.ident), m.name, CHAR(p.modtime), CHAR(p.modby), p.modwith FROM palladium p, machine m",
+    "CHAR(p.name), CHAR(p.ident), CHAR(m.name), CHAR(p.modtime), CHAR(p.modby), p.modwith FROM palladium p, machine m",
     gpdm_fields,
     6,
-    "p.name = '%s' AND m.mach_id = p.mach_id",
+    "p.name LIKE '%s' ESCAPE '*' AND m.mach_id = p.mach_id",
     1,
-    &VDsortf,
+    &VDwildsortf,
   },
 
   {
@@ -3651,12 +3824,12 @@ struct query Queries2[] = {
     RETRIEVE,
     "a",
     "alias",
-    "name, type, trans FROM alias",
+    "CHAR(name), CHAR(type), CHAR(trans) FROM alias",
     gali_fields,
     3,
-    "name = '%s' AND type = '%s' AND trans = '%s'",
+    "name LIKE '%s' ESCAPE '*' AND type LIKE '%s' ESCAPE '*' AND trans LIKE '%s' ESCAPE '*'",
     3,
-    0,
+    &VDwild3sort1,
   },
 
   {
@@ -3684,7 +3857,7 @@ struct query Queries2[] = {
     (char *)0,
     aali_fields,
     0,
-    "name = '%s' AND type = '%s' AND trans = '%s'",
+    "name = '%s' AND type = '%s' AND  trans = '%s'", 
     3,
     &dali_validate,
   },
@@ -3756,7 +3929,7 @@ struct query Queries2[] = {
     RETRIEVE,
     "tbs",
     "tblstats",
-    "tbs.table_name, CHAR(tbs.appends), CHAR(tbs.updates), CHAR(tbs.deletes), CHAR(tbs.modtime) FROM tblstats tbs",
+    "table_name, CHAR(appends), CHAR(updates), CHAR(deletes), CHAR(modtime) FROM tblstats",
     gats_fields,
     5,
     (char *)0,
This page took 0.109269 seconds and 4 git commands to generate.