int (*action)(int, char *[], void *), void *actarg);
void build_sql_stmt(char *result_buf, char *cmd, char *targetlist,
char *argv[], char *qual);
-char *sqlstrstr(char *str, char *pat);
-void optimize_sql_stmt(char *buf);
SQLDA *mr_alloc_sqlda(void);
void sqlglm(char *, int *, int *);
struct query *q;
int status;
struct validate *v;
- char qual[256];
- char *pqual;
+ char *qual = NULL;
EXEC SQL BEGIN DECLARE SECTION;
char *table;
EXEC SQL END DECLARE SECTION;
/* build "where" clause if needed */
if (q->qual)
- {
- build_qual(q->qual, q->argc, Argv, qual);
- pqual = qual;
- }
- else
- pqual = 0;
+ qual = build_qual(q->qual, q->argc, Argv);
/* if there is a followup routine, then we must save the results */
/* of the first query for use by the followup routine */
if (v && v->post_rtn)
{
sq = sq_create();
- status = do_retrieve(q, pqual, sq_save_args, sq);
+ status = do_retrieve(q, qual, sq_save_args, sq);
if (status != MR_SUCCESS)
{
sq_destroy(sq);
else
{
/* normal retrieve */
- status = do_retrieve(q, pqual, action, actarg);
+ status = do_retrieve(q, qual, action, actarg);
}
if (status != MR_SUCCESS)
break;
/* if q->rvar = NULL, perform post_rtn only */
if (q->rvar)
{
- build_qual(q->qual, q->argc, Argv, qual);
+ qual = build_qual(q->qual, q->argc, Argv);
incremental_before(q->rtable, qual, argv_ro);
status = do_update(q, &Argv[q->argc], qual, action, actarg);
incremental_after(q->rtable, qual, argv_ro);
/* build "where" clause if needed */
if (q->qual)
- {
- build_qual(q->qual, q->argc, Argv, qual);
- pqual = qual;
- }
- else
- pqual = 0;
+ qual = build_qual(q->qual, q->argc, Argv);
/* perform the append */
/* if q->rvar = NULL, perform post_rtn only */
if (q->rvar)
{
incremental_clear_before();
- status = do_append(q, &Argv[q->argc], pqual, action, actarg);
+ status = do_append(q, &Argv[q->argc], qual, action, actarg);
if (status != MR_SUCCESS)
break;
if (v && v->object_id)
{
+ qual = realloc(qual, 15 + strlen(q->rvar) +
+ strlen(Argv[q->argc + q->vcnt]));
sprintf(qual, "%s.%s = %s", q->rvar, v->object_id,
Argv[q->argc + q->vcnt]);
incremental_after(q->rtable, qual, argv_ro);
}
else
- incremental_after(q->rtable, pqual, argv_ro);
+ incremental_after(q->rtable, qual, argv_ro);
table = table_name[q->rtable];
EXEC SQL UPDATE tblstats
/* if q->rvar = NULL, perform post_rtn only */
if (q->rvar)
{
- build_qual(q->qual, q->argc, Argv, qual);
+ qual = build_qual(q->qual, q->argc, Argv);
table = table_name[q->rtable];
incremental_before(q->rtable, qual, argv_ro);
status = do_delete(q, qual, action, actarg);
}
out:
+ free(qual);
+
if (status == MR_SUCCESS && dbms_errno != 0)
{
com_err(whoami, MR_INTERNAL, "Server didn't notice DBMS ERROR %d",
return status;
}
-void build_qual(char *fmt_buf, int argc, char *argv[], char *qual)
+char *build_qual(char *fmt_buf, int argc, char *argv[])
{
- char *res, *fmt;
+ char *res, *result_buf, *fmt, *arg, *like, *p;
+
+ result_buf = xmalloc(2 * (strlen(fmt_buf) + argc * ARGLEN));
+
+ res = result_buf;
+ fmt = fmt_buf;
+
+ like = strstr(fmt, "LIKE");
+ arg = strchr(fmt, '%');
- for (res = qual, fmt = fmt_buf; *fmt; fmt++)
+ /* Look through the format for LIKE expressions and arguments.
+ Substitute in the arguments, simplify the `LIKE's to `='s
+ where possible, and insert ESCAPE clauses where needed */
+
+ while (*fmt)
{
- if (*fmt == '%')
+ if (!like && !arg)
{
- if (*++fmt)
+ /* only plain text remains */
+ strcpy(res, fmt);
+ res = strchr(res, '\0');
+ break;
+ }
+ else if (!like || arg < like)
+ {
+ /* regular arg: copy up to arg, then substitute */
+ strncpy(res, fmt, arg - fmt);
+ res += arg - fmt;
+ if (*++arg)
{
- switch (*fmt)
+ switch (*arg++)
{
- case '%': /* %% -> % */
- *res++ = *fmt;
+ case '%':
+ *res++ = '%';
break;
+
case 's':
- if (*argv[0])
+ p = *argv;
+ /* copy string, doubling single quotes */
+ while (*p)
{
- char *p = *argv;
- while (*p)
- {
- if (*p == '\'')
- *res++ = '\''; /* double the ' */
- *res++ = *p++;
- }
+ if (*p == '\'')
+ *res++ = '\'';
+ *res++ = *p++;
}
argv++;
break;
+
case 'd':
res += sprintf(res, "%d", *(int *)*argv++);
break;
- default: /* Swallow other %? pairs */
- break;
}
}
- else
- break;
+ fmt = arg;
+ arg = strchr(fmt, '%');
+ } else {
+ /* LIKE arg: copy over up to the arg, then copy and convert arg */
+ int escape = 0;
+
+ strncpy(res, fmt, arg - fmt);
+ res += arg - fmt;
+
+ /* copy arg, converting UNIX globs to `SQL voodoo', and noting
+ if we'll need an ESCAPE clause */
+ for (p = *argv++; *p; p++)
+ {
+ switch (*p)
+ {
+ case '*':
+ *res++ = '%';
+ *res++ = '%'; /* need to double for build_sql_stmt */
+ break;
+
+ case '?':
+ *res++ = '_';
+ break;
+
+ case '%':
+ case '_':
+ *res++ = '*';
+ *res++ = *p;
+ if (*p == '%')
+ *res++ = *p;
+ escape = 1;
+ break;
+
+ case '\'':
+ *res++ = '\'';
+ /* fall through */
+
+ default:
+ *res++ = *p;
+ }
+ }
+
+ fmt = arg + 2;
+ if (*fmt == '\'')
+ *res++ = *fmt++;
+
+ if (escape)
+ res += sprintf(res, " ESCAPE '*'");
+
+ arg = strchr(fmt, '%');
+ like = strstr(fmt, "LIKE");
}
- else
- *res++ = *fmt; /* text -> result buffer */
}
+
*res = '\0';
+ result_buf = realloc(result_buf, strlen(result_buf) + 1);
+ return result_buf;
}
/* Build arguement vector, verify query and arguments */
return do_for_all_rows(stmt_buf, q->vcnt, action, actarg);
}
-char *sqlstrstr(char *str, char *pat)
-{
- char *p = pat;
-
- do
- {
- if (*str == '\'') /* Skip over single-quote delimited substrings */
- {
- while (*++str && (*str != '\''))
- ;
- continue;
- }
- if (*str == *p)
- {
- char *s;
- s = str;
- while (*++p && (*++s == *p))
- ;
- if (*p)
- p = pat; /* failed */
- }
- }
- while (*p && *++str);
-
- if (!*str)
- str = NULL;
- return str;
-}
-
-void optimize_sql_stmt(char *buf)
-{
- char *point = buf, *pat, *eopat, *esc1, *esc2, *csr;
-
- for (point = buf; (point = sqlstrstr(point, "LIKE")); point++)
- {
- /* Now pointing to string "LIKE" */
-
- /* Look at next word */
- for (pat = point + 4; *pat == ' '; pat++)
- ;
-
- /* Is it a single-quote delimited string? */
- if (*pat != '\'')
- continue;
-
- /* look for "escape" clause - save escape character */
- /* 1. Find end of pattern */
- for (eopat = pat + 1; 1; eopat++)
- {
- if (*eopat == '\'')
- {
- if (eopat[1] == '\'') /* single-quote is self-escaping */
- eopat++;
- else
- break;
- }
- }
-
- /* 2. Look at next word */
- for (esc1 = eopat; *++esc1 == ' ';)
- ;
-
- /* 3. esc1 = 0 if not "ESCAPE '?'", where the ? may be any character. */
- if (strncmp(esc1, "ESCAPE", 6))
- esc1 = NULL;
-
- if (esc1)
- {
- for (esc2 = esc1 + 6; *esc2 == ' '; esc2++)
- ;
-
- if (*esc2++ != '\'')
- continue; /* Bad SQL syntax. Skip. */
- /* esc2 now points at the escape character itself */
- if (esc2[1] != '\'')
- continue; /* Weird escape string. Skip. */
- }
- else
- esc2 = "\\";
-
- /* Is pattern free from special characters? */
- for (csr = pat; csr < eopat; csr++)
- {
- if ((*csr == '%') || (*csr == '_') || (*csr == *esc2))
- break;
- }
- if (csr != eopat)
- continue; /* Uses pattern matching. Skip. */
-
- /* Optimize the query statement */
- /* 1. Change "LIKE" to " = " */
- memcpy(point, " = ", 4);
-
- /* 2. Change "ESCAPE" to " " */
- if (esc1)
- {
- memset(esc1, ' ', 6);
- /* 3. Change "'*'" to " " */
- /* (Changes '''' to " ") */
- if (esc2)
- memset(esc2 - 1, ' ', (*esc2 == '\'') ? 4 : 3);
- }
- }
-}
-
void build_sql_stmt(char *result_buf, char *cmd, char *targetlist,
char *argv[], char *qual)
{
*res++ = *fmt; /* text -> result buffer */
}
*res = '\0';
-
- optimize_sql_stmt(result_buf);
}
int do_update(struct query *q, char *argv[], char *qual,
* can be shared.
*/
-static struct valobj VOwild0[] = {
- {V_WILD, 0},
-};
-
-static struct valobj VOupwild0[] = {
- {V_UPWILD, 0},
-};
-
-static struct valobj VOwild01[] = {
- {V_WILD, 0},
- {V_WILD, 1},
-};
-
-static struct valobj VOwild012[] = {
- {V_WILD, 0},
- {V_WILD, 1},
- {V_WILD, 2},
-};
-
-
static struct valobj VOuser0[] = {
{V_ID, 0, USERS_TABLE, "login", "users_id", MR_USER},
};
*/
static struct validate VDmach = { VOmach0, 1 };
-static struct validate VDwild0= { VOwild0, 1 };
-static struct validate VDupwild0= { VOupwild0, 1 };
-static struct validate VDwild2 = { VOwild01, 2 };
-static struct validate VDwild3 = { VOwild012, 3 };
+
static struct validate VDfix_modby = {
0,
0,
followup_fix_modby,
};
-static struct validate VDwild_fix_modby = {
- VOwild0,
- 1,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- followup_fix_modby,
-};
-
-static struct validate VDupwild_fix_modby = {
- VOupwild0,
- 1,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- followup_fix_modby,
-};
/* Query data */
static char *galo_fields[] = {
static struct validate gubl_validate =
{
- VOwild0,
- 1,
+ 0,
+ 0,
0,
0,
0,
static struct validate guan_validate =
{
- VOwild01,
- 2,
+ 0,
+ 0,
0,
0,
0,
static struct validate gubn_validate =
{
- VOwild01,
- 2,
+ 0,
+ 0,
0,
0,
0,
"name", "vendor", "model", "os", "location", "contact", "use", "status", "status_change", "network", "address", "ace_type", "ace_name", "admin_comment", "ops_comment", "created", "creator", "inuse", "modby", "modby", "modwith",
};
-static struct valobj ghst_valobj[] = {
- {V_UPWILD, 0},
- {V_UPWILD, 1},
- {V_UPWILD, 2},
- {V_UPWILD, 3},
-};
-
static struct validate ghst_validate = {
- ghst_valobj,
- 4,
+ 0,
+ 0,
0,
0,
0,
"alias", "canonical_hostname"
};
-static struct valobj ghal_valobj[] = {
- {V_UPWILD, 0},
- {V_UPWILD, 1},
-};
-
static struct validate ghal_validate = {
- ghal_valobj,
- 2,
+ 0,
+ 0,
0,
0,
0,
static struct valobj ahal_valobj[] = {
{V_CHAR, 0, HOSTALIAS_TABLE, "name"},
- {V_UPWILD, 0},
{V_ID, 1, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
};
static struct validate ahal_validate = {
ahal_valobj,
- 3,
+ 2,
"name",
"name = '%s'",
1,
};
static struct valobj dhal_valobj[] = {
- {V_UPWILD, 0},
{V_ID, 1, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
};
static struct validate dhal_validate = {
dhal_valobj,
- 2,
+ 1,
"name",
"name = '%s' AND mach_id = %d",
2,
};
static struct validate gsnt_validate = {
- VOupwild0,
- 1,
+ 0,
+ 0,
0,
0,
0,
"machine", "cluster",
};
-static struct valobj gmcm_valobj[] =
-{
- {V_UPWILD, 0},
- {V_WILD, 1},
-};
-
-static struct validate gmcm_validate = { gmcm_valobj, 2 };
-
static struct valobj amtc_valobj[] = /* ADD_MACHINE_TO_CLUSTER */
{ /* DELETE_MACHINE_FROM_CLUSTER */
{V_ID, 0, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
0,
access_vis_list_by_name,
0,
- get_list_info,
+ followup_glin,
};
static char *alis_fields[] = {
static struct validate gsin_validate =
{
- VOupwild0,
- 1,
+ 0,
+ 0,
0,
0,
0,
"value3", "modby", "modby", "modwith",
};
-static struct valobj gshi_valobj[] = {
- { V_UPWILD, 0 },
- { V_UPWILD, 1 },
-};
-
static struct validate gshi_validate = {
- gshi_valobj,
- 2,
+ 0,
+ 0,
0,
0,
0,
"create", "lockertype", "modby", "modby", "modwith",
};
-static struct valobj gfsn_valobj[] =
-{
- {V_ID, 0, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
- {V_WILD, 1},
-};
-
static struct validate gfsn_validate = {
- gfsn_valobj,
- 2,
+ VOmach0,
+ 1,
0,
0,
0,
"machine", "dir", "device", "status", "allocated", "size", "modby", "modby", "modwith",
};
-static struct valobj gnfp_valobj[] = {
- {V_ID, 0, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
- {V_WILD, 1},
-};
-
static struct validate gnfp_validate = {
- gnfp_valobj,
- 2,
+ VOmach0,
+ 1,
0,
0,
0,
};
static struct valobj gqot_valobj[] = {
- {V_WILD, 0},
{V_TYPE, 1, 0, "quota_type", 0, MR_TYPE},
{V_TYPEDATA, 2, 0, 0, 0, MR_ACE},
};
static struct validate gqot_validate = {
gqot_valobj,
- 3,
+ 2,
0,
0,
0,
};
static struct validate gqbf_validate = {
- VOwild0,
- 1,
+ 0,
+ 0,
0,
0,
0,
};
static struct validate gnfq_validate = {
- VOwild0,
- 1,
+ 0,
+ 0,
0,
0,
0,
"filesys", "login", "quota", "dir", "machine", "modby", "modby", "modwith",
};
-static struct valobj gnqp_valobj[] = {
- {V_ID, 0, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
- {V_WILD, 1},
-};
-
-static struct validate gnqp_validate = { gnqp_valobj, 2, };
-
static char *anfq_fields[] = {
"filesys", "login", "quota",
};
};
static struct validate gzcl_validate = {
- VOwild0,
- 1,
+ 0,
+ 0,
0,
0,
0,
static struct validate gsha_validate =
{
- VOupwild0,
- 1,
+ 0,
+ 0,
0,
0,
0,
};
static struct validate gpce_validate = {
- VOwild0,
- 1,
+ 0,
+ 0,
0,
0,
0,
"u.login, u.unix_uid, u.shell, u.last, u.first, u.middle, u.status, u.clearid, u.type, str.string, u.signature, u.secure, TO_CHAR(u.modtime, 'DD-mon-YYYY HH24:MI:SS'), u.modby, u.modwith FROM users u, strings str",
gual_fields,
15,
- "u.login LIKE '%s' ESCAPE '*' AND u.users_id != 0 AND u.comments = str.string_id",
+ "u.login LIKE '%s' AND u.users_id != 0 AND u.comments = str.string_id",
1,
"u.login",
&gubl_validate,
"u.login, u.unix_uid, u.shell, u.last, u.first, u.middle, u.status, u.clearid, u.type, str.string, u.signature, u.secure, TO_CHAR(u.modtime, 'DD-mon-YYYY HH24:MI:SS'), u.modby, u.modwith FROM users u, strings str",
guan_fields,
15,
- "u.first LIKE '%s' ESCAPE '*' AND u.last LIKE '%s' ESCAPE '*' AND u.users_id != 0 and u.comments = str.string_id",
+ "u.first LIKE '%s' AND u.last LIKE '%s' AND u.users_id != 0 and u.comments = str.string_id",
2,
"u.login",
&guan_validate,
"u.login, u.unix_uid, u.shell, u.last, u.first, u.middle, u.status, u.clearid, u.type, str.string, u.signature, u.secure, TO_CHAR(u.modtime, 'DD-mon-YYYY HH24:MI:SS'), u.modby, u.modwith FROM users u, strings str",
guam_fields,
15,
- "u.clearid LIKE '%s' ESCAPE '*' AND u.users_id != 0 AND u.comments = str.string_id",
+ "u.clearid LIKE '%s' AND u.users_id != 0 AND u.comments = str.string_id",
1,
"u.login",
- &VDwild_fix_modby,
+ &VDfix_modby,
},
{
"u.login, u.unix_uid, u.shell, u.last, u.first, u.middle, u.status, u.clearid, u.type, TO_CHAR(u.modtime, 'DD-mon-YYYY HH24:MI:SS'), u.modby, u.modwith FROM users u",
gubl_fields,
12,
- "u.login LIKE '%s' ESCAPE '*' AND u.users_id != 0",
+ "u.login LIKE '%s' AND u.users_id != 0",
1,
"u.login",
&gubl_validate,
"u.login, u.unix_uid, u.shell, u.last, u.first, u.middle, u.status, u.clearid, u.type, TO_CHAR(u.modtime, 'DD-mon-YYYY HH24:MI:SS'), u.modby, u.modwith FROM users u",
gubn_fields,
12,
- "u.first LIKE '%s' ESCAPE '*' AND u.last LIKE '%s' ESCAPE '*' AND u.users_id != 0",
+ "u.first LIKE '%s' AND u.last LIKE '%s' AND u.users_id != 0",
2,
"u.login",
&gubn_validate,
"u.login, u.unix_uid, u.shell, u.last, u.first, u.middle, u.status, u.clearid, u.type, TO_CHAR(u.modtime, 'DD-mon-YYYY HH24:MI:SS'), u.modby, u.modwith FROM users u",
gubm_fields,
12,
- "u.clearid LIKE '%s' ESCAPE '*' AND u.users_id != 0",
+ "u.clearid LIKE '%s' AND u.users_id != 0",
1,
"u.login",
- &VDwild_fix_modby,
+ &VDfix_modby,
},
{
"u.login, str.string FROM krbmap km, users u, strings str",
gkum_fields,
2,
- "u.login LIKE '%s' ESCAPE '*' AND str.string LIKE '%s' ESCAPE '*' AND km.users_id = u.users_id AND km.string_id = str.string_id",
+ "u.login LIKE '%s' AND str.string LIKE '%s' AND km.users_id = u.users_id AND km.string_id = str.string_id",
2,
"u.login, str.string",
- &VDwild2,
+ NULL,
},
{
"m.name, m.vendor, m.model, m.os, m.location, m.contact, m.use, m.status, TO_CHAR(m.statuschange, 'DD-mon-YYYY HH24:MI:SS'), s.name, m.address, m.owner_type, m.owner_id, m.acomment, m.ocomment, TO_CHAR(m.created, 'DD-mon-YYYY HH24:MI:SS'), m.creator, TO_CHAR(m.inuse, 'DD-mon-YYYY HH24:MI:SS'), TO_CHAR(m.modtime, 'DD-mon-YYYY HH24:MI:SS'), m.modby, m.modwith FROM machine m, subnet s",
ghst_fields,
21,
- "m.name LIKE '%s' ESCAPE '*' AND m.address LIKE '%s' ESCAPE '*' AND m.location LIKE '%s' ESCAPE '*' AND s.name LIKE '%s' ESCAPE '*' AND m.mach_id != 0 AND s.snet_id = m.snet_id",
+ "m.name LIKE UPPER('%s') AND m.address LIKE '%s' AND m.location LIKE '%s' AND s.name LIKE UPPER('%s') AND m.mach_id != 0 AND s.snet_id = m.snet_id",
4,
"m.name",
&ghst_validate,
"name, vendor, TO_CHAR(modtime, 'DD-mon-YYYY HH24:MI:SS'), modby, modwith FROM machine",
gmac_fields,
5,
- "name LIKE '%s' ESCAPE '*' AND mach_id != 0",
+ "name LIKE UPPER('%s') AND mach_id != 0",
1,
"name",
- &VDupwild_fix_modby,
+ &VDfix_modby,
},
{
"a.name, m.name FROM hostalias a, machine m",
ghal_fields,
2,
- "m.mach_id = a.mach_id and a.name LIKE '%s' ESCAPE '*' AND m.name LIKE '%s' ESCAPE '*'",
+ "m.mach_id = a.mach_id and a.name LIKE UPPER('%s') AND m.name LIKE UPPER('%s')",
2,
"a.name",
&ghal_validate,
"name, description, saddr, mask, low, high, prefix, owner_type, owner_id, TO_CHAR(modtime, 'DD-mon-YYYY HH24:MI:SS'), modby, modwith FROM subnet",
gsnt_fields,
12,
- "name LIKE '%s' ESCAPE '*' and snet_id != 0",
+ "name LIKE UPPER('%s') and snet_id != 0",
1,
"name",
&gsnt_validate,
"name, description, location, TO_CHAR(modtime, 'DD-mon-YYYY HH24:MI:SS'), modby, modwith FROM clusters",
gclu_fields,
6,
- "name LIKE '%s' ESCAPE '*' AND clu_id != 0",
+ "name LIKE '%s' AND clu_id != 0",
1,
"name",
- &VDwild_fix_modby,
+ &VDfix_modby,
},
{
"m.name, c.name FROM machine m, clusters c, mcmap mcm",
gmcm_fields,
2,
- "m.name LIKE '%s' ESCAPE '*' AND c.name LIKE '%s' ESCAPE '*' AND mcm.clu_id = c.clu_id AND mcm.mach_id = m.mach_id",
+ "m.name LIKE UPPER('%s') AND c.name LIKE '%s' AND mcm.clu_id = c.clu_id AND mcm.mach_id = m.mach_id",
2,
"m.name",
- &gmcm_validate,
+ NULL,
},
{
"c.name, svc.serv_label, svc.serv_cluster FROM svc svc, clusters c",
gcld_fields,
3,
- "c.clu_id = svc.clu_id AND c.name LIKE '%s' ESCAPE '*' AND svc.serv_label LIKE '%s' ESCAPE '*'",
+ "c.clu_id = svc.clu_id AND c.name LIKE '%s' AND svc.serv_label LIKE '%s'",
2,
"c.name, svc.serv_label",
- &VDwild2,
+ NULL,
},
{
"get_list_info",
"glin",
RETRIEVE,
- 0,
+ "l",
LIST_TABLE,
- 0,
+ "name, active, publicflg, hidden, maillist, group, gid, ace_type, ace_name, description, modtime, modby, modwith FROM list",
glin_fields,
13,
- 0,
+ "name LIKE '%s'",
1,
- NULL,
+ "name",
&glin_validate,
},
"name FROM list",
glin_fields,
1,
- "name LIKE '%s' ESCAPE '*' AND list_id != 0",
+ "name LIKE '%s' AND list_id != 0",
1,
"name",
- &VDwild0,
+ NULL,
},
{
"name, update_int, target_file, script, dfgen, dfcheck, type, enable, inprogress, harderror, errmsg, acl_type, acl_id, TO_CHAR(modtime, 'DD-mon-YYYY HH24:MI:SS'), modby, modwith FROM servers",
gsin_fields,
16,
- "name LIKE '%s' ESCAPE '*'",
+ "name LIKE UPPER('%s')",
1,
"name",
&gsin_validate,
"sh.service, m.name, sh.enable, sh.override, sh.success, sh.inprogress, sh.hosterror, sh.hosterrmsg, sh.ltt, sh.lts, sh.value1, sh.value2, sh.value3, TO_CHAR(sh.modtime, 'DD-mon-YYYY HH24:MI:SS'), sh.modby, sh.modwith FROM serverhosts sh, machine m",
gshi_fields,
16,
- "sh.service LIKE '%s' ESCAPE '*' AND m.name LIKE '%s' ESCAPE '*' AND m.mach_id = sh.mach_id",
+ "sh.service LIKE UPPER('%s') AND m.name LIKE UPPER('%s') AND m.mach_id = sh.mach_id",
2,
"sh.service, m.name",
&gshi_validate,
"sh.service, m.name FROM serverhosts sh, machine m",
gslo_fields,
2,
- "sh.service LIKE '%s' ESCAPE '*' AND sh.mach_id = m.mach_id",
+ "sh.service LIKE UPPER('%s') AND sh.mach_id = m.mach_id",
1,
"sh.service, m.name",
- &VDupwild0,
+ NULL,
},
{
"fs.label, fs.type, m.name, fs.name, fs.mount, fs.rwaccess, fs.comments, u.login, l.name, fs.createflg, fs.lockertype, TO_CHAR(fs.modtime, 'DD-mon-YYYY HH24:MI:SS'), fs.modby, fs.modwith FROM filesys fs, machine m, users u, list l",
gfsl_fields,
14,
- "fs.label LIKE '%s' ESCAPE '*' AND fs.mach_id = m.mach_id AND fs.owner = u.users_id AND fs.owners = l.list_id",
+ "fs.label LIKE '%s' AND fs.mach_id = m.mach_id AND fs.owner = u.users_id AND fs.owners = l.list_id",
1,
"fs.label",
- &VDwild_fix_modby,
+ &VDfix_modby,
},
{
"fs.label, fs.type, m.name, fs.name, fs.mount, fs.rwaccess, fs.comments, u.login, l.name, fs.createflg, fs.lockertype, TO_CHAR(fs.modtime, 'DD-mon-YYYY HH24:MI:SS'), 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 LIKE '%s' ESCAPE '*' 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' AND fs.type = 'NFS'",
2,
"fs.label",
&gfsn_validate,
"fs.label, fs.type, m.name, fs.name, fs.mount, fs.rwaccess, fs.comments, u.login, l.name, fs.createflg, fs.lockertype, TO_CHAR(fs.modtime, 'DD-mon-YYYY HH24:MI:SS'), fs.modby, fs.modwith FROM filesys fs, machine m, users u, list l",
gfsp_fields,
14,
- "fs.name LIKE '%s' ESCAPE '*' AND m.mach_id = fs.mach_id AND fs.owner = u.users_id AND fs.owners = list_id",
+ "fs.name LIKE '%s' AND m.mach_id = fs.mach_id AND fs.owner = u.users_id AND fs.owners = list_id",
1,
"fs.label",
- &VDwild_fix_modby,
+ &VDfix_modby,
},
{
"m.name, np.dir, np.device, np.status, np.allocated, np.partsize, TO_CHAR(np.modtime, 'DD-mon-YYYY HH24:MI:SS'), np.modby, np.modwith FROM nfsphys np, machine m",
gnfp_fields,
9,
- "np.mach_id = %d AND np.dir LIKE '%s' ESCAPE '*' AND m.mach_id = np.mach_id",
+ "np.mach_id = %d AND np.dir LIKE '%s' AND m.mach_id = np.mach_id",
2,
"m.name, np.dir",
&gnfp_validate,
"fs.label, q.type, q.entity_id, q.quota, q.phys_id, m.name, TO_CHAR(q.modtime, 'DD-mon-YYYY HH24:MI:SS'), q.modby, q.modwith FROM quota q, filesys fs, machine m",
gqot_fields,
9,
- "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",
+ "fs.label LIKE '%s' AND q.type = '%s' AND q.entity_id = %d AND fs.filsys_id = q.filsys_id AND m.mach_id = fs.mach_id",
3,
NULL,
&gqot_validate,
"fs.label, q.type, q.entity_id, q.quota, q.phys_id, m.name, TO_CHAR(q.modtime, 'DD-mon-YYYY HH24:MI:SS'), q.modby, q.modwith FROM quota q, filesys fs, machine m",
gqbf_fields,
9,
- "fs.label LIKE '%s' ESCAPE '*' AND fs.filsys_id = q.filsys_id AND m.mach_id = fs.mach_id",
+ "fs.label LIKE '%s' AND fs.filsys_id = q.filsys_id AND m.mach_id = fs.mach_id",
1,
"fs.label, q.type",
&gqbf_validate,
"fs.label, u.login, q.quota, q.phys_id, m.name, TO_CHAR(q.modtime, 'DD-mon-YYYY HH24:MI:SS'), q.modby, q.modwith FROM quota q, filesys fs, users u, machine m",
gnfq_fields,
8,
- "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'",
+ "fs.label LIKE '%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'",
2,
"fs.label, u.login",
&gnfq_validate,
"fs.label, u.login, q.quota, np.dir, m.name FROM quota q, filesys fs, users u, nfsphys np, machine m",
gnqp_fields,
5,
- "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",
+ "np.mach_id = %d AND np.dir LIKE '%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",
2,
"fs.label",
- &gnqp_validate,
+ NULL,
},
{
"class, xmt_type, xmt_id, sub_type, sub_id, iws_type, iws_id, iui_type, iui_id, TO_CHAR(modtime, 'DD-mon-YYYY HH24:MI:SS'), modby, modwith FROM zephyr",
gzcl_fields,
12,
- "class LIKE '%s' ESCAPE '*'",
+ "class LIKE '%s'",
1,
"class",
&gzcl_validate,
"m.name, ha.acl_type, ha.acl_id, TO_CHAR(ha.modtime, 'DD-mon-YYYY HH24:MI:SS'), ha.modby, ha.modwith FROM hostaccess ha, machine m",
gsha_fields,
6,
- "m.name LIKE '%s' ESCAPE '*' AND ha.mach_id = m.mach_id",
+ "m.name LIKE UPPER('%s') AND ha.mach_id = m.mach_id",
1,
"m.name",
&gsha_validate,
"name, protocol, port, description, TO_CHAR(modtime, 'DD-mon-YYYY HH24:MI:SS'), modby, modwith FROM services",
gsvc_fields,
7,
- "name LIKE '%s' ESCAPE '*'",
+ "name LIKE '%s'",
1,
"name",
- &VDwild_fix_modby,
+ &VDfix_modby,
},
{
"pc.name, m.name, pc.dir, pc.rp, pc.quotaserver, pc.auth, pc.price, pc.comments, TO_CHAR(pc.modtime, 'DD-mon-YYYY HH24:MI:SS'), pc.modby, pc.modwith FROM printcap pc, machine m",
gpce_fields,
11,
- "pc.name LIKE '%s' ESCAPE '*' AND m.mach_id = pc.mach_id",
+ "pc.name LIKE '%s' AND m.mach_id = pc.mach_id",
1,
"pc.name",
&gpce_validate,
"pc.name, m.name, pc.dir, pc.rp, pc.comments, TO_CHAR(pc.modtime, 'DD-mon-YYYY HH24:MI:SS'), pc.modby, pc.modwith FROM printcap pc, machine m",
gpcp_fields,
8,
- "pc.name LIKE '%s' ESCAPE '*' AND m.mach_id = pc.mach_id",
+ "pc.name LIKE '%s' AND m.mach_id = pc.mach_id",
1,
"pc.name",
- &VDwild_fix_modby,
+ &VDfix_modby,
},
{
"pal.name, pal.identifier, m.name, TO_CHAR(pal.modtime, 'DD-mon-YYYY HH24:MI:SS'), pal.modby, pal.modwith FROM palladium pal, machine m",
gpdm_fields,
6,
- "pal.name LIKE '%s' ESCAPE '*' AND m.mach_id = pal.mach_id",
+ "pal.name LIKE '%s' AND m.mach_id = pal.mach_id",
1,
"pal.name",
- &VDwild_fix_modby,
+ &VDfix_modby,
},
{
"name, type, trans FROM alias",
gali_fields,
3,
- "name LIKE '%s' ESCAPE '*' AND type LIKE '%s' ESCAPE '*' AND trans LIKE '%s' ESCAPE '*'",
+ "name LIKE '%s' AND type LIKE '%s' AND trans LIKE '%s'",
3,
"type, name, trans",
- &VDwild3,
+ NULL,
},
{