Changeset: d97185abc74f for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/d97185abc74f
Modified Files:
monetdb5/modules/mal/pp_hash.c
sql/storage/bat/bat_storage.c
Branch: pp_hashjoin
Log Message:
make sure the elim_doubles returns a value >= 0
diffs (24 lines):
diff --git a/monetdb5/modules/mal/pp_hash.c b/monetdb5/modules/mal/pp_hash.c
--- a/monetdb5/modules/mal/pp_hash.c
+++ b/monetdb5/modules/mal/pp_hash.c
@@ -416,7 +416,7 @@ OAHASHnew(Client cntxt, MalBlkPtr m, Mal
size = *getArgReference_lng(s, p, 2);
}
/* multiply with the magic estimation while avoiding overflow */
- size = size > (BUN_MAX / 1.2 / 2.1)? BUN_MAX : size * 1.2 * 2.1;
+ size = size > ((dbl)BUN_MAX / 1.2 / 2.1)? BUN_MAX : size * 1.2 * 2.1;
if (p->argc == 4) {
bat pid = *getArgReference_bat(s, p, 3);
diff --git a/sql/storage/bat/bat_storage.c b/sql/storage/bat/bat_storage.c
--- a/sql/storage/bat/bat_storage.c
+++ b/sql/storage/bat/bat_storage.c
@@ -2982,7 +2982,7 @@ double_elim_col(sql_trans *tr, sql_colum
if (b && ATOMstorage(b->ttype) == TYPE_str) { /* check double
elimination */
de = GDK_ELIMDOUBLES(b->tvheap);
if (de) {
- BUN bytes = b->tvheap->free - GDK_VAROFFSET;
+ BUN bytes = (b->tvheap->free >= GDK_VAROFFSET)?
b->tvheap->free - GDK_VAROFFSET : 0;
if (bytes > 0)
de = (int)(bytes/b->twidth);
}
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]