test002.ksh

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

KSH
69
字号
#!/bin/sh# TestCase:# create table with two fields and index on first field# insert 1000 tuple# check number of tuples, totalPagesused# check pagesUsed for storing hash bucket# check number of index nodes, pagesUsed for storing index nodes# delete 1000 tuple# check number of tuples, totalPagesused# check pagesUsed for storing hash bucket# check number of index nodes, pagesUsed for storing index nodes#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}/insert1000echo "Tuples inserted into table"echo "Case 1: -T option for t1: with 1000 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 1000 tuple"$CSQL_INSTALL_ROOT/bin/catalog -u root -p manager -I t1idx1if [ $? -ne 0 ]then   exit 2;fi${REL_PATH}/delete1000echo "Tuples deleted from table"echo "Case 3: -T option for t1: after removing 1000 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 1000 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 + -
显示快捷键?