Skip to content

Commit d0afe4b

Browse files
committed
Merge 10.6 into 10.11
2 parents 509557c + 340753e commit d0afe4b

39 files changed

+238
-196
lines changed

mysql-test/main/mysql_upgrade.result

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2519,7 +2519,8 @@ name dl
25192519
# Check that mysql_upgrade can be run on mysqldump
25202520
# of mysql schema from previous versions
25212521
#
2522-
call mtr.add_suppression("innodb_(table|index)_stats has length mismatch in the column name table_name");
2522+
call mtr.add_suppression("InnoDB: Fetch of persistent statistics requested for table `mysql`\\.`gtid_slave_pos` but the required system tables mysql\\.innodb_table_stats and mysql\\.innodb_index_stats are not present or have unexpected structure");
2523+
call mtr.add_suppression("InnoDB: Unexpected length of mysql\\.innodb_table_stats\\.table_name");
25232524
call mtr.add_suppression("Column count of mysql.proc is wrong. Expected 21, found 20.");
25242525
#
25252526
# Upgrade from version 5.5

mysql-test/main/mysql_upgrade.test

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -527,7 +527,8 @@ SELECT * FROM mysql.plugin WHERE name='unix_socket';
527527
--echo #
528528

529529
# The warning appears during mysql_upgrade, before the schema becomes consistent
530-
call mtr.add_suppression("innodb_(table|index)_stats has length mismatch in the column name table_name");
530+
call mtr.add_suppression("InnoDB: Fetch of persistent statistics requested for table `mysql`\\.`gtid_slave_pos` but the required system tables mysql\\.innodb_table_stats and mysql\\.innodb_index_stats are not present or have unexpected structure");
531+
call mtr.add_suppression("InnoDB: Unexpected length of mysql\\.innodb_table_stats\\.table_name");
531532
# This comes from opening 10.6 sys.host_summary view that uses sys.format_time function,
532533
# on still inconsistent mysql.proc, in older versions
533534
call mtr.add_suppression("Column count of mysql.proc is wrong. Expected 21, found 20.");
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
RESET MASTER;
2+
connect con1,localhost,root,,;
3+
CREATE TABLE t1 (a INT) ENGINE=InnoDB;
4+
CREATE TRIGGER tr BEFORE UPDATE ON t1 FOR EACH ROW BEGIN END;
5+
LOCK TABLES t1 WRITE;
6+
LOAD DATA INFILE 'x' INTO TABLE x;
7+
ERROR HY000: Table 'x' was not locked with LOCK TABLES
8+
SET AUTOCOMMIT= OFF;
9+
INSERT INTO t1 VALUES (1);
10+
SAVEPOINT A;
11+
COMMIT;
12+
disconnect con1;
13+
connect con2,localhost,root,,;
14+
SELECT 1;
15+
1
16+
1
17+
disconnect con2;
18+
connection default;
19+
include/show_binlog_events.inc
20+
Log_name Pos Event_type Server_id End_log_pos Info
21+
master-bin.000001 # Gtid # # GTID #-#-#
22+
master-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a INT) ENGINE=InnoDB
23+
master-bin.000001 # Gtid # # GTID #-#-#
24+
master-bin.000001 # Query # # use `test`; CREATE DEFINER=`root`@`localhost` TRIGGER tr BEFORE UPDATE ON t1 FOR EACH ROW BEGIN END
25+
master-bin.000001 # Gtid # # BEGIN GTID #-#-#
26+
master-bin.000001 # Annotate_rows # # INSERT INTO t1 VALUES (1)
27+
master-bin.000001 # Table_map # # table_id: # (test.t1)
28+
master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
29+
master-bin.000001 # Query # # SAVEPOINT `A`
30+
master-bin.000001 # Xid # # COMMIT /* XID */
31+
DROP TABLE t1;
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
--source include/have_innodb.inc
2+
--source include/have_binlog_format_row.inc
3+
4+
RESET MASTER;
5+
6+
# This sequence of statements triggered a bug, where the pending LOCK TABLES
7+
# would skip flusing the pending row event for INSERT to the trx cache. And
8+
# Then the pending event would be overwritten by the SAVEPOINT, leaving an
9+
# invalid state in the THD. And then a later connection would pick the THD
10+
# with invalid state and trigger an assertion.
11+
--connect (con1,localhost,root,,)
12+
CREATE TABLE t1 (a INT) ENGINE=InnoDB;
13+
CREATE TRIGGER tr BEFORE UPDATE ON t1 FOR EACH ROW BEGIN END;
14+
LOCK TABLES t1 WRITE;
15+
--error ER_TABLE_NOT_LOCKED
16+
LOAD DATA INFILE 'x' INTO TABLE x;
17+
SET AUTOCOMMIT= OFF;
18+
INSERT INTO t1 VALUES (1);
19+
SAVEPOINT A;
20+
COMMIT;
21+
--disconnect con1
22+
23+
--connect (con2,localhost,root,,)
24+
SELECT 1;
25+
26+
# Cleanup
27+
--disconnect con2
28+
--connection default
29+
# Show the binlog events.
30+
# When the bug occurs, the Write_rows event is missing STMT_END_F.
31+
--source include/show_binlog_events.inc
32+
33+
DROP TABLE t1;

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

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -530,3 +530,16 @@ INDEX_TYPE BTREE
530530
COMMENT
531531
INDEX_COMMENT
532532
IGNORED NO
533+
#
534+
# MDEV-31740 InnoDB statistics column length validation failed
535+
#
536+
call mtr.add_suppression("InnoDB: Unexpected length of mysql\\.innodb_table_stats\\.last_update");
537+
ALTER TABLE mysql.innodb_table_stats MODIFY LAST_UPDATE DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP() ON UPDATE CURRENT_TIMESTAMP();
538+
CREATE TABLE t (a INT KEY)Engine=InnoDB STATS_PERSISTENT=1;
539+
FOUND 1 /InnoDB: Unexpected length of mysql\.innodb_table_stats\.last_update/ in mysqld.1.err
540+
ALTER TABLE mysql.innodb_table_stats MODIFY last_update TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP() ON UPDATE CURRENT_TIMESTAMP();
541+
CREATE TABLE t2(a INT KEY)ENGINE=InnoDB STATS_PERSISTENT= 1;
542+
SELECT table_name FROM mysql.innodb_table_stats;
543+
table_name
544+
t2
545+
DROP TABLE t, t2;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
call mtr.add_suppression("InnoDB: Table .*innodb_index_stats.* not found");
22
call mtr.add_suppression("InnoDB: Fetch of persistent statistics requested for table .*");
3-
call mtr.add_suppression("InnoDB: Table mysql\\.innodb_index_stats has length mismatch in the column name stat_description\\. Please run mariadb-upgrade");
3+
call mtr.add_suppression("InnoDB: Unexpected length of mysql\\.innodb_index_stats\\.stat_description");
44
call mtr.add_suppression("InnoDB: Column stat_description in table mysql\\.innodb_index_stats is VARCHAR");
55
ALTER TABLE mysql.innodb_index_stats RENAME TO mysql.innodb_index_stats_;
66
CREATE TABLE test_ps_create_on_corrupted

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

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
#
44

55
-- source include/have_innodb.inc
6+
-- source include/not_embedded.inc
67

78
-- disable_warnings
89
-- disable_query_log
@@ -63,3 +64,17 @@ CREATE TABLE test_innodb_stats (
6364
-- disable_query_log
6465
DROP TABLE test_innodb_stats;
6566
set @@use_stat_tables= @save_use_stat_tables;
67+
--enable_query_log
68+
--echo #
69+
--echo # MDEV-31740 InnoDB statistics column length validation failed
70+
--echo #
71+
call mtr.add_suppression("InnoDB: Unexpected length of mysql\\.innodb_table_stats\\.last_update");
72+
ALTER TABLE mysql.innodb_table_stats MODIFY LAST_UPDATE DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP() ON UPDATE CURRENT_TIMESTAMP();
73+
CREATE TABLE t (a INT KEY)Engine=InnoDB STATS_PERSISTENT=1;
74+
let SEARCH_FILE=$MYSQLTEST_VARDIR/log/mysqld.1.err;
75+
let SEARCH_PATTERN=InnoDB: Unexpected length of mysql\\.innodb_table_stats\\.last_update;
76+
--source include/search_pattern_in_file.inc
77+
ALTER TABLE mysql.innodb_table_stats MODIFY last_update TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP() ON UPDATE CURRENT_TIMESTAMP();
78+
CREATE TABLE t2(a INT KEY)ENGINE=InnoDB STATS_PERSISTENT= 1;
79+
SELECT table_name FROM mysql.innodb_table_stats;
80+
DROP TABLE t, t2;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
call mtr.add_suppression("InnoDB: Table .*innodb_index_stats.* not found");
1414
call mtr.add_suppression("InnoDB: Fetch of persistent statistics requested for table .*");
15-
call mtr.add_suppression("InnoDB: Table mysql\\.innodb_index_stats has length mismatch in the column name stat_description\\. Please run mariadb-upgrade");
15+
call mtr.add_suppression("InnoDB: Unexpected length of mysql\\.innodb_index_stats\\.stat_description");
1616
call mtr.add_suppression("InnoDB: Column stat_description in table mysql\\.innodb_index_stats is VARCHAR");
1717

1818
-- vertical_results
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
include/master-slave.inc
2+
[connection master]
3+
create table t (a int, key(a)) partition by range (a) (
4+
partition p0 values less than (10),
5+
partition p1 values less than (100)
6+
);
7+
insert into t values (5),(50);
8+
connection slave;
9+
flush tables;
10+
connection master;
11+
repair table t;
12+
Table Op Msg_type Msg_text
13+
test.t repair status OK
14+
connection slave;
15+
SET STATEMENT sql_log_bin=0 FOR
16+
CALL mtr.add_suppression('[[]Warning[]] Moved 1 misplaced rows');
17+
connection master;
18+
DROP TABLE t;
19+
include/rpl_end.inc
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
include/master-slave.inc
2+
[connection master]
3+
connection slave;
4+
SET @old_format= @@GLOBAL.binlog_row_image;
5+
SET GLOBAL binlog_row_image=MINIMAL;
6+
include/stop_slave.inc
7+
include/start_slave.inc
8+
SET GLOBAL binlog_row_image= @old_format;
9+
connection default;
10+
SET SESSION binlog_row_image=MINIMAL;
11+
CREATE TABLE t (id INT AUTO_INCREMENT, col_int BIGINT NOT NULL, UNIQUE (col_int), KEY(id)) ENGINE=InnoDB;
12+
INSERT INTO t VALUES (1,1);
13+
UPDATE t SET id = 2;
14+
connection slave;
15+
connection master;
16+
DROP TABLE t;
17+
include/rpl_end.inc

0 commit comments

Comments
 (0)