Changeset: d4c059ab34ba for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=d4c059ab34ba
Added Files:
        sql/test/BugTracker-2017/Tests/drop_system_schema.Bug-6437.sql
        sql/test/BugTracker-2017/Tests/drop_system_schema.Bug-6437.stable.err
        sql/test/BugTracker-2017/Tests/drop_system_schema.Bug-6437.stable.out
Modified Files:
        sql/test/BugTracker-2017/Tests/All
Branch: Jul2017
Log Message:

Add missing test for bug 6437


diffs (290 lines):

diff --git a/sql/test/BugTracker-2017/Tests/All 
b/sql/test/BugTracker-2017/Tests/All
--- a/sql/test/BugTracker-2017/Tests/All
+++ b/sql/test/BugTracker-2017/Tests/All
@@ -84,6 +84,7 @@ sqlitelogictest-aggregation-distinct-coa
 sqlsmith.Bug-6432
 sqlitelogictest-select-in.Bug-6433
 sqlitelogictest-select-not-in.Bug-6435
+drop_system_schema.Bug-6437
 sqlitelogictest-cast-decimal.Bug-6445
 HAVE_LIBPY?table_returning_with.Bug-6444
 insert_into_multiple_subqueries.Bug-6448
diff --git a/sql/test/BugTracker-2017/Tests/drop_system_schema.Bug-6437.sql 
b/sql/test/BugTracker-2017/Tests/drop_system_schema.Bug-6437.sql
new file mode 100644
--- /dev/null
+++ b/sql/test/BugTracker-2017/Tests/drop_system_schema.Bug-6437.sql
@@ -0,0 +1,50 @@
+select name, authorization, owner from sys.schemas where system and name IN 
('sys', 'tmp', 'json', 'profiler') order by name;
+
+set schema profiler;
+select current_schema;
+drop schema profiler;
+
+set schema json;
+select current_schema;
+drop schema profiler restrict;
+
+select name, authorization, owner from sys.schemas where system and name IN 
('sys', 'tmp', 'json', 'profiler') order by name;
+
+set schema profiler;
+set schema tmp;
+select current_schema;
+drop schema json restrict;
+
+select name, authorization, owner from sys.schemas where system and name IN 
('sys', 'tmp', 'json', 'profiler') order by name;
+
+set schema json;
+set schema sys;
+select current_schema;
+drop schema tmp restrict;
+
+set schema tmp;
+drop schema sys restrict;
+
+select name, authorization, owner from sys.schemas where system and name IN 
('sys', 'tmp', 'json', 'profiler') order by name;
+
+set schema profiler;
+select current_schema;
+set schema json;
+select current_schema;
+set schema sys;
+select current_schema;
+
+select name, authorization, owner, "system" from sys.schemas where name IN 
('sys', 'tmp', 'json', 'profiler') order by name;
+
+drop schema profiler cascade;
+drop schema json cascade;
+drop schema tmp cascade;
+
+select name, authorization, owner, "system" from sys.schemas where name IN 
('sys', 'tmp', 'json', 'profiler') order by name;
+
+set schema tmp;
+select current_schema;
+drop schema sys cascade;
+
+select name, authorization, owner, "system" from sys.schemas where name IN 
('sys', 'tmp', 'json', 'profiler') order by name;
+
diff --git 
a/sql/test/BugTracker-2017/Tests/drop_system_schema.Bug-6437.stable.err 
b/sql/test/BugTracker-2017/Tests/drop_system_schema.Bug-6437.stable.err
new file mode 100644
--- /dev/null
+++ b/sql/test/BugTracker-2017/Tests/drop_system_schema.Bug-6437.stable.err
@@ -0,0 +1,61 @@
+stderr of test 'drop_system_schema.Bug-6437` in directory 
'sql/test/BugTracker-2017` itself:
+
+
+# 13:50:35 >  
+# 13:50:35 >  "mserver5" "--debug=10" "--set" "gdk_nr_threads=0" "--set" 
"mapi_open=true" "--set" "mapi_port=36212" "--set" 
"mapi_usock=/var/tmp/mtest-25647/.s.monetdb.36212" "--set" "monet_prompt=" 
"--forcemito" 
"--dbpath=/export/scratch1/dinther/INSTALL/var/MonetDB/mTests_sql_test_BugTracker-2017"
+# 13:50:35 >  
+
+# builtin opt  gdk_dbpath = 
/export/scratch1/dinther/INSTALL/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 = 36212
+# cmdline opt  mapi_usock = /var/tmp/mtest-25647/.s.monetdb.36212
+# cmdline opt  monet_prompt = 
+# cmdline opt  gdk_dbpath = 
/export/scratch1/dinther/INSTALL/var/MonetDB/mTests_sql_test_BugTracker-2017
+# cmdline opt  gdk_debug = 536870922
+
+# 13:50:35 >  
+# 13:50:35 >  "mclient" "-lsql" "-ftest" "-Eutf-8" "-i" "-e" 
"--host=/var/tmp/mtest-25647" "--port=36212"
+# 13:50:35 >  
+
+MAPI  = (monetdb) /var/tmp/mtest-25647/.s.monetdb.36212
+QUERY = drop schema profiler;
+ERROR = !DROP SCHEMA: cannot drop current schema
+MAPI  = (monetdb) /var/tmp/mtest-25647/.s.monetdb.36212
+QUERY = drop schema profiler restrict;
+ERROR = !DROP SCHEMA: access denied for 'profiler'
+MAPI  = (monetdb) /var/tmp/mtest-25647/.s.monetdb.36212
+QUERY = drop schema json restrict;
+ERROR = !DROP SCHEMA: access denied for 'json'
+MAPI  = (monetdb) /var/tmp/mtest-25647/.s.monetdb.36212
+QUERY = drop schema tmp restrict;
+ERROR = !DROP SCHEMA: access denied for 'tmp'
+MAPI  = (monetdb) /var/tmp/mtest-25647/.s.monetdb.36212
+QUERY = drop schema sys restrict;
+ERROR = !DROP SCHEMA: access denied for 'sys'
+MAPI  = (monetdb) /var/tmp/mtest-8455/.s.monetdb.31322
+QUERY = drop schema profiler cascade;
+ERROR = !DROP SCHEMA: access denied for 'profiler'
+MAPI  = (monetdb) /var/tmp/mtest-8455/.s.monetdb.31322
+QUERY = drop schema json cascade;
+ERROR = !DROP SCHEMA: access denied for 'json'
+MAPI  = (monetdb) /var/tmp/mtest-8455/.s.monetdb.31322
+QUERY = drop schema tmp cascade;
+ERROR = !DROP SCHEMA: access denied for 'tmp'
+MAPI  = (monetdb) /var/tmp/mtest-8455/.s.monetdb.31322
+QUERY = drop schema sys cascade;
+ERROR = !DROP SCHEMA: access denied for 'sys'
+
+# 13:50:35 >  
+# 13:50:35 >  "Done."
+# 13:50:35 >  
+
diff --git 
a/sql/test/BugTracker-2017/Tests/drop_system_schema.Bug-6437.stable.out 
b/sql/test/BugTracker-2017/Tests/drop_system_schema.Bug-6437.stable.out
new file mode 100644
--- /dev/null
+++ b/sql/test/BugTracker-2017/Tests/drop_system_schema.Bug-6437.stable.out
@@ -0,0 +1,153 @@
+stdout of test 'drop_system_schema.Bug-6437` in directory 
'sql/test/BugTracker-2017` itself:
+
+
+# 13:50:35 >  
+# 13:50:35 >  "mserver5" "--debug=10" "--set" "gdk_nr_threads=0" "--set" 
"mapi_open=true" "--set" "mapi_port=36212" "--set" 
"mapi_usock=/var/tmp/mtest-25647/.s.monetdb.36212" "--set" "monet_prompt=" 
"--forcemito" 
"--dbpath=/export/scratch1/dinther/INSTALL/var/MonetDB/mTests_sql_test_BugTracker-2017"
+# 13:50:35 >  
+
+# MonetDB 5 server v11.27.10
+# This is an unreleased version
+# Serving database 'mTests_sql_test_BugTracker-2017', using 4 threads
+# Compiled for x86_64-unknown-linux-gnu/64bit with 128bit integers
+# Found 31.312 GiB available main-memory.
+# Copyright (c) 1993-July 2008 CWI.
+# Copyright (c) August 2008-2017 MonetDB B.V., all rights reserved
+# Visit https://www.monetdb.org/ for further information
+# Listening for connection requests on mapi:monetdb://catskill.da.cwi.nl:36212/
+# Listening for UNIX domain connection requests on 
mapi:monetdb:///var/tmp/mtest-25647/.s.monetdb.36212
+# MonetDB/GIS module loaded
+# MonetDB/SQL module loaded
+
+Ready.
+
+# 13:50:35 >  
+# 13:50:35 >  "mclient" "-lsql" "-ftest" "-Eutf-8" "-i" "-e" 
"--host=/var/tmp/mtest-25647" "--port=36212"
+# 13:50:35 >  
+
+#select name, authorization, owner from sys.schemas where system and name IN 
('sys', 'tmp', 'json', 'profiler') order by name;
+% sys.schemas, sys.schemas,    sys.schemas # table_name
+% name,        authorization,  owner # name
+% varchar,     int,    int # type
+% 8,   1,      1 # length
+[ "json",      3,      3       ]
+[ "profiler",  3,      3       ]
+[ "sys",       2,      3       ]
+[ "tmp",       2,      3       ]
+#set schema profiler;
+#select current_schema;
+% .L2 # table_name
+% L2 # name
+% varchar # type
+% 8 # length
+[ "profiler"   ]
+#set schema json;
+#select current_schema;
+% .L2 # table_name
+% L2 # name
+% varchar # type
+% 4 # length
+[ "json"       ]
+#select name, authorization, owner from sys.schemas where system and name IN 
('sys', 'tmp', 'json', 'profiler') order by name;
+% sys.schemas, sys.schemas,    sys.schemas # table_name
+% name,        authorization,  owner # name
+% varchar,     int,    int # type
+% 8,   1,      1 # length
+[ "json",      3,      3       ]
+[ "profiler",  3,      3       ]
+[ "sys",       2,      3       ]
+[ "tmp",       2,      3       ]
+#set schema profiler;
+#set schema tmp;
+#select current_schema;
+% .L2 # table_name
+% L2 # name
+% varchar # type
+% 3 # length
+[ "tmp"        ]
+#select name, authorization, owner from sys.schemas where system and name IN 
('sys', 'tmp', 'json', 'profiler') order by name;
+% sys.schemas, sys.schemas,    sys.schemas # table_name
+% name,        authorization,  owner # name
+% varchar,     int,    int # type
+% 8,   1,      1 # length
+[ "json",      3,      3       ]
+[ "profiler",  3,      3       ]
+[ "sys",       2,      3       ]
+[ "tmp",       2,      3       ]
+#set schema json;
+#set schema sys;
+#select current_schema;
+% .L2 # table_name
+% L2 # name
+% varchar # type
+% 3 # length
+[ "sys"        ]
+#set schema tmp;
+#select name, authorization, owner from sys.schemas where system and name IN 
('sys', 'tmp', 'json', 'profiler') order by name;
+% sys.schemas, sys.schemas,    sys.schemas # table_name
+% name,        authorization,  owner # name
+% varchar,     int,    int # type
+% 8,   1,      1 # length
+[ "json",      3,      3       ]
+[ "profiler",  3,      3       ]
+[ "sys",       2,      3       ]
+[ "tmp",       2,      3       ]
+#set schema profiler;
+#select current_schema;
+% .L2 # table_name
+% L2 # name
+% varchar # type
+% 8 # length
+[ "profiler"   ]
+#set schema json;
+#select current_schema;
+% .L2 # table_name
+% L2 # name
+% varchar # type
+% 4 # length
+[ "json"       ]
+#set schema sys;
+#select current_schema;
+% .L2 # table_name
+% L2 # name
+% varchar # type
+% 3 # length
+[ "sys"        ]
+#select name, authorization, owner, "system" from sys.schemas where name IN 
('sys', 'tmp', 'json', 'profiler') order by name;
+% sys.schemas, sys.schemas,    sys.schemas,    sys.schemas # table_name
+% name,        authorization,  owner,  system # name
+% varchar,     int,    int,    boolean # type
+% 8,   1,      1,      5 # length
+[ "json",      3,      3,      true    ]
+[ "profiler",  3,      3,      true    ]
+[ "sys",       2,      3,      true    ]
+[ "tmp",       2,      3,      true    ]
+#select name, authorization, owner, "system" from sys.schemas where name IN 
('sys', 'tmp', 'json', 'profiler') order by name;
+% sys.schemas, sys.schemas,    sys.schemas,    sys.schemas # table_name
+% name,        authorization,  owner,  system # name
+% varchar,     int,    int,    boolean # type
+% 8,   1,      1,      5 # length
+[ "json",      3,      3,      true    ]
+[ "profiler",  3,      3,      true    ]
+[ "sys",       2,      3,      true    ]
+[ "tmp",       2,      3,      true    ]
+#set schema tmp;
+#select current_schema;
+% .L2 # table_name
+% L2 # name
+% varchar # type
+% 3 # length
+[ "tmp"        ]
+#select name, authorization, owner, "system" from sys.schemas where name IN 
('sys', 'tmp', 'json', 'profiler') order by name;
+% sys.schemas, sys.schemas,    sys.schemas,    sys.schemas # table_name
+% name,        authorization,  owner,  system # name
+% varchar,     int,    int,    boolean # type
+% 8,   1,      1,      5 # length
+[ "json",      3,      3,      true    ]
+[ "profiler",  3,      3,      true    ]
+[ "sys",       2,      3,      true    ]
+[ "tmp",       2,      3,      true    ]
+
+# 13:50:35 >  
+# 13:50:35 >  "Done."
+# 13:50:35 >  
+
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to