Skip to content

Commit 6978bcb

Browse files
committed
Merge 10.9 into 10.10
2 parents c0a6ce6 + fada4cb commit 6978bcb

24 files changed

+542
-264
lines changed

mysql-test/suite/innodb/r/innodb-index-online.result

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ SET @rowlog_decrypt_1=
333333
WHERE variable_name = 'innodb_encryption_n_rowlog_blocks_decrypted');
334334
connection con1;
335335
SET DEBUG_SYNC = 'row_log_apply_before SIGNAL c2f_created WAIT_FOR dml3_done';
336-
ALTER TABLE t1 ADD INDEX c2f(c2);
336+
ALTER TABLE t1 ADD INDEX c2f(c22f), CHANGE c2 c22f INT;
337337
connection default;
338338
SET DEBUG_SYNC = 'now WAIT_FOR c2f_created';
339339
SELECT name, count FROM INFORMATION_SCHEMA.INNODB_METRICS WHERE subsystem = 'ddl';
@@ -396,7 +396,6 @@ SET DEBUG_SYNC = 'now SIGNAL dml3_done';
396396
connection con1;
397397
Warnings:
398398
Note 1831 Duplicate index `c2f`. This is deprecated and will be disallowed in a future release
399-
ALTER TABLE t1 CHANGE c2 c22f INT;
400399
SELECT name, count FROM INFORMATION_SCHEMA.INNODB_METRICS WHERE subsystem = 'ddl';
401400
name count
402401
ddl_background_drop_indexes 0

mysql-test/suite/innodb/t/innodb-index-online.test

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -312,9 +312,7 @@ connection con1;
312312
# Accumulate and apply some modification log.
313313
SET DEBUG_SYNC = 'row_log_apply_before SIGNAL c2f_created WAIT_FOR dml3_done';
314314
--send
315-
# FIXME: MDEV-13668
316-
#ALTER TABLE t1 ADD INDEX c2f(c22f), CHANGE c2 c22f INT;
317-
ALTER TABLE t1 ADD INDEX c2f(c2);
315+
ALTER TABLE t1 ADD INDEX c2f(c22f), CHANGE c2 c22f INT;
318316

319317
connection default;
320318
SET DEBUG_SYNC = 'now WAIT_FOR c2f_created';
@@ -338,8 +336,6 @@ SET DEBUG_SYNC = 'now SIGNAL dml3_done';
338336

339337
connection con1;
340338
reap;
341-
# FIXME: MDEV-13668
342-
ALTER TABLE t1 CHANGE c2 c22f INT;
343339

344340
eval $innodb_metrics_select;
345341

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

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,12 @@ EOF
4949
--error ER_UNKNOWN_STORAGE_ENGINE
5050
SELECT * FROM t1 WHERE PK = 1;
5151

52-
# We will disable also purge, to not let it request the corrupted page.
53-
let $restart_parameters=--innodb-force-recovery=2;
52+
# Force recovery to ignore the corrupted page.
53+
let $restart_parameters=--innodb-force-recovery=1;
5454
--source include/restart_mysqld.inc
5555
SELECT * FROM t1 WHERE PK = 1;
5656
--error ER_NOT_KEYFILE
5757
SELECT * FROM t1 WHERE pk = 12;
5858
CHECK TABLE t1;
5959

6060
DROP TABLE t1;
61-
let $restart_parameters=;
62-
--source include/restart_mysqld.inc

mysql-test/suite/innodb_fts/r/misc_debug2.result

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,17 @@ INSERT INTO mdev21563 VALUES('This is a test');
66
ALTER TABLE mdev21563 DISCARD TABLESPACE;
77
# restart
88
DROP TABLE mdev21563;
9+
#
10+
# MDEV-29342 Assertion failure in file que0que.cc line 728
11+
#
12+
CREATE TABLE t1(f1 CHAR(100), FULLTEXT idx(f1))ENGINE=InnoDB;
13+
INSERT INTO t1 VALUES('mysql'), ('innodb');
14+
set debug_dbug="+d,fts_instrument_sync_debug";
15+
INSERT INTO t1 VALUES('test');
16+
set debug_dbug="-d,fts_instrument_sync_debug";
17+
INSERT INTO t1 VALUES('This is a fts issue');
18+
# restart
19+
set debug_dbug="+d,fts_instrument_sync_debug";
20+
UPDATE t1 SET f1="mariadb";
21+
set debug_dbug="-d,fts_instrument_sync_debug";
22+
DROP TABLE t1;

mysql-test/suite/innodb_fts/t/misc_debug2.test

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,18 @@ INSERT INTO mdev21563 VALUES('This is a test');
1010
ALTER TABLE mdev21563 DISCARD TABLESPACE;
1111
--source include/restart_mysqld.inc
1212
DROP TABLE mdev21563;
13+
14+
--echo #
15+
--echo # MDEV-29342 Assertion failure in file que0que.cc line 728
16+
--echo #
17+
CREATE TABLE t1(f1 CHAR(100), FULLTEXT idx(f1))ENGINE=InnoDB;
18+
INSERT INTO t1 VALUES('mysql'), ('innodb');
19+
set debug_dbug="+d,fts_instrument_sync_debug";
20+
INSERT INTO t1 VALUES('test');
21+
set debug_dbug="-d,fts_instrument_sync_debug";
22+
INSERT INTO t1 VALUES('This is a fts issue');
23+
--source include/restart_mysqld.inc
24+
set debug_dbug="+d,fts_instrument_sync_debug";
25+
UPDATE t1 SET f1="mariadb";
26+
set debug_dbug="-d,fts_instrument_sync_debug";
27+
DROP TABLE t1;
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
include/master-slave.inc
2+
[connection master]
3+
#
4+
# Set replica to ignore system tables
5+
connection slave;
6+
include/stop_slave.inc
7+
SET @@GLOBAL.replicate_wild_ignore_table="mysql.%";
8+
include/start_slave.inc
9+
#
10+
# Trying to execute REVOKE ALL PRIVILEGES on a non-existent user and
11+
# DROP USER on a list of users where not all users exist should error
12+
# and be written into the binary log
13+
connection master;
14+
REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'nonexistentuser'@'%';
15+
ERROR HY000: Can't revoke all privileges for one or more of the requested users
16+
CREATE USER 'testuser'@'localhost' IDENTIFIED by '';
17+
DROP USER 'testuser'@'localhost', 'nonexistentuser'@'%';
18+
ERROR HY000: Operation DROP USER failed for 'nonexistentuser'@'%'
19+
#
20+
# Ensure the events exist in the primary's binary log
21+
FLUSH BINARY LOGS;
22+
# MYSQL_BINLOG MYSQLD_DATADIR/binlog_file > MYSQL_TMP_DIR/mysqlbinlog_out.sql
23+
# There should be three Query events: REVOKE, CREATE USER, and DROP USER
24+
FOUND 3 /Query/ in mysqlbinlog_out.sql
25+
FOUND 1 /REVOKE ALL PRIVILEGES/ in mysqlbinlog_out.sql
26+
FOUND 1 /CREATE USER/ in mysqlbinlog_out.sql
27+
FOUND 1 /DROP USER/ in mysqlbinlog_out.sql
28+
#
29+
# Ensure that the replica receives the event without error
30+
connection slave;
31+
Last_SQL_Error =
32+
Last_SQL_Errno = 0
33+
#
34+
# Clean up
35+
connection slave;
36+
include/stop_slave.inc
37+
SET @@GLOBAL.replicate_wild_ignore_table="";
38+
include/start_slave.inc
39+
include/rpl_end.inc
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
#
2+
# Purpose:
3+
# This test ensures that a binlogged Query_log_event which failed on the
4+
# primary server does not break replication if it is ignored by Grant_tables
5+
# on the replica. The bug reported by MDEV-28530 shows this with
6+
# REVOKE ALL PRIVILEGES.. using a non-existent user. The primary will binlog
7+
# the REVOKE command with an error code, and the replica will think the command
8+
# executed with success because the replication filter will ignore the command
9+
# while accessing the Grant_tables classes. When the replica performs an error
10+
# check, it sees the difference between the error codes, and replication
11+
# breaks.
12+
#
13+
# Methodology:
14+
# Using a replica configured with replicate_wild_ignore_table="schema.%",
15+
# on the primary, execute REVOKE ALL PRVILEGES using a non-existent user and
16+
# DROP USER using a list of users where not all users exist, and ensure that
17+
# the replica acknowledges and ignores the events without erroring.
18+
#
19+
# References:
20+
# MDEV-28530: Revoking privileges from a non-existing user on a master breaks
21+
# replication on the slave in the presence of replication filters
22+
#
23+
24+
source include/master-slave.inc;
25+
source include/have_binlog_format_statement.inc;
26+
27+
--echo #
28+
--echo # Set replica to ignore system tables
29+
connection slave;
30+
let $old_filter= query_get_value(SHOW SLAVE STATUS, Replicate_Wild_Ignore_Table, 1);
31+
source include/stop_slave.inc;
32+
SET @@GLOBAL.replicate_wild_ignore_table="mysql.%";
33+
source include/start_slave.inc;
34+
35+
36+
--echo #
37+
--echo # Trying to execute REVOKE ALL PRIVILEGES on a non-existent user and
38+
--echo # DROP USER on a list of users where not all users exist should error
39+
--echo # and be written into the binary log
40+
--connection master
41+
42+
--error 1269
43+
REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'nonexistentuser'@'%';
44+
45+
CREATE USER 'testuser'@'localhost' IDENTIFIED by '';
46+
--error 1396
47+
DROP USER 'testuser'@'localhost', 'nonexistentuser'@'%';
48+
--save_master_pos
49+
50+
51+
--echo #
52+
--echo # Ensure the events exist in the primary's binary log
53+
--let $MYSQLD_DATADIR= `select @@datadir`
54+
--let $binlog_file=query_get_value(SHOW MASTER STATUS, File, 1)
55+
FLUSH BINARY LOGS;
56+
--echo # MYSQL_BINLOG MYSQLD_DATADIR/binlog_file > MYSQL_TMP_DIR/mysqlbinlog_out.sql
57+
--exec $MYSQL_BINLOG $MYSQLD_DATADIR/$binlog_file > $MYSQL_TMP_DIR/mysqlbinlog_out.sql
58+
59+
--echo # There should be three Query events: REVOKE, CREATE USER, and DROP USER
60+
--let SEARCH_FILE= $MYSQL_TMP_DIR/mysqlbinlog_out.sql
61+
62+
--let SEARCH_PATTERN= Query
63+
--source include/search_pattern_in_file.inc
64+
65+
--let SEARCH_PATTERN= REVOKE ALL PRIVILEGES
66+
--source include/search_pattern_in_file.inc
67+
68+
--let SEARCH_PATTERN= CREATE USER
69+
--source include/search_pattern_in_file.inc
70+
71+
--let SEARCH_PATTERN= DROP USER
72+
--source include/search_pattern_in_file.inc
73+
74+
75+
--echo #
76+
--echo # Ensure that the replica receives the event without error
77+
connection slave;
78+
--sync_with_master
79+
let $error= query_get_value(SHOW SLAVE STATUS, Last_SQL_Error, 1);
80+
--echo Last_SQL_Error = $error
81+
let $errno= query_get_value(SHOW SLAVE STATUS, Last_SQL_Errno, 1);
82+
--echo Last_SQL_Errno = $errno
83+
84+
85+
--echo #
86+
--echo # Clean up
87+
--connection slave
88+
source include/stop_slave.inc;
89+
--eval SET @@GLOBAL.replicate_wild_ignore_table="$old_filter"
90+
source include/start_slave.inc;
91+
92+
--source include/rpl_end.inc

plugin/disks/information_schema_disks.cc

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ static int disks_table_add_row_stat(
108108
#else
109109
if (info.f_flags & MNT_RDONLY)
110110
#endif
111-
return 0;
111+
return 0;
112112

113113
pTable->field[0]->store(zDisk, strlen(zDisk), system_charset_info);
114114
pTable->field[1]->store(zPath, strlen(zPath), system_charset_info);
@@ -214,15 +214,15 @@ static int disks_fill_table(THD* pThd, TABLE_LIST* pTables, Item* pCond)
214214
)
215215
{
216216
struct stat f;
217-
const char *path, *point;
217+
const char *path, *point;
218218
#ifdef HAVE_SETMNTENT
219-
path= pEnt->mnt_dir;
220-
point= pEnt->mnt_fsname;
219+
path= pEnt->mnt_dir;
220+
point= pEnt->mnt_fsname;
221221
#else
222-
path= pEnt->mnt_mountp;
223-
point= pEnt->mnt_special;
222+
path= pEnt->mnt_mountp;
223+
point= pEnt->mnt_special;
224224
#endif
225-
// Try to keep to real storage by excluding
225+
// Try to keep to real storage by excluding
226226
// read only mounts, and mount points that aren't directories
227227
if (hasmntopt(pEnt, MNTOPT_RO) != NULL)
228228
continue;

sql/log_event_server.cc

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2158,23 +2158,30 @@ int Query_log_event::do_apply_event(rpl_group_info *rgi,
21582158
if (thd->m_digest != NULL)
21592159
thd->m_digest->reset(thd->m_token_array, max_digest_length);
21602160

2161-
if (thd->slave_thread)
2162-
{
2163-
/*
2164-
To be compatible with previous releases, the slave thread uses the global
2165-
log_slow_disabled_statements value, wich can be changed dynamically, so we
2166-
have to set the sql_log_slow respectively.
2167-
*/
2168-
thd->variables.sql_log_slow= !MY_TEST(global_system_variables.log_slow_disabled_statements & LOG_SLOW_DISABLE_SLAVE);
2169-
}
2161+
if (thd->slave_thread)
2162+
{
2163+
/*
2164+
To be compatible with previous releases, the slave thread uses the global
2165+
log_slow_disabled_statements value, wich can be changed dynamically, so we
2166+
have to set the sql_log_slow respectively.
2167+
*/
2168+
thd->variables.sql_log_slow= !MY_TEST(global_system_variables.log_slow_disabled_statements & LOG_SLOW_DISABLE_SLAVE);
2169+
}
21702170
mysql_parse(thd, thd->query(), thd->query_length(), &parser_state);
21712171
/* Finalize server status flags after executing a statement. */
21722172
thd->update_server_status();
21732173
log_slow_statement(thd);
21742174
thd->lex->restore_set_statement_var();
2175+
2176+
/*
2177+
When THD::slave_expected_error gets reset inside execution stack
2178+
that is the case of to be ignored event. In this case the expected
2179+
error must change to the reset value as well.
2180+
*/
2181+
expected_error= thd->slave_expected_error;
21752182
}
21762183
}
2177-
else if(sa_result == -1)
2184+
else if (sa_result == -1)
21782185
{
21792186
rli->report(ERROR_LEVEL, expected_error, rgi->gtid_info(),
21802187
"TODO start alter error");

sql/share/errmsg-utf8.txt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7535,9 +7535,10 @@ ER_BINLOG_UNSAFE_NONTRANS_AFTER_TRANS
75357535
eng "Statement is unsafe because it accesses a non-transactional table after accessing a transactional table within the same transaction"
75367536
spa "La sentencia no es segura porque accede a una tabla no transaccional tras acceder a una transaccional dentro de la misma transacción"
75377537
ER_MESSAGE_AND_STATEMENT
7538-
chi "%s语句:%s"
7539-
eng "%s Statement: %s"
7540-
spa "%s Sentencia: %s"
7538+
chi "%s.语句:%s"
7539+
eng "%s. Statement: %s"
7540+
spa "%s. Sentencia: %s"
7541+
75417542
ER_SLAVE_CONVERSION_FAILED
75427543
chi "列%d表'%-.192s.%-.192s'无法从'%-.50s'类型为'%-.50s'"
75437544
eng "Column %d of table '%-.192s.%-.192s' cannot be converted from type '%-.50s' to type '%-.50s'"

0 commit comments

Comments
 (0)