1
drop table if exists t1,t2,t3,t4,t5;
2
set session debug="+d,sleep_create_select_before_create";
3
create table t1 select 1 as i;;
4
create table t1 (j char(5));
5
ERROR 42S01: Table 't1' already exists
9
`i` int(1) NOT NULL DEFAULT '0'
10
) ENGINE=MyISAM DEFAULT CHARSET=latin1
12
create table t1 select 1 as i;;
13
create table t1 select "Test" as j;
14
ERROR 42S01: Table 't1' already exists
17
t1 CREATE TABLE `t1` (
18
`i` int(1) NOT NULL DEFAULT '0'
19
) ENGINE=MyISAM DEFAULT CHARSET=latin1
21
create table t3 (j char(5));
22
create table t1 select 1 as i;;
23
create table t1 like t3;
24
ERROR 42S01: Table 't1' already exists
27
t1 CREATE TABLE `t1` (
28
`i` int(1) NOT NULL DEFAULT '0'
29
) ENGINE=MyISAM DEFAULT CHARSET=latin1
31
create table t1 select 1 as i;;
32
rename table t3 to t1;
33
ERROR 42S01: Table 't1' already exists
36
t1 CREATE TABLE `t1` (
37
`i` int(1) NOT NULL DEFAULT '0'
38
) ENGINE=MyISAM DEFAULT CHARSET=latin1
40
create table t1 select 1 as i;;
41
alter table t3 rename to t1;
42
ERROR 42S01: Table 't1' already exists
45
t1 CREATE TABLE `t1` (
46
`i` int(1) NOT NULL DEFAULT '0'
47
) ENGINE=MyISAM DEFAULT CHARSET=latin1
49
create table t1 select 1 as i;;
50
alter table t3 rename to t1, add k int;
51
ERROR 42S01: Table 't1' already exists
54
t1 CREATE TABLE `t1` (
55
`i` int(1) NOT NULL DEFAULT '0'
56
) ENGINE=MyISAM DEFAULT CHARSET=latin1
58
set session debug="-d,sleep_create_select_before_create:+d,sleep_create_select_before_open";
59
create table t1 select 1 as i;;
61
create table t1 select 1 as i;;
62
rename table t1 to t2;
64
create table t1 select 1 as i;;
69
create table t1 select 1 as i;;
70
insert into t1 values (2);
77
create table t1 select 1 as i;;
78
create trigger t1_bi before insert on t1 for each row set @a:=1;
83
set session debug="-d,sleep_create_select_before_open:+d,sleep_create_select_before_lock";
84
create table t1 select 1 as i;;
86
create table t1 select 1 as i;;
87
rename table t1 to t2;
89
create table t1 select 1 as i;;
94
create table t1 select 1 as i;;
95
insert into t1 values (2);
102
create table t1 select 1 as i;;
103
create trigger t1_bi before insert on t1 for each row set @a:=1;
108
set session debug="-d,sleep_create_select_before_lock:+d,sleep_create_select_before_check_if_exists";
109
create table t1 (i int);
110
create table if not exists t1 select 1 as i;;
113
Note 1050 Table 't1' already exists
114
create table t1 (i int);
116
create table if not exists t1 select 1 as i;;
117
create trigger t1_bi before insert on t1 for each row set @a:=1;
119
Note 1050 Table 't1' already exists
127
set session debug="-d,sleep_create_select_before_check_if_exists";
128
create table t2 (a int);
129
create table t4 (b int);
134
create table t3 as select * from t4;;
135
create table t1 select * from t2, t3;;
139
show create table t1;
141
t1 CREATE TABLE `t1` (
142
`a` int(11) DEFAULT NULL,
143
`b` int(11) DEFAULT NULL
144
) ENGINE=MyISAM DEFAULT CHARSET=latin1
150
rename table t4 to t3;;
151
create table if not exists t1 select 1 as i from t2, t3;;
152
create table t5 (j int);
153
rename table t5 to t1;
156
Note 1050 Table 't1' already exists
159
show create table t1;
161
t1 CREATE TABLE `t1` (
162
`j` int(11) DEFAULT NULL
163
) ENGINE=MyISAM DEFAULT CHARSET=latin1
164
drop table t1, t2, t3;
165
drop table if exists t1,t2;
166
create table t1 (i int);
167
set session debug="+d,sleep_create_like_before_check_if_exists";
169
create table t2 like t1;;
170
insert into t1 values (1);
172
show create table t2;
174
t2 CREATE TABLE `t2` (
175
`i` int(11) DEFAULT NULL
176
) ENGINE=MyISAM DEFAULT CHARSET=latin1
178
show binlog events in 'master-bin.000001' from 106;
179
Log_name Pos Event_type Server_id End_log_pos Info
180
master-bin.000001 # Query 1 # use `test`; insert into t1 values (1)
181
master-bin.000001 # Query 1 # use `test`; create table t2 like t1
182
master-bin.000001 # Query 1 # use `test`; drop table t1
183
master-bin.000001 # Query 1 # use `test`; drop table t2
184
create table t1 (i int);
185
set session debug="-d,sleep_create_like_before_check_if_exists:+d,sleep_create_like_before_copy";
186
create table t2 like t1;;
187
create table if not exists t2 (j int);
189
Note 1050 Table 't2' already exists
190
show create table t2;
192
t2 CREATE TABLE `t2` (
193
`i` int(11) DEFAULT NULL
194
) ENGINE=MyISAM DEFAULT CHARSET=latin1
197
create table t2 like t1;;
200
show binlog events in 'master-bin.000001' from 106;
201
Log_name Pos Event_type Server_id End_log_pos Info
202
master-bin.000001 # Query 1 # use `test`; create table t2 like t1
203
master-bin.000001 # Query 1 # use `test`; drop table t1
204
master-bin.000001 # Query 1 # use `test`; drop table t2
205
create table t1 (i int);
206
set session debug="-d,sleep_create_like_before_copy:+d,sleep_create_like_before_ha_create";
208
create table t2 like t1;;
209
insert into t2 values (1);
211
create table t2 like t1;;
213
create table t2 like t1;;
216
show binlog events in 'master-bin.000001' from 106;
217
Log_name Pos Event_type Server_id End_log_pos Info
218
master-bin.000001 # Query 1 # use `test`; create table t2 like t1
219
master-bin.000001 # Query 1 # use `test`; insert into t2 values (1)
220
master-bin.000001 # Query 1 # use `test`; drop table t2
221
master-bin.000001 # Query 1 # use `test`; create table t2 like t1
222
master-bin.000001 # Query 1 # use `test`; drop table t2
223
master-bin.000001 # Query 1 # use `test`; create table t2 like t1
224
master-bin.000001 # Query 1 # use `test`; drop table t1
225
master-bin.000001 # Query 1 # use `test`; drop table t2
226
create table t1 (i int);
227
set session debug="-d,sleep_create_like_before_ha_create:+d,sleep_create_like_before_binlogging";
229
create table t2 like t1;;
230
insert into t2 values (1);
232
create table t2 like t1;;
234
create table t2 like t1;;
237
show binlog events in 'master-bin.000001' from 106;
238
Log_name Pos Event_type Server_id End_log_pos Info
239
master-bin.000001 # Query 1 # use `test`; create table t2 like t1
240
master-bin.000001 # Query 1 # use `test`; insert into t2 values (1)
241
master-bin.000001 # Query 1 # use `test`; drop table t2
242
master-bin.000001 # Query 1 # use `test`; create table t2 like t1
243
master-bin.000001 # Query 1 # use `test`; drop table t2
244
master-bin.000001 # Query 1 # use `test`; create table t2 like t1
245
master-bin.000001 # Query 1 # use `test`; drop table t1
246
master-bin.000001 # Query 1 # use `test`; drop table t2
247
set session debug="-d,sleep_create_like_before_binlogging";