Changeset: 37ae94f3028d for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=37ae94f3028d
Modified Files:
clients/mapiclient/dump.c
Branch: Jul2017
Log Message:
Fix dump.
Don't use values from a result if there is the possibility that between
getting the value and using it another query was run.
diffs (39 lines):
diff --git a/clients/mapiclient/dump.c b/clients/mapiclient/dump.c
--- a/clients/mapiclient/dump.c
+++ b/clients/mapiclient/dump.c
@@ -98,6 +98,10 @@ has_hugeint(Mapi mid)
{
MapiHdl hdl;
int ret;
+ static int hashge = -1;
+
+ if (hashge >= 0)
+ return hashge;
if ((hdl = mapi_query(mid,
"SELECT id "
@@ -113,6 +117,7 @@ has_hugeint(Mapi mid)
if (mapi_error(mid))
goto bailout;
mapi_close_handle(hdl);
+ hashge = ret;
return ret;
bailout:
@@ -1388,7 +1393,7 @@ dump_functions(Mapi mid, stream *toConso
MapiHdl hdl;
char *q;
size_t l;
- int hashge = has_hugeint(mid);
+ int hashge;
const char *fid;
if (fname != NULL) {
@@ -1442,6 +1447,7 @@ dump_functions(Mapi mid, stream *toConso
free(q);
if (hdl == NULL || mapi_error(mid))
goto bailout;
+ hashge = has_hugeint(mid);
while (!mnstr_errnr(toConsole) && mapi_fetch_row(hdl) != 0) {
fid = mapi_fetch_field(hdl, 0);
dump_function(mid, toConsole, fid, hashge);
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list