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

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 10.1.3
    • Fix Version/s: 10.1
    • Labels:
      None

      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

        Gliffy Diagrams

          Attachments

            Activity

            There are no comments yet on this issue.

              People

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

                Dates

                • Created:
                  Updated: