summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2022-07-01 17:53:06 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2022-07-01 17:53:06 +0300
commit3c2a5ad3e80edc5b3ffffd033732556a8bef13a4 (patch)
tree83793ba771411c9c1c2582d2c73c9b722e7753c5 /mysql-test
parentba5b2e7b291a9b4bfb97dcdf3c53ca49fc91a4e7 (diff)
parent3dff84cd158ed09e9c5b1a390af7571fd671f012 (diff)
downloadmariadb-git-3c2a5ad3e80edc5b3ffffd033732556a8bef13a4.tar.gz
Merge 10.7 into 10.8
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/main/information_schema_tables.test2
-rw-r--r--mysql-test/suite/funcs_1/t/myisam_views-big.test2
-rw-r--r--mysql-test/suite/gcol/r/innodb_virtual_debug.result21
-rw-r--r--mysql-test/suite/gcol/t/innodb_virtual_debug.test26
-rw-r--r--mysql-test/suite/innodb/r/instant_alter_import.result29
-rw-r--r--mysql-test/suite/innodb/t/alter_copy.test3
-rw-r--r--mysql-test/suite/innodb/t/blob-crash.test1
-rw-r--r--mysql-test/suite/innodb/t/instant_alter_import.test25
-rw-r--r--mysql-test/suite/innodb/t/read_only_recover_committed.test1
-rw-r--r--mysql-test/suite/innodb/t/table_flags.test1
-rw-r--r--mysql-test/suite/innodb/t/xa_recovery.test1
-rw-r--r--mysql-test/suite/innodb_fts/r/crash_recovery.result13
-rw-r--r--mysql-test/suite/innodb_fts/r/fulltext2.result7
-rw-r--r--mysql-test/suite/innodb_fts/t/crash_recovery.test17
-rw-r--r--mysql-test/suite/innodb_fts/t/fulltext2.test11
-rw-r--r--mysql-test/suite/innodb_gis/t/multi_pk.test2
-rw-r--r--mysql-test/suite/innodb_gis/t/rtree_purge.test2
-rw-r--r--mysql-test/suite/multi_source/multi_parallel.test1
-rw-r--r--mysql-test/suite/parts/inc/partition_auto_increment.inc17
-rw-r--r--mysql-test/suite/parts/r/partition_auto_increment_blackhole.result23
-rw-r--r--mysql-test/suite/parts/r/partition_auto_increment_innodb.result12
-rw-r--r--mysql-test/suite/parts/r/partition_auto_increment_maria.result12
-rw-r--r--mysql-test/suite/parts/r/partition_auto_increment_memory.result12
-rw-r--r--mysql-test/suite/parts/r/partition_auto_increment_myisam.result12
24 files changed, 240 insertions, 13 deletions
diff --git a/mysql-test/main/information_schema_tables.test b/mysql-test/main/information_schema_tables.test
index bc4f269a3fb..ee277276b52 100644
--- a/mysql-test/main/information_schema_tables.test
+++ b/mysql-test/main/information_schema_tables.test
@@ -37,7 +37,9 @@ SELECT v.* FROM v JOIN INFORMATION_SCHEMA.TABLES WHERE DATA_LENGTH = -1;
--eval KILL $conid
--disconnect con1
--connection default
+--disable_warnings
DROP VIEW IF EXISTS vv;
+--enable_warnings
DROP VIEW v;
DROP FUNCTION f;
DROP TABLE t;
diff --git a/mysql-test/suite/funcs_1/t/myisam_views-big.test b/mysql-test/suite/funcs_1/t/myisam_views-big.test
index bf499ee789a..60fe1b8eaba 100644
--- a/mysql-test/suite/funcs_1/t/myisam_views-big.test
+++ b/mysql-test/suite/funcs_1/t/myisam_views-big.test
@@ -4,6 +4,8 @@
# because of a pair of slow Solaris Sparc machines in pb2,
# this test is marked as big:
--source include/big_test.inc
+# This test often times out with MSAN
+--source include/not_msan.inc
# MyISAM tables should be used
#
diff --git a/mysql-test/suite/gcol/r/innodb_virtual_debug.result b/mysql-test/suite/gcol/r/innodb_virtual_debug.result
index 80b2bde6ca5..9cac55c25e3 100644
--- a/mysql-test/suite/gcol/r/innodb_virtual_debug.result
+++ b/mysql-test/suite/gcol/r/innodb_virtual_debug.result
@@ -124,3 +124,24 @@ CHECK TABLE t1;
Table Op Msg_type Msg_text
test.t1 check status OK
DROP TABLE t1;
+#
+# MDEV-28806 Assertion `flag == 1' failure in
+# row_build_index_entry_low upon concurrent ALTER and UPDATE
+#
+CREATE TABLE t1(a CHAR(8), b INT, c INT AS (b), KEY(a)) ENGINE=InnoDB;
+INSERT INTO t1(b) VALUES (1),(2);
+connect con1,localhost,root,,test;
+SET DEBUG_SYNC="alter_table_inplace_before_lock_upgrade SIGNAL dml_start WAIT_FOR dml_commit";
+ALTER TABLE t1 ADD KEY ind (c);
+connection default;
+SET DEBUG_SYNC="now WAIT_FOR dml_start";
+UPDATE t1 SET a ='foo';
+SET DEBUG_SYNC="now SIGNAL dml_commit";
+connection con1;
+CHECK TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+DROP TABLE t1;
+disconnect con1;
+connection default;
+SET DEBUG_SYNC=RESET;
diff --git a/mysql-test/suite/gcol/t/innodb_virtual_debug.test b/mysql-test/suite/gcol/t/innodb_virtual_debug.test
index 5ebc90dac19..cd2b860400c 100644
--- a/mysql-test/suite/gcol/t/innodb_virtual_debug.test
+++ b/mysql-test/suite/gcol/t/innodb_virtual_debug.test
@@ -312,4 +312,30 @@ SELECT * FROM t1;
CHECK TABLE t1;
DROP TABLE t1;
+--echo #
+--echo # MDEV-28806 Assertion `flag == 1' failure in
+--echo # row_build_index_entry_low upon concurrent ALTER and UPDATE
+--echo #
+
+CREATE TABLE t1(a CHAR(8), b INT, c INT AS (b), KEY(a)) ENGINE=InnoDB;
+INSERT INTO t1(b) VALUES (1),(2);
+
+--connect (con1,localhost,root,,test)
+SET DEBUG_SYNC="alter_table_inplace_before_lock_upgrade SIGNAL dml_start WAIT_FOR dml_commit";
+send ALTER TABLE t1 ADD KEY ind (c);
+
+--connection default
+SET DEBUG_SYNC="now WAIT_FOR dml_start";
+UPDATE t1 SET a ='foo';
+SET DEBUG_SYNC="now SIGNAL dml_commit";
+
+# Cleanup
+--connection con1
+--reap
+CHECK TABLE t1;
+DROP TABLE t1;
+--disconnect con1
+connection default;
+SET DEBUG_SYNC=RESET;
+
--source include/wait_until_count_sessions.inc
diff --git a/mysql-test/suite/innodb/r/instant_alter_import.result b/mysql-test/suite/innodb/r/instant_alter_import.result
index 3fff0d50b36..c65ffb3ad4c 100644
--- a/mysql-test/suite/innodb/r/instant_alter_import.result
+++ b/mysql-test/suite/innodb/r/instant_alter_import.result
@@ -130,3 +130,32 @@ UNLOCK TABLES;
ALTER TABLE t2 IMPORT TABLESPACE;
ERROR HY000: Index for table 't2' is corrupt; try to repair it
DROP TABLE t1, t2;
+#
+# MDEV-28919 Assertion `(((core_null) + 7) >> 3) ==
+# oindex.n_core_null_bytes || !not_redundant()' failed
+#
+call mtr.add_suppression(" InnoDB: Tablespace for table `test`.`t` is set as discarded");
+CREATE TABLE t (a INTEGER, b INTEGER as (a) VIRTUAL,
+c INTEGER)engine=innodb;
+ALTER TABLE t DISCARD TABLESPACE;
+FLUSH TABLES;
+ALTER TABLE t DROP COLUMN b, algorithm=instant;
+Warnings:
+Warning 1814 Tablespace has been discarded for table `t`
+ALTER TABLE t DROP COLUMN c, algorithm=instant;
+Warnings:
+Warning 1814 Tablespace has been discarded for table `t`
+CREATE TABLE t1(a INTEGER)ENGINE=InnoDB;
+INSERT INTO t1 VALUES(1);
+FLUSH TABLE t1 FOR EXPORT;
+unlock tables;
+ALTER TABLE t IMPORT tablespace;
+Warnings:
+Warning 1814 Tablespace has been discarded for table `t`
+check table t;
+Table Op Msg_type Msg_text
+test.t check status OK
+select * from t;
+a
+1
+DROP TABLE t, t1;
diff --git a/mysql-test/suite/innodb/t/alter_copy.test b/mysql-test/suite/innodb/t/alter_copy.test
index 6b6a0151de4..90f2171d10b 100644
--- a/mysql-test/suite/innodb/t/alter_copy.test
+++ b/mysql-test/suite/innodb/t/alter_copy.test
@@ -2,8 +2,7 @@
--source include/have_debug.inc
--source include/have_debug_sync.inc
--source include/not_embedded.inc
-# Valgrind gives leaks from the first shutdown which confuses mtr
-#--source include/not_valgrind.inc
+--source include/no_valgrind_without_big.inc
--echo #
--echo # MDEV-11415 AVOID INTERMEDIATE COMMIT WHILE DOING
diff --git a/mysql-test/suite/innodb/t/blob-crash.test b/mysql-test/suite/innodb/t/blob-crash.test
index beb500553ea..5d529059742 100644
--- a/mysql-test/suite/innodb/t/blob-crash.test
+++ b/mysql-test/suite/innodb/t/blob-crash.test
@@ -1,5 +1,6 @@
--source include/maybe_debug.inc
--source include/innodb_page_size_small.inc
+--source include/no_valgrind_without_big.inc
--echo #
--echo # Bug #16963396 INNODB: USE OF LARGE EXTERNALLY-STORED FIELDS MAKES
diff --git a/mysql-test/suite/innodb/t/instant_alter_import.test b/mysql-test/suite/innodb/t/instant_alter_import.test
index 3ffbe01f77e..3a811def170 100644
--- a/mysql-test/suite/innodb/t/instant_alter_import.test
+++ b/mysql-test/suite/innodb/t/instant_alter_import.test
@@ -208,3 +208,28 @@ UNLOCK TABLES;
ALTER TABLE t2 IMPORT TABLESPACE;
DROP TABLE t1, t2;
+
+--echo #
+--echo # MDEV-28919 Assertion `(((core_null) + 7) >> 3) ==
+--echo # oindex.n_core_null_bytes || !not_redundant()' failed
+--echo #
+call mtr.add_suppression(" InnoDB: Tablespace for table `test`.`t` is set as discarded");
+CREATE TABLE t (a INTEGER, b INTEGER as (a) VIRTUAL,
+ c INTEGER)engine=innodb;
+ALTER TABLE t DISCARD TABLESPACE;
+FLUSH TABLES;
+# Table does reload
+ALTER TABLE t DROP COLUMN b, algorithm=instant;
+ALTER TABLE t DROP COLUMN c, algorithm=instant;
+
+CREATE TABLE t1(a INTEGER)ENGINE=InnoDB;
+INSERT INTO t1 VALUES(1);
+FLUSH TABLE t1 FOR EXPORT;
+--let $MYSQLD_DATADIR= `select @@datadir`
+--move_file $MYSQLD_DATADIR/test/t1.cfg $MYSQLD_DATADIR/test/t.cfg
+--copy_file $MYSQLD_DATADIR/test/t1.ibd $MYSQLD_DATADIR/test/t.ibd
+unlock tables;
+ALTER TABLE t IMPORT tablespace;
+check table t;
+select * from t;
+DROP TABLE t, t1;
diff --git a/mysql-test/suite/innodb/t/read_only_recover_committed.test b/mysql-test/suite/innodb/t/read_only_recover_committed.test
index 6252c774a25..1d2270315c5 100644
--- a/mysql-test/suite/innodb/t/read_only_recover_committed.test
+++ b/mysql-test/suite/innodb/t/read_only_recover_committed.test
@@ -3,6 +3,7 @@
--source include/have_debug_sync.inc
# need to restart server
--source include/not_embedded.inc
+--source include/no_valgrind_without_big.inc
--disable_query_log
# Ignore messages from the innodb_force_recovery=5 startup.
diff --git a/mysql-test/suite/innodb/t/table_flags.test b/mysql-test/suite/innodb/t/table_flags.test
index 380052b9db6..d36e71b797a 100644
--- a/mysql-test/suite/innodb/t/table_flags.test
+++ b/mysql-test/suite/innodb/t/table_flags.test
@@ -1,6 +1,7 @@
--source include/innodb_page_size.inc
# Embedded server tests do not support restarting
--source include/not_embedded.inc
+--source include/no_valgrind_without_big.inc
--disable_query_log
call mtr.add_suppression("InnoDB: Table `mysql`\\.`innodb_table_stats` not found");
diff --git a/mysql-test/suite/innodb/t/xa_recovery.test b/mysql-test/suite/innodb/t/xa_recovery.test
index 7a67cd8e8b7..cfb82240187 100644
--- a/mysql-test/suite/innodb/t/xa_recovery.test
+++ b/mysql-test/suite/innodb/t/xa_recovery.test
@@ -1,6 +1,7 @@
--source include/have_innodb.inc
# Embedded server does not support restarting.
--source include/not_embedded.inc
+--source include/no_valgrind_without_big.inc
# MDEV-8841 - close tables opened by previous tests,
# so they don't get marked crashed when the server gets crashed
diff --git a/mysql-test/suite/innodb_fts/r/crash_recovery.result b/mysql-test/suite/innodb_fts/r/crash_recovery.result
index e8305cbb2f1..83e5ddaea90 100644
--- a/mysql-test/suite/innodb_fts/r/crash_recovery.result
+++ b/mysql-test/suite/innodb_fts/r/crash_recovery.result
@@ -157,5 +157,18 @@ id title body
1 MySQL Tutorial DBMS stands for Database...
2 MariaDB Tutorial DB means Database ...
DROP TABLE mdev19073, mdev19073_2;
+#
+# MDEV-28706 Redundant InnoDB table fails during alter
+#
+SET @@global.innodb_file_per_table = 0;
+CREATE TABLE t1 (
+col_int INTEGER, col_text TEXT,
+col_text_1 TEXT
+) ENGINE = InnoDB ROW_FORMAT = Redundant ;
+ALTER TABLE t1 ADD FULLTEXT KEY `ftidx` ( col_text ) ;
+INSERT INTO t1 VALUES ( 1255, "mariadb", "InnoDB");
+# restart
+ALTER TABLE t1 ADD FULLTEXT(col_text_1);
+DROP TABLE t1;
SELECT * FROM information_schema.innodb_sys_tables WHERE name LIKE 'test/%';
TABLE_ID NAME FLAG N_COLS SPACE ROW_FORMAT ZIP_PAGE_SIZE SPACE_TYPE
diff --git a/mysql-test/suite/innodb_fts/r/fulltext2.result b/mysql-test/suite/innodb_fts/r/fulltext2.result
index b210b3bd874..7ec2df8ee46 100644
--- a/mysql-test/suite/innodb_fts/r/fulltext2.result
+++ b/mysql-test/suite/innodb_fts/r/fulltext2.result
@@ -272,3 +272,10 @@ fts_doc_id first_name last_name score
6 Ned Flanders 0
7 Nelson Muntz 0
DROP TABLE t1;
+CREATE TABLE t1(a INT, b TEXT, FTS_DOC_ID BIGINT UNSIGNED NOT NULL,
+KEY FTS_DOC_ID_INDEX(FTS_DOC_ID))ENGINE=InnoDB;
+ALTER TABLE t1 ADD COLUMN c INT as (a) VIRTUAL;
+ALTER TABLE t1 ADD d INT NULL;
+ALTER TABLE t1 ADD FULLTEXT(b);
+ERROR HY000: Index 'FTS_DOC_ID_INDEX' is of wrong type for an InnoDB FULLTEXT index
+DROP TABLE t1;
diff --git a/mysql-test/suite/innodb_fts/t/crash_recovery.test b/mysql-test/suite/innodb_fts/t/crash_recovery.test
index 702aaefad83..b8da55a8ba6 100644
--- a/mysql-test/suite/innodb_fts/t/crash_recovery.test
+++ b/mysql-test/suite/innodb_fts/t/crash_recovery.test
@@ -255,4 +255,21 @@ SELECT * FROM mdev19073_2 WHERE MATCH (title, body)
AGAINST ('Database' IN NATURAL LANGUAGE MODE);
DROP TABLE mdev19073, mdev19073_2;
+let $shutdown_timeout=;
+
+--echo #
+--echo # MDEV-28706 Redundant InnoDB table fails during alter
+--echo #
+
+SET @@global.innodb_file_per_table = 0;
+CREATE TABLE t1 (
+ col_int INTEGER, col_text TEXT,
+ col_text_1 TEXT
+) ENGINE = InnoDB ROW_FORMAT = Redundant ;
+ALTER TABLE t1 ADD FULLTEXT KEY `ftidx` ( col_text ) ;
+INSERT INTO t1 VALUES ( 1255, "mariadb", "InnoDB");
+--source include/restart_mysqld.inc
+ALTER TABLE t1 ADD FULLTEXT(col_text_1);
+DROP TABLE t1;
+
SELECT * FROM information_schema.innodb_sys_tables WHERE name LIKE 'test/%';
diff --git a/mysql-test/suite/innodb_fts/t/fulltext2.test b/mysql-test/suite/innodb_fts/t/fulltext2.test
index 4dd2c78827f..1e3894644a0 100644
--- a/mysql-test/suite/innodb_fts/t/fulltext2.test
+++ b/mysql-test/suite/innodb_fts/t/fulltext2.test
@@ -257,3 +257,14 @@ INSERT INTO t1 (id, first_name, last_name) VALUES
analyze table t1;
SELECT fts_doc_id, first_name, last_name, MATCH(first_name) AGAINST('Homer' IN BOOLEAN MODE) AS score FROM t1;
DROP TABLE t1;
+
+#
+# MDEV-28912 NON-UNIQUE FTS_DOC_ID mistaken as FTS_DOC_ID_INDEX
+#
+CREATE TABLE t1(a INT, b TEXT, FTS_DOC_ID BIGINT UNSIGNED NOT NULL,
+ KEY FTS_DOC_ID_INDEX(FTS_DOC_ID))ENGINE=InnoDB;
+ALTER TABLE t1 ADD COLUMN c INT as (a) VIRTUAL;
+ALTER TABLE t1 ADD d INT NULL;
+--error ER_INNODB_FT_WRONG_DOCID_INDEX
+ALTER TABLE t1 ADD FULLTEXT(b);
+DROP TABLE t1;
diff --git a/mysql-test/suite/innodb_gis/t/multi_pk.test b/mysql-test/suite/innodb_gis/t/multi_pk.test
index c90f794fe15..1be919d165a 100644
--- a/mysql-test/suite/innodb_gis/t/multi_pk.test
+++ b/mysql-test/suite/innodb_gis/t/multi_pk.test
@@ -8,6 +8,8 @@
--source include/have_debug.inc
--source include/big_test.inc
--source include/not_valgrind.inc
+# This test often times out with MSAN
+--source include/not_msan.inc
# Create table with R-tree index.
create table t1 (c1 int, c2 varchar(255), c3 geometry not null, primary key(c1, c2), spatial index (c3))engine=innodb;
diff --git a/mysql-test/suite/innodb_gis/t/rtree_purge.test b/mysql-test/suite/innodb_gis/t/rtree_purge.test
index 60ecbe2e53a..fc5ce2e14bc 100644
--- a/mysql-test/suite/innodb_gis/t/rtree_purge.test
+++ b/mysql-test/suite/innodb_gis/t/rtree_purge.test
@@ -3,6 +3,8 @@
--source include/innodb_page_size.inc
--source include/have_sequence.inc
--source include/not_valgrind.inc
+# This test often times out with MSAN
+--source include/not_msan.inc
SET @saved_frequency = @@GLOBAL.innodb_purge_rseg_truncate_frequency;
SET GLOBAL innodb_purge_rseg_truncate_frequency = 1;
diff --git a/mysql-test/suite/multi_source/multi_parallel.test b/mysql-test/suite/multi_source/multi_parallel.test
index a1385198b61..2bbb344378c 100644
--- a/mysql-test/suite/multi_source/multi_parallel.test
+++ b/mysql-test/suite/multi_source/multi_parallel.test
@@ -2,6 +2,7 @@
# Slave_non_transactional_groups, Slave_transactional_groups
--source include/not_embedded.inc
--source include/have_innodb.inc
+--source include/no_valgrind_without_big.inc
--let $rpl_server_count= 0
--connect (master1,127.0.0.1,root,,,$SERVER_MYPORT_1)
diff --git a/mysql-test/suite/parts/inc/partition_auto_increment.inc b/mysql-test/suite/parts/inc/partition_auto_increment.inc
index b9746ec110f..b19a8cd7749 100644
--- a/mysql-test/suite/parts/inc/partition_auto_increment.inc
+++ b/mysql-test/suite/parts/inc/partition_auto_increment.inc
@@ -873,6 +873,8 @@ SELECT LAST_INSERT_ID();
SELECT * FROM t1;
DROP TABLE t1;
}
+--echo ##############################################################################
+}
if (!$skip_update)
{
@@ -880,13 +882,13 @@ if (!$skip_update)
--echo # MDEV-19622 Assertion failures in
--echo # ha_partition::set_auto_increment_if_higher upon UPDATE on Aria table
--echo #
-CREATE OR REPLACE TABLE t1 (pk INT AUTO_INCREMENT, a INT, KEY(pk)) ENGINE=myisam PARTITION BY HASH(a);
+eval CREATE OR REPLACE TABLE t1 (pk INT AUTO_INCREMENT, a INT, KEY(pk)) ENGINE=$engine PARTITION BY HASH(a);
INSERT INTO t1 VALUES (1,1),(2,2);
UPDATE t1 SET pk = 0;
DROP TABLE t1;
}
-if (!$skip_update)
+if (!$skip_delete)
{
--echo #
--echo # MDEV-21027 Assertion `part_share->auto_inc_initialized || !can_use_for_auto_inc_init()'
@@ -897,5 +899,14 @@ REPLACE INTO t1 PARTITION (p0) VALUES (3);
DROP TABLE t1;
}
---echo ##############################################################################
+if (!$skip_truncate)
+{
+--echo #
+--echo # MDEV-21310 AUTO_INCREMENT column throws range error on INSERT in partitioned table |
+--echo # Assertion `part_share->auto_inc_initialized || !can_use_for_auto_inc_init()' failed.
+--echo #
+eval CREATE TABLE t1 (c INT AUTO_INCREMENT KEY) ENGINE=$engine PARTITION BY LIST (c) (PARTITION p1 VALUES IN (1), PARTITION p2 VALUES IN (2));
+ALTER TABLE t1 TRUNCATE PARTITION p1;
+INSERT INTO t1 PARTITION (p1) (c) SELECT 1;
+DROP TABLE t1;
}
diff --git a/mysql-test/suite/parts/r/partition_auto_increment_blackhole.result b/mysql-test/suite/parts/r/partition_auto_increment_blackhole.result
index 0276385dc29..c017aadcbab 100644
--- a/mysql-test/suite/parts/r/partition_auto_increment_blackhole.result
+++ b/mysql-test/suite/parts/r/partition_auto_increment_blackhole.result
@@ -695,3 +695,26 @@ PARTITIONS 2
SELECT * FROM t1 ORDER BY c1;
c1
DROP TABLE t1;
+#
+# MDEV-19622 Assertion failures in
+# ha_partition::set_auto_increment_if_higher upon UPDATE on Aria table
+#
+CREATE OR REPLACE TABLE t1 (pk INT AUTO_INCREMENT, a INT, KEY(pk)) ENGINE='Blackhole' PARTITION BY HASH(a);
+INSERT INTO t1 VALUES (1,1),(2,2);
+UPDATE t1 SET pk = 0;
+DROP TABLE t1;
+#
+# MDEV-21027 Assertion `part_share->auto_inc_initialized || !can_use_for_auto_inc_init()'
+# ha_partition::set_auto_increment_if_higher
+#
+CREATE TABLE t1 (a INT AUTO_INCREMENT PRIMARY KEY) ENGINE='Blackhole' PARTITION BY HASH (a) PARTITIONS 3;
+REPLACE INTO t1 PARTITION (p0) VALUES (3);
+DROP TABLE t1;
+#
+# MDEV-21310 AUTO_INCREMENT column throws range error on INSERT in partitioned table |
+# Assertion `part_share->auto_inc_initialized || !can_use_for_auto_inc_init()' failed.
+#
+CREATE TABLE t1 (c INT AUTO_INCREMENT KEY) ENGINE='Blackhole' PARTITION BY LIST (c) (PARTITION p1 VALUES IN (1), PARTITION p2 VALUES IN (2));
+ALTER TABLE t1 TRUNCATE PARTITION p1;
+INSERT INTO t1 PARTITION (p1) (c) SELECT 1;
+DROP TABLE t1;
diff --git a/mysql-test/suite/parts/r/partition_auto_increment_innodb.result b/mysql-test/suite/parts/r/partition_auto_increment_innodb.result
index ce1e3562d4c..f0f0ff21824 100644
--- a/mysql-test/suite/parts/r/partition_auto_increment_innodb.result
+++ b/mysql-test/suite/parts/r/partition_auto_increment_innodb.result
@@ -1116,11 +1116,12 @@ SELECT * FROM t1;
a
0
DROP TABLE t1;
+##############################################################################
#
# MDEV-19622 Assertion failures in
# ha_partition::set_auto_increment_if_higher upon UPDATE on Aria table
#
-CREATE OR REPLACE TABLE t1 (pk INT AUTO_INCREMENT, a INT, KEY(pk)) ENGINE=myisam PARTITION BY HASH(a);
+CREATE OR REPLACE TABLE t1 (pk INT AUTO_INCREMENT, a INT, KEY(pk)) ENGINE='InnoDB' PARTITION BY HASH(a);
INSERT INTO t1 VALUES (1,1),(2,2);
UPDATE t1 SET pk = 0;
DROP TABLE t1;
@@ -1131,4 +1132,11 @@ DROP TABLE t1;
CREATE TABLE t1 (a INT AUTO_INCREMENT PRIMARY KEY) ENGINE='InnoDB' PARTITION BY HASH (a) PARTITIONS 3;
REPLACE INTO t1 PARTITION (p0) VALUES (3);
DROP TABLE t1;
-##############################################################################
+#
+# MDEV-21310 AUTO_INCREMENT column throws range error on INSERT in partitioned table |
+# Assertion `part_share->auto_inc_initialized || !can_use_for_auto_inc_init()' failed.
+#
+CREATE TABLE t1 (c INT AUTO_INCREMENT KEY) ENGINE='InnoDB' PARTITION BY LIST (c) (PARTITION p1 VALUES IN (1), PARTITION p2 VALUES IN (2));
+ALTER TABLE t1 TRUNCATE PARTITION p1;
+INSERT INTO t1 PARTITION (p1) (c) SELECT 1;
+DROP TABLE t1;
diff --git a/mysql-test/suite/parts/r/partition_auto_increment_maria.result b/mysql-test/suite/parts/r/partition_auto_increment_maria.result
index ad041735ebb..8c063958b27 100644
--- a/mysql-test/suite/parts/r/partition_auto_increment_maria.result
+++ b/mysql-test/suite/parts/r/partition_auto_increment_maria.result
@@ -1148,11 +1148,12 @@ SELECT * FROM t1;
a
0
DROP TABLE t1;
+##############################################################################
#
# MDEV-19622 Assertion failures in
# ha_partition::set_auto_increment_if_higher upon UPDATE on Aria table
#
-CREATE OR REPLACE TABLE t1 (pk INT AUTO_INCREMENT, a INT, KEY(pk)) ENGINE=myisam PARTITION BY HASH(a);
+CREATE OR REPLACE TABLE t1 (pk INT AUTO_INCREMENT, a INT, KEY(pk)) ENGINE='Aria' PARTITION BY HASH(a);
INSERT INTO t1 VALUES (1,1),(2,2);
UPDATE t1 SET pk = 0;
DROP TABLE t1;
@@ -1163,4 +1164,11 @@ DROP TABLE t1;
CREATE TABLE t1 (a INT AUTO_INCREMENT PRIMARY KEY) ENGINE='Aria' PARTITION BY HASH (a) PARTITIONS 3;
REPLACE INTO t1 PARTITION (p0) VALUES (3);
DROP TABLE t1;
-##############################################################################
+#
+# MDEV-21310 AUTO_INCREMENT column throws range error on INSERT in partitioned table |
+# Assertion `part_share->auto_inc_initialized || !can_use_for_auto_inc_init()' failed.
+#
+CREATE TABLE t1 (c INT AUTO_INCREMENT KEY) ENGINE='Aria' PARTITION BY LIST (c) (PARTITION p1 VALUES IN (1), PARTITION p2 VALUES IN (2));
+ALTER TABLE t1 TRUNCATE PARTITION p1;
+INSERT INTO t1 PARTITION (p1) (c) SELECT 1;
+DROP TABLE t1;
diff --git a/mysql-test/suite/parts/r/partition_auto_increment_memory.result b/mysql-test/suite/parts/r/partition_auto_increment_memory.result
index d2d1fb6831c..3461f8b13c5 100644
--- a/mysql-test/suite/parts/r/partition_auto_increment_memory.result
+++ b/mysql-test/suite/parts/r/partition_auto_increment_memory.result
@@ -1129,11 +1129,12 @@ SELECT * FROM t1;
a
0
DROP TABLE t1;
+##############################################################################
#
# MDEV-19622 Assertion failures in
# ha_partition::set_auto_increment_if_higher upon UPDATE on Aria table
#
-CREATE OR REPLACE TABLE t1 (pk INT AUTO_INCREMENT, a INT, KEY(pk)) ENGINE=myisam PARTITION BY HASH(a);
+CREATE OR REPLACE TABLE t1 (pk INT AUTO_INCREMENT, a INT, KEY(pk)) ENGINE='Memory' PARTITION BY HASH(a);
INSERT INTO t1 VALUES (1,1),(2,2);
UPDATE t1 SET pk = 0;
DROP TABLE t1;
@@ -1144,4 +1145,11 @@ DROP TABLE t1;
CREATE TABLE t1 (a INT AUTO_INCREMENT PRIMARY KEY) ENGINE='Memory' PARTITION BY HASH (a) PARTITIONS 3;
REPLACE INTO t1 PARTITION (p0) VALUES (3);
DROP TABLE t1;
-##############################################################################
+#
+# MDEV-21310 AUTO_INCREMENT column throws range error on INSERT in partitioned table |
+# Assertion `part_share->auto_inc_initialized || !can_use_for_auto_inc_init()' failed.
+#
+CREATE TABLE t1 (c INT AUTO_INCREMENT KEY) ENGINE='Memory' PARTITION BY LIST (c) (PARTITION p1 VALUES IN (1), PARTITION p2 VALUES IN (2));
+ALTER TABLE t1 TRUNCATE PARTITION p1;
+INSERT INTO t1 PARTITION (p1) (c) SELECT 1;
+DROP TABLE t1;
diff --git a/mysql-test/suite/parts/r/partition_auto_increment_myisam.result b/mysql-test/suite/parts/r/partition_auto_increment_myisam.result
index f92a6ed18c6..525f47bdbd7 100644
--- a/mysql-test/suite/parts/r/partition_auto_increment_myisam.result
+++ b/mysql-test/suite/parts/r/partition_auto_increment_myisam.result
@@ -1148,11 +1148,12 @@ SELECT * FROM t1;
a
0
DROP TABLE t1;
+##############################################################################
#
# MDEV-19622 Assertion failures in
# ha_partition::set_auto_increment_if_higher upon UPDATE on Aria table
#
-CREATE OR REPLACE TABLE t1 (pk INT AUTO_INCREMENT, a INT, KEY(pk)) ENGINE=myisam PARTITION BY HASH(a);
+CREATE OR REPLACE TABLE t1 (pk INT AUTO_INCREMENT, a INT, KEY(pk)) ENGINE='MyISAM' PARTITION BY HASH(a);
INSERT INTO t1 VALUES (1,1),(2,2);
UPDATE t1 SET pk = 0;
DROP TABLE t1;
@@ -1163,4 +1164,11 @@ DROP TABLE t1;
CREATE TABLE t1 (a INT AUTO_INCREMENT PRIMARY KEY) ENGINE='MyISAM' PARTITION BY HASH (a) PARTITIONS 3;
REPLACE INTO t1 PARTITION (p0) VALUES (3);
DROP TABLE t1;
-##############################################################################
+#
+# MDEV-21310 AUTO_INCREMENT column throws range error on INSERT in partitioned table |
+# Assertion `part_share->auto_inc_initialized || !can_use_for_auto_inc_init()' failed.
+#
+CREATE TABLE t1 (c INT AUTO_INCREMENT KEY) ENGINE='MyISAM' PARTITION BY LIST (c) (PARTITION p1 VALUES IN (1), PARTITION p2 VALUES IN (2));
+ALTER TABLE t1 TRUNCATE PARTITION p1;
+INSERT INTO t1 PARTITION (p1) (c) SELECT 1;
+DROP TABLE t1;