Changeset: a70b6a528343 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=a70b6a528343
Added Files:
        sql/test/BugTracker-2018/Tests/aggr-in-case.Bug-6526.stable.out.int128
        sql/test/BugTracker-2018/Tests/ilike.Bug-6547.sql
        sql/test/BugTracker-2018/Tests/ilike.Bug-6547.stable.err
        sql/test/BugTracker-2018/Tests/ilike.Bug-6547.stable.out
Modified Files:
        monetdb5/modules/mal/pcre.c
        sql/test/BugTracker-2018/Tests/All
        sql/test/BugTracker-2018/Tests/aggr-in-case.Bug-6526.stable.out
Branch: Mar2018
Log Message:

Merge with Jul2017 branch.


diffs (truncated from 356 to 300 lines):

diff --git a/monetdb5/modules/mal/pcre.c b/monetdb5/modules/mal/pcre.c
--- a/monetdb5/modules/mal/pcre.c
+++ b/monetdb5/modules/mal/pcre.c
@@ -92,24 +92,15 @@ typedef struct RE {
 static const char *
 strcasestr(const char *haystack, const char *needle)
 {
-       const char *p, *np = 0, *startn = 0;
+       size_t nlen = strlen(needle);
 
-       for (p = haystack; *p; p++) {
-               if (np) {
-                       if (toupper(*p) == toupper(*np)) {
-                               if (!*++np)
-                                       return startn;
-                       } else
-                               np = 0;
-               } else if (toupper(*p) == toupper(*needle)) {
-                       np = needle + 1;
-                       startn = p;
-                       if (!*np)
-                               return startn;
-               }
+       if (nlen == 0)
+               return haystack;
+       for (size_t hlen = strlen(haystack); nlen <= hlen; haystack++, hlen--) {
+               if (strncasecmp(haystack, needle, nlen) == 0)
+                       return haystack;
        }
-
-       return 0;
+       return NULL;
 }
 #endif
 
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
@@ -13,7 +13,7 @@ update-with-correlated-subquery.Bug-6520
 sqlitelogictest-in-single-column.Bug-6522
 sqlitelogictest-case-subquery-missing.Bug-6523
 sqlitelogictest-group-by-having-in-count.Bug-6524
-HAVE_HGE?aggr-in-case.Bug-6526
+aggr-in-case.Bug-6526
 crash-orderby-alias.Bug-6527
 sqlitelogictest-in-cast-null.Bug-6529
 sqlitelogictest-not-in-wrong-results.Bug-6530
@@ -25,3 +25,4 @@ truncate_sys_tables.Bug-6543
 truncate_empty_table.Bug-6544
 sqlitelogictest-in-query.Bug-6545
 sqlitelogictest-in-with-division.Bug-6546
+ilike.Bug-6547
diff --git a/sql/test/BugTracker-2018/Tests/aggr-in-case.Bug-6526.stable.out 
b/sql/test/BugTracker-2018/Tests/aggr-in-case.Bug-6526.stable.out
--- a/sql/test/BugTracker-2018/Tests/aggr-in-case.Bug-6526.stable.out
+++ b/sql/test/BugTracker-2018/Tests/aggr-in-case.Bug-6526.stable.out
@@ -8,7 +8,7 @@ stdout of test 'aggr-in-case.Bug-6526` i
 # MonetDB 5 server v11.27.14
 # This is an unreleased version
 # Serving database 'mTests_sql_test_BugTracker-2018', using 4 threads
-# Compiled for x86_64-unknown-linux-gnu/64bit with 128bit integers
+# Compiled for x86_64-unknown-linux-gnu/64bit
 # Found 7.324 GiB available main-memory.
 # Copyright (c) 1993 - July 2008 CWI.
 # Copyright (c) August 2008 - 2018 MonetDB B.V., all rights reserved
@@ -51,7 +51,7 @@ Ready.
 #having sum("d1") < case when 5 > 10 then 500 else 400 end;
 % sys.t1,      sys.L4, sys.L7 # table_name
 % c1,  d1,     d2 # name
-% varchar,     hugeint,        hugeint # type
+% varchar,     bigint, bigint # type
 % 1,   3,      3 # length
 [ "A", 339,    555     ]
 #select
@@ -63,8 +63,8 @@ Ready.
 #group by "c1";
 % sys.t1,      sys.L4, sys.L7, sys.L14 # table_name
 % c1,  d1,     d2,     formula # name
-% varchar,     hugeint,        hugeint,        decimal # type
-% 1,   4,      4,      40 # length
+% varchar,     bigint, bigint, decimal # type
+% 1,   4,      4,      20 # length
 [ "A", 339,    555,    0.610   ]
 [ "B", 5039,   610,    8.260   ]
 [ "C", 6011,   9207,   0.652   ]
@@ -79,8 +79,8 @@ Ready.
 #having (1.0 * sum("d1") / (1.0 * case when sum("d2") > 0 then sum("d2") else 
null end)) > 1;
 % sys.t1,      sys.L4, sys.L7, sys.L14 # table_name
 % c1,  d1,     d2,     formula # name
-% varchar,     hugeint,        hugeint,        decimal # type
-% 1,   4,      3,      40 # length
+% varchar,     bigint, bigint, decimal # type
+% 1,   4,      3,      20 # length
 [ "B", 5039,   610,    8.260   ]
 #rollback;
 
diff --git 
a/sql/test/BugTracker-2018/Tests/aggr-in-case.Bug-6526.stable.out.int128 
b/sql/test/BugTracker-2018/Tests/aggr-in-case.Bug-6526.stable.out.int128
new file mode 100644
--- /dev/null
+++ b/sql/test/BugTracker-2018/Tests/aggr-in-case.Bug-6526.stable.out.int128
@@ -0,0 +1,90 @@
+stdout of test 'aggr-in-case.Bug-6526` in directory 'sql/test/BugTracker-2018` 
itself:
+
+
+# 18:07:27 >  
+# 18:07:27 >  "mserver5" "--debug=10" "--set" "gdk_nr_threads=0" "--set" 
"mapi_open=true" "--set" "mapi_port=35745" "--set" 
"mapi_usock=/var/tmp/mtest-17690/.s.monetdb.35745" "--set" "monet_prompt=" 
"--forcemito" 
"--dbpath=/home/niels/scratch/rc-old/Linux-x86_64/var/MonetDB/mTests_sql_test_BugTracker-2018"
+# 18:07:27 >  
+
+# MonetDB 5 server v11.27.14
+# This is an unreleased version
+# Serving database 'mTests_sql_test_BugTracker-2018', using 4 threads
+# Compiled for x86_64-unknown-linux-gnu/64bit with 128bit integers
+# Found 7.324 GiB available main-memory.
+# Copyright (c) 1993 - July 2008 CWI.
+# Copyright (c) August 2008 - 2018 MonetDB B.V., all rights reserved
+# Visit https://www.monetdb.org/ for further information
+# Listening for connection requests on mapi:monetdb://localhost.nes.nl:35745/
+# Listening for UNIX domain connection requests on 
mapi:monetdb:///var/tmp/mtest-17690/.s.monetdb.35745
+# MonetDB/GIS module loaded
+# MonetDB/SQL module loaded
+
+Ready.
+
+# 18:07:27 >  
+# 18:07:27 >  "mclient" "-lsql" "-ftest" "-Eutf-8" "-i" "-e" 
"--host=/var/tmp/mtest-17690" "--port=35745"
+# 18:07:27 >  
+
+#start transaction;
+#create table "t1" (
+#    "id" int,
+#    "c1" varchar(100),
+#    "d1" int,
+#    "d2" int
+#);
+#insert into "t1" values
+#(1, 'A', 50, 80),
+#(2, 'A', 200, 350),
+#(3, 'A', 89, 125),
+#(4, 'B', 4845, 13),
+#(5, 'B', 194, 597),
+#(6, 'C', 5636, 5802),
+#(7, 'C', 375, 3405),
+#(7, 'D', 365, 0),
+#(7, 'D', 87, 0);
+[ 9    ]
+#select
+#    "c1",
+#    sum("d1") as "d1",
+#    sum("d2") as "d2"
+#from "t1"
+#group by "c1"
+#having sum("d1") < case when 5 > 10 then 500 else 400 end;
+% sys.t1,      sys.L4, sys.L7 # table_name
+% c1,  d1,     d2 # name
+% varchar,     hugeint,        hugeint # type
+% 1,   3,      3 # length
+[ "A", 339,    555     ]
+#select
+#    "c1",
+#    sum("d1")as "d1",
+#    sum("d2") as "d2",
+#    1.0 * sum("d1") / (1.0 * case when sum("d2") > 0 then sum("d2") else null 
end) as "formula"
+#from "t1"
+#group by "c1";
+% sys.t1,      sys.L4, sys.L7, sys.L14 # table_name
+% c1,  d1,     d2,     formula # name
+% varchar,     hugeint,        hugeint,        decimal # type
+% 1,   4,      4,      40 # length
+[ "A", 339,    555,    0.610   ]
+[ "B", 5039,   610,    8.260   ]
+[ "C", 6011,   9207,   0.652   ]
+[ "D", 452,    0,      NULL    ]
+#select
+#    "c1",
+#    sum("d1")as "d1",
+#    sum("d2") as "d2",
+#    1.0 * sum("d1") / (1.0 * case when sum("d2") > 0 then sum("d2") else null 
end) as "formula"
+#from "t1"
+#group by "c1"
+#having (1.0 * sum("d1") / (1.0 * case when sum("d2") > 0 then sum("d2") else 
null end)) > 1;
+% sys.t1,      sys.L4, sys.L7, sys.L14 # table_name
+% c1,  d1,     d2,     formula # name
+% varchar,     hugeint,        hugeint,        decimal # type
+% 1,   4,      3,      40 # length
+[ "B", 5039,   610,    8.260   ]
+#rollback;
+
+# 18:07:27 >  
+# 18:07:27 >  "Done."
+# 18:07:27 >  
+
diff --git a/sql/test/BugTracker-2018/Tests/ilike.Bug-6547.sql 
b/sql/test/BugTracker-2018/Tests/ilike.Bug-6547.sql
new file mode 100644
--- /dev/null
+++ b/sql/test/BugTracker-2018/Tests/ilike.Bug-6547.sql
@@ -0,0 +1,22 @@
+START TRANSACTION;
+
+CREATE TABLE "unitTestDontDelete" (
+        "A" VARCHAR(255),
+        "B" BIGINT,
+        "C" DOUBLE,
+        "D" TIMESTAMP
+);
+INSERT INTO "unitTestDontDelete" VALUES (NULL, NULL, NULL, NULL);
+INSERT INTO "unitTestDontDelete" VALUES ('Cat1', 0, 0.5, '2013-06-10 
11:10:10.000000');
+INSERT INTO "unitTestDontDelete" VALUES ('Cat2', 1, 1.5, '2013-06-11 
12:11:11.000000');
+INSERT INTO "unitTestDontDelete" VALUES ('Cat1', 2, 2.5, '2013-06-12 
13:12:12.000000');
+INSERT INTO "unitTestDontDelete" VALUES ('Cat2', 3, 3.5, '2013-06-13 
14:13:13.000000');
+INSERT INTO "unitTestDontDelete" VALUES ('Cat1', 4, 4.5, '2013-06-14 
15:14:14.000000');
+INSERT INTO "unitTestDontDelete" VALUES ('Cat2', 5, 5.5, '2013-06-15 
16:15:15.000000');
+INSERT INTO "unitTestDontDelete" VALUES ('Cat1', 6, 6.5, '2013-06-16 
17:16:16.000000');
+INSERT INTO "unitTestDontDelete" VALUES ('Cat2', 7, 7.5, '2013-06-17 
18:17:17.000000');
+INSERT INTO "unitTestDontDelete" VALUES ('Cat1', 8, 8.5, '2013-06-18 
19:18:18.000000');
+
+select max("A") from "unitTestDontDelete" where "A" ilike ('%' || '' || '%');
+
+ROLLBACK;
diff --git a/sql/test/BugTracker-2018/Tests/ilike.Bug-6547.stable.err 
b/sql/test/BugTracker-2018/Tests/ilike.Bug-6547.stable.err
new file mode 100644
--- /dev/null
+++ b/sql/test/BugTracker-2018/Tests/ilike.Bug-6547.stable.err
@@ -0,0 +1,34 @@
+stderr of test 'ilike.Bug-6547` in directory 'sql/test/BugTracker-2018` itself:
+
+
+# 13:40:43 >  
+# 13:40:43 >  "mserver5" "--debug=10" "--set" "gdk_nr_threads=0" "--set" 
"mapi_open=true" "--set" "mapi_port=38828" "--set" "monet_prompt=" 
"--forcemito" 
"--dbpath=C:\Users\sjoerd\Documents\src\MonetDB\stable\@build-vs64d\var\MonetDB\mTests_sql_test_BugTracker-2018"
 "--set" "embedded_py=true"
