mirror of
https://github.com/MariaDB/server.git
synced 2025-01-16 12:02:42 +01:00
ctype_ucs.result, ctype_ucs.test, item.cc:
#5024 [Ver]: Server crashes with queries on fields with certain charset/collation settings sql/item.cc: #5024 [Ver]: Server crashes with queries on fields with certain charset/collation settings mysql-test/t/ctype_ucs.test: #5024 [Ver]: Server crashes with queries on fields with certain charset/collation settings mysql-test/r/ctype_ucs.result: #5024 [Ver]: Server crashes with queries on fields with certain charset/collation settings
This commit is contained in:
parent
fe61e5d2e4
commit
16987e1ce2
3 changed files with 26 additions and 4 deletions
|
@ -464,3 +464,9 @@ HEX(a)
|
|||
AAAA
|
||||
000AAAAA
|
||||
DROP TABLE t1;
|
||||
create table t1 (s1 char character set `ucs2` collate `ucs2_czech_ci`);
|
||||
insert into t1 values ('0'),('1'),('2'),('a'),('b'),('c');
|
||||
select s1 from t1 where s1 > 'a' order by s1;
|
||||
s1
|
||||
b
|
||||
c
|
||||
|
|
|
@ -293,3 +293,14 @@ SELECT HEX(a) FROM t1;
|
|||
DROP TABLE t1;
|
||||
|
||||
-- the same should be also done with enum and set
|
||||
|
||||
|
||||
#
|
||||
# Bug #5024 Server crashes with queries on fields
|
||||
# with certain charset/collation settings
|
||||
#
|
||||
|
||||
create table t1 (s1 char character set `ucs2` collate `ucs2_czech_ci`);
|
||||
insert into t1 values ('0'),('1'),('2'),('a'),('b'),('c');
|
||||
select s1 from t1 where s1 > 'a' order by s1;
|
||||
|
||||
|
|
13
sql/item.cc
13
sql/item.cc
|
@ -176,10 +176,15 @@ void Item::set_name(const char *str, uint length, CHARSET_INFO *cs)
|
|||
name= (char*) str;
|
||||
return;
|
||||
}
|
||||
while (length && !my_isgraph(cs,*str))
|
||||
{ // Fix problem with yacc
|
||||
length--;
|
||||
str++;
|
||||
if (cs->ctype)
|
||||
{
|
||||
// This will probably need a better implementation in the future:
|
||||
// a function in CHARSET_INFO structure.
|
||||
while (length && !my_isgraph(cs,*str))
|
||||
{ // Fix problem with yacc
|
||||
length--;
|
||||
str++;
|
||||
}
|
||||
}
|
||||
if (!my_charset_same(cs, system_charset_info))
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue