1
0
mirror of https://github.com/MariaDB/server.git synced 2025-11-06 13:10:12 +03:00

Bug 6206: ENUMs are not case sensitive even if declared BINARY

The same problem with SET columns:

find_set() now executes find_type2() to do charset aware search,
instead of always using system_charset_info comparison.
This commit is contained in:
bar@mysql.com
2004-10-26 13:17:37 +05:00
parent 623c61596d
commit a18cee7a18
7 changed files with 70 additions and 15 deletions

View File

@@ -15,3 +15,36 @@ t1 CREATE TABLE `t1` (
drop table t1;
CREATE TABLE t1 ( user varchar(64) NOT NULL default '', path varchar(255) NOT NULL default '', privilege set('select','RESERVED30','RESERVED29','RESERVED28','RESERVED27','RESERVED26', 'RESERVED25','RESERVED24','data.delete','RESERVED22','RESERVED21', 'RESERVED20','data.insert.none','data.insert.approve', 'data.insert.delete','data.insert.move','data.insert.propose', 'data.insert.reject','RESERVED13','RESERVED12','RESERVED11','RESERVED10', 'RESERVED09','data.update','RESERVED07','RESERVED06','RESERVED05', 'RESERVED04','metadata.delete','metadata.put','RESERVED01','RESERVED00') NOT NULL default '', KEY user (user) ) ENGINE=MyISAM CHARSET=utf8;
DROP TABLE t1;
set names latin1;
create table t1 (s set ('a','A') character set latin1 collate latin1_bin);
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`s` set('a','A') character set latin1 collate latin1_bin default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
insert into t1 values ('a'),('a,A'),('A,a'),('A');
select s from t1 order by s;
s
a
A
a,A
a,A
drop table t1;
CREATE TABLE t1 (c set('ae','oe','ue','ss') collate latin1_german2_ci);
INSERT INTO t1 VALUES ('<27>'),('<27>'),('<27>'),('<27>');
INSERT INTO t1 VALUES ('ae'),('oe'),('ue'),('ss');
INSERT INTO t1 VALUES ('<27>,<2C>,<2C>,<2C>');
INSERT INTO t1 VALUES ('ae,oe,ue,ss');
SELECT c FROM t1 ORDER BY c;
c
ae
ae
oe
oe
ue
ue
ss
ss
ae,oe,ue,ss
ae,oe,ue,ss
DROP TABLE t1;

View File

@@ -14,3 +14,24 @@ show create table t1;
drop table t1;
CREATE TABLE t1 ( user varchar(64) NOT NULL default '', path varchar(255) NOT NULL default '', privilege set('select','RESERVED30','RESERVED29','RESERVED28','RESERVED27','RESERVED26', 'RESERVED25','RESERVED24','data.delete','RESERVED22','RESERVED21', 'RESERVED20','data.insert.none','data.insert.approve', 'data.insert.delete','data.insert.move','data.insert.propose', 'data.insert.reject','RESERVED13','RESERVED12','RESERVED11','RESERVED10', 'RESERVED09','data.update','RESERVED07','RESERVED06','RESERVED05', 'RESERVED04','metadata.delete','metadata.put','RESERVED01','RESERVED00') NOT NULL default '', KEY user (user) ) ENGINE=MyISAM CHARSET=utf8;
DROP TABLE t1;
#
# Check that SET is case sensitive with a binary collation
#
set names latin1;
create table t1 (s set ('a','A') character set latin1 collate latin1_bin);
show create table t1;
insert into t1 values ('a'),('a,A'),('A,a'),('A');
select s from t1 order by s;
drop table t1;
#
# Check that SET honors a more complex collation correctly
#
CREATE TABLE t1 (c set('ae','oe','ue','ss') collate latin1_german2_ci);
INSERT INTO t1 VALUES ('<27>'),('<27>'),('<27>'),('<27>');
INSERT INTO t1 VALUES ('ae'),('oe'),('ue'),('ss');
INSERT INTO t1 VALUES ('<27>,<2C>,<2C>,<2C>');
INSERT INTO t1 VALUES ('ae,oe,ue,ss');
SELECT c FROM t1 ORDER BY c;
DROP TABLE t1;