Details
-
Bug
-
Status: Open (View Workflow)
-
Major
-
Resolution: Unresolved
-
10.11, 11.4, 11.8, 12.3, 13.0, 13.1
-
None
-
Can result in unexpected behaviour
Description
INSTALL SONAME 'ha_connect'; |
|
|
let $MYSQLD_DATADIR= `select @@datadir`; |
|
|
CREATE TABLE t1 (id INT(4) NOT NULL FIELD_FORMAT='Z', val CHAR(10) NOT NULL, KEY(id)) ENGINE=CONNECT TABLE_TYPE=FIX FILE_NAME='deeptest5_idx.txt' ENDING=1; |
INSERT INTO t1 VALUES (50,'row50'),(10,'row10'),(90,'row90'),(30,'row30'),(70,'row70'); |
|
|
--echo # Index works correctly before any corruption
|
SELECT COUNT(*) AS baseline_where90 FROM t1 WHERE id=90; |
SELECT COUNT(*) AS baseline_all FROM t1; |
|
|
FLUSH TABLES;
|
|
|
--echo # Corrupt .fnx index file
|
--let $IDXFILE= $MYSQLD_DATADIR/test/deeptest5_idx.fnx
|
--exec perl -e 'open(F,"+<","'$IDXFILE'") or exit 1; binmode F; seek(F,128,0); print F "\xff\xff\xff\xff"; close F;'
|
|
|
FLUSH TABLES;
|
|
|
--echo # BUG: silently reports 0 rows for a value that still exists in the data file. It should either still be 1, or raise a clean corruption error
|
SELECT COUNT(*) AS after_corruption_where90 FROM t1 WHERE id=90; |
--echo # Proves the row is still physically present -- only the indexed lookup is wrong
|
SELECT COUNT(*) AS after_corruption_all FROM t1; |
SELECT * FROM t1 ORDER BY id; |
|
|
DROP TABLE t1; |
--remove_file $MYSQLD_DATADIR/test/deeptest5_idx.txt |