Changeset: fb9e4d2ff8b6 for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=fb9e4d2ff8b6 Added Files: sql/test/BugTracker-2015/Tests/adddrop_unknown_table.Bug-3718.sql sql/test/BugTracker-2015/Tests/adddrop_unknown_table.Bug-3718.stable.err sql/test/BugTracker-2015/Tests/adddrop_unknown_table.Bug-3718.stable.out sql/test/BugTracker-2015/Tests/crash_on_alter_set_not_null.Bug-3715.sql sql/test/BugTracker-2015/Tests/leftjoin.Bug-3720.sql sql/test/BugTracker-2015/Tests/leftjoin.Bug-3720.stable.err sql/test/BugTracker-2015/Tests/leftjoin.Bug-3720.stable.out Modified Files: sql/server/rel_schema.c sql/test/BugTracker-2015/Tests/All Branch: default Log Message:
merged with Oct2014 diffs (276 lines): diff --git a/sql/server/rel_schema.c b/sql/server/rel_schema.c --- a/sql/server/rel_schema.c +++ b/sql/server/rel_schema.c @@ -1189,6 +1189,8 @@ rel_alter_table(mvc *sql, dlist *qname, if (rel_check_tables(sql, t, nnt) < 0) return NULL; cs_add(&nt->tables, nnt, TR_NEW); + } else { + return sql_error(sql, 02, "42S02!ALTER TABLE: no such table '%s' in schema '%s'", ntname, s->base.name); } } /* table drop table */ diff --git a/sql/test/BugTracker-2015/Tests/All b/sql/test/BugTracker-2015/Tests/All --- a/sql/test/BugTracker-2015/Tests/All +++ b/sql/test/BugTracker-2015/Tests/All @@ -28,3 +28,5 @@ readonly.Bug-3709 crash_on_alter_set_not_null.Bug-3715 convert-to-bit.Bug-3719 union_project.Bug-3723 +leftjoin.Bug-3720 +adddrop_unknown_table.Bug-3718 diff --git a/sql/test/BugTracker-2015/Tests/adddrop_unknown_table.Bug-3718.sql b/sql/test/BugTracker-2015/Tests/adddrop_unknown_table.Bug-3718.sql new file mode 100644 --- /dev/null +++ b/sql/test/BugTracker-2015/Tests/adddrop_unknown_table.Bug-3718.sql @@ -0,0 +1,4 @@ +CREATE merge TABLE mt (i int); +ALTER TABLE mt ADD TABLE blablah; +ALTER TABLE mt DROP TABLE blablah; +DROP TABLE mt; diff --git a/sql/test/BugTracker-2015/Tests/adddrop_unknown_table.Bug-3718.stable.err b/sql/test/BugTracker-2015/Tests/adddrop_unknown_table.Bug-3718.stable.err new file mode 100644 --- /dev/null +++ b/sql/test/BugTracker-2015/Tests/adddrop_unknown_table.Bug-3718.stable.err @@ -0,0 +1,40 @@ +stderr of test 'adddrop_unknown_table.Bug-3718` in directory 'sql/test/BugTracker-2015` itself: + + +# 12:45:37 > +# 12:45:37 > "mserver5" "--debug=10" "--set" "gdk_nr_threads=0" "--set" "mapi_open=true" "--set" "mapi_port=36769" "--set" "mapi_usock=/var/tmp/mtest-2012/.s.monetdb.36769" "--set" "monet_prompt=" "--forcemito" "--set" "mal_listing=2" "--dbpath=/home/niels/scratch/rc-clean/Linux-x86_64/var/MonetDB/mTests_sql_test_BugTracker-2015" "--set" "mal_listing=0" "--set" "embedded_r=yes" +# 12:45:37 > + +# builtin opt gdk_dbpath = /home/niels/scratch/rc-clean/Linux-x86_64/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 = 36769 +# cmdline opt mapi_usock = /var/tmp/mtest-2012/.s.monetdb.36769 +# cmdline opt monet_prompt = +# cmdline opt mal_listing = 2 +# cmdline opt gdk_dbpath = /home/niels/scratch/rc-clean/Linux-x86_64/var/MonetDB/mTests_sql_test_BugTracker-2015 +# cmdline opt mal_listing = 0 +# cmdline opt embedded_r = yes +# cmdline opt gdk_debug = 536870922 + +# 12:45:38 > +# 12:45:38 > "mclient" "-lsql" "-ftest" "-Eutf-8" "-i" "-e" "--host=/var/tmp/mtest-2012" "--port=36769" +# 12:45:38 > + +MAPI = (monetdb) /var/tmp/mtest-2012/.s.monetdb.36769 +QUERY = ALTER TABLE mt ADD TABLE blablah; +ERROR = !ALTER TABLE: no such table 'blablah' in schema 'sys' + +# 12:45:38 > +# 12:45:38 > "Done." +# 12:45:38 > + diff --git a/sql/test/BugTracker-2015/Tests/adddrop_unknown_table.Bug-3718.stable.out b/sql/test/BugTracker-2015/Tests/adddrop_unknown_table.Bug-3718.stable.out new file mode 100644 --- /dev/null +++ b/sql/test/BugTracker-2015/Tests/adddrop_unknown_table.Bug-3718.stable.out @@ -0,0 +1,35 @@ +stdout of test 'adddrop_unknown_table.Bug-3718` in directory 'sql/test/BugTracker-2015` itself: + + +# 12:45:37 > +# 12:45:37 > "mserver5" "--debug=10" "--set" "gdk_nr_threads=0" "--set" "mapi_open=true" "--set" "mapi_port=36769" "--set" "mapi_usock=/var/tmp/mtest-2012/.s.monetdb.36769" "--set" "monet_prompt=" "--forcemito" "--set" "mal_listing=2" "--dbpath=/home/niels/scratch/rc-clean/Linux-x86_64/var/MonetDB/mTests_sql_test_BugTracker-2015" "--set" "mal_listing=0" "--set" "embedded_r=yes" +# 12:45:37 > + +# MonetDB 5 server v11.19.10 +# This is an unreleased version +# Serving database 'mTests_sql_test_BugTracker-2015', using 4 threads +# Compiled for x86_64-unknown-linux-gnu/64bit with 64bit OIDs dynamically linked +# Found 7.333 GiB available main-memory. +# Copyright (c) 1993-July 2008 CWI. +# Copyright (c) August 2008-2015 MonetDB B.V., all rights reserved +# Visit http://www.monetdb.org/ for further information +# Listening for connection requests on mapi:monetdb://localhost.nes.nl:36769/ +# Listening for UNIX domain connection requests on mapi:monetdb:///var/tmp/mtest-2012/.s.monetdb.36769 +# MonetDB/GIS module loaded +# MonetDB/SQL module loaded +# MonetDB/R module loaded + +Ready. + +# 12:45:38 > +# 12:45:38 > "mclient" "-lsql" "-ftest" "-Eutf-8" "-i" "-e" "--host=/var/tmp/mtest-2012" "--port=36769" +# 12:45:38 > + +#CREATE merge TABLE mt (i int); +#ALTER TABLE mt DROP TABLE blablah; +#DROP TABLE mt; + +# 12:45:38 > +# 12:45:38 > "Done." +# 12:45:38 > + diff --git a/sql/test/BugTracker-2015/Tests/crash_on_alter_set_not_null.Bug-3715.sql b/sql/test/BugTracker-2015/Tests/crash_on_alter_set_not_null.Bug-3715.sql new file mode 100644 --- /dev/null +++ b/sql/test/BugTracker-2015/Tests/crash_on_alter_set_not_null.Bug-3715.sql @@ -0,0 +1,9 @@ +CREATE TABLE bugexample ( id INTEGER); + +START TRANSACTION; +ALTER TABLE bugexample ADD COLUMN newcolumn integer; +ALTER TABLE bugexample ALTER COLUMN newcolumn SET NOT NULL; +COMMIT; + +drop table bugexample; + diff --git a/sql/test/BugTracker-2015/Tests/leftjoin.Bug-3720.sql b/sql/test/BugTracker-2015/Tests/leftjoin.Bug-3720.sql new file mode 100644 --- /dev/null +++ b/sql/test/BugTracker-2015/Tests/leftjoin.Bug-3720.sql @@ -0,0 +1,24 @@ +create table two ( + id int, + name string, + istrue boolean, + joindate date, + jointime timestamp, + count int +); + +copy 6 records into two from stdin using delimiters ',','\n'; +1,null,false,2017-12-08,2014-06-30 14:05:31.000000,2 +2,vijay,false,2017-12-08,2014-06-30 14:05:59.000000,3 +3,krish,true,2017-12-08,2014-06-30 14:06:17.000000,5 +4,bat,true,null,null,null +5,gotham,false,null,null,null +6,wayne,false,null,null,3 + + +select * from two; + +select two.id, two.name, two.count, twoAlias.id as id2, twoAlias.name as name2 from two left join two as twoAlias on two.count=twoAlias.id; + +drop table two; + diff --git a/sql/test/BugTracker-2015/Tests/leftjoin.Bug-3720.stable.err b/sql/test/BugTracker-2015/Tests/leftjoin.Bug-3720.stable.err new file mode 100644 --- /dev/null +++ b/sql/test/BugTracker-2015/Tests/leftjoin.Bug-3720.stable.err @@ -0,0 +1,37 @@ +stderr of test 'leftjoin.Bug-3720` in directory 'sql/test/BugTracker-2015` itself: + + +# 12:46:42 > +# 12:46:42 > "mserver5" "--debug=10" "--set" "gdk_nr_threads=0" "--set" "mapi_open=true" "--set" "mapi_port=37706" "--set" "mapi_usock=/var/tmp/mtest-2742/.s.monetdb.37706" "--set" "monet_prompt=" "--forcemito" "--set" "mal_listing=2" "--dbpath=/home/niels/scratch/rc-clean/Linux-x86_64/var/MonetDB/mTests_sql_test_BugTracker-2015" "--set" "mal_listing=0" "--set" "embedded_r=yes" +# 12:46:42 > + +# builtin opt gdk_dbpath = /home/niels/scratch/rc-clean/Linux-x86_64/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 = 37706 +# cmdline opt mapi_usock = /var/tmp/mtest-2742/.s.monetdb.37706 +# cmdline opt monet_prompt = +# cmdline opt mal_listing = 2 +# cmdline opt gdk_dbpath = /home/niels/scratch/rc-clean/Linux-x86_64/var/MonetDB/mTests_sql_test_BugTracker-2015 +# cmdline opt mal_listing = 0 +# cmdline opt embedded_r = yes +# cmdline opt gdk_debug = 536870922 + +# 12:46:43 > +# 12:46:43 > "mclient" "-lsql" "-ftest" "-Eutf-8" "-i" "-e" "--host=/var/tmp/mtest-2742" "--port=37706" +# 12:46:43 > + + +# 12:46:43 > +# 12:46:43 > "Done." +# 12:46:43 > + diff --git a/sql/test/BugTracker-2015/Tests/leftjoin.Bug-3720.stable.out b/sql/test/BugTracker-2015/Tests/leftjoin.Bug-3720.stable.out new file mode 100644 --- /dev/null +++ b/sql/test/BugTracker-2015/Tests/leftjoin.Bug-3720.stable.out @@ -0,0 +1,71 @@ +stdout of test 'leftjoin.Bug-3720` in directory 'sql/test/BugTracker-2015` itself: + + +# 12:46:42 > +# 12:46:42 > "mserver5" "--debug=10" "--set" "gdk_nr_threads=0" "--set" "mapi_open=true" "--set" "mapi_port=37706" "--set" "mapi_usock=/var/tmp/mtest-2742/.s.monetdb.37706" "--set" "monet_prompt=" "--forcemito" "--set" "mal_listing=2" "--dbpath=/home/niels/scratch/rc-clean/Linux-x86_64/var/MonetDB/mTests_sql_test_BugTracker-2015" "--set" "mal_listing=0" "--set" "embedded_r=yes" +# 12:46:42 > + +# MonetDB 5 server v11.19.10 +# This is an unreleased version +# Serving database 'mTests_sql_test_BugTracker-2015', using 4 threads +# Compiled for x86_64-unknown-linux-gnu/64bit with 64bit OIDs dynamically linked +# Found 7.333 GiB available main-memory. +# Copyright (c) 1993-July 2008 CWI. +# Copyright (c) August 2008-2015 MonetDB B.V., all rights reserved +# Visit http://www.monetdb.org/ for further information +# Listening for connection requests on mapi:monetdb://localhost.nes.nl:37706/ +# Listening for UNIX domain connection requests on mapi:monetdb:///var/tmp/mtest-2742/.s.monetdb.37706 +# MonetDB/GIS module loaded +# MonetDB/SQL module loaded +# MonetDB/R module loaded + +Ready. + +# 12:46:43 > +# 12:46:43 > "mclient" "-lsql" "-ftest" "-Eutf-8" "-i" "-e" "--host=/var/tmp/mtest-2742" "--port=37706" +# 12:46:43 > + +#create table two ( +# id int, +# name string, +# istrue boolean, +# joindate date, +# jointime timestamp, +# count int +#); +#copy 6 records into two from stdin using delimiters ',','\n'; +#1,null,false,2017-12-08,2014-06-30 14:05:31.000000,2 +#2,vijay,false,2017-12-08,2014-06-30 14:05:59.000000,3 +#3,krish,true,2017-12-08,2014-06-30 14:06:17.000000,5 +#4,bat,true,null,null,null +#5,gotham,false,null,null,null +#6,wayne,false,null,null,3 +[ 6 ] +#select * from two; +% sys.two, sys.two, sys.two, sys.two, sys.two, sys.two # table_name +% id, name, istrue, joindate, jointime, count # name +% int, clob, boolean, date, timestamp, int # type +% 1, 6, 5, 10, 26, 1 # length +[ 1, NULL, false, 2017-12-08, 2014-06-30 14:05:31.000000, 2 ] +[ 2, "vijay", false, 2017-12-08, 2014-06-30 14:05:59.000000, 3 ] +[ 3, "krish", true, 2017-12-08, 2014-06-30 14:06:17.000000, 5 ] +[ 4, "bat", true, NULL, NULL, NULL ] +[ 5, "gotham", false, NULL, NULL, NULL ] +[ 6, "wayne", false, NULL, NULL, 3 ] +#select two.id, two.name, two.count, twoAlias.id as id2, twoAlias.name as name2 from two left join two as twoAlias on two.count=twoAlias.id; +% .two, .two, .two, .L, .L # table_name +% id, name, count, id2, name2 # name +% int, clob, int, int, clob # type +% 1, 6, 1, 1, 6 # length +[ 1, NULL, 2, 2, "vijay" ] +[ 2, "vijay", 3, 3, "krish" ] +[ 3, "krish", 5, 5, "gotham" ] +[ 6, "wayne", 3, 3, "krish" ] +[ 4, "bat", NULL, NULL, NULL ] +[ 5, "gotham", NULL, NULL, NULL ] +#drop table two; + +# 12:46:43 > +# 12:46:43 > "Done." +# 12:46:43 > + _______________________________________________ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list