Changeset: ea66e5cb6010 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/ea66e5cb6010
Modified Files:
sql/backends/monet5/sql.c
Branch: Dec2025
Log Message:
fixed bat leak, in case of empty update bats (only triggered in prepares as
that does less optimization)
diffs (39 lines):
diff --git a/sql/backends/monet5/sql.c b/sql/backends/monet5/sql.c
--- a/sql/backends/monet5/sql.c
+++ b/sql/backends/monet5/sql.c
@@ -1322,6 +1322,7 @@ mvc_bind_wrap(Client cntxt, MalBlkPtr mb
*bid = id->batCacheid;
*uvl = vl->batCacheid;
} else {
+ BBPunfix(bn->batCacheid);
*bid = e_bat(TYPE_oid);
*uvl = e_bat(c->type.type->localtype);
if (*bid == BID_NIL || *uvl == BID_NIL) {
@@ -1354,8 +1355,7 @@ mvc_bind_wrap(Client cntxt, MalBlkPtr mb
BBPkeepref(bn);
*bid = bn->batCacheid;
}
- }
- else if (upd) { /*unpartitioned access to update bats*/
+ } else if (upd) { /*unpartitioned access to update bats*/
BAT *ui = NULL, *uv = NULL;
if (store->storage_api.bind_updates(m->session->tr, c, &ui,
&uv) == LOG_ERR)
throw(SQL,"sql.bind",SQLSTATE(HY005) "Cannot access the
update columns");
@@ -1365,8 +1365,7 @@ mvc_bind_wrap(Client cntxt, MalBlkPtr mb
BBPkeepref(uv);
*bid = ui->batCacheid;
*uvl = uv->batCacheid;
- }
- else { /*unpartitioned access to base column*/
+ } else { /*unpartitioned access to base column*/
int coltype = getBatType(getArgType(mb, pci, 0));
b = store->storage_api.bind_col(m->session->tr, c, access);
if (b == NULL)
@@ -1675,6 +1674,7 @@ mvc_bind_idxbat_wrap(Client cntxt, MalBl
*bid = id->batCacheid;
*uvl = vl->batCacheid;
} else {
+ BBPunfix(bn->batCacheid);
*bid = e_bat(TYPE_oid);
*uvl =
e_bat((i->type==join_idx)?TYPE_oid:TYPE_lng);
if (*bid == BID_NIL || *uvl == BID_NIL) {
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]