Subject | Problem with CONTAINING and COLLATE - UTF8 |
---|---|
Author | Gabor Boros |
Post date | 2017-12-19T14:57:04Z |
Hi All,
After the original "Problem with CONTAINING and COLLATE" thread I
switched to UTF8 but not happy with it. The optional COLLATE after
CONTAINING have no effect, the database default COLLATION used. See the
below examples. Tried with 3.0.3.32854 snapshot and Linux 64bit (Ubuntu
14.04.1).
1.Database defaults: UTF8+UNICODE_CI
CREATE DATABASE 'CHARSET_TEST' PAGE_SIZE 4096 DEFAULT CHARACTER SET UTF8
COLLATION UNICODE_CI;
isql CHARSET_TEST -ch UTF8 -u SYSDBA
CREATE TABLE TABLE1 (NAME VARCHAR(60));
INSERT INTO TABLE1 (NAME) VALUES ('od');
INSERT INTO TABLE1 (NAME) VALUES ('őb');
INSERT INTO TABLE1 (NAME) VALUES ('Őc');
INSERT INTO TABLE1 (NAME) VALUES ('Oa');
SQL> SELECT * FROM TABLE1 WHERE NAME CONTAINING 'o';
NAME
============================================================
od
Oa
SQL> SELECT * FROM TABLE1 WHERE NAME CONTAINING 'ő';
NAME
============================================================
őb
Őc
SQL> SELECT * FROM TABLE1 WHERE NAME CONTAINING 'o' COLLATE UNICODE_CI_AI;
NAME
============================================================
od
Oa
SQL> SELECT * FROM TABLE1 WHERE NAME CONTAINING 'ő' COLLATE
UNICODE_CI_AI;
NAME
============================================================
őb
Őc
2.Database defaults: UTF8+UNICODE_CI_AI
CREATE DATABASE 'CHARSET_TEST' PAGE_SIZE 4096 DEFAULT CHARACTER SET UTF8
COLLATION UNICODE_CI_AI;
isql CHARSET_TEST -ch UTF8 -u SYSDBA
CREATE TABLE TABLE1 (NAME VARCHAR(60));
INSERT INTO TABLE1 (NAME) VALUES ('od');
INSERT INTO TABLE1 (NAME) VALUES ('őb');
INSERT INTO TABLE1 (NAME) VALUES ('Őc');
INSERT INTO TABLE1 (NAME) VALUES ('Oa');
SQL> SELECT * FROM TABLE1 WHERE NAME CONTAINING 'o';
NAME
============================================================
od
őb
Őc
Oa
SQL> SELECT * FROM TABLE1 WHERE NAME CONTAINING 'ő';
NAME
============================================================
od
őb
Őc
Oa
SQL> SELECT * FROM TABLE1 WHERE NAME CONTAINING 'o' COLLATE UNICODE_CI;
NAME
============================================================
od
őb
Őc
Oa
SQL> SELECT * FROM TABLE1 WHERE NAME CONTAINING 'ő' COLLATE UNICODE_CI;
NAME
============================================================
od
őb
Őc
Oa
Gabor
After the original "Problem with CONTAINING and COLLATE" thread I
switched to UTF8 but not happy with it. The optional COLLATE after
CONTAINING have no effect, the database default COLLATION used. See the
below examples. Tried with 3.0.3.32854 snapshot and Linux 64bit (Ubuntu
14.04.1).
1.Database defaults: UTF8+UNICODE_CI
CREATE DATABASE 'CHARSET_TEST' PAGE_SIZE 4096 DEFAULT CHARACTER SET UTF8
COLLATION UNICODE_CI;
isql CHARSET_TEST -ch UTF8 -u SYSDBA
CREATE TABLE TABLE1 (NAME VARCHAR(60));
INSERT INTO TABLE1 (NAME) VALUES ('od');
INSERT INTO TABLE1 (NAME) VALUES ('őb');
INSERT INTO TABLE1 (NAME) VALUES ('Őc');
INSERT INTO TABLE1 (NAME) VALUES ('Oa');
SQL> SELECT * FROM TABLE1 WHERE NAME CONTAINING 'o';
NAME
============================================================
od
Oa
SQL> SELECT * FROM TABLE1 WHERE NAME CONTAINING 'ő';
NAME
============================================================
őb
Őc
SQL> SELECT * FROM TABLE1 WHERE NAME CONTAINING 'o' COLLATE UNICODE_CI_AI;
NAME
============================================================
od
Oa
SQL> SELECT * FROM TABLE1 WHERE NAME CONTAINING 'ő' COLLATE
UNICODE_CI_AI;
NAME
============================================================
őb
Őc
2.Database defaults: UTF8+UNICODE_CI_AI
CREATE DATABASE 'CHARSET_TEST' PAGE_SIZE 4096 DEFAULT CHARACTER SET UTF8
COLLATION UNICODE_CI_AI;
isql CHARSET_TEST -ch UTF8 -u SYSDBA
CREATE TABLE TABLE1 (NAME VARCHAR(60));
INSERT INTO TABLE1 (NAME) VALUES ('od');
INSERT INTO TABLE1 (NAME) VALUES ('őb');
INSERT INTO TABLE1 (NAME) VALUES ('Őc');
INSERT INTO TABLE1 (NAME) VALUES ('Oa');
SQL> SELECT * FROM TABLE1 WHERE NAME CONTAINING 'o';
NAME
============================================================
od
őb
Őc
Oa
SQL> SELECT * FROM TABLE1 WHERE NAME CONTAINING 'ő';
NAME
============================================================
od
őb
Őc
Oa
SQL> SELECT * FROM TABLE1 WHERE NAME CONTAINING 'o' COLLATE UNICODE_CI;
NAME
============================================================
od
őb
Őc
Oa
SQL> SELECT * FROM TABLE1 WHERE NAME CONTAINING 'ő' COLLATE UNICODE_CI;
NAME
============================================================
od
őb
Őc
Oa
Gabor