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

virtual columns don't work with enum or set as data type

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 5.5.24, 5.3.7, 5.2.12
    • Fix Version/s: 5.5.27, 5.3.8
    • Component/s: None
    • Labels:
      None

      Description

      Trying to use an ENUM data type for a persistent virtual column results in an error

      CREATE TABLE table1 (
      a INT not null,
      b char(2) not null,
      c enum("Y","N") as (case when b = "aa" then "Y" else "N" end) persistent
      );

      ERROR 1033 (HY000): Incorrect information in file: './database/table1.frm'

      Changing the datatype results in a successful table creation.

      CREATE TABLE table1 (
      a INT not null,
      b char(2) not null,
      c char(1) as (case when b = "aa" then "Y" else "N" end) persistent
      );

      Query OK, 0 rows affected (0.16 sec)

        Gliffy Diagrams

          Attachments

            Activity

            Hide
            elenst Elena Stepanova added a comment -

            Reproducible on 5.2, 5.3, 5.5. I haven't found anything in documentation that suggests it's an intentional limitation.

            Show
            elenst Elena Stepanova added a comment - Reproducible on 5.2, 5.3, 5.5. I haven't found anything in documentation that suggests it's an intentional limitation.
            Hide
            igor Igor Babaev added a comment -

            Fixed the bug and sent the patch to Sanja for a review.

            Show
            igor Igor Babaev added a comment - Fixed the bug and sent the patch to Sanja for a review.
            Hide
            sanja Oleksandr Byelkin added a comment -

            the fix is OK

            Show
            sanja Oleksandr Byelkin added a comment - the fix is OK
            Hide
            igor Igor Babaev added a comment -

            The fix was pushed into the 5.2 tree. Buildbot did not show any problems.

            Show
            igor Igor Babaev added a comment - The fix was pushed into the 5.2 tree. Buildbot did not show any problems.

              People

              • Assignee:
                igor Igor Babaev
                Reporter:
                pprkut Heinz Wiesinger
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: