Changeset: 6dc3b5ad6189 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/6dc3b5ad6189
Modified Files:
sql/backends/monet5/dict.c
sql/backends/monet5/for.c
Branch: default
Log Message:
Throw right error message and identation fix
diffs (56 lines):
diff --git a/sql/backends/monet5/dict.c b/sql/backends/monet5/dict.c
--- a/sql/backends/monet5/dict.c
+++ b/sql/backends/monet5/dict.c
@@ -346,7 +346,7 @@ DICTdecompress_(BAT *o, BAT *u)
} else {
BATloop(o, p, q) {
BUN up = op[p];
- if (BUNappend(b, BUNtail(ui, up), false) !=
GDK_SUCCEED) {
+ if (BUNappend(b, BUNtail(ui, up), false) !=
GDK_SUCCEED) {
bat_iterator_end(&oi);
bat_destroy(b);
return NULL;
diff --git a/sql/backends/monet5/for.c b/sql/backends/monet5/for.c
--- a/sql/backends/monet5/for.c
+++ b/sql/backends/monet5/for.c
@@ -59,23 +59,26 @@ FORdecompress(Client cntxt, MalBlkPtr mb
lng minval = *getArgReference_lng(stk, pci, 2);
b = COLnew(o->hseqbase, TYPE_lng, cnt, PERSISTENT);
- if (b) {
- if (o->ttype == TYPE_bte) {
- lng *ov = Tloc(b, 0);
- bte *iv = Tloc(o, 0);
- for(BUN i = 0; i<cnt; i++)
- ov[i] = minval + iv[i];
- } else {
- lng *ov = Tloc(b, 0);
- sht *iv = Tloc(o, 0);
- for(BUN i = 0; i<cnt; i++)
- ov[i] = minval + iv[i];
- }
+ if (!b) {
+ bat_destroy(o);
+ throw(SQL, "for.decompress", SQLSTATE(HY013)
MAL_MALLOC_FAIL);
}
+ if (o->ttype == TYPE_bte) {
+ lng *ov = Tloc(b, 0);
+ bte *iv = Tloc(o, 0);
+ for(BUN i = 0; i<cnt; i++)
+ ov[i] = minval + iv[i];
+ } else {
+ lng *ov = Tloc(b, 0);
+ sht *iv = Tloc(o, 0);
+ for(BUN i = 0; i<cnt; i++)
+ ov[i] = minval + iv[i];
+ }
+ } else {
+ bat_destroy(o);
+ throw(SQL, "for.decompress", SQLSTATE(3F000) "unknown offset
type");
}
bat_destroy(o);
- if (!b)
- throw(SQL, "for.decompress", SQLSTATE(HY013) "unknown offset
type");
BATsetcount(b, cnt);
BATnegateprops(b);
BBPkeepref(*r = b->batCacheid);
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list