Update of /cvsroot/refdb/refdb/src
In directory sc8-pr-cvs1:/tmp/cvs-serv5596
Modified Files:
refdbdref.c
Log Message:
don't output anything if query returns zero datasets
Index: refdbdref.c
===================================================================
RCS file: /cvsroot/refdb/refdb/src/refdbdref.c,v
retrieving revision 1.49
retrieving revision 1.50
diff -u -U2 -r1.49 -r1.50
--- refdbdref.c 4 Jan 2004 01:58:20 -0000 1.49
+++ refdbdref.c 10 Jan 2004 01:26:39 -0000 1.50
@@ -3823,19 +3823,21 @@
}
- /* create a "footer" if necessary */
- /* fill in variable elements of structure */
- rendinfo.ptr_ref = &sql_command;
- rendinfo.ptr_ref_len = &sql_command_len;
+ if (nref_counter) {
+ /* create a "footer" if necessary */
+ /* fill in variable elements of structure */
+ rendinfo.ptr_ref = &sql_command;
+ rendinfo.ptr_ref_len = &sql_command_len;
- if ((new_sql_command = finish_render(&rendinfo)) == NULL) {
- dbi_result_free(rendinfo.dbires);
- dbi_conn_close(conn);
- delete_all_lilimem(&sentinel);
- return 0;
+ if ((new_sql_command = finish_render(&rendinfo)) == NULL) {
+ dbi_result_free(rendinfo.dbires);
+ dbi_conn_close(conn);
+ delete_all_lilimem(&sentinel);
+ return 0;
+ }
+ else {
+ sql_command = new_sql_command;
+ }
+ iwrite(ptr_clrequest->fd, sql_command, strlen(sql_command));
}
- else {
- sql_command = new_sql_command;
- }
- iwrite(ptr_clrequest->fd, sql_command, strlen(sql_command));
dbi_result_free(rendinfo.dbires);
|