Changeset: c9b97d26fbf1 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=c9b97d26fbf1
Added Files:
        
sql/test/BugTracker-2018/Tests/multi-column-hash-wrongly-NIL.Bug-6638.sql
        
sql/test/BugTracker-2018/Tests/multi-column-hash-wrongly-NIL.Bug-6638.stable.err
        
sql/test/BugTracker-2018/Tests/multi-column-hash-wrongly-NIL.Bug-6638.stable.out
Modified Files:
        monetdb5/modules/atoms/json.c
        monetdb5/modules/atoms/mtime.c
        
sql/test/BugTracker-2016/Tests/timestamp_with_tz_fromstr.Bug-4019.stable.err
        
sql/test/BugTracker-2016/Tests/timestamp_with_tz_fromstr.Bug-4019.stable.out
        sql/test/BugTracker-2018/Tests/All
        sql/test/json/Tests/parsing.stable.err
Branch: default
Log Message:

Merge with Aug2018 branch.


diffs (truncated from 1098 to 300 lines):

diff --git a/monetdb5/modules/atoms/json.c b/monetdb5/modules/atoms/json.c
--- a/monetdb5/modules/atoms/json.c
+++ b/monetdb5/modules/atoms/json.c
@@ -800,7 +800,7 @@ JSONtoken(JSON *jt, const char *j, const
                        if (jt->error)
                                return idx;
                        if (jt->elm[nxt].kind != JSON_ELEMENT) {
-                               jt->error = createException(MAL, "json.parser", 
"Syntax error : element expected");
+                               jt->error = createException(MAL, "json.parser", 
"JSON syntax error: element expected");
                                return idx;
                        }
                        JSONappend(jt, idx, nxt);
@@ -811,13 +811,13 @@ JSONtoken(JSON *jt, const char *j, const
                        if (*j == '}')
                                break;
                        if (*j != '}' && *j != ',') {
-                               jt->error = createException(MAL, "json.parser", 
"Syntax error : ','  or '}' expected");
+                               jt->error = createException(MAL, "json.parser", 
"JSON syntax error: ','  or '}' expected");
                                return idx;
                        }
                        j++;
                }
                if (*j != '}') {
-                       jt->error = createException(MAL, "json.parser", "Syntax 
error : '}' expected");
+                       jt->error = createException(MAL, "json.parser", "JSON 
syntax error: '}' expected");
                        return idx;
                } else
                        j++;
@@ -868,18 +868,18 @@ JSONtoken(JSON *jt, const char *j, const
                        if (*j == ']')
                                break;
                        if (jt->elm[nxt].kind == JSON_ELEMENT) {
-                               jt->error = createException(MAL, "json.parser", 
"Syntax error : Array value expected");
+                               jt->error = createException(MAL, "json.parser", 
"JSON syntax error: Array value expected");
                                return idx;
                        }
                        if (*j != ']' && *j != ',') {
-                               jt->error = createException(MAL, "json.parser", 
"Syntax error : ','  or ']' expected");
+                               jt->error = createException(MAL, "json.parser", 
"JSON syntax error: ','  or ']' expected");
                                return idx;
                        }
                        j++;
                        skipblancs(j);
                }
                if (*j != ']') {
-                       jt->error = createException(MAL, "json.parser", "Syntax 
error : ']' expected");
+                       jt->error = createException(MAL, "json.parser", "JSON 
syntax error: ']' expected");
                } else
                        j++;
                *next = j;
@@ -916,7 +916,7 @@ JSONtoken(JSON *jt, const char *j, const
                        jt->elm[idx].valuelen = 4;
                        return idx;
                }
-               jt->error = createException(MAL, "json.parser", "Syntax error: 
NULL expected");
+               jt->error = createException(MAL, "json.parser", "JSON syntax 
error: NULL expected");
                return idx;
        case 't':
                if (strncmp("true", j, 4) == 0) {
@@ -926,7 +926,7 @@ JSONtoken(JSON *jt, const char *j, const
                        jt->elm[idx].valuelen = 4;
                        return idx;
                }
-               jt->error = createException(MAL, "json.parser", "Syntax error: 
True expected");
+               jt->error = createException(MAL, "json.parser", "JSON syntax 
error: True expected");
                return idx;
        case 'f':
                if (strncmp("false", j, 5) == 0) {
@@ -936,7 +936,7 @@ JSONtoken(JSON *jt, const char *j, const
                        jt->elm[idx].valuelen = 5;
                        return idx;
                }
-               jt->error = createException(MAL, "json.parser", "Syntax error: 
False expected");
+               jt->error = createException(MAL, "json.parser", "JSON syntax 
error: False expected");
                return idx;
        default:
                if (*j == '-' || (*j >= '0' && *j <= '9')) {
@@ -948,7 +948,7 @@ JSONtoken(JSON *jt, const char *j, const
                        jt->elm[idx].valuelen = *next - jt->elm[idx].value;
                        return idx;
                }
-               jt->error = createException(MAL, "json.parser", "Syntax error: 
value expected");
+               jt->error = createException(MAL, "json.parser", "JSON syntax 
error: value expected");
                return idx;
        }
 }
@@ -963,7 +963,7 @@ JSONparse(const char *j)
                return NULL;
        skipblancs(j);
        if (!*j || !(*j == '{' || *j == '[')) {
-               jt->error = createException(MAL, "json.parser", "Syntax error: 
json parse failed, expecting '{', '['");
+               jt->error = createException(MAL, "json.parser", "JSON syntax 
error: json parse failed, expecting '{', '['");
                return jt;
        }
        JSONtoken(jt, j, &j);
@@ -971,7 +971,7 @@ JSONparse(const char *j)
                return jt;
        skipblancs(j);
        if (*j)
-               jt->error = createException(MAL, "json.parser", "Syntax error: 
json parse failed");
+               jt->error = createException(MAL, "json.parser", "JSON syntax 
error: json parse failed");
        return jt;
 }
 
diff --git a/monetdb5/modules/atoms/mtime.c b/monetdb5/modules/atoms/mtime.c
--- a/monetdb5/modules/atoms/mtime.c
+++ b/monetdb5/modules/atoms/mtime.c
@@ -249,7 +249,7 @@ static date DATE_MAX, DATE_MIN;             /* ofte
 #define MONTHDAYS(m,y) ((m) != 2 ? LEAPDAYS[m] : leapyear(y) ? 29 : 28)
 #define YEARDAYS(y)            (leapyear(y) ? 366 : 365)
 #define DATE(d,m,y)            ((m) > 0 && (m) <= 12 && (d) > 0 && (y) != 0 && 
(y) >= YEAR_MIN && (y) <= YEAR_MAX && (d) <= MONTHDAYS(m, y))
-#define TIME(h,m,s,x)  ((h) >= 0 && (h) < 24 && (m) >= 0 && (m) < 60 && (s) >= 
0 && (s) < 60 && (x) >= 0 && (x) < 1000)
+#define TIME(h,m,s,x)  ((h) >= 0 && (h) < 24 && (m) >= 0 && (m) < 60 && (s) >= 
0 && (s) <= 60 && (x) >= 0 && (x) < 1000)
 #define LOWER(c)               ((c) >= 'A' && (c) <= 'Z' ? (c) + 'a' - 'A' : 
(c))
 
 /*
diff --git 
a/sql/test/BugTracker-2016/Tests/timestamp_with_tz_fromstr.Bug-4019.stable.err 
b/sql/test/BugTracker-2016/Tests/timestamp_with_tz_fromstr.Bug-4019.stable.err
--- 
a/sql/test/BugTracker-2016/Tests/timestamp_with_tz_fromstr.Bug-4019.stable.err
+++ 
b/sql/test/BugTracker-2016/Tests/timestamp_with_tz_fromstr.Bug-4019.stable.err
@@ -28,14 +28,6 @@ stderr of test 'timestamp_with_tz_fromst
 # 16:31:49 >  "mclient" "-lsql" "-ftest" "-Eutf-8" "-i" "-e" 
"--host=/var/tmp/mtest-1703" "--port=32740"
 # 16:31:49 >  
 
-MAPI  = (monetdb) /var/tmp/mtest-1703/.s.monetdb.32740
-QUERY = select cast('2015-12-08T00:46:60' as timestamp);
-ERROR = !Timestamp (2015-12-08T00:46:60) has incorrect format
-CODE  = 22007
-MAPI  = (monetdb) /var/tmp/mtest-30274/.s.monetdb.37685
-QUERY = select cast('2015-12-08 00:46:60' as timestamp);
-ERROR = !Timestamp (2015-12-08 00:46:60) has incorrect format
-CODE  = 22007
 
 # 16:31:49 >  
 # 16:31:49 >  "Done."
diff --git 
a/sql/test/BugTracker-2016/Tests/timestamp_with_tz_fromstr.Bug-4019.stable.out 
b/sql/test/BugTracker-2016/Tests/timestamp_with_tz_fromstr.Bug-4019.stable.out
--- 
a/sql/test/BugTracker-2016/Tests/timestamp_with_tz_fromstr.Bug-4019.stable.out
+++ 
b/sql/test/BugTracker-2016/Tests/timestamp_with_tz_fromstr.Bug-4019.stable.out
@@ -25,6 +25,18 @@ Ready.
 # 16:31:49 >  "mclient" "-lsql" "-ftest" "-Eutf-8" "-i" "-e" 
"--host=/var/tmp/mtest-1703" "--port=32740"
 # 16:31:49 >  
 
+#select cast('2015-12-08T00:46:60' as timestamp);
+% .L2 # table_name
+% L2 # name
+% timestamp # type
+% 26 # length
+[ 2015-12-08 00:47:00.000000   ]
+#select cast('2015-12-08 00:46:60' as timestamp);
+% .L2 # table_name
+% L2 # name
+% timestamp # type
+% 26 # length
+[ 2015-12-08 00:47:00.000000   ]
 
 # 16:31:49 >  
 # 16:31:49 >  "Done."
diff --git a/sql/test/BugTracker-2018/Tests/All 
b/sql/test/BugTracker-2018/Tests/All
--- a/sql/test/BugTracker-2018/Tests/All
+++ b/sql/test/BugTracker-2018/Tests/All
@@ -78,3 +78,4 @@ singleton-stddev.Bug-6627
 create_table_if_not_exists_returns_42000.Bug-6629
 sqlitelogictest-cast-null-add.Bug-6630
 ilike-foreign-characters.Bug-6633
+multi-column-hash-wrongly-NIL.Bug-6638
diff --git 
a/sql/test/BugTracker-2018/Tests/multi-column-hash-wrongly-NIL.Bug-6638.sql 
b/sql/test/BugTracker-2018/Tests/multi-column-hash-wrongly-NIL.Bug-6638.sql
new file mode 100644
--- /dev/null
+++ b/sql/test/BugTracker-2018/Tests/multi-column-hash-wrongly-NIL.Bug-6638.sql
@@ -0,0 +1,77 @@
+
+-- sample value constellationa where multi-column joins drop results
+-- (false-negatives) because (sequences of) mkey.bulk_rotate_xor_hash()
+-- produce NIL (which then does not match/join)
+
+start transaction;
+
+create table r2 (a bigint, b bigint, x bigint generated always as identity 
primary key);
+insert into r2 (a,b) values 
(11,21),(12,22),(13,23),(2199023255552,0),(0,2199023255552),(6597069766656,1),(1,6597069766656),(4398046511104,-9223372036854775807),(-9223372036854775807,4398046511104),(1,-9223372036850581504),(-9223372036850581504,1),(-1,9223372036854775807),(9223372036854775807,-1);
+create table s2 as (select a, b, -x as y from r2 order by x desc) with data;
+select * from r2;
+select * from s2;
+select * from r2 natural join s2 order by x,y;
+select * from s2 natural join r2 order by x,y;
+
+create table r3 (a bigint, b bigint, c bigint, x bigint generated always as 
identity primary key);
+insert into r3 (a,b,c) values 
(11,21,31),(12,22,32),(13,23,33),(2147483648,0,0),(0,2147483648,0),(0,0,2147483648),(140737488355328,0,0),(0,140737488355328,0),(0,0,140737488355328);
+create table s3 as (select a, b, c, -x as y from r3 order by x desc) with data;
+select * from r3;
+select * from s3;
+select * from r3 natural join s3 order by x,y;
+select * from s3 natural join r3 order by x,y;
+
+create table r4 (a bigint, b bigint, c bigint, d bigint, x bigint generated 
always as identity primary key);
+insert into r4 (a,b,c,d) values 
(11,21,31,41),(12,22,32,42),(13,23,33,43),(16777216,0,0,0),(0,16777216,0,0),(0,0,16777216,0),(0,0,0,16777216),(1125899906842624,0,0,0),(0,1125899906842624,0,0),(0,0,1125899906842624,0),(0,0,0,1125899906842624);
+create table s4 as (select a, b, c, d, -x as y from r4 order by x desc) with 
data;
+select * from r4;
+select * from s4;
+select * from r4 natural join s4 order by x,y;
+select * from s4 natural join r4 order by x,y;
+
+create table r5 (a bigint, b bigint, c bigint, d bigint, e bigint, x bigint 
generated always as identity primary key);
+insert into r5 (a,b,c,d,e) values 
(11,21,31,41,51),(12,22,32,42,52),(13,23,33,43,53),(524288,0,0,0,0),(0,524288,0,0,0),(0,0,524288,0,0),(0,0,0,524288,0),(0,0,0,0,524288),(4503599627370496,0,0,0,0),(0,4503599627370496,0,0,0),(0,0,4503599627370496,0,0),(0,0,0,4503599627370496,0),(0,0,0,0,4503599627370496);
+create table s5 as (select a, b, c, d, e, -x as y from r5 order by x desc) 
with data;
+select * from r5;
+select * from s5;
+select * from r5 natural join s5 order by x,y;
+select * from s5 natural join r5 order by x,y;
+
+create table r6 (a bigint, b bigint, c bigint, d bigint, e bigint, f bigint, x 
bigint generated always as identity primary key);
+insert into r6 (a,b,c,d,e,f) values 
(11,21,31,41,51,61),(12,22,32,42,52,62),(13,23,33,43,53,63),(8192,0,0,0,0,0),(0,8192,0,0,0,0),(0,0,8192,0,0,0),(0,0,0,8192,0,0),(0,0,0,0,8192,0),(0,0,0,0,0,8192),(9007199254740992,0,0,0,0,0),(0,9007199254740992,0,0,0,0),(0,0,9007199254740992,0,0,0),(0,0,0,9007199254740992,0,0),(0,0,0,0,9007199254740992,0),(0,0,0,0,0,9007199254740992);
+create table s6 as (select a, b, c, d, e, f, -x as y from r6 order by x desc) 
with data;
+select * from r6;
+select * from s6;
+select * from r6 natural join s6 order by x,y;
+select * from s6 natural join r6 order by x,y;
+
+create table r7 (a bigint, b bigint, c bigint, d bigint, e bigint, f bigint, g 
bigint, x bigint generated always as identity primary key);
+insert into r7 (a,b,c,d,e,f,g) values 
(11,21,31,41,51,61,71),(12,22,32,42,52,62,72),(13,23,33,43,53,63,73),(32768,0,0,0,0,0,0),(0,32768,0,0,0,0,0),(0,0,32768,0,0,0,0),(0,0,0,32768,0,0,0),(0,0,0,0,32768,0,0),(0,0,0,0,0,32768,0),(0,0,0,0,0,0,32768),(36028797018963968,0,0,0,0,0,0),(0,36028797018963968,0,0,0,0,0),(0,0,36028797018963968,0,0,0,0),(0,0,0,36028797018963968,0,0,0),(0,0,0,0,36028797018963968,0,0),(0,0,0,0,0,36028797018963968,0),(0,0,0,0,0,0,36028797018963968);
+create table s7 as (select a, b, c, d, e, f, g, -x as y from r7 order by x 
desc) with data;
+select * from r7;
+select * from s7;
+select * from r7 natural join s7 order by x,y;
+select * from s7 natural join r7 order by x,y;
+
+create table r8 (a bigint, b bigint, c bigint, d bigint, e bigint, f bigint, g 
bigint, h bigint, x bigint generated always as identity primary key);
+insert into r8 (a,b,c,d,e,f,g,h) values 
(11,21,31,41,51,61,71,81),(12,22,32,42,52,62,72,82),(13,23,33,43,53,63,73,83),(128,0,0,0,0,0,0,0),(0,128,0,0,0,0,0,0),(0,0,128,0,0,0,0,0),(0,0,0,128,0,0,0,0),(0,0,0,0,128,0,0,0),(0,0,0,0,0,128,0,0),(0,0,0,0,0,0,128,0),(0,0,0,0,0,0,0,128),(36028797018963968,0,0,0,0,0,0,0),(0,36028797018963968,0,0,0,0,0,0),(0,0,36028797018963968,0,0,0,0,0),(0,0,0,36028797018963968,0,0,0,0),(0,0,0,0,36028797018963968,0,0,0),(0,0,0,0,0,36028797018963968,0,0),(0,0,0,0,0,0,36028797018963968,0),(0,0,0,0,0,0,0,36028797018963968);
+create table s8 as (select a, b, c, d, e, f, g, h, -x as y from r8 order by x 
desc) with data;
+select * from r8;
+select * from s8;
+select * from r8 natural join s8 order by x,y;
+select * from s8 natural join r8 order by x,y;
+
+create table r9 (a bigint, b bigint, c bigint, d bigint, e bigint, f bigint, g 
bigint, h bigint, i bigint, x bigint generated always as identity primary key);
+insert into r9 (a,b,c,d,e,f,g,h,i) values 
(11,21,31,41,51,61,71,81,91),(12,22,32,42,52,62,72,82,92),(13,23,33,43,53,63,73,83,93),(128,0,0,0,0,0,0,0,0),(0,128,0,0,0,0,0,0,0),(0,0,128,0,0,0,0,0,0),(0,0,0,128,0,0,0,0,0),(0,0,0,0,128,0,0,0,0),(0,0,0,0,0,128,0,0,0),(0,0,0,0,0,0,128,0,0),(0,0,0,0,0,0,0,128,0),(0,0,0,0,0,0,0,0,128),(72057594037927936,0,0,0,0,0,0,0,0),(0,72057594037927936,0,0,0,0,0,0,0),(0,0,72057594037927936,0,0,0,0,0,0),(0,0,0,72057594037927936,0,0,0,0,0),(0,0,0,0,72057594037927936,0,0,0,0),(0,0,0,0,0,72057594037927936,0,0,0),(0,0,0,0,0,0,72057594037927936,0,0),(0,0,0,0,0,0,0,72057594037927936,0),(0,0,0,0,0,0,0,0,72057594037927936);
+create table s9 as (select a, b, c, d, e, f, g, h, i, -x as y from r9 order by 
x desc) with data;
+select * from r9;
+select * from s9;
+select * from r9 natural join s9 order by x,y;
+select * from s9 natural join r9 order by x,y;
+
+alter table r2 add constraint ab_unique unique (a,b);
+insert into r2 (a,b) values (2199023255552,0);
+select * from r2;
+
+rollback;
+
diff --git 
a/sql/test/BugTracker-2018/Tests/multi-column-hash-wrongly-NIL.Bug-6638.stable.err
 
b/sql/test/BugTracker-2018/Tests/multi-column-hash-wrongly-NIL.Bug-6638.stable.err
new file mode 100644
--- /dev/null
+++ 
b/sql/test/BugTracker-2018/Tests/multi-column-hash-wrongly-NIL.Bug-6638.stable.err
@@ -0,0 +1,43 @@
+stderr of test 'multi-column-hash-wrongly-NIL.Bug-6638` in directory 
'sql/test/BugTracker-2018` itself:
+
+
+# 16:21:04 >  
+# 16:21:04 >  "mserver5" "--debug=10" "--set" "gdk_nr_threads=0" "--set" 
"mapi_open=true" "--set" "mapi_port=34059" "--set" 
"mapi_usock=/var/tmp/mtest-9105/.s.monetdb.34059" "--set" "monet_prompt=" 
"--forcemito" 
"--dbpath=/ufs/manegold/_/Monet/release/prefix/_/var/MonetDB/mTests_sql_test_BugTracker-2018"
 "--set" "embedded_c=true"
+# 16:21:04 >  
+
+# builtin opt  gdk_dbpath = 
/ufs/manegold/_/Monet/release/prefix/_/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 = 34059
+# cmdline opt  mapi_usock = /var/tmp/mtest-9105/.s.monetdb.34059
+# cmdline opt  monet_prompt = 
+# cmdline opt  gdk_dbpath = 
/ufs/manegold/_/Monet/release/prefix/_/var/MonetDB/mTests_sql_test_BugTracker-2018
+# cmdline opt  embedded_c = true
+# cmdline opt  gdk_debug = 553648138
+
+# 16:21:04 >  
+# 16:21:04 >  "mclient" "-lsql" "-ftest" "-tnone" "-Eutf-8" "-i" "-e" 
"--host=/var/tmp/mtest-9105" "--port=34059"
+# 16:21:04 >  
+
+MAPI  = (monetdb) /var/tmp/mtest-16700/.s.monetdb.33530
+QUERY = insert into r2 (a,b) values (2199023255552,0);
+ERROR = !INSERT INTO: UNIQUE constraint 'r2.ab_unique' violated
+CODE  = M0M29
+MAPI  = (monetdb) /var/tmp/mtest-16700/.s.monetdb.33530
+QUERY = select * from r2;
+ERROR = !Current transaction is aborted (please ROLLBACK)
+CODE  = 25005
+
+# 16:21:04 >  
+# 16:21:04 >  "Done."
+# 16:21:04 >  
+
diff --git 
a/sql/test/BugTracker-2018/Tests/multi-column-hash-wrongly-NIL.Bug-6638.stable.out
 
b/sql/test/BugTracker-2018/Tests/multi-column-hash-wrongly-NIL.Bug-6638.stable.out
new file mode 100644
--- /dev/null
+++ 
b/sql/test/BugTracker-2018/Tests/multi-column-hash-wrongly-NIL.Bug-6638.stable.out
@@ -0,0 +1,741 @@
+stdout of test 'multi-column-hash-wrongly-NIL.Bug-6638` in directory 
'sql/test/BugTracker-2018` itself:
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to