Changeset: 9adbe1674a73 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=9adbe1674a73
Added Files:
        sql/test/BugTracker-2016/Tests/ifthenelse-void.Bug-6075.sql
        sql/test/BugTracker-2016/Tests/ifthenelse-void.Bug-6075.stable.err
        sql/test/BugTracker-2016/Tests/ifthenelse-void.Bug-6075.stable.out
Modified Files:
        MonetDB.spec
        gdk/gdk_calc.c
        sql/test/BugTracker-2016/Tests/All
Branch: default
Log Message:

Merge with Dec2016 branch.


diffs (truncated from 335 to 300 lines):

diff --git a/MonetDB.spec b/MonetDB.spec
--- a/MonetDB.spec
+++ b/MonetDB.spec
@@ -361,8 +361,10 @@ Group: Applications/Databases
 Requires: MonetDB5-server%{?_isa} = %{version}-%{release}
 Requires: %{name}-client%{?_isa} = %{version}-%{release}
 Requires: %{name}-client-odbc%{?_isa} = %{version}-%{release}
+%if (0%{?fedora} >= 22)
 Recommends: perl-DBD-monetdb >= 1.0
 Recommends: php-monetdb >= 1.0
+%endif
 Requires: %{name}-SQL-server5%{?_isa} = %{version}-%{release}
 Requires: python-monetdb >= 1.0
 
diff --git a/gdk/gdk_calc.c b/gdk/gdk_calc.c
--- a/gdk/gdk_calc.c
+++ b/gdk/gdk_calc.c
@@ -13092,13 +13092,30 @@ VARcalcbetween(ValPtr ret, const ValReco
                        l += incr2;                                     \
                }                                                       \
        } while (0)
