Changeset: 9fd0ea249335 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=9fd0ea249335
Added Files:
sql/backends/monet5/gsl/Tests/gsl00.malC
sql/test/BugTracker-2015/Tests/acidity2-fail.Bug-3635.stable.err
sql/test/BugTracker-2015/Tests/acidity2-fail.Bug-3635.stable.out
sql/test/BugTracker-2015/Tests/inet-ordering.Bug-3660.sql
sql/test/BugTracker-2015/Tests/inet-ordering.Bug-3660.stable.err
sql/test/BugTracker-2015/Tests/inet-ordering.Bug-3660.stable.out
Removed Files:
sql/backends/monet5/gsl/Tests/gsl00.mal
Modified Files:
gdk/gdk_aggr.c
gdk/gdk_atoms.c
gdk/gdk_bat.c
gdk/gdk_batop.c
gdk/gdk_calc.c
gdk/gdk_firstn.c
gdk/gdk_group.c
gdk/gdk_imprints.c
gdk/gdk_join.c
gdk/gdk_private.h
gdk/gdk_qsort.c
gdk/gdk_search.c
gdk/gdk_select.c
gdk/gdk_setop.c
gdk/gdk_ssort_impl.h
gdk/gdk_unique.c
java/src/nl/cwi/monetdb/jdbc/MonetResultSet.java
java/src/nl/cwi/monetdb/jdbc/MonetStatement.java
monetdb5/modules/kernel/aggr.mal.sh
monetdb5/modules/mal/batcalc.c
monetdb5/modules/mal/mal_io.c
monetdb5/modules/mal/manifold.c
sql/backends/monet5/gsl/Tests/gsl00.stable.out
sql/backends/monet5/sql_result.c
sql/storage/bat/bat_storage.c
sql/storage/store.c
sql/test/BugTracker-2015/Tests/All
Branch: default
Log Message:
Merge with Oct2014 branch.
diffs (truncated from 1745 to 300 lines):
diff --git a/gdk/gdk_aggr.c b/gdk/gdk_aggr.c
--- a/gdk/gdk_aggr.c
+++ b/gdk/gdk_aggr.c
@@ -1224,7 +1224,7 @@ BATprod(void *res, int tp, BAT *b, BAT *
GDKerror("BATprod: %s\n", err);
return GDK_FAIL;
}
- switch (ATOMstorage(tp)) {
+ switch (tp) {
case TYPE_bte:
* (bte *) res = nil_if_empty ? bte_nil : (bte) 1;
break;
@@ -1849,11 +1849,8 @@ BATgroupcount(BAT *b, BAT *g, BAT *e, BA
t = b->T->type;
nil = ATOMnilptr(t);
- atomcmp = BATatoms[t].atomCmp;
- if (t != ATOMstorage(t) &&
- ATOMnilptr(ATOMstorage(t)) == nil &&
- BATatoms[ATOMstorage(t)].atomCmp == atomcmp)
- t = ATOMstorage(t);
+ atomcmp = ATOMcompare(t);
+ t = ATOMbasetype(t);
switch (t) {
case TYPE_bte:
AGGR_COUNT(bte);
@@ -2084,11 +2081,8 @@ do_groupmin(oid *restrict oids, BAT *b,
t = b->T->type;
nil = ATOMnilptr(t);
- atomcmp = BATatoms[t].atomCmp;
- if (t != ATOMstorage(t) &&
- ATOMnilptr(ATOMstorage(t)) == nil &&
- BATatoms[ATOMstorage(t)].atomCmp == atomcmp)
- t = ATOMstorage(t);
+ atomcmp = ATOMcompare(t);
+ t = ATOMbasetype(t);
switch (t) {
case TYPE_bte:
AGGR_CMP(bte, LT);
@@ -2213,11 +2207,8 @@ do_groupmax(oid *restrict oids, BAT *b,
t = b->T->type;
nil = ATOMnilptr(t);
- atomcmp = BATatoms[t].atomCmp;
- if (t != ATOMstorage(t) &&
- ATOMnilptr(ATOMstorage(t)) == nil &&
- BATatoms[ATOMstorage(t)].atomCmp == atomcmp)
- t = ATOMstorage(t);
+ atomcmp = ATOMcompare(t);
+ t = ATOMbasetype(t);
switch (t) {
case TYPE_bte:
AGGR_CMP(bte, GT);
@@ -2572,7 +2563,7 @@ BATgroupquantile(BAT *b, BAT *g, BAT *e,
bi = bat_iterator(b);
nil = ATOMnilptr(b->ttype);
- atomcmp = BATatoms[b->ttype].atomCmp;
+ atomcmp = ATOMcompare(b->ttype);
if (g) { /* we have to do this by group */
const oid *restrict grps;
diff --git a/gdk/gdk_atoms.c b/gdk/gdk_atoms.c
--- a/gdk/gdk_atoms.c
+++ b/gdk/gdk_atoms.c
@@ -288,10 +288,7 @@ ATOMheap(int t, Heap *hp, size_t cap)
int
ATOMcmp(int t, const void *l, const void *r)
{
- switch (t != ATOMstorage(t) &&
- ATOMnilptr(t) == ATOMnilptr(ATOMstorage(t)) &&
- ATOMcompare(t) == ATOMcompare(ATOMstorage(t)) ?
- ATOMstorage(t) : t) {
+ switch (ATOMbasetype(t)) {
case TYPE_bte:
return simple_CMP(l, r, bte);
case TYPE_sht:
diff --git a/gdk/gdk_bat.c b/gdk/gdk_bat.c
--- a/gdk/gdk_bat.c
+++ b/gdk/gdk_bat.c
@@ -905,7 +905,7 @@ BATcopy(BAT *b, int ht, int tt, int writ
* the heap as in the source */
bn->batFirst = b->batFirst;
bn->batInserted = b->batInserted;
- } else if (BATatoms[ht].atomFix || BATatoms[tt].atomFix || (ht
&& tt) || ATOMstorage(MAX(ht, tt)) >= TYPE_str) {
+ } else if (BATatoms[ht].atomFix || BATatoms[tt].atomFix || (ht
&& tt) || ATOMextern(MAX(ht, tt))) {
/* case (4): one-by-one BUN insert (really slow) */
BUN p, q, r = BUNfirst(bn);
BATiter bi = bat_iterator(b);
@@ -952,7 +952,7 @@ BATcopy(BAT *b, int ht, int tt, int writ
if (ATOMtype(ht) == ATOMtype(b->htype)) {
ALIGNsetH(bn, b);
} else if (ATOMstorage(ht) == ATOMstorage(b->htype) &&
- BATatoms[ht].atomCmp == BATatoms[b->htype].atomCmp) {
+ ATOMcompare(ht) == ATOMcompare(b->htype)) {
bn->hsorted = b->hsorted;
bn->hrevsorted = b->hrevsorted;
bn->hdense = b->hdense && ATOMtype(bn->htype) == TYPE_oid;
@@ -966,7 +966,7 @@ BATcopy(BAT *b, int ht, int tt, int writ
if (ATOMtype(tt) == ATOMtype(b->ttype)) {
ALIGNsetT(bn, b);
} else if (ATOMstorage(tt) == ATOMstorage(b->ttype) &&
- BATatoms[tt].atomCmp == BATatoms[b->ttype].atomCmp) {
+ ATOMcompare(tt) == ATOMcompare(b->ttype)) {
bn->tsorted = b->tsorted;
bn->trevsorted = b->trevsorted;
bn->tdense = b->tdense && ATOMtype(bn->ttype) == TYPE_oid;
@@ -1780,7 +1780,7 @@ slowfnd(BAT *b, const void *v)
{
BATiter bi = bat_iterator(b);
BUN p, q;
- int (*cmp)(const void *, const void *) = BATatoms[b->ttype].atomCmp;
+ int (*cmp)(const void *, const void *) = ATOMcompare(b->ttype);
BATloop(b, p, q) {
if ((*cmp)(v, BUNtail(bi, p)) == 0)
@@ -1872,8 +1872,8 @@ BUNlocate(BAT *b, const void *x, const v
BATcheck(b, "BUNlocate: BAT parameter required");
BATcheck(x, "BUNlocate: value parameter required");
- hcmp = BATatoms[b->htype].atomCmp;
- tcmp = BATatoms[b->ttype].atomCmp;
+ hcmp = ATOMcompare(b->htype);
+ tcmp = ATOMcompare(b->ttype);
p = BUNfirst(b);
q = BUNlast(b);
if (p == q)
@@ -1976,9 +1976,9 @@ BUNlocate(BAT *b, const void *x, const v
}
/* exploit string double elimination, when present */
- htpe = ATOMstorage(b->htype);
- ttpe = ATOMstorage(b->ttype);
- if (htpe == TYPE_str && GDK_ELIMDOUBLES(b->H->vheap) && b->H->width >
2) {
+ htpe = ATOMbasetype(b->htype);
+ ttpe = ATOMbasetype(b->ttype);
+ if (ATOMstorage(htpe) == TYPE_str && GDK_ELIMDOUBLES(b->H->vheap) &&
b->H->width > 2) {
hidx.v = strLocate(b->H->vheap, x);
if (hidx.v == 0)
return BUN_NONE; /* x does not occur */
@@ -2003,7 +2003,7 @@ BUNlocate(BAT *b, const void *x, const v
}
}
}
- if (ttpe == TYPE_str && GDK_ELIMDOUBLES(b->T->vheap) && b->T->width >
2) {
+ if (ATOMstorage(ttpe) == TYPE_str && GDK_ELIMDOUBLES(b->T->vheap) &&
b->T->width > 2) {
tidx.v = strLocate(b->T->vheap, y);
if (tidx.v == 0)
return BUN_NONE; /* y does not occur */
@@ -2079,7 +2079,7 @@ BUNlocate(BAT *b, const void *x, const v
/* linear check; we get here for small ranges, [bte,bte] bats,
* and hash alloc failure */
- if (ATOMstorage(b->htype) == TYPE_bte && ATOMstorage(b->ttype) ==
TYPE_bte) {
+ if (htpe == TYPE_bte && ttpe == TYPE_bte) {
for (; p < q; p++)
if (*(bte *) BUNhloc(bi, p) == *(bte *) x &&
*(bte *) BUNtloc(bi, p) == *(bte *) y)
@@ -2834,7 +2834,7 @@ BATassertHeadProps(BAT *b)
b->H->vheap == NULL ||
(BBPfarms[b->H->vheap->farmid].roles & (1 << b->batRole)));
- cmpf = BATatoms[b->htype].atomCmp;
+ cmpf = ATOMcompare(b->htype);
nilp = ATOMnilptr(b->htype);
p = BUNfirst(b);
q = BUNlast(b);
@@ -3093,7 +3093,7 @@ BATderiveHeadProps(BAT *b, int expensive
return;
assert((b->hkey & BOUND2BTRUE) == 0);
COLsettrivprop(b, b->H);
- cmpf = BATatoms[b->htype].atomCmp;
+ cmpf = ATOMcompare(b->htype);
nilp = ATOMnilptr(b->htype);
b->batDirtydesc = 1; /* we will be changing things */
if (b->htype == TYPE_void || b->batCount <= 1) {
diff --git a/gdk/gdk_batop.c b/gdk/gdk_batop.c
--- a/gdk/gdk_batop.c
+++ b/gdk/gdk_batop.c
@@ -1898,11 +1898,7 @@ BATcount_no_nil(BAT *b)
if (b->T->nonil)
return n;
p = Tloc(b, b->batFirst);
- t = b->ttype;
- if (t != ATOMstorage(t) &&
- ATOMnilptr(ATOMstorage(t)) == ATOMnilptr(t) &&
- BATatoms[ATOMstorage(t)].atomCmp == BATatoms[t].atomCmp)
- t = ATOMstorage(t);
+ t = ATOMbasetype(b->ttype);
switch (t) {
case TYPE_void:
cnt = b->tseqbase == oid_nil ? 0 : n;
@@ -1962,7 +1958,7 @@ BATcount_no_nil(BAT *b)
break;
default:
nil = ATOMnilptr(t);
- cmp = BATatoms[t].atomCmp;
+ cmp = ATOMcompare(t);
if (b->tvarsized) {
base = b->T->vheap->base;
for (i = 0; i < n; i++)
diff --git a/gdk/gdk_calc.c b/gdk/gdk_calc.c
--- a/gdk/gdk_calc.c
+++ b/gdk/gdk_calc.c
@@ -61,14 +61,6 @@
#define CSTdbl
#define CSToid
-/* The base type is the storage type if the comparison function and
- * nil values are the same as those of the storage type; otherwise it
- * is the type itself. */
-#define BASETYPE(t) ((t) != ATOMstorage(t) && \
- ATOMnilptr(t) == ATOMnilptr(ATOMstorage(t)) && \
- ATOMcompare(t) == ATOMcompare(ATOMstorage(t)) ? \
- ATOMstorage(t) : (t))
-
/* Most of the internal routines return a count of the number of NIL
* values they produced. They indicate an error by returning a value
* >= BUN_NONE. BUN_NONE means that the error was dealt with by
@@ -219,7 +211,7 @@ BATcalcnot(BAT *b, BAT *s)
if (bn == NULL)
return NULL;
- switch (BASETYPE(b->T->type)) {
+ switch (ATOMbasetype(b->T->type)) {
case TYPE_bte:
if (b->T->type == TYPE_bit) {
UNARY_2TYPE_FUNC(bit, bit, NOTBIT);
@@ -274,7 +266,7 @@ int
VARcalcnot(ValPtr ret, const ValRecord *v)
{
ret->vtype = v->vtype;
- switch (BASETYPE(v->vtype)) {
+ switch (ATOMbasetype(v->vtype)) {
case TYPE_bte:
if (v->val.btval == bit_nil)
ret->val.btval = bit_nil;
@@ -339,7 +331,7 @@ BATcalcnegate(BAT *b, BAT *s)
if (bn == NULL)
return NULL;
- switch (BASETYPE(b->T->type)) {
+ switch (ATOMbasetype(b->T->type)) {
case TYPE_bte:
UNARY_2TYPE_FUNC(bte, bte, NEGATE);
break;
@@ -396,7 +388,7 @@ int
VARcalcnegate(ValPtr ret, const ValRecord *v)
{
ret->vtype = v->vtype;
- switch (BASETYPE(v->vtype)) {
+ switch (ATOMbasetype(v->vtype)) {
case TYPE_bte:
if (v->val.btval == bte_nil)
ret->val.btval = bte_nil;
@@ -469,7 +461,7 @@ BATcalcabsolute(BAT *b, BAT *s)
if (bn == NULL)
return NULL;
- switch (BASETYPE(b->T->type)) {
+ switch (ATOMbasetype(b->T->type)) {
case TYPE_bte:
UNARY_2TYPE_FUNC(bte, bte, (bte) abs);
break;
@@ -528,7 +520,7 @@ int
VARcalcabsolute(ValPtr ret, const ValRecord *v)
{
ret->vtype = v->vtype;
- switch (BASETYPE(v->vtype)) {
+ switch (ATOMbasetype(v->vtype)) {
case TYPE_bte:
if (v->val.btval == bte_nil)
ret->val.btval = bte_nil;
@@ -603,7 +595,7 @@ BATcalciszero(BAT *b, BAT *s)
if (bn == NULL)
return NULL;
- switch (BASETYPE(b->T->type)) {
+ switch (ATOMbasetype(b->T->type)) {
case TYPE_bte:
UNARY_2TYPE_FUNC(bte, bit, ISZERO);
break;
@@ -659,7 +651,7 @@ int
VARcalciszero(ValPtr ret, const ValRecord *v)
{
ret->vtype = TYPE_bit;
- switch (BASETYPE(v->vtype)) {
+ switch (ATOMbasetype(v->vtype)) {
case TYPE_bte:
if (v->val.btval == bte_nil)
ret->val.btval = bit_nil;
@@ -735,7 +727,7 @@ BATcalcsign(BAT *b, BAT *s)
if (bn == NULL)
return NULL;
- switch (BASETYPE(b->T->type)) {
+ switch (ATOMbasetype(b->T->type)) {
case TYPE_bte:
UNARY_2TYPE_FUNC(bte, bte, SIGN);
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list