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

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

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 10.0(EOL), 10.1(EOL)
    • 10.0.28, 10.1.19
    • Locking
    • None
    • 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

              svoj Sergey Vojtovich
              bar Alexander Barkov
              Votes:
              0 Vote for this issue
              Watchers:
              3 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.