diff options
| author | Sergei Golubchik <serg@mariadb.org> | 2020-08-07 13:37:41 +0200 |
|---|---|---|
| committer | Sergei Golubchik <serg@mariadb.org> | 2020-08-07 13:39:04 +0200 |
| commit | cd2924bacbb06596d30f4397b0e200fc9c73e40b (patch) | |
| tree | b970692ffd0f2c6ef5e524ae49610d41d0fab23b /mysql-test/main/func_des_encrypt.test | |
| parent | e08141504011e9a751d3ad1d3d571c725fdc3744 (diff) | |
| download | mariadb-git-cd2924bacbb06596d30f4397b0e200fc9c73e40b.tar.gz | |
MDEV-23330 Server crash or ASAN negative-size-param in my_strnncollsp_binary / SORT_FIELD_ATTR::compare_packed_varstrings
and
MDEV-23414 Assertion `res->charset() == item->collation.collation' failed in Type_handler_string_result::make_packed_sort_key_part
pack_sort_string() *must* take a collation from the Item, not from the
String value. Because when casting a string to _binary the original
String is not copied for performance reasons, it's reused but its
collation does not match Item's collation anymore.
Note, that String's collation cannot be simply changed to _binary,
because for an Item_string literal the original String must stay
unchanged for the duration of the query.
this partially reverts 61c15ebe323
Diffstat (limited to 'mysql-test/main/func_des_encrypt.test')
| -rw-r--r-- | mysql-test/main/func_des_encrypt.test | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/mysql-test/main/func_des_encrypt.test b/mysql-test/main/func_des_encrypt.test index c9661b81cc0..44fc30ff00f 100644 --- a/mysql-test/main/func_des_encrypt.test +++ b/mysql-test/main/func_des_encrypt.test @@ -37,3 +37,24 @@ SELECT DROP TABLE t1; --Echo End of 5.0 tests + +--echo # +--echo # MDEV-23330 Server crash or ASAN negative-size-param in +--echo # my_strnncollsp_binary / SORT_FIELD_ATTR::compare_packed_varstrings +--echo # + +CREATE TABLE t1 (a CHAR(240), b BIT(48)); +INSERT INTO t1 VALUES ('a',b'0001'),('b',b'0010'),('c',b'0011'),('d',b'0100'),('e',b'0001'),('f',b'0101'),('g',b'0110'),('h',b'0111'),('i',b'1000'),('j',b'1001'); +SELECT DES_DECRYPT(a, 'x'), HEX(BINARY b) FROM t1 GROUP BY 1, 2 WITH ROLLUP; +DROP TABLE t1; + +# +# don't change the charset of a literal Item_string +# + +CREATE TABLE t1 (a INT); +INSERT t1 VALUES (1),(2); +SELECT CHAR_LENGTH(a), DES_DECRYPT(a) FROM (SELECT _utf8 0xC2A2 AS a FROM t1) AS t2; +DROP TABLE t1; + +--Echo End of 10.5 tests |
