diff options
author | Alexander Barkov <bar@mariadb.org> | 2014-06-04 21:53:15 +0400 |
---|---|---|
committer | Alexander Barkov <bar@mariadb.org> | 2014-06-04 21:53:15 +0400 |
commit | 284479c085f005a705d31e37e9cd85bb670d615e (patch) | |
tree | 044868e9c5a27a60750f3389ca63763f2bbc1ef0 /sql/item_timefunc.cc | |
parent | 55bfabf9715c15df16adb4a3e8880deb4943df2b (diff) | |
parent | 661daf16f11ffa879ffb005008b6e73f6744e0ad (diff) | |
download | mariadb-git-284479c085f005a705d31e37e9cd85bb670d615e.tar.gz |
Merge 5.3->5.5
Diffstat (limited to 'sql/item_timefunc.cc')
-rw-r--r-- | sql/item_timefunc.cc | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/sql/item_timefunc.cc b/sql/item_timefunc.cc index cb0e638046d..15701658015 100644 --- a/sql/item_timefunc.cc +++ b/sql/item_timefunc.cc @@ -1298,6 +1298,18 @@ bool get_interval_value(Item *args,interval_type int_type, INTERVAL *interval) if (!(val= args->val_decimal(&decimal_value))) return true; interval->neg= my_decimal2seconds(val, &second, &second_part); + if (second == LONGLONG_MAX) + { + char buff[DECIMAL_MAX_STR_LENGTH]; + int length= sizeof(buff); + decimal2string(val, buff, &length, 0, 0, 0); + push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN, + ER_TRUNCATED_WRONG_VALUE, + ER(ER_TRUNCATED_WRONG_VALUE), "DECIMAL", + buff); + return true; + } + interval->second= second; interval->second_part= second_part; return false; |