aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/test/mb/expected/big5.out1
-rw-r--r--src/test/mb/expected/euc_jp.out1
-rw-r--r--src/test/mb/expected/euc_kr.out1
-rw-r--r--src/test/mb/expected/euc_tw.out1
-rw-r--r--src/test/mb/expected/gb18030.out87
-rw-r--r--src/test/mb/expected/mule_internal.out2
-rw-r--r--src/test/mb/expected/sjis.out1
-rw-r--r--src/test/mb/expected/utf8.out1
-rwxr-xr-xsrc/test/mb/mbregress.sh11
-rw-r--r--src/test/mb/sql/gb18030.sql19
10 files changed, 124 insertions, 1 deletions
diff --git a/src/test/mb/expected/big5.out b/src/test/mb/expected/big5.out
index 97100cd0a2d..d7a6097e612 100644
--- a/src/test/mb/expected/big5.out
+++ b/src/test/mb/expected/big5.out
@@ -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');
diff --git a/src/test/mb/expected/euc_jp.out b/src/test/mb/expected/euc_jp.out
index 15f83e0231c..be248d91359 100644
--- a/src/test/mb/expected/euc_jp.out
+++ b/src/test/mb/expected/euc_jp.out
@@ -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布');
diff --git a/src/test/mb/expected/euc_kr.out b/src/test/mb/expected/euc_kr.out
index 229ffd8f971..837f2e60d07 100644
--- a/src/test/mb/expected/euc_kr.out
+++ b/src/test/mb/expected/euc_kr.out
@@ -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');
diff --git a/src/test/mb/expected/euc_tw.out b/src/test/mb/expected/euc_tw.out
index 99eb4884e12..f224e7820d5 100644
--- a/src/test/mb/expected/euc_tw.out
+++ b/src/test/mb/expected/euc_tw.out
@@ -3,6 +3,7 @@ ERROR: table "燹俑骜砧" does not exist
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摩');
diff --git a/src/test/mb/expected/gb18030.out b/src/test/mb/expected/gb18030.out
new file mode 100644
index 00000000000..562852b6741
--- /dev/null
+++ b/src/test/mb/expected/gb18030.out
@@ -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)
+
diff --git a/src/test/mb/expected/mule_internal.out b/src/test/mb/expected/mule_internal.out
index ac8b57dc421..67f7775706e 100644
--- a/src/test/mb/expected/mule_internal.out
+++ b/src/test/mb/expected/mule_internal.out
@@ -3,6 +3,7 @@ ERROR: table "挿讙换挼脱捀" does not exist
create table 挿讙换挼脱捀 (捦褣胳 text, 捠瑨梧挜硳〖挜 varchar, 捜鲯雇1A挙罀よ char(16));
create index 挿讙换挼脱捀靑ndex1 on 挿讙换挼脱捀 using btree (捦褣胳);
create index 挿讙换挼脱捀靑ndex2 on 挿讙换挼脱捀 using hash (捠瑨梧挜硳〖挜);
+WARNING: hash indexes are not WAL-logged and their use is discouraged
insert into 挿讙换挼脱捀 values('挜硳ン挜話ュ挕紥タ挜菕ィ挜箳プ挜鞉イ','挼01捑');
insert into 挿讙换挼脱捀 values('挜硳ン挜話ュ挕紥タ挜皰ラ挜諕ィ挜脪ク挜','捠珺10捗');
insert into 挿讙换挼脱捀 values('挜硳ン挜話ュ挕紥タ挜讙ロ挜皰ラ挜迴〖','捒蚙01挷');
@@ -177,6 +178,7 @@ ERROR: table "撏獡擤撗侩摼" does not exist
create table 撏獡擤撗侩摼 (摽霌绢 text, 撦聯拙撃趽靛 varchar, 摵駬绊1A摱髶备 char(16));
create index 撏獡擤撗侩摼頸ndex1 on 撏獡擤撗侩摼 using btree (摽霌绢);
create index 撏獡擤撗侩摼頸ndex2 on 撏獡擤撗侩摼 using hash (撦聯拙撃趽靛);
+WARNING: hash indexes are not WAL-logged and their use is discouraged
insert into 撏獡擤撗侩摼 values('撃膿腔撆蛽叼摻簱敲摲箵捞', '撗01撨');
insert into 撏獡擤撗侩摼 values('撃膿腔撆蛽弊摲侨摻', '撦翨10擇');
insert into 撏獡擤撗侩摼 values('撃膿腔撆蛽橇摲螕弊摲赣', '撿裐01擓');
diff --git a/src/test/mb/expected/sjis.out b/src/test/mb/expected/sjis.out
index db2bfd0d755..73dd29b9843 100644
--- a/src/test/mb/expected/sjis.out
+++ b/src/test/mb/expected/sjis.out
@@ -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壓');
diff --git a/src/test/mb/expected/utf8.out b/src/test/mb/expected/utf8.out
index 8f9f63c7e0e..715f3468374 100644
--- a/src/test/mb/expected/utf8.out
+++ b/src/test/mb/expected/utf8.out
@@ -3,6 +3,7 @@ ERROR: table "瑷堢畻姗熺敤瑾" does not exist
create table 瑷堢畻姗熺敤瑾 (鐢ㄨ獮 text, 鍒嗛銈炽兗銉 varchar, 鍌欒1A銇犮倛 char(16));
create index 瑷堢畻姗熺敤瑾瀒ndex1 on 瑷堢畻姗熺敤瑾 using btree (鐢ㄨ獮);
create index 瑷堢畻姗熺敤瑾瀒ndex2 on 瑷堢畻姗熺敤瑾 using hash (鍒嗛銈炽兗銉);
+WARNING: hash indexes are not WAL-logged and their use is discouraged
insert into 瑷堢畻姗熺敤瑾 values('銈炽兂銉斻儱銉笺偪銉囥偅銈广儣銉偆','姗烝01涓');
insert into 瑷堢畻姗熺敤瑾 values('銈炽兂銉斻儱銉笺偪銈般儵銉曘偅銉冦偗銈','鍒咮10涓');
insert into 瑷堢畻姗熺敤瑾 values('銈炽兂銉斻儱銉笺偪銉椼儹銈般儵銉炪兗','浜篫01涓');
diff --git a/src/test/mb/mbregress.sh b/src/test/mb/mbregress.sh
index 03e590c9fc6..1efa0326c7f 100755
--- a/src/test/mb/mbregress.sh
+++ b/src/test/mb/mbregress.sh
@@ -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
diff --git a/src/test/mb/sql/gb18030.sql b/src/test/mb/sql/gb18030.sql
new file mode 100644
index 00000000000..91ecaaa973b
--- /dev/null
+++ b/src/test/mb/sql/gb18030.sql
@@ -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 計算機用語;