extern void clist_delete(), do_auth(), do_shutdown();
void do_call();
+extern int ingres_errno, mr_errcode;
+static int row_count;
+
+/* Put this in a variable so that we can patch it if necessary */
+int max_row_count = 2048;
/*
* Welcome to the (finite state) machine (highest level).
char *p_cp;
{
register client *cp = (client *)p_cp;
+ mr_params *arg_tmp;
+ returned_tuples *tp;
+ OPERATION op_tmp;
+ register char **nargv;
+ register int i;
+
+ if (row_count++ >= max_row_count) {
+ ingres_errno = mr_errcode = MR_NO_MEM;
+ return;
+ }
+
/*
* This takes too much advantage of the fact that
* serialization of the data happens during the queue operation.
*/
- mr_params *arg_tmp = (mr_params *)db_alloc(sizeof(mr_params));
- returned_tuples *tp = (returned_tuples *)
- db_alloc(sizeof(returned_tuples));
- register char **nargv = (char **)malloc(argc * sizeof(char *));
- register int i;
+ arg_tmp = (mr_params *)db_alloc(sizeof(mr_params));
+ tp = (returned_tuples *)db_alloc(sizeof(returned_tuples));
+ nargv = (char **)malloc(argc * sizeof(char *));
- OPERATION op_tmp = create_operation();
+ op_tmp = create_operation();
if (mr_trim_args(argc, argv) == MR_NO_MEM) {
com_err(whoami, MR_NO_MEM, "while trimming args");
cl->reply.mr_argc = 0;
cl->reply.mr_status = 0;
+ row_count = 0;
queryname = cl->args->mr_argv[0];
retr_callback,
(char *)cl);
}
+ if (row_count >= max_row_count) {
+ critical_alert("moirad", "attempted query %s with %d rows\n",
+ queryname, row_count);
+ }
+
if (log_flags & LOG_RES)
com_err(whoami, 0, "Query complete.");
}
len = read(motd, buffer, sizeof(buffer) - 1);
close(motd);
buffer[len] = 0;
+ row_count = 0;
retr_callback(1, arg, cl);
cl->reply.mr_status = 0;
}