Skip to content

Commit

Permalink
The patch for MDEV-23551 did not compile on some compilers. Fixing.
Browse files Browse the repository at this point in the history
  • Loading branch information
abarkov committed Aug 24, 2020
1 parent 04ce293 commit 056766c
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions sql/sql_type.h
Original file line number Diff line number Diff line change
Expand Up @@ -1056,6 +1056,13 @@ class Temporal_hybrid: public Temporal
}
// 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
{
if (!is_valid_temporal())
Expand Down Expand Up @@ -1976,7 +1983,7 @@ class Date: public Temporal_with_date
}
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());
}
bool is_valid_date() const
Expand Down Expand Up @@ -2240,7 +2247,7 @@ class Datetime: public Temporal_with_date
}
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());
}
explicit Datetime(const MYSQL_TIME *from)
Expand Down

0 comments on commit 056766c

Please sign in to comment.