Skip to content

Commit

Permalink
MDEV-25907: Assertion failed in dict_table_schema_check()
Browse files Browse the repository at this point in the history
dict_table_schema_check(): Simply remove the debug assertion.
We will still return a failure.
  • Loading branch information
dr-m committed Jun 14, 2021
1 parent 6ba938a commit cb0cad8
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -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))
Expand All @@ -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'
Expand Down
11 changes: 11 additions & 0 deletions mysql-test/suite/innodb/t/innodb_stats_create_on_corrupted.test
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand Down
1 change: 0 additions & 1 deletion storage/innobase/dict/dict0stats.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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."
Expand Down

0 comments on commit cb0cad8

Please sign in to comment.