blob: 45d5b422f3feaf9d50f8a817ff8f0a66be8cd15f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
|
connection node_2;
connection node_1;
#
# MDEV-7222: Cluster Node Crash at CREATE DEFINER statement
#
USE test;
CREATE DEFINER=CURRENT_USER VIEW v1 AS SELECT 1;
DROP VIEW v1;
#
# MDEV-8464 : ALTER VIEW not replicated in some cases
#
# On node_1
connection node_1;
USE test;
CREATE TABLE t1(i INT) ENGINE=INNODB;
CREATE DEFINER=CURRENT_USER VIEW v1 AS SELECT * FROM t1;
CREATE ALGORITHM=MERGE VIEW v2 AS SELECT * FROM t1;
CREATE ALGORITHM=TEMPTABLE VIEW v3 AS SELECT * FROM t1;
CREATE ALGORITHM=UNDEFINED DEFINER=CURRENT_USER VIEW v4 AS SELECT * FROM t1;
# On node_2
connection node_2;
USE test;
SHOW CREATE VIEW v1;
View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`i` AS `i` from `t1` latin1 latin1_swedish_ci
SHOW CREATE VIEW v2;
View Create View character_set_client collation_connection
v2 CREATE ALGORITHM=MERGE DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v2` AS select `t1`.`i` AS `i` from `t1` latin1 latin1_swedish_ci
SHOW CREATE VIEW v3;
View Create View character_set_client collation_connection
v3 CREATE ALGORITHM=TEMPTABLE DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v3` AS select `t1`.`i` AS `i` from `t1` latin1 latin1_swedish_ci
SHOW CREATE VIEW v4;
View Create View character_set_client collation_connection
v4 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v4` AS select `t1`.`i` AS `i` from `t1` latin1 latin1_swedish_ci
# On node_1
connection node_1;
ALTER ALGORITHM=MERGE VIEW v1 AS SELECT * FROM t1;
ALTER ALGORITHM=UNDEFINED VIEW v2 AS SELECT * FROM t1;
ALTER DEFINER=CURRENT_USER VIEW v3 AS SELECT * FROM t1;
ALTER ALGORITHM=TEMPTABLE DEFINER=CURRENT_USER VIEW v4 AS SELECT * FROM t1;
# On node_2
connection node_2;
SHOW CREATE VIEW v1;
View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=MERGE DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`i` AS `i` from `t1` latin1 latin1_swedish_ci
SHOW CREATE VIEW v2;
View Create View character_set_client collation_connection
v2 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v2` AS select `t1`.`i` AS `i` from `t1` latin1 latin1_swedish_ci
SHOW CREATE VIEW v3;
View Create View character_set_client collation_connection
v3 CREATE ALGORITHM=TEMPTABLE DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v3` AS select `t1`.`i` AS `i` from `t1` latin1 latin1_swedish_ci
SHOW CREATE VIEW v4;
View Create View character_set_client collation_connection
v4 CREATE ALGORITHM=TEMPTABLE DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v4` AS select `t1`.`i` AS `i` from `t1` latin1 latin1_swedish_ci
# Cleanup
DROP VIEW v1, v2, v3, v4;
DROP TABLE t1;
# End of tests
|