Changeset: 887d332abe07 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=887d332abe07
Modified Files:
        bootstrap
        gdk/gdk_group.c
        sql/test/emptydb-upgrade-chain-hge/Tests/check.stable.out.int128
        sql/test/emptydb-upgrade-chain/Tests/check.stable.out
        sql/test/emptydb-upgrade-chain/Tests/check.stable.out.32bit
        sql/test/emptydb-upgrade-chain/Tests/check.stable.out.int128
        sql/test/emptydb-upgrade-hge/Tests/check.stable.out.int128
        sql/test/emptydb-upgrade/Tests/check.stable.out
        sql/test/emptydb-upgrade/Tests/check.stable.out.32bit
        sql/test/emptydb-upgrade/Tests/check.stable.out.int128
        sql/test/emptydb/Tests/check.stable.out
        sql/test/emptydb/Tests/check.stable.out.32bit
        sql/test/emptydb/Tests/check.stable.out.int128
        sql/test/leaks/Tests/check1.stable.out
        sql/test/leaks/Tests/check1.stable.out.int128
        sql/test/leaks/Tests/check2.stable.out
        sql/test/leaks/Tests/check2.stable.out.int128
        sql/test/leaks/Tests/check3.stable.out
        sql/test/leaks/Tests/check3.stable.out.int128
        sql/test/leaks/Tests/check4.stable.out
        sql/test/leaks/Tests/check4.stable.out.int128
        sql/test/leaks/Tests/check5.stable.out
        sql/test/leaks/Tests/check5.stable.out.int128
        tools/merovingian/daemon/forkmserver.c
        tools/merovingian/utils/properties.c
        tools/merovingian/utils/utils.c
        tools/merovingian/utils/utils.h
Branch: Jul2017
Log Message:

Merge with Dec2016 branch.


diffs (truncated from 2272 to 300 lines):

diff --git a/bootstrap b/bootstrap
--- a/bootstrap
+++ b/bootstrap
@@ -14,9 +14,11 @@ PYTHONPATH=${PWD:-$(pwd)}/buildtools/aut
 export PYTHONPATH
 
 # cope with systems where libtool is not GNU libtool, e.g. Darwin
-type -P glibtoolize > /dev/null \
-       && libtoolize=glibtoolize \
-       || libtoolize=libtoolize
+if type -P glibtoolize > /dev/null; then
+    libtoolize=glibtoolize
+else
+    libtoolize=libtoolize
+fi
 
 # cope with systems where aclocal is known as aclocal-1.10 (and
 # automake as automake-1.10), e.g. OpenIndiana
@@ -40,22 +42,26 @@ if [[ -n ${M4DIRS} ]] ; then
        done
 fi
 
-python buildtools/autogen/autogen.py &&
+python buildtools/autogen/autogen.py || exit $?
 (
 # replace the line starting with AC_CONFIG_FILES in configure.ag with
 # the command to substitute the configure results into the .in files,
 # making sure executable files remain executable.
-sed -n '/^AC_CONFIG_FILES/s/.*/AC_CONFIG_FILES([/;1,/^AC_CONFIG_FILES/p' 
configure.ag
-while read f; do [ -x $f.in ] || echo $f; done < acout.in
+sed -n '/^AC_CONFIG_FILES/s/.*/AC_CONFIG_FILES([/;1,/^AC_CONFIG_FILES/p' 
configure.ag || exit $?
+while read f; do
+    [ -x $f.in ] || echo $f
+done < acout.in
 echo '])'
-while read f; do [ -x $f.in ] && echo "AC_CONFIG_FILES([$f], [chmod +x $f])"; 
done < acout.in
+while read f; do
+    [ -x $f.in ] && echo "AC_CONFIG_FILES([$f], [chmod +x $f])"
+done < acout.in
 sed '1,/^AC_CONFIG_FILES/d' configure.ag
-) > configure.ac &&
-$libtoolize -c -f  &&
-aclocal$amv ${_m4_extra_dirs} &&
-autoheader  &&
-automake$amv --add-missing --copy --foreign  &&
-autoconf
+) > configure.ac || exit $?
+$libtoolize -c -f  || exit $?
+aclocal$amv ${_m4_extra_dirs} || exit $?
+autoheader  || exit $?
+automake$amv --add-missing --copy --foreign  || exit $?
+autoconf || exit $?
 if [ -f buildtools/conf/install-sh -a ! -x buildtools/conf/install-sh ]; then
     chmod +x buildtools/conf/install-sh
 fi
diff --git a/gdk/gdk_group.c b/gdk/gdk_group.c
--- a/gdk/gdk_group.c
+++ b/gdk/gdk_group.c
@@ -223,20 +223,21 @@
 #define GRP_use_existing_hash_table(INIT_0,INIT_1,COMP)                        
