Changeset: 1f7a31e8b24c for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/1f7a31e8b24c
Modified Files:
sql/storage/bat/bat_table.c
Branch: Jul2021
Log Message:
More allocation failures and don't forget to unfix update ids
diffs (47 lines):
diff --git a/sql/storage/bat/bat_table.c b/sql/storage/bat/bat_table.c
--- a/sql/storage/bat/bat_table.c
+++ b/sql/storage/bat/bat_table.c
@@ -36,23 +36,32 @@ full_column(sql_trans *tr, sql_column *c
BAT *b = store->storage_api.bind_col(tr, c, RDONLY);
BAT *ui = store->storage_api.bind_col(tr, c, RD_UPD_ID);
+ if (!b || !ui) {
+ bat_destroy(b);
+ bat_destroy(ui);
+ return NULL;
+ }
if (BATcount(ui)) {
- BAT *uv = store->storage_api.bind_col(tr, c, RD_UPD_VAL);
- if (ui && BATcount(ui)) {
- BAT *r = COLcopy(b, b->ttype, true, TRANSIENT);
+ BAT *uv = store->storage_api.bind_col(tr, c, RD_UPD_VAL), *r;
+ if (!uv) {
bat_destroy(b);
- b = r;
- if (!b || !ui || !uv || BATreplace(b, ui, uv, true) !=
GDK_SUCCEED) {
- if (b) BBPunfix(b->batCacheid);
- if (ui) BBPunfix(ui->batCacheid);
- if (uv) BBPunfix(uv->batCacheid);
- return NULL;
- }
+ bat_destroy(ui);
+ return NULL;
}
- bat_destroy(ui);
+
+ r = COLcopy(b, b->ttype, true, TRANSIENT);
+ bat_destroy(b);
+ b = r;
+ if (!b || BATreplace(b, ui, uv, true) != GDK_SUCCEED) {
+ bat_destroy(b);
+ bat_destroy(ui);
+ bat_destroy(uv);
+ return NULL;
+ }
bat_destroy(uv);
}
+ bat_destroy(ui);
return b;
}
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list