mirror of
https://github.com/MariaDB/server.git
synced 2026-05-16 20:07:13 +02:00
Bug#8840 Empty string comparison and character set 'cp1250'
Secondary weight out of bounds was picked up in mistake when the string is empty, instead of returning 0.
This commit is contained in:
parent
763ce399f7
commit
d6c9c19412
5 changed files with 28 additions and 1 deletions
4
mysql-test/include/have_cp1250_ch.inc
Normal file
4
mysql-test/include/have_cp1250_ch.inc
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
-- require r/have_cp1250_ch.require
|
||||
disable_query_log;
|
||||
show collation like "cp1250_czech_cs";
|
||||
enable_query_log;
|
||||
9
mysql-test/r/ctype_cp1250_ch.result
Normal file
9
mysql-test/r/ctype_cp1250_ch.result
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
SHOW COLLATION LIKE 'cp1250_czech_cs';
|
||||
Collation Charset Id Default Compiled Sortlen
|
||||
cp1250_czech_cs cp1250 34 Yes 2
|
||||
CREATE TABLE t1 (a char(16)) character set cp1250 collate cp1250_czech_cs;
|
||||
INSERT INTO t1 VALUES ('');
|
||||
SELECT a, length(a), a='', a=' ', a=' ' FROM t1;
|
||||
a length(a) a='' a=' ' a=' '
|
||||
0 1 1 1
|
||||
DROP TABLE t1;
|
||||
2
mysql-test/r/have_cp1250_ch.require
Normal file
2
mysql-test/r/have_cp1250_ch.require
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
Collation Charset Id Default Compiled Sortlen
|
||||
cp1250_czech_cs cp1250 34 Yes 2
|
||||
12
mysql-test/t/ctype_cp1250_ch.test
Normal file
12
mysql-test/t/ctype_cp1250_ch.test
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
-- source include/have_cp1250_ch.inc
|
||||
|
||||
SHOW COLLATION LIKE 'cp1250_czech_cs';
|
||||
|
||||
#
|
||||
# Bugs: #8840: Empty string comparison and character set 'cp1250'
|
||||
#
|
||||
|
||||
CREATE TABLE t1 (a char(16)) character set cp1250 collate cp1250_czech_cs;
|
||||
INSERT INTO t1 VALUES ('');
|
||||
SELECT a, length(a), a='', a=' ', a=' ' FROM t1;
|
||||
DROP TABLE t1;
|
||||
|
|
@ -416,7 +416,7 @@ static struct wordvalue doubles[] = {
|
|||
#define NEXT_CMP_VALUE(src, p, pass, value, len) \
|
||||
while (1) { \
|
||||
if (IS_END(p, src, len)) { \
|
||||
if (pass == 0) { p = src; pass++; } \
|
||||
if (pass == 0 && len > 0) { p= src; pass++; } \
|
||||
else { value = 0; break; } \
|
||||
} \
|
||||
value = ((pass == 0) ? _sort_order_win1250ch1[*p] \
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue