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

function over non existing table which is in a process of creation return error in 5.5 and pass in 10.1

    XMLWordPrintable

Details

    Description

      DELIMITER |;
      CREATE function f1() returns int
      BEGIN
        declare n int;
        set n:= (select count(*) from t1);
        return n;
      end|
      DELIMITER ;|
      create table t1 as select  f1() union all select last_insert_id() ;
      select * from t1;
      drop table t1;
       
      drop function f1;

      in 10.1:

      CREATE function f1() returns int
      BEGIN
      declare n int;
      set n:= (select count(*) from t1);
      return n;
      end|
      create table t1 as select  f1() union all select last_insert_id() ;
      select * from t1;
      f1()
      0
      0
      drop table t1;
      drop function f1;
      main.test3                               [ pass ]      8

      in 5.5:

      CREATE function f1() returns int
      BEGIN
      declare n int;
      set n:= (select count(*) from t1);
      return n;
      end|
      create table t1 as select  f1() union all select last_insert_id() ;
      main.test3                               [ fail ]
              Test ended at 2015-03-12 22:53:04
       
      CURRENT_TEST: main.test3
      mysqltest: At line 13: query 'create table t1 as select  f1() union all select last_insert_id() ' failed: 1146: Table 'test.t1' doesn't exist
       

      can be connected to MDEV-7765

      Attachments

        Activity

          People

            sanja Oleksandr Byelkin
            sanja Oleksandr Byelkin
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Git Integration

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