Commit 14f84d20 authored by Oleksandr Byelkin's avatar Oleksandr Byelkin

MDEV-13232: Assertion `(&(&share->intern_lock)->m_mutex)->count > 0 &&...

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
parent de942c9f
......@@ -2500,5 +2500,19 @@ t2 CREATE TABLE `t2` (
DROP TABLE t2;
DROP TABLE t1;
#
# 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
#
CREATE TABLE t1 (c1 CHAR(8));
INSERT INTO t1 VALUES ('10'),('-10');
CREATE TABLE t2 (c2 CHAR);
SET @a= CAST('10' AS CHAR);
SELECT c1 FROM t1 UNION SELECT - @a FROM t2;
c1
10
-10
drop table t1,t2;
#
# End of 10.3 tests
#
......@@ -1745,6 +1745,21 @@ SHOW CREATE TABLE t2;
DROP TABLE t2;
DROP TABLE t1;
--echo #
--echo # MDEV-13232: Assertion `(&(&share->intern_lock)->m_mutex)->count > 0 &&
--echo # pthread_equal(pthread_self(), (&(&share->intern_lock)->m_mutex)->
--echo # thread)' failed in _ma_state_info_write
--echo #
CREATE TABLE t1 (c1 CHAR(8));
INSERT INTO t1 VALUES ('10'),('-10');
CREATE TABLE t2 (c2 CHAR);
SET @a= CAST('10' AS CHAR);
SELECT c1 FROM t1 UNION SELECT - @a FROM t2;
drop table t1,t2;
--echo #
--echo # End of 10.3 tests
......
......@@ -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;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment