1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

MDEV-17792 New class Timestamp and cleanups in Date, Datetime, Field for rounding

This commit is contained in:
Alexander Barkov
2018-11-22 14:53:25 +04:00
parent 2ebb110c36
commit 740ce108a5
9 changed files with 184 additions and 76 deletions

View File

@@ -2576,18 +2576,9 @@ bool Item_func_maketime::get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzy
minute < 0 || minute > 59 || sec.neg() || sec.truncated())
return (null_value= 1);
bzero(ltime, sizeof(*ltime));
ltime->time_type= MYSQL_TIMESTAMP_TIME;
ltime->neg= hour.neg();
if (hour.abs() <= TIME_MAX_HOUR)
{
ltime->hour= (uint) hour.abs();
ltime->minute= (uint) minute;
ltime->second= (uint) sec.sec();
ltime->second_part= sec.usec();
}
else
int warn;
new(ltime) Time(&warn, hour.neg(), hour.abs(), (uint) minute, sec);
if (warn)
{
// use check_time_range() to set ltime to the max value depending on dec
int unused;