Skip to content

Commit

Permalink
Merge 10.8 into 10.9
Browse files Browse the repository at this point in the history
  • Loading branch information
dr-m committed Nov 28, 2022
2 parents d48db97 + 6f854d7 commit 9abd70e
Show file tree
Hide file tree
Showing 21 changed files with 193 additions and 189 deletions.
21 changes: 21 additions & 0 deletions mysql-test/main/query_cache_notembedded.result
Original file line number Diff line number Diff line change
Expand Up @@ -462,6 +462,27 @@ flush query cache|
delete from t1|
drop procedure bug3583|
drop table t1|
#
# MDEV-29760 DROP DATABASE hangs when particular query cache is present
#
create table t1 (id int);
create table t2 like t1;
create table t3 like t1;
create database d;
create table d.t1 like test.t1;
create table d.t2 like test.t2;
set LOCAL query_cache_type=ON;
select id from t3;
id
select 'x' a, 'y' b from d.t1;
a b
select 'x' a, 'y' b from d.t1, d.t2;
a b
drop database d;
drop table t1, t2, t3;
#
# End of 10.5 tests
#
SET GLOBAL query_cache_size=@query_cache_size_save;
SET GLOBAL query_cache_type=@query_cache_type_save;
set GLOBAL sql_mode=@sql_mode_save;
27 changes: 27 additions & 0 deletions mysql-test/main/query_cache_notembedded.test
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,33 @@ drop procedure bug3583|
drop table t1|
delimiter ;|

--echo #
--echo # MDEV-29760 DROP DATABASE hangs when particular query cache is present
--echo #

create table t1 (id int);
create table t2 like t1;
create table t3 like t1;

create database d;

create table d.t1 like test.t1;
create table d.t2 like test.t2;

set LOCAL query_cache_type=ON;

select id from t3;
select 'x' a, 'y' b from d.t1;
select 'x' a, 'y' b from d.t1, d.t2;

drop database d;

drop table t1, t2, t3;

--echo #
--echo # End of 10.5 tests
--echo #

# Wait till we reached the initial number of concurrent sessions
--source include/wait_until_count_sessions.inc
SET GLOBAL query_cache_size=@query_cache_size_save;
Expand Down
25 changes: 3 additions & 22 deletions mysql-test/suite/binlog/r/binlog_checkpoint.result
Original file line number Diff line number Diff line change
Expand Up @@ -164,28 +164,9 @@ connection default;
SET GLOBAL debug_dbug="+d,only_kill_system_threads_no_loop";
# restart
** Proof of shutdown caused ROLLBACK-completed transaction
include/show_binlog_events.inc
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000002 # Format_desc # # SERVER_VERSION, BINLOG_VERSION
master-bin.000002 # Gtid_list # # []
master-bin.000002 # Binlog_checkpoint # # master-bin.000001
master-bin.000002 # Binlog_checkpoint # # master-bin.000002
master-bin.000002 # Gtid # # GTID #-#-#
master-bin.000002 # Query # # use `test`; CREATE TABLE tm (a INT) ENGINE = myisam
master-bin.000002 # Gtid # # BEGIN GTID #-#-#
master-bin.000002 # Query # # use `mtr`; INSERT INTO test_suppressions (pattern) VALUES ( NAME_CONST('pattern',_latin1'Table \'./test/tm\' is marked as crashed' COLLATE 'latin1_swedish_ci'))
master-bin.000002 # Query # # COMMIT
master-bin.000002 # Gtid # # BEGIN GTID #-#-#
master-bin.000002 # Query # # use `mtr`; INSERT INTO test_suppressions (pattern) VALUES ( NAME_CONST('pattern',_latin1'Checking table' COLLATE 'latin1_swedish_ci'))
master-bin.000002 # Query # # COMMIT
master-bin.000002 # Gtid # # BEGIN GTID #-#-#
master-bin.000002 # Query # # use `test`; INSERT INTO tm SET a = 1
master-bin.000002 # Query # # COMMIT
master-bin.000002 # Gtid # # BEGIN GTID #-#-#
master-bin.000002 # Query # # use `test`; INSERT INTO t1 VALUES (2, 1)
master-bin.000002 # Query # # use `test`; INSERT INTO t1 VALUES (3, "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx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xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx")
master-bin.000002 # Query # # ROLLBACK
master-bin.000002 # Rotate # # master-bin.000003;pos=POS
# MYSQL_BINLOG datadir/binlog_file --result-file=assert_file
include/assert_grep.inc [No XA statements should be written into the binary log]
include/assert_grep.inc [The transaction should be rolled back]
SELECT * FROM tm;
a
1
Expand Down
18 changes: 17 additions & 1 deletion mysql-test/suite/binlog/t/binlog_checkpoint.test
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,23 @@ XA END 'xa1';
--source include/start_mysqld.inc

--echo ** Proof of shutdown caused ROLLBACK-completed transaction
--source include/show_binlog_events.inc

--let assert_file=$MYSQLTEST_VARDIR/tmp/binlog_decoded.out
--let datadir=`select @@datadir`

--echo # MYSQL_BINLOG datadir/binlog_file --result-file=assert_file
--exec $MYSQL_BINLOG $datadir/$binlog_file --result-file=$assert_file

--let $assert_text= No XA statements should be written into the binary log
--let $assert_count= 0
--let assert_select= XA START|XA END|XA PREPARE|XA COMMIT|XA ROLLBACK
--source include/assert_grep.inc

--let $assert_text= The transaction should be rolled back
--let $assert_count= 1
--let assert_select= ^ROLLBACK\$
--source include/assert_grep.inc

SELECT * FROM tm;
--eval SELECT * FROM t1 WHERE a = $a

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,14 @@ AND support IN ('YES', 'DEFAULT', 'ENABLED');
COUNT(*)
1
FOUND 4 /InnoDB: Upgrading redo log:/ in mysqld.1.err
# Empty large multi-file redo log from after MariaDB 10.2.2
# restart: --innodb-data-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption --innodb-log-group-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption --innodb-force-recovery=5 --innodb-log-file-size=4m
SELECT COUNT(*) FROM INFORMATION_SCHEMA.ENGINES
WHERE engine = 'innodb'
AND support IN ('YES', 'DEFAULT', 'ENABLED');
COUNT(*)
1
FOUND 5 /InnoDB: Upgrading redo log:/ in mysqld.1.err
# Minimal MariaDB 10.1.21 encrypted redo log
# restart: --innodb-data-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption --innodb-log-group-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption --innodb-force-recovery=5
SELECT COUNT(*) `1` FROM INFORMATION_SCHEMA.ENGINES WHERE engine='innodb'
Expand Down
8 changes: 8 additions & 0 deletions mysql-test/suite/innodb/r/log_corruption.result
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,14 @@ AND support IN ('YES', 'DEFAULT', 'ENABLED');
COUNT(*)
1
FOUND 4 /InnoDB: Upgrading redo log:/ in mysqld.1.err
# Empty large multi-file redo log from after MariaDB 10.2.2
# restart: --innodb-data-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption --innodb-log-group-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption --innodb-force-recovery=5 --innodb-log-file-size=4m
SELECT COUNT(*) FROM INFORMATION_SCHEMA.ENGINES
WHERE engine = 'innodb'
AND support IN ('YES', 'DEFAULT', 'ENABLED');
COUNT(*)
1
FOUND 5 /InnoDB: Upgrading redo log:/ in mysqld.1.err
# Minimal MariaDB 10.1.21 encrypted redo log
# restart: --innodb-data-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption --innodb-log-group-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption --innodb-force-recovery=5
SELECT * FROM INFORMATION_SCHEMA.ENGINES
Expand Down
37 changes: 37 additions & 0 deletions mysql-test/suite/innodb/t/log_corruption.test
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ call mtr.add_suppression("InnoDB: Missing MLOG_FILE_NAME or MLOG_FILE_DELETE bef
call mtr.add_suppression("InnoDB: Obtaining redo log encryption key version 1 failed");
call mtr.add_suppression("InnoDB: Decrypting checkpoint failed");
call mtr.add_suppression("InnoDB: Log file .*ib_logfile1 is of different size 2097152 bytes than other log files (1048576|4194304) bytes!");
call mtr.add_suppression("InnoDB: The change buffer is corrupted");
--enable_query_log

let bugdir= $MYSQLTEST_VARDIR/tmp/log_corruption;
Expand Down Expand Up @@ -606,6 +607,42 @@ AND support IN ('YES', 'DEFAULT', 'ENABLED');
--let SEARCH_PATTERN= InnoDB: Upgrading redo log:
--source include/search_pattern_in_file.inc

--echo # Empty large multi-file redo log from after MariaDB 10.2.2
perl;
do "$ENV{MTR_SUITE_DIR}/../innodb/include/crc32.pl";
my $polynomial = 0x82f63b78; # CRC-32C

die unless open OUT, "+<", "$ENV{bugdir}/ib_logfile0";
binmode OUT;
$_= pack("Nx[5]nx[5]", 1, 0x1286) . "BogoDB 4.3.2.1" . chr(0) x 478;
print OUT $_, pack("N", mycrc32($_, 0, $polynomial));
# checkpoint page 1 and all-zero checkpoint 2
$_= pack("x[13]nCNNx[484]", 0x1286, 12, 2, 0x80c);
print OUT $_, pack("N", mycrc32($_, 0, $polynomial));
print OUT chr(0) x 1024;
die unless seek(OUT, 0x1FFFFFFFF, 0);
print OUT chr(0);
close OUT or die;
die unless open OUT, ">", "$ENV{bugdir}/ib_logfile1";
binmode OUT;
die unless seek(OUT, 0x800, 0); # the first 2048 bytes are unused!
$_= pack("Nnnx[500]", 0x80000944, 12, 12);
print OUT $_, pack("N", mycrc32($_, 0, $polynomial));
die unless seek(OUT, 0x1FFFFFFFF, 0);
print OUT chr(0);
close OUT or die;
EOF

--let $restart_parameters= $dirs --innodb-force-recovery=5 --innodb-log-file-size=4m
--source include/start_mysqld.inc
SELECT COUNT(*) FROM INFORMATION_SCHEMA.ENGINES
WHERE engine = 'innodb'
AND support IN ('YES', 'DEFAULT', 'ENABLED');
--source include/shutdown_mysqld.inc
--let SEARCH_PATTERN= InnoDB: Upgrading redo log:
--source include/search_pattern_in_file.inc
--let $restart_parameters= $dirs

--echo # Minimal MariaDB 10.1.21 encrypted redo log
perl;
die unless open OUT, "+<", "$ENV{bugdir}/ib_logfile0";
Expand Down
3 changes: 2 additions & 1 deletion plugin/password_reuse_check/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@

MYSQL_ADD_PLUGIN(password_reuse_check password_reuse_check.c)
MYSQL_ADD_PLUGIN(password_reuse_check password_reuse_check.c
RECOMPILE_FOR_EMBEDDED)
4 changes: 2 additions & 2 deletions sql/share/errmsg-utf8.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9773,9 +9773,9 @@ ER_UNUSED_23
spa "Nunca debería vd de ver esto"

ER_PARTITION_WRONG_TYPE
chi "错误的分区类型,预期类型:%`s for partitioning by %`s"
chi "错误分区类型%`s,应当是%`s"
eng "Wrong partition type %`s for partitioning by %`s"
spa "Tipo de partición equivocada, tipo esperado: %`s for partitioning by %`s"
spa "Tipo de partición equivocada %`s para particionado mediante %`s"

WARN_VERS_PART_FULL
chi "版本化表%`s.%`s:partition%`s已满,添加更多历史分区(out of %s)"
Expand Down
16 changes: 7 additions & 9 deletions sql/sql_cache.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2131,8 +2131,7 @@ def_week_frmt: %zu, in_trans: %d, autocommit: %d",
("Handler require invalidation queries of %.*s %llu-%llu",
(int)qcache_se_key_len, qcache_se_key_name,
engine_data, table->engine_data()));
invalidate_table_internal(thd,
(uchar *) table->db(),
invalidate_table_internal((uchar *) table->db(),
table->key_length());
}
else
Expand Down Expand Up @@ -2381,7 +2380,7 @@ void Query_cache::invalidate(THD *thd, const char *db)
if (strcmp(table->db(),db) == 0)
{
Query_cache_block_table *list_root= table_block->table(0);
invalidate_query_block_list(thd,list_root);
invalidate_query_block_list(list_root);
}

table_block= next;
Expand Down Expand Up @@ -3320,7 +3319,7 @@ void Query_cache::invalidate_table(THD *thd, uchar * key, size_t key_length)
DEBUG_SYNC(thd, "wait_in_query_cache_invalidate2");

if (query_cache_size > 0)
invalidate_table_internal(thd, key, key_length);
invalidate_table_internal(key, key_length);

unlock();
}
Expand All @@ -3335,14 +3334,14 @@ void Query_cache::invalidate_table(THD *thd, uchar * key, size_t key_length)
*/

void
Query_cache::invalidate_table_internal(THD *thd, uchar *key, size_t key_length)
Query_cache::invalidate_table_internal(uchar *key, size_t key_length)
{
Query_cache_block *table_block=
(Query_cache_block*)my_hash_search(&tables, key, key_length);
if (table_block)
{
Query_cache_block_table *list_root= table_block->table(0);
invalidate_query_block_list(thd, list_root);
invalidate_query_block_list(list_root);
}
}

Expand All @@ -3359,8 +3358,7 @@ Query_cache::invalidate_table_internal(THD *thd, uchar *key, size_t key_length)
*/

void
Query_cache::invalidate_query_block_list(THD *thd,
Query_cache_block_table *list_root)
Query_cache::invalidate_query_block_list(Query_cache_block_table *list_root)
{
while (list_root->next != list_root)
{
Expand Down Expand Up @@ -3544,7 +3542,7 @@ Query_cache::insert_table(THD *thd, size_t key_len, const char *key,
*/
{
Query_cache_block_table *list_root= table_block->table(0);
invalidate_query_block_list(thd, list_root);
invalidate_query_block_list(list_root);
}

table_block= 0;
Expand Down
5 changes: 2 additions & 3 deletions sql/sql_cache.h
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ class Query_cache
Cache_staus m_cache_status;

void free_query_internal(Query_cache_block *point);
void invalidate_table_internal(THD *thd, uchar *key, size_t key_length);
void invalidate_table_internal(uchar *key, size_t key_length);

protected:
/*
Expand Down Expand Up @@ -375,8 +375,7 @@ class Query_cache
void invalidate_table(THD *thd, TABLE *table);
void invalidate_table(THD *thd, uchar *key, size_t key_length);
void invalidate_table(THD *thd, Query_cache_block *table_block);
void invalidate_query_block_list(THD *thd,
Query_cache_block_table *list_root);
void invalidate_query_block_list(Query_cache_block_table *list_root);

TABLE_COUNTER_TYPE
register_tables_from_list(THD *thd, TABLE_LIST *tables_used,
Expand Down
6 changes: 4 additions & 2 deletions sql/sql_table.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1830,13 +1830,16 @@ int mysql_rm_table_no_locks(THD *thd, TABLE_LIST *tables,
}
error= thd->is_error();

if (non_temp_tables_count)
query_cache_invalidate3(thd, tables, 0);

/*
We are always logging drop of temporary tables.
The reason is to handle the following case:
- Use statement based replication
- CREATE TEMPORARY TABLE foo (logged)
- set row based replication
- DROP TEMPORAY TABLE foo (needs to be logged)
- DROP TEMPORARY TABLE foo (needs to be logged)
This should be fixed so that we remember if creation of the
temporary table was logged and only log it if the creation was
logged.
Expand All @@ -1848,7 +1851,6 @@ int mysql_rm_table_no_locks(THD *thd, TABLE_LIST *tables,
if (non_trans_tmp_table_deleted || trans_tmp_table_deleted)
thd->transaction->stmt.mark_dropped_temp_table();

query_cache_invalidate3(thd, tables, 0);
if (!dont_log_query && mysql_bin_log.is_open())
{
debug_crash_here("ddl_log_drop_before_binlog");
Expand Down
Loading

0 comments on commit 9abd70e

Please sign in to comment.