From 30ed040585f6497dcbdfe8b204643a819aad2d8f Mon Sep 17 00:00:00 2001 From: prabatuty Date: Sat, 6 Nov 2010 06:00:14 +0000 Subject: [PATCH] adding test scripts --- test/phptests/autocommit_rollback_commit.php | 113 +++++++++++++ test/phptests/autoincrement.php | 85 ++++++++++ test/phptests/columninfo.php | 43 +++++ test/phptests/columninfo1.php | 42 +++++ test/phptests/columninfo2.php | 46 +++++ test/phptests/columninfo3.php | 45 +++++ test/phptests/columninfo4.php | 45 +++++ test/phptests/contest.php | 14 ++ test/phptests/csql.conf | 104 ++++++++++++ test/phptests/datatype.php | 240 +++++++++++++++++++++++++++ test/phptests/datatypeinfo.php | 29 ++++ test/phptests/default.php | 64 +++++++ test/phptests/dml.php | 104 ++++++++++++ test/phptests/dropindextest.php | 67 ++++++++ test/phptests/index1.php | 66 ++++++++ test/phptests/index2.php | 87 ++++++++++ test/phptests/mysqlwqtest26.php | 159 ++++++++++++++++++ test/phptests/nulltest.php | 67 ++++++++ test/phptests/odbc_error.php | 47 ++++++ test/phptests/odbc_fetch_array.php | 32 ++++ test/phptests/odbc_fetch_array1.php | 43 +++++ test/phptests/odbc_result_all.php | 64 +++++++ test/phptests/odbc_statistics.php | 32 ++++ test/phptests/odbcfree.php | 44 +++++ test/phptests/paradelete.php | 69 ++++++++ test/phptests/parainsert.php | 47 ++++++ test/phptests/paraselect.php | 72 ++++++++ test/phptests/paraupdate.php | 51 ++++++ test/phptests/primarytest.php | 55 ++++++ test/phptests/rowinfo.php | 76 +++++++++ test/phptests/test001.ksh | 17 ++ test/phptests/test002.ksh | 17 ++ test/phptests/test003.ksh | 17 ++ test/phptests/test004.ksh | 17 ++ test/phptests/test005.ksh | 17 ++ test/phptests/test006.ksh | 17 ++ test/phptests/test007.ksh | 17 ++ test/phptests/test008.ksh | 17 ++ test/phptests/test009.ksh | 17 ++ test/phptests/test010.ksh | 17 ++ test/phptests/test011.ksh | 18 ++ test/phptests/test012.ksh | 18 ++ test/phptests/test013.ksh | 17 ++ test/phptests/test014.ksh | 17 ++ test/phptests/test015.ksh | 17 ++ test/phptests/test016.ksh | 17 ++ test/phptests/test017.ksh | 17 ++ test/phptests/test018.ksh | 18 ++ test/phptests/test019.ksh | 17 ++ test/phptests/test020.ksh | 17 ++ test/phptests/test021.ksh | 18 ++ test/phptests/test022.ksh | 18 ++ test/phptests/test023.ksh | 18 ++ test/phptests/test024.ksh | 18 ++ test/phptests/test025.ksh | 17 ++ test/phptests/test026.ksh | 17 ++ test/phptests/test027.ksh | 17 ++ test/phptests/test028.ksh | 17 ++ test/phptests/test029.ksh | 17 ++ test/phptests/test030.ksh | 17 ++ test/phptests/uniqueindex.php | 65 ++++++++ test/phptests/uniqueindex2.php | 87 ++++++++++ 62 files changed, 2721 insertions(+) create mode 100644 test/phptests/autocommit_rollback_commit.php create mode 100644 test/phptests/autoincrement.php create mode 100644 test/phptests/columninfo.php create mode 100644 test/phptests/columninfo1.php create mode 100644 test/phptests/columninfo2.php create mode 100644 test/phptests/columninfo3.php create mode 100644 test/phptests/columninfo4.php create mode 100644 test/phptests/contest.php create mode 100644 test/phptests/csql.conf create mode 100644 test/phptests/datatype.php create mode 100644 test/phptests/datatypeinfo.php create mode 100644 test/phptests/default.php create mode 100644 test/phptests/dml.php create mode 100644 test/phptests/dropindextest.php create mode 100644 test/phptests/index1.php create mode 100644 test/phptests/index2.php create mode 100644 test/phptests/mysqlwqtest26.php create mode 100644 test/phptests/nulltest.php create mode 100644 test/phptests/odbc_error.php create mode 100644 test/phptests/odbc_fetch_array.php create mode 100644 test/phptests/odbc_fetch_array1.php create mode 100644 test/phptests/odbc_result_all.php create mode 100644 test/phptests/odbc_statistics.php create mode 100644 test/phptests/odbcfree.php create mode 100644 test/phptests/paradelete.php create mode 100644 test/phptests/parainsert.php create mode 100644 test/phptests/paraselect.php create mode 100644 test/phptests/paraupdate.php create mode 100644 test/phptests/primarytest.php create mode 100644 test/phptests/rowinfo.php create mode 100755 test/phptests/test001.ksh create mode 100755 test/phptests/test002.ksh create mode 100755 test/phptests/test003.ksh create mode 100755 test/phptests/test004.ksh create mode 100755 test/phptests/test005.ksh create mode 100755 test/phptests/test006.ksh create mode 100755 test/phptests/test007.ksh create mode 100755 test/phptests/test008.ksh create mode 100755 test/phptests/test009.ksh create mode 100755 test/phptests/test010.ksh create mode 100755 test/phptests/test011.ksh create mode 100755 test/phptests/test012.ksh create mode 100755 test/phptests/test013.ksh create mode 100755 test/phptests/test014.ksh create mode 100755 test/phptests/test015.ksh create mode 100755 test/phptests/test016.ksh create mode 100755 test/phptests/test017.ksh create mode 100755 test/phptests/test018.ksh create mode 100755 test/phptests/test019.ksh create mode 100755 test/phptests/test020.ksh create mode 100755 test/phptests/test021.ksh create mode 100755 test/phptests/test022.ksh create mode 100755 test/phptests/test023.ksh create mode 100755 test/phptests/test024.ksh create mode 100755 test/phptests/test025.ksh create mode 100755 test/phptests/test026.ksh create mode 100755 test/phptests/test027.ksh create mode 100755 test/phptests/test028.ksh create mode 100755 test/phptests/test029.ksh create mode 100755 test/phptests/test030.ksh create mode 100644 test/phptests/uniqueindex.php create mode 100644 test/phptests/uniqueindex2.php diff --git a/test/phptests/autocommit_rollback_commit.php b/test/phptests/autocommit_rollback_commit.php new file mode 100644 index 00000000..fec313b2 --- /dev/null +++ b/test/phptests/autocommit_rollback_commit.php @@ -0,0 +1,113 @@ + + +/*Testing Autocommit, Commit and rollback */ + + + + diff --git a/test/phptests/autoincrement.php b/test/phptests/autoincrement.php new file mode 100644 index 00000000..116ba3e0 --- /dev/null +++ b/test/phptests/autoincrement.php @@ -0,0 +1,85 @@ + + +/*Autoincrement testing */ + + + + + diff --git a/test/phptests/columninfo.php b/test/phptests/columninfo.php new file mode 100644 index 00000000..05dd9f21 --- /dev/null +++ b/test/phptests/columninfo.php @@ -0,0 +1,43 @@ + + +/*Testing odbc_num_fields for find out the number of fields */ + + + + diff --git a/test/phptests/columninfo1.php b/test/phptests/columninfo1.php new file mode 100644 index 00000000..35c6bd9c --- /dev/null +++ b/test/phptests/columninfo1.php @@ -0,0 +1,42 @@ + + +/*Testing odbc_field_num for find the field position of a field */ + + + + diff --git a/test/phptests/columninfo2.php b/test/phptests/columninfo2.php new file mode 100644 index 00000000..42c53bfe --- /dev/null +++ b/test/phptests/columninfo2.php @@ -0,0 +1,46 @@ + + +/* */ + + + + diff --git a/test/phptests/columninfo3.php b/test/phptests/columninfo3.php new file mode 100644 index 00000000..fa11a563 --- /dev/null +++ b/test/phptests/columninfo3.php @@ -0,0 +1,45 @@ + + +/*Testing odbc_field_type for find out the type of a field */ + + + + diff --git a/test/phptests/columninfo4.php b/test/phptests/columninfo4.php new file mode 100644 index 00000000..55c25129 --- /dev/null +++ b/test/phptests/columninfo4.php @@ -0,0 +1,45 @@ + + +/*Testing odbc_field_len for find out column length */ + + + + diff --git a/test/phptests/contest.php b/test/phptests/contest.php new file mode 100644 index 00000000..de3d24b6 --- /dev/null +++ b/test/phptests/contest.php @@ -0,0 +1,14 @@ + + +//Connection Testing + + + diff --git a/test/phptests/csql.conf b/test/phptests/csql.conf new file mode 100644 index 00000000..3fcad3e1 --- /dev/null +++ b/test/phptests/csql.conf @@ -0,0 +1,104 @@ +# CSQL System Configuration File + +#####################################Server Section######################## +#Important: For Server section parameters, make sure that the value is same for the +# server process and all the csql client process which connects to it. otherwise, +# behavior is undefined + +# Page size. Each database is logically divided into pages and allocation happens +# in this unit of pages. Increasing this value will reduce frequent allocation of pages. +PAGE_SIZE= 8192 + +#Total number of client process which can connect and work with the +# database concurrently +MAX_PROCS = 100 + +# Maximum size of the system database. +MAX_SYS_DB_SIZE=10485760 + +#Maximum size of the user database file. +MAX_DB_SIZE=335544320 + +#Shared memory key to be used by the system to create and locate system database. +SYS_DB_KEY=1199 + +#Shared memory key to be used by the system to create and locate user database. +USER_DB_KEY=2277 + +#Give full path for the log file where important system actions are stored. +LOG_FILE=/tmp/log/csql/log.out + +#The virtual memory start address at which the shared memory segment +# will be created and attached. +MAP_ADDRESS=400000000 + +#Whether to enable durability +DURABILITY=false + +#Give full path for the database file where table and record information will +#be stored for durability +DATABASE_FILE=/tmp/csql/db + +#Important: For Server section parameters, make sure that the value is same for the +# server process and all the csql client process which connects to it. otherwise, +# behavior is undefined +#####################################Client Section######################## + +#Mutex timeout interval seconds +MUTEX_TIMEOUT_SECS=0 +MUTEX_TIMEOUT_USECS=5000 +MUTEX_TIMEOUT_RETRIES=10 + +#Lock timeout interval seconds +LOCK_TIMEOUT_SECS=0 +LOCK_TIMEOUT_USECS=5000 +LOCK_TIMEOUT_RETRIES=10 + +#####################################Cache Section######################## + +#Whether to enable caching of tables from target database +CACHE_TABLE=false + +#Set cache id for multiple bidirectional cache node for single data source +SITE_ID=1 + +#DSN Name to connect to the target database. +#This should be present in ~/odbc.ini file +DSN=myodbc3 + +DBUSER= + +PASSWORD= + +ENABLE_BIDIRECTIONAL_CACHE=false + +CACHE_RECEIVER_WAIT_SECS=10 + +#Give full path for the file where all the cached table information is stored +TABLE_CONFIG_FILE=/tmp/csql/csqltable.conf + +#Mode of operation SYNC or ASYNC +CACHE_MODE=SYNC + +##########################SqlNetworkServer Section######################## + +# Whether to enable SqlNetwork server +CSQL_SQL_SERVER=false + +#Set port for Network access +PORT=5678 + +#Whether to enable Replication across the sites +REPLICATION=false + +#No of sites to replicate +REPLICATION_SITES=16 + +#Give full path for the file where all the peer site information is stored +NETWORK_CONFIG_FILE=/tmp/csql/csqlnw.conf + +# MSGKEY for creating msg queue for MsgQueue Server +MSG_KEY=2525 + +ID_SHM_KEY=1947 +######################################End Section######################## diff --git a/test/phptests/datatype.php b/test/phptests/datatype.php new file mode 100644 index 00000000..a1bd8707 --- /dev/null +++ b/test/phptests/datatype.php @@ -0,0 +1,240 @@ + + +/*Create table and with all types of datatypes,Insert one valid record It Should be Passed */ + + + + + + diff --git a/test/phptests/datatypeinfo.php b/test/phptests/datatypeinfo.php new file mode 100644 index 00000000..dbf0d887 --- /dev/null +++ b/test/phptests/datatypeinfo.php @@ -0,0 +1,29 @@ + + +/*Testing for get all Datatype info of a database with odbc_gettypeinfo()*/ + + + + diff --git a/test/phptests/default.php b/test/phptests/default.php new file mode 100644 index 00000000..d903ed14 --- /dev/null +++ b/test/phptests/default.php @@ -0,0 +1,64 @@ + + +/*Default value testing */ + + + + + diff --git a/test/phptests/dml.php b/test/phptests/dml.php new file mode 100644 index 00000000..52189637 --- /dev/null +++ b/test/phptests/dml.php @@ -0,0 +1,104 @@ + + +/*Create table and test all DML Operation on the table */ +"; +echo "ROLL"; +echo "NAME"; +echo "\nfetch started\n"; +while (odbc_fetch_row($rs)) +{ + $roll=preg_replace('/[\x00-\x09\x0B-\x19\x7F]/', '',odbc_result($rs, 1)); + $name=preg_replace('/[\x00-\x09\x0B-\x19\x7F]/', '',odbc_result($rs, 2)); + echo "$roll"; + echo "$name\n"; +} +echo ""; + +$sth = odbc_prepare($conn, "UPDATE t1 SET f2='TWELVE';"); +$res = odbc_execute($sth); +if (!$res) +{ + echo "\nError in Updation\n"; + exit(5); +} +echo "\nRecord Updated\n"; + +$sth = 'select * from t1;'; +$rs = odbc_exec($conn, $sth); +while (odbc_fetch_row($rs)) +{ + $roll=preg_replace('/[\x00-\x09\x0B-\x19\x7F]/', '',odbc_result($rs, 1)); + $name=preg_replace('/[\x00-\x09\x0B-\x19\x7F]/', '',odbc_result($rs, 2)); + echo "$roll"; + echo "$name\n"; +} +echo ""; + +$sth = odbc_prepare($conn, "DELETE FROM t1;"); +$res = odbc_execute($sth); +if (!$res) +{ + echo "\nError in Deletion\n"; + exit(6); +} +echo "\nRecord Deleted\n"; + +$sth = 'select * from t1;'; +$rs = odbc_exec($conn, $sth); +while (odbc_fetch_row($rs)) +{ + $roll=preg_replace('/[\x00-\x09\x0B-\x19\x7F]/', '',odbc_result($rs, 1)); + $name=preg_replace('/[\x00-\x09\x0B-\x19\x7F]/', '',odbc_result($rs, 2)); + echo "$roll"; + echo "$name\n"; +} +echo ""; + +$sth=odbc_prepare($conn,"DROP TABLE t1;"); +$res = odbc_execute($sth); +if (!$res) +{ + echo "\nError in Drop Table"; + exit(7); +} +echo "\nTable Dropped \nTest Passed"; +odbc_close($conn); +?> + + + diff --git a/test/phptests/dropindextest.php b/test/phptests/dropindextest.php new file mode 100644 index 00000000..8d9ab970 --- /dev/null +++ b/test/phptests/dropindextest.php @@ -0,0 +1,67 @@ + + +/* Creating table with 2 fields(say f1 int, f2 char(10)). + Create index idx1 on f1 field. Drop that index.Again create index with same name. It should be Passed. + check basic INSERT, SELECT */ + + + + + diff --git a/test/phptests/index1.php b/test/phptests/index1.php new file mode 100644 index 00000000..16542424 --- /dev/null +++ b/test/phptests/index1.php @@ -0,0 +1,66 @@ + + +/* Creating table with 3 INT fields, Create index on single field. + Create all possible composite indexes. + check basic INSERT, SELECT */ + + + + + diff --git a/test/phptests/index2.php b/test/phptests/index2.php new file mode 100644 index 00000000..e5138e78 --- /dev/null +++ b/test/phptests/index2.php @@ -0,0 +1,87 @@ + + +/* Creating table with 2 fields(int,char) + Insert some duplicate value in f1 field + Create unique index on f1 field. It should be failed saying Unique key Violation. + check basic INSERT, SELECT */ +"; +echo "F1"; +echo "F2"; +echo "\nfetch started\n"; +while (odbc_fetch_row($rs)) +{ + $roll=preg_replace('/[\x00-\x09\x0B-\x19\x7F]/', '',odbc_result($rs, 1)); + $name=preg_replace('/[\x00-\x09\x0B-\x19\x7F]/', '',odbc_result($rs, 2)); + echo "$roll"; + echo "$name\n"; +} +echo ""; + +$sth=odbc_prepare($conn,"DROP TABLE t1;"); +$res = odbc_execute($sth); +if (!$res) +{ + echo "\nError in Drop Table"; + exit(7); +} +echo "\nTable Dropped\nTest Passed"; +odbc_close($conn); +?> + + + + diff --git a/test/phptests/mysqlwqtest26.php b/test/phptests/mysqlwqtest26.php new file mode 100644 index 00000000..080d7f2e --- /dev/null +++ b/test/phptests/mysqlwqtest26.php @@ -0,0 +1,159 @@ + + + $time) + {$min = $time;} + if ($max < $time) + {$max = $time;} + $count++; + } + printf("\nInsert :%6d MIN :%4f MAX :%4f AVG :%4f microsec\n",$count,$min,$max,$timecount/$count); + +$sth = 'SELECT * FROM t1;'; +$rs = odbc_exec($conn, $sth); +if (!$rs) + {exit("Error in SQL-2");} +odbc_result_all($rs, 'border = 2'); + + $timecount = 0; + $min = 1; + $max = 0; + $time_start = 0; + $time_end = 0; + $time = 0; + $count =0; + $q = "SELECT * FROM t1 WHERE f1=?;"; + $res = odbc_prepare ($conn, $q); + for ($i = 0; $i <100; $i++) + { + $time_start = microtime(); + $a = $i; + $rs=odbc_execute($res, array($a)); + + echo ""; + echo ""; + echo ""; + while (odbc_fetch_row($rs)) + { + $roll=odbc_result($rs, 1); + $name=odbc_result($rs, 2); + echo ""; + echo "\n"; + } + echo "
ROLLNAME
$roll$name
"; + + $time_end = microtime(); + $time = $time_end - $time_start; + $timecount = $timecount + $time ; + if ($min > $time) + {$min = $time;} + if ($max < $time) + {$max = $time;} + $count++; + } + printf("\nSelect :%6d MIN :%4f MAX :%4f AVG :%4f microsec\n",$count,$min,$max,$timecount/$count); + + $timecount = 0; + $min = 1; + $max = 0; + $time_start = 0; + $time_end = 0; + $time = 0; + $count =0; + $q = "update t1 set f2=? where f1=?;"; + $res = odbc_prepare ($conn, $q); + for ($i = 0; $i <100; $i++) + { + $time_start = microtime(); + $a = "LAKSHYA_CSQL"; + $b = $i; + odbc_execute($res, array($a, $b)); + $time_end = microtime(); + $time = $time_end - $time_start; + $timecount = $timecount + $time ; + if ($min > $time) + {$min = $time;} + if ($max < $time) + {$max = $time;} + $count++; + } + printf("\nUpdate :%6d MIN :%4f MAX :%4f AVG :%4f microsec\n",$count,$min,$max,$timecount/$count); + +$sth = 'SELECT * FROM t1;'; +$rs = odbc_exec($conn, $sth); +if (!$rs) + {exit("Error in SQL-2");} +odbc_result_all($rs, 'border = 2'); + + $timecount = 0; + $min = 1; + $max = 0; + $time_start = 0; + $time_end = 0; + $time = 0; + $count =0; + $q = "DELETE FROM t1 WHERE f1=?;"; + $res = odbc_prepare ($conn, $q); + for ($i = 0; $i <100; $i++) + { + $time_start = microtime(); + $a = $i; + $rs = odbc_execute($res, array($a)); + $time_end = microtime(); + $time = $time_end - $time_start; + $timecount = $timecount + $time ; + if ($min > $time) + {$min = $time;} + if ($max < $time) + {$max = $time;} + $count++; + } + printf("\nDelete :%6d MIN :%4f MAX :%4f AVG :%4f microsec\n",$count,$min,$max,$timecount/$count); + +$sth = 'SELECT * FROM t1;'; +$rs = odbc_exec($conn, $sth); +if (!$rs) + {exit("Error in SQL-2");} +odbc_result_all($rs, 'border = 2'); + +$sth=odbc_prepare($conn,"DROP TABLE t1;"); +$res = odbc_execute($sth); +if (!$res) + {exit("\nError in Drop Table");} +echo "\nTable Dropped \nTest Passed"; +odbc_close($conn); + +?> + + diff --git a/test/phptests/nulltest.php b/test/phptests/nulltest.php new file mode 100644 index 00000000..7a94b798 --- /dev/null +++ b/test/phptests/nulltest.php @@ -0,0 +1,67 @@ + + +/* Creating table with not null constraint constraint on the int field + check basic INSERT, SELECT */ +"; +echo "F1"; +echo "F2"; +echo "\nfetch started\n"; +while (odbc_fetch_row($rs)) +{ + $roll=preg_replace('/[\x00-\x09\x0B-\x19\x7F]/', '',odbc_result($rs, 1)); + $name=preg_replace('/[\x00-\x09\x0B-\x19\x7F]/', '',odbc_result($rs, 2)); + echo "$roll"; + echo "$name\n"; +} +echo ""; + +$sth=odbc_prepare($conn,"DROP TABLE t1"); +$res = odbc_execute($sth); +if (!$res) +{ + echo "\nError in Drop Table"; + exit(5); +} +echo "\nTable Dropped\nTest Passed"; +odbc_close($conn); +?> + + + + diff --git a/test/phptests/odbc_error.php b/test/phptests/odbc_error.php new file mode 100644 index 00000000..8acd37da --- /dev/null +++ b/test/phptests/odbc_error.php @@ -0,0 +1,47 @@ + + +/*Testing odbc_error() and odbc_errormsg() for error handeling */ + + + + diff --git a/test/phptests/odbc_fetch_array.php b/test/phptests/odbc_fetch_array.php new file mode 100644 index 00000000..673c6568 --- /dev/null +++ b/test/phptests/odbc_fetch_array.php @@ -0,0 +1,32 @@ + + +/*Testing odbc_fetch_array()*/ + + + + diff --git a/test/phptests/odbc_fetch_array1.php b/test/phptests/odbc_fetch_array1.php new file mode 100644 index 00000000..121ea3b8 --- /dev/null +++ b/test/phptests/odbc_fetch_array1.php @@ -0,0 +1,43 @@ + + +/*Testing odbc_next_result, var_dump for find next result*/ + + + + diff --git a/test/phptests/odbc_result_all.php b/test/phptests/odbc_result_all.php new file mode 100644 index 00000000..feeb3617 --- /dev/null +++ b/test/phptests/odbc_result_all.php @@ -0,0 +1,64 @@ + + +/* odbc_result_all() test for display the conditional select result in formated manner. It is more advance than odbc_result() */ + + + + diff --git a/test/phptests/odbc_statistics.php b/test/phptests/odbc_statistics.php new file mode 100644 index 00000000..95963e7d --- /dev/null +++ b/test/phptests/odbc_statistics.php @@ -0,0 +1,32 @@ + + +/*Testing odbc_statistics()*/ + + + + diff --git a/test/phptests/odbcfree.php b/test/phptests/odbcfree.php new file mode 100644 index 00000000..9b4f722e --- /dev/null +++ b/test/phptests/odbcfree.php @@ -0,0 +1,44 @@ + + +/*Testing Querry Memory Free with odbc_free_result() */ + + + + diff --git a/test/phptests/paradelete.php b/test/phptests/paradelete.php new file mode 100644 index 00000000..73c12d67 --- /dev/null +++ b/test/phptests/paradelete.php @@ -0,0 +1,69 @@ + + +/*Parateterised delete*/ + + + + diff --git a/test/phptests/parainsert.php b/test/phptests/parainsert.php new file mode 100644 index 00000000..bbe94ad1 --- /dev/null +++ b/test/phptests/parainsert.php @@ -0,0 +1,47 @@ + + +/*Parateterised Insert*/ + + + + diff --git a/test/phptests/paraselect.php b/test/phptests/paraselect.php new file mode 100644 index 00000000..19223463 --- /dev/null +++ b/test/phptests/paraselect.php @@ -0,0 +1,72 @@ + + +/*Parateterised delete*/ +"; + echo "ROLL"; + echo "NAME"; + while (odbc_fetch_row($res)) + { + $roll=preg_replace('/[\x00-\x09\x0B-\x19\x7F]/', '',odbc_result($res, 1)); + $name=preg_replace('/[\x00-\x09\x0B-\x19\x7F]/', '',odbc_result($res, 2)); + echo "$roll"; + echo "$name\n"; + } + echo ""; + + +$sth=odbc_prepare($conn,"DROP TABLE t1;"); +$res = odbc_execute($sth); +if (!$res) + {exit("\nError in Drop Table");} +echo "\nTable Dropped \nTest Passed"; +odbc_close($conn); +?> + + + diff --git a/test/phptests/paraupdate.php b/test/phptests/paraupdate.php new file mode 100644 index 00000000..838e35fd --- /dev/null +++ b/test/phptests/paraupdate.php @@ -0,0 +1,51 @@ + + +/*Parameterisez update*/ + + + + diff --git a/test/phptests/primarytest.php b/test/phptests/primarytest.php new file mode 100644 index 00000000..845d0855 --- /dev/null +++ b/test/phptests/primarytest.php @@ -0,0 +1,55 @@ + + +/* Creating table with Primary key constraint constraint on the int field + check basic INSERT, SELECT */ + + + + diff --git a/test/phptests/rowinfo.php b/test/phptests/rowinfo.php new file mode 100644 index 00000000..4b5ac16f --- /dev/null +++ b/test/phptests/rowinfo.php @@ -0,0 +1,76 @@ + + +/* Testing odbc_num_rows() for display number of rows */ + \n"; +while (odbc_fetch_row($result)) +{ + $a=preg_replace('/[\x00-\x09\x0B-\x19\x7F]/', '',odbc_result($result,1)); + $b=preg_replace('/[\x00-\x09\x0B-\x19\x7F]/', '',odbc_result($result,2)); + $c=preg_replace('/[\x00-\x09\x0B-\x19\x7F]/', '',odbc_result($result,3)); + echo ""; + echo "$a$b$c"; + echo "\n"; +} +echo ""; +$sth=odbc_prepare($conn,"DROP TABLE t1;"); +$res = odbc_execute($sth); +if (!$res) +{ + echo "\nError in Drop Table"; + exit(6); +} +echo "\nTable Dropped \nTest Passed"; +odbc_close($conn); +?> + + + diff --git a/test/phptests/test001.ksh b/test/phptests/test001.ksh new file mode 100755 index 00000000..b5128e95 --- /dev/null +++ b/test/phptests/test001.ksh @@ -0,0 +1,17 @@ +#!/bin/ksh + +CSQL_CONF=${PWD}/phptests/csql.conf +REL_PATH=. +if [ -s "$CSQL_CONF" ] +then + REL_PATH=${PWD}/phptests +fi +echo $REL_PATH +php $REL_PATH/contest.php +if [ $? -ne 0 ] +then + exit 50; +fi +exit 0; + + diff --git a/test/phptests/test002.ksh b/test/phptests/test002.ksh new file mode 100755 index 00000000..a67a57c5 --- /dev/null +++ b/test/phptests/test002.ksh @@ -0,0 +1,17 @@ +#!/bin/ksh + +CSQL_CONF=${PWD}/phptests/csql.conf +REL_PATH=. +if [ -s "$CSQL_CONF" ] +then + REL_PATH=${PWD}/phptests +fi + +php $REL_PATH/dml.php +if [ $? -ne 0 ] +then + exit 50; +fi +exit 0; + + diff --git a/test/phptests/test003.ksh b/test/phptests/test003.ksh new file mode 100755 index 00000000..4dc9728e --- /dev/null +++ b/test/phptests/test003.ksh @@ -0,0 +1,17 @@ +#!/bin/ksh + +CSQL_CONF=${PWD}/phptests/csql.conf +REL_PATH=. +if [ -s "$CSQL_CONF" ] +then + REL_PATH=${PWD}/phptests +fi + +php $REL_PATH/datatype.php +if [ $? -ne 0 ] +then + exit 50; +fi +exit 0; + + diff --git a/test/phptests/test004.ksh b/test/phptests/test004.ksh new file mode 100755 index 00000000..93b985ec --- /dev/null +++ b/test/phptests/test004.ksh @@ -0,0 +1,17 @@ +#!/bin/ksh + +CSQL_CONF=${PWD}/phptests/csql.conf +REL_PATH=. +if [ -s "$CSQL_CONF" ] +then + REL_PATH=${PWD}/phptests +fi + +php $REL_PATH/nulltest.php +if [ $? -ne 0 ] +then + exit 50; +fi +exit 0; + + diff --git a/test/phptests/test005.ksh b/test/phptests/test005.ksh new file mode 100755 index 00000000..0a13c5a7 --- /dev/null +++ b/test/phptests/test005.ksh @@ -0,0 +1,17 @@ +#!/bin/ksh + +CSQL_CONF=${PWD}/phptests/csql.conf +REL_PATH=. +if [ -s "$CSQL_CONF" ] +then + REL_PATH=${PWD}/phptests +fi + +php $REL_PATH/primarytest.php +if [ $? -ne 0 ] +then + exit 50; +fi +exit 0; + + diff --git a/test/phptests/test006.ksh b/test/phptests/test006.ksh new file mode 100755 index 00000000..ca953501 --- /dev/null +++ b/test/phptests/test006.ksh @@ -0,0 +1,17 @@ +#!/bin/ksh + +CSQL_CONF=${PWD}/phptests/csql.conf +REL_PATH=. +if [ -s "$CSQL_CONF" ] +then + REL_PATH=${PWD}/phptests +fi + +php $REL_PATH/index1.php +if [ $? -ne 0 ] +then + exit 50; +fi +exit 0; + + diff --git a/test/phptests/test007.ksh b/test/phptests/test007.ksh new file mode 100755 index 00000000..422dbe2a --- /dev/null +++ b/test/phptests/test007.ksh @@ -0,0 +1,17 @@ +#!/bin/ksh + +CSQL_CONF=${PWD}/phptests/csql.conf +REL_PATH=. +if [ -s "$CSQL_CONF" ] +then + REL_PATH=${PWD}/phptests +fi + +php $REL_PATH/uniqueindex.php +if [ $? -ne 0 ] +then + exit 50; +fi +exit 0; + + diff --git a/test/phptests/test008.ksh b/test/phptests/test008.ksh new file mode 100755 index 00000000..26ab47ad --- /dev/null +++ b/test/phptests/test008.ksh @@ -0,0 +1,17 @@ +#!/bin/ksh + +CSQL_CONF=${PWD}/phptests/csql.conf +REL_PATH=. +if [ -s "$CSQL_CONF" ] +then + REL_PATH=${PWD}/phptests +fi + +php $REL_PATH/index2.php +if [ $? -ne 0 ] +then + exit 50; +fi +exit 0; + + diff --git a/test/phptests/test009.ksh b/test/phptests/test009.ksh new file mode 100755 index 00000000..0e9fa946 --- /dev/null +++ b/test/phptests/test009.ksh @@ -0,0 +1,17 @@ +#!/bin/ksh + +CSQL_CONF=${PWD}/phptests/csql.conf +REL_PATH=. +if [ -s "$CSQL_CONF" ] +then + REL_PATH=${PWD}/phptests +fi + +php $REL_PATH/uniqueindex2.php +if [ $? -ne 0 ] +then + exit 50; +fi +exit 0; + + diff --git a/test/phptests/test010.ksh b/test/phptests/test010.ksh new file mode 100755 index 00000000..5c9dc1a9 --- /dev/null +++ b/test/phptests/test010.ksh @@ -0,0 +1,17 @@ +#!/bin/ksh + +CSQL_CONF=${PWD}/phptests/csql.conf +REL_PATH=. +if [ -s "$CSQL_CONF" ] +then + REL_PATH=${PWD}/phptests +fi + +php $REL_PATH/dropindextest.php +if [ $? -ne 0 ] +then + exit 50; +fi +exit 0; + + diff --git a/test/phptests/test011.ksh b/test/phptests/test011.ksh new file mode 100755 index 00000000..a2774c44 --- /dev/null +++ b/test/phptests/test011.ksh @@ -0,0 +1,18 @@ +#!/bin/ksh + + +CSQL_CONF=${PWD}/phptests/csql.conf +REL_PATH=. +if [ -s "$CSQL_CONF" ] +then + REL_PATH=${PWD}/phptests +fi + +php $REL_PATH/autoincrement.php +if [ $? -ne 0 ] +then + exit 50; +fi +exit 0; + + diff --git a/test/phptests/test012.ksh b/test/phptests/test012.ksh new file mode 100755 index 00000000..f822feca --- /dev/null +++ b/test/phptests/test012.ksh @@ -0,0 +1,18 @@ +#!/bin/ksh + + +CSQL_CONF=${PWD}/phptests/csql.conf +REL_PATH=. +if [ -s "$CSQL_CONF" ] +then + REL_PATH=${PWD}/phptests +fi + +php $REL_PATH/default.php +if [ $? -ne 0 ] +then + exit 50; +fi +exit 0; + + diff --git a/test/phptests/test013.ksh b/test/phptests/test013.ksh new file mode 100755 index 00000000..c4f6cc1f --- /dev/null +++ b/test/phptests/test013.ksh @@ -0,0 +1,17 @@ +#!/bin/ksh + +CSQL_CONF=${PWD}/phptests/csql.conf +REL_PATH=. +if [ -s "$CSQL_CONF" ] +then + REL_PATH=${PWD}/phptests +fi + +php $REL_PATH/columninfo.php +if [ $? -ne 0 ] +then + exit 50; +fi +exit 0; + + diff --git a/test/phptests/test014.ksh b/test/phptests/test014.ksh new file mode 100755 index 00000000..85537c21 --- /dev/null +++ b/test/phptests/test014.ksh @@ -0,0 +1,17 @@ +#!/bin/ksh + +CSQL_CONF=${PWD}/phptests/csql.conf +REL_PATH=. +if [ -s "$CSQL_CONF" ] +then + REL_PATH=${PWD}/phptests +fi + +php $REL_PATH/rowinfo.php +if [ $? -ne 0 ] +then + exit 50; +fi +exit 0; + + diff --git a/test/phptests/test015.ksh b/test/phptests/test015.ksh new file mode 100755 index 00000000..4f8a3d13 --- /dev/null +++ b/test/phptests/test015.ksh @@ -0,0 +1,17 @@ +#!/bin/ksh + + +CSQL_CONF=${PWD}/phptests/csql.conf +REL_PATH=. +if [ -s "$CSQL_CONF" ] +then + REL_PATH=${PWD}/phptests +fi +php $REL_PATH/datatypeinfo.php +if [ $? -ne 0 ] +then + exit 50; +fi +exit 0; + + diff --git a/test/phptests/test016.ksh b/test/phptests/test016.ksh new file mode 100755 index 00000000..52827013 --- /dev/null +++ b/test/phptests/test016.ksh @@ -0,0 +1,17 @@ +#!/bin/ksh + +CSQL_CONF=${PWD}/phptests/csql.conf +REL_PATH=. +if [ -s "$CSQL_CONF" ] +then + REL_PATH=${PWD}/phptests +fi + +php $REL_PATH/odbc_result_all.php +if [ $? -ne 0 ] +then + exit 50; +fi +exit 0; + + diff --git a/test/phptests/test017.ksh b/test/phptests/test017.ksh new file mode 100755 index 00000000..6772431c --- /dev/null +++ b/test/phptests/test017.ksh @@ -0,0 +1,17 @@ +#!/bin/ksh + +CSQL_CONF=${PWD}/phptests/csql.conf +REL_PATH=. +if [ -s "$CSQL_CONF" ] +then + REL_PATH=${PWD}/phptests +fi + +php $REL_PATH/autocommit_rollback_commit.php +if [ $? -ne 0 ] +then + exit 50; +fi +exit 0; + + diff --git a/test/phptests/test018.ksh b/test/phptests/test018.ksh new file mode 100755 index 00000000..a8fc592a --- /dev/null +++ b/test/phptests/test018.ksh @@ -0,0 +1,18 @@ +#!/bin/ksh + + +CSQL_CONF=${PWD}/phptests/csql.conf +REL_PATH=. +if [ -s "$CSQL_CONF" ] +then + REL_PATH=${PWD}/phptests +fi + +php $REL_PATH/odbc_error.php +if [ $? -ne 0 ] +then + exit 50; +fi +exit 0; + + diff --git a/test/phptests/test019.ksh b/test/phptests/test019.ksh new file mode 100755 index 00000000..03bae506 --- /dev/null +++ b/test/phptests/test019.ksh @@ -0,0 +1,17 @@ +#!/bin/ksh + +CSQL_CONF=${PWD}/phptests/csql.conf +REL_PATH=. +if [ -s "$CSQL_CONF" ] +then + REL_PATH=${PWD}/phptests +fi + +php $REL_PATH/odbc_fetch_array.php +if [ $? -ne 0 ] +then + exit 50; +fi +exit 0; + + diff --git a/test/phptests/test020.ksh b/test/phptests/test020.ksh new file mode 100755 index 00000000..36634a38 --- /dev/null +++ b/test/phptests/test020.ksh @@ -0,0 +1,17 @@ +#!/bin/ksh + +CSQL_CONF=${PWD}/phptests/csql.conf +REL_PATH=. +if [ -s "$CSQL_CONF" ] +then + REL_PATH=${PWD}/phptests +fi + +php $REL_PATH/odbc_fetch_array1.php +if [ $? -ne 0 ] +then + exit 50; +fi +exit 0; + + diff --git a/test/phptests/test021.ksh b/test/phptests/test021.ksh new file mode 100755 index 00000000..8284b53b --- /dev/null +++ b/test/phptests/test021.ksh @@ -0,0 +1,18 @@ +#!/bin/ksh + + +CSQL_CONF=${PWD}/phptests/csql.conf +REL_PATH=. +if [ -s "$CSQL_CONF" ] +then + REL_PATH=${PWD}/phptests +fi + +php $REL_PATH/odbc_statistics.php +if [ $? -ne 0 ] +then + exit 50; +fi +exit 0; + + diff --git a/test/phptests/test022.ksh b/test/phptests/test022.ksh new file mode 100755 index 00000000..ec9e7110 --- /dev/null +++ b/test/phptests/test022.ksh @@ -0,0 +1,18 @@ +#!/bin/ksh + + +CSQL_CONF=${PWD}/phptests/csql.conf +REL_PATH=. +if [ -s "$CSQL_CONF" ] +then + REL_PATH=${PWD}/phptests +fi + +php $REL_PATH/parainsert.php +if [ $? -ne 0 ] +then + exit 50; +fi +exit 0; + + diff --git a/test/phptests/test023.ksh b/test/phptests/test023.ksh new file mode 100755 index 00000000..fb3ffd2c --- /dev/null +++ b/test/phptests/test023.ksh @@ -0,0 +1,18 @@ +#!/bin/ksh + + +CSQL_CONF=${PWD}/phptests/csql.conf +REL_PATH=. +if [ -s "$CSQL_CONF" ] +then + REL_PATH=${PWD}/phptests +fi + +php $REL_PATH/paraupdate.php +if [ $? -ne 0 ] +then + exit 50; +fi +exit 0; + + diff --git a/test/phptests/test024.ksh b/test/phptests/test024.ksh new file mode 100755 index 00000000..555928bf --- /dev/null +++ b/test/phptests/test024.ksh @@ -0,0 +1,18 @@ +#!/bin/ksh + + +CSQL_CONF=${PWD}/phptests/csql.conf +REL_PATH=. +if [ -s "$CSQL_CONF" ] +then + REL_PATH=${PWD}/phptests +fi + +php $REL_PATH/paradelete.php +if [ $? -ne 0 ] +then + exit 50; +fi +exit 0; + + diff --git a/test/phptests/test025.ksh b/test/phptests/test025.ksh new file mode 100755 index 00000000..a7403bd3 --- /dev/null +++ b/test/phptests/test025.ksh @@ -0,0 +1,17 @@ +#!/bin/ksh + +CSQL_CONF=${PWD}/phptests/csql.conf +REL_PATH=. +if [ -s "$CSQL_CONF" ] +then + REL_PATH=${PWD}/phptests +fi + +php $REL_PATH/paraselect.php +if [ $? -ne 0 ] +then + exit 50; +fi +exit 0; + + diff --git a/test/phptests/test026.ksh b/test/phptests/test026.ksh new file mode 100755 index 00000000..c92c5792 --- /dev/null +++ b/test/phptests/test026.ksh @@ -0,0 +1,17 @@ +#!/bin/ksh + + +CSQL_CONF=${PWD}/phptests/csql.conf +REL_PATH=. +if [ -s "$CSQL_CONF" ] +then + REL_PATH=${PWD}/phptests +fi +php $REL_PATH/odbcfree.php +if [ $? -ne 0 ] +then + exit 50; +fi +exit 0; + + diff --git a/test/phptests/test027.ksh b/test/phptests/test027.ksh new file mode 100755 index 00000000..44a956fc --- /dev/null +++ b/test/phptests/test027.ksh @@ -0,0 +1,17 @@ +#!/bin/ksh + +CSQL_CONF=${PWD}/phptests/csql.conf +REL_PATH=. +if [ -s "$CSQL_CONF" ] +then + REL_PATH=${PWD}/phptests +fi + +php $REL_PATH/columninfo1.php +if [ $? -ne 0 ] +then + exit 50; +fi +exit 0; + + diff --git a/test/phptests/test028.ksh b/test/phptests/test028.ksh new file mode 100755 index 00000000..8a4107df --- /dev/null +++ b/test/phptests/test028.ksh @@ -0,0 +1,17 @@ +#!/bin/ksh + +CSQL_CONF=${PWD}/phptests/csql.conf +REL_PATH=. +if [ -s "$CSQL_CONF" ] +then + REL_PATH=${PWD}/phptests +fi + +php $REL_PATH/columninfo2.php +if [ $? -ne 0 ] +then + exit 50; +fi +exit 0; + + diff --git a/test/phptests/test029.ksh b/test/phptests/test029.ksh new file mode 100755 index 00000000..97092de1 --- /dev/null +++ b/test/phptests/test029.ksh @@ -0,0 +1,17 @@ +#!/bin/ksh + +CSQL_CONF=${PWD}/phptests/csql.conf +REL_PATH=. +if [ -s "$CSQL_CONF" ] +then + REL_PATH=${PWD}/phptests +fi + +php $REL_PATH/columninfo3.php +if [ $? -ne 0 ] +then + exit 50; +fi +exit 0; + + diff --git a/test/phptests/test030.ksh b/test/phptests/test030.ksh new file mode 100755 index 00000000..1bba91b7 --- /dev/null +++ b/test/phptests/test030.ksh @@ -0,0 +1,17 @@ +#!/bin/ksh + +CSQL_CONF=${PWD}/phptests/csql.conf +REL_PATH=. +if [ -s "$CSQL_CONF" ] +then + REL_PATH=${PWD}/phptests +fi + +php $REL_PATH/columninfo4.php +if [ $? -ne 0 ] +then + exit 50; +fi +exit 0; + + diff --git a/test/phptests/uniqueindex.php b/test/phptests/uniqueindex.php new file mode 100644 index 00000000..19bdd76c --- /dev/null +++ b/test/phptests/uniqueindex.php @@ -0,0 +1,65 @@ + + +/*Creating table with 3 INT fields, Create unique index on single field. + Create possible composite unique indexes in different Combinations +*/ + + + + + diff --git a/test/phptests/uniqueindex2.php b/test/phptests/uniqueindex2.php new file mode 100644 index 00000000..548ab95a --- /dev/null +++ b/test/phptests/uniqueindex2.php @@ -0,0 +1,87 @@ + + +/* Creating table with 2 fields(int,char) + Insert some duplicate value in f1 field + Create unique index on f1 field. It should be failed saying Unique key Violation. + check basic INSERT, SELECT */ +"; +echo "F1"; +echo "F2"; +echo "\nfetch started\n"; +while (odbc_fetch_row($rs)) +{ + $roll=preg_replace('/[\x00-\x09\x0B-\x19\x7F]/', '',odbc_result($rs, 1)); + $name=preg_replace('/[\x00-\x09\x0B-\x19\x7F]/', '',odbc_result($rs, 2)); + echo "$roll"; + echo "$name\n"; +} +echo ""; + +$sth=odbc_prepare($conn,"DROP TABLE t1;"); +$res = odbc_execute($sth); +if (!$res) +{ + echo "\nError in Drop Table"; + exit(6); +} +echo "\nTable Dropped\nTest Passed"; +odbc_close($conn); +?> + + + + -- 2.11.4.GIT