Debian Codegraph @

mysql-test/suite/sysschema/r/pr_create_synonym_db.result

raw
1 CREATE TABLE t1 (t1_id int PRIMARY KEY, t1_val varchar(10));
2 CREATE TABLE t2 (t2_id int PRIMARY KEY, t1_id int, t2_val int, INDEX (t1_id));
3 CREATE TABLE `is` (t1_id int PRIMARY KEY, t1_val varchar(10));
4 CREATE TABLE `ab``c` (t1_id int PRIMARY KEY, t1_val varchar(10));
5 CREATE SQL SECURITY INVOKER VIEW myview AS SELECT * FROM t1 NATURAL JOIN t2;
6 CALL sys.create_synonym_db('test', 'test1');
7 summary
8 Created 5 views in the `test1` database
9 SELECT TABLE_NAME, SECURITY_TYPE FROM information_schema.VIEWS WHERE TABLE_SCHEMA = 'test1' ORDER BY TABLE_NAME;
10 TABLE_NAME SECURITY_TYPE
11 ab`c INVOKER
12 is INVOKER
13 myview INVOKER
14 t1 INVOKER
15 t2 INVOKER
16 CALL sys.create_synonym_db('test', 'test1');
17 ERROR HY000: Can't create database test1; database exists
18 CREATE SCHEMA test2;
19 CALL sys.create_synonym_db('test', 'test2');
20 ERROR HY000: Can't create database test2; database exists
21 SELECT COUNT(*) FROM information_schema.TABLES WHERE TABLE_SCHEMA = 'test2';
22 COUNT(*)
23 0
24 CALL sys.create_synonym_db('test', 'is');
25 summary
26 Created 5 views in the `is` database
27 SELECT TABLE_NAME, SECURITY_TYPE FROM information_schema.VIEWS WHERE TABLE_SCHEMA = 'is' ORDER BY TABLE_NAME;
28 TABLE_NAME SECURITY_TYPE
29 ab`c INVOKER
30 is INVOKER
31 myview INVOKER
32 t1 INVOKER
33 t2 INVOKER
34 CALL sys.create_synonym_db('is', 'i`s');
35 summary
36 Created 5 views in the `i``s` database
37 SELECT TABLE_NAME, SECURITY_TYPE FROM information_schema.VIEWS WHERE TABLE_SCHEMA = 'i`s' ORDER BY TABLE_NAME;
38 TABLE_NAME SECURITY_TYPE
39 ab`c INVOKER
40 is INVOKER
41 myview INVOKER
42 t1 INVOKER
43 t2 INVOKER
44 DROP SCHEMA test1;
45 DROP SCHEMA test2;
46 DROP SCHEMA `is`;
47 DROP SCHEMA `i``s`;
48 DROP VIEW test.myview;
49 DROP TABLE test.t1;
50 DROP TABLE test.t2;
51 DROP TABLE `is`;
52 DROP TABLE `ab``c`;