summaryrefslogtreecommitdiff
path: root/mysql-test/main/ctype_gb2312.test
diff options
context:
space:
mode:
authorAlexander Barkov <bar@mariadb.com>2020-05-29 11:07:55 +0400
committerAlexander Barkov <bar@mariadb.com>2020-05-29 11:15:28 +0400
commitcdc2508ed1a5488f3b20fae7ee8a72b4275a65b6 (patch)
treea49419144c5be0aa4057afceb58bfeaf064609ee /mysql-test/main/ctype_gb2312.test
parentc2a929185c147fc85bbf91e2c537bcdd98f2e680 (diff)
downloadmariadb-git-cdc2508ed1a5488f3b20fae7ee8a72b4275a65b6.tar.gz
MDEV-22625 SIGSEGV in intern_find_sys_var (optimized builds)
The constructor of Lex_ident_sys returns LEX_CSTRING(NULL,0) if character set conversion goes wrong, and raises the "wrong character string" error in the diagnostics area. The code in sql_yacc.yy did not check Lex_ident_sys::ptr against NULL, so the execution entered functions that did not expect NULL (and crashed). Fixing the code to do MYSQL_YYABORT if Lex_ident_sys::ptr is NULL after constructing.
Diffstat (limited to 'mysql-test/main/ctype_gb2312.test')
-rw-r--r--mysql-test/main/ctype_gb2312.test17
1 files changed, 17 insertions, 0 deletions
diff --git a/mysql-test/main/ctype_gb2312.test b/mysql-test/main/ctype_gb2312.test
index 4489168a163..07460116ade 100644
--- a/mysql-test/main/ctype_gb2312.test
+++ b/mysql-test/main/ctype_gb2312.test
@@ -180,3 +180,20 @@ let $coll_pad='gb2312_bin';
--echo #
--echo # End of 10.2 tests
--echo #
+
+
+--echo #
+--echo # Start of 10.5 tests
+--echo #
+
+--echo #
+--echo # MDEV-22625 SIGSEGV in intern_find_sys_var (optimized builds)
+--echo #
+
+SET NAMES gb2312;
+SET @seq=_gb2312 0xA2A1;
+--source include/ctype_ident_sys.inc
+
+--echo #
+--echo # End of 10.5 tests
+--echo #