mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
Fix for bug #31069: crash in 'sounds like'
and for bug #31070: crash during conversion of charsets Problem: passing a 0 byte length string to some my_mb_wc_XXX() functions leads to server crash due to improper argument check. Fix: properly check arguments passed to my_mb_wc_XXX() functions. mysql-test/include/ctype_common.inc: Fix for bug #31069: crash in 'sounds like' and bug #31070: crash during conversion of charsets - test case. mysql-test/r/ctype_big5.result: Fix for bug #31069: crash in 'sounds like' and bug #31070: crash during conversion of charsets - test result. mysql-test/r/ctype_euckr.result: Fix for bug #31069: crash in 'sounds like' and bug #31070: crash during conversion of charsets - test result. mysql-test/r/ctype_gb2312.result: Fix for bug #31069: crash in 'sounds like' and bug #31070: crash during conversion of charsets - test result. mysql-test/r/ctype_gbk.result: Fix for bug #31069: crash in 'sounds like' and bug #31070: crash during conversion of charsets - test result. mysql-test/r/ctype_uca.result: Fix for bug #31069: crash in 'sounds like' and bug #31070: crash during conversion of charsets - test result. strings/ctype-big5.c: Fix for bug #31069: crash in 'sounds like' and bug #31070: crash during conversion of charsets - check the string length before testing its first byte. strings/ctype-cp932.c: Fix for bug #31069: crash in 'sounds like' and bug #31070: crash during conversion of charsets - check the string length before testing its first byte. strings/ctype-euc_kr.c: Fix for bug #31069: crash in 'sounds like' and bug #31070: crash during conversion of charsets - check the string length before testing its first byte. strings/ctype-gb2312.c: Fix for bug #31069: crash in 'sounds like' and bug #31070: crash during conversion of charsets - check the string length before testing its first byte. strings/ctype-sjis.c: Fix for bug #31069: crash in 'sounds like' and bug #31070: crash during conversion of charsets - check the string length before testing its first byte.
This commit is contained in:
@@ -51,6 +51,15 @@ SELECT c1 as want1result from t1 where c1 like 'locatio%';
|
||||
SELECT c1 as want1result from t1 where c1 like 'location%';
|
||||
DROP TABLE t1;
|
||||
|
||||
#
|
||||
# Bug #31070: crash during conversion of charsets
|
||||
#
|
||||
create table t1 (a set('a') not null);
|
||||
insert into t1 values (),();
|
||||
select cast(a as char(1)) from t1;
|
||||
select a sounds like a from t1;
|
||||
drop table t1;
|
||||
|
||||
DROP DATABASE d1;
|
||||
# Restore settings
|
||||
USE test;
|
||||
|
@@ -52,6 +52,17 @@ SELECT c1 as want1result from t1 where c1 like 'location%';
|
||||
want1result
|
||||
location
|
||||
DROP TABLE t1;
|
||||
create table t1 (a set('a') not null);
|
||||
insert into t1 values (),();
|
||||
select cast(a as char(1)) from t1;
|
||||
cast(a as char(1))
|
||||
|
||||
|
||||
select a sounds like a from t1;
|
||||
a sounds like a
|
||||
1
|
||||
1
|
||||
drop table t1;
|
||||
DROP DATABASE d1;
|
||||
USE test;
|
||||
SET character_set_server= @safe_character_set_server;
|
||||
|
@@ -52,6 +52,17 @@ SELECT c1 as want1result from t1 where c1 like 'location%';
|
||||
want1result
|
||||
location
|
||||
DROP TABLE t1;
|
||||
create table t1 (a set('a') not null);
|
||||
insert into t1 values (),();
|
||||
select cast(a as char(1)) from t1;
|
||||
cast(a as char(1))
|
||||
|
||||
|
||||
select a sounds like a from t1;
|
||||
a sounds like a
|
||||
1
|
||||
1
|
||||
drop table t1;
|
||||
DROP DATABASE d1;
|
||||
USE test;
|
||||
SET character_set_server= @safe_character_set_server;
|
||||
|
@@ -52,6 +52,17 @@ SELECT c1 as want1result from t1 where c1 like 'location%';
|
||||
want1result
|
||||
location
|
||||
DROP TABLE t1;
|
||||
create table t1 (a set('a') not null);
|
||||
insert into t1 values (),();
|
||||
select cast(a as char(1)) from t1;
|
||||
cast(a as char(1))
|
||||
|
||||
|
||||
select a sounds like a from t1;
|
||||
a sounds like a
|
||||
1
|
||||
1
|
||||
drop table t1;
|
||||
DROP DATABASE d1;
|
||||
USE test;
|
||||
SET character_set_server= @safe_character_set_server;
|
||||
|
@@ -52,6 +52,17 @@ SELECT c1 as want1result from t1 where c1 like 'location%';
|
||||
want1result
|
||||
location
|
||||
DROP TABLE t1;
|
||||
create table t1 (a set('a') not null);
|
||||
insert into t1 values (),();
|
||||
select cast(a as char(1)) from t1;
|
||||
cast(a as char(1))
|
||||
|
||||
|
||||
select a sounds like a from t1;
|
||||
a sounds like a
|
||||
1
|
||||
1
|
||||
drop table t1;
|
||||
DROP DATABASE d1;
|
||||
USE test;
|
||||
SET character_set_server= @safe_character_set_server;
|
||||
|
@@ -2371,6 +2371,17 @@ SELECT c1 as want1result from t1 where c1 like 'location%';
|
||||
want1result
|
||||
location
|
||||
DROP TABLE t1;
|
||||
create table t1 (a set('a') not null);
|
||||
insert into t1 values (),();
|
||||
select cast(a as char(1)) from t1;
|
||||
cast(a as char(1))
|
||||
|
||||
|
||||
select a sounds like a from t1;
|
||||
a sounds like a
|
||||
1
|
||||
1
|
||||
drop table t1;
|
||||
DROP DATABASE d1;
|
||||
USE test;
|
||||
SET character_set_server= @safe_character_set_server;
|
||||
|
Reference in New Issue
Block a user