summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorkrasimir <krasimir@chalmers.se>2016-05-22 09:19:54 +0000
committerkrasimir <krasimir@chalmers.se>2016-05-22 09:19:54 +0000
commite56b56a57feb0bdbdcbbc3250235a8979dece0a9 (patch)
tree8be1e78a9755b2d07445d75a7bc4cd4c11c5ea85 /src
parentfdf4bd3196030fdc9d5103e7ae961171a4f65bc4 (diff)
bugfix in libsg
Diffstat (limited to 'src')
-rw-r--r--src/runtime/c/sg/sg.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/runtime/c/sg/sg.c b/src/runtime/c/sg/sg.c
index b6c69d7b4..04db5d67f 100644
--- a/src/runtime/c/sg/sg.c
+++ b/src/runtime/c/sg/sg.c
@@ -1841,7 +1841,7 @@ sg_query_triple(SgSG *sg, SgTriple triple, GuExn* err)
rc = open_exprs(sg, 0, false, &tres->ectxt, err);
if (rc != SQLITE_OK)
- goto close;
+ goto close1;
for (int i = 0; i < 3; i++) {
if (gu_variant_is_null(triple[i]))
@@ -1850,9 +1850,10 @@ sg_query_triple(SgSG *sg, SgTriple triple, GuExn* err)
tres->i.mem[i].flags = MEM_Int;
rc = store_expr(sg, &tres->ectxt, triple[i], &tres->i.mem[i].u.i, 0);
if (rc != SQLITE_OK)
- goto close;
+ goto close1;
if (tres->i.mem[i].u.i == 0) {
tres->i.res = 1;
+ tres->i.tctxt.n_cursors = 0; // this is important since the triples are not initialized yet
return tres;
}
}
@@ -1866,8 +1867,9 @@ sg_query_triple(SgSG *sg, SgTriple triple, GuExn* err)
return tres;
close:
- close_exprs(&tres->ectxt);
close_triples(&tres->i.tctxt);
+close1:
+ close_exprs(&tres->ectxt);
if (sg->autoCommit) {
sqlite3BtreeRollback(sg->pBtree, SQLITE_ABORT_ROLLBACK, 0);