Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
75370a58
Commit
75370a58
authored
Sep 04, 2017
by
Galina Shalygina
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
New tests on errors added. Comments corrected. Some procedures corrected.
parent
6bce8e14
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
190 additions
and
90 deletions
+190
-90
mysql-test/r/table_value_constr.result
mysql-test/r/table_value_constr.result
+18
-0
mysql-test/t/table_value_constr.test
mysql-test/t/table_value_constr.test
+21
-0
sql/item_subselect.cc
sql/item_subselect.cc
+7
-5
sql/share/errmsg-utf8.txt
sql/share/errmsg-utf8.txt
+2
-4
sql/sql_tvc.cc
sql/sql_tvc.cc
+142
-81
No files found.
mysql-test/r/table_value_constr.result
View file @
75370a58
...
...
@@ -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;
mysql-test/t/table_value_constr.test
View file @
75370a58
...
...
@@ -852,4 +852,25 @@ values (3,4)
union
all
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
;
\ No newline at end of file
sql/item_subselect.cc
View file @
75370a58
...
...
@@ -265,12 +265,14 @@ bool Item_subselect::fix_fields(THD *thd_param, Item **ref)
if
(
check_stack_overrun
(
thd
,
STACK_MIN_SIZE
,
(
uchar
*
)
&
res
))
return
TRUE
;
if
(
unit
->
first_select
()
&&
unit
->
first_select
()
->
tvc
)
for
(
SELECT_LEX
*
sl
=
unit
->
first_select
();
sl
;
sl
=
sl
->
next_select
())
{
my_error
(
ER_NO_TVC_IN_SUBQUERY
,
MYF
(
0
));
res
=
1
;
goto
end
;
if
(
sl
->
tvc
)
{
my_error
(
ER_TVC_IN_SUBQUERY
,
MYF
(
0
));
res
=
1
;
goto
end
;
}
}
if
(
!
(
res
=
engine
->
prepare
(
thd
)))
...
...
sql/share/errmsg-utf8.txt
View file @
75370a58
...
...
@@ -7492,7 +7492,5 @@ ER_SP_STACK_TRACE
eng "At line %u in %s"
ER_WRONG_NUMBER_OF_VALUES_IN_TVC
eng "The used table value constructor has a different number of values"
ER_UNKNOWN_VALUE_IN_TVC
eng "Unknown value '%d' in table values constructor definition"
ER_NO_TVC_IN_SUBQUERY
eng "The usage of table value constructor as specification of subselect isn't implemented yet"
\ No newline at end of file
ER_TVC_IN_SUBQUERY
eng "Table value constructor can't be used as specification of subquery isn't implemented yet"
\ No newline at end of file
sql/sql_tvc.cc
View file @
75370a58
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment