mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
MDEV-22836: Server crashes in err_conv / ErrBuff::set_str
The issue here is charset for Sort_param::tmp_buffer is cleared when bzero is done for Sort_param. Make sure to set the charset explicitly in the constructor for tmp_buffer.
This commit is contained in:
@ -3955,4 +3955,14 @@ ORDER BY surname_first ASC LIMIT 1 OFFSET 1;
|
|||||||
name surname_first
|
name surname_first
|
||||||
Charles Dickens Dickens, Charles
|
Charles Dickens Dickens, Charles
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
|
#
|
||||||
|
# MDEV-22836: Server crashes in err_conv / ErrBuff::set_str
|
||||||
|
#
|
||||||
|
CREATE TABLE t1 (a INT);
|
||||||
|
INSERT INTO t1 VALUES (0),(1);
|
||||||
|
SELECT * FROM t1 ORDER BY CONVERT(AES_ENCRYPT(1,a), CHAR(4));
|
||||||
|
a
|
||||||
|
1
|
||||||
|
0
|
||||||
|
DROP TABLE t1;
|
||||||
# End of 10.5 tests
|
# End of 10.5 tests
|
||||||
|
@ -2454,4 +2454,15 @@ ORDER BY surname_first ASC LIMIT 1 OFFSET 1;
|
|||||||
|
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
|
|
||||||
|
--echo #
|
||||||
|
--echo # MDEV-22836: Server crashes in err_conv / ErrBuff::set_str
|
||||||
|
--echo #
|
||||||
|
|
||||||
|
CREATE TABLE t1 (a INT);
|
||||||
|
INSERT INTO t1 VALUES (0),(1);
|
||||||
|
--disable_warnings
|
||||||
|
SELECT * FROM t1 ORDER BY CONVERT(AES_ENCRYPT(1,a), CHAR(4));
|
||||||
|
--enable_warnings
|
||||||
|
DROP TABLE t1;
|
||||||
|
|
||||||
--echo # End of 10.5 tests
|
--echo # End of 10.5 tests
|
||||||
|
@ -545,6 +545,11 @@ public:
|
|||||||
{
|
{
|
||||||
memset(reinterpret_cast<void*>(this), 0, sizeof(*this));
|
memset(reinterpret_cast<void*>(this), 0, sizeof(*this));
|
||||||
tmp_buffer.set_thread_specific();
|
tmp_buffer.set_thread_specific();
|
||||||
|
/*
|
||||||
|
Fix memset() clearing the charset.
|
||||||
|
TODO: The constructor should be eventually rewritten not to use memset().
|
||||||
|
*/
|
||||||
|
tmp_buffer.set_charset(&my_charset_bin);
|
||||||
}
|
}
|
||||||
void init_for_filesort(uint sortlen, TABLE *table,
|
void init_for_filesort(uint sortlen, TABLE *table,
|
||||||
ha_rows maxrows, bool sort_positions);
|
ha_rows maxrows, bool sort_positions);
|
||||||
|
Reference in New Issue
Block a user