mirror of
https://github.com/MariaDB/server.git
synced 2026-05-03 13:45:34 +02:00
MDEV-22130 SHOW WARNINGS will SIGSEGV 10.5 optimized build after setting CHARACTER_SET_RESULTS to NULL and running any invalid SQL | Binary_string::copy_printable_hhhh
The old code did not take into account that thd->variables.character_set_results can be NULL.
This commit is contained in:
parent
7bcaa541aa
commit
8ad3c6154b
3 changed files with 23 additions and 1 deletions
|
|
@ -49,3 +49,14 @@ ERROR 42000: \0423 \0432\0430\0441 \043E\0448\0438\0431\043A\0430 \0432 \0437\04
|
|||
disconnect con1;
|
||||
connection default;
|
||||
End of 5.5 tests
|
||||
#
|
||||
# MDEV-22130 SHOW WARNINGS will SIGSEGV 10.5 optimized build after setting CHARACTER_SET_RESULTS to NULL and running any invalid SQL | Binary_string::copy_printable_hhhh
|
||||
#
|
||||
SET NAMES latin1;
|
||||
SET @@CHARACTER_SET_RESULTS=NULL;
|
||||
a;
|
||||
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'a' at line 1
|
||||
SHOW WARNINGS;
|
||||
Level Code Message
|
||||
Error 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'a' at line 1
|
||||
SET NAMES latin1;
|
||||
|
|
|
|||
|
|
@ -58,3 +58,14 @@ disconnect con1;
|
|||
connection default;
|
||||
|
||||
--echo End of 5.5 tests
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-22130 SHOW WARNINGS will SIGSEGV 10.5 optimized build after setting CHARACTER_SET_RESULTS to NULL and running any invalid SQL | Binary_string::copy_printable_hhhh
|
||||
--echo #
|
||||
|
||||
SET NAMES latin1;
|
||||
SET @@CHARACTER_SET_RESULTS=NULL;
|
||||
--error ER_PARSE_ERROR
|
||||
a;
|
||||
SHOW WARNINGS;
|
||||
SET NAMES latin1;
|
||||
|
|
|
|||
|
|
@ -1194,7 +1194,7 @@ bool Protocol::store_warning(const char *from, size_t length)
|
|||
{
|
||||
BinaryStringBuffer<MYSQL_ERRMSG_SIZE> tmp;
|
||||
CHARSET_INFO *cs= thd->variables.character_set_results;
|
||||
if (cs == &my_charset_bin)
|
||||
if (!cs || cs == &my_charset_bin)
|
||||
cs= system_charset_info;
|
||||
if (tmp.copy_printable_hhhh(cs, system_charset_info, from, length))
|
||||
return net_store_data((const uchar*)"", 0);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue