mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
MDEV-9234 Add Type_handler::union_element_finalize()
This commit is contained in:
committed by
Nikita Malyavin
parent
9d5967f74b
commit
c86f813afe
@ -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,
|
bool Type_handler::Vers_history_point_resolve_unit(THD *thd,
|
||||||
Vers_history_point *point)
|
Vers_history_point *point)
|
||||||
const
|
const
|
||||||
|
@ -1187,6 +1187,14 @@ public:
|
|||||||
virtual Field *make_conversion_table_field(TABLE *TABLE,
|
virtual Field *make_conversion_table_field(TABLE *TABLE,
|
||||||
uint metadata,
|
uint metadata,
|
||||||
const Field *target) const= 0;
|
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_fix_attributes(Column_definition *c) const= 0;
|
||||||
virtual bool Column_definition_prepare_stage1(THD *thd,
|
virtual bool Column_definition_prepare_stage1(THD *thd,
|
||||||
MEM_ROOT *mem_root,
|
MEM_ROOT *mem_root,
|
||||||
@ -2236,7 +2244,7 @@ public:
|
|||||||
void sortlength(THD *thd,
|
void sortlength(THD *thd,
|
||||||
const Type_std_attributes *item,
|
const Type_std_attributes *item,
|
||||||
SORT_FIELD_ATTR *attr) const;
|
SORT_FIELD_ATTR *attr) const;
|
||||||
|
bool union_element_finalize(const Item * item) const;
|
||||||
bool Column_definition_prepare_stage1(THD *thd,
|
bool Column_definition_prepare_stage1(THD *thd,
|
||||||
MEM_ROOT *mem_root,
|
MEM_ROOT *mem_root,
|
||||||
Column_definition *c,
|
Column_definition *c,
|
||||||
|
@ -1150,12 +1150,12 @@ cont:
|
|||||||
|
|
||||||
while ((type= tp++))
|
while ((type= tp++))
|
||||||
{
|
{
|
||||||
if (type->cmp_type() == STRING_RESULT &&
|
/*
|
||||||
type->collation.derivation == DERIVATION_NONE)
|
Test if the aggregated data type is OK for a UNION element.
|
||||||
{
|
E.g. in case of string data, DERIVATION_NONE is not allowed.
|
||||||
my_error(ER_CANT_AGGREGATE_NCOLLATIONS, MYF(0), "UNION");
|
*/
|
||||||
|
if (type->type_handler()->union_element_finalize(type))
|
||||||
goto err;
|
goto err;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Reference in New Issue
Block a user