summaryrefslogtreecommitdiff
path: root/sql/sql_type.h
diff options
context:
space:
mode:
authorAlexander Barkov <bar@mariadb.com>2020-08-24 14:27:32 +0400
committerAlexander Barkov <bar@mariadb.com>2020-08-24 14:27:32 +0400
commit056766c042e975a91b016246357e9e6929b60b1a (patch)
treec03cb39384f739a53d2614dcd5880b1be6fcce6f /sql/sql_type.h
parent04ce29354b6053f0334ad1b8d5acaa0974b10fd8 (diff)
downloadmariadb-git-056766c042e975a91b016246357e9e6929b60b1a.tar.gz
The patch for MDEV-23551 did not compile on some compilers. Fixing.
Diffstat (limited to 'sql/sql_type.h')
-rw-r--r--sql/sql_type.h11
1 files changed, 9 insertions, 2 deletions
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<MYSQL_TIME*>(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<MYSQL_TIME*>(this))= *from;
+ from->copy_valid_value_to_mysql_time(this);
DBUG_ASSERT(is_valid_datetime_slow());
}
explicit Datetime(const MYSQL_TIME *from)