Changeset: 74f63592625d for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=74f63592625d
Added Files:
sql/test/BugTracker-2011/Tests/crash_on_alias.Bug-2798.stable.out.int128
Modified Files:
sql/test/BugTracker-2011/Tests/crash_on_alias.Bug-2798.sql
sql/test/BugTracker-2011/Tests/crash_on_alias.Bug-2798.stable.out
Branch: default
Log Message:
Undo the cast(... as bigint)) changes made to crash_on_alias.Bug-2798 in
changeset 69345:55505094267b
It appears that the plans with the cast(... as bigint)) are different on
non-int128 platforms, so we need an .int128 output anyway.
diffs (199 lines):
diff --git a/sql/test/BugTracker-2011/Tests/crash_on_alias.Bug-2798.sql
b/sql/test/BugTracker-2011/Tests/crash_on_alias.Bug-2798.sql
--- a/sql/test/BugTracker-2011/Tests/crash_on_alias.Bug-2798.sql
+++ b/sql/test/BugTracker-2011/Tests/crash_on_alias.Bug-2798.sql
@@ -4,26 +4,28 @@ START TRANSACTION;
CREATE TABLE dbg (a INT, b INT);
INSERT INTO dbg (a,b) VALUES (10,10);
--- no alias around the SUM(b), works
-plan SELECT a as d, cast(SUM(b) as bigint), cast((2 * (SUM(b) / (SELECT 2)))
as bigint) as f FROM dbg GROUP BY d;
+-- no alias for the SUM(b), works
+plan
+SELECT a as d, SUM(b), (2 * (SUM(b) / (SELECT 2))) as f FROM dbg GROUP BY d;
set optimizer = 'sequential_pipe';
---explain SELECT a as d, cast(SUM(b) as bigint), cast((2 * (SUM(b) / (SELECT
2))) as bigint) as f FROM dbg GROUP BY d;
+--explain SELECT a as d, SUM(b), (2 * (SUM(b) / (SELECT 2))) as f FROM dbg
GROUP BY d;
set optimizer = 'default_pipe';
-SELECT a as d, cast(SUM(b) as bigint), cast((2 * (SUM(b) / (SELECT 2))) as
bigint) as f FROM dbg GROUP BY d;
+SELECT a as d, SUM(b), (2 * (SUM(b) / (SELECT 2))) as f FROM dbg GROUP BY d;
ROLLBACK;
+
START TRANSACTION;
CREATE TABLE dbg (a INT, b INT);
INSERT INTO dbg (a,b) VALUES (10,10);
--- alias e, crashes :/
-plan SELECT a as d, cast(SUM(b) as bigint) as e, cast((2 * (SUM(b) / (SELECT
2))) as bigint) as f FROM dbg GROUP BY d;
+-- with alias e, it crashes :/
+plan
+SELECT a as d, SUM(b) as e, (2 * (SUM(b) / (SELECT 2))) as f FROM dbg GROUP BY
d;
set optimizer = 'sequential_pipe';
---explain SELECT a as d, cast(SUM(b) as bigint) as e, cast((2 * (SUM(b) /
(SELECT 2))) as bigint) as f FROM dbg GROUP BY d;
+--explain SELECT a as d, SUM(b) as e, (2 * (SUM(b) / (SELECT 2))) as f FROM
dbg GROUP BY d;
set optimizer = 'default_pipe';
-SELECT a as d, cast(SUM(b) as bigint) as e, cast((2 * (SUM(b) / (SELECT 2)))
as bigint) as f FROM dbg GROUP
-BY d;
+SELECT a as d, SUM(b) as e, (2 * (SUM(b) / (SELECT 2))) as f FROM dbg GROUP BY
d;
ROLLBACK;
diff --git a/sql/test/BugTracker-2011/Tests/crash_on_alias.Bug-2798.stable.out
b/sql/test/BugTracker-2011/Tests/crash_on_alias.Bug-2798.stable.out
--- a/sql/test/BugTracker-2011/Tests/crash_on_alias.Bug-2798.stable.out
+++ b/sql/test/BugTracker-2011/Tests/crash_on_alias.Bug-2798.stable.out
@@ -24,25 +24,26 @@ stdout of test 'crash_on_alias.Bug-2798`
#CREATE TABLE dbg (a INT, b INT);
#INSERT INTO dbg (a,b) VALUES (10,10);
[ 1 ]
-#plan SELECT a as d, cast(SUM(b) as bigint), cast((2 * (SUM(b) / (SELECT 2)))
as bigint) as f FROM dbg GROUP BY d;
+#plan
+#SELECT a as d, SUM(b), (2 * (SUM(b) / (SELECT 2))) as f FROM dbg GROUP BY d;
% .plan # table_name
% rel # name
% clob # type
-% 133 # length
+% 105 # length
project (
| project (
| | group by (
| | | table(sys.dbg) [ "dbg"."a", "dbg"."b" ] COUNT
-| | ) [ "dbg"."a" as "d" ] [ "dbg"."d", sys.sum no nil ("dbg"."b") as
"L3"."L3", "L3"."L3" as "L6"."L6" ]
-| ) [ "dbg"."d", bigint["L3"."L3"] as "L4"."L4",
bigint[sys.sql_mul(sys.sql_div("L6"."L6", tinyint "2"), tinyint "2")] as
"L10"."f" ]
-) [ "dbg"."d", "L4"."L4", "L10"."f" ]
+| | ) [ "dbg"."a" as "d" ] [ "dbg"."d", sys.sum no nil ("dbg"."b") as
"L3"."L3", "L3"."L3" as "L5"."L5" ]
+| ) [ "dbg"."d", "L3"."L3", sys.sql_mul(sys.sql_div("L5"."L5", tinyint "2"),
tinyint "2") as "L6"."f" ]
+) [ "dbg"."d", "L3"."L3", "L6"."f" ]
#set optimizer = 'sequential_pipe';
#set optimizer = 'default_pipe';
-#SELECT a as d, cast(SUM(b) as bigint), cast((2 * (SUM(b) / (SELECT 2))) as
bigint) as f FROM dbg GROUP BY d;
+#SELECT a as d, SUM(b), (2 * (SUM(b) / (SELECT 2))) as f FROM dbg GROUP BY d;
% sys.dbg, sys., sys. # table_name
-# sys.dbg, sys.L4, sys.L10 # table_name
+# sys.dbg, sys.L3, sys.L6 # table_name
% d, L, f # name
-# d, L4, f # name
+# d, L3, f # name
% int, bigint, bigint # type
% 2, 2, 2 # length
[ 10, 10, 10 ]
@@ -51,24 +52,24 @@ project (
#CREATE TABLE dbg (a INT, b INT);
#INSERT INTO dbg (a,b) VALUES (10,10);
[ 1 ]
-#plan SELECT a as d, cast(SUM(b) as bigint) as e, cast((2 * (SUM(b) / (SELECT
2))) as bigint) as f FROM dbg GROUP BY d;
+#plan
+#SELECT a as d, SUM(b) as e, (2 * (SUM(b) / (SELECT 2))) as f FROM dbg GROUP
BY d;
% .plan # table_name
% rel # name
% clob # type
-% 132 # length
+% 115 # length
project (
| project (
| | group by (
| | | table(sys.dbg) [ "dbg"."a", "dbg"."b" ] COUNT
-| | ) [ "dbg"."a" as "d" ] [ "dbg"."d", sys.sum no nil ("dbg"."b") as
"L3"."L3", "L3"."L3" as "L7"."L7" ]
-| ) [ "dbg"."d", bigint["L3"."L3"] as "L5"."e",
bigint[sys.sql_mul(sys.sql_div("L7"."L7", tinyint "2"), tinyint "2")] as
"L11"."f" ]
-) [ "dbg"."d", "L5"."e", "L11"."f" ]
+| | ) [ "dbg"."a" as "d" ] [ "dbg"."d", sys.sum no nil ("dbg"."b") as
"L3"."L3", "L3"."L3" as "L6"."L6" ]
+| ) [ "dbg"."d", "L3"."L3" as "L4"."e", sys.sql_mul(sys.sql_div("L6"."L6",
tinyint "2"), tinyint "2") as "L7"."f" ]
+) [ "dbg"."d", "L4"."e", "L7"."f" ]
#set optimizer = 'sequential_pipe';
#set optimizer = 'default_pipe';
-#SELECT a as d, cast(SUM(b) as bigint) as e, cast((2 * (SUM(b) / (SELECT 2)))
as bigint) as f FROM dbg GROUP
-#BY d;
+#SELECT a as d, SUM(b) as e, (2 * (SUM(b) / (SELECT 2))) as f FROM dbg GROUP
BY d;
% sys.dbg, sys., sys. # table_name
-# sys.dbg, sys.L5, sys.L11 # table_name
+# sys.dbg, sys.L4, sys.L7 # table_name
% d, e, f # name
% int, bigint, bigint # type
% 2, 2, 2 # length
diff --git
a/sql/test/BugTracker-2011/Tests/crash_on_alias.Bug-2798.stable.out.int128
b/sql/test/BugTracker-2011/Tests/crash_on_alias.Bug-2798.stable.out.int128
new file mode 100644
--- /dev/null
+++ b/sql/test/BugTracker-2011/Tests/crash_on_alias.Bug-2798.stable.out.int128
@@ -0,0 +1,82 @@
+stdout of test 'crash_on_alias.Bug-2798` in directory
'sql/test/BugTracker-2011` itself:
+
+
+# 14:09:56 >
+# 14:09:56 > mserver5 --debug=10 --set gdk_nr_threads=0 --set
"gdk_dbfarm=/net/volund.ins.cwi.nl/export/scratch0/fabian/vtmp/mtest-Apr2011-volund.ins.cwi.nl/sql/dbfarm"
--set mapi_open=true --set mapi_port=31436 --set monet_prompt= --trace
--forcemito --set mal_listing=2 "--dbname=mTests_test_BugTracker-2011" --set
mal_listing=0 ; echo ; echo Over..
+# 14:09:56 >
+
+# MonetDB 5 server v11.3.1 "Apr2011-f9a21e4aaff7"
+# Serving database 'mTests_test_BugTracker-2011', using 4 threads
+# Compiled for x86_64-pc-linux-gnu/64bit with 64bit OIDs dynamically linked
+# Found 7.749 GiB available main-memory.
+# Copyright (c) 1993-July 2008 CWI.
+# Copyright (c) August 2008-2015 MonetDB B.V., all rights reserved
+# Visit http://monetdb.cwi.nl/ for further information
+# Listening for connection requests on mapi:monetdb://volund.ins.cwi.nl:31436/
+# MonetDB/GIS module loaded
+# MonetDB/SQL module loaded
+
+# 14:09:56 >
+# 14:09:56 > mclient -lsql -ftest -i -e --host=volund --port=31436
+# 14:09:56 >
+
+#START TRANSACTION;
+#CREATE TABLE dbg (a INT, b INT);
+#INSERT INTO dbg (a,b) VALUES (10,10);
+[ 1 ]
+#plan
+#SELECT a as d, SUM(b), (2 * (SUM(b) / (SELECT 2))) as f FROM dbg GROUP BY d;
+% .plan # table_name
+% rel # name
+% clob # type
+% 105 # length
+project (
+| project (
+| | group by (
+| | | table(sys.dbg) [ "dbg"."a", "dbg"."b" ] COUNT
+| | ) [ "dbg"."a" as "d" ] [ "dbg"."d", sys.sum no nil ("dbg"."b") as
"L3"."L3", "L3"."L3" as "L5"."L5" ]
+| ) [ "dbg"."d", "L3"."L3", sys.sql_mul(sys.sql_div("L5"."L5", tinyint "2"),
tinyint "2") as "L6"."f" ]
+) [ "dbg"."d", "L3"."L3", "L6"."f" ]
+#set optimizer = 'sequential_pipe';
+#set optimizer = 'default_pipe';
+#SELECT a as d, SUM(b), (2 * (SUM(b) / (SELECT 2))) as f FROM dbg GROUP BY d;
+% sys.dbg, sys., sys. # table_name
+# sys.dbg, sys.L3, sys.L6 # table_name
+% d, L, f # name
+# d, L3, f # name
+% int, hugeint, hugeint # type
+% 2, 2, 2 # length
+[ 10, 10, 10 ]
+#ROLLBACK;
+#START TRANSACTION;
+#CREATE TABLE dbg (a INT, b INT);
+#INSERT INTO dbg (a,b) VALUES (10,10);
+[ 1 ]
+#plan
+#SELECT a as d, SUM(b) as e, (2 * (SUM(b) / (SELECT 2))) as f FROM dbg GROUP
BY d;
+% .plan # table_name
+% rel # name
+% clob # type
+% 115 # length
+project (
+| project (
+| | group by (
+| | | table(sys.dbg) [ "dbg"."a", "dbg"."b" ] COUNT
+| | ) [ "dbg"."a" as "d" ] [ "dbg"."d", sys.sum no nil ("dbg"."b") as
"L3"."L3", "L3"."L3" as "L6"."L6" ]
+| ) [ "dbg"."d", "L3"."L3" as "L4"."e", sys.sql_mul(sys.sql_div("L6"."L6",
tinyint "2"), tinyint "2") as "L7"."f" ]
+) [ "dbg"."d", "L4"."e", "L7"."f" ]
+#set optimizer = 'sequential_pipe';
+#set optimizer = 'default_pipe';
+#SELECT a as d, SUM(b) as e, (2 * (SUM(b) / (SELECT 2))) as f FROM dbg GROUP
BY d;
+% sys.dbg, sys., sys. # table_name
+# sys.dbg, sys.L4, sys.L7 # table_name
+% d, e, f # name
+% int, hugeint, hugeint # type
+% 2, 2, 2 # length
+[ 10, 10, 10 ]
+#ROLLBACK;
+
+# 14:09:56 >
+# 14:09:56 > Done.
+# 14:09:56 >
+
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list