Begin;
Initialize;
InitializeSession "TESTDB";
Command "create database TESTDB";
TerminateSession;
InitializeSession "TESTDB";
#
# 障害票 No.1004に対応
# Btree2とBitmapとArrayの各索引のchar列やvarchar列に対して、
# 検索条件に2バイト文字を使うと結果が正しくないことがある。
# v16.2, v17.0用スクリプト
#
Command "create table T1(c char(4))";
Command "insert T1 values 'abc'";
Command "insert T1 values 'acb'";
Command "insert T1 values 'bac'";
Command "insert T1 values 'bca'";
Command "insert T1 values 'cab'";
Command "insert T1 values 'cba'";
Command "create table T2(c varchar(4))";
Command "insert T2 values 'abc'";
Command "insert T2 values 'acb'";
Command "insert T2 values 'bac'";
Command "insert T2 values 'bca'";
Command "insert T2 values 'cab'";
Command "insert T2 values 'cba'";
Command "create table T3(c char(4) array[no limit])";
Command "insert T3 values (array['abc'])";
Command "insert T3 values (array['acb'])";
Command "insert T3 values (array['bac'])";
Command "insert T3 values (array['bca'])";
Command "insert T3 values (array['cab'])";
Command "insert T3 values (array['cba'])";
Command "create table T4(c varchar(4) array[no limit])";
Command "insert T4 values (array['abc'])";
Command "insert T4 values (array['acb'])";
Command "insert T4 values (array['bac'])";
Command "insert T4 values (array['bca'])";
Command "insert T4 values (array['cab'])";
Command "insert T4 values (array['cba'])";
Command "create index I1 on T1(c)";
Command "create index I2 on T2(c)";
Command "select * from T1 where c = 'ちbc'";
Command "select * from T2 where c <> 'abっ'";
Command "select * from T2 where c < 'aぢc'";
Command "select * from T1 where c <= 'ちぢっ'";
Command "select * from T2 where c like 'a%c'";
Command "select * from T1 where c > 'ちcb'";
Command "select * from T2 where c >= 'acぢ'";
Command "select * from T2 where c like 'ちbc'";
Command "select * from T1 where c = 'ぢac'";
Command "select * from T2 where c <> 'baっ'";
Command "select * from T2 where c < 'bちc'";
Command "select * from T1 where c <= 'ぢちっ'";
Command "select * from T2 where c like 'a%b'";
Command "select * from T1 where c > 'ぢca'";
Command "select * from T2 where c >= 'bcち'";
Command "select * from T2 where c like 'aっb'";
Command "select * from T1 where c = 'っab'";
Command "select * from T2 where c <> 'caぢ'";
Command "select * from T2 where c < 'cちb'";
Command "select * from T1 where c <= 'っちぢ'";
Command "select * from T2 where c like 'b%c'";
Command "select * from T1 where c > 'っba'";
Command "select * from T2 where c >= 'cbち'";
Command "select * from T2 where c like 'ぢac'";
Command "select * from T1 where c > 'ちbc'";
Command "select * from T1 where c > 'abっ'";
Command "select * from T1 where c > 'aぢc'";
Command "select * from T1 where c > 'ちぢっ'";
Command "select * from T2 where c = 'ちcb'";
Command "select * from T2 where c = 'acぢ'";
Command "select * from T2 where c = 'aっb'";
Command "select * from T2 where c = 'ちっぢ'";
Command "select * from T2 where c >= 'ぢac'";
Command "select * from T2 where c >= 'baっ'";
Command "select * from T2 where c >= 'bちc'";
Command "select * from T2 where c >= 'ぢちっ'";
Command "select * from T1 where c <> 'ぢca'";
Command "select * from T1 where c <> 'bcち'";
Command "select * from T2 where c = 'bっa'";
Command "select * from T1 where c <> 'ぢっち'";
Command "select * from T1 where c > 'っab'";
Command "select * from T2 where c >= 'caぢ'";
Command "select * from T1 where c > 'cちb'";
Command "select * from T2 where c >= 'っちぢ'";
Command "select * from T2 where c = 'っba'";
Command "select * from T1 where c <> 'cbち'";
Command "select * from T2 where c = 'cぢa'";
Command "select * from T1 where c <> 'っぢち'";
Command "drop index I1";
Command "drop index I2";
Command "create bitmap index I1 on T1(c) hint 'compressed'";
Command "create bitmap index I2 on T2(c) hint 'compressed'";
Command "select * from T2 where c <> 'ちbc'";
Command "select * from T1 where c = 'abっ'";
Command "select * from T2 where c like 'b%a'";
Command "select * from T2 where c like 'bっa'";
Command "select * from T2 where c <> 'ぢac'";
Command "select * from T1 where c = 'baっ'";
Command "select * from T2 where c like 'c%b'";
Command "select * from T2 where c like 'っab'";
Command "select * from T2 where c <> 'っab'";
Command "select * from T1 where c = 'caぢ'";
Command "select * from T2 where c like 'c%a'";
Command "select * from T2 where c like 'cぢa'";
Command "select * from T1 where c <> 'ちcb'";
Command "select * from T1 where c <> 'acぢ'";
Command "select * from T1 where c <> 'aっb'";
Command "select * from T1 where c <> 'ちっぢ'";
Command "select * from T2 where c = 'ぢca'";
Command "select * from T2 where c = 'bcち'";
Command "select * from T1 where c <> 'bっa'";
Command "select * from T2 where c = 'ぢっち'";
Command "select * from T1 where c <> 'っba'";
Command "select * from T2 where c = 'cbち'";
Command "select * from T1 where c <> 'cぢa'";
Command "select * from T2 where c = 'っぢち'";
Command "drop index I1";
Command "drop index I2";
Command "create bitmap index I3 on T3(c) hint 'compressed'";
Command "create bitmap index I4 on T4(c) hint 'compressed'";
Command "select * from T4 where c[] = 'aぢc'";
Command "select * from T3 where c[] <> 'ちぢっ'";
Command "select * from T3 where c[] like 'a_c'";
Command "select * from T3 where c[] like 'ちb%'";
Command "select * from T4 where c[] = 'bちc'";
Command "select * from T3 where c[] <> 'ぢちっ'";
Command "select * from T3 where c[] like 'a_b'";
Command "select * from T3 where c[] like 'aっ%'";
Command "select * from T4 where c[] = 'cちb'";
Command "select * from T3 where c[] <> 'っちぢ'";
Command "select * from T3 where c[] like 'b_c'";
Command "select * from T3 where c[] like 'ぢa%'";
Command "select * from T3 where c[] like 'ab%'";
Command "select * from T3 where c[] like 'bc%'";
Command "select * from T3 where c[] like 'abc'";
Command "select * from T3 where c[] like 'bca'";
Command "select * from T3 where c[] like 'ち_c'";
Command "select * from T3 where c[] like 'acb'";
Command "select * from T3 where c[] like 'a_ぢ'";
Command "select * from T3 where c[] like 'a%ぢ'";
Command "select * from T3 where c[] like 'ba%'";
Command "select * from T3 where c[] like 'bac'";
Command "select * from T3 where c[] like 'ぢ_c'";
Command "select * from T3 where c[] like 'ぢ%c'";
Command "drop index I3";
Command "drop index I4";
Command "create array index I3 on T3(c)";
Command "create array index I4 on T4(c)";
Command "select * from T4 where c[] <= 'ちbc'";
Command "select * from T3 where c[] < 'abっ'";
Command "select * from T3 where c[] <> 'aぢc'";
Command "select * from T4 where c[] = 'ちぢっ'";
Command "select * from T3 where c[] like 'b_a'";
Command "select * from T4 where c[] between 'ちcb' and 'ちcb'";
Command "select * from T3 where c[] >= 'aっb'";
Command "select * from T4 where c[] > 'ちっぢ'";
Command "select * from T3 where c[] like 'bっ%'";
Command "select * from T4 where c[] <= 'ぢac'";
Command "select * from T3 where c[] < 'baっ'";
Command "select * from T3 where c[] <> 'bちc'";
Command "select * from T4 where c[] = 'ぢちっ'";
Command "select * from T3 where c[] like 'c_b'";
Command "select * from T4 where c[] between 'ぢca' and 'ぢca'";
Command "select * from T3 where c[] >= 'bっa'";
Command "select * from T4 where c[] > 'ぢっち'";
Command "select * from T3 where c[] like 'っa%'";
Command "select * from T4 where c[] <= 'っab'";
Command "select * from T3 where c[] < 'caぢ'";
Command "select * from T3 where c[] <> 'cちb'";
Command "select * from T4 where c[] = 'っちぢ'";
Command "select * from T3 where c[] like 'c_a'";
Command "select * from T4 where c[] between 'っba' and 'っba'";
Command "select * from T3 where c[] >= 'cぢa'";
Command "select * from T4 where c[] > 'っぢち'";
Command "select * from T3 where c[] like 'cぢ%'";
Command "select * from T4 where c[] between 'ちbc' and 'ちbc'";
Command "select * from T4 where c[] between 'abっ' and 'abっ'";
Command "select * from T4 where c[] between 'aぢc' and 'aぢc'";
Command "select * from T4 where c[] between 'ちぢっ' and 'ちぢっ'";
Command "select * from T3 where c[] <= 'ちcb'";
Command "select * from T3 where c[] <= 'acぢ'";
Command "select * from T3 where c[] <= 'aっb'";
Command "select * from T3 where c[] <= 'ちっぢ'";
Command "select * from T3 where c[] like 'b_ち'";
Command "select * from T3 where c[] like 'ち%c'";
Command "select * from T3 where c[] like 'b%ち'";
Command "select * from T3 where c[] like 'ac%'";
Command "select * from T3 where c[] like 'ca%'";
Command "select * from T3 where c[] like 'cab'";
Command "select * from T4 where c[] < 'ぢca'";
Command "select * from T4 where c[] < 'bcち'";
Command "select * from T3 where c[] <= 'bっa'";
Command "select * from T4 where c[] < 'ぢっち'";
Command "select * from T3 where c[] like 'っ_b'";
Command "select * from T3 where c[] like 'っ%b'";
Command "select * from T4 where c[] between 'っab' and 'っab'";
Command "select * from T4 where c[] between 'cちb' and 'cちb'";
Command "select * from T3 where c[] like 'cb%'";
Command "select * from T3 where c[] like 'cba'";
Command "select * from T3 where c[] <= 'っba'";
Command "select * from T4 where c[] < 'cbち'";
Command "select * from T3 where c[] <= 'cぢa'";
Command "select * from T4 where c[] < 'っぢち'";
Command "select * from T3 where c[] like 'c_ち'";
Command "select * from T3 where c[] like 'c%ち'";
Command "drop index I3";
Command "drop index I4";
Command "drop table T1";
Command "drop table T2";
Command "drop table T3";
Command "drop table T4";
TerminateSession;
InitializeSession "TESTDB";
Command "drop database TESTDB";
TerminateSession;
Terminate;
End;
