#型に関するテスト
#statementが6行増えた。(020110)

Begin;
BeginTimeSpan;
Initialize;
EndTimeSpan;
InitializeSession "";

#ひととおりの型を持った表を作ってしまう
#型名の一覧はSQLParserL.lemonによる
Command "create table TypeTest(
	A nvarchar(32),
	AB nvarchar(32) array [4],
	AC nvarchar(32) array [no limit],
	AD nvarchar(32) hint heap 'compressed',
	B varchar(32),
	BB varchar(32) array [3],
	BC varchar(32) array [no limit],
	BD varchar(32) hint heap 'compressed',
	C ntext,
	CB ntext array [4],
	CC ntext array [no limit],
	CD ntext hint heap 'compressed',
	CE ntext array [4] hint heap 'compressed',
	CF ntext array [no limit] hint heap 'compressed',
	D fulltext,
	DB fulltext array [4],
	DC fulltext array [no limit],
	DD fulltext hint heap 'compressed',
	E int,
	EB int array [3],
	EC int array [no limit],
	F float,
	FB float array [3],
	FC float array [no limit],
	G datetime,
	GB datetime array [3],
	GC datetime array [no limit],
	H uniqueidentifier,
	HB uniqueidentifier array [3],
	HC uniqueidentifier array [no limit],
	I image,
	IB image array [4],
	IC image array [no limit],
	ID image hint heap 'compressed',
	J nchar(32),
	JB nchar(32) array [4],
	JC nchar(32)  array [no limit],
	JD nchar(32)  hint heap 'compressed',
	K nvarchar(32),
	KB  nvarchar(32) array [4],
	KC  nvarchar(32) array [no limit],
	KD  nvarchar(32) hint heap 'compressed',
	L binary(32),
	LB binary(32) array [4],
	LC binary(32) array [no limit],
	LD binary(32) hint heap 'compressed',
--	primary key (A)
	)";

##indexは別ファイルにするかなー。

#defaultはnonclustered
Command "create index IndexAA on TypeTest(A)";
Command "create clustered index IndexAB on TypeTest(A)";
#Command "create fulltext index IndexAC on TypeTest(A)";

##同様の索引を、可能ならば全ての文字型の列に対してつけ、さらに何か文字列を入れて検索してみる。
Command "create fulltext index IndexC1 on TypeTest(C)";
Command "create fulltext index IndexC2 on TypeTest(CC) hint 'sectionized'";
Command "create fulltext index IndexC3 on TypeTest(C) hint 'delayed'";
Command "create fulltext index IndexC4 on TypeTest(CC) hint 'sectionized delayed'";

Pause;

Command "insert into TypeTest (C) values ?" [string "\"\""];
Command "select * from TypeTest";

#Command "drop table TypeTest"; #付属するindecesも同時に消える

TerminateSession;
# (障害回復を試すためTerminateしない)
End;

