EXEC SQL END DECLARE SECTION;
extern char *whoami;
extern FILE *journal;
+extern int QueryCount, max_version;
+extern struct query Queries[];
/* Put this in a variable so that we can patch it if necessary */
int max_row_count = 4096;
int mr_open_database(void)
{
int i;
- static first_open = 1;
+ static int first_open = 1;
if (first_open)
{
dbms_errno = 0;
mr_errcode = 0;
- q = get_query_by_name(name);
+ q = get_query_by_name(name, cl->version);
if (!q)
return MR_NO_HANDLE;
{
if (argc < 1)
return MR_ARGS;
- q = get_query_by_name(argv_ro[0]);
+ q = get_query_by_name(argv_ro[0], cl->version);
if (!q)
return MR_NO_HANDLE;
help_query(q, action, actarg);
}
/* get query structure, return error if named query does not exist */
- q = get_query_by_name(name);
+ q = get_query_by_name(name, cl->version);
if (!q)
return MR_NO_HANDLE;
v = q->validate;
}
-/* For now this just checks the argc's. It should also see that there
- * are no duplicate names.
- */
-
void sanity_check_queries(void)
{
int i;
int maxv = 0, maxa = 0;
- extern int QueryCount2;
- extern struct query Queries2[];
#define MAX(x, y) ((x) > (y) ? (x) : (y))
- for (i = 0; i < QueryCount2; i++)
+ for (i = 0; i < QueryCount; i++)
{
- maxv = MAX(maxv, Queries2[i].vcnt);
- maxa = MAX(maxa, Queries2[i].argc);
+ maxv = MAX(maxv, Queries[i].vcnt);
+ maxa = MAX(maxa, Queries[i].argc);
+ max_version = MAX(max_version, Queries[i].version);
}
if (MAX(maxv, maxa) > QMAXARGS)
{