summaryrefslogtreecommitdiff
path: root/sql/compat56.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/compat56.cc')
-rw-r--r--sql/compat56.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/sql/compat56.cc b/sql/compat56.cc
index 6cbf4a66ac8..f2be7da8934 100644
--- a/sql/compat56.cc
+++ b/sql/compat56.cc
@@ -45,8 +45,10 @@
*/
longlong TIME_to_longlong_time_packed(const MYSQL_TIME *ltime)
{
- /* If month is 0, we mix day with hours: "1 00:10:10" -> "24:00:10" */
- long hms= (((ltime->month ? 0 : ltime->day * 24) + ltime->hour) << 12) |
+ DBUG_ASSERT(ltime->year == 0);
+ DBUG_ASSERT(ltime->month == 0);
+ // Mix days with hours: "1 00:10:10" -> "24:00:10"
+ long hms= ((ltime->day * 24 + ltime->hour) << 12) |
(ltime->minute << 6) | ltime->second;
longlong tmp= MY_PACKED_TIME_MAKE(hms, ltime->second_part);
return ltime->neg ? -tmp : tmp;