Commit 9b38137a authored by Sergei Golubchik's avatar Sergei Golubchik

lp:740958 5.1-micro can not handle prepared statements with timestamps involving nanoseconds

fix a typo in the boundary test.
simplify make_truncated_value_warning call.
parent c5547dcf
...@@ -2756,12 +2756,11 @@ void Item_param::set_time(MYSQL_TIME *tm, timestamp_type time_type, ...@@ -2756,12 +2756,11 @@ void Item_param::set_time(MYSQL_TIME *tm, timestamp_type time_type,
value.time.day > 31 || value.time.day > 31 ||
(time_type != MYSQL_TIMESTAMP_TIME && value.time.hour > 23) || (time_type != MYSQL_TIMESTAMP_TIME && value.time.hour > 23) ||
value.time.minute > 59 || value.time.second > 59 || value.time.minute > 59 || value.time.second > 59 ||
value.time.second_part >= MAX_SEC_PART_VALUE) value.time.second_part > MAX_SEC_PART_VALUE)
{ {
char buff[MAX_DATE_STRING_REP_LENGTH]; Lazy_string_time str(tm);
uint length= my_TIME_to_str(&value.time, buff, decimals);
make_truncated_value_warning(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN, make_truncated_value_warning(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
buff, length, time_type, 0); &str, time_type, 0);
set_zero_time(&value.time, MYSQL_TIMESTAMP_ERROR); set_zero_time(&value.time, MYSQL_TIMESTAMP_ERROR);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment