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

frm is reported corrupted after ER_EXPRESSION_REFERS_TO_UNINIT_FIELD

Details

    Description

      CREATE TABLE t1 (a INT,b INT AS (b is NULL) VIRTUAL);
      

      Leads to:

      10.7.0 71ed8c136fa203b9b3a678a6d5cc72235ef73ef7 (Debug)

      10.7.0-dbg>CREATE TABLE t1 (a INT,b INT AS (b is NULL) VIRTUAL);
      ERROR 4029 (01000): Expression for field `b` is referring to uninitialized field `b`
      

      Yet;

      10.7.0 71ed8c136fa203b9b3a678a6d5cc72235ef73ef7 (Debug)

      2021-07-28 20:18:44 4 [ERROR] mysqld: Incorrect information in file: './test/t1.frm'
      

      May only be a cosmetic issue (i.e. the error in the error log should not be shown as the table is never created successfully).

      If no underlying bug, propose to not show (i.e. prevent) any error in error log (so as to not confuse DBA's).

      Attachments

        Issue Links

          Activity

            nikitamalyavin Nikita Malyavin added a comment - the patch for review is: https://github.com/MariaDB/server/commit/a15934fb331228e83b704018661227c2b4ca7342

            Add more description about the problem (why it happens) and OK to push

            sanja Oleksandr Byelkin added a comment - Add more description about the problem (why it happens) and OK to push

            The issue is cosmetic only. However, [ERROR] is reported to the server output, which shouldn't happen in this case, since it's just the table was created with wrong spec.

            This happens because the check is made only on the (already created) frm parsing stage, where any parse_vcol_defs error is considered as a corrupted frm.

            Here we should not consider frm corrupted. I think we should never report 'frm corrupted' during table creation, and it is always bogus.

            nikitamalyavin Nikita Malyavin added a comment - The issue is cosmetic only. However, [ERROR] is reported to the server output, which shouldn't happen in this case, since it's just the table was created with wrong spec. This happens because the check is made only on the (already created) frm parsing stage, where any parse_vcol_defs error is considered as a corrupted frm. Here we should not consider frm corrupted. I think we should never report 'frm corrupted' during table creation, and it is always bogus.

            Though it is accidentally duplicated with midenok's work, I made some additional changes:

            • add debug assertion – it shouldn't report corrupted during create table
            • add test without false-positive result
            nikitamalyavin Nikita Malyavin added a comment - Though it is accidentally duplicated with midenok 's work, I made some additional changes: add debug assertion – it shouldn't report corrupted during create table add test without false-positive result

            People

              nikitamalyavin Nikita Malyavin
              Roel Roel Van de Paar
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

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