summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2021-06-14 10:06:27 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2021-06-14 12:38:56 +0300
commitcb0cad8156f5c7de3777e465a6b8f64bc440b278 (patch)
treebd49c1cf6c5b4d95f79e6c1acf8fab19a30a3346
parent6ba938af6219db3489aca7c8daa80a30009716bf (diff)
downloadmariadb-git-cb0cad8156f5c7de3777e465a6b8f64bc440b278.tar.gz
MDEV-25907: Assertion failed in dict_table_schema_check()
dict_table_schema_check(): Simply remove the debug assertion. We will still return a failure.
-rw-r--r--mysql-test/suite/innodb/r/innodb_stats_create_on_corrupted.result9
-rw-r--r--mysql-test/suite/innodb/t/innodb_stats_create_on_corrupted.test11
-rw-r--r--storage/innobase/dict/dict0stats.cc1
3 files changed, 20 insertions, 1 deletions
diff --git a/mysql-test/suite/innodb/r/innodb_stats_create_on_corrupted.result b/mysql-test/suite/innodb/r/innodb_stats_create_on_corrupted.result
index 66ef5ed2696..3c3996e0bba 100644
--- a/mysql-test/suite/innodb/r/innodb_stats_create_on_corrupted.result
+++ b/mysql-test/suite/innodb/r/innodb_stats_create_on_corrupted.result
@@ -1,5 +1,7 @@
call mtr.add_suppression("InnoDB: Table .*innodb_index_stats.* not found");
call mtr.add_suppression("InnoDB: Fetch of persistent statistics requested for table .*");
+call mtr.add_suppression("InnoDB: Table mysql\\.innodb_index_stats has length mismatch in the column name stat_description\\. Please run mariadb-upgrade");
+call mtr.add_suppression("InnoDB: Column stat_description in table mysql\\.innodb_index_stats is VARCHAR");
ALTER TABLE mysql.innodb_index_stats RENAME TO mysql.innodb_index_stats_;
CREATE TABLE test_ps_create_on_corrupted
(a INT, PRIMARY KEY (a))
@@ -17,6 +19,13 @@ avg_row_length 0
max_data_length 0
index_length 0
ALTER TABLE mysql.innodb_index_stats_ RENAME TO mysql.innodb_index_stats;
+SET old_mode='';
+ALTER TABLE mysql.innodb_index_stats
+MODIFY stat_description VARCHAR(1024) COLLATE utf8_bin;
+CREATE TABLE t (a INT) ENGINE=InnoDB STATS_PERSISTENT=1;
+ALTER TABLE mysql.innodb_index_stats
+MODIFY stat_description VARCHAR(1024) COLLATE utf8mb3_bin NOT NULL;
+DROP TABLE t;
# restart
SELECT seq_in_index, column_name, cardinality
FROM information_schema.statistics WHERE table_name = 'test_ps_create_on_corrupted'
diff --git a/mysql-test/suite/innodb/t/innodb_stats_create_on_corrupted.test b/mysql-test/suite/innodb/t/innodb_stats_create_on_corrupted.test
index 5d36cfdcbb9..2ca5ee9fe31 100644
--- a/mysql-test/suite/innodb/t/innodb_stats_create_on_corrupted.test
+++ b/mysql-test/suite/innodb/t/innodb_stats_create_on_corrupted.test
@@ -12,6 +12,8 @@
call mtr.add_suppression("InnoDB: Table .*innodb_index_stats.* not found");
call mtr.add_suppression("InnoDB: Fetch of persistent statistics requested for table .*");
+call mtr.add_suppression("InnoDB: Table mysql\\.innodb_index_stats has length mismatch in the column name stat_description\\. Please run mariadb-upgrade");
+call mtr.add_suppression("InnoDB: Column stat_description in table mysql\\.innodb_index_stats is VARCHAR");
-- vertical_results
@@ -34,6 +36,15 @@ FROM information_schema.tables WHERE table_name = 'test_ps_create_on_corrupted';
# restore the persistent storage
ALTER TABLE mysql.innodb_index_stats_ RENAME TO mysql.innodb_index_stats;
+SET old_mode='';
+ALTER TABLE mysql.innodb_index_stats
+MODIFY stat_description VARCHAR(1024) COLLATE utf8_bin;
+CREATE TABLE t (a INT) ENGINE=InnoDB STATS_PERSISTENT=1;
+ALTER TABLE mysql.innodb_index_stats
+MODIFY stat_description VARCHAR(1024) COLLATE utf8mb3_bin NOT NULL;
+
+DROP TABLE t;
+
--source include/restart_mysqld.inc
-- vertical_results
diff --git a/storage/innobase/dict/dict0stats.cc b/storage/innobase/dict/dict0stats.cc
index 3bc9ed79318..d8ae7106cdc 100644
--- a/storage/innobase/dict/dict0stats.cc
+++ b/storage/innobase/dict/dict0stats.cc
@@ -405,7 +405,6 @@ dict_table_schema_check(
/* check length for exact match */
if (req_schema->columns[i].len != table->cols[j].len) {
- ut_ad(table->cols[j].len < req_schema->columns[i].len);
sql_print_warning("InnoDB: Table %s has"
" length mismatch in the"
" column name %s."