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

Merge branch '11.6' into 11.7

This commit is contained in:
Oleksandr Byelkin
2024-11-09 19:01:12 +01:00
789 changed files with 10342 additions and 4415 deletions

View File

@ -1960,6 +1960,11 @@ public:
{
return neg ? -to_seconds_abs() : to_seconds_abs();
}
bool to_bool() const
{
return is_valid_time() &&
(TIME_to_ulonglong_time(this) != 0 || second_part != 0);
}
longlong to_longlong() const
{
if (!is_valid_time())
@ -2320,6 +2325,10 @@ public:
DBUG_ASSERT(is_valid_date_slow());
return Temporal::to_packed();
}
bool to_bool() const
{
return to_longlong() != 0;
}
longlong to_longlong() const
{
return is_valid_date() ? (longlong) TIME_to_ulonglong_date(this) : 0LL;
@ -2639,6 +2648,11 @@ public:
ltime->time_type= type;
return false;
}
bool to_bool() const
{
return is_valid_datetime() &&
(TIME_to_ulonglong_datetime(this) != 0 || second_part != 0);
}
longlong to_longlong() const
{
return is_valid_datetime() ?
@ -2877,6 +2891,10 @@ public:
return Datetime::zero();
return Timestamp::to_datetime(thd);
}
bool to_bool() const
{
return !m_is_zero_datetime;
}
bool is_zero_datetime() const { return m_is_zero_datetime; }
void trunc(uint decimals)
{
@ -3013,7 +3031,7 @@ static inline my_repertoire_t &operator|=(my_repertoire_t &a,
enum Derivation
{
DERIVATION_IGNORABLE= 7, // Explicit NULL
DERIVATION_IGNORABLE= 8, // Explicit NULL
/*
Explicit or implicit conversion from numeric/temporal data to string:
@ -3021,17 +3039,20 @@ enum Derivation
- Numeric user variables
- CAST(numeric_or_temporal_expr AS CHAR)
*/
DERIVATION_NUMERIC= 6,
DERIVATION_NUMERIC= 7,
/*
- String literals
*/
DERIVATION_COERCIBLE= 6,
/*
- String user variables
*/
DERIVATION_COERCIBLE= 5,
DERIVATION_USERVAR= 5,
/*
String cast and conversion functions:
- BINARY(expr)
- CAST(string_expr AS CHAR)
- CONVERT(expr USING cs)
*/
@ -3157,6 +3178,7 @@ public:
case DERIVATION_NUMERIC: return "NUMERIC";
case DERIVATION_IGNORABLE: return "IGNORABLE";
case DERIVATION_COERCIBLE: return "COERCIBLE";
case DERIVATION_USERVAR: return "USERVAR";
case DERIVATION_CAST: return "CAST";
case DERIVATION_IMPLICIT: return "IMPLICIT";
case DERIVATION_SYSCONST: return "SYSCONST";
@ -6035,6 +6057,9 @@ public:
const Type_handler *type_handler_signed() const override;
void Item_update_null_value(Item *item) const override;
bool Item_sum_hybrid_fix_length_and_dec(Item_sum_hybrid *) const override;
Item_cache *Item_get_cache(THD *thd, const Item *item) const override;
int Item_save_in_field(Item *item, Field *field, bool no_conversions)
const override;
};