diff options
author | Marc G. Fournier | 1998-07-24 03:32:46 +0000 |
---|---|---|
committer | Marc G. Fournier | 1998-07-24 03:32:46 +0000 |
commit | bf00bbb0c4940b80b46b7e5b379cd64184f2262f (patch) | |
tree | bf32bf3bafe6f367ee97249c83afb4c9e9a637af /src/test | |
parent | 6e66468f3a160878111578a93be2852635eb4f4d (diff) |
I really hope that I haven't missed anything in this one...
From: t-ishii@sra.co.jp
Attached are patches to enhance the multi-byte support. (patches are
against 7/18 snapshot)
* determine encoding at initdb/createdb rather than compile time
Now initdb/createdb has an option to specify the encoding. Also, I
modified the syntax of CREATE DATABASE to accept encoding option. See
README.mb for more details.
For this purpose I have added new column "encoding" to pg_database.
Also pg_attribute and pg_class are changed to catch up the
modification to pg_database. Actually I haved added pg_database_mb.h,
pg_attribute_mb.h and pg_class_mb.h. These are used only when MB is
enabled. The reason having separate files is I couldn't find a way to
use ifdef or whatever in those files. I have to admit it looks
ugly. No way.
* support for PGCLIENTENCODING when issuing COPY command
commands/copy.c modified.
* support for SQL92 syntax "SET NAMES"
See gram.y.
* support for LATIN2-5
* add UNICODE regression test case
* new test suite for MB
New directory test/mb added.
* clean up source files
Basic idea is to have MB's own subdirectory for easier maintenance.
These are include/mb and backend/utils/mb.
Diffstat (limited to 'src/test')
-rw-r--r-- | src/test/mb/README | 9 | ||||
-rw-r--r-- | src/test/mb/expected/euc_cn.out | 87 | ||||
-rw-r--r-- | src/test/mb/expected/euc_jp.out | 87 | ||||
-rw-r--r-- | src/test/mb/expected/euc_kr.out | 87 | ||||
-rw-r--r-- | src/test/mb/expected/mule_internal.out | 333 | ||||
-rw-r--r-- | src/test/mb/expected/sjis.out | 90 | ||||
-rw-r--r-- | src/test/mb/expected/unicode.out | 87 | ||||
-rw-r--r-- | src/test/mb/mbregress.sh | 48 | ||||
-rw-r--r-- | src/test/mb/sql/euc_cn.sql | 19 | ||||
-rw-r--r-- | src/test/mb/sql/euc_jp.sql | 19 | ||||
-rw-r--r-- | src/test/mb/sql/euc_kr.sql | 19 | ||||
-rw-r--r-- | src/test/mb/sql/mule_internal.sql | 72 | ||||
-rw-r--r-- | src/test/mb/sql/sjis.sql | 20 | ||||
-rw-r--r-- | src/test/mb/sql/unicode.sql | 19 |
14 files changed, 996 insertions, 0 deletions
diff --git a/src/test/mb/README b/src/test/mb/README new file mode 100644 index 00000000000..50797f831a0 --- /dev/null +++ b/src/test/mb/README @@ -0,0 +1,9 @@ +README for MB(multi-byte) regression test + 1998/7/22 + Tatsuo Ishii + +This directory contains a set of tests for MB(multi-byte) supporting +extentions for PostgreSQL. To run the test, simply type: + +% mbregress.sh + diff --git a/src/test/mb/expected/euc_cn.out b/src/test/mb/expected/euc_cn.out new file mode 100644 index 00000000000..f35356b5e85 --- /dev/null +++ b/src/test/mb/expected/euc_cn.out @@ -0,0 +1,87 @@ +QUERY: drop table 柴麻字宝囂; +ERROR: Relation 柴麻字宝囂 Does Not Exist! +QUERY: create table 柴麻字宝囂(宝囂 text, 蛍窃催 varchar, 姥廣1A char(16)); +QUERY: create index 柴麻字宝囂index1 on 柴麻字宝囂 using btree(宝囂); +QUERY: create index 柴麻字宝囂index2 on 柴麻字宝囂 using btree(蛍窃催); +QUERY: insert into 柴麻字宝囂 values('窮辻塋焼','字A01貧'); +QUERY: insert into 柴麻字宝囂 values('窮辻夕侘','蛍B01嶄'); +QUERY: insert into 柴麻字宝囂 values('窮辻殻會埀','繁Z01和'); +QUERY: vacuum 柴麻字宝囂; +QUERY: select * from 柴麻字宝囂; +宝囂 |蛍窃催 |姥廣1a +----------+-------+------ +窮辻塋焼|字A01貧| +窮辻夕侘 |蛍B01嶄| +窮辻殻會埀|繁Z01和| +(3 rows) + +QUERY: select * from 柴麻字宝囂 where 蛍窃催 = '繁Z01和'; +宝囂 |蛍窃催 |姥廣1a +----------+-------+------ +窮辻殻會埀|繁Z01和| +(1 row) + +QUERY: select * from 柴麻字宝囂 where 蛍窃催 ~* '繁z01和'; +宝囂 |蛍窃催 |姥廣1a +----------+-------+------ +窮辻殻會埀|繁Z01和| +(1 row) + +QUERY: select * from 柴麻字宝囂 where 蛍窃催 like '_Z01_'; +宝囂 |蛍窃催 |姥廣1a +----------+-------+------ +窮辻殻會埀|繁Z01和| +(1 row) + +QUERY: select * from 柴麻字宝囂 where 蛍窃催 like '_Z%'; +宝囂 |蛍窃催 |姥廣1a +----------+-------+------ +窮辻殻會埀|繁Z01和| +(1 row) + +QUERY: select * from 柴麻字宝囂 where 宝囂 ~ '窮辻[塒]'; +宝囂 |蛍窃催 |姥廣1a +----------+-------+------ +窮辻塋焼|字A01貧| +窮辻夕侘 |蛍B01嶄| +(2 rows) + +QUERY: select * from 柴麻字宝囂 where 宝囂 ~* '窮辻[塒]'; +宝囂 |蛍窃催 |姥廣1a +----------+-------+------ +窮辻塋焼|字A01貧| +窮辻夕侘 |蛍B01嶄| +(2 rows) + +QUERY: select *,character_length(宝囂) from 柴麻字宝囂; +宝囂 |蛍窃催 |姥廣1a|length +----------+-------+------+------ +窮辻塋焼|字A01貧| | 5 +窮辻夕侘 |蛍B01嶄| | 4 +窮辻殻會埀|繁Z01和| | 5 +(3 rows) + +QUERY: select *,octet_length(宝囂) from 柴麻字宝囂; +宝囂 |蛍窃催 |姥廣1a|octet_length +----------+-------+------+------------ +窮辻塋焼|字A01貧| | 10 +窮辻夕侘 |蛍B01嶄| | 8 +窮辻殻會埀|繁Z01和| | 10 +(3 rows) + +QUERY: select *,position('' in 宝囂) from 柴麻字宝囂; +宝囂 |蛍窃催 |姥廣1a|strpos +----------+-------+------+------ +窮辻塋焼|字A01貧| | 3 +窮辻夕侘 |蛍B01嶄| | 0 +窮辻殻會埀|繁Z01和| | 0 +(3 rows) + +QUERY: select *,substring(宝囂 from 3 for 4) from 柴麻字宝囂; +宝囂 |蛍窃催 |姥廣1a|substr +----------+-------+------+------ +窮辻塋焼|字A01貧| |塋焼 +窮辻夕侘 |蛍B01嶄| |夕侘 +窮辻殻會埀|繁Z01和| |殻會埀 +(3 rows) + diff --git a/src/test/mb/expected/euc_jp.out b/src/test/mb/expected/euc_jp.out new file mode 100644 index 00000000000..f976010e76b --- /dev/null +++ b/src/test/mb/expected/euc_jp.out @@ -0,0 +1,87 @@ +QUERY: drop table 計算機用語; +ERROR: Relation 計算機用語 Does Not Exist! +QUERY: create table 計算機用語 (用語 text, 分類コード varchar, 備考1Aだよ char(16)); +QUERY: create index 計算機用語index1 on 計算機用語 using btree (用語); +QUERY: create index 計算機用語index2 on 計算機用語 using hash (分類コード); +QUERY: insert into 計算機用語 values('コンピュータディスプレイ','機A01上'); +QUERY: insert into 計算機用語 values('コンピュータグラフィックス','分B10中'); +QUERY: insert into 計算機用語 values('コンピュータプログラマー','人Z01下'); +QUERY: vacuum 計算機用語; +QUERY: select * from 計算機用語; +用語 |分類コード|備考1aだよ +--------------------------+----------+---------- +コンピュータディスプレイ |機A01上 | +コンピュータグラフィックス|分B10中 | +コンピュータプログラマー |人Z01下 | +(3 rows) + +QUERY: select * from 計算機用語 where 分類コード = '人Z01下'; +用語 |分類コード|備考1aだよ +------------------------+----------+---------- +コンピュータプログラマー|人Z01下 | +(1 row) + +QUERY: select * from 計算機用語 where 分類コード ~* '人z01下'; +用語 |分類コード|備考1aだよ +------------------------+----------+---------- +コンピュータプログラマー|人Z01下 | +(1 row) + +QUERY: select * from 計算機用語 where 分類コード like '_Z01_'; +用語 |分類コード|備考1aだよ +------------------------+----------+---------- +コンピュータプログラマー|人Z01下 | +(1 row) + +QUERY: select * from 計算機用語 where 分類コード like '_Z%'; +用語 |分類コード|備考1aだよ +------------------------+----------+---------- +コンピュータプログラマー|人Z01下 | +(1 row) + +QUERY: select * from 計算機用語 where 用語 ~ 'コンピュータ[デグ]'; +用語 |分類コード|備考1aだよ +--------------------------+----------+---------- +コンピュータディスプレイ |機A01上 | +コンピュータグラフィックス|分B10中 | +(2 rows) + +QUERY: select * from 計算機用語 where 用語 ~* 'コンピュータ[デグ]'; +用語 |分類コード|備考1aだよ +--------------------------+----------+---------- +コンピュータディスプレイ |機A01上 | +コンピュータグラフィックス|分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/mb/expected/euc_kr.out b/src/test/mb/expected/euc_kr.out new file mode 100644 index 00000000000..e0bf3e0e452 --- /dev/null +++ b/src/test/mb/expected/euc_kr.out @@ -0,0 +1,87 @@ +QUERY: drop table 悠潯僞遂嬢; +ERROR: Relation 悠潯僞遂嬢 Does Not Exist! +QUERY: create table 悠潯僞遂嬢 (遂嬢 text, 歛彎坪球 varchar, 搾壱1A虞姥 char(16)); +QUERY: create index 悠潯僞遂嬢index1 on 悠潯僞遂嬢 using btree (遂嬢); +QUERY: create index 悠潯僞遂嬢index2 on 悠潯僞遂嬢 using hash (歛彎坪球); +QUERY: insert into 悠潯僞遂嬢 values('陳濃斗巨什巴傾戚', '僞A01濔'); +QUERY: insert into 悠潯僞遂嬢 values('陳濃斗益掘波什', '歛B10驩'); +QUERY: insert into 悠潯僞遂嬢 values('陳濃斗覗稽益掘袴', '賺Z01'); +QUERY: vacuum 悠潯僞遂嬢; +QUERY: select * from 悠潯僞遂嬢; +遂嬢 |歛彎坪球|搾壱1a虞姥 +----------------+--------+---------- +陳濃斗巨什巴傾戚|僞A01濔 | +陳濃斗益掘波什 |歛B10驩 | +陳濃斗覗稽益掘袴|賺Z01 | +(3 rows) + +QUERY: select * from 悠潯僞遂嬢 where 歛彎坪球 = '賺Z01'; +遂嬢 |歛彎坪球|搾壱1a虞姥 +----------------+--------+---------- +陳濃斗覗稽益掘袴|賺Z01 | +(1 row) + +QUERY: select * from 悠潯僞遂嬢 where 歛彎坪球 ~* '賺z01'; +遂嬢 |歛彎坪球|搾壱1a虞姥 +----------------+--------+---------- +陳濃斗覗稽益掘袴|賺Z01 | +(1 row) + +QUERY: select * from 悠潯僞遂嬢 where 歛彎坪球 like '_Z01_'; +遂嬢 |歛彎坪球|搾壱1a虞姥 +----------------+--------+---------- +陳濃斗覗稽益掘袴|賺Z01 | +(1 row) + +QUERY: select * from 悠潯僞遂嬢 where 歛彎坪球 like '_Z%'; +遂嬢 |歛彎坪球|搾壱1a虞姥 +----------------+--------+---------- +陳濃斗覗稽益掘袴|賺Z01 | +(1 row) + +QUERY: select * from 悠潯僞遂嬢 where 遂嬢 ~ '陳濃斗[巨益]'; +遂嬢 |歛彎坪球|搾壱1a虞姥 +----------------+--------+---------- +陳濃斗巨什巴傾戚|僞A01濔 | +陳濃斗益掘波什 |歛B10驩 | +(2 rows) + +QUERY: select * from 悠潯僞遂嬢 where 遂嬢 ~* '陳濃斗[巨益]'; +遂嬢 |歛彎坪球|搾壱1a虞姥 +----------------+--------+---------- +陳濃斗巨什巴傾戚|僞A01濔 | +陳濃斗益掘波什 |歛B10驩 | +(2 rows) + +QUERY: select *,character_length(遂嬢) from 悠潯僞遂嬢; +遂嬢 |歛彎坪球|搾壱1a虞姥|length +----------------+--------+----------+------ +陳濃斗巨什巴傾戚|僞A01濔 | | 8 +陳濃斗益掘波什 |歛B10驩 | | 7 +陳濃斗覗稽益掘袴|賺Z01 | | 8 +(3 rows) + +QUERY: select *,octet_length(遂嬢) from 悠潯僞遂嬢; +遂嬢 |歛彎坪球|搾壱1a虞姥|octet_length +----------------+--------+----------+------------ +陳濃斗巨什巴傾戚|僞A01濔 | | 16 +陳濃斗益掘波什 |歛B10驩 | | 14 +陳濃斗覗稽益掘袴|賺Z01 | | 16 +(3 rows) + +QUERY: select *,position('巨' in 遂嬢) from 悠潯僞遂嬢; +遂嬢 |歛彎坪球|搾壱1a虞姥|strpos +----------------+--------+----------+------ +陳濃斗巨什巴傾戚|僞A01濔 | | 4 +陳濃斗益掘波什 |歛B10驩 | | 0 +陳濃斗覗稽益掘袴|賺Z01 | | 0 +(3 rows) + +QUERY: select *,substring(遂嬢 from 3 for 4) from 悠潯僞遂嬢; +遂嬢 |歛彎坪球|搾壱1a虞姥|substr +----------------+--------+----------+-------- +陳濃斗巨什巴傾戚|僞A01濔 | |斗巨什巴 +陳濃斗益掘波什 |歛B10驩 | |斗益掘波 +陳濃斗覗稽益掘袴|賺Z01 | |斗覗稽益 +(3 rows) + diff --git a/src/test/mb/expected/mule_internal.out b/src/test/mb/expected/mule_internal.out new file mode 100644 index 00000000000..da81d55a4ed --- /dev/null +++ b/src/test/mb/expected/mule_internal.out @@ -0,0 +1,333 @@ +QUERY: drop table 計算機用語; +ERROR: Relation 計算機用語 Does Not Exist! +QUERY: create table 計算機用語 (用語 text, 分類コード varchar, 備考1Aだよ char(16)); +QUERY: create index 計算機用語index1 on 計算機用語 using btree (用語); +QUERY: create index 計算機用語index2 on 計算機用語 using hash (分類コード); +QUERY: insert into 計算機用語 values('コンピュータディスプレイ','機A01上'); +QUERY: insert into 計算機用語 values('コンピュータグラフィックス','分B10中'); +QUERY: insert into 計算機用語 values('コンピュータプログラマー','人Z01下'); +QUERY: vacuum 計算機用語; +QUERY: select * from 計算機用語; +用語 |分類コード|備考1aだよ +---------------------------------------+---------------+-------------- +コンピュータディスプレイ |機A01上 | +コンピュータグラフィックス|分B10中 | +コンピュータプログラマー |人Z01下 | +(3 rows) + +QUERY: select * from 計算機用語 where 分類コード = '人Z01下'; +用語 |分類コード|備考1aだよ +------------------------------------+---------------+-------------- +コンピュータプログラマー|人Z01下 | +(1 row) + +QUERY: select * from 計算機用語 where 分類コード ~* '人z01下'; +用語 |分類コード|備考1aだよ +------------------------------------+---------------+-------------- +コンピュータプログラマー|人Z01下 | +(1 row) + +QUERY: select * from 計算機用語 where 分類コード like '_Z01_'; +用語 |分類コード|備考1aだよ +------------------------------------+---------------+-------------- +コンピュータプログラマー|人Z01下 | +(1 row) + +QUERY: select * from 計算機用語 where 分類コード like '_Z%'; +用語 |分類コード|備考1aだよ +------------------------------------+---------------+-------------- +コンピュータプログラマー|人Z01下 | +(1 row) + +QUERY: select * from 計算機用語 where 用語 ~ 'コンピュータ[デグ]'; +用語 |分類コード|備考1aだよ +---------------------------------------+---------------+-------------- +コンピュータディスプレイ |機A01上 | +コンピュータグラフィックス|分B10中 | +(2 rows) + +QUERY: select * from 計算機用語 where 用語 ~* 'コンピュータ[デグ]'; +用語 |分類コード|備考1aだよ +---------------------------------------+---------------+-------------- +コンピュータディスプレイ |機A01上 | +コンピュータグラフィックス|分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上 | | 36 +コンピュータグラフィックス|分B10中 | | 39 +コンピュータプログラマー |人Z01下 | | 36 +(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) + +QUERY: drop table 柴麻字宝囂; +ERROR: Relation 柴麻字宝囂 Does Not Exist! +QUERY: create table 柴麻字宝囂(宝囂 text, 蛍窃催 varchar, 姥廣1A char(16)); +QUERY: create index 柴麻字宝囂index1 on 柴麻字宝囂 using btree(宝囂); +QUERY: create index 柴麻字宝囂index2 on 柴麻字宝囂 using btree(蛍窃催); +QUERY: insert into 柴麻字宝囂 values('窮辻幣徳','字A01貧'); +QUERY: insert into 柴麻字宝囂 values('窮辻夕侘','蛍B01嶄'); +QUERY: insert into 柴麻字宝囂 values('窮辻殻會埀','繁Z01和'); +QUERY: vacuum 柴麻字宝囂; +QUERY: select * from 柴麻字宝囂; +宝囂 |蛍窃催|姥廣1a +---------------+---------+-------- +窮辻幣徳|字A01貧| +窮辻夕侘 |蛍B01嶄| +窮辻殻會埀|繁Z01和| +(3 rows) + +QUERY: select * from 柴麻字宝囂 where 蛍窃催 = '繁Z01和'; +宝囂 |蛍窃催|姥廣1a +---------------+---------+-------- +窮辻殻會埀|繁Z01和| +(1 row) + +QUERY: select * from 柴麻字宝囂 where 蛍窃催 ~* '繁z01和'; +宝囂 |蛍窃催|姥廣1a +---------------+---------+-------- +窮辻殻會埀|繁Z01和| +(1 row) + +QUERY: select * from 柴麻字宝囂 where 蛍窃催 like '_Z01_'; +宝囂 |蛍窃催|姥廣1a +---------------+---------+-------- +窮辻殻會埀|繁Z01和| +(1 row) + +QUERY: select * from 柴麻字宝囂 where 蛍窃催 like '_Z%'; +宝囂 |蛍窃催|姥廣1a +---------------+---------+-------- +窮辻殻會埀|繁Z01和| +(1 row) + +QUERY: select * from 柴麻字宝囂 where 宝囂 ~ '窮辻[夕]'; +宝囂 |蛍窃催|姥廣1a +---------------+---------+-------- +窮辻幣徳|字A01貧| +窮辻夕侘 |蛍B01嶄| +(2 rows) + +QUERY: select * from 柴麻字宝囂 where 宝囂 ~* '窮辻[夕]'; +宝囂 |蛍窃催|姥廣1a +---------------+---------+-------- +窮辻幣徳|字A01貧| +窮辻夕侘 |蛍B01嶄| +(2 rows) + +QUERY: select *,character_length(宝囂) from 柴麻字宝囂; +宝囂 |蛍窃催|姥廣1a|length +---------------+---------+--------+------ +窮辻幣徳|字A01貧| | 5 +窮辻夕侘 |蛍B01嶄| | 4 +窮辻殻會埀|繁Z01和| | 5 +(3 rows) + +QUERY: select *,octet_length(宝囂) from 柴麻字宝囂; +宝囂 |蛍窃催|姥廣1a|octet_length +---------------+---------+--------+------------ +窮辻幣徳|字A01貧| | 15 +窮辻夕侘 |蛍B01嶄| | 12 +窮辻殻會埀|繁Z01和| | 15 +(3 rows) + +QUERY: select *,position('' in 宝囂) from 柴麻字宝囂; +宝囂 |蛍窃催|姥廣1a|strpos +---------------+---------+--------+------ +窮辻幣徳|字A01貧| | 3 +窮辻夕侘 |蛍B01嶄| | 0 +窮辻殻會埀|繁Z01和| | 0 +(3 rows) + +QUERY: select *,substring(宝囂 from 3 for 4) from 柴麻字宝囂; +宝囂 |蛍窃催|姥廣1a|substr +---------------+---------+--------+--------- +窮辻幣徳|字A01貧| |幣徳 +窮辻夕侘 |蛍B01嶄| |夕侘 +窮辻殻會埀|繁Z01和| |殻會埀 +(3 rows) + +QUERY: drop table 悠潯僞遂嬢; +ERROR: Relation 悠潯僞遂嬢 Does Not Exist! +QUERY: create table 悠潯僞遂嬢 (遂嬢 text, 歛彎坪球 varchar, 搾壱1A虞姥 char(16)); +QUERY: create index 悠潯僞遂嬢index1 on 悠潯僞遂嬢 using btree (遂嬢); +QUERY: create index 悠潯僞遂嬢index2 on 悠潯僞遂嬢 using hash (歛彎坪球); +QUERY: insert into 悠潯僞遂嬢 values('陳濃斗巨什巴傾戚', '僞A01濔'); +QUERY: insert into 悠潯僞遂嬢 values('陳濃斗益掘波什', '歛B10驩'); +QUERY: insert into 悠潯僞遂嬢 values('陳濃斗覗稽益掘袴', '賺Z01'); +QUERY: vacuum 悠潯僞遂嬢; +QUERY: select * from 悠潯僞遂嬢; +遂嬢 |歛彎坪球|搾壱1a虞姥 +------------------------+------------+-------------- +陳濃斗巨什巴傾戚|僞A01濔 | +陳濃斗益掘波什 |歛B10驩 | +陳濃斗覗稽益掘袴|賺Z01 | +(3 rows) + +QUERY: select * from 悠潯僞遂嬢 where 歛彎坪球 = '賺Z01'; +遂嬢 |歛彎坪球|搾壱1a虞姥 +------------------------+------------+-------------- +陳濃斗覗稽益掘袴|賺Z01 | +(1 row) + +QUERY: select * from 悠潯僞遂嬢 where 歛彎坪球 ~* '賺z01'; +遂嬢 |歛彎坪球|搾壱1a虞姥 +------------------------+------------+-------------- +陳濃斗覗稽益掘袴|賺Z01 | +(1 row) + +QUERY: select * from 悠潯僞遂嬢 where 歛彎坪球 like '_Z01_'; +遂嬢 |歛彎坪球|搾壱1a虞姥 +------------------------+------------+-------------- +陳濃斗覗稽益掘袴|賺Z01 | +(1 row) + +QUERY: select * from 悠潯僞遂嬢 where 歛彎坪球 like '_Z%'; +遂嬢 |歛彎坪球|搾壱1a虞姥 +------------------------+------------+-------------- +陳濃斗覗稽益掘袴|賺Z01 | +(1 row) + +QUERY: select * from 悠潯僞遂嬢 where 遂嬢 ~ '陳濃斗[巨益]'; +遂嬢 |歛彎坪球|搾壱1a虞姥 +------------------------+------------+-------------- +陳濃斗巨什巴傾戚|僞A01濔 | +陳濃斗益掘波什 |歛B10驩 | +(2 rows) + +QUERY: select * from 悠潯僞遂嬢 where 遂嬢 ~* '陳濃斗[巨益]'; +遂嬢 |歛彎坪球|搾壱1a虞姥 +------------------------+------------+-------------- +陳濃斗巨什巴傾戚|僞A01濔 | +陳濃斗益掘波什 |歛B10驩 | +(2 rows) + +QUERY: select *,character_length(遂嬢) from 悠潯僞遂嬢; +遂嬢 |歛彎坪球|搾壱1a虞姥|length +------------------------+------------+--------------+------ +陳濃斗巨什巴傾戚|僞A01濔 | | 8 +陳濃斗益掘波什 |歛B10驩 | | 7 +陳濃斗覗稽益掘袴|賺Z01 | | 8 +(3 rows) + +QUERY: select *,octet_length(遂嬢) from 悠潯僞遂嬢; +遂嬢 |歛彎坪球|搾壱1a虞姥|octet_length +------------------------+------------+--------------+------------ +陳濃斗巨什巴傾戚|僞A01濔 | | 24 +陳濃斗益掘波什 |歛B10驩 | | 21 +陳濃斗覗稽益掘袴|賺Z01 | | 24 +(3 rows) + +QUERY: select *,position('巨' in 遂嬢) from 悠潯僞遂嬢; +遂嬢 |歛彎坪球|搾壱1a虞姥|strpos +------------------------+------------+--------------+------ +陳濃斗巨什巴傾戚|僞A01濔 | | 4 +陳濃斗益掘波什 |歛B10驩 | | 0 +陳濃斗覗稽益掘袴|賺Z01 | | 0 +(3 rows) + +QUERY: select *,substring(遂嬢 from 3 for 4) from 悠潯僞遂嬢; +遂嬢 |歛彎坪球|搾壱1a虞姥|substr +------------------------+------------+--------------+------------ +陳濃斗巨什巴傾戚|僞A01濔 | |斗巨什巴 +陳濃斗益掘波什 |歛B10驩 | |斗益掘波 +陳濃斗覗稽益掘袴|賺Z01 | |斗覗稽益 +(3 rows) + +QUERY: drop table test; +ERROR: Relation test Does Not Exist! +QUERY: create table test (t text); +QUERY: insert into test values('ENGLISH'); +QUERY: insert into test values('FRANAIS'); +QUERY: insert into test values('ESPAOL'); +QUERY: insert into test values('SLENSKA'); +QUERY: insert into test values('ENGLISH FRANAIS ESPAOL SLENSKA'); +QUERY: vacuum test; +QUERY: select * from test; +t +------------------------------------ +ENGLISH +FRANAIS +ESPAOL +SLENSKA +ENGLISH FRANAIS ESPAOL SLENSKA +(5 rows) + +QUERY: select * from test where t = 'ESPAOL'; +t +-------- +ESPAOL +(1 row) + +QUERY: select * from test where t ~* 'espaol'; +t +------------------------------------ +ESPAOL +ENGLISH FRANAIS ESPAOL SLENSKA +(2 rows) + +QUERY: select *,character_length(t) from test; +t |length +------------------------------------+------ +ENGLISH | 7 +FRANAIS | 8 +ESPAOL | 7 +SLENSKA | 8 +ENGLISH FRANAIS ESPAOL SLENSKA| 33 +(5 rows) + +QUERY: select *,octet_length(t) from test; +t |octet_length +------------------------------------+------------ +ENGLISH | 7 +FRANAIS | 9 +ESPAOL | 8 +SLENSKA | 9 +ENGLISH FRANAIS ESPAOL SLENSKA| 36 +(5 rows) + +QUERY: select *,position('L' in t) from test; +t |strpos +------------------------------------+------ +ENGLISH | 4 +FRANAIS | 0 +ESPAOL | 7 +SLENSKA | 3 +ENGLISH FRANAIS ESPAOL SLENSKA| 4 +(5 rows) + +QUERY: select *,substring(t from 3 for 4) from test; +t |substr +------------------------------------+------ +ENGLISH |GLIS +FRANAIS |ANA +ESPAOL |PAO +SLENSKA |LENS +ENGLISH FRANAIS ESPAOL SLENSKA|GLIS +(5 rows) + diff --git a/src/test/mb/expected/sjis.out b/src/test/mb/expected/sjis.out new file mode 100644 index 00000000000..512678764d3 --- /dev/null +++ b/src/test/mb/expected/sjis.out @@ -0,0 +1,90 @@ +QUERY: drop table vZ@p; +QUERY: create table vZ@p (p text, R[h varchar, l1A char(16)); +QUERY: create index vZ@pindex1 on vZ@p using btree (p); +QUERY: create index vZ@pindex2 on vZ@p using hash (R[h); +QUERY: insert into vZ@p values('Rs[^fBXvC','@A01'); +QUERY: insert into vZ@p values('Rs[^OtBbNX','B10'); +QUERY: insert into vZ@p values('Rs[^vO}[','lZ01'); +QUERY: vacuum vZ@p; +QUERY: select * from vZ@p; +p |R[h|l1a +--------------------------+----------+---------- +Rs[^fBXvC |@A01 | +Rs[^OtBbNX|B10 | +Rs[^vO}[ |lZ01 | +(3 rows) + +QUERY: select * from vZ@p where R[h = 'lZ01'; +p |R[h|l1a +------------------------+----------+---------- +Rs[^vO}[|lZ01 | +(1 row) + +QUERY: select * from vZ@p where R[h ~* 'lz01'; +p |R[h|l1a +------------------------+----------+---------- +Rs[^vO}[|lZ01 | +(1 row) + +QUERY: select * from vZ@p where R[h like '_Z01_'; +p |R[h|l1a +------------------------+----------+---------- +Rs[^vO}[|lZ01 | +(1 row) + +QUERY: select * from vZ@p where R[h like '_Z%'; +p |R[h|l1a +------------------------+----------+---------- +Rs[^vO}[|lZ01 | +(1 row) + +QUERY: select * from vZ@p where p ~ 'Rs[^[fO]'; +p |R[h|l1a +--------------------------+----------+---------- +Rs[^fBXvC |@A01 | +Rs[^OtBbNX|B10 | +(2 rows) + +QUERY: select * from vZ@p where p ~* 'Rs[^[fO]'; +p |R[h|l1a +--------------------------+----------+---------- +Rs[^fBXvC |@A01 | +Rs[^OtBbNX|B10 | +(2 rows) + +QUERY: select *,character_length(p) from vZ@p; +p |R[h|l1a|length +--------------------------+----------+----------+------ +Rs[^fBXvC |@A01 | | 12 +Rs[^OtBbNX|B10 | | 13 +Rs[^vO}[ |lZ01 | | 12 +(3 rows) + +QUERY: select *,octet_length(p) from vZ@p; +p |R[h|l1a|octet_length +--------------------------+----------+----------+------------ +Rs[^fBXvC |@A01 | | 24 +Rs[^OtBbNX|B10 | | 26 +Rs[^vO}[ |lZ01 | | 24 +(3 rows) + +QUERY: select *,position('f' in p) from vZ@p; +p |R[h|l1a|strpos +--------------------------+----------+----------+------ +Rs[^fBXvC |@A01 | | 7 +Rs[^OtBbNX|B10 | | 0 +Rs[^vO}[ |lZ01 | | 0 +(3 rows) + +QUERY: select *,substring(p from 10 for 4) from vZ@p; +p |R[h|l1a|substr +--------------------------+----------+----------+-------- +Rs[^fBXvC |@A01 | |vC +Rs[^OtBbNX|B10 | |BbNX +Rs[^vO}[ |lZ01 | |}[ +(3 rows) + +QUERY: copy vZ@p to stdout; +Rs[^fBXvC @A01 \N +Rs[^OtBbNX B10 \N +Rs[^vO}[ lZ01 \N diff --git a/src/test/mb/expected/unicode.out b/src/test/mb/expected/unicode.out new file mode 100644 index 00000000000..7c5f3f782a4 --- /dev/null +++ b/src/test/mb/expected/unicode.out @@ -0,0 +1,87 @@ +QUERY: drop table 荐膊罘茯; +ERROR: Relation 荐膊罘茯 Does Not Exist! +QUERY: create table 荐膊罘茯 (茯 text, 蕁潟若 varchar, 1A char(16)); +QUERY: create index 荐膊罘茯index1 on 荐膊罘茯 using btree (茯); +QUERY: create index 荐膊罘茯index2 on 荐膊罘茯 using hash (蕁潟若); +QUERY: insert into 荐膊罘茯 values('潟潟ャ若帥c鴻','罘A01筝'); +QUERY: insert into 荐膊罘茯 values('潟潟ャ若帥違c','B10筝'); +QUERY: insert into 荐膊罘茯 values('潟潟ャ若帥違','篋Z01筝'); +QUERY: vacuum 荐膊罘茯; +QUERY: select * from 荐膊罘茯; +茯 |蕁潟若|1a +---------------------------------------+---------------+-------------- +潟潟ャ若帥c鴻 |罘A01筝 | +潟潟ャ若帥違c|B10筝 | +潟潟ャ若帥違 |篋Z01筝 | +(3 rows) + +QUERY: select * from 荐膊罘茯 where 蕁潟若 = '篋Z01筝'; +茯 |蕁潟若|1a +------------------------------------+---------------+-------------- +潟潟ャ若帥違|篋Z01筝 | +(1 row) + +QUERY: select * from 荐膊罘茯 where 蕁潟若 ~* '篋z01筝'; +茯 |蕁潟若|1a +------------------------------------+---------------+-------------- +潟潟ャ若帥違|篋Z01筝 | +(1 row) + +QUERY: select * from 荐膊罘茯 where 蕁潟若 like '_Z01_'; +茯 |蕁潟若|1a +------------------------------------+---------------+-------------- +潟潟ャ若帥違|篋Z01筝 | +(1 row) + +QUERY: select * from 荐膊罘茯 where 蕁潟若 like '_Z%'; +茯 |蕁潟若|1a +------------------------------------+---------------+-------------- +潟潟ャ若帥違|篋Z01筝 | +(1 row) + +QUERY: select * from 荐膊罘茯 where 茯 ~ '潟潟ャ若[]'; +茯 |蕁潟若|1a +---------------------------------------+---------------+-------------- +潟潟ャ若帥c鴻 |罘A01筝 | +潟潟ャ若帥違c|B10筝 | +(2 rows) + +QUERY: select * from 荐膊罘茯 where 茯 ~* '潟潟ャ若[]'; +茯 |蕁潟若|1a +---------------------------------------+---------------+-------------- +潟潟ャ若帥c鴻 |罘A01筝 | +潟潟ャ若帥違c|B10筝 | +(2 rows) + +QUERY: select *,character_length(茯) from 荐膊罘茯; +茯 |蕁潟若|1a|length +---------------------------------------+---------------+--------------+------ +潟潟ャ若帥c鴻 |罘A01筝 | | 12 +潟潟ャ若帥違c|B10筝 | | 13 +潟潟ャ若帥違 |篋Z01筝 | | 12 +(3 rows) + +QUERY: select *,octet_length(茯) from 荐膊罘茯; +茯 |蕁潟若|1a|octet_length +---------------------------------------+---------------+--------------+------------ +潟潟ャ若帥c鴻 |罘A01筝 | | 36 +潟潟ャ若帥違c|B10筝 | | 39 +潟潟ャ若帥違 |篋Z01筝 | | 36 +(3 rows) + +QUERY: select *,position('' in 茯) from 荐膊罘茯; +茯 |蕁潟若|1a|strpos +---------------------------------------+---------------+--------------+------ +潟潟ャ若帥c鴻 |罘A01筝 | | 7 +潟潟ャ若帥違c|B10筝 | | 0 +潟潟ャ若帥違 |篋Z01筝 | | 0 +(3 rows) + +QUERY: select *,substring(茯 from 10 for 4) from 荐膊罘茯; +茯 |蕁潟若|1a|substr +---------------------------------------+---------------+--------------+------------ +潟潟ャ若帥c鴻 |罘A01筝 | | +潟潟ャ若帥違c|B10筝 | |c +潟潟ャ若帥違 |篋Z01筝 | | +(3 rows) + diff --git a/src/test/mb/mbregress.sh b/src/test/mb/mbregress.sh new file mode 100644 index 00000000000..cb376122ab0 --- /dev/null +++ b/src/test/mb/mbregress.sh @@ -0,0 +1,48 @@ +#! /bin/sh +# $Header: /cvsroot/pgsql/src/test/mb/mbregress.sh,v 1.1 1998/07/24 03:32:40 scrappy Exp $ + +if echo '\c' | grep -s c >/dev/null 2>&1 +then + ECHO_N="echo -n" + ECHO_C="" +else + ECHO_N="echo" + ECHO_C='\c' +fi + +PSQL="psql -n -e -q" +tests="euc_jp sjis euc_kr euc_cn unicode mule_internal" +unset PGCLIENTENCODING +for i in $tests +do + $ECHO_N "${i} .. " $ECHO_C + + if [ $i = sjis ];then + PGCLIENTENCODING=SJIS + export PGCLIENTENCODING + $PSQL euc_jp < sql/sjis.sql > results/sjis.out 2>&1 + unset PGCLIENTENCODING + else + destroydb $i >/dev/null 2>&1 + createdb -E `echo $i|tr "[a-z]" "[A-Z]"` $i + $PSQL $i < sql/${i}.sql > results/${i}.out 2>&1 + fi + + if [ -f expected/${i}-${SYSTEM}.out ] + then + EXPECTED="expected/${i}-${SYSTEM}.out" + else + EXPECTED="expected/${i}.out" + fi + + if [ `diff ${EXPECTED} results/${i}.out | wc -l` -ne 0 ] + then + ( diff -wC3 ${EXPECTED} results/${i}.out; \ + echo ""; \ + echo "----------------------"; \ + echo "" ) >> regression.diffs + echo failed + else + echo ok + fi +done diff --git a/src/test/mb/sql/euc_cn.sql b/src/test/mb/sql/euc_cn.sql new file mode 100644 index 00000000000..7cd0b9b0e25 --- /dev/null +++ b/src/test/mb/sql/euc_cn.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 btree(蛍窃催); +insert into 柴麻字宝囂 values('窮辻塋焼','字A01貧'); +insert into 柴麻字宝囂 values('窮辻夕侘','蛍B01嶄'); +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 3 for 4) from 柴麻字宝囂; diff --git a/src/test/mb/sql/euc_jp.sql b/src/test/mb/sql/euc_jp.sql new file mode 100644 index 00000000000..2021205bf45 --- /dev/null +++ b/src/test/mb/sql/euc_jp.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 計算機用語; diff --git a/src/test/mb/sql/euc_kr.sql b/src/test/mb/sql/euc_kr.sql new file mode 100644 index 00000000000..cf9e07fd1c6 --- /dev/null +++ b/src/test/mb/sql/euc_kr.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 3 for 4) from 悠潯僞遂嬢; diff --git a/src/test/mb/sql/mule_internal.sql b/src/test/mb/sql/mule_internal.sql new file mode 100644 index 00000000000..2e381f0f7ed --- /dev/null +++ b/src/test/mb/sql/mule_internal.sql @@ -0,0 +1,72 @@ +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 計算機用語; +drop table 柴麻字宝囂; +create table 柴麻字宝囂(宝囂 text, 蛍窃催 varchar, 姥廣1A char(16)); +create index 柴麻字宝囂index1 on 柴麻字宝囂 using btree(宝囂); +create index 柴麻字宝囂index2 on 柴麻字宝囂 using btree(蛍窃催); +insert into 柴麻字宝囂 values('窮辻幣徳','字A01貧'); +insert into 柴麻字宝囂 values('窮辻夕侘','蛍B01嶄'); +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 3 for 4) from 柴麻字宝囂; +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 3 for 4) from 悠潯僞遂嬢; +drop table test; +create table test (t text); +insert into test values('ENGLISH'); +insert into test values('FRANAIS'); +insert into test values('ESPAOL'); +insert into test values('SLENSKA'); +insert into test values('ENGLISH FRANAIS ESPAOL SLENSKA'); +vacuum test; +select * from test; +select * from test where t = 'ESPAOL'; +select * from test where t ~* 'espaol'; +select *,character_length(t) from test; +select *,octet_length(t) from test; +select *,position('L' in t) from test; +select *,substring(t from 3 for 4) from test; diff --git a/src/test/mb/sql/sjis.sql b/src/test/mb/sql/sjis.sql new file mode 100644 index 00000000000..dfa66fcb79c --- /dev/null +++ b/src/test/mb/sql/sjis.sql @@ -0,0 +1,20 @@ +drop table vZ@p; +create table vZ@p (p text, R[h varchar, l1A char(16)); +create index vZ@pindex1 on vZ@p using btree (p); +create index vZ@pindex2 on vZ@p using hash (R[h); +insert into vZ@p values('Rs[^fBXvC','@A01'); +insert into vZ@p values('Rs[^OtBbNX','B10'); +insert into vZ@p values('Rs[^vO}[','lZ01'); +vacuum vZ@p; +select * from vZ@p; +select * from vZ@p where R[h = 'lZ01'; +select * from vZ@p where R[h ~* 'lz01'; +select * from vZ@p where R[h like '_Z01_'; +select * from vZ@p where R[h like '_Z%'; +select * from vZ@p where p ~ 'Rs[^[fO]'; +select * from vZ@p where p ~* 'Rs[^[fO]'; +select *,character_length(p) from vZ@p; +select *,octet_length(p) from vZ@p; +select *,position('f' in p) from vZ@p; +select *,substring(p from 10 for 4) from vZ@p; +copy vZ@p to stdout; diff --git a/src/test/mb/sql/unicode.sql b/src/test/mb/sql/unicode.sql new file mode 100644 index 00000000000..e722d3d0dd6 --- /dev/null +++ b/src/test/mb/sql/unicode.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('潟潟ャ若帥c鴻','罘A01筝'); +insert into 荐膊罘茯 values('潟潟ャ若帥違c','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 荐膊罘茯; |