1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-27 18:02:13 +03:00

Merge branch '10.3' into 10.4

This commit is contained in:
Igor Babaev
2018-06-03 10:34:41 -07:00
1308 changed files with 50217 additions and 28761 deletions

View File

@ -161,15 +161,6 @@ void Temporal_with_date::make_from_item(THD *thd, Item *item, sql_mode_t flags)
}
void Type_std_attributes::set(const Field *field)
{
decimals= field->decimals();
unsigned_flag= MY_TEST(field->flags & UNSIGNED_FLAG);
collation.set(field->charset(), field->derivation(), field->repertoire());
fix_char_length(field->char_length());
}
uint Type_std_attributes::count_max_decimals(Item **item, uint nitems)
{
uint res= 0;
@ -476,6 +467,20 @@ const Name
Type_handler_datetime_common::m_name_datetime(STRING_WITH_LEN("datetime")),
Type_handler_timestamp_common::m_name_timestamp(STRING_WITH_LEN("timestamp"));
const Type_limits_int
Type_handler_tiny::m_limits_sint8= Type_limits_sint8(),
Type_handler_tiny::m_limits_uint8= Type_limits_uint8(),
Type_handler_short::m_limits_sint16= Type_limits_sint16(),
Type_handler_short::m_limits_uint16= Type_limits_uint16(),
Type_handler_int24::m_limits_sint24= Type_limits_sint24(),
Type_handler_int24::m_limits_uint24= Type_limits_uint24(),
Type_handler_long::m_limits_sint32= Type_limits_sint32(),
Type_handler_long::m_limits_uint32= Type_limits_uint32(),
Type_handler_longlong::m_limits_sint64= Type_limits_sint64(),
Type_handler_longlong::m_limits_uint64= Type_limits_uint64();
/***************************************************************************/
const Type_handler *Type_handler_null::type_handler_for_comparison() const
@ -696,9 +701,7 @@ Type_handler_hybrid_field_type::aggregate_for_comparison(const Type_handler *h)
Item_result a= cmp_type();
Item_result b= h->cmp_type();
if (m_vers_trx_id && (a == STRING_RESULT || b == STRING_RESULT))
m_type_handler= &type_handler_datetime;
else if (a == STRING_RESULT && b == STRING_RESULT)
if (a == STRING_RESULT && b == STRING_RESULT)
m_type_handler= &type_handler_long_blob;
else if (a == INT_RESULT && b == INT_RESULT)
m_type_handler= &type_handler_longlong;
@ -2506,6 +2509,14 @@ uint32 Type_handler_bit::max_display_length(const Item *item) const
return item->max_length;
}
uint32 Type_handler_general_purpose_int::max_display_length(const Item *item)
const
{
return type_limits_int_by_unsigned_flag(item->unsigned_flag)->char_length();
}
/*************************************************************************/
int Type_handler_time_common::Item_save_in_field(Item *item, Field *field,
@ -6285,4 +6296,61 @@ bool Type_handler_geometry::
}
#endif
bool Type_handler::Vers_history_point_resolve_unit(THD *thd,
Vers_history_point *point)
const
{
/*
Disallow using non-relevant data types in history points.
Even expressions with explicit TRANSACTION or TIMESTAMP units.
*/
point->bad_expression_data_type_error(name().ptr());
return true;
}
bool Type_handler_typelib::
Vers_history_point_resolve_unit(THD *thd,
Vers_history_point *point) const
{
/*
ENUM/SET have dual type properties (string and numeric).
Require explicit CAST to avoid ambiguity.
*/
point->bad_expression_data_type_error(name().ptr());
return true;
}
bool Type_handler_general_purpose_int::
Vers_history_point_resolve_unit(THD *thd,
Vers_history_point *point) const
{
return point->resolve_unit_trx_id(thd);
}
bool Type_handler_bit::
Vers_history_point_resolve_unit(THD *thd,
Vers_history_point *point) const
{
return point->resolve_unit_trx_id(thd);
}
bool Type_handler_temporal_result::
Vers_history_point_resolve_unit(THD *thd,
Vers_history_point *point) const
{
return point->resolve_unit_timestamp(thd);
}
bool Type_handler_general_purpose_string::
Vers_history_point_resolve_unit(THD *thd,
Vers_history_point *point) const
{
return point->resolve_unit_timestamp(thd);
}
/***************************************************************************/