mirror of
https://github.com/MariaDB/server.git
synced 2026-05-17 20:37:12 +02:00
MDEV-16991 Rounding vs truncation for TIME, DATETIME, TIMESTAMP
This commit is contained in:
parent
27f3329ff6
commit
4447a02cf1
59 changed files with 4771 additions and 395 deletions
|
|
@ -258,8 +258,11 @@ namespace mrn {
|
|||
Item *real_value_item = value_item->real_item();
|
||||
switch (field_item->field->type()) {
|
||||
case MYSQL_TYPE_TIME:
|
||||
error = real_value_item->get_time(current_thd, mysql_time);
|
||||
{
|
||||
THD *thd= current_thd;
|
||||
error= real_value_item->get_date(thd, mysql_time, Time::Options(thd));
|
||||
break;
|
||||
}
|
||||
case MYSQL_TYPE_YEAR:
|
||||
mysql_time->year = static_cast<int>(value_item->val_int());
|
||||
mysql_time->month = 1;
|
||||
|
|
@ -273,9 +276,13 @@ namespace mrn {
|
|||
error = false;
|
||||
break;
|
||||
default:
|
||||
error = real_value_item->get_date(current_thd, mysql_time, TIME_FUZZY_DATES);
|
||||
{
|
||||
THD *thd= current_thd;
|
||||
Datetime::Options opt(TIME_FUZZY_DATES, thd);
|
||||
error = real_value_item->get_date(thd, mysql_time, opt);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
DBUG_RETURN(error);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue