Commit 1bbf7184 authored by unknown's avatar unknown

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
parent 5009663b
......@@ -1246,3 +1246,10 @@ select * from v1;
cast(1 as char(3))
1
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;
select * from 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");
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(mysql_handle_derived(thd->lex));
}
......
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