Commit 75370a58 authored by Galina Shalygina's avatar Galina Shalygina

New tests on errors added. Comments corrected. Some procedures corrected.

parent 6bce8e14
...@@ -1630,4 +1630,22 @@ ANALYZE ...@@ -1630,4 +1630,22 @@ ANALYZE
} }
} }
} }
# different number of values in TVC
values (1,2),(3,4,5);
ERROR HY000: The used table value constructor has a different number of values
# subquery that uses VALUES structure(s)
select * from t1
where a in (values (1));
ERROR HY000: Table value constructor can't be used as specification of subquery isn't implemented yet
select * from t1
where a in (select 2 union values (1));
ERROR HY000: Table value constructor can't be used as specification of subquery isn't implemented yet
select * from t1
where a in (values (1) union select 2);
ERROR HY000: Table value constructor can't be used as specification of subquery isn't implemented yet
# illegal parameter data types in TVC
values (1,point(1,1)),(1,1);
ERROR HY000: Illegal parameter data types geometry and int for operation 'TABLE VALUE CONSTRUCTOR'
values (1,point(1,1)+1);
ERROR HY000: Illegal parameter data types geometry and int for operation '+'
drop table t1; drop table t1;
...@@ -852,4 +852,25 @@ values (3,4) ...@@ -852,4 +852,25 @@ values (3,4)
union all union all
values (1,2); values (1,2);
--echo # different number of values in TVC
--error ER_WRONG_NUMBER_OF_VALUES_IN_TVC
values (1,2),(3,4,5);
--echo # subquery that uses VALUES structure(s)
--error ER_TVC_IN_SUBQUERY
select * from t1
where a in (values (1));
--error ER_TVC_IN_SUBQUERY
select * from t1
where a in (select 2 union values (1));
--error ER_TVC_IN_SUBQUERY
select * from t1
where a in (values (1) union select 2);
--echo # illegal parameter data types in TVC
--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
values (1,point(1,1)),(1,1);
--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
values (1,point(1,1)+1);
drop table t1; drop table t1;
\ No newline at end of file
...@@ -265,13 +265,15 @@ bool Item_subselect::fix_fields(THD *thd_param, Item **ref) ...@@ -265,13 +265,15 @@ bool Item_subselect::fix_fields(THD *thd_param, Item **ref)
if (check_stack_overrun(thd, STACK_MIN_SIZE, (uchar*)&res)) if (check_stack_overrun(thd, STACK_MIN_SIZE, (uchar*)&res))
return TRUE; return TRUE;
if (unit->first_select() && for (SELECT_LEX *sl= unit->first_select(); sl; sl= sl->next_select())
unit->first_select()->tvc) {
if (sl->tvc)
{ {
my_error(ER_NO_TVC_IN_SUBQUERY, MYF(0)); my_error(ER_TVC_IN_SUBQUERY, MYF(0));
res= 1; res= 1;
goto end; goto end;
} }
}
if (!(res= engine->prepare(thd))) if (!(res= engine->prepare(thd)))
{ {
......
...@@ -7492,7 +7492,5 @@ ER_SP_STACK_TRACE ...@@ -7492,7 +7492,5 @@ ER_SP_STACK_TRACE
eng "At line %u in %s" eng "At line %u in %s"
ER_WRONG_NUMBER_OF_VALUES_IN_TVC ER_WRONG_NUMBER_OF_VALUES_IN_TVC
eng "The used table value constructor has a different number of values" eng "The used table value constructor has a different number of values"
ER_UNKNOWN_VALUE_IN_TVC ER_TVC_IN_SUBQUERY
eng "Unknown value '%d' in table values constructor definition" eng "Table value constructor can't be used as specification of subquery isn't implemented yet"
ER_NO_TVC_IN_SUBQUERY \ No newline at end of file
eng "The usage of table value constructor as specification of subselect isn't implemented yet"
\ No newline at end of file
This diff is collapsed.
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