Fix outdated src/test/mb/ tests, and add a GB18030 test.
The expected-output files for these tests were broken by the recent addition of a warning for hash indexes. Update them. Also add a test case for GB18030 encoding, similar to the other ones. This is a pretty weak test, but it's better than nothing.
This commit is contained in:
parent
8b0f105d2d
commit
07af523870
@ -2,6 +2,7 @@ drop table
|
||||
create table 廠商資料 (行業別 text, 公司抬頭 varchar, 地址 varchar(16));
|
||||
create index 廠商資料index1 on 廠商資料 using btree (行業別);
|
||||
create index 廠商資料index2 on 廠商資料 using hash (公司抬頭);
|
||||
WARNING: hash indexes are not WAL-logged and their use is discouraged
|
||||
insert into 廠商資料 values ('電腦業', '達達科技', '北A01仁');
|
||||
insert into 廠商資料 values ('製造業', '財源有限公司', '中B10中');
|
||||
insert into 廠商資料 values ('餐飲業', '美味股份有限公司', '高Z01九');
|
||||
|
@ -3,6 +3,7 @@ ERROR: table "
|
||||
create table 計算機用語 (用語 text, 分類コード varchar, 備考1Aだよ char(16));
|
||||
create index 計算機用語index1 on 計算機用語 using btree (用語);
|
||||
create index 計算機用語index2 on 計算機用語 using hash (分類コード);
|
||||
WARNING: hash indexes are not WAL-logged and their use is discouraged
|
||||
insert into 計算機用語 values('コンピュータディスプレイ','機A01上');
|
||||
insert into 計算機用語 values('コンピュータグラフィックス','分B10中');
|
||||
insert into 計算機用語 values('コンピュータプログラマー','人Z01下');
|
||||
|
@ -3,6 +3,7 @@ ERROR: table "ͪߩѦ
|
||||
create table 計算機용어 (용어 text, 分類코드 varchar, 비고1A라구 char(16));
|
||||
create index 計算機용어index1 on 計算機용어 using btree (용어);
|
||||
create index 計算機용어index2 on 計算機용어 using hash (分類코드);
|
||||
WARNING: hash indexes are not WAL-logged and their use is discouraged
|
||||
insert into 計算機용어 values('컴퓨터디스플레이', '機A01上');
|
||||
insert into 計算機용어 values('컴퓨터그래픽스', '分B10中');
|
||||
insert into 計算機용어 values('컴퓨터프로그래머', '人Z01下');
|
||||
|
@ -3,6 +3,7 @@ ERROR: table "
|
||||
create table 燹俑骜砧 (如淦杀 text, 狞瞥婉螭 varchar, 氢蛇 varchar(16));
|
||||
create index 燹俑骜砧index1 on 燹俑骜砧 using btree (如淦杀);
|
||||
create index 燹俑骜砧index2 on 燹俑骜砧 using hash (狞瞥婉螭);
|
||||
WARNING: hash indexes are not WAL-logged and their use is discouraged
|
||||
insert into 燹俑骜砧 values ('缳妾淦', '绠绠绎世', '啤A01念');
|
||||
insert into 燹俑骜砧 values ('犒葸淦', '芈溷却宇狞瞥', '你B10你');
|
||||
insert into 燹俑骜砧 values ('螫悖淦', '印汤洗枪却宇狞瞥', '仨Z01摩');
|
||||
|
87
src/test/mb/expected/gb18030.out
Normal file
87
src/test/mb/expected/gb18030.out
Normal file
@ -0,0 +1,87 @@
|
||||
drop table 計算機用語;
|
||||
create table 計算機用語 (用語 text, 分類コード varchar, 備考1Aだよ char(16));
|
||||
create index 計算機用語index1 on 計算機用語 using btree (用語);
|
||||
create index 計算機用語index2 on 計算機用語 using hash (分類コード);
|
||||
WARNING: hash indexes are not WAL-logged and their use is discouraged
|
||||
insert into 計算機用語 values('コンピュータディスプレイ','機A01上');
|
||||
insert into 計算機用語 values('コンピュータグラフィックス','分B10中');
|
||||
insert into 計算機用語 values('コンピュータプログラマー','人Z01下');
|
||||
vacuum 計算機用語;
|
||||
select * from 計算機用語;
|
||||
用語 | 分類コード | 備考1aだよ
|
||||
----------------------------+------------+------------
|
||||
コンピュータディスプレイ | 機A01上 |
|
||||
コンピュータグラフィックス | 分B10中 |
|
||||
コンピュータプログラマー | 人Z01下 |
|
||||
(3 rows)
|
||||
|
||||
select * from 計算機用語 where 分類コード = '人Z01下';
|
||||
用語 | 分類コード | 備考1aだよ
|
||||
--------------------------+------------+------------
|
||||
コンピュータプログラマー | 人Z01下 |
|
||||
(1 row)
|
||||
|
||||
select * from 計算機用語 where 分類コード ~* '人z01下';
|
||||
用語 | 分類コード | 備考1aだよ
|
||||
--------------------------+------------+------------
|
||||
コンピュータプログラマー | 人Z01下 |
|
||||
(1 row)
|
||||
|
||||
select * from 計算機用語 where 分類コード like '_Z01_';
|
||||
用語 | 分類コード | 備考1aだよ
|
||||
--------------------------+------------+------------
|
||||
コンピュータプログラマー | 人Z01下 |
|
||||
(1 row)
|
||||
|
||||
select * from 計算機用語 where 分類コード like '_Z%';
|
||||
用語 | 分類コード | 備考1aだよ
|
||||
--------------------------+------------+------------
|
||||
コンピュータプログラマー | 人Z01下 |
|
||||
(1 row)
|
||||
|
||||
select * from 計算機用語 where 用語 ~ 'コンピュータ[デグ]';
|
||||
用語 | 分類コード | 備考1aだよ
|
||||
----------------------------+------------+------------
|
||||
コンピュータディスプレイ | 機A01上 |
|
||||
コンピュータグラフィックス | 分B10中 |
|
||||
(2 rows)
|
||||
|
||||
select * from 計算機用語 where 用語 ~* 'コンピュータ[デグ]';
|
||||
用語 | 分類コード | 備考1aだよ
|
||||
----------------------------+------------+------------
|
||||
コンピュータディスプレイ | 機A01上 |
|
||||
コンピュータグラフィックス | 分B10中 |
|
||||
(2 rows)
|
||||
|
||||
select *,character_length(用語) from 計算機用語;
|
||||
用語 | 分類コード | 備考1aだよ | character_length
|
||||
----------------------------+------------+------------+------------------
|
||||
コンピュータディスプレイ | 機A01上 | | 12
|
||||
コンピュータグラフィックス | 分B10中 | | 13
|
||||
コンピュータプログラマー | 人Z01下 | | 12
|
||||
(3 rows)
|
||||
|
||||
select *,octet_length(用語) from 計算機用語;
|
||||
用語 | 分類コード | 備考1aだよ | octet_length
|
||||
----------------------------+------------+------------+--------------
|
||||
コンピュータディスプレイ | 機A01上 | | 36
|
||||
コンピュータグラフィックス | 分B10中 | | 39
|
||||
コンピュータプログラマー | 人Z01下 | | 36
|
||||
(3 rows)
|
||||
|
||||
select *,position('デ' in 用語) from 計算機用語;
|
||||
用語 | 分類コード | 備考1aだよ | position
|
||||
----------------------------+------------+------------+----------
|
||||
コンピュータディスプレイ | 機A01上 | | 7
|
||||
コンピュータグラフィックス | 分B10中 | | 0
|
||||
コンピュータプログラマー | 人Z01下 | | 0
|
||||
(3 rows)
|
||||
|
||||
select *,substring(用語 from 10 for 4) from 計算機用語;
|
||||
用語 | 分類コード | 備考1aだよ | substring
|
||||
----------------------------+------------+------------+-----------
|
||||
コンピュータディスプレイ | 機A01上 | | プレイ
|
||||
コンピュータグラフィックス | 分B10中 | | ィックス
|
||||
コンピュータプログラマー | 人Z01下 | | ラマー
|
||||
(3 rows)
|
||||
|
@ -3,6 +3,7 @@ ERROR: table "
|
||||
create table ’·×’»»’µ¡’ÍÑ’¸ì (’ÍÑ’¸ì text, ’ʬ’Îà’¥³’¡¼’¥É varchar, ’È÷’¹Í1A’¤À’¤è char(16));
|
||||
create index ’·×’»»’µ¡’ÍÑ’¸ìindex1 on ’·×’»»’µ¡’ÍÑ’¸ì using btree (’ÍÑ’¸ì);
|
||||
create index ’·×’»»’µ¡’ÍÑ’¸ìindex2 on ’·×’»»’µ¡’ÍÑ’¸ì using hash (’ʬ’Îà’¥³’¡¼’¥É);
|
||||
WARNING: hash indexes are not WAL-logged and their use is discouraged
|
||||
insert into ’·×’»»’µ¡’ÍÑ’¸ì values('’¥³’¥ó’¥Ô’¥å’¡¼’¥¿’¥Ç’¥£’¥¹’¥×’¥ì’¥¤','’µ¡A01’¾å');
|
||||
insert into ’·×’»»’µ¡’ÍÑ’¸ì values('’¥³’¥ó’¥Ô’¥å’¡¼’¥¿’¥°’¥é’¥Õ’¥£’¥Ã’¥¯’¥¹','’ʬB10’Ãæ');
|
||||
insert into ’·×’»»’µ¡’ÍÑ’¸ì values('’¥³’¥ó’¥Ô’¥å’¡¼’¥¿’¥×’¥í’¥°’¥é’¥Þ’¡¼','’¿ÍZ01’²¼');
|
||||
@ -177,6 +178,7 @@ ERROR: table "
|
||||
create table “ͪ“ß©“Ѧ“¿ë“¾î (“¿ë“¾î text, “Ý“׾“ÄÚ“µå varchar, “ºñ“°í1A“¶ó“±¸ char(16));
|
||||
create index “ͪ“ß©“Ѧ“¿ë“¾îindex1 on “ͪ“ß©“Ѧ“¿ë“¾î using btree (“¿ë“¾î);
|
||||
create index “ͪ“ß©“Ѧ“¿ë“¾îindex2 on “ͪ“ß©“Ѧ“¿ë“¾î using hash (“Ý“׾“ÄÚ“µå);
|
||||
WARNING: hash indexes are not WAL-logged and their use is discouraged
|
||||
insert into “ͪ“ß©“Ѧ“¿ë“¾î values('“Äēǻ“ÅÍ“µð“½º“ÇÓ·¹“ÀÌ', '“ѦA01“ß¾');
|
||||
insert into “ͪ“ß©“Ѧ“¿ë“¾î values('“Äēǻ“ÅÍ“±×“·¡“ÇÈ“½º', '“ÝÂB10“ñé');
|
||||
insert into “ͪ“ß©“Ѧ“¿ë“¾î values('“Äēǻ“ÅÍ“ÇÁ“·Î“±×“·¡“¸Ó', '“ìÑZ01“ù»');
|
||||
|
@ -2,6 +2,7 @@ drop table
|
||||
create table 計算機用語 (用語 text, 分類コード varchar, 備考1Aだよ char(16));
|
||||
create index 計算機用語index1 on 計算機用語 using btree (用語);
|
||||
create index 計算機用語index2 on 計算機用語 using hash (分類コード);
|
||||
WARNING: hash indexes are not WAL-logged and their use is discouraged
|
||||
insert into 計算機用語 values('コンピュータディスプレイ','機A01上');
|
||||
insert into 計算機用語 values('コンピュータグラフィックス','分B10中');
|
||||
insert into 計算機用語 values('コンピュータプログラマー','人Z01下');
|
||||
|
@ -3,6 +3,7 @@ ERROR: table "計算機用語" does not exist
|
||||
create table 計算機用語 (用語 text, 分類コード varchar, 備考1Aだよ char(16));
|
||||
create index 計算機用語index1 on 計算機用語 using btree (用語);
|
||||
create index 計算機用語index2 on 計算機用語 using hash (分類コード);
|
||||
WARNING: hash indexes are not WAL-logged and their use is discouraged
|
||||
insert into 計算機用語 values('コンピュータディスプレイ','機A01上');
|
||||
insert into 計算機用語 values('コンピュータグラフィックス','分B10中');
|
||||
insert into 計算機用語 values('コンピュータプログラマー','人Z01下');
|
||||
|
@ -18,7 +18,11 @@ dropdb --if-exists utf8
|
||||
createdb -T template0 -l C -E UTF8 utf8 || exit 1
|
||||
|
||||
PSQL="psql -n -e -q"
|
||||
tests="euc_jp sjis euc_kr euc_cn euc_tw big5 utf8 mule_internal"
|
||||
|
||||
# in the test list, client-only encodings must follow the server encoding
|
||||
# they're to be tested with; see hard-coded cases below
|
||||
tests="euc_jp sjis euc_kr euc_cn euc_tw big5 utf8 gb18030 mule_internal"
|
||||
|
||||
EXITCODE=0
|
||||
|
||||
unset PGCLIENTENCODING
|
||||
@ -36,6 +40,11 @@ do
|
||||
export PGCLIENTENCODING
|
||||
$PSQL euc_tw < sql/big5.sql > results/big5.out 2>&1
|
||||
unset PGCLIENTENCODING
|
||||
elif [ $i = gb18030 ];then
|
||||
PGCLIENTENCODING=GB18030
|
||||
export PGCLIENTENCODING
|
||||
$PSQL utf8 < sql/gb18030.sql > results/gb18030.out 2>&1
|
||||
unset PGCLIENTENCODING
|
||||
else
|
||||
dropdb $i >/dev/null 2>&1
|
||||
createdb -T template0 -l C -E `echo $i | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` $i >/dev/null
|
||||
|
19
src/test/mb/sql/gb18030.sql
Normal file
19
src/test/mb/sql/gb18030.sql
Normal file
@ -0,0 +1,19 @@
|
||||
drop table 計算機用語;
|
||||
create table 計算機用語 (用語 text, 分類コード varchar, 備考1Aだよ char(16));
|
||||
create index 計算機用語index1 on 計算機用語 using btree (用語);
|
||||
create index 計算機用語index2 on 計算機用語 using hash (分類コード);
|
||||
insert into 計算機用語 values('コンピュータディスプレイ','機A01上');
|
||||
insert into 計算機用語 values('コンピュータグラフィックス','分B10中');
|
||||
insert into 計算機用語 values('コンピュータプログラマー','人Z01下');
|
||||
vacuum 計算機用語;
|
||||
select * from 計算機用語;
|
||||
select * from 計算機用語 where 分類コード = '人Z01下';
|
||||
select * from 計算機用語 where 分類コード ~* '人z01下';
|
||||
select * from 計算機用語 where 分類コード like '_Z01_';
|
||||
select * from 計算機用語 where 分類コード like '_Z%';
|
||||
select * from 計算機用語 where 用語 ~ 'コンピュータ[デグ]';
|
||||
select * from 計算機用語 where 用語 ~* 'コンピュータ[デグ]';
|
||||
select *,character_length(用語) from 計算機用語;
|
||||
select *,octet_length(用語) from 計算機用語;
|
||||
select *,position('デ' in 用語) from 計算機用語;
|
||||
select *,substring(用語 from 10 for 4) from 計算機用語;
|
Loading…
x
Reference in New Issue
Block a user