Details
-
Bug
-
Status: Open (View Workflow)
-
Major
-
Resolution: Unresolved
-
10.5, 11.6
-
None
Description
MyISAM uses only one byte to store the ID of the table-level default collation:
myisamdef.h: uchar language; /* Language for indexes */ |
This member is used in myisamchk.c.
If I create a table with a collation whose ID is greater than 255 (for example, latin1_nopad_bin, collation ID=1071)
CREATE OR REPLCE TABLE t1 (a TEXT) CHARACTER SET latin1 COLLATE latin1_nopad_bin; |
FLUSH TABLES;
|
myisamchk erroneously thinks the ID equals to (1071 mod 256), which gives 47:
$ ../../bin/myisamchk -d t1.MYI
|
|
MyISAM file: t1.MYI
|
Record format: Packed
|
Character set: latin1_bin (47)
|
Data records: 0 Deleted blocks: 0
|
Recordlength: 12
|
table description:
Key Start Len Index Type
|
This makes myisamchk broken for collations > 255. It seems that it can corrupt the table that way. Or at least it can keep repairing it, thinking that collation changes every time.
MyISAM should be fixed to store collation IDs using 2 bytes.
Aria should be checked for the same problem.
Attachments
Issue Links
- relates to
-
MDEV-19123 Change default charset from latin1 to utf8mb4
-
- Closed
-