1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

Merge branch '10.6' into 10.11

This commit is contained in:
Oleksandr Byelkin
2024-10-29 15:24:38 +01:00
655 changed files with 8060 additions and 3541 deletions

View File

@ -1964,6 +1964,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())
@ -2324,6 +2329,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;
@ -2629,6 +2638,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() ?
@ -2857,6 +2871,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)
{
@ -5842,6 +5860,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;
};