Changeset: 95bf91908153 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=95bf91908153
Modified Files:
clients/mapiclient/dump.c
Branch: Mar2018
Log Message:
Pointer mismanagement caused empty queries to be sent.
diffs (47 lines):
diff --git a/clients/mapiclient/dump.c b/clients/mapiclient/dump.c
--- a/clients/mapiclient/dump.c
+++ b/clients/mapiclient/dump.c
@@ -1575,7 +1575,7 @@ dump_functions(Mapi mid, stream *toConso
return 1;
}
q = query;
- end_q = q + len;
+ end_q = query + len;
q += snprintf(q, end_q - q, "%s\n", get_compat_clause(mid));
q += snprintf(q, end_q - q,
@@ -1818,6 +1818,7 @@ dump_database(Mapi mid, stream *toConsol
if (!query)
goto bailout;
q = query;
+ end_q = query + query_len;
/* start a transaction for the dump */
if (!describe)
@@ -1888,7 +1889,7 @@ dump_database(Mapi mid, stream *toConsol
mapi_close_handle(hdl);
/* dump schemas */
- q = end_q = query;
+ q = query;
q += snprintf(q, end_q - q, "%s\n", get_compat_clause(mid));
q += snprintf(q, end_q - q, "%s\n", schemas);
if ((hdl = mapi_query(mid, query)) == NULL ||
@@ -1969,7 +1970,7 @@ dump_database(Mapi mid, stream *toConsol
}
/* dump sequences, part 1 */
- q = end_q = query;
+ q = query;
q += snprintf(q, end_q - q, "%s\n", get_compat_clause(mid));
q += snprintf(q, end_q - q, "%s\n", sequences1);
if ((hdl = mapi_query(mid, query)) == NULL || mapi_error(mid))
@@ -2064,7 +2065,7 @@ dump_database(Mapi mid, stream *toConsol
hdl = NULL;
/* dump views, functions, and triggers */
- q = end_q = query;
+ q = query;
q += snprintf(q, end_q - q, "%s\n", get_compat_clause(mid));
q += snprintf(q, end_q - q, "%s\n", views_functions_triggers);
if ((hdl = mapi_query(mid, query)) == NULL ||
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list