1
by brian
clean slate |
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 |
|
6 |
show create table t1; |
|
7 |
Table Create Table |
|
8 |
t1 CREATE TABLE `t1` ( |
|
9 |
`i` int(1) NOT NULL DEFAULT '0' |
|
10 |
) ENGINE=MyISAM DEFAULT CHARSET=latin1 |
|
11 |
drop table t1; |
|
12 |
create table t1 select 1 as i;; |
|
13 |
create table t1 select "Test" as j; |
|
14 |
ERROR 42S01: Table 't1' already exists |
|
15 |
show create table t1; |
|
16 |
Table Create Table |
|
17 |
t1 CREATE TABLE `t1` ( |
|
18 |
`i` int(1) NOT NULL DEFAULT '0' |
|
19 |
) ENGINE=MyISAM DEFAULT CHARSET=latin1 |
|
20 |
drop table t1; |
|
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 |
|
25 |
show create table t1; |
|
26 |
Table Create Table |
|
27 |
t1 CREATE TABLE `t1` ( |
|
28 |
`i` int(1) NOT NULL DEFAULT '0' |
|
29 |
) ENGINE=MyISAM DEFAULT CHARSET=latin1 |
|
30 |
drop table t1; |
|
31 |
create table t1 select 1 as i;; |
|
32 |
rename table t3 to t1; |
|
33 |
ERROR 42S01: Table 't1' already exists |
|
34 |
show create table t1; |
|
35 |
Table Create Table |
|
36 |
t1 CREATE TABLE `t1` ( |
|
37 |
`i` int(1) NOT NULL DEFAULT '0' |
|
38 |
) ENGINE=MyISAM DEFAULT CHARSET=latin1 |
|
39 |
drop table t1; |
|
40 |
create table t1 select 1 as i;; |
|
41 |
alter table t3 rename to t1; |
|
42 |
ERROR 42S01: Table 't1' already exists |
|
43 |
show create table t1; |
|
44 |
Table Create Table |
|
45 |
t1 CREATE TABLE `t1` ( |
|
46 |
`i` int(1) NOT NULL DEFAULT '0' |
|
47 |
) ENGINE=MyISAM DEFAULT CHARSET=latin1 |
|
48 |
drop table t1; |
|
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 |
|
52 |
show create table t1; |
|
53 |
Table Create Table |
|
54 |
t1 CREATE TABLE `t1` ( |
|
55 |
`i` int(1) NOT NULL DEFAULT '0' |
|
56 |
) ENGINE=MyISAM DEFAULT CHARSET=latin1 |
|
57 |
drop table t1, t3; |
|
58 |
set session debug="-d,sleep_create_select_before_create:+d,sleep_create_select_before_open"; |
|
59 |
create table t1 select 1 as i;; |
|
60 |
drop table t1; |
|
61 |
create table t1 select 1 as i;; |
|
62 |
rename table t1 to t2; |
|
63 |
drop table t2; |
|
64 |
create table t1 select 1 as i;; |
|
65 |
select * from t1; |
|
66 |
i
|
|
67 |
1
|
|
68 |
drop table t1; |
|
69 |
create table t1 select 1 as i;; |
|
70 |
insert into t1 values (2); |
|
71 |
select * from t1; |
|
72 |
i
|
|
73 |
1
|
|
74 |
2
|
|
75 |
drop table t1; |
|
76 |
set @a:=0; |
|
77 |
create table t1 select 1 as i;; |
|
78 |
create trigger t1_bi before insert on t1 for each row set @a:=1; |
|
79 |
select @a; |
|
80 |
@a
|
|
81 |
0
|
|
82 |
drop table t1; |
|
83 |
set session debug="-d,sleep_create_select_before_open:+d,sleep_create_select_before_lock"; |
|
84 |
create table t1 select 1 as i;; |
|
85 |
drop table t1; |
|
86 |
create table t1 select 1 as i;; |
|
87 |
rename table t1 to t2; |
|
88 |
drop table t2; |
|
89 |
create table t1 select 1 as i;; |
|
90 |
select * from t1; |
|
91 |
i
|
|
92 |
1
|
|
93 |
drop table t1; |
|
94 |
create table t1 select 1 as i;; |
|
95 |
insert into t1 values (2); |
|
96 |
select * from t1; |
|
97 |
i
|
|
98 |
1
|
|
99 |
2
|
|
100 |
drop table t1; |
|
101 |
set @a:=0; |
|
102 |
create table t1 select 1 as i;; |
|
103 |
create trigger t1_bi before insert on t1 for each row set @a:=1; |
|
104 |
select @a; |
|
105 |
@a
|
|
106 |
0
|
|
107 |
drop table t1; |
|
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;; |
|
111 |
drop table t1; |
|
112 |
Warnings: |
|
113 |
Note 1050 Table 't1' already exists |
|
114 |
create table t1 (i int); |
|
115 |
set @a:=0; |
|
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; |
|
118 |
Warnings: |
|
119 |
Note 1050 Table 't1' already exists |
|
120 |
select @a; |
|
121 |
@a
|
|
122 |
0
|
|
123 |
select * from t1; |
|
124 |
i
|
|
125 |
1
|
|
126 |
drop table t1; |
|
127 |
set session debug="-d,sleep_create_select_before_check_if_exists"; |
|
128 |
create table t2 (a int); |
|
129 |
create table t4 (b int); |
|
130 |
lock table t4 write; |
|
131 |
select 1; |
|
132 |
1
|
|
133 |
1
|
|
134 |
create table t3 as select * from t4;; |
|
135 |
create table t1 select * from t2, t3;; |
|
136 |
unlock tables; |
|
137 |
select * from t1; |
|
138 |
a b |
|
139 |
show create table t1; |
|
140 |
Table Create Table |
|
141 |
t1 CREATE TABLE `t1` ( |
|
142 |
`a` int(11) DEFAULT NULL, |
|
143 |
`b` int(11) DEFAULT NULL |
|
144 |
) ENGINE=MyISAM DEFAULT CHARSET=latin1 |
|
145 |
drop table t1, t3; |
|
146 |
lock table t4 read; |
|
147 |
select 1; |
|
148 |
1
|
|
149 |
1
|
|
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; |
|
154 |
unlock tables; |
|
155 |
Warnings: |
|
156 |
Note 1050 Table 't1' already exists |
|
157 |
select * from t1; |
|
158 |
j
|
|
159 |
show create table t1; |
|
160 |
Table Create Table |
|
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"; |
|
168 |
reset master; |
|
169 |
create table t2 like t1;; |
|
170 |
insert into t1 values (1); |
|
171 |
drop table t1; |
|
172 |
show create table t2; |
|
173 |
Table Create Table |
|
174 |
t2 CREATE TABLE `t2` ( |
|
175 |
`i` int(11) DEFAULT NULL |
|
176 |
) ENGINE=MyISAM DEFAULT CHARSET=latin1 |
|
177 |
drop table t2; |
|
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); |
|
188 |
Warnings: |
|
189 |
Note 1050 Table 't2' already exists |
|
190 |
show create table t2; |
|
191 |
Table Create Table |
|
192 |
t2 CREATE TABLE `t2` ( |
|
193 |
`i` int(11) DEFAULT NULL |
|
194 |
) ENGINE=MyISAM DEFAULT CHARSET=latin1 |
|
195 |
drop table t2; |
|
196 |
reset master; |
|
197 |
create table t2 like t1;; |
|
198 |
drop table t1; |
|
199 |
drop table t2; |
|
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"; |
|
207 |
reset master; |
|
208 |
create table t2 like t1;; |
|
209 |
insert into t2 values (1); |
|
210 |
drop table t2; |
|
211 |
create table t2 like t1;; |
|
212 |
drop table t2; |
|
213 |
create table t2 like t1;; |
|
214 |
drop table t1; |
|
215 |
drop table t2; |
|
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"; |
|
228 |
reset master; |
|
229 |
create table t2 like t1;; |
|
230 |
insert into t2 values (1); |
|
231 |
drop table t2; |
|
232 |
create table t2 like t1;; |
|
233 |
drop table t2; |
|
234 |
create table t2 like t1;; |
|
235 |
drop table t1; |
|
236 |
drop table t2; |
|
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"; |