diff options
author | Oleksandr Byelkin <sanja@mariadb.com> | 2018-04-23 10:35:33 +0200 |
---|---|---|
committer | Oleksandr Byelkin <sanja@mariadb.com> | 2018-04-23 12:48:13 +0200 |
commit | 14f84d207177f5cf626377fb760a296a9fceb10d (patch) | |
tree | 875c83004a9c9deea4ee51d80af375ce53cbb837 /sql/item_func.cc | |
parent | de942c9f618b590a01a7960c171d7e50e435708f (diff) | |
download | mariadb-git-14f84d207177f5cf626377fb760a296a9fceb10d.tar.gz |
MDEV-13232: Assertion `(&(&share->intern_lock)->m_mutex)->count > 0 && pthread_equal(pthread_self(), (&(&share->intern_lock)->m_mutex)->thread)' failed in _ma_state_info_write
Limit length of result of "negative" operation to something reasonable
Diffstat (limited to 'sql/item_func.cc')
-rw-r--r-- | sql/item_func.cc | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/sql/item_func.cc b/sql/item_func.cc index e2740272385..ae6c61e83f4 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -1935,6 +1935,9 @@ void Item_func_neg::fix_length_and_dec_double() set_handler(&type_handler_double); decimals= args[0]->decimals; // Preserve NOT_FIXED_DEC max_length= args[0]->max_length + 1; + // Limit length with something reasonable + uint32 mlen= type_handler()->max_display_length(this); + set_if_smaller(max_length, mlen); unsigned_flag= false; } |