summaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorMarc G. Fournier1998-04-27 17:10:50 +0000
committerMarc G. Fournier1998-04-27 17:10:50 +0000
commitf554af0a9fdbe0e9636fce36d6c809e81ce1539c (patch)
tree3cd60fe19a94c78e774ac3b70ef3d729f7896f20 /src/test
parent2cbcf461028dee105f69328e4589f08a4f59db91 (diff)
From: t-ishii@sra.co.jp
Hi, here are patches I promised (against 6.3.2): * character_length(), position(), substring() are now aware of multi-byte characters * add octet_length() * add --with-mb option to configure * new regression tests for EUC_KR (contributed by "Soonmyung. Hong" <hong@lunaris.hanmesoft.co.kr>) * add some test cases to the EUC_JP regression test * fix problem in regress/regress.sh in case of System V * fix toupper(), tolower() to handle 8bit chars note that: o patches for both configure.in and configure are included. maybe the one for configure is not necessary. o pg_proc.h was modified to add octet_length(). I used OIDs (1374-1379) for that. Please let me know if these numbers are not appropriate.
Diffstat (limited to 'src/test')
-rw-r--r--src/test/regress/expected/euc_jp.out32
-rwxr-xr-xsrc/test/regress/regress.sh4
-rw-r--r--src/test/regress/sql/euc_jp.sql4
3 files changed, 38 insertions, 2 deletions
diff --git a/src/test/regress/expected/euc_jp.out b/src/test/regress/expected/euc_jp.out
index c710392738f..f976010e76b 100644
--- a/src/test/regress/expected/euc_jp.out
+++ b/src/test/regress/expected/euc_jp.out
@@ -53,3 +53,35 @@ QUERY: select * from 計算機用語 where 用語 ~* 'コンピュータ[デグ]';
コンピュータグラフィックス|分B10中 |
(2 rows)
+QUERY: select *,character_length(用語) from 計算機用語;
+用語 |分類コード|備考1aだよ|length
+--------------------------+----------+----------+------
+コンピュータディスプレイ |機A01上 | | 12
+コンピュータグラフィックス|分B10中 | | 13
+コンピュータプログラマー |人Z01下 | | 12
+(3 rows)
+
+QUERY: select *,octet_length(用語) from 計算機用語;
+用語 |分類コード|備考1aだよ|octet_length
+--------------------------+----------+----------+------------
+コンピュータディスプレイ |機A01上 | | 24
+コンピュータグラフィックス|分B10中 | | 26
+コンピュータプログラマー |人Z01下 | | 24
+(3 rows)
+
+QUERY: select *,position('デ' in 用語) from 計算機用語;
+用語 |分類コード|備考1aだよ|strpos
+--------------------------+----------+----------+------
+コンピュータディスプレイ |機A01上 | | 7
+コンピュータグラフィックス|分B10中 | | 0
+コンピュータプログラマー |人Z01下 | | 0
+(3 rows)
+
+QUERY: select *,substring(用語 from 10 for 4) from 計算機用語;
+用語 |分類コード|備考1aだよ|substr
+--------------------------+----------+----------+--------
+コンピュータディスプレイ |機A01上 | |プレイ
+コンピュータグラフィックス|分B10中 | |ィックス
+コンピュータプログラマー |人Z01下 | |ラマー
+(3 rows)
+
diff --git a/src/test/regress/regress.sh b/src/test/regress/regress.sh
index f12b431e31b..caa40033b80 100755
--- a/src/test/regress/regress.sh
+++ b/src/test/regress/regress.sh
@@ -1,5 +1,5 @@
#!/bin/sh
-# $Header: /cvsroot/pgsql/src/test/regress/Attic/regress.sh,v 1.18 1998/03/15 07:39:04 scrappy Exp $
+# $Header: /cvsroot/pgsql/src/test/regress/Attic/regress.sh,v 1.19 1998/04/27 17:10:17 scrappy Exp $
#
if echo '\c' | grep -s c >/dev/null 2>&1
then
@@ -43,7 +43,7 @@ fi
echo "=============== running regression queries... ================="
echo "" > regression.diffs
if [ a$MB != a ];then
- mbtests=`echo $MB|tr A-Z a-z`
+ mbtests=`echo $MB|tr "[A-Z]" "[a-z]"`
else
mbtests=""
fi
diff --git a/src/test/regress/sql/euc_jp.sql b/src/test/regress/sql/euc_jp.sql
index 8cba58055d5..2021205bf45 100644
--- a/src/test/regress/sql/euc_jp.sql
+++ b/src/test/regress/sql/euc_jp.sql
@@ -13,3 +13,7 @@ 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 計算機用語;