1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-01 03:47:19 +03:00

MDEV-10524 Assertion `arg1_int >= 0' failed in Item_func_additive_op::result_precision()

This change is a backport from 10.0 to 5.5 for:
1. The full patch for:
     MDEV-4841 Wrong character set of ADDTIME() and DATE_ADD()
     9adb6e991e

2. A small fragment of:
     MDEV-5298 Illegal mix of collations on timestamp
     03f6778d61
   which overrides Item_temporal_hybrid_func::cmp_type(),
   and adds a new line into cache_temporal_4265.result.
This commit is contained in:
Alexander Barkov
2016-12-19 14:28:08 +04:00
parent c4d9dc705b
commit 2f6fede8d5
17 changed files with 341 additions and 37 deletions

View File

@ -838,6 +838,23 @@ const char *get_date_time_format_str(KNOWN_DATE_TIME_FORMAT *format,
}
}
/**
Convert TIME/DATE/DATETIME value to String.
@param l_time DATE value
@param OUT str String to convert to
@param dec Number of fractional digits.
*/
bool my_TIME_to_str(const MYSQL_TIME *ltime, String *str, uint dec)
{
if (str->alloc(MAX_DATE_STRING_REP_LENGTH))
return true;
str->set_charset(&my_charset_numeric);
str->length(my_TIME_to_str(ltime, const_cast<char*>(str->ptr()), dec));
return false;
}
void make_truncated_value_warning(THD *thd,
MYSQL_ERROR::enum_warning_level level,
const ErrConv *sval,