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
c86f813a
Commit
c86f813a
authored
Apr 23, 2019
by
Alexander Barkov
Committed by
Nikita Malyavin
Jul 29, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-9234 Add Type_handler::union_element_finalize()
parent
9d5967f7
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
6 deletions
+26
-6
sql/sql_type.cc
sql/sql_type.cc
+12
-0
sql/sql_type.h
sql/sql_type.h
+9
-1
sql/sql_union.cc
sql/sql_union.cc
+5
-5
No files found.
sql/sql_type.cc
View file @
c86f813a
...
...
@@ -5933,6 +5933,18 @@ void Type_handler_geometry::Item_param_set_param_func(Item_param *param,
/***************************************************************************/
bool
Type_handler_string_result
::
union_element_finalize
(
const
Item
*
item
)
const
{
if
(
item
->
collation
.
derivation
==
DERIVATION_NONE
)
{
my_error
(
ER_CANT_AGGREGATE_NCOLLATIONS
,
MYF
(
0
),
"UNION"
);
return
true
;
}
return
false
;
}
/***************************************************************************/
bool
Type_handler
::
Vers_history_point_resolve_unit
(
THD
*
thd
,
Vers_history_point
*
point
)
const
...
...
sql/sql_type.h
View file @
c86f813a
...
...
@@ -1187,6 +1187,14 @@ class Type_handler
virtual
Field
*
make_conversion_table_field
(
TABLE
*
TABLE
,
uint
metadata
,
const
Field
*
target
)
const
=
0
;
/*
Performs the final data type validation for a UNION element,
after the regular "aggregation for result" was done.
*/
virtual
bool
union_element_finalize
(
const
Item
*
item
)
const
{
return
false
;
}
virtual
bool
Column_definition_fix_attributes
(
Column_definition
*
c
)
const
=
0
;
virtual
bool
Column_definition_prepare_stage1
(
THD
*
thd
,
MEM_ROOT
*
mem_root
,
...
...
@@ -2236,7 +2244,7 @@ class Type_handler_string_result: public Type_handler
void
sortlength
(
THD
*
thd
,
const
Type_std_attributes
*
item
,
SORT_FIELD_ATTR
*
attr
)
const
;
bool
union_element_finalize
(
const
Item
*
item
)
const
;
bool
Column_definition_prepare_stage1
(
THD
*
thd
,
MEM_ROOT
*
mem_root
,
Column_definition
*
c
,
...
...
sql/sql_union.cc
View file @
c86f813a
...
...
@@ -1150,12 +1150,12 @@ bool st_select_lex_unit::prepare(TABLE_LIST *derived_arg,
while
((
type
=
tp
++
))
{
if
(
type
->
cmp_type
()
==
STRING_RESULT
&&
type
->
collation
.
derivation
==
DERIVATION_NONE
)
{
my_error
(
ER_CANT_AGGREGATE_NCOLLATIONS
,
MYF
(
0
),
"UNION"
);
/*
Test if the aggregated data type is OK for a UNION element.
E.g. in case of string data, DERIVATION_NONE is not allowed.
*/
if
(
type
->
type_handler
()
->
union_element_finalize
(
type
))
goto
err
;
}
}
/*
...
...
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