diff options
author | Monty <monty@mariadb.org> | 2019-06-27 18:51:34 +0300 |
---|---|---|
committer | Monty <monty@mariadb.org> | 2019-06-27 19:01:51 +0300 |
commit | 9053047f3db37a174f6c1333acf189b6558c50c4 (patch) | |
tree | 3d79c42badc0af123d7e288b26b020177580a6c4 /mysql-test/main/type_varchar.result | |
parent | f5c080c7353cc9c30d0b269c07024cd38253c3bc (diff) | |
download | mariadb-git-9053047f3db37a174f6c1333acf189b6558c50c4.tar.gz |
MDEV-17551 assert or crashed table when using blobs
The bug was that when long item-strings was converted to VARCHAR,
type_handler::string_type_handler() didn't take into account max
VARCHAR length. The resulting Aria temporary table was created with
a VARCHAR field of length 1 when it should have been 65537. This caused
MariaDB to send impossible records to ma_write() and Aria reported
eventually the table as crashed.
Fixed by updating Type_handler::string_type_handler() to not create too long
VARCHAR fields. To make things extra safe, I also added checks in when
writing dynamic Aria records to ensure we find the wrong record during write
instead of during read.
Diffstat (limited to 'mysql-test/main/type_varchar.result')
-rw-r--r-- | mysql-test/main/type_varchar.result | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/mysql-test/main/type_varchar.result b/mysql-test/main/type_varchar.result index 0b2a5b54d08..daf9ab8a1f0 100644 --- a/mysql-test/main/type_varchar.result +++ b/mysql-test/main/type_varchar.result @@ -686,3 +686,22 @@ DROP TABLE t1,t2; # # End of 10.0 tests # +# +# MDEV-17551 +# Assertion `(&(&share->intern_lock)->m_mutex)->count > 0 && +# pthread_equal(pthread_self(), (&(&share->intern_lock)->m_mutex)-> +# thread)' failed in _ma_state_info_write or ER_CRASHED_ON_USAGE +# upon SELECT with UNION +# +CREATE TABLE t1 (b BLOB, vb BLOB AS (b) VIRTUAL); +INSERT INTO t1 (b) VALUES ('foobar'); +SELECT 'foo' AS f1, CONVERT( 'bar' USING latin1 ) AS f2 FROM t1 +UNION +SELECT b AS f1, CONVERT( vb USING latin1 ) AS f2 FROM t1; +f1 f2 +foo bar +foobar foobar +DROP TABLE t1; +# +# End of 10.3 tests +# |