Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 609026b

Browse files
committed
From: t-ishii@sra.co.jp
Included are patches intended for allowing PostgreSQL to handle multi-byte charachter sets such as EUC(Extende Unix Code), Unicode and Mule internal code. With the MB patch you can use multi-byte character sets in regexp and LIKE. The encoding system chosen is determined at the compile time. To enable the MB extension, you need to define a variable "MB" in Makefile.global or in Makefile.custom. For further information please take a look at README.mb under doc directory. (Note that unlike "jp patch" I do not use modified GNU regexp any more. I changed Henry Spencer's regexp coming with PostgreSQL.)
1 parent 661ecf3 commit 609026b

File tree

6 files changed

+246
-0
lines changed

6 files changed

+246
-0
lines changed

src/test/regress/expected/euc_cn.out

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
QUERY: drop table ���������;
2+
ERROR: Relation ��������� Does Not Exist!
3+
QUERY: create table ���������(���� text, ����� varchar, ��ע1A char(16));
4+
QUERY: create index ���������index1 on ��������� using btree(����);
5+
QUERY: create index ���������index2 on ��������� using btree(�����);
6+
QUERY: insert into ��������� values('������ʾ��','��A01��');
7+
QUERY: insert into ��������� values('����ͼ��','��B01��');
8+
QUERY: insert into ��������� values('���Գ���Ա','��Z01��');
9+
QUERY: vacuum ���������;
10+
QUERY: select * from ���������;
11+
���� |����� |��ע1a
12+
----------+-------+------
13+
������ʾ��|��A01��|
14+
����ͼ�� |��B01��|
15+
���Գ���Ա|��Z01��|
16+
(3 rows)
17+
18+
QUERY: select * from ��������� where ����� = '��Z01��';
19+
���� |����� |��ע1a
20+
----------+-------+------
21+
���Գ���Ա|��Z01��|
22+
(1 row)
23+
24+
QUERY: select * from ��������� where ����� ~* '��z01��';
25+
���� |����� |��ע1a
26+
----------+-------+------
27+
���Գ���Ա|��Z01��|
28+
(1 row)
29+
30+
QUERY: select * from ��������� where ����� like '_Z01_';
31+
���� |����� |��ע1a
32+
----------+-------+------
33+
���Գ���Ա|��Z01��|
34+
(1 row)
35+
36+
QUERY: select * from ��������� where ����� like '_Z%';
37+
���� |����� |��ע1a
38+
----------+-------+------
39+
���Գ���Ա|��Z01��|
40+
(1 row)
41+
42+
QUERY: select * from ��������� where ���� ~ '����[��ͼ]';
43+
���� |����� |��ע1a
44+
----------+-------+------
45+
������ʾ��|��A01��|
46+
����ͼ�� |��B01��|
47+
(2 rows)
48+
49+
QUERY: select * from ��������� where ���� ~* '����[��ͼ]';
50+
���� |����� |��ע1a
51+
----------+-------+------
52+
������ʾ��|��A01��|
53+
����ͼ�� |��B01��|
54+
(2 rows)
55+

src/test/regress/expected/euc_jp.out

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
QUERY: drop table �׻����Ѹ�;
2+
ERROR: Relation �׻����Ѹ� Does Not Exist!
3+
QUERY: create table �׻����Ѹ� (�Ѹ� text, ʬ�ॳ���� varchar, ����1A���� char(16));
4+
QUERY: create index �׻����Ѹ�index1 on �׻����Ѹ� using btree (�Ѹ�);
5+
QUERY: create index �׻����Ѹ�index2 on �׻����Ѹ� using hash (ʬ�ॳ����);
6+
QUERY: insert into �׻����Ѹ� values('����ԥ塼���ǥ����ץ쥤','��A01��');
7+
QUERY: insert into �׻����Ѹ� values('����ԥ塼������ե��å���','ʬB10��');
8+
QUERY: insert into �׻����Ѹ� values('����ԥ塼���ץ�����ޡ�','��Z01��');
9+
QUERY: vacuum �׻����Ѹ�;
10+
QUERY: select * from �׻����Ѹ�;
11+
�Ѹ� |ʬ�ॳ����|����1a����
12+
--------------------------+----------+----------
13+
����ԥ塼���ǥ����ץ쥤 |��A01�� |
14+
����ԥ塼������ե��å���|ʬB10�� |
15+
����ԥ塼���ץ�����ޡ� |��Z01�� |
16+
(3 rows)
17+
18+
QUERY: select * from �׻����Ѹ� where ʬ�ॳ���� = '��Z01��';
19+
�Ѹ� |ʬ�ॳ����|����1a����
20+
------------------------+----------+----------
21+
����ԥ塼���ץ�����ޡ�|��Z01�� |
22+
(1 row)
23+
24+
QUERY: select * from �׻����Ѹ� where ʬ�ॳ���� ~* '��z01��';
25+
�Ѹ� |ʬ�ॳ����|����1a����
26+
------------------------+----------+----------
27+
����ԥ塼���ץ�����ޡ�|��Z01�� |
28+
(1 row)
29+
30+
QUERY: select * from �׻����Ѹ� where ʬ�ॳ���� like '_Z01_';
31+
�Ѹ� |ʬ�ॳ����|����1a����
32+
------------------------+----------+----------
33+
����ԥ塼���ץ�����ޡ�|��Z01�� |
34+
(1 row)
35+
36+
QUERY: select * from �׻����Ѹ� where ʬ�ॳ���� like '_Z%';
37+
�Ѹ� |ʬ�ॳ����|����1a����
38+
------------------------+----------+----------
39+
����ԥ塼���ץ�����ޡ�|��Z01�� |
40+
(1 row)
41+
42+
QUERY: select * from �׻����Ѹ� where �Ѹ� ~ '����ԥ塼��[�ǥ�]';
43+
�Ѹ� |ʬ�ॳ����|����1a����
44+
--------------------------+----------+----------
45+
����ԥ塼���ǥ����ץ쥤 |��A01�� |
46+
����ԥ塼������ե��å���|ʬB10�� |
47+
(2 rows)
48+
49+
QUERY: select * from �׻����Ѹ� where �Ѹ� ~* '����ԥ塼��[�ǥ�]';
50+
�Ѹ� |ʬ�ॳ����|����1a����
51+
--------------------------+----------+----------
52+
����ԥ塼���ǥ����ץ쥤 |��A01�� |
53+
����ԥ塼������ե��å���|ʬB10�� |
54+
(2 rows)
55+
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
QUERY: drop table ��ג�������ђ��;
2+
ERROR: Relation ��ג�������ђ�� Does Not Exist!
3+
QUERY: create table ��ג�������ђ�� (��ђ�� text, �ʬ������������ varchar, ������1A������ char(16));
4+
QUERY: create index ��ג�������ђ��index1 on ��ג�������ђ�� using btree (��ђ��);
5+
QUERY: create index ��ג�������ђ��index2 on ��ג�������ђ�� using hash (�ʬ������������);
6+
QUERY: insert into ��ג�������ђ�� values('������Ԓ�咡������ǒ�������ג�쒥�','���A01���');
7+
QUERY: insert into ��ג�������ђ�� values('������Ԓ�咡���������钥Ւ����Ò�����','�ʬB10���');
8+
QUERY: insert into ��ג�������ђ�� values('������Ԓ�咡������ג�풥���钥ޒ��','���Z01���');
9+
QUERY: insert into ��ג�������ђ�� values('����ԑ�ԑʾ���','���A01���');
10+
QUERY: insert into ��ג�������ђ�� values('����ԑͼ���','���B01���');
11+
QUERY: insert into ��ג�������ђ�� values('����ԑ�̑��Ա','���Z01���');
12+
QUERY: vacuum ��ג�������ђ��;
13+
QUERY: select * from ��ג�������ђ��;
14+
��ђ�� |�ʬ������������|������1a������
15+
---------------------------------------+---------------+--------------
16+
������Ԓ�咡������ǒ�������ג�쒥� |���A01��� |
17+
������Ԓ�咡���������钥Ւ����Ò�����|�ʬB10��� |
18+
������Ԓ�咡������ג�풥���钥ޒ�� |���Z01��� |
19+
����ԑ�ԑʾ��� |���A01��� |
20+
����ԑͼ��� |���B01��� |
21+
����ԑ�̑��Ա |���Z01��� |
22+
(6 rows)
23+
24+
QUERY: select * from ��ג�������ђ�� where �ʬ������������ = '���Z01���';
25+
��ђ�� |�ʬ������������|������1a������
26+
------------------------------------+---------------+--------------
27+
������Ԓ�咡������ג�풥���钥ޒ��|���Z01��� |
28+
(1 row)
29+
30+
QUERY: select * from ��ג�������ђ�� where �ʬ������������ ~ 'Z01';
31+
��ђ�� |�ʬ������������|������1a������
32+
------------------------------------+---------------+--------------
33+
������Ԓ�咡������ג�풥���钥ޒ��|���Z01��� |
34+
����ԑ�̑��Ա |���Z01��� |
35+
(2 rows)
36+
37+
QUERY: select * from ��ג�������ђ�� where �ʬ������������ ~* 'z01';
38+
��ђ�� |�ʬ������������|������1a������
39+
------------------------------------+---------------+--------------
40+
������Ԓ�咡������ג�풥���钥ޒ��|���Z01��� |
41+
����ԑ�̑��Ա |���Z01��� |
42+
(2 rows)
43+
44+
QUERY: select * from ��ג�������ђ�� where �ʬ������������ like '_Z01_';
45+
��ђ�� |�ʬ������������|������1a������
46+
------------------------------------+---------------+--------------
47+
������Ԓ�咡������ג�풥���钥ޒ��|���Z01��� |
48+
����ԑ�̑��Ա |���Z01��� |
49+
(2 rows)
50+
51+
QUERY: select * from ��ג�������ђ�� where �ʬ������������ like '_Z%';
52+
��ђ�� |�ʬ������������|������1a������
53+
------------------------------------+---------------+--------------
54+
������Ԓ�咡������ג�풥���钥ޒ��|���Z01��� |
55+
����ԑ�̑��Ա |���Z01��� |
56+
(2 rows)
57+
58+
QUERY: select * from ��ג�������ђ�� where ��ђ�� ~ '������Ԓ�咡����[��ǒ��]';
59+
��ђ�� |�ʬ������������|������1a������
60+
---------------------------------------+---------------+--------------
61+
������Ԓ�咡������ǒ�������ג�쒥� |���A01��� |
62+
������Ԓ�咡���������钥Ւ����Ò�����|�ʬB10��� |
63+
(2 rows)
64+
65+
QUERY: select * from ��ג�������ђ�� where ��ђ�� ~* '������Ԓ�咡����[��ǒ��]';
66+
��ђ�� |�ʬ������������|������1a������
67+
---------------------------------------+---------------+--------------
68+
������Ԓ�咡������ǒ�������ג�쒥� |���A01��� |
69+
������Ԓ�咡���������钥Ւ����Ò�����|�ʬB10��� |
70+
(2 rows)
71+
72+
QUERY: select * from ��ג�������ђ�� where ��ђ�� ~ '�����[��ԑͼ]';
73+
��ђ�� |�ʬ������������|������1a������
74+
---------------+---------------+--------------
75+
����ԑ�ԑʾ���|���A01��� |
76+
����ԑͼ��� |���B01��� |
77+
(2 rows)
78+
79+
QUERY: select * from ��ג�������ђ�� where ��ђ�� ~* '�����[��ԑͼ]';
80+
��ђ�� |�ʬ������������|������1a������
81+
---------------+---------------+--------------
82+
����ԑ�ԑʾ���|���A01��� |
83+
����ԑͼ��� |���B01��� |
84+
(2 rows)
85+

src/test/regress/sql/euc_cn.sql

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
drop table 计算机术语;
2+
create table 计算机术语(术语 text, 分类号 varchar, 备注1A char(16));
3+
create index 计算机术语index1 on 计算机术语 using btree(术语);
4+
create index 计算机术语index2 on 计算机术语 using btree(分类号);
5+
insert into 计算机术语 values('电脑显示屏','机A01上');
6+
insert into 计算机术语 values('电脑图形','分B01中');
7+
insert into 计算机术语 values('电脑程序员','人Z01下');
8+
vacuum 计算机术语;
9+
select * from 计算机术语;
10+
select * from 计算机术语 where 分类号 = '人Z01下';
11+
select * from 计算机术语 where 分类号 ~* '人z01下';
12+
select * from 计算机术语 where 分类号 like '_Z01_';
13+
select * from 计算机术语 where 分类号 like '_Z%';
14+
select * from 计算机术语 where 术语 ~ '电脑[显图]';
15+
select * from 计算机术语 where 术语 ~* '电脑[显图]';

src/test/regress/sql/euc_jp.sql

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
drop table 計算機用語;
2+
create table 計算機用語 (用語 text, 分類コード varchar, 備考1Aだよ char(16));
3+
create index 計算機用語index1 on 計算機用語 using btree (用語);
4+
create index 計算機用語index2 on 計算機用語 using hash (分類コード);
5+
insert into 計算機用語 values('コンピュータディスプレイ','機A01上');
6+
insert into 計算機用語 values('コンピュータグラフィックス','分B10中');
7+
insert into 計算機用語 values('コンピュータプログラマー','人Z01下');
8+
vacuum 計算機用語;
9+
select * from 計算機用語;
10+
select * from 計算機用語 where 分類コード = '人Z01下';
11+
select * from 計算機用語 where 分類コード ~* '人z01下';
12+
select * from 計算機用語 where 分類コード like '_Z01_';
13+
select * from 計算機用語 where 分類コード like '_Z%';
14+
select * from 計算機用語 where 用語 ~ 'コンピュータ[デグ]';
15+
select * from 計算機用語 where 用語 ~* 'コンピュータ[デグ]';
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
drop table ’·×’»»’µ¡’ÍÑ’¸ì;
2+
create table ’·×’»»’µ¡’ÍÑ’¸ì (’ÍÑ’¸ì text, ’ʬ’Îà’¥³’¡¼’¥É varchar, ’È÷’¹Í1A’¤À’¤è char(16));
3+
create index ’·×’»»’µ¡’ÍÑ’¸ìindex1 on ’·×’»»’µ¡’ÍÑ’¸ì using btree (’ÍÑ’¸ì);
4+
create index ’·×’»»’µ¡’ÍÑ’¸ìindex2 on ’·×’»»’µ¡’ÍÑ’¸ì using hash (’ʬ’Îà’¥³’¡¼’¥É);
5+
insert into ’·×’»»’µ¡’ÍÑ’¸ì values('’¥³’¥ó’¥Ô’¥å’¡¼’¥¿’¥Ç’¥£’¥¹’¥×’¥ì’¥¤','’µ¡A01’¾å');
6+
insert into ’·×’»»’µ¡’ÍÑ’¸ì values('’¥³’¥ó’¥Ô’¥å’¡¼’¥¿’¥°’¥é’¥Õ’¥£’¥Ã’¥¯’¥¹','’ʬB10’Ãæ');
7+
insert into ’·×’»»’µ¡’ÍÑ’¸ì values('’¥³’¥ó’¥Ô’¥å’¡¼’¥¿’¥×’¥í’¥°’¥é’¥Þ’¡¼','’¿ÍZ01’²¼');
8+
insert into ’·×’»»’µ¡’ÍÑ’¸ì values('‘µç‘ÄÔ‘Ïԑʾ‘ÆÁ','‘»úA01‘ÉÏ');
9+
insert into ’·×’»»’µ¡’ÍÑ’¸ì values('‘µç‘Äԑͼ‘ÐÎ','‘·ÖB01‘ÖÐ');
10+
insert into ’·×’»»’µ¡’ÍÑ’¸ì values('‘µç‘ÄÔ‘³Ì‘Ðò‘Ô±','‘ÈËZ01‘ÏÂ');
11+
vacuum ’·×’»»’µ¡’ÍÑ’¸ì;
12+
select * from ’·×’»»’µ¡’ÍÑ’¸ì;
13+
select * from ’·×’»»’µ¡’ÍÑ’¸ì where ’ʬ’Îà’¥³’¡¼’¥É = '’¿ÍZ01’²¼';
14+
select * from ’·×’»»’µ¡’ÍÑ’¸ì where ’ʬ’Îà’¥³’¡¼’¥É ~ 'Z01';
15+
select * from ’·×’»»’µ¡’ÍÑ’¸ì where ’ʬ’Îà’¥³’¡¼’¥É ~* 'z01';
16+
select * from ’·×’»»’µ¡’ÍÑ’¸ì where ’ʬ’Îà’¥³’¡¼’¥É like '_Z01_';
17+
select * from ’·×’»»’µ¡’ÍÑ’¸ì where ’ʬ’Îà’¥³’¡¼’¥É like '_Z%';
18+
select * from ’·×’»»’µ¡’ÍÑ’¸ì where ’ÍÑ’¸ì ~ '’¥³’¥ó’¥Ô’¥å’¡¼’¥¿[’¥Ç’¥°]';
19+
select * from ’·×’»»’µ¡’ÍÑ’¸ì where ’ÍÑ’¸ì ~* '’¥³’¥ó’¥Ô’¥å’¡¼’¥¿[’¥Ç’¥°]';
20+
select * from ’·×’»»’µ¡’ÍÑ’¸ì where ’ÍÑ’¸ì ~ '‘µç‘ÄÔ[‘Ïԑͼ]';
21+
select * from ’·×’»»’µ¡’ÍÑ’¸ì where ’ÍÑ’¸ì ~* '‘µç‘ÄÔ[‘Ïԑͼ]';

0 commit comments

Comments
 (0)