summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2021-07-27 10:47:17 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2021-07-27 10:47:17 +0300
commitf50eb0d398f5f5eb2110192be436e70acd44cb9d (patch)
tree10474699ef727691212dda1cd07fb224c1198770 /mysql-test
parent2575eaa502b4253181651decfda46beef7f3f026 (diff)
parentafe00bb7cce7de279e48a83ededc71b3f8cfafcf (diff)
downloadmariadb-git-f50eb0d398f5f5eb2110192be436e70acd44cb9d.tar.gz
Merge 10.2 into 10.3
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/main/cte_recursive.result22
-rw-r--r--mysql-test/main/cte_recursive.test14
-rw-r--r--mysql-test/main/lock_multi_bug38499.test3
-rw-r--r--mysql-test/main/lock_multi_bug38691.test2
-rw-r--r--mysql-test/suite/binlog_encryption/encrypted_master.test3
-rw-r--r--mysql-test/suite/encryption/t/innodb-page_encryption.test3
-rw-r--r--mysql-test/suite/encryption/t/innodb_encryption_filekeys.test18
-rw-r--r--mysql-test/suite/galera/r/galera_fk_lock_wait.result52
-rw-r--r--mysql-test/suite/galera/t/galera_fk_lock_wait.test40
-rw-r--r--mysql-test/suite/gcol/r/innodb_virtual_fk.result3
-rw-r--r--mysql-test/suite/gcol/t/innodb_virtual_fk.test3
-rw-r--r--mysql-test/suite/innodb/t/innodb-page_compression_lz4.test2
12 files changed, 147 insertions, 18 deletions
diff --git a/mysql-test/main/cte_recursive.result b/mysql-test/main/cte_recursive.result
index 7bfb0876103..86d5fa08b1f 100644
--- a/mysql-test/main/cte_recursive.result
+++ b/mysql-test/main/cte_recursive.result
@@ -4565,6 +4565,28 @@ drop procedure sp1;
drop procedure sp2;
drop table t1;
#
+# MDEV-26202: Recursive CTE used indirectly twice
+# (fixed by the patch forMDEV-26025)
+#
+with recursive
+rcte as ( SELECT 1 AS a
+UNION ALL
+SELECT cast(a + 1 as unsigned int) FROM rcte WHERE a < 3),
+cte1 AS (SELECT a FROM rcte),
+cte2 AS (SELECT a FROM cte1),
+cte3 AS ( SELECT a FROM cte2)
+SELECT * FROM cte2, cte3;
+a a
+1 1
+2 1
+3 1
+1 2
+2 2
+3 2
+1 3
+2 3
+3 3
+#
# End of 10.2 tests
#
#
diff --git a/mysql-test/main/cte_recursive.test b/mysql-test/main/cte_recursive.test
index d9dc1481f18..4c4bd99c24c 100644
--- a/mysql-test/main/cte_recursive.test
+++ b/mysql-test/main/cte_recursive.test
@@ -2920,6 +2920,20 @@ drop procedure sp2;
drop table t1;
--echo #
+--echo # MDEV-26202: Recursive CTE used indirectly twice
+--echo # (fixed by the patch forMDEV-26025)
+--echo #
+
+with recursive
+ rcte as ( SELECT 1 AS a
+ UNION ALL
+ SELECT cast(a + 1 as unsigned int) FROM rcte WHERE a < 3),
+ cte1 AS (SELECT a FROM rcte),
+ cte2 AS (SELECT a FROM cte1),
+ cte3 AS ( SELECT a FROM cte2)
+SELECT * FROM cte2, cte3;
+
+--echo #
--echo # End of 10.2 tests
--echo #
diff --git a/mysql-test/main/lock_multi_bug38499.test b/mysql-test/main/lock_multi_bug38499.test
index b812984e516..c489712e5d8 100644
--- a/mysql-test/main/lock_multi_bug38499.test
+++ b/mysql-test/main/lock_multi_bug38499.test
@@ -2,6 +2,9 @@
# MySQL >= 5.0
#
+# The test can take hours with valgrind
+--source include/not_valgrind.inc
+
# Save the initial number of concurrent sessions
--source include/count_sessions.inc
diff --git a/mysql-test/main/lock_multi_bug38691.test b/mysql-test/main/lock_multi_bug38691.test
index 881a0d8e502..9760c1a873a 100644
--- a/mysql-test/main/lock_multi_bug38691.test
+++ b/mysql-test/main/lock_multi_bug38691.test
@@ -4,6 +4,8 @@
# MySQL >= 5.0
#
+# The test can take hours with valgrind
+--source include/not_valgrind.inc
# Save the initial number of concurrent sessions
--source include/count_sessions.inc
diff --git a/mysql-test/suite/binlog_encryption/encrypted_master.test b/mysql-test/suite/binlog_encryption/encrypted_master.test
index f67e93ce815..f6fc172c79e 100644
--- a/mysql-test/suite/binlog_encryption/encrypted_master.test
+++ b/mysql-test/suite/binlog_encryption/encrypted_master.test
@@ -18,6 +18,9 @@
# - with annotated events, default checksums and minimal binlog row image
#
+# The test can take very long time with valgrind
+--source include/not_valgrind.inc
+
--source include/have_partition.inc
--source encryption_algorithms.inc
--source include/have_innodb.inc
diff --git a/mysql-test/suite/encryption/t/innodb-page_encryption.test b/mysql-test/suite/encryption/t/innodb-page_encryption.test
index df2d1d52aaa..d756f07aea0 100644
--- a/mysql-test/suite/encryption/t/innodb-page_encryption.test
+++ b/mysql-test/suite/encryption/t/innodb-page_encryption.test
@@ -1,6 +1,9 @@
-- source include/have_innodb.inc
-- source include/have_file_key_management_plugin.inc
+# The test can take very long time with valgrind
+--source include/not_valgrind.inc
+
create table innodb_normal(c1 bigint not null, b char(200)) engine=innodb;
show warnings;
create table innodb_compact(c1 bigint not null, b char(200)) engine=innodb row_format=compact encrypted=yes encryption_key_id=1;
diff --git a/mysql-test/suite/encryption/t/innodb_encryption_filekeys.test b/mysql-test/suite/encryption/t/innodb_encryption_filekeys.test
index cd5724638b1..03447bbcfa6 100644
--- a/mysql-test/suite/encryption/t/innodb_encryption_filekeys.test
+++ b/mysql-test/suite/encryption/t/innodb_encryption_filekeys.test
@@ -48,12 +48,6 @@ while ($cnt)
{
real_sleep 1;
dec $cnt;
- if ($cnt == 200)
- {
- --disable_query_log
- set global innodb_encrypt_tables = on;
- --enable_query_log
- }
}
}
if (!$success)
@@ -84,12 +78,6 @@ while ($cnt)
{
real_sleep 1;
dec $cnt;
- if ($cnt == 200)
- {
- --disable_query_log
- set global innodb_encrypt_tables = off;
- --enable_query_log
- }
}
}
if (!$success)
@@ -119,12 +107,6 @@ while ($cnt)
{
real_sleep 1;
dec $cnt;
- if ($cnt == 200)
- {
- --disable_query_log
- set global innodb_encrypt_tables=on;
- --enable_query_log
- }
}
}
if (!$success)
diff --git a/mysql-test/suite/galera/r/galera_fk_lock_wait.result b/mysql-test/suite/galera/r/galera_fk_lock_wait.result
new file mode 100644
index 00000000000..7bbbf40cb29
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_fk_lock_wait.result
@@ -0,0 +1,52 @@
+CREATE TABLE parent(parent_id int not null AUTO_INCREMENT PRIMARY KEY,
+parent_name varchar(80)) ENGINE=InnoDB;
+CREATE TABLE child(child_id int not null AUTO_INCREMENT PRIMARY KEY,
+child_name varchar(80),
+child_parent_id int not null,
+CONSTRAINT `fk_child_parent`
+ FOREIGN KEY (child_parent_id) REFERENCES parent (parent_id)
+ON DELETE CASCADE
+ON UPDATE CASCADE) ENGINE=InnoDB;
+INSERT INTO parent VALUES (1, 'first'),(2,'second'),(3,'foo'),(4,'tmp');
+INSERT INTO child VALUES (NULL,'first_child',1);
+INSERT INTO child VALUES (NULL,'second_child',1);
+INSERT INTO child VALUES (NULL,'first_child2',2);
+INSERT INTO child VALUES (NULL,'first_child3',2);
+INSERT INTO child VALUES (NULL,'first_child4',3);
+BEGIN;
+UPDATE parent SET parent_name = 'bar' WHERE parent_id = 2;
+connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1;
+SET SESSION innodb_lock_wait_timeout=2;
+UPDATE child SET child_parent_id = 5 where child_parent_id = 2;
+ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+connection node_1;
+COMMIT;
+SELECT * FROM parent;
+parent_id parent_name
+1 first
+2 bar
+3 foo
+4 tmp
+SELECT * FROM child;
+child_id child_name child_parent_id
+1 first_child 1
+3 second_child 1
+5 first_child2 2
+7 first_child3 2
+9 first_child4 3
+connection node_2;
+SELECT * FROM parent;
+parent_id parent_name
+1 first
+2 bar
+3 foo
+4 tmp
+SELECT * FROM child;
+child_id child_name child_parent_id
+1 first_child 1
+3 second_child 1
+5 first_child2 2
+7 first_child3 2
+9 first_child4 3
+DROP TABLE child, parent;
+disconnect node_1a;
diff --git a/mysql-test/suite/galera/t/galera_fk_lock_wait.test b/mysql-test/suite/galera/t/galera_fk_lock_wait.test
new file mode 100644
index 00000000000..150c7397f7e
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_fk_lock_wait.test
@@ -0,0 +1,40 @@
+--source include/galera_cluster.inc
+
+CREATE TABLE parent(parent_id int not null AUTO_INCREMENT PRIMARY KEY,
+parent_name varchar(80)) ENGINE=InnoDB;
+
+CREATE TABLE child(child_id int not null AUTO_INCREMENT PRIMARY KEY,
+child_name varchar(80),
+child_parent_id int not null,
+CONSTRAINT `fk_child_parent`
+ FOREIGN KEY (child_parent_id) REFERENCES parent (parent_id)
+ ON DELETE CASCADE
+ ON UPDATE CASCADE) ENGINE=InnoDB;
+
+INSERT INTO parent VALUES (1, 'first'),(2,'second'),(3,'foo'),(4,'tmp');
+INSERT INTO child VALUES (NULL,'first_child',1);
+INSERT INTO child VALUES (NULL,'second_child',1);
+INSERT INTO child VALUES (NULL,'first_child2',2);
+INSERT INTO child VALUES (NULL,'first_child3',2);
+INSERT INTO child VALUES (NULL,'first_child4',3);
+
+BEGIN;
+UPDATE parent SET parent_name = 'bar' WHERE parent_id = 2;
+
+--connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1
+SET SESSION innodb_lock_wait_timeout=2;
+--error ER_LOCK_WAIT_TIMEOUT
+UPDATE child SET child_parent_id = 5 where child_parent_id = 2;
+
+--connection node_1
+COMMIT;
+SELECT * FROM parent;
+SELECT * FROM child;
+
+--connection node_2
+
+SELECT * FROM parent;
+SELECT * FROM child;
+DROP TABLE child, parent;
+
+--disconnect node_1a
diff --git a/mysql-test/suite/gcol/r/innodb_virtual_fk.result b/mysql-test/suite/gcol/r/innodb_virtual_fk.result
index 252274f3e0a..367ed1223f7 100644
--- a/mysql-test/suite/gcol/r/innodb_virtual_fk.result
+++ b/mysql-test/suite/gcol/r/innodb_virtual_fk.result
@@ -809,15 +809,18 @@ generated_email_id int as (email_id),
PRIMARY KEY (id),
KEY mautic_generated_sent_date_email_id (generated_email_id),
FOREIGN KEY (email_id) REFERENCES emails (id) ON DELETE SET NULL
+ON UPDATE CASCADE
) ENGINE=InnoDB;
CREATE TABLE emails_metadata (
email_id int,
PRIMARY KEY (email_id),
CONSTRAINT FK FOREIGN KEY (email_id) REFERENCES emails (id) ON DELETE CASCADE
+ON UPDATE CASCADE
) ENGINE=InnoDB;
INSERT INTO emails VALUES (1);
INSERT INTO email_stats (id, email_id, date_sent) VALUES (1,1,'Jan');
INSERT INTO emails_metadata VALUES (1);
+UPDATE emails SET id=2;
DELETE FROM emails;
DROP TABLE email_stats;
DROP TABLE emails_metadata;
diff --git a/mysql-test/suite/gcol/t/innodb_virtual_fk.test b/mysql-test/suite/gcol/t/innodb_virtual_fk.test
index 24b6a4631e6..c99259531b3 100644
--- a/mysql-test/suite/gcol/t/innodb_virtual_fk.test
+++ b/mysql-test/suite/gcol/t/innodb_virtual_fk.test
@@ -670,6 +670,7 @@ CREATE TABLE email_stats (
PRIMARY KEY (id),
KEY mautic_generated_sent_date_email_id (generated_email_id),
FOREIGN KEY (email_id) REFERENCES emails (id) ON DELETE SET NULL
+ ON UPDATE CASCADE
) ENGINE=InnoDB;
@@ -677,6 +678,7 @@ CREATE TABLE emails_metadata (
email_id int,
PRIMARY KEY (email_id),
CONSTRAINT FK FOREIGN KEY (email_id) REFERENCES emails (id) ON DELETE CASCADE
+ ON UPDATE CASCADE
) ENGINE=InnoDB;
@@ -684,6 +686,7 @@ INSERT INTO emails VALUES (1);
INSERT INTO email_stats (id, email_id, date_sent) VALUES (1,1,'Jan');
INSERT INTO emails_metadata VALUES (1);
+UPDATE emails SET id=2;
DELETE FROM emails;
DROP TABLE email_stats;
diff --git a/mysql-test/suite/innodb/t/innodb-page_compression_lz4.test b/mysql-test/suite/innodb/t/innodb-page_compression_lz4.test
index 49255d3a1ac..ec9bc456e74 100644
--- a/mysql-test/suite/innodb/t/innodb-page_compression_lz4.test
+++ b/mysql-test/suite/innodb/t/innodb-page_compression_lz4.test
@@ -1,6 +1,8 @@
-- source include/have_innodb.inc
-- source include/have_innodb_lz4.inc
-- source include/not_embedded.inc
+# The test can take very long time with valgrind
+--source include/not_valgrind.inc
# lz4
set global innodb_compression_algorithm = 2;