+#define IFTHENELSELOOP_oid()                                           \
+       do {                                                            \
+               for (i = 0; i < cnt; i++) {                             \
+                       if (src[i] == bit_nil) {                        \
+                               ((oid *) dst)[i] = oid_nil;             \
+                               nils++;                                 \
+                       } else if (src[i]) {                            \
+                               ((oid *) dst)[i] = col1 ? ((oid *) col1)[k] : 
seq1; \
+                       } else {                                        \
+                               ((oid *) dst)[i] = col2 ? ((oid *) col2)[k] : 
seq2; \
+                       }                                               \
+                       k += incr1;                                     \
+                       l += incr2;                                     \
+                       seq1 += incr1;                                  \
+                       seq2 += incr2;                                  \
+               }                                                       \
+       } while (0)
 
 static BAT *
 BATcalcifthenelse_intern(BAT *b,
                         const void *col1, int incr1, const char *heap1,
-                        int width1, int nonil1,
+                        int width1, int nonil1, oid seq1,
                         const void *col2, int incr2, const char *heap2,
-                        int width2, int nonil2,
+                        int width2, int nonil2, oid seq2,
                         int tpe)
 {
        BAT *bn;
@@ -13110,9 +13127,15 @@ BATcalcifthenelse_intern(BAT *b,
        const bit *src;
        BUN cnt = b->batCount;
 
-       assert(col2 != NULL);
-
-       bn = COLnew(b->hseqbase, tpe, cnt, TRANSIENT);
+       /* col1 and col2 can only be NULL for void columns */
+       assert(col1 != NULL || ATOMtype(tpe) == TYPE_oid);
+       assert(col2 != NULL || ATOMtype(tpe) == TYPE_oid);
+       assert(col1 != NULL || heap1 == NULL);
+       assert(col2 != NULL || heap2 == NULL);
+       assert(col1 != NULL || incr1 == 1);
+       assert(col2 != NULL || incr2 == 1);
+
+       bn = COLnew(b->hseqbase, ATOMtype(tpe), cnt, TRANSIENT);
        if (bn == NULL)
                return NULL;
 
@@ -13146,38 +13169,42 @@ BATcalcifthenelse_intern(BAT *b,
        } else {
                assert(heap1 == NULL);
                assert(heap2 == NULL);
-               switch (bn->twidth) {
-               case 1:
-                       IFTHENELSELOOP(bte);
-                       break;
-               case 2:
-                       IFTHENELSELOOP(sht);
-                       break;
-               case 4:
-                       IFTHENELSELOOP(int);
-                       break;
-               case 8:
-                       IFTHENELSELOOP(lng);
-                       break;
-#ifdef HAVE_HGE
-               case 16:
-                       IFTHENELSELOOP(hge);
-                       break;
-#endif
-               default:
-                       for (i = 0; i < cnt; i++) {
-                               if (src[i] == bit_nil) {
-                                       p = nil;
-                                       nils++;
-                               } else if (src[i]) {
-                                       p = ((const char *) col1) + k * width1;
-                               } else {
-                                       p = ((const char *) col2) + l * width2;
+               if (ATOMtype(tpe) == TYPE_oid) {
+                       IFTHENELSELOOP_oid();
+               } else {
+                       switch (bn->twidth) {
+                       case 1:
+                               IFTHENELSELOOP(bte);
+                               break;
+                       case 2:
+                               IFTHENELSELOOP(sht);
+                               break;
+                       case 4:
+                               IFTHENELSELOOP(int);
+                               break;
+                       case 8:
+                               IFTHENELSELOOP(lng);
+                               break;
+#ifdef HAVE_HGE
+                       case 16:
+                               IFTHENELSELOOP(hge);
+                               break;
+#endif
+                       default:
+                               for (i = 0; i < cnt; i++) {
+                                       if (src[i] == bit_nil) {
+                                               p = nil;
+                                               nils++;
+                                       } else if (src[i]) {
+                                               p = ((const char *) col1) + k * 
width1;
+                                       } else {
+                                               p = ((const char *) col2) + l * 
width2;
+                                       }
+                                       memcpy(dst, p, bn->twidth);
+                                       dst = (void *) ((char *) dst + 
bn->twidth);
+                                       k += incr1;
+                                       l += incr2;
                                }
-                               memcpy(dst, p, bn->twidth);
-                               dst = (void *) ((char *) dst + bn->twidth);
-                               k += incr1;
-                               l += incr2;
                        }
                }
        }
@@ -13212,8 +13239,8 @@ BATcalcifthenelse(BAT *b, BAT *b1, BAT *
                return NULL;
        }
        return BATcalcifthenelse_intern(b,
-                                       Tloc(b1, 0), 1, b1->tvheap ? 
b1->tvheap->base : NULL, b1->twidth, b1->tnonil,
-                                       Tloc(b2, 0), 1, b2->tvheap ? 
b2->tvheap->base : NULL, b2->twidth, b2->tnonil,
+                                       Tloc(b1, 0), 1, b1->tvheap ? 
b1->tvheap->base : NULL, b1->twidth, b1->tnonil, b1->tseqbase,
+                                       Tloc(b2, 0), 1, b2->tvheap ? 
b2->tvheap->base : NULL, b2->twidth, b2->tnonil, b2->tseqbase,
                                        b1->ttype);
 }
 
@@ -13231,8 +13258,8 @@ BATcalcifthenelsecst(BAT *b, BAT *b1, co
                return NULL;
        }
        return BATcalcifthenelse_intern(b,
-                                       Tloc(b1, 0), 1, b1->tvheap ? 
b1->tvheap->base : NULL, b1->twidth, b1->tnonil,
-                                       VALptr(c2), 0, NULL, 0, !VALisnil(c2),
+                                       Tloc(b1, 0), 1, b1->tvheap ? 
b1->tvheap->base : NULL, b1->twidth, b1->tnonil, b1->tseqbase,
+                                       VALptr(c2), 0, NULL, 0, !VALisnil(c2), 
0,
                                        b1->ttype);
 }
 
@@ -13250,8 +13277,8 @@ BATcalcifthencstelse(BAT *b, const ValRe
                return NULL;
        }
        return BATcalcifthenelse_intern(b,
-                                       VALptr(c1), 0, NULL, 0, !VALisnil(c1),
-                                       Tloc(b2, 0), 1, b2->tvheap ? 
b2->tvheap->base : NULL, b2->twidth, b2->tnonil,
+                                       VALptr(c1), 0, NULL, 0, !VALisnil(c1), 
0,
+                                       Tloc(b2, 0), 1, b2->tvheap ? 
b2->tvheap->base : NULL, b2->twidth, b2->tnonil, b2->tseqbase,
                                        c1->vtype);
 }
 
@@ -13267,8 +13294,8 @@ BATcalcifthencstelsecst(BAT *b, const Va
                return NULL;
        }
        return BATcalcifthenelse_intern(b,
-                                       VALptr(c1), 0, NULL, 0, !VALisnil(c1),
-                                       VALptr(c2), 0, NULL, 0, !VALisnil(c2),
+                                       VALptr(c1), 0, NULL, 0, !VALisnil(c1), 
0,
+                                       VALptr(c2), 0, NULL, 0, !VALisnil(c2), 
0,
                                        c1->vtype);
 }
 
diff --git a/sql/test/BugTracker-2016/Tests/All 
b/sql/test/BugTracker-2016/Tests/All
--- a/sql/test/BugTracker-2016/Tests/All
+++ b/sql/test/BugTracker-2016/Tests/All
@@ -53,3 +53,6 @@ prepare_without_querycache.Bug-4047
 outer_constant_predicate.Bug-4070
 name_conflict_in_union.Bug-6065
 set-negative-querytimeout.Bug-6070
+cast_and_floor.Bug-6071
+union.Bug-6069
+ifthenelse-void.Bug-6075
diff --git a/sql/test/BugTracker-2016/Tests/ifthenelse-void.Bug-6075.sql 
b/sql/test/BugTracker-2016/Tests/ifthenelse-void.Bug-6075.sql
new file mode 100644
--- /dev/null
+++ b/sql/test/BugTracker-2016/Tests/ifthenelse-void.Bug-6075.sql
@@ -0,0 +1,8 @@
+select
+  ref_17.progress as c0,
+  cast(coalesce(ref_17.tag,
+    ref_17.tag) as oid) as c1
+from
+  sys.queue as ref_17
+where false
+limit 156;
diff --git a/sql/test/BugTracker-2016/Tests/ifthenelse-void.Bug-6075.stable.err 
b/sql/test/BugTracker-2016/Tests/ifthenelse-void.Bug-6075.stable.err
new file mode 100644
--- /dev/null
+++ b/sql/test/BugTracker-2016/Tests/ifthenelse-void.Bug-6075.stable.err
@@ -0,0 +1,35 @@
+stderr of test 'ifthenelse-void.Bug-6075` in directory 
'sql/test/BugTracker-2016` itself:
+
+
+# 16:07:09 >  
+# 16:07:09 >  "mserver5" "--debug=10" "--set" "gdk_nr_threads=0" "--set" 
"mapi_open=true" "--set" "mapi_port=32132" "--set" 
"mapi_usock=/var/tmp/mtest-28251/.s.monetdb.32132" "--set" "monet_prompt=" 
"--forcemito" 
"--dbpath=/ufs/sjoerd/Monet-stable/var/MonetDB/mTests_sql_test_BugTracker-2016" 
"--set" "embedded_r=yes"
+# 16:07:09 >  
+
+# builtin opt  gdk_dbpath = /ufs/sjoerd/Monet-stable/var/monetdb5/dbfarm/demo
+# builtin opt  gdk_debug = 0
+# builtin opt  gdk_vmtrim = no
+# builtin opt  monet_prompt = >
+# builtin opt  monet_daemon = no
+# builtin opt  mapi_port = 50000
+# builtin opt  mapi_open = false
+# builtin opt  mapi_autosense = false
+# builtin opt  sql_optimizer = default_pipe
+# builtin opt  sql_debug = 0
+# cmdline opt  gdk_nr_threads = 0
+# cmdline opt  mapi_open = true
+# cmdline opt  mapi_port = 32132
+# cmdline opt  mapi_usock = /var/tmp/mtest-28251/.s.monetdb.32132
+# cmdline opt  monet_prompt = 
+# cmdline opt  gdk_dbpath = 
/ufs/sjoerd/Monet-stable/var/MonetDB/mTests_sql_test_BugTracker-2016
+# cmdline opt  embedded_r = yes
+# cmdline opt  gdk_debug = 536870922
+
+# 16:07:10 >  
+# 16:07:10 >  "mclient" "-lsql" "-ftest" "-Eutf-8" "-i" "-e" 
"--host=/var/tmp/mtest-28251" "--port=32132"
+# 16:07:10 >  
+
+
+# 16:07:10 >  
+# 16:07:10 >  "Done."
+# 16:07:10 >  
+
diff --git a/sql/test/BugTracker-2016/Tests/ifthenelse-void.Bug-6075.stable.out 
b/sql/test/BugTracker-2016/Tests/ifthenelse-void.Bug-6075.stable.out
new file mode 100644
--- /dev/null
+++ b/sql/test/BugTracker-2016/Tests/ifthenelse-void.Bug-6075.stable.out
@@ -0,0 +1,80 @@
+stdout of test 'ifthenelse-void.Bug-6075` in directory 
'sql/test/BugTracker-2016` itself:
+
+
+# 16:07:09 >  
+# 16:07:09 >  "mserver5" "--debug=10" "--set" "gdk_nr_threads=0" "--set" 
"mapi_open=true" "--set" "mapi_port=32132" "--set" 
"mapi_usock=/var/tmp/mtest-28251/.s.monetdb.32132" "--set" "monet_prompt=" 
"--forcemito" 
"--dbpath=/ufs/sjoerd/Monet-stable/var/MonetDB/mTests_sql_test_BugTracker-2016" 
"--set" "embedded_r=yes"
+# 16:07:09 >  
+
+# MonetDB 5 server v11.23.14 (hg id: 6843f6bd5843+)
+# This is an unreleased version
+# Serving database 'mTests_sql_test_BugTracker-2016', using 8 threads
+# Compiled for x86_64-unknown-linux-gnu/64bit with 64bit OIDs dynamically 
linked
+# Found 15.589 GiB available main-memory.
+# Copyright (c) 1993-July 2008 CWI.
+# Copyright (c) August 2008-2016 MonetDB B.V., all rights reserved
+# Visit http://www.monetdb.org/ for further information
+# Listening for connection requests on mapi:monetdb://madrid.da.cwi.nl:32132/
+# Listening for UNIX domain connection requests on 
mapi:monetdb:///var/tmp/mtest-28251/.s.monetdb.32132
+# MonetDB/GIS module loaded
+# MonetDB/SQL module loaded
+# MonetDB/R   module loaded
+
+Ready.
+# SQL catalog created, loading sql scripts once
+# loading sql script: 09_like.sql
+# loading sql script: 10_math.sql
+# loading sql script: 11_times.sql
+# loading sql script: 12_url.sql
+# loading sql script: 13_date.sql
+# loading sql script: 14_inet.sql
+# loading sql script: 15_querylog.sql
+# loading sql script: 16_tracelog.sql
+# loading sql script: 17_temporal.sql
+# loading sql script: 20_vacuum.sql
+# loading sql script: 21_dependency_functions.sql
+# loading sql script: 22_clients.sql
+# loading sql script: 23_skyserver.sql
+# loading sql script: 24_zorder.sql
+# loading sql script: 25_debug.sql
+# loading sql script: 26_sysmon.sql
+# loading sql script: 27_rejects.sql
+# loading sql script: 39_analytics.sql
+# loading sql script: 40_geom.sql
+# loading sql script: 40_json.sql
+# loading sql script: 41_md5sum.sql
+# loading sql script: 45_uuid.sql
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to