Debian Codegraph @

mysql-test/suite/rpl/r/rpl_temporary.result

raw
1 SET sql_log_bin = 0;
2 SET sql_log_bin = 1;
3 include/master-slave.inc
4 [connection master]
5 connection slave;
6 reset master;
7 connection master;
8 DROP TABLE IF EXISTS t1;
9 CREATE TEMPORARY TABLE t1 (a char(1));
10 INSERT INTO t1 VALUES ('a');
11 connection slave;
12 include/stop_slave.inc
13 include/start_slave.inc
14 connection master;
15 INSERT INTO t1 VALUES ('b');
16 connection slave;
17 connection master;
18 DROP TABLE IF EXISTS t1;
19 CREATE TEMPORARY TABLE `t1`(`a` tinyint,`b` char(1))engine=myisam;
20 INSERT IGNORE INTO `t1` set `a`=128,`b`='128';
21 Warnings:
22 Warning 1264 Out of range value for column 'a' at row 1
23 Warning 1265 Data truncated for column 'b' at row 1
24 connection slave;
25 include/stop_slave.inc
26 include/start_slave.inc
27 connection master;
28 INSERT IGNORE INTO `t1` set `a`=128,`b`='128';
29 Warnings:
30 Warning 1264 Out of range value for column 'a' at row 1
31 Warning 1265 Data truncated for column 'b' at row 1
32 connection slave;
33 connection master;
34 DROP TABLE t1;
35 connection slave;
36 connection master;
37 create user zedjzlcsjhd@localhost;
38 GRANT ALL on test.* to zedjzlcsjhd@localhost;
39 connect con1,localhost,root,,;
40 connect con2,localhost,root,,;
41 connect con3,localhost,zedjzlcsjhd,,;
42 connection con3;
43 SET @save_select_limit=@@session.sql_select_limit;
44 SET @@session.sql_select_limit=10, @@session.pseudo_thread_id=100;
45 ERROR 42000: Access denied; you need (at least one of) the BINLOG REPLAY privilege(s) for this operation
46 SELECT @@session.sql_select_limit = @save_select_limit;
47 @@session.sql_select_limit = @save_select_limit
48 1
49 SET @@session.sql_select_limit=10, @@session.sql_log_bin=0;
50 ERROR 42000: Access denied; you need (at least one of) the BINLOG ADMIN privilege(s) for this operation
51 SELECT @@session.sql_select_limit = @save_select_limit;
52 @@session.sql_select_limit = @save_select_limit
53 1
54 connection con2;
55 SET @save_conn_id= connection_id();
56 SET @@session.pseudo_thread_id=100;
57 SET @@session.pseudo_thread_id=connection_id();
58 SET @@session.pseudo_thread_id=@save_conn_id;
59 SET @@session.sql_log_bin=0;
60 SET @@session.sql_log_bin=1;
61 connection con3;
62 drop table if exists t1,t2;
63 create table t1(f int);
64 create table t2(f int);
65 insert into t1 values (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
66 SELECT COUNT(*) FROM t1;
67 COUNT(*)
68 10
69 connection con1;
70 create temporary table t3(f int);
71 insert into t3 select * from t1 where f<6;
72 connection con2;
73 create temporary table t3(f int);
74 connection con1;
75 insert into t2 select count(*) from t3;
76 connection con2;
77 insert into t3 select * from t1 where f>=4;
78 connection con1;
79 drop temporary table t3;
80 connection con2;
81 insert into t2 select count(*) from t3;
82 drop temporary table t3;
83 select * from t2 ORDER BY f;
84 f
85 5
86 7
87 drop table t1, t2;
88 drop user zedjzlcsjhd@localhost;
89 use test;
90 SET TIMESTAMP=1040323920;
91 create table t1(f int);
92 SET TIMESTAMP=1040323931;
93 create table t2(f int);
94 SET TIMESTAMP=1040323938;
95 insert into t1 values (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
96 SET TIMESTAMP=1040323945;
97 SET @@session.pseudo_thread_id=1;
98 create temporary table t3(f int);
99 SET TIMESTAMP=1040323952;
100 SET @@session.pseudo_thread_id=1;
101 insert into t3 select * from t1 where f<6;
102 SET TIMESTAMP=1040324145;
103 SET @@session.pseudo_thread_id=2;
104 create temporary table t3(f int);
105 SET TIMESTAMP=1040324186;
106 SET @@session.pseudo_thread_id=1;
107 insert into t2 select count(*) from t3;
108 SET TIMESTAMP=1040324200;
109 SET @@session.pseudo_thread_id=2;
110 insert into t3 select * from t1 where f>=4;
111 SET TIMESTAMP=1040324211;
112 SET @@session.pseudo_thread_id=1;
113 drop temporary table t3;
114 SET TIMESTAMP=1040324219;
115 SET @@session.pseudo_thread_id=2;
116 insert into t2 select count(*) from t3;
117 SET TIMESTAMP=1040324224;
118 SET @@session.pseudo_thread_id=2;
119 drop temporary table t3;
120 select * from t2 ORDER BY f;
121 f
122 5
123 7
124 drop table t1,t2;
125 create temporary table t3 (f int);
126 connection slave;
127 connection master;
128 create temporary table t4 (f int);
129 create table t5 (f int);
130 connection slave;
131 stop slave;
132 connection master;
133 insert into t5 select * from t4;
134 connection slave;
135 start slave;
136 select * from t5 /* must be 1 after reconnection */;
137 f
138 connection master;
139 drop temporary table t4;
140 drop table t5;
141 connection con1;
142 set @@session.pseudo_thread_id=100;
143 create temporary table t101 (id int);
144 create temporary table t102 (id int);
145 set @@session.pseudo_thread_id=200;
146 create temporary table t201 (id int);
147 create temporary table `t``201` (id int);
148 create temporary table `#sql_not_user_table202` (id int);
149 set @@session.pseudo_thread_id=300;
150 create temporary table t301 (id int);
151 create temporary table t302 (id int);
152 create temporary table `#sql_not_user_table303` (id int);
153 disconnect con1;
154 connection master;
155 create table t1(f int);
156 insert into t1 values (1);
157 connection slave;
158 select * from t1 /* must be 1 */;
159 f
160 1
161 connection master;
162 drop table t1;
163 connection slave;
164 select * from t1;
165 a
166 1
167 connection master;
168 drop table t1;
169 connection slave;
170 include/stop_slave.inc
171 connection master;
172 include/rpl_reset.inc
173 -- Bug#43748
174 -- make a user on the slave that can list but not kill system threads.
175 connection slave;
176 FLUSH PRIVILEGES;
177 GRANT USAGE ON *.* TO [email protected] IDENTIFIED BY 'meow';
178 GRANT PROCESS ON *.* TO [email protected];
179 -- try to KILL system-thread as that non-privileged user (on slave).
180 connect cont43748,127.0.0.1,user43748,meow,"*NO-ONE*",$SLAVE_MYPORT,;
181 connection cont43748;
182 SELECT id INTO @id FROM information_schema.processlist WHERE user='system user' LIMIT 1;
183 KILL @id;
184 Got one of the listed errors
185 disconnect cont43748;
186 -- throw out test-user on slave.
187 connection slave;
188 DROP USER [email protected];
189 #
190 # MDEV-10216: Assertion `strcmp(share->unique_file_name,filename) ||
191 # share->last_version' failed in myisam/mi_open.c:67: test_if_reopen
192 #
193 connection master;
194 CREATE TEMPORARY TABLE t1(i INT PRIMARY KEY) ENGINE=MYISAM;
195 INSERT INTO t1 VALUES(1);
196 SELECT COUNT(*)=1 FROM t1;
197 COUNT(*)=1
198 1
199 ALTER TABLE t1 RENAME t2;
200 SELECT COUNT(*)=1 FROM t2;
201 COUNT(*)=1
202 1
203 ALTER TABLE t2 RENAME t1;
204 ALTER TABLE t1 DISABLE KEYS;
205 ALTER TABLE t1 ENABLE KEYS;
206 LOCK TABLES t1 WRITE;
207 ALTER TABLE t1 RENAME t2;
208 SELECT COUNT(*)=1 FROM t2;
209 COUNT(*)=1
210 1
211 ALTER TABLE t2 RENAME t1;
212 ALTER TABLE t1 DISABLE KEYS;
213 ALTER TABLE t1 ENABLE KEYS;
214 UNLOCK TABLES;
215 LOCK TABLES t1 READ;
216 ALTER TABLE t1 RENAME t2;
217 SELECT COUNT(*)=1 FROM t2;
218 COUNT(*)=1
219 1
220 ALTER TABLE t2 RENAME t1;
221 ALTER TABLE t1 DISABLE KEYS;
222 ALTER TABLE t1 ENABLE KEYS;
223 UNLOCK TABLES;
224 FLUSH TABLES WITH READ LOCK;
225 ALTER TABLE t1 RENAME t2;
226 SELECT COUNT(*)=1 FROM t2;
227 COUNT(*)=1
228 1
229 ALTER TABLE t2 RENAME t1;
230 ALTER TABLE t1 DISABLE KEYS;
231 ALTER TABLE t1 ENABLE KEYS;
232 UNLOCK TABLES;
233 ALTER TABLE t1 RENAME t2, LOCK SHARED;
234 ALTER TABLE t2 RENAME t1, LOCK EXCLUSIVE;
235 DROP TABLE t1;
236 #
237 # MDEV-10320: NO-OP ALTER TABLE on temporary tables getting logged
238 # under row binlog format
239 #
240 connection master;
241 CREATE TEMPORARY TABLE t1(i INT PRIMARY KEY) ENGINE=MYISAM;
242 ALTER TABLE t1;
243 ALTER TABLE t1 ADD COLUMN IF NOT EXISTS I INT;
244 Warnings:
245 Note 1060 Duplicate column name 'I'
246 DROP TABLE t1;
247 End of 5.1 tests
248 include/rpl_end.inc