[MDEV-7766] function over non existing table which is in a process of creation return error in 5.5 and pass in 10.1 Created: 2015-03-12  Updated: 2022-01-25

Status: Open
Project: MariaDB Server
Component/s: Data Definition - Procedure
Affects Version/s: 10.1.3
Fix Version/s: 10.1

Type: Bug Priority: Minor
Reporter: Oleksandr Byelkin Assignee: Oleksandr Byelkin
Resolution: Unresolved Votes: 0
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


Generated at Thu Feb 08 07:22:06 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.