summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2022-03-01 09:36:28 +0200
committerMarko Mäkelä <marko.makela@mariadb.com>2022-03-01 09:36:28 +0200
commita43777cc9215edee4e74fa69dc71f8e621004021 (patch)
treef1c68b8b1888b50b7454eef394bc875d55e9f9d6
parent3d88f9f34c1223c59272d5086dcd2b4b2cfc167b (diff)
parentfd5a6d0f75f1435e6b15409516ccba54b8fee145 (diff)
downloadmariadb-git-a43777cc9215edee4e74fa69dc71f8e621004021.tar.gz
Merge 10.6 into 10.7
-rw-r--r--mysql-test/include/have_crypt.inc2
-rw-r--r--mysql-test/main/alter_table.result18
-rw-r--r--mysql-test/main/alter_table.test22
-rw-r--r--mysql-test/main/alter_table_lock.result19
-rw-r--r--mysql-test/main/alter_table_lock.test25
-rw-r--r--mysql-test/main/backup_locks.result8
-rw-r--r--mysql-test/main/backup_locks.test8
-rw-r--r--mysql-test/main/cte_recursive.test3
-rw-r--r--mysql-test/main/func_crypt.result25
-rw-r--r--mysql-test/main/func_crypt.test38
-rw-r--r--mysql-test/main/func_encrypt.result7
-rw-r--r--mysql-test/main/func_encrypt.test15
-rw-r--r--mysql-test/main/partition_debug_sync.result7
-rw-r--r--mysql-test/main/partition_debug_sync.test19
-rw-r--r--mysql-test/main/query_cache_debug.test11
-rw-r--r--mysql-test/main/ssl-big.test1
-rw-r--r--mysql-test/main/strings.result9
-rw-r--r--mysql-test/main/strings.test9
-rw-r--r--mysql-test/main/view.result8
-rw-r--r--mysql-test/main/view.test12
-rw-r--r--mysql-test/suite/rpl/t/rpl_dump_request_retry_warning.test6
-rw-r--r--storage/innobase/include/buf0buf.h9
-rw-r--r--storage/innobase/trx/trx0undo.cc17
23 files changed, 182 insertions, 116 deletions
diff --git a/mysql-test/include/have_crypt.inc b/mysql-test/include/have_crypt.inc
index 422f8922edc..ae94121980c 100644
--- a/mysql-test/include/have_crypt.inc
+++ b/mysql-test/include/have_crypt.inc
@@ -1,3 +1,5 @@
+# MDEV-27964 The function ENCRYPT() causes SIGSEGV in WITH_MSAN builds
+-- source include/not_msan.inc
# encrypt('a') is NULL if crypt(3) is not available
# encrypt('a') is "*0" in fips mode
if (`select length(encrypt('a')) > 3 IS NOT TRUE`) {
diff --git a/mysql-test/main/alter_table.result b/mysql-test/main/alter_table.result
index 7183f1efe0e..e9977bd0d5e 100644
--- a/mysql-test/main/alter_table.result
+++ b/mysql-test/main/alter_table.result
@@ -3415,24 +3415,6 @@ ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITH
delete from t1 where a = 11;
drop table t1;
#
-# MDEV-23836: Assertion `! is_set() || m_can_overwrite_status' in
-# Diagnostics_area::set_error_status (interrupted ALTER TABLE under LOCK)
-#
-SET @max_session_mem_used_save= @@max_session_mem_used;
-CREATE TABLE t1 (a INT);
-SELECT * FROM t1;
-a
-ALTER TABLE x MODIFY xx INT;
-ERROR 42S02: Table 'test.x' doesn't exist
-SET SESSION max_session_mem_used= 8192;
-LOCK TABLE t1 WRITE;
-ALTER TABLE t1 CHANGE COLUMN IF EXISTS b c INT;
-Warnings:
-Note 1054 Unknown column 'b' in 't1'
-SET SESSION max_session_mem_used = @max_session_mem_used_save;
-UNLOCK TABLES;
-DROP TABLE t1;
-#
# End of 10.5 tests
#
#
diff --git a/mysql-test/main/alter_table.test b/mysql-test/main/alter_table.test
index 5ce10dd2c2b..31c69783248 100644
--- a/mysql-test/main/alter_table.test
+++ b/mysql-test/main/alter_table.test
@@ -2662,28 +2662,6 @@ delete from t1 where a = 11;
drop table t1;
--echo #
---echo # MDEV-23836: Assertion `! is_set() || m_can_overwrite_status' in
---echo # Diagnostics_area::set_error_status (interrupted ALTER TABLE under LOCK)
---echo #
-
-SET @max_session_mem_used_save= @@max_session_mem_used;
-
-CREATE TABLE t1 (a INT);
-SELECT * FROM t1;
-
---error ER_NO_SUCH_TABLE
-ALTER TABLE x MODIFY xx INT;
-
-SET SESSION max_session_mem_used= 8192;
-LOCK TABLE t1 WRITE;
-
-ALTER TABLE t1 CHANGE COLUMN IF EXISTS b c INT;
-
-SET SESSION max_session_mem_used = @max_session_mem_used_save;
-UNLOCK TABLES;
-DROP TABLE t1;
-
---echo #
--echo # End of 10.5 tests
--echo #
diff --git a/mysql-test/main/alter_table_lock.result b/mysql-test/main/alter_table_lock.result
new file mode 100644
index 00000000000..ce6097c9ada
--- /dev/null
+++ b/mysql-test/main/alter_table_lock.result
@@ -0,0 +1,19 @@
+#
+# MDEV-23836: Assertion `! is_set() || m_can_overwrite_status' in
+# Diagnostics_area::set_error_status (interrupted ALTER TABLE under LOCK)
+#
+SET @max_session_mem_used_save= @@max_session_mem_used;
+CREATE TABLE t1 (a INT);
+SELECT * FROM t1;
+a
+ALTER TABLE x MODIFY xx INT;
+ERROR 42S02: Table 'test.x' doesn't exist
+SET SESSION max_session_mem_used= 8192;
+LOCK TABLE t1 WRITE;
+ALTER TABLE t1 CHANGE COLUMN IF EXISTS b c INT;
+Warnings:
+Note 1054 Unknown column 'b' in 't1'
+SET SESSION max_session_mem_used = @max_session_mem_used_save;
+UNLOCK TABLES;
+DROP TABLE t1;
+# End of 10.5 tests
diff --git a/mysql-test/main/alter_table_lock.test b/mysql-test/main/alter_table_lock.test
new file mode 100644
index 00000000000..f1f60e38b61
--- /dev/null
+++ b/mysql-test/main/alter_table_lock.test
@@ -0,0 +1,25 @@
+--source include/not_msan.inc
+
+--echo #
+--echo # MDEV-23836: Assertion `! is_set() || m_can_overwrite_status' in
+--echo # Diagnostics_area::set_error_status (interrupted ALTER TABLE under LOCK)
+--echo #
+
+SET @max_session_mem_used_save= @@max_session_mem_used;
+
+CREATE TABLE t1 (a INT);
+SELECT * FROM t1;
+
+--error ER_NO_SUCH_TABLE
+ALTER TABLE x MODIFY xx INT;
+
+SET SESSION max_session_mem_used= 8192;
+LOCK TABLE t1 WRITE;
+
+ALTER TABLE t1 CHANGE COLUMN IF EXISTS b c INT;
+
+SET SESSION max_session_mem_used = @max_session_mem_used_save;
+UNLOCK TABLES;
+DROP TABLE t1;
+
+--echo # End of 10.5 tests
diff --git a/mysql-test/main/backup_locks.result b/mysql-test/main/backup_locks.result
index 1e567c1a58d..478cd1ef537 100644
--- a/mysql-test/main/backup_locks.result
+++ b/mysql-test/main/backup_locks.result
@@ -2,19 +2,19 @@
# Test lock taken
#
BACKUP LOCK test.t1;
-SELECT LOCK_MODE, LOCK_TYPE, TABLE_SCHEMA, TABLE_NAME FROM information_schema.metadata_lock_info;
+SELECT LOCK_MODE, LOCK_TYPE, TABLE_SCHEMA, TABLE_NAME FROM information_schema.metadata_lock_info where table_name not like "innodb_%";
LOCK_MODE LOCK_TYPE TABLE_SCHEMA TABLE_NAME
MDL_SHARED_HIGH_PRIO Table metadata lock test t1
BACKUP UNLOCK;
-SELECT LOCK_MODE, LOCK_TYPE, TABLE_SCHEMA, TABLE_NAME FROM information_schema.metadata_lock_info;
+SELECT LOCK_MODE, LOCK_TYPE, TABLE_SCHEMA, TABLE_NAME FROM information_schema.metadata_lock_info where table_name not like "innodb_%";
LOCK_MODE LOCK_TYPE TABLE_SCHEMA TABLE_NAME
BACKUP LOCK t1;
-SELECT LOCK_MODE, LOCK_TYPE, TABLE_SCHEMA, TABLE_NAME FROM information_schema.metadata_lock_info;
+SELECT LOCK_MODE, LOCK_TYPE, TABLE_SCHEMA, TABLE_NAME FROM information_schema.metadata_lock_info where table_name not like "innodb_%";
LOCK_MODE LOCK_TYPE TABLE_SCHEMA TABLE_NAME
MDL_SHARED_HIGH_PRIO Table metadata lock test t1
BACKUP UNLOCK;
BACKUP LOCK non_existing.t1;
-SELECT LOCK_MODE, LOCK_TYPE, TABLE_SCHEMA, TABLE_NAME FROM information_schema.metadata_lock_info;
+SELECT LOCK_MODE, LOCK_TYPE, TABLE_SCHEMA, TABLE_NAME FROM information_schema.metadata_lock_info where table_name not like "innodb_%";
LOCK_MODE LOCK_TYPE TABLE_SCHEMA TABLE_NAME
MDL_SHARED_HIGH_PRIO Table metadata lock non_existing t1
BACKUP UNLOCK;
diff --git a/mysql-test/main/backup_locks.test b/mysql-test/main/backup_locks.test
index 1271abfd993..02313186bec 100644
--- a/mysql-test/main/backup_locks.test
+++ b/mysql-test/main/backup_locks.test
@@ -11,14 +11,14 @@
--echo #
BACKUP LOCK test.t1;
-SELECT LOCK_MODE, LOCK_TYPE, TABLE_SCHEMA, TABLE_NAME FROM information_schema.metadata_lock_info;
+SELECT LOCK_MODE, LOCK_TYPE, TABLE_SCHEMA, TABLE_NAME FROM information_schema.metadata_lock_info where table_name not like "innodb_%";
BACKUP UNLOCK;
-SELECT LOCK_MODE, LOCK_TYPE, TABLE_SCHEMA, TABLE_NAME FROM information_schema.metadata_lock_info;
+SELECT LOCK_MODE, LOCK_TYPE, TABLE_SCHEMA, TABLE_NAME FROM information_schema.metadata_lock_info where table_name not like "innodb_%";
BACKUP LOCK t1;
-SELECT LOCK_MODE, LOCK_TYPE, TABLE_SCHEMA, TABLE_NAME FROM information_schema.metadata_lock_info;
+SELECT LOCK_MODE, LOCK_TYPE, TABLE_SCHEMA, TABLE_NAME FROM information_schema.metadata_lock_info where table_name not like "innodb_%";
BACKUP UNLOCK;
BACKUP LOCK non_existing.t1;
-SELECT LOCK_MODE, LOCK_TYPE, TABLE_SCHEMA, TABLE_NAME FROM information_schema.metadata_lock_info;
+SELECT LOCK_MODE, LOCK_TYPE, TABLE_SCHEMA, TABLE_NAME FROM information_schema.metadata_lock_info where table_name not like "innodb_%";
BACKUP UNLOCK;
--echo #
diff --git a/mysql-test/main/cte_recursive.test b/mysql-test/main/cte_recursive.test
index f8c41dbc3ea..5964c32061b 100644
--- a/mysql-test/main/cte_recursive.test
+++ b/mysql-test/main/cte_recursive.test
@@ -1,4 +1,7 @@
--source include/default_optimizer_switch.inc
+# This is too slow on MSAN
+--source include/not_msan.inc
+--source include/not_valgrind.inc
create table t1 (a int, b varchar(32));
insert into t1 values
diff --git a/mysql-test/main/func_crypt.result b/mysql-test/main/func_crypt.result
index 2c42d3dc845..25f38932c26 100644
--- a/mysql-test/main/func_crypt.result
+++ b/mysql-test/main/func_crypt.result
@@ -92,6 +92,14 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used
Warnings:
Note 1003 select password('idkfa ') AS `password('idkfa ')`,old_password('idkfa') AS `old_password('idkfa')`
+CREATE VIEW v1 AS SELECT ENCRYPT("dhgdhgd");
+SELECT * FROM v1;
+drop view v1;
+CREATE VIEW v1 AS SELECT SUBSTRING_INDEX("dkjhgd:kjhdjh", ":", 1);
+SELECT * FROM v1;
+SUBSTRING_INDEX("dkjhgd:kjhdjh", ":", 1)
+dkjhgd
+drop view v1;
select encrypt('1234','_.');
encrypt('1234','_.')
#
@@ -105,6 +113,13 @@ SELECT OLD_PASSWORD(c1), PASSWORD(c1) FROM t1;
OLD_PASSWORD(c1) PASSWORD(c1)
77023ffe214c04ff *82E58A2C08AAFE72C8EB523069CD8ADB33F78F58
DROP TABLE t1;
+drop table if exists t1;
+create table t1 (f1 smallint(6) default null, f2 mediumtext character set utf8)
+engine=myisam default charset=latin1;
+insert into t1 values (null,'contraction\'s');
+insert into t1 values (-15818,'requirement\'s');
+select encrypt(f1,f2) as a from t1,(select encrypt(f1,f2) as b from t1) a;
+drop table t1;
# End of 5.0 tests
#
# Start of 10.0 tests
@@ -215,3 +230,13 @@ a b
hello 12NKz5XM5JeKI
DROP TABLE t1;
# End of 10.2 tests
+#
+# MDEV-25778 Overrun buffer in to_string_native()
+#
+CREATE TABLE t1 (a DECIMAL(15,11) ZEROFILL);
+INSERT INTO t1 (a) VALUES (0.1),(0.2);
+SELECT length(ENCRYPT(a)) AS f, COUNT(*) FROM t1 GROUP BY f;
+f COUNT(*)
+13 2
+DROP TABLE t1;
+# End of 10.6 tests
diff --git a/mysql-test/main/func_crypt.test b/mysql-test/main/func_crypt.test
index 118a7023669..cf6a6371e50 100644
--- a/mysql-test/main/func_crypt.test
+++ b/mysql-test/main/func_crypt.test
@@ -52,6 +52,18 @@ select old_password(' i d k f a ');
explain extended select password('idkfa '), old_password('idkfa');
#
+# using encrypt & substring_index in view (Bug#7024)
+#
+CREATE VIEW v1 AS SELECT ENCRYPT("dhgdhgd");
+disable_result_log;
+SELECT * FROM v1;
+enable_result_log;
+drop view v1;
+CREATE VIEW v1 AS SELECT SUBSTRING_INDEX("dkjhgd:kjhdjh", ":", 1);
+SELECT * FROM v1;
+drop view v1;
+
+#
# Bug #13619: Crash on FreeBSD with salt like '_.'
#
--replace_column 1 #
@@ -69,6 +81,21 @@ INSERT INTO t1 VALUES (REPEAT('a', 1024));
SELECT OLD_PASSWORD(c1), PASSWORD(c1) FROM t1;
DROP TABLE t1;
+#
+# Bug#44365 valgrind warnings with encrypt() function
+#
+--disable_warnings
+drop table if exists t1;
+--enable_warnings
+create table t1 (f1 smallint(6) default null, f2 mediumtext character set utf8)
+engine=myisam default charset=latin1;
+insert into t1 values (null,'contraction\'s');
+insert into t1 values (-15818,'requirement\'s');
+--disable_result_log
+select encrypt(f1,f2) as a from t1,(select encrypt(f1,f2) as b from t1) a;
+--enable_result_log
+drop table t1;
+
--echo # End of 5.0 tests
--echo #
--echo # Start of 10.0 tests
@@ -122,3 +149,14 @@ SELECT * FROM t1;
DROP TABLE t1;
--echo # End of 10.2 tests
+
+--echo #
+--echo # MDEV-25778 Overrun buffer in to_string_native()
+--echo #
+
+CREATE TABLE t1 (a DECIMAL(15,11) ZEROFILL);
+INSERT INTO t1 (a) VALUES (0.1),(0.2);
+SELECT length(ENCRYPT(a)) AS f, COUNT(*) FROM t1 GROUP BY f;
+DROP TABLE t1;
+
+--echo # End of 10.6 tests
diff --git a/mysql-test/main/func_encrypt.result b/mysql-test/main/func_encrypt.result
index 68c44231e43..326702f3c98 100644
--- a/mysql-test/main/func_encrypt.result
+++ b/mysql-test/main/func_encrypt.result
@@ -183,13 +183,6 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used
Warnings:
Note 1003 select des_decrypt(des_encrypt('hello',4),'password2') AS `des_decrypt(des_encrypt("hello",4),'password2')`,des_decrypt(des_encrypt('hello','hidden')) AS `des_decrypt(des_encrypt("hello","hidden"))`
-drop table if exists t1;
-create table t1 (f1 smallint(6) default null, f2 mediumtext character set utf8)
-engine=myisam default charset=latin1;
-insert into t1 values (null,'contraction\'s');
-insert into t1 values (-15818,'requirement\'s');
-select encrypt(f1,f2) as a from t1,(select encrypt(f1,f2) as b from t1) a;
-drop table t1;
#
# Start of 10.1 tests
#
diff --git a/mysql-test/main/func_encrypt.test b/mysql-test/main/func_encrypt.test
index e27a2bd46d3..4a8c20e3dbc 100644
--- a/mysql-test/main/func_encrypt.test
+++ b/mysql-test/main/func_encrypt.test
@@ -89,21 +89,6 @@ explain extended select des_decrypt(des_encrypt("hello",4),'password2'), des_dec
# End of 4.1 tests
-#
-# Bug#44365 valgrind warnings with encrypt() function
-#
---disable_warnings
-drop table if exists t1;
---enable_warnings
-create table t1 (f1 smallint(6) default null, f2 mediumtext character set utf8)
-engine=myisam default charset=latin1;
-insert into t1 values (null,'contraction\'s');
-insert into t1 values (-15818,'requirement\'s');
---disable_result_log
-select encrypt(f1,f2) as a from t1,(select encrypt(f1,f2) as b from t1) a;
---enable_result_log
-drop table t1;
-
--echo #
--echo # Start of 10.1 tests
--echo #
diff --git a/mysql-test/main/partition_debug_sync.result b/mysql-test/main/partition_debug_sync.result
index 7006491fcaa..635f7735e6c 100644
--- a/mysql-test/main/partition_debug_sync.result
+++ b/mysql-test/main/partition_debug_sync.result
@@ -53,9 +53,14 @@ SET DEBUG_SYNC= 'alter_table_before_rename_result_table WAIT_FOR delete_done';
ALTER TABLE t2 REMOVE PARTITIONING;
connection default;
SET DEBUG_SYNC= 'now WAIT_FOR removing_partitions';
-SET DEBUG_SYNC= 'rm_table_no_locks_before_delete_table SIGNAL waiting_for_alter';
+SET DEBUG_SYNC= 'rm_table_no_locks_before_delete_table SIGNAL waiting_for_alter WAIT_FOR mtr_continue';
SET DEBUG_SYNC= 'rm_table_no_locks_before_binlog SIGNAL delete_done';
DROP TABLE IF EXISTS t2;
+# Create a new connection thread to orchestrate the ALTER and DROP
+# threads' DEBUG_SYNC points to avoid lost signals
+connect con2,localhost,root,,;
+SET DEBUG_SYNC= 'now SIGNAL mtr_continue';
+connection default;
connection con1;
ERROR 42S02: Table 'test.t2' doesn't exist
SET DEBUG_SYNC= 'RESET';
diff --git a/mysql-test/main/partition_debug_sync.test b/mysql-test/main/partition_debug_sync.test
index 09ebba0b0e2..bc49153f803 100644
--- a/mysql-test/main/partition_debug_sync.test
+++ b/mysql-test/main/partition_debug_sync.test
@@ -66,12 +66,27 @@ SET DEBUG_SYNC= 'alter_table_before_rename_result_table WAIT_FOR delete_done';
--send ALTER TABLE t2 REMOVE PARTITIONING
connection default;
SET DEBUG_SYNC= 'now WAIT_FOR removing_partitions';
-SET DEBUG_SYNC= 'rm_table_no_locks_before_delete_table SIGNAL waiting_for_alter';
+
+SET DEBUG_SYNC= 'rm_table_no_locks_before_delete_table SIGNAL waiting_for_alter WAIT_FOR mtr_continue';
SET DEBUG_SYNC= 'rm_table_no_locks_before_binlog SIGNAL delete_done';
-DROP TABLE IF EXISTS t2;
+--send DROP TABLE IF EXISTS t2
+
+--echo # Create a new connection thread to orchestrate the ALTER and DROP
+--echo # threads' DEBUG_SYNC points to avoid lost signals
+connect(con2,localhost,root,,);
+let $wait_condition= select count(*)=0 from information_schema.processlist where state like "debug sync point: alter_table_before_open_tables";
+source include/wait_condition.inc;
+SET DEBUG_SYNC= 'now SIGNAL mtr_continue';
+
+# Return execution for DROP TABLE
+connection default;
+--reap
+
+# Return execution for ALTER TABLE
connection con1;
--error ER_NO_SUCH_TABLE
--reap
+
SET DEBUG_SYNC= 'RESET';
disconnect con1;
--source include/wait_until_disconnected.inc
diff --git a/mysql-test/main/query_cache_debug.test b/mysql-test/main/query_cache_debug.test
index 90b76077cac..af82927245b 100644
--- a/mysql-test/main/query_cache_debug.test
+++ b/mysql-test/main/query_cache_debug.test
@@ -197,8 +197,17 @@ SET DEBUG_SYNC="now WAIT_FOR parked1_2";
--echo ** and finally release the mutex. The threads will continue to wait
--echo ** until a broadcast signal reaches them causing both threads to
--echo ** come alive and check the condition.
+
+# Before sending signals back-to-back, we have to ensure the previous signal
+# was received
+let $wait_condition= select count(*)=3 from information_schema.processlist where state like "%debug%";
+source include/wait_condition.inc;
SET DEBUG_SYNC="now SIGNAL go2";
+let $wait_condition= select count(*)=2 from information_schema.processlist where state like "%debug%";
+source include/wait_condition.inc;
SET DEBUG_SYNC="now SIGNAL go3";
+let $wait_condition= select count(*)=1 from information_schema.processlist where state like "%debug%";
+source include/wait_condition.inc;
--echo **
--echo ** Finally signal the DELETE statement on THD1 one last time.
@@ -208,6 +217,8 @@ SET DEBUG_SYNC="now SIGNAL go3";
--echo ** invalidations and a broadcast signal will be sent to the thread
--echo ** group holding result set writers.
SET DEBUG_SYNC="now SIGNAL go1_2";
+let $wait_condition= select count(*)=0 from information_schema.processlist where state like "%debug%";
+source include/wait_condition.inc;
--echo **
--echo *************************************************************************
diff --git a/mysql-test/main/ssl-big.test b/mysql-test/main/ssl-big.test
index 44db11b52bb..fa35146e627 100644
--- a/mysql-test/main/ssl-big.test
+++ b/mysql-test/main/ssl-big.test
@@ -6,6 +6,7 @@
-- source include/have_64bit.inc
# No point in running with valgrind as it takes 1.5 hours
-- source include/not_valgrind.inc
+-- source include/not_msan.inc
# Save the initial number of concurrent sessions
--source include/count_sessions.inc
diff --git a/mysql-test/main/strings.result b/mysql-test/main/strings.result
index b327381f8bf..2d0eb5e7400 100644
--- a/mysql-test/main/strings.result
+++ b/mysql-test/main/strings.result
@@ -9,15 +9,6 @@ ERROR HY000: \042D\0442\0443 \043E\043F\0435\0440\0430\0446\0438\044E \043D\0435
STOP SLAVE;
RESET SLAVE ALL;
#
-# MDEV-25778 Overrun buffer in to_string_native()
-#
-CREATE TABLE t1 (a DECIMAL(15,11) ZEROFILL);
-INSERT INTO t1 (a) VALUES (0.1),(0.2);
-SELECT length(ENCRYPT(a)) AS f, COUNT(*) FROM t1 GROUP BY f;
-f COUNT(*)
-13 2
-DROP TABLE t1;
-#
# MDEV-25754 ASAN: stack-buffer-overflow in Field_newdate::val_str
#
CREATE TABLE t1 (d DATE);
diff --git a/mysql-test/main/strings.test b/mysql-test/main/strings.test
index d0785cfb072..083ab7b07a4 100644
--- a/mysql-test/main/strings.test
+++ b/mysql-test/main/strings.test
@@ -17,15 +17,6 @@ STOP SLAVE;
RESET SLAVE ALL;
--echo #
---echo # MDEV-25778 Overrun buffer in to_string_native()
---echo #
-
-CREATE TABLE t1 (a DECIMAL(15,11) ZEROFILL);
-INSERT INTO t1 (a) VALUES (0.1),(0.2);
-SELECT length(ENCRYPT(a)) AS f, COUNT(*) FROM t1 GROUP BY f;
-DROP TABLE t1;
-
---echo #
--echo # MDEV-25754 ASAN: stack-buffer-overflow in Field_newdate::val_str
--echo #
diff --git a/mysql-test/main/view.result b/mysql-test/main/view.result
index 27c091a71d1..075e50e1b0a 100644
--- a/mysql-test/main/view.result
+++ b/mysql-test/main/view.result
@@ -1942,14 +1942,6 @@ f1
2005-02-02
drop view v1;
drop table t1;
-CREATE VIEW v1 AS SELECT ENCRYPT("dhgdhgd");
-SELECT * FROM v1;
-drop view v1;
-CREATE VIEW v1 AS SELECT SUBSTRING_INDEX("dkjhgd:kjhdjh", ":", 1);
-SELECT * FROM v1;
-SUBSTRING_INDEX("dkjhgd:kjhdjh", ":", 1)
-dkjhgd
-drop view v1;
create table t1 (f59 int, f60 int, f61 int);
insert into t1 values (19,41,32);
create view v1 as select f59, f60 from t1 where f59 in
diff --git a/mysql-test/main/view.test b/mysql-test/main/view.test
index 1b09bb146f4..825274756a8 100644
--- a/mysql-test/main/view.test
+++ b/mysql-test/main/view.test
@@ -1716,18 +1716,6 @@ drop view v1;
drop table t1;
#
-# using encrypt & substring_index in view (Bug#7024)
-#
-CREATE VIEW v1 AS SELECT ENCRYPT("dhgdhgd");
-disable_result_log;
-SELECT * FROM v1;
-enable_result_log;
-drop view v1;
-CREATE VIEW v1 AS SELECT SUBSTRING_INDEX("dkjhgd:kjhdjh", ":", 1);
-SELECT * FROM v1;
-drop view v1;
-
-#
# hide underlying tables names in case of imposibility to update (Bug#10773)
#
create table t1 (f59 int, f60 int, f61 int);
diff --git a/mysql-test/suite/rpl/t/rpl_dump_request_retry_warning.test b/mysql-test/suite/rpl/t/rpl_dump_request_retry_warning.test
index d750d44ae71..1ee043623ae 100644
--- a/mysql-test/suite/rpl/t/rpl_dump_request_retry_warning.test
+++ b/mysql-test/suite/rpl/t/rpl_dump_request_retry_warning.test
@@ -43,6 +43,12 @@ START SLAVE;
SET DEBUG_SYNC= 'now WAIT_FOR parked';
SET @@GLOBAL.debug_dbug = @saved_dbug;
SET DEBUG_SYNC= 'now SIGNAL continue';
+
+# Ensure the last DEBUG_SYNC signal was received by the target thread before
+# reset; otherwise, the reset can drop the last signal before it gets
+# acknowledged
+let $wait_condition= select count(*)=0 from information_schema.processlist where state like "%debug%";
+source include/wait_condition.inc;
SET DEBUG_SYNC= 'RESET';
--source include/wait_for_slave_io_to_start.inc
diff --git a/storage/innobase/include/buf0buf.h b/storage/innobase/include/buf0buf.h
index 703087d1b7f..5f91617beec 100644
--- a/storage/innobase/include/buf0buf.h
+++ b/storage/innobase/include/buf0buf.h
@@ -1873,9 +1873,14 @@ public:
buf_tmp_buffer_t *io_buf_reserve() { return io_buf.reserve(); }
/** @return whether any I/O is pending */
- bool any_io_pending() const
+ bool any_io_pending()
{
- return n_pend_reads || n_flush_LRU() || n_flush_list();
+ if (n_pend_reads)
+ return true;
+ mysql_mutex_lock(&mutex);
+ const bool any_pending{n_flush_LRU_ || n_flush_list_};
+ mysql_mutex_unlock(&mutex);
+ return any_pending;
}
/** @return total amount of pending I/O */
ulint io_pending() const
diff --git a/storage/innobase/trx/trx0undo.cc b/storage/innobase/trx/trx0undo.cc
index e12952b4725..96dc82049d8 100644
--- a/storage/innobase/trx/trx0undo.cc
+++ b/storage/innobase/trx/trx0undo.cc
@@ -1,7 +1,7 @@
/*****************************************************************************
Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved.
-Copyright (c) 2014, 2021, MariaDB Corporation.
+Copyright (c) 2014, 2022, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@@ -465,6 +465,10 @@ static uint16_t trx_undo_header_create(buf_block_t *undo_page, trx_id_t trx_id,
undo_page->page.frame, free);
mtr->write<8,mtr_t::MAYBE_NOP>(*undo_page, free + TRX_UNDO_TRX_ID +
undo_page->page.frame, trx_id);
+ if (UNIV_UNLIKELY(mach_read_from_8(free + TRX_UNDO_TRX_NO +
+ undo_page->page.frame) != 0))
+ mtr->memset(undo_page, free + TRX_UNDO_TRX_NO, 8, 0);
+
/* Write TRX_UNDO_NEEDS_PURGE=1 and TRX_UNDO_LOG_START. */
mach_write_to_2(buf, 1);
memcpy_aligned<2>(buf + 2, start, 2);
@@ -882,12 +886,19 @@ corrupted:
sql_print_error("InnoDB: unsupported undo header state %u",
state);
goto corrupted;
+ case TRX_UNDO_CACHED:
+ if (UNIV_UNLIKELY(type != 0)) {
+ /* This undo page was not updated by MariaDB
+ 10.3 or later. The TRX_UNDO_TRX_NO field may
+ contain garbage. */
+ break;
+ }
+ goto read_trx_no;
case TRX_UNDO_TO_PURGE:
if (UNIV_UNLIKELY(type == 1)) {
goto corrupted_type;
}
- /* fall through */
- case TRX_UNDO_CACHED:
+ read_trx_no:
trx_id_t id = mach_read_from_8(TRX_UNDO_TRX_NO + undo_header);
if (id >> 48) {
sql_print_error("InnoDB: corrupted TRX_NO %llx", id);