mirror of
https://github.com/MariaDB/server.git
synced 2025-09-02 09:41:40 +03:00
BUG#14026: When doing the end-of-prepare fix up for TABLE_LISTs used in the PS, do the fixup
for underlying tables of a merge VIEWs, too.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
drop table if exists t1,t2,t9,`t1a``b`,v1,v2,v3,v4,v5,v6;
|
||||
drop table if exists t1,t2,t3,t4,t9,`t1a``b`,v1,v2,v3,v4,v5,v6;
|
||||
drop view if exists t1,t2,`t1a``b`,v1,v2,v3,v4,v5,v6;
|
||||
drop database if exists mysqltest;
|
||||
use test;
|
||||
@@ -2323,3 +2323,24 @@ id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 PRIMARY t3 ALL NULL NULL NULL NULL 3 Using where
|
||||
DROP VIEW v1,v2;
|
||||
DROP TABLE t1,t2,t3;
|
||||
create table t1 (x int, y int);
|
||||
create table t2 (x int, y int, z int);
|
||||
create table t3 (x int, y int, z int);
|
||||
create table t4 (x int, y int, z int);
|
||||
create view v1 as
|
||||
select t1.x
|
||||
from (
|
||||
(t1 join t2 on ((t1.y = t2.y)))
|
||||
join
|
||||
(t3 left join t4 on (t3.y = t4.y) and (t3.z = t4.z))
|
||||
);
|
||||
prepare stmt1 from "select count(*) from v1 where x = ?";
|
||||
set @parm1=1;
|
||||
execute stmt1 using @parm1;
|
||||
count(*)
|
||||
0
|
||||
execute stmt1 using @parm1;
|
||||
count(*)
|
||||
0
|
||||
drop view v1;
|
||||
drop table t1,t2,t3,t4;
|
||||
|
@@ -1,5 +1,5 @@
|
||||
--disable_warnings
|
||||
drop table if exists t1,t2,t9,`t1a``b`,v1,v2,v3,v4,v5,v6;
|
||||
drop table if exists t1,t2,t3,t4,t9,`t1a``b`,v1,v2,v3,v4,v5,v6;
|
||||
drop view if exists t1,t2,`t1a``b`,v1,v2,v3,v4,v5,v6;
|
||||
drop database if exists mysqltest;
|
||||
--enable_warnings
|
||||
@@ -2189,4 +2189,26 @@ EXPLAIN SELECT * FROM v2 WHERE a=1;
|
||||
DROP VIEW v1,v2;
|
||||
DROP TABLE t1,t2,t3;
|
||||
|
||||
#
|
||||
# BUG#14026 Crash on second PS execution when using views
|
||||
#
|
||||
create table t1 (x int, y int);
|
||||
create table t2 (x int, y int, z int);
|
||||
create table t3 (x int, y int, z int);
|
||||
create table t4 (x int, y int, z int);
|
||||
|
||||
create view v1 as
|
||||
select t1.x
|
||||
from (
|
||||
(t1 join t2 on ((t1.y = t2.y)))
|
||||
join
|
||||
(t3 left join t4 on (t3.y = t4.y) and (t3.z = t4.z))
|
||||
);
|
||||
|
||||
prepare stmt1 from "select count(*) from v1 where x = ?";
|
||||
set @parm1=1;
|
||||
|
||||
execute stmt1 using @parm1;
|
||||
execute stmt1 using @parm1;
|
||||
drop view v1;
|
||||
drop table t1,t2,t3,t4;
|
||||
|
Reference in New Issue
Block a user