Commit 056766c0 authored by Alexander Barkov's avatar Alexander Barkov

The patch for MDEV-23551 did not compile on some compilers. Fixing.

parent 04ce2935
...@@ -1056,6 +1056,13 @@ class Temporal_hybrid: public Temporal ...@@ -1056,6 +1056,13 @@ class Temporal_hybrid: public Temporal
} }
// End of constuctors // End of constuctors
bool copy_valid_value_to_mysql_time(MYSQL_TIME *ltime) const
{
DBUG_ASSERT(is_valid_temporal());
*ltime= *this;
return false;
}
longlong to_longlong() const longlong to_longlong() const
{ {
if (!is_valid_temporal()) if (!is_valid_temporal())
...@@ -1976,7 +1983,7 @@ class Date: public Temporal_with_date ...@@ -1976,7 +1983,7 @@ class Date: public Temporal_with_date
} }
explicit Date(const Temporal_hybrid *from) explicit Date(const Temporal_hybrid *from)
{ {
*(static_cast<MYSQL_TIME*>(this))= *from; from->copy_valid_value_to_mysql_time(this);
DBUG_ASSERT(is_valid_date_slow()); DBUG_ASSERT(is_valid_date_slow());
} }
bool is_valid_date() const bool is_valid_date() const
...@@ -2240,7 +2247,7 @@ class Datetime: public Temporal_with_date ...@@ -2240,7 +2247,7 @@ class Datetime: public Temporal_with_date
} }
explicit Datetime(const Temporal_hybrid *from) explicit Datetime(const Temporal_hybrid *from)
{ {
*(static_cast<MYSQL_TIME*>(this))= *from; from->copy_valid_value_to_mysql_time(this);
DBUG_ASSERT(is_valid_datetime_slow()); DBUG_ASSERT(is_valid_datetime_slow());
} }
explicit Datetime(const MYSQL_TIME *from) explicit Datetime(const MYSQL_TIME *from)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment