void do_access(client *cl, mr_params req);
void get_motd(client *cl);
-/* Put this in a variable so that we can patch it if necessary */
-int max_row_count = 4096;
-
char *procnames[] = {
"noop",
"auth",
if (cl->done || dbms_errno)
return;
- if (cl->ntuples == max_row_count)
- {
- dbms_errno = mr_errcode = MR_NO_MEM;
- return;
- }
-
if (cl->ntuples == cl->tuplessize - 1)
{
int newsize = (cl->tuplessize + 4) * 2;
client_reply(cl, status);
- if (cl->ntuples >= max_row_count)
- {
- critical_alert("moirad", "attempted query %s with too many rows\n",
- queryname);
- }
-
com_err(whoami, 0, "Query complete.");
}
extern char *whoami;
extern FILE *journal;
+/* Put this in a variable so that we can patch it if necessary */
+int max_row_count = 4096;
+
int mr_verify_query(client *cl, struct query *q, int argc, char *argv_ro[]);
int do_retrieve(struct query *q, char *pqual,
int (*action)(int, char *[], void *), void *actarg);
status = do_retrieve(q, qual, sq_save_args, sq);
if (status != MR_SUCCESS)
{
+ char **argv;
+ int i;
+
+ while (sq_get_data(sq, &argv))
+ {
+ for (i = 0; i < q->vcnt; i++)
+ free(argv[i]);
+ free(argv);
+ }
sq_destroy(sq);
break;
}
mr_sqlda->L[i] = MAX_FIELD_WIDTH;
}
- while (1)
+ while (rowcount < max_row_count)
{
EXEC SQL FETCH curs USING DESCRIPTOR mr_sqlda;
if (sqlca.sqlcode)
if (mr_errcode)
return mr_errcode;
- return (rowcount == 0) ? MR_NO_MATCH : MR_SUCCESS;
+ if (rowcount == max_row_count)
+ {
+ critical_alert("moirad", "attempted query with too many rows");
+ return MR_NO_MEM;
+ }
+ else if (rowcount == 0)
+ return MR_NO_MATCH;
+ else
+ return MR_SUCCESS;
}