Debian Codegraph @

mysql-test/suite/rpl_nogtid/r/rpl_create_if_not_exists.result

raw
1 include/master-slave.inc
2 Warnings:
3 Note #### Sending passwords in plain text without SSL/TLS is extremely insecure.
4 Note #### Storing MySQL user name or password information in the connection metadata repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START REPLICA; see the 'START REPLICA Syntax' in the MySQL Manual for more information.
5 [connection master]
6 DROP DATABASE IF EXISTS mysqltest;
7 CREATE DATABASE IF NOT EXISTS mysqltest;
8 USE mysqltest;
9 CREATE TABLE IF NOT EXISTS t(c1 int);
10 CREATE TABLE IF NOT EXISTS t1 LIKE t;
11 CREATE TABLE IF NOT EXISTS t2 SELECT * FROM t;
12 CREATE EVENT IF NOT EXISTS e
13 ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 HOUR
14 DO SELECT now();
15 include/sync_slave_sql_with_master.inc
16 DROP DATABASE mysqltest;
17 CREATE DATABASE IF NOT EXISTS mysqltest;
18 USE mysqltest;
19 CREATE TABLE IF NOT EXISTS t(c1 int);
20 CREATE TABLE IF NOT EXISTS t1 LIKE t;
21 CREATE TABLE IF NOT EXISTS t2 SELECT * FROM t;
22 CREATE EVENT IF NOT EXISTS e
23 ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 HOUR
24 DO SELECT now();
25 include/sync_slave_sql_with_master.inc
26 SHOW TABLES in mysqltest;
27 Tables_in_mysqltest
28 t
29 t1
30 SHOW EVENTS in mysqltest;
31 Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation
32 mysqltest e root@localhost SYSTEM ONE TIME # NULL NULL NULL NULL SLAVESIDE_DISABLED 1 utf8mb4 utf8mb4_0900_ai_ci utf8mb4_0900_ai_ci
33 DROP DATABASE IF EXISTS mysqltest;
34 -------------BUG#47418-------------
35 USE test;
36 DROP TABLE IF EXISTS t3;
37 CREATE TABLE t3(c1 INTEGER);
38 INSERT INTO t3 VALUES(33);
39 CREATE TEMPORARY TABLE t1(c1 INTEGER);
40 CREATE TEMPORARY TABLE t2(c1 INTEGER);
41 INSERT INTO t1 VALUES(1);
42 INSERT INTO t2 VALUES(1);
43 CREATE TABLE IF NOT EXISTS t1(c1 INTEGER) SELECT c1 FROM t3;
44 CREATE TABLE t2(c1 INTEGER) SELECT c1 FROM t3;
45 SELECT * FROM t1;
46 c1
47 1
48 SELECT * FROM t2;
49 c1
50 1
51 include/sync_slave_sql_with_master.inc
52 SELECT * FROM t1;
53 c1
54 33
55 SELECT * FROM t2;
56 c1
57 33
58 DROP TEMPORARY TABLE t1;
59 DROP TEMPORARY TABLE t2;
60 SELECT * FROM t1;
61 c1
62 33
63 SELECT * FROM t2;
64 c1
65 33
66 DROP TABLE t1;
67 DROP TABLE t2;
68 DROP TABLE t3;
69 # WL#5370
70 # The behavior of statement 'CREATE TABLE SELECT IF NOT EXISTS' is changed.
71 # After the worklog, it will insert nothing and the statement will not be
72 # binlogged if the table already exists.
73 # After the worklog, some bugs will disappear automotically.
74 include/rpl_reset.inc
75
76 # Case 1: BUG#47132
77 call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT.*");
78 CREATE TABLE t1 (id int);
79 CREATE TABLE t2 (id int);
80 INSERT INTO t1 VALUES (1), (1);
81 INSERT INTO t2 VALUES (2), (2);
82 CREATE VIEW v1 AS SELECT id FROM t2;
83 CREATE TABLE IF NOT EXISTS v1(a int, b int) SELECT id, id FROM t1;
84 Warnings:
85 Note 1050 Table 'v1' already exists
86 include/show_binlog_events.inc
87 SHOW CREATE TABLE v1;
88 View Create View character_set_client collation_connection
89 v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t2`.`id` AS `id` from `t2` utf8mb4 utf8mb4_0900_ai_ci
90 SELECT * FROM t2;
91 id
92 2
93 2
94 SELECT * FROM v1;
95 id
96 2
97 2
98 DROP VIEW v1;
99 CREATE TEMPORARY TABLE tt1 AS SELECT id FROM t2;
100 CREATE TEMPORARY TABLE IF NOT EXISTS tt1(a int, b int) SELECT id, id FROM t1;
101 Warnings:
102 Note 1050 Table 'tt1' already exists
103 include/show_binlog_events.inc
104 SELECT * FROM t2;
105 id
106 2
107 2
108 SELECT * FROM tt1;
109 id
110 2
111 2
112 DROP TEMPORARY TABLE tt1;
113
114 # Case 1: BUG#47132
115 # RBR breaks on CREATE TABLE IF EXISTS <existing VIEW> AS SELECT
116 CREATE VIEW v1 AS SELECT 1 as a;
117 CREATE TABLE IF NOT EXISTS v1 SELECT 2 as a;
118 Warnings:
119 Note 1050 Table 'v1' already exists
120 include/show_binlog_events.inc
121 include/sync_slave_sql_with_master.inc
122 DROP VIEW v1;
123 DROP TABLE t1, t2;
124 #
125 # Test case which has failed on assertion after refactoring which was
126 # made as part of fix for bug #27480 "Extend CREATE TEMPORARY TABLES
127 # privilege to allow temp table operations".
128 #
129 CREATE TEMPORARY TABLE t1 (id int);
130 CREATE TABLE IF NOT EXISTS t2 LIKE t1;
131 # The below statement should succeed with warning and
132 # should not crash due to failing assertion.
133 CREATE TABLE IF NOT EXISTS t2 LIKE t1;
134 Warnings:
135 Note 1050 Table 't2' already exists
136 # Clean-up.
137 DROP TABLE t1, t2;
138 include/sync_slave_sql_with_master.inc
139 include/rpl_end.inc