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

Crash in CREATE..SELECT..UNION with a ENUM column and NULL

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 10.3
    • Fix Version/s: 10.3.1
    • Component/s: OTHER
    • Labels:
      None

      Description

      This is a 10.3 specific problem.

      This script makes the server crash:

      CREATE OR REPLACE TABLE t1 (a ENUM('a1'));
      CREATE OR REPLACE TABLE t2 AS SELECT (SELECT a FROM t1 UNION SELECT NULL);
      

      with this stack trace:

      #0  0x00007ffff5ddaa28 in raise () from /lib64/libc.so.6
      #1  0x00007ffff5ddc62a in abort () from /lib64/libc.so.6
      #2  0x00007ffff5dd3227 in __assert_fail_base () from /lib64/libc.so.6
      #3  0x00007ffff5dd32d2 in __assert_fail () from /lib64/libc.so.6
      #4  0x0000555555d13f72 in Type_handler_enum::make_table_field (
          this=0x5555571cd9c8 <type_handler_enum>, name=0x7ffe70013b90, addr=..., 
          attr=..., table=0x7ffff4197260)
          at /home/bar/maria-git/server.10.2-ext/sql/sql_type.cc:1628
      #5  0x0000555555d12cba in Type_handler::make_and_init_table_field (
          this=0x5555571cd9c8 <type_handler_enum>, name=0x7ffe70013b90, addr=..., 
          attr=..., table=0x7ffff4197260)
          at /home/bar/maria-git/server.10.2-ext/sql/sql_type.cc:1218
      #6  0x0000555555a7c89b in Item::tmp_table_field_from_field_type (
          this=0x7ffe70013b40, table=0x7ffff4197260)
          at /home/bar/maria-git/server.10.2-ext/sql/item.h:553
      

      Note, if I change the CREATE..SELECT not to use UNION, it works fine:

      CREATE OR REPLACE TABLE t1 (a ENUM('a1'));
      CREATE OR REPLACE TABLE t2 AS SELECT (SELECT a FROM t1);
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              bar Alexander Barkov
              Reporter:
              bar Alexander Barkov
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: