summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergei Golubchik <sergii@pisem.net>2011-03-23 14:10:11 +0100
committerSergei Golubchik <sergii@pisem.net>2011-03-23 14:10:11 +0100
commita85ccfedcf91f7ad2c578ec60e69d127f199d079 (patch)
tree5f355f6631542251505e686af86e4a204077bc93
parent8d2738367efc79a0adf5dfbb159de3d2ec84d6f1 (diff)
downloadmariadb-git-a85ccfedcf91f7ad2c578ec60e69d127f199d079.tar.gz
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.
-rw-r--r--sql/item.cc7
1 files changed, 3 insertions, 4 deletions
diff --git a/sql/item.cc b/sql/item.cc
index 40e23f524db..6105aaa0ed1 100644
--- a/sql/item.cc
+++ b/sql/item.cc
@@ -2756,12 +2756,11 @@ void Item_param::set_time(MYSQL_TIME *tm, timestamp_type time_type,
value.time.day > 31 ||
(time_type != MYSQL_TIMESTAMP_TIME && value.time.hour > 23) ||
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];
- uint length= my_TIME_to_str(&value.time, buff, decimals);
+ Lazy_string_time str(tm);
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);
}