test001.ksh

来自「b树实现源码,linux和unix下运行,速度快,极好用」· KSH 代码 · 共 80 行

KSH
80
字号
#!/bin/sh# TestCase:# create table with two fields and index on first field# insert 1 tuple# check number of tuples, totalPagesused# check pagesUsed for storing hash bucket# check number of index nodes, pagesUsed for storing index nodes# delete 1 tuple# check number of tuples, totalPagesused# check pagesUsed for storing hash bucket# check number of index nodes, pagesUsed for storing index nodes# Note: spaceused for table = noOfDataNodes * sizeofTuple + noOfPages * sizeofPageInfo#Note:Thats why we see spaceused as 16 even when no tuple exist#Run this test only under csql/test or on this directory.#Otherwise, it may failEXECUTABLE=${PWD}/system/Allocator/createREL_PATH=.if [ -s "$EXECUTABLE" ]then    REL_PATH=${PWD}/system/Allocatorfi${REL_PATH}/createif [ $? -ne 0 ]then   exit 100;fiecho "Tables and Indexes are created"${REL_PATH}/insert1if [ $? -ne 1 ]then   exit 100;fiecho "Tuples inserted into table"echo "Case 1: -T option for t1: with 1 tuple"$CSQL_INSTALL_ROOT/bin/catalog -u root -p manager -T t1if [ $? -ne 0 ]then   exit 1;fiecho "Case 2: -I option for idx1 of t1, with 1 tuple"$CSQL_INSTALL_ROOT/bin/catalog -u root -p manager -I t1idx1if [ $? -ne 0 ]then   exit 2;fi${REL_PATH}/delete1if [ $? -ne 1 ]then   exit 100;fiecho "Tuples deleted from table"echo "Case 3: -T option for t1: after removing 1 tuple"$CSQL_INSTALL_ROOT/bin/catalog -u root -p manager -T t1if [ $? -ne 0 ]then   exit 3;fiecho "Case 4: -I option for idx1 of t1, after removing 1 tuple"$CSQL_INSTALL_ROOT/bin/catalog -u root -p manager -I t1idx1if [ $? -ne 0 ]then   exit 4;fi${REL_PATH}/dropif [ $? -ne 0 ]then   exit 100;fiecho "Tables and Indexes are dropped"exit 0

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?