mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
fixed bug handling in views (BUG#5276)
mysql-test/r/view.result: bug handlimg from VIEWs mysql-test/t/view.test: bug handlimg from VIEWs sql/sql_base.cc: fixed bug handling in views
This commit is contained in:
@ -1246,3 +1246,10 @@ select * from v1;
|
|||||||
cast(1 as char(3))
|
cast(1 as char(3))
|
||||||
1
|
1
|
||||||
drop view v1;
|
drop view v1;
|
||||||
|
create view v1 as select 'a',1;
|
||||||
|
create view v2 as select * from v1 union all select * from v1;
|
||||||
|
create view v3 as select * from v2 where 1 = (select `1` from v2);
|
||||||
|
create view v4 as select * from v3;
|
||||||
|
select * from v4;
|
||||||
|
ERROR 21000: Subquery returns more than 1 row
|
||||||
|
drop view v4, v3, v2, v1;
|
||||||
|
@ -1196,3 +1196,14 @@ create view v1 as select cast(1 as char(3));
|
|||||||
show create view v1;
|
show create view v1;
|
||||||
select * from v1;
|
select * from v1;
|
||||||
drop view v1;
|
drop view v1;
|
||||||
|
|
||||||
|
#
|
||||||
|
# bug handlimg from VIEWs
|
||||||
|
#
|
||||||
|
create view v1 as select 'a',1;
|
||||||
|
create view v2 as select * from v1 union all select * from v1;
|
||||||
|
create view v3 as select * from v2 where 1 = (select `1` from v2);
|
||||||
|
create view v4 as select * from v3;
|
||||||
|
-- error 1242
|
||||||
|
select * from v4;
|
||||||
|
drop view v4, v3, v2, v1;
|
||||||
|
@ -1761,9 +1761,9 @@ int open_and_lock_tables(THD *thd, TABLE_LIST *tables)
|
|||||||
{
|
{
|
||||||
DBUG_ENTER("open_and_lock_tables");
|
DBUG_ENTER("open_and_lock_tables");
|
||||||
uint counter;
|
uint counter;
|
||||||
if (open_tables(thd, tables, &counter) || lock_tables(thd, tables, counter))
|
if (open_tables(thd, tables, &counter) || lock_tables(thd, tables, counter)
|
||||||
|
|| mysql_handle_derived(thd->lex))
|
||||||
DBUG_RETURN(thd->net.report_error ? -1 : 1); /* purecov: inspected */
|
DBUG_RETURN(thd->net.report_error ? -1 : 1); /* purecov: inspected */
|
||||||
DBUG_RETURN(mysql_handle_derived(thd->lex));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user