From 65faaae777a15a8794f33fc82bc3a9084ad588ed Mon Sep 17 00:00:00 2001 From: niharlcp1 Date: Wed, 26 Nov 2008 13:15:05 +0000 Subject: [PATCH] Bydefault all the indexes are hash index --- test/tools/csql/exp.test056.ksh | 11 +++++++++++ test/tools/csql/test056.ksh | 27 +++++++++++++++++++++++++++ test/tools/csql/tree11.sql | 8 ++++++++ 3 files changed, 46 insertions(+) create mode 100644 test/tools/csql/exp.test056.ksh create mode 100755 test/tools/csql/test056.ksh create mode 100644 test/tools/csql/tree11.sql diff --git a/test/tools/csql/exp.test056.ksh b/test/tools/csql/exp.test056.ksh new file mode 100644 index 00000000..814bed00 --- /dev/null +++ b/test/tools/csql/exp.test056.ksh @@ -0,0 +1,11 @@ +Statement Executed +echo create index idx1 on t1(f1) unique; +Statement Executed +echo create index idx2 on t1(f1) primary; +Statement execute failed with error -4 +echo create index idx3 on t1(f1) hash primary; +Statement execute failed with error -4 +CREATE TABLE t1 (f1 INT NOT NULL , f2 INT , f3 INT ); +CREATE INDEX idx1 on t1 ( f1 ) HASH UNIQUE; +SET AUTOCOMMIT OFF; +Statement Executed diff --git a/test/tools/csql/test056.ksh b/test/tools/csql/test056.ksh new file mode 100755 index 00000000..1ebcbe83 --- /dev/null +++ b/test/tools/csql/test056.ksh @@ -0,0 +1,27 @@ +#!/bin/sh +#Test case +#create table t1(f1 int not null,f2 int,f3 int); +#a) create unique index on the first field. +#b) create primary index on the same field. +#c) create hash primary index on the same field. +#b) and c) should fail Saying "Index on this field already exists". +# +QUITFILE=${PWD}/tools/csql/quit.sql +REL_PATH=. +if [ -s "$QUITFILE" ] +then + REL_PATH=`pwd`/tools/csql +fi + +$CSQL_INSTALL_ROOT/bin/csql -u root -p manager -s ${REL_PATH}/tree11.sql +if [ $? -ne 0 ] +then + exit 1; +fi +$CSQL_INSTALL_ROOT/bin/csqldump -T t1 +$CSQL_INSTALL_ROOT/bin/csql -u root -p manager -s ${REL_PATH}/drop.sql +if [ $? -ne 0 ] +then + exit 1; +fi + diff --git a/test/tools/csql/tree11.sql b/test/tools/csql/tree11.sql new file mode 100644 index 00000000..cf3670bf --- /dev/null +++ b/test/tools/csql/tree11.sql @@ -0,0 +1,8 @@ +create table t1(f1 int not null,f2 int,f3 int); +echo create index idx1 on t1(f1) unique; +create index idx1 on t1(f1) unique; +echo create index idx2 on t1(f1) primary; +create index idx2 on t1(f1) primary; +echo create index idx3 on t1(f1) hash primary; +create index idx3 on t1(f1) hash primary; + -- 2.11.4.GIT