From 056766c042e975a91b016246357e9e6929b60b1a Mon Sep 17 00:00:00 2001 From: Alexander Barkov Date: Mon, 24 Aug 2020 14:27:32 +0400 Subject: The patch for MDEV-23551 did not compile on some compilers. Fixing. --- sql/sql_type.h | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'sql/sql_type.h') diff --git a/sql/sql_type.h b/sql/sql_type.h index 2064a55dc14..c1b13dfa811 100644 --- a/sql/sql_type.h +++ b/sql/sql_type.h @@ -1056,6 +1056,13 @@ public: } // 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()) @@ -1976,7 +1983,7 @@ public: } explicit Date(const Temporal_hybrid *from) { - *(static_cast(this))= *from; + from->copy_valid_value_to_mysql_time(this); DBUG_ASSERT(is_valid_date_slow()); } bool is_valid_date() const @@ -2240,7 +2247,7 @@ public: } explicit Datetime(const Temporal_hybrid *from) { - *(static_cast(this))= *from; + from->copy_valid_value_to_mysql_time(this); DBUG_ASSERT(is_valid_datetime_slow()); } explicit Datetime(const MYSQL_TIME *from) -- cgit v1.2.1