Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-28498

Incorrect information in file: './test/t0.frm' on CREATE TABLE

Details

    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)

      Attachments

        Issue Links

          Activity

            bar Alexander Barkov added a comment - - edited

            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.

            bar Alexander Barkov added a comment - - edited 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.

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

            bar Alexander Barkov added a comment - Changing priority from Critical to Major, as ENUM with binary values is something exotic.
            bar Alexander Barkov added a comment - Hello serg , please review https://github.com/MariaDB/server/commit/8fc488e9ec4c39916f3dbdf0c96cb65a9abcc4a2 Thanks.
            serg Sergei Golubchik added a comment - - edited

            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.

            serg Sergei Golubchik added a comment - - edited 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.

            People

              serg Sergei Golubchik
              Roel Roel Van de Paar
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.