Commit dc3f5594 authored by Igor Babaev's avatar Igor Babaev

MDEV-17107 Assertion `table_list->table' failed in find_field_in_table_ref

Added only test case because the bug was fixed by the patch for mdev-16992.
parent 2308b9af
...@@ -1641,3 +1641,21 @@ a b ...@@ -1641,3 +1641,21 @@ a b
drop procedure p1; drop procedure p1;
drop procedure p2; drop procedure p2;
drop table t1; drop table t1;
#
# MDEV-17107: PS for CREATE OR REPLACE VIEW defined by SELECT with CTEs
#
create table t1(a int);
insert into t1 values (3), (1), (2);
create table t2 (b int);
insert into t2 values (2), (10);
prepare stmt from
"create or replace view v1 as
with t as (select s.a from (select t1.a from t1) s),
r as(select t.a from t2, t where t2.b=t.a)
select a from r;";
execute stmt;
select * from v1;
a
2
drop view v1;
drop table t1,t2;
...@@ -1147,3 +1147,24 @@ select * from t1; ...@@ -1147,3 +1147,24 @@ select * from t1;
drop procedure p1; drop procedure p1;
drop procedure p2; drop procedure p2;
drop table t1; drop table t1;
--echo #
--echo # MDEV-17107: PS for CREATE OR REPLACE VIEW defined by SELECT with CTEs
--echo #
create table t1(a int);
insert into t1 values (3), (1), (2);
create table t2 (b int);
insert into t2 values (2), (10);
prepare stmt from
"create or replace view v1 as
with t as (select s.a from (select t1.a from t1) s),
r as(select t.a from t2, t where t2.b=t.a)
select a from r;";
execute stmt;
select * from v1;
drop view v1;
drop table t1,t2;
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment