# lang情報のついた全文索引のテスト(sectionized, delayed, あとづけ)

Begin;
Initialize;
InitializeSession "DefaultDB";

# 表を作成
Command "create table T (N int, C ntext array [no limit], L language array [no limit])";

#insert
CreatePreparedCommand "ins" "insert into T (N, C, L) values (?, ?, ?)";
PreparedCommand "ins" [0, [null, null], [null, null]];
PreparedCommand "ins" [1, [null, textucsfile "..\\..\\doc\\takekurabe.txt"],
			  [null, null]];
PreparedCommand "ins" [2, [textucsfile "..\\..\\doc\\takekurabe.txt", null], 
			  [null, null]];
PreparedCommand "ins" [3, [textucsfile "..\\..\\doc\\takekurabe.txt",
		           textucsfile "..\\..\\doc\\takekurabe.txt"],
			  [null, null]];
ErasePreparedCommand "ins";


# 以下の索引作成は全て失敗する
# -> 仕様変更で成功するようになったので毎回drop indexする (040824 horibe)
Command "update T set L=?" [["ja+en", null]];

Command "create fulltext index FTIndex on T(C) language column L hint 'sectionized, delayed, in
verted=(normalized=true, indexing=word, tokenizer=DUAL:JAP:ALL:1 @NORMRSCID:1 @UNARSCID:1)'";

Command "update T set L=?" [[null, "ja+en"]];

Command "drop index FTIndex";

Command "create fulltext index FTIndex on T(C) language column L hint 'sectionized, delayed, inverted=(normalized=true, indexing=word, tokenizer=DUAL:JAP:ALL:1 @NORMRSCID:1 @UNARSCID:1)'";

Command "update T set L=?" [[null, null]];

Command "drop index FTIndex";

Command "create fulltext index FTIndex on T(C) language column L hint 'sectionized, delayed, inverted=(normalized=true, indexing=word, tokenizer=DUAL:JAP:ALL:1 @NORMRSCID:1 @UNARSCID:1)'";

Command "verify table T cascade continue";

# 全文ファイルテスト用の表を消去
Command "drop table T";

TerminateSession;
Terminate;
End;

