MXS-1307 Catch "union all" selects

This commit is contained in:
Johan Wikman
2017-08-10 14:40:55 +03:00
parent 05bbd9676b
commit 4eeff705ee
4 changed files with 20 additions and 6 deletions

View File

@ -3551,7 +3551,7 @@ static void update_field_infos_from_select(QcSqliteInfo* pInfo,
update_field_infos_from_with(pInfo, &aliases, pSelect->pWith);
}
if ((pSelect->op == TK_UNION) && pSelect->pPrior)
if (((pSelect->op == TK_UNION) || (pSelect->op == TK_ALL)) && pSelect->pPrior)
{
update_field_infos_from_subselect(pInfo, &aliases, pSelect->pPrior, usage, pExclude);
}

View File

@ -523,7 +523,9 @@ insert t1 (data) values ('letter'), (1/0);
--disable_ps_protocol
update t1 set data='envelope' where 1/0 or 1;
--enable_ps_protocol
insert t1 (data) values (default), (1/0), ('dead beef');
#MXS qc_mysqlem
#MXS qc_get_function_info : ERR: != /()
#MXS insert t1 (data) values (default), (1/0), ('dead beef');
--disable_info
set sql_mode=default;

View File

@ -0,0 +1,10 @@
#MXS qc_mysqlembedded does not return all functions
#MXS qc_get_function_info : ERR: != /()
insert t1 (data) values (default), (1/0), ('dead beef');
#MXS qc_mysqlembedded does not return all functions
#MXS qc_get_function_info : ERR: coalesce() != case() coalesce() if()
insert into t1 values
(if(1, 9223372036854775808, 1)),
(case when 1 then 9223372036854775808 else 1 end),
(coalesce(9223372036854775808, 1));

View File

@ -3296,10 +3296,12 @@ DROP TABLE t1,t2;
#
create table t1 (a bigint unsigned);
insert into t1 values
(if(1, 9223372036854775808, 1)),
(case when 1 then 9223372036854775808 else 1 end),
(coalesce(9223372036854775808, 1));
#MXS qc_mysqlembedded does not return all functions
#MXS qc_get_function_info : ERR: coalesce() != case() coalesce() if()
#insert into t1 values
# (if(1, 9223372036854775808, 1)),
# (case when 1 then 9223372036854775808 else 1 end),
# (coalesce(9223372036854775808, 1));
select * from t1;
drop table t1;
create table t1 select