+# 13:40:43 >  
+
+# builtin opt  gdk_dbpath = 
C:\Users\sjoerd\Documents\src\MonetDB\stable\@build-vs64d\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 = 38828
+# cmdline opt  monet_prompt = 
+# cmdline opt  gdk_dbpath = 
C:\Users\sjoerd\Documents\src\MonetDB\stable\@build-vs64d\var\MonetDB\mTests_sql_test_BugTracker-2018
+# cmdline opt  embedded_py = true
+# cmdline opt  gdk_debug = 553648138
+
+# 13:40:43 >  
+# 13:40:43 >  "mclient" "-lsql" "-ftest" "-Eutf-8" "-i" "-e" "--host=WIN2012" 
"--port=38828"
+# 13:40:43 >  
+
+
+# 13:40:44 >  
+# 13:40:44 >  "Done."
+# 13:40:44 >  
+
diff --git a/sql/test/BugTracker-2018/Tests/ilike.Bug-6547.stable.out 
b/sql/test/BugTracker-2018/Tests/ilike.Bug-6547.stable.out
new file mode 100644
--- /dev/null
+++ b/sql/test/BugTracker-2018/Tests/ilike.Bug-6547.stable.out
@@ -0,0 +1,95 @@
+stdout of test 'ilike.Bug-6547` in directory 'sql/test/BugTracker-2018` itself:
+
+
+# 13:40:43 >  
+# 13:40:43 >  "mserver5" "--debug=10" "--set" "gdk_nr_threads=0" "--set" 
"mapi_open=true" "--set" "mapi_port=38828" "--set" "monet_prompt=" 
"--forcemito" 
"--dbpath=C:\Users\sjoerd\Documents\src\MonetDB\stable\@build-vs64d\var\MonetDB\mTests_sql_test_BugTracker-2018"
 "--set" "embedded_py=true"
+# 13:40:43 >  
+
+# MonetDB 5 server v11.27.14 (hg id: ff3c403ba4c9+)
+# This is an unreleased version
+# Serving database 'mTests_sql_test_BugTracker-2018', using 6 threads
+# Compiled for x86_64-pc-winnt/64bit
+# Found 29.999 GiB available main-memory.
+# Copyright (c) 1993 - July 2008 CWI.
+# Copyright (c) August 2008 - 2018 MonetDB B.V., all rights reserved
+# Visit https://www.monetdb.org/ for further information
+# Listening for connection requests on mapi:monetdb://win2012:38828/
+# MonetDB/GIS module loaded
+# MonetDB/SQL module loaded
+# MonetDB/Python2 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: 18_index.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: 25_debug.sql
+# loading sql script: 26_sysmon.sql
+# loading sql script: 27_rejects.sql
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to