Changeset: 6959ef4ae9cb for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=6959ef4ae9cb
Modified Files:
monetdb5/modules/mal/xid.c
Branch: xid
Log Message:
xid.c: avoid double BBPreleaseref() in case of errors
diffs (56 lines):
diff --git a/monetdb5/modules/mal/xid.c b/monetdb5/modules/mal/xid.c
--- a/monetdb5/modules/mal/xid.c
+++ b/monetdb5/modules/mal/xid.c
@@ -227,11 +227,10 @@ XIDcompressCol( Client cntxt, InstrPtr p
clk = GDKusec();
msg = XIDencode(&i,col,p,q);
- if (msg != MAL_SUCCEED)
+ if (msg != MAL_SUCCEED)
return msg;
- if (i+1 > XID_VAL_MAX) {
+ if (i+1 > XID_VAL_MAX)
throw(MAL, "xid.compress", "value too large");
- }
col[0].value = (xid)(i+1); /* keep compression size */
mnstr_printf(cntxt->fdout,"#xid, %d, %s compress, " BUNFMT ","
BUNFMT ", %4.2f clk " LLFMT " usec\n",
getArg(pci,0), s, BATcount(b), i,
i/(BATcount(b)/100.0), GDKusec()-clk);
@@ -358,7 +357,7 @@ XIDdecode(BUN *rtrn, XIDcolumn col, oid
}
static str
-XIDdecompressCol( Client cntxt, InstrPtr pci, BAT *b, COLrec *c, BAT *bn,
COLrec *cn, str s, BUN cap, oid *o )
+XIDdecompressCol( Client cntxt, InstrPtr pci, COLrec *c, BAT *bn, COLrec *cn,
str s, BUN cap, oid *o )
{
BUN cnt = 0, lim;
XIDcolumn col;
@@ -372,11 +371,8 @@ XIDdecompressCol( Client cntxt, InstrPtr
clk = GDKusec();
msg = XIDdecode(&cnt,col,o,lim,cap);
- if (msg != MAL_SUCCEED) {
- BBPreleaseref(b->batCacheid);
- BBPreleaseref(bn->batCacheid);
+ if (msg != MAL_SUCCEED)
return msg;
- }
mnstr_printf(cntxt->fdout,"#xid, %d, %s decompress, " BUNFMT ",
" BUNFMT ", clk " LLFMT " usec\n",
getArg(pci,1), s, lim, cnt, GDKusec()-clk);
@@ -425,14 +421,14 @@ XIDdecompress(Client cntxt, MalBlkPtr mb
}
BATsetcount(bn, 0);
- msg = XIDdecompressCol( cntxt, pci, b, b->H, bn, bn->H, "head", cap,
(oid*)Hloc(bn,BUNfirst(bn)) );
+ msg = XIDdecompressCol( cntxt, pci, b->H, bn, bn->H, "head", cap,
(oid*)Hloc(bn,BUNfirst(bn)) );
if (msg != MAL_SUCCEED) {
BBPreleaseref(b->batCacheid);
BBPreleaseref(bn->batCacheid);
return msg;
}
- msg = XIDdecompressCol( cntxt, pci, b, b->T, bn, bn->T, "tail", cap,
(oid*)Tloc(bn,BUNfirst(bn)) );
+ msg = XIDdecompressCol( cntxt, pci, b->T, bn, bn->T, "tail", cap,
(oid*)Tloc(bn,BUNfirst(bn)) );
if (msg != MAL_SUCCEED) {
BBPreleaseref(b->batCacheid);
BBPreleaseref(bn->batCacheid);
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list