\
        do {                                                            \
                INIT_0;                                                 \
-               for (r = 0; r < cnt; r++) {                             \
-                       if (cand) {                                     \
-                               p = cand[r] - hseqb + lo;               \
-                       } else {                                        \
-                               p = start + r;                          \
-                       }                                               \
-                       assert(p < end);                                \
-                       INIT_1;                                         \
-                       /* this loop is similar, but not equal, to */   \
-                       /* HASHloop: the difference is that we only */  \
-                       /* consider BUNs smaller than the one we're */  \
-                       /* looking up (p), and that we also consider */ \
-                       /* the input groups */                          \
-                       if (grps) {                                     \
+               if (grps) {                                             \
+                       for (r = 0; r < cnt; r++) {                     \
+                               if (cand) {                             \
+                                       p = cand[r] - hseqb + lo;       \
+                               } else {                                \
+                                       p = start + r;                  \
+                               }                                       \
+                               assert(p < end);                        \
+                               INIT_1;                                 \
+                               /* this loop is similar, but not */     \
+                               /* equal, to HASHloop: the difference */ \
+                               /* is that we only consider BUNs */     \
+                               /* smaller than the one we're looking */ \
+                               /* up (p), and that we also consider */ \
+                               /* the input groups */                  \
                                for (hb = HASHgetlink(hs, p);           \
                                     hb != HASHnil(hs) && hb >= start;  \
                                     hb = HASHgetlink(hs, hb)) {        \
@@ -266,7 +267,24 @@
                                                break;                  \
                                        }                               \
                                }                                       \
-                       } else {                                        \
+                               if (hb == HASHnil(hs) || hb < lo) {     \
+                                       GRPnotfound();                  \
+                               }                                       \
+                       }                                               \
+               } else {                                                \
+                       for (r = 0; r < cnt; r++) {                     \
+                               if (cand) {                             \
+                                       p = cand[r] - hseqb + lo;       \
+                               } else {                                \
+                                       p = start + r;                  \
+                               }                                       \
+                               assert(p < end);                        \
+                               INIT_1;                                 \
+                               /* this loop is similar, but not */     \
+                               /* equal, to HASHloop: the difference */ \
+                               /* is that we only consider BUNs */     \
+                               /* smaller than the one we're looking */ \
+                               /* up (p) */                            \
                                for (hb = HASHgetlink(hs, p);           \
                                     hb != HASHnil(hs) && hb >= start;  \
                                     hb = HASHgetlink(hs, hb)) {        \
@@ -318,16 +336,16 @@
        do {                                                            \
                oid grp;                                                \
                INIT_0;                                                 \
-               for (r = 0; r < cnt; r++) {                             \
-                       if (cand) {                                     \
-                               p = cand[r] - b->hseqbase;              \
-                       } else {                                        \
-                               p = start + r;                          \
-                       }                                               \
-                       assert(p < end);                                \
-                       INIT_1;                                         \
-                       prb = HASH;                                     \
-                       if (gc) {                                       \
+               if (gc) {                                               \
+                       for (r = 0; r < cnt; r++) {                     \
+                               if (cand) {                             \
+                                       p = cand[r] - b->hseqbase;      \
+                               } else {                                \
+                                       p = start + r;                  \
+                               }                                       \
+                               assert(p < end);                        \
+                               INIT_1;                                 \
+                               prb = HASH;                             \
                                for (hb = HASHget(hs, prb);             \
                                     hb != HASHnil(hs) && hb >= start;  \
                                     hb = HASHgetlink(hs, hb)) {        \
@@ -352,7 +370,7 @@
                                                grp = ngrps[hb];        \
                                        }                               \
                                        if (COMP) {                     \
-                                               ngrps[r] = grp;         \
+                                               ngrps[r] = grp;         \
                                                if (histo)              \
                                                        cnts[grp]++;    \
                                                if (gn->tsorted &&      \
@@ -361,8 +379,24 @@
                                                break;                  \
                                        }                               \
                                }                                       \
-                       } else if (grps) {                              \
-                               prb = (prb ^ (BUN) grps[r] << bits) & hs->mask; 
\
+                               if (hb == HASHnil(hs) || hb < start) {  \
+                                       GRPnotfound();                  \
+                                       /* enter new group into hash table */ \
+                                       HASHputlink(hs, p, HASHget(hs, prb)); \
+                                       HASHput(hs, prb, p);            \
+                               }                                       \
+                       }                                               \
+               } else if (grps) {                                      \
+                       for (r = 0; r < cnt; r++) {                     \
+                               if (cand) {                             \
+                                       p = cand[r] - b->hseqbase;      \
+                               } else {                                \
+                                       p = start + r;                  \
+                               }                                       \
+                               assert(p < end);                        \
+                               INIT_1;                                 \
+                               prb = HASH;                             \
+                               prb = (prb ^ (BUN) grps[r] << bits) & hs->mask; 
\
                                for (hb = HASHget(hs, prb);             \
                                     hb != HASHnil(hs) && hb >= start;  \
                                     hb = HASHgetlink(hs, hb)) {        \
@@ -390,7 +424,23 @@
                                                break;                  \
                                        }                               \
                                }                                       \
-                       } else {                                        \
+                               if (hb == HASHnil(hs) || hb < start) {  \
+                                       GRPnotfound();                  \
+                                       /* enter new group into hash table */ \
+                                       HASHputlink(hs, p, HASHget(hs, prb)); \
+                                       HASHput(hs, prb, p);            \
+                               }                                       \
+                       }                                               \
+               } else {                                                \
+                       for (r = 0; r < cnt; r++) {                     \
+                               if (cand) {                             \
+                                       p = cand[r] - b->hseqbase;      \
+                               } else {                                \
+                                       p = start + r;                  \
+                               }                                       \
+                               assert(p < end);                        \
+                               INIT_1;                                 \
+                               prb = HASH;                             \
                                for (hb = HASHget(hs, prb);             \
                                     hb != HASHnil(hs) && hb >= start;  \
                                     hb = HASHgetlink(hs, hb)) {        \
@@ -405,7 +455,7 @@
                                                grp = ngrps[hb];        \
                                        }                               \
                                        if (COMP) {                     \
-                                               ngrps[r] = grp; \
+                                               ngrps[r] = grp;         \
                                                if (histo)              \
                                                        cnts[grp]++;    \
                                                if (gn->tsorted &&      \
@@ -419,7 +469,7 @@
                                GRPnotfound();                          \
                                /* enter new group into hash table */   \
                                HASHputlink(hs, p, HASHget(hs, prb));   \
-                               HASHput(hs, prb, p);                    \
+                               HASHput(hs, prb, p);                    \
                        }                                               \
                }                                                       \
        } while (0)
@@ -954,22 +1004,15 @@ BATgroup_internal(BAT **groups, BAT **ex
                        break;
                }
        } else {
-               bit gc = g && (g->tsorted || g->trevsorted);
+               bit gc = g && (BATordered(g) || BATordered_rev(g));
                const char *nme;
                size_t nmelen;
                Heap *hp = NULL;
                BUN prb;
-               BUN mask = HASHmask(cnt) >> 3;
-               int bits = 3;
+               BUN mask;
+               int bits;
 
                GDKclrerr();    /* not interested in BAThash errors */
-               /* when combining value and group-id hashes,
-                * we left-shift one of them by half the hash-mask width
-                * to better spread bits and use the entire hash-mask,
-                * and thus reduce collisions */
-               while (mask >>= 1)
-                       bits++;
-               bits /= 2;
 
                /* not sorted, and no pre-existing hash table: we'll
                 * build an incomplete hash table on the fly--also see
@@ -996,8 +1039,17 @@ BATgroup_internal(BAT **groups, BAT **ex
                        mask = 1 << 16;
                        bits = 8;
                } else {
+                       /* when combining value and group-id hashes,
+                        * we left-shift one of them by half the
+                        * hash-mask width to better spread bits and
+                        * use the entire hash-mask, and thus reduce
+                        * collisions */
+                       mask = HASHmask(cnt) >> 3;
+                       bits = 3;
+                       while (mask >>= 1)
+                               bits++;
+                       bits /= 2;
                        mask = HASHmask(cnt);
-                       bits = 0;
                }
                if ((hp = GDKzalloc(sizeof(Heap))) == NULL ||
                    (hp->farmid = BBPselectfarm(TRANSIENT, b->ttype, hashheap)) 
< 0 ||
diff --git a/sql/test/emptydb-upgrade-chain/Tests/check.stable.out.32bit 
b/sql/test/emptydb-upgrade-chain/Tests/check.stable.out.32bit
--- a/sql/test/emptydb-upgrade-chain/Tests/check.stable.out.32bit
+++ b/sql/test/emptydb-upgrade-chain/Tests/check.stable.out.32bit
@@ -336,7 +336,7 @@ Ready.
 \dSf sys."var_samp"
 SYSTEM SCHEMA  bam
 SYSTEM SCHEMA  json
-SYSTEM SCHEMA profiler
+SYSTEM SCHEMA  profiler
 SYSTEM SCHEMA  sys
 SYSTEM SCHEMA  tmp
 SYSTEM TABLE  sys._columns
@@ -364,7 +364,7 @@ SYSTEM TABLE  sys.privilege_codes
 SYSTEM TABLE  sys.privileges
 SYSTEM TABLE  sys.schemas
 SYSTEM TABLE  sys.sequences
-SYSTEM TABLE sys.spatial_ref_sys
+SYSTEM TABLE  sys.spatial_ref_sys
 SYSTEM TABLE  sys.statistics
 SYSTEM TABLE  sys.storagemodelinput
 SYSTEM TABLE  sys.systemfunctions
@@ -374,7 +374,7 @@ SYSTEM TABLE  sys.types
 SYSTEM TABLE  sys.user_role
 SYSTEM VIEW  sys.columns
 SYSTEM VIEW  sys.environment
-SYSTEM VIEW sys.geometry_columns
+SYSTEM VIEW  sys.geometry_columns
 SYSTEM VIEW  sys.optimizers
 SYSTEM VIEW  sys.querylog_calls
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to