[MDEV-28498] Incorrect information in file: './test/t0.frm' on CREATE TABLE Created: 2022-05-07  Updated: 2024-01-12

Status: In Review
Project: MariaDB Server
Component/s: Data Definition - Create Table, Data types
Affects Version/s: 10.2, 10.3, 10.4, 10.5, 10.6, 10.7, 10.8, 10.9, 10.10, 10.11
Fix Version/s: 10.4, 10.5, 10.6

Type: Bug Priority: Minor
Reporter: Roel Van de Paar Assignee: Sergei Golubchik
Resolution: Unresolved Votes: 0
Labels: affects-tests, corruption

Issue Links:
Relates
relates to MDEV-22111 ERROR 1064 & 1033 and SIGSEGV on CREA... Closed
relates to MDEV-27771 [ERROR] mysqld: Incorrect information... Stalled
relates to MDEV-28078 Garbage on multiple equal ENUMs with ... Closed

 Description   

CREATE TABLE t0 (a ENUM ('',0x0000),b ENUM (''));

Leads to:

10.9.0 0b14dbd45b5a1c02616d611876158d44b92b77bf (Debug)

10.9.0-dbg>CREATE TABLE t0 (a ENUM ('',0x0000),b ENUM (''));
ERROR 1033 (HY000): Incorrect information in file: './test/t0.frm'

Bug confirmed present in:
MariaDB: 10.2.44 (dbg), 10.2.44 (opt), 10.3.35 (dbg), 10.3.35 (opt), 10.4.25 (dbg), 10.4.25 (opt), 10.5.16 (dbg), 10.5.16 (opt), 10.6.8 (dbg), 10.6.8 (opt), 10.7.4 (dbg), 10.7.4 (opt), 10.8.3 (dbg), 10.8.3 (opt), 10.9.0 (dbg), 10.9.0 (opt)

Bug (or feature/syntax) confirmed not present in:
MySQL: 5.5.62 (dbg), 5.5.62 (opt), 5.6.51 (dbg), 5.6.51 (opt), 5.7.37 (dbg), 5.7.37 (opt), 8.0.28 (dbg), 8.0.28 (opt)



 Comments   
Comment by Alexander Barkov [ 2022-06-16 ]

Plan A

  • Add a new format for FRM ENUM/SET value list encoding:

    {uint16 number of values, {uint8 length, value}* }
    

  • Add a new FRM flag, say USE_LENGTH_ENCODED_TYPELIBS, indicating that this FRM file uses the new ENUM/SET value list format.
  • Choose the new format when it's really needed, i.e. if the table has values with 0x00 bytes. This is for downgrade compatibility.

A few major releases later we can:

  • Force the new format
  • Remove the HEX encoding for ENUM/SET + UCS2/UTF16/UTF32, use the new format instead.

Plan B

Use HEX encoding for any ENUM/SET with 0x00 bytes, like we do for UCS2/UTF16/UTF32.

Comment by Alexander Barkov [ 2022-08-18 ]

Changing priority from Critical to Major, as ENUM with binary values is something exotic.

Comment by Alexander Barkov [ 2023-12-04 ]

Hello serg,

please review https://github.com/MariaDB/server/commit/8fc488e9ec4c39916f3dbdf0c96cb65a9abcc4a2

Thanks.

Comment by Sergei Golubchik [ 2024-01-06 ]

First, in line with MDEV-27771 any open frm errors from CREATE TABLE should not go into the error log. The suggested fix from MDEV-27771 will do that.

Second, we can still change the ENUM/SET storage in frm to allow such ENUMs, but I'd say it's a minor issue at best.

Generated at Thu Feb 08 10:01:12 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.