mirror of
https://github.com/MariaDB/server.git
synced 2025-01-16 12:02:42 +01:00
fixed LIMIT clause printing (BUG#4839)
mysql-test/r/view.result: EXISTS with UNION VIEW creation test mysql-test/t/view.test: EXISTS with UNION VIEW creation test sql/sql_lex.cc: fixed LIMIT clause printing
This commit is contained in:
parent
9ca63e55bc
commit
248d7108c9
3 changed files with 15 additions and 2 deletions
|
@ -1042,3 +1042,8 @@ SHOW TABLES;
|
|||
Tables_in_test table_type
|
||||
t2 BASE TABLE
|
||||
v4 VIEW
|
||||
CREATE VIEW v1 AS SELECT EXISTS (SELECT 1 UNION SELECT 2);
|
||||
select * from v1;
|
||||
EXISTS (SELECT 1 UNION SELECT 2)
|
||||
1
|
||||
drop view v1;
|
||||
|
|
|
@ -980,3 +980,10 @@ drop table t1;
|
|||
-- error 1096
|
||||
CREATE VIEW v02 AS SELECT * FROM DUAL;
|
||||
SHOW TABLES;
|
||||
|
||||
#
|
||||
# EXISTS with UNION VIEW
|
||||
#
|
||||
CREATE VIEW v1 AS SELECT EXISTS (SELECT 1 UNION SELECT 2);
|
||||
select * from v1;
|
||||
drop view v1;
|
||||
|
|
|
@ -1481,8 +1481,9 @@ void st_select_lex::print_order(String *str, ORDER *order)
|
|||
|
||||
void st_select_lex::print_limit(THD *thd, String *str)
|
||||
{
|
||||
Item_subselect *item= master_unit()->item;
|
||||
if (item &&
|
||||
SELECT_LEX_UNIT *unit= master_unit();
|
||||
Item_subselect *item= unit->item;
|
||||
if (item && unit->global_parameters == this &&
|
||||
(item->substype() == Item_subselect::EXISTS_SUBS ||
|
||||
item->substype() == Item_subselect::IN_SUBS ||
|
||||
item->substype() == Item_subselect::ALL_SUBS))
|
||||
|
|
Loading…
Reference in a new issue