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

Crash in CREATE OR REPLACE TABLE t1 AS SELECT spfunc()

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 10.1, 10.0
    • Fix Version/s: 10.0.28, 10.1.19
    • Component/s: Locking
    • Labels:
      None
    • Sprint:
      10.0.28

      Description

      This script crashes the server:

      CREATE TABLE IF NOT EXISTS t1 (i INT);
      DROP FUNCTION IF EXISTS f1;
      DELIMITER $$
      CREATE FUNCTION f1() RETURNS VARCHAR(16383)
      BEGIN
        RETURN 'test';
      END;
      $$
      DELIMITER ;
      CREATE OR REPLACE TABLE t1 AS SELECT f1();
      

      Note, if I replace CREATE OR REPLACE to a DROP followed by CREATE, it works fine:

      CREATE TABLE IF NOT EXISTS t1 (i INT);
      DROP FUNCTION IF EXISTS f1;
      DELIMITER $$
      CREATE FUNCTION f1() RETURNS VARCHAR(16383)
      BEGIN
        RETURN 'test';
      END;
      $$
      DELIMITER ;
      DROP TABLE IF EXISTS t1;
      CREATE TABLE t1 AS SELECT f1();
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              svoj Sergey Vojtovich
              Reporter:
              bar Alexander Barkov
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: