Skip to content

Commit 2ce5279

Browse files
committed
Merge branch '5.5' into 10.1
2 parents caa9023 + 757daa4 commit 2ce5279

29 files changed

+357
-108
lines changed

mysql-test/r/grant4.result

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,26 @@ View Create View character_set_client collation_connection
123123
v3 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v3` AS select `t_select_priv`.`a` AS `a`,`t_select_priv`.`b` AS `b` from `t_select_priv` latin1 latin1_swedish_ci
124124
drop database mysqltest_db1;
125125
drop user mysqltest_u1@localhost;
126+
call mtr.add_suppression("Table 'mysql.user' doesn't exist");
127+
call mtr.add_suppression("'mysql.user' is not TABLE");
128+
rename table mysql.user to mysql.user1;
129+
create view mysql.user as select * from mysql.user1;
130+
flush privileges;
131+
ERROR HY000: 'mysql.user' is not TABLE
132+
drop view mysql.user;
133+
create temporary table mysql.user select * from mysql.user1 limit 0;
134+
flush privileges;
135+
ERROR 42S02: Table 'mysql.user' doesn't exist
136+
drop temporary table mysql.user;
137+
rename table mysql.user1 to mysql.user;
138+
call mtr.add_suppression('mysql.user table is damaged');
139+
rename table mysql.user to mysql.user1;
140+
create table mysql.user (Host char(100), User char(100));
141+
flush privileges;
142+
ERROR HY000: Unknown error
143+
drop table mysql.user;
144+
rename table mysql.user1 to mysql.user;
145+
End of 5.5 tests
126146
#
127147
# Additional coverage for refactoring which is made as part
128148
# of fix for bug #27480 "Extend CREATE TEMPORARY TABLES privilege
@@ -215,3 +235,4 @@ ERROR HY000: Password hash should be a 16-digit hexadecimal number
215235
create user foo4 identified via mysql_old_password using '11111111111111111111111111111111111111111';
216236
ERROR HY000: Password hash should be a 16-digit hexadecimal number
217237
set GLOBAL sql_mode=default;
238+
End of 10.1 tests
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
PREPARE stmt2 FROM "CREATE VIEW v AS SELECT * FROM INFORMATION_SCHEMA.TABLES";
2+
FLUSH PRIVILEGES;
3+
EXECUTE stmt2;
4+
DROP VIEW v;

mysql-test/r/multi_update.result

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1018,6 +1018,27 @@ execute stmt1;
10181018
deallocate prepare stmt1;
10191019
drop view v3,v2,v1;
10201020
drop table t1,t2,t3;
1021+
create table t1 (id int not null, v1 varchar(10) not null);
1022+
insert into t1 values (1,1),(2,2);
1023+
create table t2 (log varchar(10) not null);
1024+
create trigger t1_after_update after update on t1
1025+
for each row insert into t2 values ('triggered');
1026+
create user foo;
1027+
grant select, insert, update, delete, create, drop, reload, index, alter, show databases, create temporary tables, lock tables, execute, create view, show view, create routine, alter routine, trigger on *.* to 'foo'@'%';
1028+
set global read_only=1;
1029+
create temporary table temp_t1 (id int not null, update_me varchar(10));
1030+
insert into temp_t1 values (1,1),(2,2),(3,3);
1031+
update temp_t1 left join t1 on temp_t1.id = t1.id set temp_t1.update_me = 'hello';
1032+
set global read_only = 0;
1033+
create table t3 (id int not null);
1034+
insert t3 values (2);
1035+
update t1 left join t3 on t1.id = t3.id set t1.v1 = 'hello';
1036+
select * from t2;
1037+
log
1038+
triggered
1039+
triggered
1040+
drop table t1,t2, t3;
1041+
drop user foo;
10211042
end of 5.5 tests
10221043

10231044
# Bug mdev-5970

mysql-test/r/view_grant.result

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,12 +177,15 @@ create table mysqltest.t1 (a int, b int, primary key(a));
177177
insert into mysqltest.t1 values (10,2), (20,3), (30,4), (40,5), (50,10);
178178
create table mysqltest.t2 (x int);
179179
insert into mysqltest.t2 values (3), (4), (5), (6);
180+
create table mysqltest.t3 (x int);
181+
insert into mysqltest.t3 values (3), (4), (5), (6);
180182
create view mysqltest.v1 (a,c) as select a, b+1 from mysqltest.t1;
181183
create view mysqltest.v2 (a,c) as select a, b from mysqltest.t1;
182184
create view mysqltest.v3 (a,c) as select a, b+1 from mysqltest.t1;
183185
create user mysqltest_1@localhost;
184186
grant update (a) on mysqltest.v2 to mysqltest_1@localhost;
185187
grant update on mysqltest.v1 to mysqltest_1@localhost;
188+
grant update on mysqltest.t3 to mysqltest_1@localhost;
186189
grant select on mysqltest.* to mysqltest_1@localhost;
187190
use mysqltest;
188191
update t2,v1 set v1.a=v1.a+v1.c where t2.x=v1.c;
@@ -217,6 +220,7 @@ a b
217220
48 4
218221
62 5
219222
71 10
223+
update t3,v3 set t3.x=t3.x+v3.c where t3.x=v3.c;
220224
update t2,v2 set v2.c=v2.a+v2.c where t2.x=v2.c;
221225
ERROR 42000: UPDATE command denied to user 'mysqltest_1'@'localhost' for column 'c' in table 'v2'
222226
update v2 set c=a+c;

mysql-test/suite/innodb/r/innodb-truncate.result

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,3 +66,16 @@ a
6666
1
6767
2
6868
DROP TABLE t1;
69+
call mtr.add_suppression('InnoDB: Error: in RENAME TABLE table `test`.`t3`');
70+
SET FOREIGN_KEY_CHECKS= OFF;
71+
CREATE TABLE t1 (f2 INT, f4 INT, KEY(f2), FOREIGN KEY (f4) REFERENCES t3 (f4)) ENGINE=InnoDB;
72+
SET FOREIGN_KEY_CHECKS= ON;
73+
CREATE TABLE t2 (f2 INT, FOREIGN KEY(f2) REFERENCES t1 (f2)) ENGINE=InnoDB;
74+
CREATE TABLE t3 (a INT) ENGINE=InnoDB;
75+
ERROR HY000: Can't create table `test`.`t3` (errno: 150 "Foreign key constraint is incorrectly formed")
76+
ALTER TABLE t1 RENAME TO t3;
77+
ERROR HY000: Error on rename of './test/t1' to './test/t3' (errno: 150 "Foreign key constraint is incorrectly formed")
78+
ALTER TABLE t1 FORCE;
79+
TRUNCATE TABLE t1;
80+
ERROR 42000: Cannot truncate a table referenced in a foreign key constraint (`test`.`t2`, CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`f2`) REFERENCES `test`.`t3` (`f2`))
81+
DROP TABLE t2, t1;

mysql-test/suite/innodb/t/innodb-truncate.test

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
--source include/have_innodb.inc
2+
let $datadir=`select @@datadir`;
23
--echo #
34
--echo # TRUNCATE TABLE
45
--echo #
@@ -62,3 +63,20 @@ INSERT INTO t1 VALUES (NULL), (NULL);
6263
SELECT * FROM t1 ORDER BY a;
6364
DROP TABLE t1;
6465

66+
#
67+
# MDEV-18923 Assertion `!lex_string_cmp(system_charset_info, fk_info->referenced_table, &table->s->table_name)' failed in fk_truncate_illegal_if_parent
68+
#
69+
call mtr.add_suppression('InnoDB: Error: in RENAME TABLE table `test`.`t3`');
70+
SET FOREIGN_KEY_CHECKS= OFF;
71+
CREATE TABLE t1 (f2 INT, f4 INT, KEY(f2), FOREIGN KEY (f4) REFERENCES t3 (f4)) ENGINE=InnoDB;
72+
SET FOREIGN_KEY_CHECKS= ON;
73+
CREATE TABLE t2 (f2 INT, FOREIGN KEY(f2) REFERENCES t1 (f2)) ENGINE=InnoDB;
74+
--error ER_CANT_CREATE_TABLE
75+
CREATE TABLE t3 (a INT) ENGINE=InnoDB;
76+
--replace_result $datadir ./
77+
--error ER_ERROR_ON_RENAME
78+
ALTER TABLE t1 RENAME TO t3;
79+
ALTER TABLE t1 FORCE;
80+
--error ER_TRUNCATE_ILLEGAL_FK
81+
TRUNCATE TABLE t1;
82+
DROP TABLE t2, t1;
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
include/master-slave.inc
2+
[connection master]
3+
set global debug_dbug='d,rows_log_event_before_open_table';
4+
set debug_sync='now WAIT_FOR before_open_table';
5+
create table t1 (a int);
6+
insert t1 values (1),(2),(3);
7+
kill slave_sql_thread;
8+
set debug_sync='now SIGNAL go_ahead_sql';
9+
set global debug_dbug='';
10+
set debug_sync='RESET';
11+
drop table t1;
12+
start slave;
13+
include/rpl_end.inc
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
source include/have_debug_sync.inc;
2+
source include/have_binlog_format_row.inc;
3+
source include/master-slave.inc;
4+
5+
connection slave;
6+
set global debug_dbug='d,rows_log_event_before_open_table';
7+
send set debug_sync='now WAIT_FOR before_open_table';
8+
9+
connection master;
10+
create table t1 (a int);
11+
insert t1 values (1),(2),(3);
12+
13+
connection slave;
14+
reap;
15+
let $a=`select id from information_schema.processlist where state='debug sync point: now'`;
16+
replace_result $a slave_sql_thread;
17+
eval kill $a;
18+
set debug_sync='now SIGNAL go_ahead_sql';
19+
set global debug_dbug='';
20+
set debug_sync='RESET';
21+
22+
connection master;
23+
drop table t1;
24+
25+
connection slave;
26+
start slave;
27+
28+
source include/rpl_end.inc;

mysql-test/t/grant4.test

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,34 @@ disconnect con1;
145145
drop database mysqltest_db1;
146146
drop user mysqltest_u1@localhost;
147147

148+
#
149+
# MDEV-18241 Downgrade from 10.4 to 10.3 crashes
150+
#
151+
call mtr.add_suppression("Table 'mysql.user' doesn't exist");
152+
call mtr.add_suppression("'mysql.user' is not TABLE");
153+
rename table mysql.user to mysql.user1;
154+
create view mysql.user as select * from mysql.user1;
155+
--error ER_WRONG_OBJECT
156+
flush privileges;
157+
drop view mysql.user;
158+
create temporary table mysql.user select * from mysql.user1 limit 0;
159+
--error ER_NO_SUCH_TABLE
160+
flush privileges;
161+
drop temporary table mysql.user;
162+
rename table mysql.user1 to mysql.user;
163+
164+
#
165+
# Bug#28986737: RENAMING AND REPLACING MYSQL.USER TABLE CAN LEAD TO A SERVER CRASH
166+
#
167+
call mtr.add_suppression('mysql.user table is damaged');
168+
rename table mysql.user to mysql.user1;
169+
create table mysql.user (Host char(100), User char(100));
170+
--error ER_UNKNOWN_ERROR
171+
flush privileges;
172+
drop table mysql.user;
173+
rename table mysql.user1 to mysql.user;
174+
175+
--echo End of 5.5 tests
148176

149177
--echo #
150178
--echo # Additional coverage for refactoring which is made as part
@@ -235,5 +263,6 @@ create user foo3 identified via mysql_old_password using '00';
235263
--error ER_PASSWD_LENGTH
236264
create user foo4 identified via mysql_old_password using '11111111111111111111111111111111111111111';
237265

238-
239266
set GLOBAL sql_mode=default;
267+
268+
--echo End of 10.1 tests

0 commit comments

Comments
 (0)