[MDEV-26668] CHECK TABLE fails to report schema mismatch Created: 2021-09-23  Updated: 2023-04-27

Status: Stalled
Project: MariaDB Server
Component/s: Storage Engine - InnoDB
Affects Version/s: 10.2, 10.3, 10.4, 10.5, 10.6
Fix Version/s: 10.4, 10.5, 10.6

Type: Bug Priority: Major
Reporter: Marko Mäkelä Assignee: Thirunarayanan Balathandayuthapani
Resolution: Unresolved Votes: 0
Labels: None

Issue Links:
Relates
relates to MDEV-26450 Corruption due to innodb_undo_log_tru... Closed

 Description   

The following scenario occurred during the testing of MDEV-26450:

--source include/have_innodb.inc
 
CREATE TABLE t1 (a INT, b VARCHAR(255)) ENGINE=InnoDB;
INSERT INTO t1 VALUES(0,'');
let $datadir=`select @@datadir`;
--copy_file $datadir/test/t1.frm $datadir/test/old.frm
ALTER TABLE t1 MODIFY a INT AFTER b;
FLUSH TABLES;
 
--remove_file $datadir/test/t1.frm
--move_file $datadir/test/old.frm $datadir/test/t1.frm
 
CHECK TABLE t1;
OPTIMIZE TABLE t1;
DROP TABLE t1;

Starting with MariaDB 10.4, this should crash in an assertion failure during OPTIMIZE TABLE.

10.6 b740b2356d539a27f8a7a9e9b6455f31bc6c9196

mariadbd: /mariadb/10.6m/storage/innobase/row/row0sel.cc:2903: void row_sel_field_store_in_mysql_format_func(byte *, const mysql_row_templ_t *, const dict_index_t *, ulint, const byte *, ulint): Assertion `templ->mysql_col_len == len' failed.

But, already before that, we have the problem that CHECK TABLE is not reporting any mismatch in the column names and data types between the SQL layer and the InnoDB data dictionary.



 Comments   
Comment by Marko Mäkelä [ 2021-10-18 ]

This looks good. I only have one request: check the types of all columns also when some indexes have been defined.

Comment by Matthias Leich [ 2021-11-02 ]

origin/bb-10.2-MDEV-26668-schema-mismatch 2e130a1a5c2255fde00a5dc34905354acfbb7411 2021-11-02T16:47:23+06:00
behaved well in the RQG test battery for broad range coverage.

Generated at Thu Feb 08 09:47:02 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.