Changeset: 76844879b9c5 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=76844879b9c5
Modified Files:
        clients/mapiclient/mhelp.c
        sql/test/rename/Tests/All
        sql/test/rename/Tests/rename07.sql
        sql/test/rename/Tests/rename07.stable.out
Branch: merge-statements
Log Message:

Updated mhelp and test.


diffs (114 lines):

diff --git a/clients/mapiclient/mhelp.c b/clients/mapiclient/mhelp.c
--- a/clients/mapiclient/mhelp.c
+++ b/clients/mapiclient/mhelp.c
@@ -56,7 +56,8 @@ SQLhelp sqlhelp[] = {
         "ALTER TABLE [ IF EXISTS ] qname DROP [ COLUMN ] ident [ RESTRICT | 
CASCADE ]\n"
         "ALTER TABLE [ IF EXISTS ] qname DROP CONSTRAINT ident [ RESTRICT | 
CASCADE ]\n"
         "ALTER TABLE [ IF EXISTS ] qname SET { { READ | INSERT } ONLY | READ 
WRITE }\n"
-        "ALTER TABLE [ IF EXISTS ] qname RENAME TO ident",
+        "ALTER TABLE [ IF EXISTS ] qname RENAME TO ident\n"
+        "ALTER TABLE [ IF EXISTS ] qname SET SCHEMA ident",
         "column_def,table_constraint",
         "See also https://www.monetdb.org/Documentation/SQLreference/Alter"},
        {"ALTER MERGE TABLE",
diff --git a/sql/test/rename/Tests/All b/sql/test/rename/Tests/All
--- a/sql/test/rename/Tests/All
+++ b/sql/test/rename/Tests/All
@@ -5,3 +5,4 @@ rename03
 rename04
 rename05
 rename06
+rename07
diff --git a/sql/test/rename/Tests/rename07.sql 
b/sql/test/rename/Tests/rename07.sql
--- a/sql/test/rename/Tests/rename07.sql
+++ b/sql/test/rename/Tests/rename07.sql
@@ -4,13 +4,25 @@ create schema "newtables";
 create table "oldtables"."atable" (a int);
 insert into "oldtables"."atable" values (1);
 
-select "a" from "oldtables"."atable";
+select "a" from "oldtables"."atable" where false;
 select "a" from "newtables"."atable"; --error
 
+select "ss"."name" from "sys"."tables" "tt" inner join "sys"."schemas" "ss" on 
"tt"."schema_id" = "ss"."id" where "tt"."name" = 'atable';
 alter table "oldtables"."atable" set schema "newtables";
+select "ss"."name" from "sys"."tables" "tt" inner join "sys"."schemas" "ss" on 
"tt"."schema_id" = "ss"."id" where "tt"."name" = 'atable';
 
 select "a" from "oldtables"."atable"; --error
-select "a" from "newtables"."atable";
+select "a" from "newtables"."atable" where false;
+
+start transaction;
+select "ss"."name" from "sys"."tables" "tt" inner join "sys"."schemas" "ss" on 
"tt"."schema_id" = "ss"."id" where "tt"."name" = 'atable';
+alter table "newtables"."atable" set schema "oldtables";
+select "ss"."name" from "sys"."tables" "tt" inner join "sys"."schemas" "ss" on 
"tt"."schema_id" = "ss"."id" where "tt"."name" = 'atable';
+select "a" from "oldtables"."atable" where false;
+rollback;
+
+select "ss"."name" from "sys"."tables" "tt" inner join "sys"."schemas" "ss" on 
"tt"."schema_id" = "ss"."id" where "tt"."name" = 'atable';
+select "a" from "newtables"."atable" where false;
 
 drop table "newtables"."atable";
 drop schema "oldtables";
diff --git a/sql/test/rename/Tests/rename07.stable.out 
b/sql/test/rename/Tests/rename07.stable.out
--- a/sql/test/rename/Tests/rename07.stable.out
+++ b/sql/test/rename/Tests/rename07.stable.out
@@ -76,14 +76,55 @@ Ready.
 % a # name
 % int # type
 % 1 # length
-[ 1    ]
+#select "ss"."name" from "sys"."tables" "tt" inner join "sys"."schemas" "ss" 
on "tt"."schema_id" = "ss"."id" where "tt"."name" = 'atable';
+% .ss # table_name
+% name # name
+% varchar # type
+% 9 # length
+[ "oldtables"  ]
 #alter table "oldtables"."atable" set schema "newtables";
-#select "a" from "newtables"."atable";
+#select "ss"."name" from "sys"."tables" "tt" inner join "sys"."schemas" "ss" 
on "tt"."schema_id" = "ss"."id" where "tt"."name" = 'atable';
+% .ss # table_name
+% name # name
+% varchar # type
+% 9 # length
+[ "newtables"  ]
+#select "a" from "newtables"."atable" where false;
 % newtables.atable # table_name
 % a # name
 % int # type
 % 1 # length
-[ 1    ]
+#start transaction;
+#select "ss"."name" from "sys"."tables" "tt" inner join "sys"."schemas" "ss" 
on "tt"."schema_id" = "ss"."id" where "tt"."name" = 'atable';
+% .ss # table_name
+% name # name
+% varchar # type
+% 9 # length
+[ "newtables"  ]
+#alter table "newtables"."atable" set schema "oldtables";
+#select "ss"."name" from "sys"."tables" "tt" inner join "sys"."schemas" "ss" 
on "tt"."schema_id" = "ss"."id" where "tt"."name" = 'atable';
+% .ss # table_name
+% name # name
+% varchar # type
+% 9 # length
+[ "oldtables"  ]
+#select "a" from "oldtables"."atable" where false;
+% oldtables.atable # table_name
+% a # name
+% int # type
+% 1 # length
+#rollback;
+#select "ss"."name" from "sys"."tables" "tt" inner join "sys"."schemas" "ss" 
on "tt"."schema_id" = "ss"."id" where "tt"."name" = 'atable';
+% .ss # table_name
+% name # name
+% varchar # type
+% 9 # length
+[ "newtables"  ]
+#select "a" from "newtables"."atable" where false;
+% newtables.atable # table_name
+% a # name
+% int # type
+% 1 # length
 #drop table "newtables"."atable";
 #drop schema "oldtables";
 #drop schema "newtables";
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to