## -*-Mode: text; tab-width: 4; c-basic-offset: 4;-*-
## vi:set ts=4 sw=4:
##
## 8214.txt -- table 作成のテスト
##
##	TEST CONTENTS
##		table の作成、削除、変更、indexの作成を同時に行う
##
##	START CONDITIONS
##		特に無し
##		
##	END CONDITIONS
##		start 前と同じ
##
##	CHECK
##		
##
##	NOTE
##		マルチスレッド
##		正常系
##		Schema の単体テストも兼ねる
##
## Copyright (c) 2001-2003 Ricoh Company, Ltd.
## All rights reserved.
##
##		$Author$
##		$Date$
##		$Revision$
##
Begin;
BeginTimeSpan;
Initialize;
EndTimeSpan;

# 準備

InitializeSession "";
Command "create database DB_xxxx";
TerminateSession;

InitializeSession "DB_xxxx";
Command "create area TBL_AREA 'd:\\dm\\area\\table'";
TerminateSession;

InitializeSession 1 "DB_xxxx";
InitializeSession 2 "DB_xxxx";
InitializeSession 3 "DB_xxxx";
InitializeSession 4 "DB_xxxx";

# 作成、削除、変更、表への挿入を同時に行う。
# 実行順序制御できないので結果は違う場合が多い。
# デッドロックにならなければ良い。(順序によってERRORが出てもよい)

CreateThread "CreateTable";
CreateThread "Alter";
CreateThread "Drop";
CreateThread "CreateIndex";
JoinThread "CreateTable";
JoinThread "Alter";
JoinThread "Drop";
JoinThread "CreateIndex";

TerminateSession 1;
TerminateSession 2;
TerminateSession 3;
TerminateSession 4;

# 後片付け
#InitializeSession "DB_xxxx";
#Command "drop database DB_xxxx";
#TerminateSession;

#System "rm -rf d:\\dm\\area";

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

#--------------------------------------------------------------------------------

#create table
CreateTable
{
Command 1 "create table TBL1 (C int)";
}

#alter table area
Alter
{
Command 2 "alter table TBL1 set area TBL_AREA";
}

#drop table
Drop
{
Command 3 "drop table TBL1";
}

#create table
CreateIndex
{
Command 4 "create index IDX1 on TBL1(C)";
Command 4 "create index IDX2 on TBL1(C)";
Command 4 "create index IDX3 on TBL1(C)";
}

