diff options
author | Alexander Barkov <bar@mariadb.org> | 2017-11-13 21:58:00 +0400 |
---|---|---|
committer | Alexander Barkov <bar@mariadb.org> | 2017-11-13 21:58:00 +0400 |
commit | 071aece907e86ac28e3c4b7869ccebea6e974ed0 (patch) | |
tree | ae77ac10126c5a2e72bd3da3d95156a4704da7dc /sql/item_timefunc.cc | |
parent | 0611797729ee475526cb9ba8af1304e9f4ff6749 (diff) | |
download | mariadb-git-071aece907e86ac28e3c4b7869ccebea6e974ed0.tar.gz |
MDEV-14376 Explicit CAST(CHAR(N)) erroneously escalates warnings to errors in STRICT_ALL_TABLES
Diffstat (limited to 'sql/item_timefunc.cc')
-rw-r--r-- | sql/item_timefunc.cc | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sql/item_timefunc.cc b/sql/item_timefunc.cc index f0d7cd1c54c..a0fdd4bb8fc 100644 --- a/sql/item_timefunc.cc +++ b/sql/item_timefunc.cc @@ -2434,6 +2434,8 @@ void Item_char_typecast::check_truncation_with_warn(String *src, uint dstlen) THD *thd= current_thd; char char_type[40]; ErrConvString err(src); + bool save_abort_on_warning= thd->abort_on_warning; + thd->abort_on_warning&= !m_suppress_warning_to_error_escalation; my_snprintf(char_type, sizeof(char_type), "%s(%lu)", cast_cs == &my_charset_bin ? "BINARY" : "CHAR", (ulong) cast_length); @@ -2441,6 +2443,7 @@ void Item_char_typecast::check_truncation_with_warn(String *src, uint dstlen) ER_TRUNCATED_WRONG_VALUE, ER_THD(thd, ER_TRUNCATED_WRONG_VALUE), char_type, err.ptr()); + thd->abort_on_warning= save_abort_on_warning; } } @@ -2551,7 +2554,7 @@ void Item_char_typecast::fix_length_and_dec_numeric() } -void Item_char_typecast::fix_length_and_dec_str() +void Item_char_typecast::fix_length_and_dec_generic() { fix_length_and_dec_internal(from_cs= args[0]->dynamic_result() ? 0 : |