Changeset: db9a161da523 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=db9a161da523
Added Files:
monetdb5/optimizer/Tests/commonTerms.stable.err
monetdb5/optimizer/Tests/commonTerms.stable.out
sql/test/BugTracker-2019/Tests/alter_table_set_schema.Bug-6701.sql
sql/test/BugTracker-2019/Tests/alter_table_set_schema.Bug-6701.stable.err
sql/test/BugTracker-2019/Tests/alter_table_set_schema.Bug-6701.stable.out
Modified Files:
monetdb5/optimizer/Tests/commonTerms.malC
sql/test/BugTracker-2013/Tests/empty-strings.Bug-3261.SQL.py
sql/test/BugTracker-2016/Tests/trigger_bulk.Bug-4045.sql
sql/test/BugTracker-2016/Tests/trigger_bulk.Bug-4045.stable.out
sql/test/BugTracker-2018/Tests/dependency_column_on_sequence.Bug-6618.SQL.py
sql/test/BugTracker-2019/Tests/All
sql/test/Users/Tests/grantAndRevokeUserLoggedIN.Bug-3476.SQL.py
sql/test/pg_regress/Tests/without_oid.stable.out.32bit
sql/test/remote/Tests/ssbm.SQL.py
sql/test/sys-schema/Tests/check_ForeignKey_referential_integrity.sql
sql/test/sys-schema/Tests/check_ForeignKey_referential_integrity.stable.out
testing/Mfilter.py
testing/Mtest.py.in
Branch: subquery
Log Message:
merged with default
diffs (truncated from 739 to 300 lines):
diff --git a/monetdb5/optimizer/Tests/commonTerms.malC
b/monetdb5/optimizer/Tests/commonTerms.malC
--- a/monetdb5/optimizer/Tests/commonTerms.malC
+++ b/monetdb5/optimizer/Tests/commonTerms.malC
@@ -1,21 +1,13 @@
# handle the duplicates in this code block
function user.s4_1():void;
-barrier X_213:bit := language.dataflow();
- X_122:bat[:str] := bat.new(nil:str);
- X_128:bat[:int] := bat.new(nil:int);
- X_126:bat[:int] := bat.new(nil:int);
- X_125:bat[:str] := bat.new(nil:str);
- X_124:bat[:str] := bat.new(nil:str);
- X_111:bat[:lng] := bat.new(nil:lng);
- (X_115:bat[:lng], X_116:bat[:oid], X_117:bat[:oid]) := algebra.sort(X_111,
false:bit, false:bit, false:bit);
- X_42:bat[:lng] := bat.new(nil:lng);
X_41:bat[:timestamp] := bat.new(nil:timestamp);
- X_46:bat[:bit] := batcalc.>=(X_41, "2018-11-04 09:00:00.000":timestamp);
+ X_46:bat[:bit] := batcalc.>=(X_41, "2019-03-10 10:00:00.000":timestamp);
X_51:bat[:bit] := batcalc.<(X_41, "2019-03-10 10:00:00.000":timestamp);
X_53:bat[:bit] := batcalc.and(X_46, X_51);
X_55:bat[:bit] := batcalc.isnil(X_53);
X_66:bat[:bit] := batcalc.ifthenelse(X_55, false:bit, X_53);
X_69:bat[:timestamp] := mal.manifold("mtime":str,
"timestamp_add_msec_interval":str, X_41, -28800000:lng);
+
X_74:bat[:bit] := batcalc.>=(X_41, "2019-03-10 10:00:00.000":timestamp);
X_77:bat[:bit] := batcalc.<(X_41, "2019-11-03 09:00:00.000":timestamp);
X_78:bat[:bit] := batcalc.and(X_74, X_77);
@@ -25,36 +17,16 @@ barrier X_213:bit := language.dataflow()
X_98:bat[:timestamp] := batcalc.ifthenelse(X_93, X_95, X_69);
X_99:bat[:timestamp] := batcalc.ifthenelse(X_66, X_69, X_98);
X_102:bat[:str] := mal.manifold("mtime":str, "timestamp_to_str":str, X_99,
"%W":str);
- (X_105:bat[:oid], C_106:bat[:oid], X_107:bat[:lng]) := group.group(X_102);
- (X_108:bat[:oid], C_109:bat[:oid], X_110:bat[:lng]) :=
group.subgroupdone(X_42, X_105);
- X_113:bat[:lng] := aggr.subcount(X_108, X_108, C_109, false:bit);
- X_120:bat[:str] := algebra.projectionpath(X_116, C_109, X_102);
- X_119:bat[:lng] := algebra.projection(X_116, X_113);
- X_118:bat[:lng] := bat.new(nil:lng);
- X_129:bat[:str] := bat.append(X_122, "sys.L2":str);
- X_131:bat[:str] := bat.append(X_124, "priority":str);
- X_133:bat[:str] := bat.append(X_125, "bigint":str);
- X_135:bat[:int] := bat.append(X_126, 64:int);
- X_137:bat[:int] := bat.append(X_128, 0:int);
- X_139:bat[:str] := bat.append(X_129, "sys.L5":str);
- X_141:bat[:str] := bat.append(X_131, "count_of_1165461084":str);
- X_143:bat[:str] := bat.append(X_133, "bigint":str);
- X_144:bat[:int] := bat.append(X_135, 64:int);
- X_145:bat[:int] := bat.append(X_137, 0:int);
- X_146:bat[:str] := bat.append(X_139, "sys.L7":str);
- X_148:bat[:str] := bat.append(X_141, "timeref":str);
- X_150:bat[:str] := bat.append(X_143, "clob":str);
- X_152:bat[:int] := bat.append(X_144, 0:int);
- X_153:bat[:int] := bat.append(X_145, 0:int);
- language.pass(X_53);
- language.pass(X_78);
- language.pass(X_41);
- language.pass(X_69);
- language.pass(X_108);
- language.pass(C_109);
- language.pass(X_102);
- language.pass(X_116);
-exit X_213:bit;
+
+ X_1851:bat[:bit] := batcalc.<(X_41:bat[:timestamp], "2006-10-29
09:00:00.000":timestamp);
+ X_1863:bat[:bit] := batcalc.<(X_41:bat[:timestamp], "2006-10-29
09:00:00.000":timestamp);
+ X_1873:bat[:bit] := batcalc.>=(X_41:bat[:timestamp], "2006-10-29
09:00:00.000":timestamp);
+ X_648:bat[:bit] := batcalc.<(X_41:bat[:timestamp], "2006-10-29
09:00:00.000":timestamp);
+ X_660:bat[:bit] := batcalc.<(X_41:bat[:timestamp], "2006-10-29
09:00:00.000":timestamp);
+ X_669:bat[:bit] := batcalc.>=(X_41:bat[:timestamp], "2006-10-29
09:00:00.000":timestamp);
+
end user.s4_1;
-optimizer.commonTerms("optimizer","commonTerms");
+optimizer.multiplex("user","s4_1");
+optimizer.commonTerms("user","s4_1");
+mdb.List("user","s4_1");
diff --git a/monetdb5/optimizer/Tests/commonTerms.stable.err
b/monetdb5/optimizer/Tests/commonTerms.stable.err
new file mode 100644
--- /dev/null
+++ b/monetdb5/optimizer/Tests/commonTerms.stable.err
@@ -0,0 +1,33 @@
+stderr of test 'commonTerms` in directory 'monetdb5/optimizer` itself:
+
+
+# 13:56:12 >
+# 13:56:12 > "mserver5" "--debug=10" "--set" "gdk_nr_threads=0" "--set"
"mapi_open=true" "--set" "mapi_port=34759" "--set"
"mapi_usock=/var/tmp/mtest-15937/.s.monetdb.34759" "--set" "monet_prompt="
"--forcemito"
"--dbpath=/export/scratch1/mk/branches/default//Linux/var/MonetDB/mTests_monetdb5_optimizer"
"--set" "monet_daemon=yes" "--set" "embedded_c=true"
+# 13:56:12 >
+
+# builtin opt gdk_dbpath =
/export/scratch1/mk/branches/default//Linux/var/monetdb5/dbfarm/demo
+# 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 = 34759
+# cmdline opt mapi_usock = /var/tmp/mtest-15937/.s.monetdb.34759
+# cmdline opt monet_prompt =
+# cmdline opt gdk_dbpath =
/export/scratch1/mk/branches/default//Linux/var/MonetDB/mTests_monetdb5_optimizer
+# cmdline opt monet_daemon = yes
+# cmdline opt embedded_c = true
+
+# 13:56:12 >
+# 13:56:12 > "mclient" "-lmal" "-ftest" "-tnone" "-Eutf-8"
"--host=/var/tmp/mtest-15937" "--port=34759"
+# 13:56:12 >
+
+
+# 13:56:12 >
+# 13:56:12 > "Done."
+# 13:56:12 >
+
diff --git a/monetdb5/optimizer/Tests/commonTerms.stable.out
b/monetdb5/optimizer/Tests/commonTerms.stable.out
new file mode 100644
--- /dev/null
+++ b/monetdb5/optimizer/Tests/commonTerms.stable.out
@@ -0,0 +1,55 @@
+stdout of test 'commonTerms` in directory 'monetdb5/optimizer` itself:
+
+
+# 13:56:12 >
+# 13:56:12 > "mserver5" "--debug=10" "--set" "gdk_nr_threads=0" "--set"
"mapi_open=true" "--set" "mapi_port=34759" "--set"
"mapi_usock=/var/tmp/mtest-15937/.s.monetdb.34759" "--set" "monet_prompt="
"--forcemito"
"--dbpath=/export/scratch1/mk/branches/default//Linux/var/MonetDB/mTests_monetdb5_optimizer"
"--set" "monet_daemon=yes" "--set" "embedded_c=true"
+# 13:56:12 >
+
+# MonetDB 5 server v11.34.0 (hg id: 30ab14e79058+)
+# This is an unreleased version
+# Serving database 'mTests_monetdb5_optimizer', using 4 threads
+# Compiled for x86_64-pc-linux-gnu/64bit with 128bit integers
+# Found 31.307 GiB available main-memory.
+# Copyright (c) 1993 - July 2008 CWI.
+# Copyright (c) August 2008 - 2019 MonetDB B.V., all rights reserved
+# Visit https://www.monetdb.org/ for further information
+# Listening for connection requests on mapi:monetdb://toke.da.cwi.nl:34759/
+# Listening for UNIX domain connection requests on
mapi:monetdb:///var/tmp/mtest-15937/.s.monetdb.34759
+# MonetDB/GIS module loaded
+# MonetDB/SQL module loaded
+
+# 13:56:12 >
+# 13:56:12 > "mclient" "-lmal" "-ftest" "-tnone" "-Eutf-8"
"--host=/var/tmp/mtest-15937" "--port=34759"
+# 13:56:12 >
+
+function user.s4_1():void; #[0] (0) 0
+ X_41:bat[:timestamp] := bat.new(nil:timestamp); #[1] (0) CMDBATnew 1 <-
2
+ X_46:bat[:bit] := batcalc.>=(X_41:bat[:timestamp], "2019-03-10
10:00:00.000":timestamp); #[2] (0) CMDbatGE 3 <- 1 4
+ X_51:bat[:bit] := batcalc.<(X_41:bat[:timestamp], "2019-03-10
10:00:00.000":timestamp); #[3] (0) CMDbatLT 5 <- 1 4
+ X_53:bat[:bit] := batcalc.and(X_46:bat[:bit], X_51:bat[:bit]); #[4]
(0) CMDbatAND 6 <- 3 5
+ X_55:bat[:bit] := batcalc.isnil(X_53:bat[:bit]); #[5] (0) CMDbatISNIL 7
<- 6
+ X_66:bat[:bit] := batcalc.ifthenelse(X_55:bat[:bit], false:bit,
X_53:bat[:bit]); #[6] (0) CMDifthen 8 <- 7 9 6
+ X_69:bat[:timestamp] := mal.manifold("mtime":str,
"timestamp_add_msec_interval":str, X_41:bat[:timestamp], -28800000:lng); #[7]
(0) MANIFOLDevaluate 10 <- 11 12 1 13
+ X_74:bat[:bit] := X_46:bat[:bit]; #[8] (0) 14 <- 3
+ X_77:bat[:bit] := batcalc.<(X_41:bat[:timestamp], "2019-11-03
09:00:00.000":timestamp); #[9] (0) CMDbatLT 15 <- 1 16
+ X_78:bat[:bit] := batcalc.and(X_46:bat[:bit], X_77:bat[:bit]); #[10]
(0) CMDbatAND 17 <- 3 15
+ X_79:bat[:bit] := batcalc.isnil(X_78:bat[:bit]); #[11] (0) CMDbatISNIL
18 <- 17
+ X_93:bat[:bit] := batcalc.ifthenelse(X_79:bat[:bit], false:bit,
X_78:bat[:bit]); #[12] (0) CMDifthen 19 <- 18 9 17
+ X_95:bat[:timestamp] := mal.manifold("mtime":str,
"timestamp_add_msec_interval":str, X_41:bat[:timestamp], -25200000:lng); #[13]
(0) MANIFOLDevaluate 20 <- 11 12 1 21
+ X_98:bat[:timestamp] := batcalc.ifthenelse(X_93:bat[:bit],
X_95:bat[:timestamp], X_69:bat[:timestamp]); #[14] (0) CMDifthen 22 <- 19 20
10
+ X_99:bat[:timestamp] := batcalc.ifthenelse(X_66:bat[:bit],
X_69:bat[:timestamp], X_98:bat[:timestamp]); #[15] (0) CMDifthen 23 <- 8 10
22
+ X_102:bat[:str] := mal.manifold("mtime":str, "timestamp_to_str":str,
X_99:bat[:timestamp], "%W":str); #[16] (0) MANIFOLDevaluate 24 <- 11 25 23
26
+ X_1851:bat[:bit] := batcalc.<(X_41:bat[:timestamp], "2006-10-29
09:00:00.000":timestamp); #[17] (0) CMDbatLT 27 <- 1 28
+ X_1863:bat[:bit] := X_1851:bat[:bit]; #[18] (0) 29 <- 27
+ X_1873:bat[:bit] := batcalc.>=(X_41:bat[:timestamp], "2006-10-29
09:00:00.000":timestamp); #[19] (0) CMDbatGE 30 <- 1 28
+ X_648:bat[:bit] := X_1851:bat[:bit]; #[20] (0) 31 <- 27
+ X_660:bat[:bit] := X_1851:bat[:bit]; #[21] (0) 32 <- 27
+ X_669:bat[:bit] := X_1873:bat[:bit]; #[22] (0) 33 <- 30
+end user.s4_1; #[23] (0)
+#multiplex actions= 0 time=1 usec
+#commonTerms actions= 5 time=6 usec
+
+# 13:56:12 >
+# 13:56:12 > "Done."
+# 13:56:12 >
+
diff --git a/sql/test/BugTracker-2013/Tests/empty-strings.Bug-3261.SQL.py
b/sql/test/BugTracker-2013/Tests/empty-strings.Bug-3261.SQL.py
--- a/sql/test/BugTracker-2013/Tests/empty-strings.Bug-3261.SQL.py
+++ b/sql/test/BugTracker-2013/Tests/empty-strings.Bug-3261.SQL.py
@@ -13,6 +13,10 @@ q = []
q.append(("create table bug3261 (probeid int, markername varchar(64));\n"
"copy %d records into bug3261 from stdin using delimiters "
"'\\t','\\n','' null as 'null';\n") % (1455 * 3916))
+try:
+ xrange
+except NameError:
+ xrange = range # Python 3
for i in xrange(1,1456):
v = 'rmm%d' % i
for j in xrange(3916):
diff --git a/sql/test/BugTracker-2016/Tests/trigger_bulk.Bug-4045.sql
b/sql/test/BugTracker-2016/Tests/trigger_bulk.Bug-4045.sql
--- a/sql/test/BugTracker-2016/Tests/trigger_bulk.Bug-4045.sql
+++ b/sql/test/BugTracker-2016/Tests/trigger_bulk.Bug-4045.sql
@@ -3,6 +3,7 @@ CREATE TABLE t111 (id INT, name VARCHAR(
INSERT INTO t111 VALUES(10, 'monetdb');
INSERT INTO t111 VALUES(20, 'monet');
+-- trigger which triggers itself recursively until reaching max nesting depth
or out of stack space
CREATE TRIGGER
test5
BEFORE INSERT ON t111
@@ -11,9 +12,13 @@ FOR EACH ROW
INSERT INTO t111 SELECT * FROM t111;
-SELECT * FROM t111;
+SELECT * FROM t111;
INSERT INTO t111 VALUES(30,'single');
SELECT * FROM t111;
DROP TABLE t111;
+-- fails with: unable to drop table t111 (there are database objects which
depend on it)
+
+-- cleanup table and dependent trigger
+DROP TABLE t111 CASCADE;
diff --git a/sql/test/BugTracker-2016/Tests/trigger_bulk.Bug-4045.stable.out
b/sql/test/BugTracker-2016/Tests/trigger_bulk.Bug-4045.stable.out
--- a/sql/test/BugTracker-2016/Tests/trigger_bulk.Bug-4045.stable.out
+++ b/sql/test/BugTracker-2016/Tests/trigger_bulk.Bug-4045.stable.out
@@ -90,6 +90,7 @@ stdout of test 'trigger_bulk.Bug-4045` i
% 2, 7 # length
[ 10, "monetdb" ]
[ 20, "monet" ]
+#DROP TABLE t111 CASCADE;
# 09:09:27 >
# 09:09:27 > "Done."
diff --git
a/sql/test/BugTracker-2018/Tests/dependency_column_on_sequence.Bug-6618.SQL.py
b/sql/test/BugTracker-2018/Tests/dependency_column_on_sequence.Bug-6618.SQL.py
---
a/sql/test/BugTracker-2018/Tests/dependency_column_on_sequence.Bug-6618.SQL.py
+++
b/sql/test/BugTracker-2018/Tests/dependency_column_on_sequence.Bug-6618.SQL.py
@@ -46,7 +46,7 @@ seqname = res[0][0]
try:
run(c1, 'drop sequence ' + seqname, False)
run(c1, 'insert into t(val) values (30), (40)')
-except Exception, e:
+except Exception as e:
print(e, file=sys.stderr)
print(query(c1, 'select * from t'))
run(c1, 'drop table t')
@@ -59,7 +59,7 @@ run(c1, 'insert into t2(val) values (10)
try:
run(c1, 'drop sequence myseq')
run(c1, 'insert into t2(val) values (30), (40)')
-except Exception, e:
+except Exception as e:
print(e, file=sys.stderr)
print(query(c1, 'select * from t2'))
run(c1, 'drop table t2')
diff --git a/sql/test/BugTracker-2019/Tests/All
b/sql/test/BugTracker-2019/Tests/All
--- a/sql/test/BugTracker-2019/Tests/All
+++ b/sql/test/BugTracker-2019/Tests/All
@@ -8,3 +8,4 @@ subselect-count.Bug-6686
subselect.Bug-6688
timestamptransformation.Bug-6695
duplicates-not-eliminated-long-CASE-stmt.Bug-6697
+alter_table_set_schema.Bug-6701
diff --git a/sql/test/BugTracker-2019/Tests/alter_table_set_schema.Bug-6701.sql
b/sql/test/BugTracker-2019/Tests/alter_table_set_schema.Bug-6701.sql
new file mode 100644
--- /dev/null
+++ b/sql/test/BugTracker-2019/Tests/alter_table_set_schema.Bug-6701.sql
@@ -0,0 +1,78 @@
+-- First check that no invalid FK references exist in the db. All next queries
should return zero rows:
+SELECT * FROM sys.columns WHERE table_id NOT IN (SELECT id FROM sys.tables);
+SELECT * FROM sys._columns WHERE table_id NOT IN (SELECT id FROM sys._tables);
+SELECT * FROM sys.keys WHERE table_id NOT IN (SELECT id FROM sys.tables);
+SELECT * FROM sys.objects WHERE id NOT IN (SELECT id FROM sys.ids);
+SELECT * FROM sys.idxs WHERE table_id NOT IN (SELECT id FROM sys.tables);
+SELECT * FROM sys.dependencies WHERE id NOT IN (SELECT id FROM sys.ids);
+SELECT * FROM sys.dependencies WHERE depend_id NOT IN (SELECT id FROM sys.ids);
+
+-- create a table with a serial column (which implicitly createa a primary key
constraint and index and a sequence)
+create table sys.test2 (col1 serial);
+select count(*) as count_rows from tables where name = 'test2';
+-- 1 row: test2 (id = 9046)
+select count(*) as count_rows from keys where table_id in (select id from
tables where name = 'test2');
+-- 1 row: test2_col1_pkey
+select count(*) as count_rows from objects where id in (select id from keys
where table_id in (select id from tables where name = 'test2'));
+-- 1 row: col1
+
+ALTER TABLE sys.test2 SET SCHEMA profiler;
+select count(*) as count_rows from tables where name = 'test2';
+-- 1 row: test2. NOTE that the id has changed from 9046 into 9048
+select count(*) as count_rows from keys where table_id in (select id from
tables where name = 'test2');
+-- 1 row: test2_col1_pkey
+select count(*) as count_rows from objects where id in (select id from keys
where table_id in (select id from tables where name = 'test2'));
+-- 2 rows! which are also identical: col1
+
+ALTER TABLE profiler.test2 SET SCHEMA json;
+select count(*) as count_rows from tables where name = 'test2';
+-- 1 row: test2. NOTE that the id has changed from 9048 into 9050
+select count(*) as count_rows from keys where table_id in (select id from
tables where name = 'test2');
+-- 1 row: test2_col1_pkey
+select count(*) as count_rows from objects where id in (select id from keys
where table_id in (select id from tables where name = 'test2'));
+-- 3 rows! which are also identical: col1
+
+ALTER TABLE json.test2 SET SCHEMA sys;
+select count(*) as count_rows from tables where name = 'test2';
+-- 1 row: test2. NOTE that the id has changed from 9050 into 9052
+select count(*) as count_rows from keys where table_id in (select id from
tables where name = 'test2');
+-- 1 row: test2_col1_pkey
+select count(*) as count_rows from objects where id in (select id from keys
where table_id in (select id from tables where name = 'test2'));
+-- 4 rows! which are also identical: col1
+
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list