From 96e26354a1cb946cf33a1620763382b6250c1210 Mon Sep 17 00:00:00 2001 From: prabatuty Date: Thu, 4 Nov 2010 10:42:15 +0000 Subject: [PATCH] adding test scripts --- test/cache/Bidirectional/create.sql | 22 + test/cache/Bidirectional/create1.sql | 24 + test/cache/Bidirectional/csql.conf | 114 ++ test/cache/Bidirectional/csql1.conf | 113 ++ test/cache/Bidirectional/db2createlogtable.sql | 1 + test/cache/Bidirectional/delete.sql | 4 + test/cache/Bidirectional/drop.sql | 2 + test/cache/Bidirectional/droptrigger.sql | 7 + test/cache/Bidirectional/exp.test001.ksh | 62 + test/cache/Bidirectional/exp.test002.ksh | 62 + test/cache/Bidirectional/exp.test003.ksh | 2 + test/cache/Bidirectional/exp.test004.ksh | 64 + test/cache/Bidirectional/exp.test005.ksh | 130 ++ test/cache/Bidirectional/exp.test006.ksh | 63 + test/cache/Bidirectional/exp.test007.ksh | 54 + test/cache/Bidirectional/exp.test008.ksh | 131 ++ test/cache/Bidirectional/exp.test009.ksh | 128 ++ test/cache/Bidirectional/exp.test010.ksh | 128 ++ test/cache/Bidirectional/exp.test011.ksh | 110 ++ test/cache/Bidirectional/exp.test012.ksh | 110 ++ test/cache/Bidirectional/exp.test013.ksh | 1409 ++++++++++++++++++ test/cache/Bidirectional/exp.test014.ksh | 1609 +++++++++++++++++++++ test/cache/Bidirectional/exp.test015.ksh | 1409 ++++++++++++++++++ test/cache/Bidirectional/exp.test016.ksh | 66 + test/cache/Bidirectional/exp.test017.ksh | 30 + test/cache/Bidirectional/exp.test018.ksh | 19 + test/cache/Bidirectional/exp.test019.ksh | 19 + test/cache/Bidirectional/exp.test020.ksh | 19 + test/cache/Bidirectional/exp.test021.ksh | 21 + test/cache/Bidirectional/exp.test022.ksh | 19 + test/cache/Bidirectional/insert.sql | 2 + test/cache/Bidirectional/mysqlcreatelogtable.sql | 1 + test/cache/Bidirectional/mysqldeletelogtable.sql | 1 + test/cache/Bidirectional/oraclecreatelogtable.sql | 4 + test/cache/Bidirectional/psqlcreatelogtable.sql | 2 + test/cache/Bidirectional/select.sql | 4 + test/cache/Bidirectional/sybasecreate.sql | 22 + test/cache/Bidirectional/sybasecreatelogtable.sql | 1 + test/cache/Bidirectional/test001.ksh | 115 ++ test/cache/Bidirectional/test002.ksh | 116 ++ test/cache/Bidirectional/test003.ksh | 119 ++ test/cache/Bidirectional/test004.ksh | 120 ++ test/cache/Bidirectional/test005.ksh | 171 +++ test/cache/Bidirectional/test006.ksh | 121 ++ test/cache/Bidirectional/test007.ksh | 120 ++ test/cache/Bidirectional/test008.ksh | 166 +++ test/cache/Bidirectional/test009.ksh | 164 +++ test/cache/Bidirectional/test010.ksh | 165 +++ test/cache/Bidirectional/test011.ksh | 165 +++ test/cache/Bidirectional/test012.ksh | 165 +++ test/cache/Bidirectional/test013.ksh | 183 +++ test/cache/Bidirectional/test014.ksh | 184 +++ test/cache/Bidirectional/test015.ksh | 187 +++ test/cache/Bidirectional/test016.ksh | 123 ++ test/cache/Bidirectional/test017.ksh | 150 ++ test/cache/Bidirectional/test018.ksh | 150 ++ test/cache/Bidirectional/test019.ksh | 151 ++ test/cache/Bidirectional/test020.ksh | 166 +++ test/cache/Bidirectional/test021.ksh | 166 +++ test/cache/Bidirectional/test022.ksh | 171 +++ test/cache/Bidirectional/trigger.psql | 7 + test/cache/Bidirectional/trigger.sql | 7 + test/cache/Bidirectional/trigger1.psql | 10 + test/cache/Bidirectional/trigger1.sql | 7 + test/cache/Bidirectional/update.sql | 4 + test/cache/CacheTable/cre_ins_csql.sql | 6 + test/cache/CacheTable/cre_ins_sybase.sql | 3 + test/cache/CacheTable/cre_ins_tdb.sql | 6 + test/cache/CacheTable/create.sql | 22 + test/cache/CacheTable/create1.sql | 1 + test/cache/CacheTable/create1db2.sql | 1 + test/cache/CacheTable/createt3.sql | 11 + test/cache/CacheTable/createt5.sql | 2 + test/cache/CacheTable/createt5db2.sql | 2 + test/cache/CacheTable/createtable.sql | 16 + test/cache/CacheTable/csql.conf | 110 ++ test/cache/CacheTable/csql1.conf | 169 +++ test/cache/CacheTable/csqlinput.sql | 1 + test/cache/CacheTable/csqlinputoracle.sql | 1 + test/cache/CacheTable/csqlinputtest9.sql | 1 + test/cache/CacheTable/csqlinputtest9oracle.sql | 1 + test/cache/CacheTable/csqlinputwithrec.sql | 3 + test/cache/CacheTable/deletefromt1csql.sql | 1 + test/cache/CacheTable/deletefromt2mysql.sql | 1 + test/cache/CacheTable/drop.sql | 1 + test/cache/CacheTable/drop1.sql | 1 + test/cache/CacheTable/drop5.sql | 2 + test/cache/CacheTable/drop_t1.sql | 2 + test/cache/CacheTable/dropall.sql | 6 + test/cache/CacheTable/dropt1t2.sql | 3 + test/cache/CacheTable/droptable.sql | 6 + test/cache/CacheTable/exp.test001.ksh | 29 + test/cache/CacheTable/exp.test003.ksh | 4 + test/cache/CacheTable/exp.test008.ksh | 10 + test/cache/CacheTable/exp.test010.ksh | 25 + test/cache/CacheTable/exp.test012.ksh | 59 + test/cache/CacheTable/exp.test012.ksh.SunOS | 61 + test/cache/CacheTable/exp.test012.ksh.x86_64 | 59 + test/cache/CacheTable/exp.test014.ksh | 8 + test/cache/CacheTable/exp.test015.ksh | 26 + test/cache/CacheTable/exp.test016.ksh | 5 + test/cache/CacheTable/exp.test017.ksh | 25 + test/cache/CacheTable/exp.test018.ksh | 7 + test/cache/CacheTable/exp.test019.ksh | 13 + test/cache/CacheTable/exp.test020.ksh | 8 + test/cache/CacheTable/exp.test021.ksh | 36 + test/cache/CacheTable/exp.test022.ksh | 111 ++ test/cache/CacheTable/exp.test022.ksh.psql | 111 ++ test/cache/CacheTable/exp.test023.ksh | 12 + test/cache/CacheTable/exp.test024.ksh | 21 + test/cache/CacheTable/exp.test025.ksh | 10 + test/cache/CacheTable/exp.test026.ksh | 25 + test/cache/CacheTable/exp.test027.ksh | 6 + test/cache/CacheTable/exp.test028.ksh | 10 + test/cache/CacheTable/exp.test029.ksh | 43 + test/cache/CacheTable/exp.test029.ksh.SunOS | 41 + test/cache/CacheTable/exp.test029.ksh.psql | 43 + test/cache/CacheTable/exp.test030.ksh | 76 + test/cache/CacheTable/exp.test030.ksh.SunOS | 71 + test/cache/CacheTable/exp.test030.ksh.psql | 76 + test/cache/CacheTable/exp.test032.ksh | 48 + test/cache/CacheTable/exp.test043.ksh | 32 + test/cache/CacheTable/exp.test043.ksh.psql | 32 + test/cache/CacheTable/exp.test044.ksh | 9 + test/cache/CacheTable/exp.test044.ksh.psql | 9 + test/cache/CacheTable/exp.test045.ksh | 67 + test/cache/CacheTable/exp.test045.ksh.SunOS | 57 + test/cache/CacheTable/exp.test045.ksh.psql | 67 + test/cache/CacheTable/exp.test045.ksh.x86_64 | 67 + test/cache/CacheTable/fcsqlinput.sql | 2 + test/cache/CacheTable/fcsqlinputoracle.sql | 2 + test/cache/CacheTable/fmodecreate.sql | 22 + test/cache/CacheTable/fmodeinsert.sql | 6 + test/cache/CacheTable/frecords.sql | 3 + test/cache/CacheTable/inputtest4.sql | 4 + test/cache/CacheTable/insert.sql | 2 + test/cache/CacheTable/insert1.sql | 5 + test/cache/CacheTable/select_t1.sql | 2 + test/cache/CacheTable/selectstar.sql | 2 + test/cache/CacheTable/selectt1.sql | 1 + test/cache/CacheTable/selectt2.sql | 1 + test/cache/CacheTable/t1create_compo.sql | 2 + test/cache/CacheTable/test001.ksh | 22 + test/cache/CacheTable/test002.ksh | 86 ++ test/cache/CacheTable/test003.ksh | 69 + test/cache/CacheTable/test004.ksh | 58 + test/cache/CacheTable/test005.ksh | 48 + test/cache/CacheTable/test006.ksh | 45 + test/cache/CacheTable/test007.ksh | 44 + test/cache/CacheTable/test008.ksh | 88 ++ test/cache/CacheTable/test009.ksh | 87 ++ test/cache/CacheTable/test010.ksh | 62 + test/cache/CacheTable/test011.ksh | 93 ++ test/cache/CacheTable/test012.ksh | 102 ++ test/cache/CacheTable/test013.ksh | 68 + test/cache/CacheTable/test014.ksh | 66 + test/cache/CacheTable/test015.ksh | 87 ++ test/cache/CacheTable/test016.ksh | 104 ++ test/cache/CacheTable/test017.ksh | 74 + test/cache/CacheTable/test018.ksh | 78 + test/cache/CacheTable/test019.ksh | 105 ++ test/cache/CacheTable/test020.ksh | 99 ++ test/cache/CacheTable/test021.ksh | 90 ++ test/cache/CacheTable/test022.ksh | 91 ++ test/cache/CacheTable/test023.ksh | 65 + test/cache/CacheTable/test024.ksh | 70 + test/cache/CacheTable/test025.ksh | 92 ++ test/cache/CacheTable/test026.ksh | 67 + test/cache/CacheTable/test027.ksh | 82 ++ test/cache/CacheTable/test028.ksh | 76 + test/cache/CacheTable/test029.ksh | 134 ++ test/cache/CacheTable/test030.ksh | 146 ++ test/cache/CacheTable/test032.ksh | 101 ++ test/cache/CacheTable/test033.ksh | 68 + test/cache/CacheTable/test034.ksh | 67 + test/cache/CacheTable/test035.ksh | 69 + test/cache/CacheTable/test036.ksh | 68 + test/cache/CacheTable/test037.ksh | 86 ++ test/cache/CacheTable/test038.ksh | 68 + test/cache/CacheTable/test039.ksh | 70 + test/cache/CacheTable/test040.ksh | 79 + test/cache/CacheTable/test041.ksh | 69 + test/cache/CacheTable/test042.ksh | 94 ++ test/cache/CacheTable/test043.ksh | 127 ++ test/cache/CacheTable/test044.ksh | 105 ++ test/cache/CacheTable/test045.ksh | 107 ++ test/cache/CacheTable/test046.ksh | 106 ++ test/cache/CacheTable/test047.ksh | 132 ++ test/cache/CacheVerify/csqldel.sql | 1 + test/cache/CacheVerify/csqldelete.sql | 3 + test/cache/CacheVerify/csqlinput.sql | 14 + test/cache/CacheVerify/csqloracleinput.sql | 11 + test/cache/CacheVerify/csqloracleinput1.sql | 14 + test/cache/CacheVerify/csqlupd.sql | 1 + test/cache/CacheVerify/csqlupdate.sql | 2 + test/cache/CacheVerify/db2input.sql | 11 + test/cache/CacheVerify/db2input10.sql | 6 + test/cache/CacheVerify/db2input11.sql | 6 + test/cache/CacheVerify/db2input12.sql | 6 + test/cache/CacheVerify/db2input13.sql | 6 + test/cache/CacheVerify/db2update.sql | 2 + test/cache/CacheVerify/drop.sql | 1 + test/cache/CacheVerify/exp.test001.ksh | 7 + test/cache/CacheVerify/exp.test004.ksh | 21 + test/cache/CacheVerify/exp.test006.ksh | 46 + test/cache/CacheVerify/exp.test007.ksh | 54 + test/cache/CacheVerify/exp.test008.ksh | 57 + test/cache/CacheVerify/exp.test009.ksh | 49 + test/cache/CacheVerify/exp.test010.ksh | 137 ++ test/cache/CacheVerify/exp.test011.ksh | 137 ++ test/cache/CacheVerify/exp.test012.ksh | 137 ++ test/cache/CacheVerify/exp.test013.ksh | 137 ++ test/cache/CacheVerify/inputtest4.sql | 3 + test/cache/CacheVerify/inputtest5.sql | 3 + test/cache/CacheVerify/mysqldel.sql | 1 + test/cache/CacheVerify/mysqldelete.sql | 2 + test/cache/CacheVerify/mysqlinput.sql | 11 + test/cache/CacheVerify/mysqlinput10.sql | 6 + test/cache/CacheVerify/mysqlinput11.sql | 6 + test/cache/CacheVerify/mysqlinput12.sql | 6 + test/cache/CacheVerify/mysqlinput13.sql | 6 + test/cache/CacheVerify/mysqlupd.sql | 1 + test/cache/CacheVerify/mysqlupdate.sql | 2 + test/cache/CacheVerify/oracleinput.sql | 11 + test/cache/CacheVerify/oracleinput10.sql | 6 + test/cache/CacheVerify/oracleinput11.sql | 6 + test/cache/CacheVerify/oracleinput12.sql | 6 + test/cache/CacheVerify/oracleinput13.sql | 6 + test/cache/CacheVerify/oracleupdate.sql | 2 + test/cache/CacheVerify/psqlinput.sql | 11 + test/cache/CacheVerify/psqlinput10.sql | 6 + test/cache/CacheVerify/psqlinput11.sql | 6 + test/cache/CacheVerify/psqlinput12.sql | 6 + test/cache/CacheVerify/psqlinput13.sql | 6 + test/cache/CacheVerify/sybaseinput.sql | 11 + test/cache/CacheVerify/sybaseinput10.sql | 6 + test/cache/CacheVerify/sybaseinput11.sql | 6 + test/cache/CacheVerify/sybaseinput12.sql | 6 + test/cache/CacheVerify/sybaseinput13.sql | 6 + test/cache/CacheVerify/test001.ksh | 22 + test/cache/CacheVerify/test002.ksh | 90 ++ test/cache/CacheVerify/test003.ksh | 24 + test/cache/CacheVerify/test004.ksh | 90 ++ test/cache/CacheVerify/test005.ksh | 47 + test/cache/CacheVerify/test006.ksh | 102 ++ test/cache/CacheVerify/test007.ksh | 68 + test/cache/CacheVerify/test008.ksh | 103 ++ test/cache/CacheVerify/test009.ksh | 164 +++ test/cache/CacheVerify/test010.ksh | 207 +++ test/cache/CacheVerify/test011.ksh | 208 +++ test/cache/CacheVerify/test012.ksh | 208 +++ test/cache/CacheVerify/test013.ksh | 208 +++ test/cache/DDL/csql.conf | 117 ++ test/cache/DDL/csqlinputtest1.sql | 3 + test/cache/DDL/db2inputtest1.sql | 11 + test/cache/DDL/dropall.sql | 1 + test/cache/DDL/exp.test001.ksh | 19 + test/cache/DDL/exp.test001.ksh.SunOS | 18 + test/cache/DDL/exp.test001.ksh.x86_64 | 19 + test/cache/DDL/exp.test002.ksh | 4 + test/cache/DDL/exp.test004.ksh | 39 + test/cache/DDL/mysqlinputtest1.sql | 11 + test/cache/DDL/mysqlinputtest2.sql | 3 + test/cache/DDL/selectstar.sql | 1 + test/cache/DDL/sybaseinputtest1.sql | 11 + test/cache/DDL/test001.ksh | 45 + test/cache/DDL/test002.ksh | 67 + test/cache/DDL/test003.ksh | 90 ++ test/cache/DDL/test004.ksh | 96 ++ 269 files changed, 18143 insertions(+) create mode 100644 test/cache/Bidirectional/create.sql create mode 100644 test/cache/Bidirectional/create1.sql create mode 100644 test/cache/Bidirectional/csql.conf create mode 100644 test/cache/Bidirectional/csql1.conf create mode 100644 test/cache/Bidirectional/db2createlogtable.sql create mode 100644 test/cache/Bidirectional/delete.sql create mode 100644 test/cache/Bidirectional/drop.sql create mode 100644 test/cache/Bidirectional/droptrigger.sql create mode 100644 test/cache/Bidirectional/exp.test001.ksh create mode 100644 test/cache/Bidirectional/exp.test002.ksh create mode 100644 test/cache/Bidirectional/exp.test003.ksh create mode 100644 test/cache/Bidirectional/exp.test004.ksh create mode 100644 test/cache/Bidirectional/exp.test005.ksh create mode 100644 test/cache/Bidirectional/exp.test006.ksh create mode 100644 test/cache/Bidirectional/exp.test007.ksh create mode 100644 test/cache/Bidirectional/exp.test008.ksh create mode 100644 test/cache/Bidirectional/exp.test009.ksh create mode 100644 test/cache/Bidirectional/exp.test010.ksh create mode 100644 test/cache/Bidirectional/exp.test011.ksh create mode 100644 test/cache/Bidirectional/exp.test012.ksh create mode 100644 test/cache/Bidirectional/exp.test013.ksh create mode 100644 test/cache/Bidirectional/exp.test014.ksh create mode 100644 test/cache/Bidirectional/exp.test015.ksh create mode 100644 test/cache/Bidirectional/exp.test016.ksh create mode 100644 test/cache/Bidirectional/exp.test017.ksh create mode 100644 test/cache/Bidirectional/exp.test018.ksh create mode 100644 test/cache/Bidirectional/exp.test019.ksh create mode 100644 test/cache/Bidirectional/exp.test020.ksh create mode 100644 test/cache/Bidirectional/exp.test021.ksh create mode 100644 test/cache/Bidirectional/exp.test022.ksh create mode 100644 test/cache/Bidirectional/insert.sql create mode 100644 test/cache/Bidirectional/mysqlcreatelogtable.sql create mode 100644 test/cache/Bidirectional/mysqldeletelogtable.sql create mode 100644 test/cache/Bidirectional/oraclecreatelogtable.sql create mode 100644 test/cache/Bidirectional/psqlcreatelogtable.sql create mode 100644 test/cache/Bidirectional/select.sql create mode 100644 test/cache/Bidirectional/sybasecreate.sql create mode 100644 test/cache/Bidirectional/sybasecreatelogtable.sql create mode 100755 test/cache/Bidirectional/test001.ksh create mode 100755 test/cache/Bidirectional/test002.ksh create mode 100755 test/cache/Bidirectional/test003.ksh create mode 100755 test/cache/Bidirectional/test004.ksh create mode 100755 test/cache/Bidirectional/test005.ksh create mode 100755 test/cache/Bidirectional/test006.ksh create mode 100755 test/cache/Bidirectional/test007.ksh create mode 100755 test/cache/Bidirectional/test008.ksh create mode 100755 test/cache/Bidirectional/test009.ksh create mode 100755 test/cache/Bidirectional/test010.ksh create mode 100755 test/cache/Bidirectional/test011.ksh create mode 100755 test/cache/Bidirectional/test012.ksh create mode 100755 test/cache/Bidirectional/test013.ksh create mode 100755 test/cache/Bidirectional/test014.ksh create mode 100755 test/cache/Bidirectional/test015.ksh create mode 100755 test/cache/Bidirectional/test016.ksh create mode 100755 test/cache/Bidirectional/test017.ksh create mode 100755 test/cache/Bidirectional/test018.ksh create mode 100755 test/cache/Bidirectional/test019.ksh create mode 100755 test/cache/Bidirectional/test020.ksh create mode 100755 test/cache/Bidirectional/test021.ksh create mode 100755 test/cache/Bidirectional/test022.ksh create mode 100644 test/cache/Bidirectional/trigger.psql create mode 100644 test/cache/Bidirectional/trigger.sql create mode 100644 test/cache/Bidirectional/trigger1.psql create mode 100644 test/cache/Bidirectional/trigger1.sql create mode 100644 test/cache/Bidirectional/update.sql create mode 100644 test/cache/CacheTable/cre_ins_csql.sql create mode 100644 test/cache/CacheTable/cre_ins_sybase.sql create mode 100644 test/cache/CacheTable/cre_ins_tdb.sql create mode 100644 test/cache/CacheTable/create.sql create mode 100644 test/cache/CacheTable/create1.sql create mode 100644 test/cache/CacheTable/create1db2.sql create mode 100644 test/cache/CacheTable/createt3.sql create mode 100644 test/cache/CacheTable/createt5.sql create mode 100644 test/cache/CacheTable/createt5db2.sql create mode 100644 test/cache/CacheTable/createtable.sql create mode 100644 test/cache/CacheTable/csql.conf create mode 100644 test/cache/CacheTable/csql1.conf create mode 100644 test/cache/CacheTable/csqlinput.sql create mode 100644 test/cache/CacheTable/csqlinputoracle.sql create mode 100644 test/cache/CacheTable/csqlinputtest9.sql create mode 100644 test/cache/CacheTable/csqlinputtest9oracle.sql create mode 100644 test/cache/CacheTable/csqlinputwithrec.sql create mode 100644 test/cache/CacheTable/deletefromt1csql.sql create mode 100644 test/cache/CacheTable/deletefromt2mysql.sql create mode 100644 test/cache/CacheTable/drop.sql create mode 100644 test/cache/CacheTable/drop1.sql create mode 100644 test/cache/CacheTable/drop5.sql create mode 100644 test/cache/CacheTable/drop_t1.sql create mode 100644 test/cache/CacheTable/dropall.sql create mode 100644 test/cache/CacheTable/dropt1t2.sql create mode 100644 test/cache/CacheTable/droptable.sql create mode 100644 test/cache/CacheTable/exp.test001.ksh create mode 100644 test/cache/CacheTable/exp.test003.ksh create mode 100644 test/cache/CacheTable/exp.test008.ksh create mode 100644 test/cache/CacheTable/exp.test010.ksh create mode 100644 test/cache/CacheTable/exp.test012.ksh create mode 100644 test/cache/CacheTable/exp.test012.ksh.SunOS create mode 100644 test/cache/CacheTable/exp.test012.ksh.x86_64 create mode 100644 test/cache/CacheTable/exp.test014.ksh create mode 100644 test/cache/CacheTable/exp.test015.ksh create mode 100644 test/cache/CacheTable/exp.test016.ksh create mode 100644 test/cache/CacheTable/exp.test017.ksh create mode 100644 test/cache/CacheTable/exp.test018.ksh create mode 100644 test/cache/CacheTable/exp.test019.ksh create mode 100644 test/cache/CacheTable/exp.test020.ksh create mode 100644 test/cache/CacheTable/exp.test021.ksh create mode 100644 test/cache/CacheTable/exp.test022.ksh create mode 100644 test/cache/CacheTable/exp.test022.ksh.psql create mode 100644 test/cache/CacheTable/exp.test023.ksh create mode 100644 test/cache/CacheTable/exp.test024.ksh create mode 100644 test/cache/CacheTable/exp.test025.ksh create mode 100644 test/cache/CacheTable/exp.test026.ksh create mode 100644 test/cache/CacheTable/exp.test027.ksh create mode 100644 test/cache/CacheTable/exp.test028.ksh create mode 100644 test/cache/CacheTable/exp.test029.ksh create mode 100644 test/cache/CacheTable/exp.test029.ksh.SunOS create mode 100644 test/cache/CacheTable/exp.test029.ksh.psql create mode 100644 test/cache/CacheTable/exp.test030.ksh create mode 100644 test/cache/CacheTable/exp.test030.ksh.SunOS create mode 100644 test/cache/CacheTable/exp.test030.ksh.psql create mode 100644 test/cache/CacheTable/exp.test032.ksh create mode 100644 test/cache/CacheTable/exp.test043.ksh create mode 100644 test/cache/CacheTable/exp.test043.ksh.psql create mode 100644 test/cache/CacheTable/exp.test044.ksh create mode 100644 test/cache/CacheTable/exp.test044.ksh.psql create mode 100644 test/cache/CacheTable/exp.test045.ksh create mode 100644 test/cache/CacheTable/exp.test045.ksh.SunOS create mode 100644 test/cache/CacheTable/exp.test045.ksh.psql create mode 100644 test/cache/CacheTable/exp.test045.ksh.x86_64 create mode 100644 test/cache/CacheTable/fcsqlinput.sql create mode 100644 test/cache/CacheTable/fcsqlinputoracle.sql create mode 100644 test/cache/CacheTable/fmodecreate.sql create mode 100644 test/cache/CacheTable/fmodeinsert.sql create mode 100644 test/cache/CacheTable/frecords.sql create mode 100644 test/cache/CacheTable/inputtest4.sql create mode 100644 test/cache/CacheTable/insert.sql create mode 100644 test/cache/CacheTable/insert1.sql create mode 100644 test/cache/CacheTable/select_t1.sql create mode 100644 test/cache/CacheTable/selectstar.sql create mode 100644 test/cache/CacheTable/selectt1.sql create mode 100644 test/cache/CacheTable/selectt2.sql create mode 100644 test/cache/CacheTable/t1create_compo.sql create mode 100755 test/cache/CacheTable/test001.ksh create mode 100755 test/cache/CacheTable/test002.ksh create mode 100755 test/cache/CacheTable/test003.ksh create mode 100755 test/cache/CacheTable/test004.ksh create mode 100755 test/cache/CacheTable/test005.ksh create mode 100755 test/cache/CacheTable/test006.ksh create mode 100755 test/cache/CacheTable/test007.ksh create mode 100755 test/cache/CacheTable/test008.ksh create mode 100755 test/cache/CacheTable/test009.ksh create mode 100755 test/cache/CacheTable/test010.ksh create mode 100755 test/cache/CacheTable/test011.ksh create mode 100755 test/cache/CacheTable/test012.ksh create mode 100755 test/cache/CacheTable/test013.ksh create mode 100755 test/cache/CacheTable/test014.ksh create mode 100755 test/cache/CacheTable/test015.ksh create mode 100755 test/cache/CacheTable/test016.ksh create mode 100755 test/cache/CacheTable/test017.ksh create mode 100755 test/cache/CacheTable/test018.ksh create mode 100755 test/cache/CacheTable/test019.ksh create mode 100755 test/cache/CacheTable/test020.ksh create mode 100755 test/cache/CacheTable/test021.ksh create mode 100755 test/cache/CacheTable/test022.ksh create mode 100755 test/cache/CacheTable/test023.ksh create mode 100755 test/cache/CacheTable/test024.ksh create mode 100755 test/cache/CacheTable/test025.ksh create mode 100755 test/cache/CacheTable/test026.ksh create mode 100755 test/cache/CacheTable/test027.ksh create mode 100755 test/cache/CacheTable/test028.ksh create mode 100755 test/cache/CacheTable/test029.ksh create mode 100755 test/cache/CacheTable/test030.ksh create mode 100755 test/cache/CacheTable/test032.ksh create mode 100755 test/cache/CacheTable/test033.ksh create mode 100755 test/cache/CacheTable/test034.ksh create mode 100755 test/cache/CacheTable/test035.ksh create mode 100755 test/cache/CacheTable/test036.ksh create mode 100755 test/cache/CacheTable/test037.ksh create mode 100755 test/cache/CacheTable/test038.ksh create mode 100755 test/cache/CacheTable/test039.ksh create mode 100755 test/cache/CacheTable/test040.ksh create mode 100755 test/cache/CacheTable/test041.ksh create mode 100755 test/cache/CacheTable/test042.ksh create mode 100755 test/cache/CacheTable/test043.ksh create mode 100755 test/cache/CacheTable/test044.ksh create mode 100755 test/cache/CacheTable/test045.ksh create mode 100755 test/cache/CacheTable/test046.ksh create mode 100755 test/cache/CacheTable/test047.ksh create mode 100644 test/cache/CacheVerify/csqldel.sql create mode 100644 test/cache/CacheVerify/csqldelete.sql create mode 100644 test/cache/CacheVerify/csqlinput.sql create mode 100644 test/cache/CacheVerify/csqloracleinput.sql create mode 100644 test/cache/CacheVerify/csqloracleinput1.sql create mode 100644 test/cache/CacheVerify/csqlupd.sql create mode 100644 test/cache/CacheVerify/csqlupdate.sql create mode 100644 test/cache/CacheVerify/db2input.sql create mode 100644 test/cache/CacheVerify/db2input10.sql create mode 100644 test/cache/CacheVerify/db2input11.sql create mode 100644 test/cache/CacheVerify/db2input12.sql create mode 100644 test/cache/CacheVerify/db2input13.sql create mode 100644 test/cache/CacheVerify/db2update.sql create mode 100644 test/cache/CacheVerify/drop.sql create mode 100644 test/cache/CacheVerify/exp.test001.ksh create mode 100644 test/cache/CacheVerify/exp.test004.ksh create mode 100644 test/cache/CacheVerify/exp.test006.ksh create mode 100644 test/cache/CacheVerify/exp.test007.ksh create mode 100644 test/cache/CacheVerify/exp.test008.ksh create mode 100644 test/cache/CacheVerify/exp.test009.ksh create mode 100644 test/cache/CacheVerify/exp.test010.ksh create mode 100644 test/cache/CacheVerify/exp.test011.ksh create mode 100644 test/cache/CacheVerify/exp.test012.ksh create mode 100644 test/cache/CacheVerify/exp.test013.ksh create mode 100644 test/cache/CacheVerify/inputtest4.sql create mode 100644 test/cache/CacheVerify/inputtest5.sql create mode 100644 test/cache/CacheVerify/mysqldel.sql create mode 100644 test/cache/CacheVerify/mysqldelete.sql create mode 100644 test/cache/CacheVerify/mysqlinput.sql create mode 100644 test/cache/CacheVerify/mysqlinput10.sql create mode 100644 test/cache/CacheVerify/mysqlinput11.sql create mode 100644 test/cache/CacheVerify/mysqlinput12.sql create mode 100644 test/cache/CacheVerify/mysqlinput13.sql create mode 100644 test/cache/CacheVerify/mysqlupd.sql create mode 100644 test/cache/CacheVerify/mysqlupdate.sql create mode 100644 test/cache/CacheVerify/oracleinput.sql create mode 100644 test/cache/CacheVerify/oracleinput10.sql create mode 100644 test/cache/CacheVerify/oracleinput11.sql create mode 100644 test/cache/CacheVerify/oracleinput12.sql create mode 100644 test/cache/CacheVerify/oracleinput13.sql create mode 100644 test/cache/CacheVerify/oracleupdate.sql create mode 100644 test/cache/CacheVerify/psqlinput.sql create mode 100644 test/cache/CacheVerify/psqlinput10.sql create mode 100644 test/cache/CacheVerify/psqlinput11.sql create mode 100644 test/cache/CacheVerify/psqlinput12.sql create mode 100644 test/cache/CacheVerify/psqlinput13.sql create mode 100644 test/cache/CacheVerify/sybaseinput.sql create mode 100644 test/cache/CacheVerify/sybaseinput10.sql create mode 100644 test/cache/CacheVerify/sybaseinput11.sql create mode 100644 test/cache/CacheVerify/sybaseinput12.sql create mode 100644 test/cache/CacheVerify/sybaseinput13.sql create mode 100755 test/cache/CacheVerify/test001.ksh create mode 100755 test/cache/CacheVerify/test002.ksh create mode 100755 test/cache/CacheVerify/test003.ksh create mode 100755 test/cache/CacheVerify/test004.ksh create mode 100755 test/cache/CacheVerify/test005.ksh create mode 100755 test/cache/CacheVerify/test006.ksh create mode 100755 test/cache/CacheVerify/test007.ksh create mode 100755 test/cache/CacheVerify/test008.ksh create mode 100755 test/cache/CacheVerify/test009.ksh create mode 100755 test/cache/CacheVerify/test010.ksh create mode 100755 test/cache/CacheVerify/test011.ksh create mode 100755 test/cache/CacheVerify/test012.ksh create mode 100755 test/cache/CacheVerify/test013.ksh create mode 100644 test/cache/DDL/csql.conf create mode 100644 test/cache/DDL/csqlinputtest1.sql create mode 100644 test/cache/DDL/db2inputtest1.sql create mode 100644 test/cache/DDL/dropall.sql create mode 100644 test/cache/DDL/exp.test001.ksh create mode 100644 test/cache/DDL/exp.test001.ksh.SunOS create mode 100644 test/cache/DDL/exp.test001.ksh.x86_64 create mode 100644 test/cache/DDL/exp.test002.ksh create mode 100644 test/cache/DDL/exp.test004.ksh create mode 100644 test/cache/DDL/mysqlinputtest1.sql create mode 100644 test/cache/DDL/mysqlinputtest2.sql create mode 100644 test/cache/DDL/selectstar.sql create mode 100644 test/cache/DDL/sybaseinputtest1.sql create mode 100755 test/cache/DDL/test001.ksh create mode 100755 test/cache/DDL/test002.ksh create mode 100755 test/cache/DDL/test003.ksh create mode 100755 test/cache/DDL/test004.ksh diff --git a/test/cache/Bidirectional/create.sql b/test/cache/Bidirectional/create.sql new file mode 100644 index 00000000..b28241e3 --- /dev/null +++ b/test/cache/Bidirectional/create.sql @@ -0,0 +1,22 @@ +create table t1 (f1 int NOT NULL, f2 int,primary key(f1)); +insert into t1 values(1,11); +insert into t1 values(2,21); +insert into t1 values(3,31); +insert into t1 values(4,41); +insert into t1 values(5,51); +insert into t1 values(6,61); +insert into t1 values(7,71); +insert into t1 values(8,81); +insert into t1 values(9,91); +insert into t1 values(10,101); +create table t2 (f1 int NOT NULL, f2 int, primary key(f1)); +insert into t2 values(1,11); +insert into t2 values(2,21); +insert into t2 values(3,31); +insert into t2 values(4,41); +insert into t2 values(5,51); +insert into t2 values(6,61); +insert into t2 values(7,71); +insert into t2 values(8,81); +insert into t2 values(9,91); +insert into t2 values(10,101); diff --git a/test/cache/Bidirectional/create1.sql b/test/cache/Bidirectional/create1.sql new file mode 100644 index 00000000..23e1b644 --- /dev/null +++ b/test/cache/Bidirectional/create1.sql @@ -0,0 +1,24 @@ +create table t1 (f1 int , f2 int); +insert into t1 values(1,11); +insert into t1 values(2,21); +insert into t1 values(3,31); +insert into t1 values(4,41); +insert into t1 values(5,51); +insert into t1 values(6,61); +insert into t1 values(7,71); +insert into t1 values(8,81); +insert into t1 values(9,91); +insert into t1 values(10,101); +create table t2 (f1 int , f2 int); +insert into t2 values(1,11); +insert into t2 values(2,21); +insert into t2 values(3,31); +insert into t2 values(4,41); +insert into t2 values(5,51); +insert into t2 values(6,61); +insert into t2 values(7,71); +insert into t2 values(8,81); +insert into t2 values(9,91); +insert into t2 values(10,101); +commit; + diff --git a/test/cache/Bidirectional/csql.conf b/test/cache/Bidirectional/csql.conf new file mode 100644 index 00000000..905b2c6d --- /dev/null +++ b/test/cache/Bidirectional/csql.conf @@ -0,0 +1,114 @@ +# 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=1048576 + +#Maximum size of the user database file. +MAX_DB_SIZE=10485760 + +#Shared memory key to be used by the system to create and locate system database. +SYS_DB_KEY=4000 + +#Shared memory key to be used by the system to create and locate user database. +USER_DB_KEY=4500 + +#Log level 0->no logging 1->Fine 2->Finer 3->Finest +LOG_LEVEL=0 + +#Give full path for the log file where important system actions are stored. +LOG_FILE=/tmp/csql/log/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 + +# Can be set true only when DURABILITY is true +MMAP=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=true + +#Set cache id for multiple bidirectional cache node for single data source +SITE_ID=1 + +# Name of Target Database (mysql ,postgres, oracle etc...) +TARGET_DATABASE=mysql +#DSN Name to connect to the target database. +#This should be present in ~/odbc.ini file +DSN=myodbc3 + +DBUSER= + +PASSWORD= + +ENABLE_BIDIRECTIONAL_CACHE=true + +CACHE_RECEIVER_WAIT_SECS=10 + +#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 table information is stored +TABLE_CONFIG_FILE=/tmp/csql/csqltable.conf + +#Give full path of the file where all the DSN information is stored +DS_CONFIG_FILE=/tmp/csql/csqlds.conf +#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/cache/Bidirectional/csql1.conf b/test/cache/Bidirectional/csql1.conf new file mode 100644 index 00000000..13e9a081 --- /dev/null +++ b/test/cache/Bidirectional/csql1.conf @@ -0,0 +1,113 @@ +# 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=104857600 + +#Shared memory key to be used by the system to create and locate system database. +SYS_DB_KEY=4000 + +#Shared memory key to be used by the system to create and locate user database. +USER_DB_KEY=4500 + +#Log level 0->no logging 1->Fine 2->Finer 3->Finest +LOG_LEVEL=0 + +#Give full path for the log file where important system actions are stored. +LOG_FILE=/tmp/csql/log/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 + +# Can be set true only when DURABILITY is true +MMAP=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=true + +#Set cache id for multiple bidirectional cache node for single data source +SITE_ID=1 + +# Name of Target Database (mysql ,postgres, oracle etc...) +TARGET_DATABASE=mysql +#DSN Name to connect to the target database. +#This should be present in ~/odbc.ini file +DSN=myodbc3 + +DBUSER= + +PASSWORD= + +ENABLE_BIDIRECTIONAL_CACHE=true + +CACHE_RECEIVER_WAIT_SECS=10 + +#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 table information is stored +TABLE_CONFIG_FILE=/tmp/csql/csqltable.conf +#Give full path of the file where all the DSN information is stored +DS_CONFIG_FILE=/tmp/csql1/csqlds.conf +#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/cache/Bidirectional/db2createlogtable.sql b/test/cache/Bidirectional/db2createlogtable.sql new file mode 100644 index 00000000..1e17db9f --- /dev/null +++ b/test/cache/Bidirectional/db2createlogtable.sql @@ -0,0 +1 @@ +create table csql_log_int(tablename char(64), pkid int, operation int,cacheid int, id int not null GENERATED AS IDENTITY); diff --git a/test/cache/Bidirectional/delete.sql b/test/cache/Bidirectional/delete.sql new file mode 100644 index 00000000..394e466c --- /dev/null +++ b/test/cache/Bidirectional/delete.sql @@ -0,0 +1,4 @@ +delete from t1 where f1 > 7; +delete from t2 where f1 < 7; +commit; + diff --git a/test/cache/Bidirectional/drop.sql b/test/cache/Bidirectional/drop.sql new file mode 100644 index 00000000..9c354ab0 --- /dev/null +++ b/test/cache/Bidirectional/drop.sql @@ -0,0 +1,2 @@ +drop table t1; +drop table t2; diff --git a/test/cache/Bidirectional/droptrigger.sql b/test/cache/Bidirectional/droptrigger.sql new file mode 100644 index 00000000..cbcfd13f --- /dev/null +++ b/test/cache/Bidirectional/droptrigger.sql @@ -0,0 +1,7 @@ +use test; +drop trigger if exists triggerinsertt1; +drop trigger if exists triggerupdatet1; +drop trigger if exists triggerdeletet1; +drop trigger if exists triggerinsertt2; +drop trigger if exists triggerupdatet2; +drop trigger if exists triggerdeletet2; diff --git a/test/cache/Bidirectional/exp.test001.ksh b/test/cache/Bidirectional/exp.test001.ksh new file mode 100644 index 00000000..114f53aa --- /dev/null +++ b/test/cache/Bidirectional/exp.test001.ksh @@ -0,0 +1,62 @@ +No log table in target DB +server started +echo select * from t1; +--------------------------------------------------------- + t1.f1 t1.f2 +--------------------------------------------------------- + 1 11 + 2 21 + 3 31 + 4 41 + 5 51 + 6 61 + 7 71 + 8 81 + 9 91 + 10 101 + +echo select * from t2; +--------------------------------------------------------- + t2.f1 t2.f2 +--------------------------------------------------------- + 1 11 + 2 21 + 3 31 + 4 41 + 5 51 + 6 61 + 7 71 + 8 81 + 9 91 + 10 101 + +echo select * from t1; +--------------------------------------------------------- + t1.f1 t1.f2 +--------------------------------------------------------- + 1 11 + 2 21 + 3 31 + 4 41 + 5 51 + 6 61 + 7 71 + 8 81 + 9 91 + 10 101 + +echo select * from t2; +--------------------------------------------------------- + t2.f1 t2.f2 +--------------------------------------------------------- + 1 11 + 2 21 + 3 31 + 4 41 + 5 51 + 6 61 + 7 71 + 8 81 + 9 91 + 10 101 + diff --git a/test/cache/Bidirectional/exp.test002.ksh b/test/cache/Bidirectional/exp.test002.ksh new file mode 100644 index 00000000..0e87ab10 --- /dev/null +++ b/test/cache/Bidirectional/exp.test002.ksh @@ -0,0 +1,62 @@ +Log table created in target DB +server started +echo select * from t1; +--------------------------------------------------------- + t1.f1 t1.f2 +--------------------------------------------------------- + 1 11 + 2 21 + 3 31 + 4 41 + 5 51 + 6 61 + 7 71 + 8 81 + 9 91 + 10 101 + +echo select * from t2; +--------------------------------------------------------- + t2.f1 t2.f2 +--------------------------------------------------------- + 1 11 + 2 21 + 3 31 + 4 41 + 5 51 + 6 61 + 7 71 + 8 81 + 9 91 + 10 101 + +echo select * from t1; +--------------------------------------------------------- + t1.f1 t1.f2 +--------------------------------------------------------- + 1 11 + 2 21 + 3 31 + 4 41 + 5 51 + 6 61 + 7 71 + 8 81 + 9 91 + 10 101 + +echo select * from t2; +--------------------------------------------------------- + t2.f1 t2.f2 +--------------------------------------------------------- + 1 11 + 2 21 + 3 31 + 4 41 + 5 51 + 6 61 + 7 71 + 8 81 + 9 91 + 10 101 + diff --git a/test/cache/Bidirectional/exp.test003.ksh b/test/cache/Bidirectional/exp.test003.ksh new file mode 100644 index 00000000..6d3c84ec --- /dev/null +++ b/test/cache/Bidirectional/exp.test003.ksh @@ -0,0 +1,2 @@ +log table created in target db. +server started diff --git a/test/cache/Bidirectional/exp.test004.ksh b/test/cache/Bidirectional/exp.test004.ksh new file mode 100644 index 00000000..3c8e2de3 --- /dev/null +++ b/test/cache/Bidirectional/exp.test004.ksh @@ -0,0 +1,64 @@ +Log table created in target DB +server started +echo select * from t1; +--------------------------------------------------------- + t1.f1 t1.f2 +--------------------------------------------------------- + 1 11 + 2 21 + 3 31 + 4 41 + 5 51 + 6 61 + 7 71 + 8 81 + 9 91 + 10 101 + +echo select * from t2; +--------------------------------------------------------- + t2.f1 t2.f2 +--------------------------------------------------------- + 1 11 + 2 21 + 3 31 + 4 41 + 5 51 + 6 61 + 7 71 + 8 81 + 9 91 + 10 101 + +echo select * from t1; +--------------------------------------------------------- + t1.f1 t1.f2 +--------------------------------------------------------- + 1 11 + 2 21 + 3 31 + 4 41 + 5 51 + 6 61 + 7 71 + 8 81 + 9 91 + 10 101 + 12 123 + +echo select * from t2; +--------------------------------------------------------- + t2.f1 t2.f2 +--------------------------------------------------------- + 1 11 + 2 21 + 3 31 + 4 41 + 5 51 + 6 61 + 7 71 + 8 81 + 9 91 + 10 101 + 15 125 + diff --git a/test/cache/Bidirectional/exp.test005.ksh b/test/cache/Bidirectional/exp.test005.ksh new file mode 100644 index 00000000..a5ca1d7c --- /dev/null +++ b/test/cache/Bidirectional/exp.test005.ksh @@ -0,0 +1,130 @@ +table csql_log_int is created with records in target db +server 1 started +cache node 2 +echo select * from t1; +--------------------------------------------------------- + t1.f1 t1.f2 +--------------------------------------------------------- + 1 11 + 2 21 + 3 31 + 4 41 + 5 51 + 6 61 + 7 71 + 8 81 + 9 91 + 10 101 + +echo select * from t2; +--------------------------------------------------------- + t2.f1 t2.f2 +--------------------------------------------------------- + 1 11 + 2 21 + 3 31 + 4 41 + 5 51 + 6 61 + 7 71 + 8 81 + 9 91 + 10 101 + +server 2 started +cache node 1 +echo select * from t1; +--------------------------------------------------------- + t1.f1 t1.f2 +--------------------------------------------------------- + 1 11 + 2 21 + 3 31 + 4 41 + 5 51 + 6 61 + 7 71 + 8 81 + 9 91 + 10 101 + +echo select * from t2; +--------------------------------------------------------- + t2.f1 t2.f2 +--------------------------------------------------------- + 1 11 + 2 21 + 3 31 + 4 41 + 5 51 + 6 61 + 7 71 + 8 81 + 9 91 + 10 101 + +echo select * from t1; +--------------------------------------------------------- + t1.f1 t1.f2 +--------------------------------------------------------- + 1 11 + 2 21 + 3 31 + 4 41 + 5 51 + 6 61 + 7 71 + 8 81 + 9 91 + 10 101 + 12 123 + +echo select * from t2; +--------------------------------------------------------- + t2.f1 t2.f2 +--------------------------------------------------------- + 1 11 + 2 21 + 3 31 + 4 41 + 5 51 + 6 61 + 7 71 + 8 81 + 9 91 + 10 101 + 15 125 + +cache node 2 +echo select * from t1; +--------------------------------------------------------- + t1.f1 t1.f2 +--------------------------------------------------------- + 1 11 + 2 21 + 3 31 + 4 41 + 5 51 + 6 61 + 7 71 + 8 81 + 9 91 + 10 101 + 12 123 + +echo select * from t2; +--------------------------------------------------------- + t2.f1 t2.f2 +--------------------------------------------------------- + 1 11 + 2 21 + 3 31 + 4 41 + 5 51 + 6 61 + 7 71 + 8 81 + 9 91 + 10 101 + 15 125 + diff --git a/test/cache/Bidirectional/exp.test006.ksh b/test/cache/Bidirectional/exp.test006.ksh new file mode 100644 index 00000000..65099617 --- /dev/null +++ b/test/cache/Bidirectional/exp.test006.ksh @@ -0,0 +1,63 @@ +Log table created in target DB +server started +echo select * from t1; +--------------------------------------------------------- + t1.f1 t1.f2 +--------------------------------------------------------- + 1 11 + 2 21 + 3 31 + 4 41 + 5 51 + 6 61 + 7 71 + 8 81 + 9 91 + 10 101 + +echo select * from t2; +--------------------------------------------------------- + t2.f1 t2.f2 +--------------------------------------------------------- + 1 11 + 2 21 + 3 31 + 4 41 + 5 51 + 6 61 + 7 71 + 8 81 + 9 91 + 10 101 + +Update some record in target database +echo select * from t1; +--------------------------------------------------------- + t1.f1 t1.f2 +--------------------------------------------------------- + 1 50 + 2 50 + 3 50 + 4 50 + 5 50 + 6 61 + 7 71 + 8 81 + 9 91 + 10 101 + +echo select * from t2; +--------------------------------------------------------- + t2.f1 t2.f2 +--------------------------------------------------------- + 1 110 + 2 110 + 3 110 + 4 110 + 5 110 + 6 61 + 7 71 + 8 81 + 9 91 + 10 101 + diff --git a/test/cache/Bidirectional/exp.test007.ksh b/test/cache/Bidirectional/exp.test007.ksh new file mode 100644 index 00000000..33dd09e3 --- /dev/null +++ b/test/cache/Bidirectional/exp.test007.ksh @@ -0,0 +1,54 @@ +Log table created in target DB +server started +echo select * from t1; +--------------------------------------------------------- + t1.f1 t1.f2 +--------------------------------------------------------- + 1 11 + 2 21 + 3 31 + 4 41 + 5 51 + 6 61 + 7 71 + 8 81 + 9 91 + 10 101 + +echo select * from t2; +--------------------------------------------------------- + t2.f1 t2.f2 +--------------------------------------------------------- + 1 11 + 2 21 + 3 31 + 4 41 + 5 51 + 6 61 + 7 71 + 8 81 + 9 91 + 10 101 + +Delete some record from target database +echo select * from t1; +--------------------------------------------------------- + t1.f1 t1.f2 +--------------------------------------------------------- + 1 11 + 2 21 + 3 31 + 4 41 + 5 51 + 6 61 + 7 71 + +echo select * from t2; +--------------------------------------------------------- + t2.f1 t2.f2 +--------------------------------------------------------- + 7 71 + 8 81 + 9 91 + 10 101 + diff --git a/test/cache/Bidirectional/exp.test008.ksh b/test/cache/Bidirectional/exp.test008.ksh new file mode 100644 index 00000000..93f8acfa --- /dev/null +++ b/test/cache/Bidirectional/exp.test008.ksh @@ -0,0 +1,131 @@ +table csql_log_int is created with records in target db +server 1 started +cache node 2 +echo select * from t1; +--------------------------------------------------------- + t1.f1 t1.f2 +--------------------------------------------------------- + 1 11 + 2 21 + 3 31 + 4 41 + 5 51 + 6 61 + 7 71 + 8 81 + 9 91 + 10 101 + +echo select * from t2; +--------------------------------------------------------- + t2.f1 t2.f2 +--------------------------------------------------------- + 1 11 + 2 21 + 3 31 + 4 41 + 5 51 + 6 61 + 7 71 + 8 81 + 9 91 + 10 101 + +server 2 started +cache node 1 +echo select * from t1; +--------------------------------------------------------- + t1.f1 t1.f2 +--------------------------------------------------------- + 1 11 + 2 21 + 3 31 + 4 41 + 5 51 + 6 61 + 7 71 + 8 81 + 9 91 + 10 101 + +echo select * from t2; +--------------------------------------------------------- + t2.f1 t2.f2 +--------------------------------------------------------- + 1 11 + 2 21 + 3 31 + 4 41 + 5 51 + 6 61 + 7 71 + 8 81 + 9 91 + 10 101 + +cache node 1 +echo select * from t1; +--------------------------------------------------------- + t1.f1 t1.f2 +--------------------------------------------------------- + 1 11 + 2 21 + 3 31 + 4 41 + 5 51 + 6 61 + 7 71 + 8 81 + 9 91 + 10 101 + 12 123 + +echo select * from t2; +--------------------------------------------------------- + t2.f1 t2.f2 +--------------------------------------------------------- + 1 11 + 2 21 + 3 31 + 4 41 + 5 51 + 6 61 + 7 71 + 8 81 + 9 91 + 10 101 + 15 125 + +cache node 2 +echo select * from t1; +--------------------------------------------------------- + t1.f1 t1.f2 +--------------------------------------------------------- + 1 11 + 2 21 + 3 31 + 4 41 + 5 51 + 6 61 + 7 71 + 8 81 + 9 91 + 10 101 + 12 123 + +echo select * from t2; +--------------------------------------------------------- + t2.f1 t2.f2 +--------------------------------------------------------- + 1 11 + 2 21 + 3 31 + 4 41 + 5 51 + 6 61 + 7 71 + 8 81 + 9 91 + 10 101 + 15 125 + diff --git a/test/cache/Bidirectional/exp.test009.ksh b/test/cache/Bidirectional/exp.test009.ksh new file mode 100644 index 00000000..1580c4c5 --- /dev/null +++ b/test/cache/Bidirectional/exp.test009.ksh @@ -0,0 +1,128 @@ +table csql_log_int is created with records in target db +server 1 started +cache node 2 +echo select * from t1; +--------------------------------------------------------- + t1.f1 t1.f2 +--------------------------------------------------------- + 1 11 + 2 21 + 3 31 + 4 41 + 5 51 + 6 61 + 7 71 + 8 81 + 9 91 + 10 101 + +echo select * from t2; +--------------------------------------------------------- + t2.f1 t2.f2 +--------------------------------------------------------- + 1 11 + 2 21 + 3 31 + 4 41 + 5 51 + 6 61 + 7 71 + 8 81 + 9 91 + 10 101 + +server 2 started +cache node 1 +echo select * from t1; +--------------------------------------------------------- + t1.f1 t1.f2 +--------------------------------------------------------- + 1 11 + 2 21 + 3 31 + 4 41 + 5 51 + 6 61 + 7 71 + 8 81 + 9 91 + 10 101 + +echo select * from t2; +--------------------------------------------------------- + t2.f1 t2.f2 +--------------------------------------------------------- + 1 11 + 2 21 + 3 31 + 4 41 + 5 51 + 6 61 + 7 71 + 8 81 + 9 91 + 10 101 + +update some record in target database +cache node 1 +echo select * from t1; +--------------------------------------------------------- + t1.f1 t1.f2 +--------------------------------------------------------- + 1 50 + 2 50 + 3 50 + 4 50 + 5 50 + 6 61 + 7 71 + 8 81 + 9 91 + 10 101 + +echo select * from t2; +--------------------------------------------------------- + t2.f1 t2.f2 +--------------------------------------------------------- + 1 110 + 2 110 + 3 110 + 4 110 + 5 110 + 6 61 + 7 71 + 8 81 + 9 91 + 10 101 + +cache node 2 +echo select * from t1; +--------------------------------------------------------- + t1.f1 t1.f2 +--------------------------------------------------------- + 1 50 + 2 50 + 3 50 + 4 50 + 5 50 + 6 61 + 7 71 + 8 81 + 9 91 + 10 101 + +echo select * from t2; +--------------------------------------------------------- + t2.f1 t2.f2 +--------------------------------------------------------- + 1 110 + 2 110 + 3 110 + 4 110 + 5 110 + 6 61 + 7 71 + 8 81 + 9 91 + 10 101 + diff --git a/test/cache/Bidirectional/exp.test010.ksh b/test/cache/Bidirectional/exp.test010.ksh new file mode 100644 index 00000000..1c5dc26a --- /dev/null +++ b/test/cache/Bidirectional/exp.test010.ksh @@ -0,0 +1,128 @@ +table csql_log_int is created with records in target db +server 1 started +cache node 2 +echo select * from t1; +--------------------------------------------------------- + t1.f1 t1.f2 +--------------------------------------------------------- + 1 11 + 2 21 + 3 31 + 4 41 + 5 51 + 6 61 + 7 71 + 8 81 + 9 91 + 10 101 + +echo select * from t2; +--------------------------------------------------------- + t2.f1 t2.f2 +--------------------------------------------------------- + 1 11 + 2 21 + 3 31 + 4 41 + 5 51 + 6 61 + 7 71 + 8 81 + 9 91 + 10 101 + +server 2 started +cache node 1 +echo select * from t1; +--------------------------------------------------------- + t1.f1 t1.f2 +--------------------------------------------------------- + 1 11 + 2 21 + 3 31 + 4 41 + 5 51 + 6 61 + 7 71 + 8 81 + 9 91 + 10 101 + +echo select * from t2; +--------------------------------------------------------- + t2.f1 t2.f2 +--------------------------------------------------------- + 1 11 + 2 21 + 3 31 + 4 41 + 5 51 + 6 61 + 7 71 + 8 81 + 9 91 + 10 101 + +Update operation in cache node 1 +cache node 1 +echo select * from t1; +--------------------------------------------------------- + t1.f1 t1.f2 +--------------------------------------------------------- + 1 50 + 2 50 + 3 50 + 4 50 + 5 50 + 6 61 + 7 71 + 8 81 + 9 91 + 10 101 + +echo select * from t2; +--------------------------------------------------------- + t2.f1 t2.f2 +--------------------------------------------------------- + 1 110 + 2 110 + 3 110 + 4 110 + 5 110 + 6 61 + 7 71 + 8 81 + 9 91 + 10 101 + +cache node 2 +echo select * from t1; +--------------------------------------------------------- + t1.f1 t1.f2 +--------------------------------------------------------- + 1 50 + 2 50 + 3 50 + 4 50 + 5 50 + 6 61 + 7 71 + 8 81 + 9 91 + 10 101 + +echo select * from t2; +--------------------------------------------------------- + t2.f1 t2.f2 +--------------------------------------------------------- + 1 110 + 2 110 + 3 110 + 4 110 + 5 110 + 6 61 + 7 71 + 8 81 + 9 91 + 10 101 + diff --git a/test/cache/Bidirectional/exp.test011.ksh b/test/cache/Bidirectional/exp.test011.ksh new file mode 100644 index 00000000..ff471f17 --- /dev/null +++ b/test/cache/Bidirectional/exp.test011.ksh @@ -0,0 +1,110 @@ +table csql_log_int is created with records in target db +server 1 started +cache node 2 +echo select * from t1; +--------------------------------------------------------- + t1.f1 t1.f2 +--------------------------------------------------------- + 1 11 + 2 21 + 3 31 + 4 41 + 5 51 + 6 61 + 7 71 + 8 81 + 9 91 + 10 101 + +echo select * from t2; +--------------------------------------------------------- + t2.f1 t2.f2 +--------------------------------------------------------- + 1 11 + 2 21 + 3 31 + 4 41 + 5 51 + 6 61 + 7 71 + 8 81 + 9 91 + 10 101 + +server 2 started +cache node 1 +echo select * from t1; +--------------------------------------------------------- + t1.f1 t1.f2 +--------------------------------------------------------- + 1 11 + 2 21 + 3 31 + 4 41 + 5 51 + 6 61 + 7 71 + 8 81 + 9 91 + 10 101 + +echo select * from t2; +--------------------------------------------------------- + t2.f1 t2.f2 +--------------------------------------------------------- + 1 11 + 2 21 + 3 31 + 4 41 + 5 51 + 6 61 + 7 71 + 8 81 + 9 91 + 10 101 + +Delete some record in target database +cache node 1 +echo select * from t1; +--------------------------------------------------------- + t1.f1 t1.f2 +--------------------------------------------------------- + 1 11 + 2 21 + 3 31 + 4 41 + 5 51 + 6 61 + 7 71 + +echo select * from t2; +--------------------------------------------------------- + t2.f1 t2.f2 +--------------------------------------------------------- + 7 71 + 8 81 + 9 91 + 10 101 + +cache node 2 +echo select * from t1; +--------------------------------------------------------- + t1.f1 t1.f2 +--------------------------------------------------------- + 1 11 + 2 21 + 3 31 + 4 41 + 5 51 + 6 61 + 7 71 + +echo select * from t2; +--------------------------------------------------------- + t2.f1 t2.f2 +--------------------------------------------------------- + 7 71 + 8 81 + 9 91 + 10 101 + diff --git a/test/cache/Bidirectional/exp.test012.ksh b/test/cache/Bidirectional/exp.test012.ksh new file mode 100644 index 00000000..86b88b2b --- /dev/null +++ b/test/cache/Bidirectional/exp.test012.ksh @@ -0,0 +1,110 @@ +table csql_log_int is created with records in target db +server 1 started +cache node 2 +echo select * from t1; +--------------------------------------------------------- + t1.f1 t1.f2 +--------------------------------------------------------- + 1 11 + 2 21 + 3 31 + 4 41 + 5 51 + 6 61 + 7 71 + 8 81 + 9 91 + 10 101 + +echo select * from t2; +--------------------------------------------------------- + t2.f1 t2.f2 +--------------------------------------------------------- + 1 11 + 2 21 + 3 31 + 4 41 + 5 51 + 6 61 + 7 71 + 8 81 + 9 91 + 10 101 + +server 2 started +cache node 1 +echo select * from t1; +--------------------------------------------------------- + t1.f1 t1.f2 +--------------------------------------------------------- + 1 11 + 2 21 + 3 31 + 4 41 + 5 51 + 6 61 + 7 71 + 8 81 + 9 91 + 10 101 + +echo select * from t2; +--------------------------------------------------------- + t2.f1 t2.f2 +--------------------------------------------------------- + 1 11 + 2 21 + 3 31 + 4 41 + 5 51 + 6 61 + 7 71 + 8 81 + 9 91 + 10 101 + +Delete operation in cache node 1 +cache node 1 +echo select * from t1; +--------------------------------------------------------- + t1.f1 t1.f2 +--------------------------------------------------------- + 1 11 + 2 21 + 3 31 + 4 41 + 5 51 + 6 61 + 7 71 + +echo select * from t2; +--------------------------------------------------------- + t2.f1 t2.f2 +--------------------------------------------------------- + 7 71 + 8 81 + 9 91 + 10 101 + +cache node 2 +echo select * from t1; +--------------------------------------------------------- + t1.f1 t1.f2 +--------------------------------------------------------- + 1 11 + 2 21 + 3 31 + 4 41 + 5 51 + 6 61 + 7 71 + +echo select * from t2; +--------------------------------------------------------- + t2.f1 t2.f2 +--------------------------------------------------------- + 7 71 + 8 81 + 9 91 + 10 101 + diff --git a/test/cache/Bidirectional/exp.test013.ksh b/test/cache/Bidirectional/exp.test013.ksh new file mode 100644 index 00000000..9a89cd2c --- /dev/null +++ b/test/cache/Bidirectional/exp.test013.ksh @@ -0,0 +1,1409 @@ +table creation file created +insert record file creates +select file created +trigger file generated +drop trigger file generated +Log table created in target DB +server started +echo select * from t1; +--------------------------------------------------------- + t1.f1 t1.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t2; +--------------------------------------------------------- + t2.f1 t2.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t3; +--------------------------------------------------------- + t3.f1 t3.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t4; +--------------------------------------------------------- + t4.f1 t4.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t5; +--------------------------------------------------------- + t5.f1 t5.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t6; +--------------------------------------------------------- + t6.f1 t6.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t7; +--------------------------------------------------------- + t7.f1 t7.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t8; +--------------------------------------------------------- + t8.f1 t8.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t9; +--------------------------------------------------------- + t9.f1 t9.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t10; +--------------------------------------------------------- + t10.f1 t10.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t11; +--------------------------------------------------------- + t11.f1 t11.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t12; +--------------------------------------------------------- + t12.f1 t12.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t13; +--------------------------------------------------------- + t13.f1 t13.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t14; +--------------------------------------------------------- + t14.f1 t14.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t15; +--------------------------------------------------------- + t15.f1 t15.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t16; +--------------------------------------------------------- + t16.f1 t16.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t17; +--------------------------------------------------------- + t17.f1 t17.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t18; +--------------------------------------------------------- + t18.f1 t18.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t19; +--------------------------------------------------------- + t19.f1 t19.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t20; +--------------------------------------------------------- + t20.f1 t20.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t21; +--------------------------------------------------------- + t21.f1 t21.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t22; +--------------------------------------------------------- + t22.f1 t22.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t23; +--------------------------------------------------------- + t23.f1 t23.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t24; +--------------------------------------------------------- + t24.f1 t24.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t25; +--------------------------------------------------------- + t25.f1 t25.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t26; +--------------------------------------------------------- + t26.f1 t26.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t27; +--------------------------------------------------------- + t27.f1 t27.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t28; +--------------------------------------------------------- + t28.f1 t28.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t29; +--------------------------------------------------------- + t29.f1 t29.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t30; +--------------------------------------------------------- + t30.f1 t30.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t31; +--------------------------------------------------------- + t31.f1 t31.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t32; +--------------------------------------------------------- + t32.f1 t32.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t33; +--------------------------------------------------------- + t33.f1 t33.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t34; +--------------------------------------------------------- + t34.f1 t34.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t35; +--------------------------------------------------------- + t35.f1 t35.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t36; +--------------------------------------------------------- + t36.f1 t36.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t37; +--------------------------------------------------------- + t37.f1 t37.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t38; +--------------------------------------------------------- + t38.f1 t38.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t39; +--------------------------------------------------------- + t39.f1 t39.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t40; +--------------------------------------------------------- + t40.f1 t40.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t41; +--------------------------------------------------------- + t41.f1 t41.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t42; +--------------------------------------------------------- + t42.f1 t42.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t43; +--------------------------------------------------------- + t43.f1 t43.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t44; +--------------------------------------------------------- + t44.f1 t44.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t45; +--------------------------------------------------------- + t45.f1 t45.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t46; +--------------------------------------------------------- + t46.f1 t46.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t47; +--------------------------------------------------------- + t47.f1 t47.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t48; +--------------------------------------------------------- + t48.f1 t48.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t49; +--------------------------------------------------------- + t49.f1 t49.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t50; +--------------------------------------------------------- + t50.f1 t50.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t51; +--------------------------------------------------------- + t51.f1 t51.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t52; +--------------------------------------------------------- + t52.f1 t52.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t53; +--------------------------------------------------------- + t53.f1 t53.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t54; +--------------------------------------------------------- + t54.f1 t54.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t55; +--------------------------------------------------------- + t55.f1 t55.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t56; +--------------------------------------------------------- + t56.f1 t56.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t57; +--------------------------------------------------------- + t57.f1 t57.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t58; +--------------------------------------------------------- + t58.f1 t58.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t59; +--------------------------------------------------------- + t59.f1 t59.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t60; +--------------------------------------------------------- + t60.f1 t60.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t61; +--------------------------------------------------------- + t61.f1 t61.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t62; +--------------------------------------------------------- + t62.f1 t62.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t63; +--------------------------------------------------------- + t63.f1 t63.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t64; +--------------------------------------------------------- + t64.f1 t64.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t65; +--------------------------------------------------------- + t65.f1 t65.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t66; +--------------------------------------------------------- + t66.f1 t66.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t67; +--------------------------------------------------------- + t67.f1 t67.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t68; +--------------------------------------------------------- + t68.f1 t68.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t69; +--------------------------------------------------------- + t69.f1 t69.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t70; +--------------------------------------------------------- + t70.f1 t70.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t71; +--------------------------------------------------------- + t71.f1 t71.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t72; +--------------------------------------------------------- + t72.f1 t72.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t73; +--------------------------------------------------------- + t73.f1 t73.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t74; +--------------------------------------------------------- + t74.f1 t74.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t75; +--------------------------------------------------------- + t75.f1 t75.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t76; +--------------------------------------------------------- + t76.f1 t76.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t77; +--------------------------------------------------------- + t77.f1 t77.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t78; +--------------------------------------------------------- + t78.f1 t78.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t79; +--------------------------------------------------------- + t79.f1 t79.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t80; +--------------------------------------------------------- + t80.f1 t80.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t81; +--------------------------------------------------------- + t81.f1 t81.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t82; +--------------------------------------------------------- + t82.f1 t82.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t83; +--------------------------------------------------------- + t83.f1 t83.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t84; +--------------------------------------------------------- + t84.f1 t84.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t85; +--------------------------------------------------------- + t85.f1 t85.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t86; +--------------------------------------------------------- + t86.f1 t86.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t87; +--------------------------------------------------------- + t87.f1 t87.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t88; +--------------------------------------------------------- + t88.f1 t88.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t89; +--------------------------------------------------------- + t89.f1 t89.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t90; +--------------------------------------------------------- + t90.f1 t90.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t91; +--------------------------------------------------------- + t91.f1 t91.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t92; +--------------------------------------------------------- + t92.f1 t92.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t93; +--------------------------------------------------------- + t93.f1 t93.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t94; +--------------------------------------------------------- + t94.f1 t94.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t95; +--------------------------------------------------------- + t95.f1 t95.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t96; +--------------------------------------------------------- + t96.f1 t96.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t97; +--------------------------------------------------------- + t97.f1 t97.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t98; +--------------------------------------------------------- + t98.f1 t98.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t99; +--------------------------------------------------------- + t99.f1 t99.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t100; +--------------------------------------------------------- + t100.f1 t100.f2 +--------------------------------------------------------- + 1 2 + +Insert some record in target database +Records in csql after insert in target DB +echo select * from t1; +--------------------------------------------------------- + t1.f1 t1.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t2; +--------------------------------------------------------- + t2.f1 t2.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t3; +--------------------------------------------------------- + t3.f1 t3.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t4; +--------------------------------------------------------- + t4.f1 t4.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t5; +--------------------------------------------------------- + t5.f1 t5.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t6; +--------------------------------------------------------- + t6.f1 t6.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t7; +--------------------------------------------------------- + t7.f1 t7.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t8; +--------------------------------------------------------- + t8.f1 t8.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t9; +--------------------------------------------------------- + t9.f1 t9.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t10; +--------------------------------------------------------- + t10.f1 t10.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t11; +--------------------------------------------------------- + t11.f1 t11.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t12; +--------------------------------------------------------- + t12.f1 t12.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t13; +--------------------------------------------------------- + t13.f1 t13.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t14; +--------------------------------------------------------- + t14.f1 t14.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t15; +--------------------------------------------------------- + t15.f1 t15.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t16; +--------------------------------------------------------- + t16.f1 t16.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t17; +--------------------------------------------------------- + t17.f1 t17.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t18; +--------------------------------------------------------- + t18.f1 t18.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t19; +--------------------------------------------------------- + t19.f1 t19.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t20; +--------------------------------------------------------- + t20.f1 t20.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t21; +--------------------------------------------------------- + t21.f1 t21.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t22; +--------------------------------------------------------- + t22.f1 t22.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t23; +--------------------------------------------------------- + t23.f1 t23.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t24; +--------------------------------------------------------- + t24.f1 t24.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t25; +--------------------------------------------------------- + t25.f1 t25.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t26; +--------------------------------------------------------- + t26.f1 t26.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t27; +--------------------------------------------------------- + t27.f1 t27.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t28; +--------------------------------------------------------- + t28.f1 t28.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t29; +--------------------------------------------------------- + t29.f1 t29.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t30; +--------------------------------------------------------- + t30.f1 t30.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t31; +--------------------------------------------------------- + t31.f1 t31.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t32; +--------------------------------------------------------- + t32.f1 t32.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t33; +--------------------------------------------------------- + t33.f1 t33.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t34; +--------------------------------------------------------- + t34.f1 t34.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t35; +--------------------------------------------------------- + t35.f1 t35.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t36; +--------------------------------------------------------- + t36.f1 t36.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t37; +--------------------------------------------------------- + t37.f1 t37.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t38; +--------------------------------------------------------- + t38.f1 t38.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t39; +--------------------------------------------------------- + t39.f1 t39.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t40; +--------------------------------------------------------- + t40.f1 t40.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t41; +--------------------------------------------------------- + t41.f1 t41.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t42; +--------------------------------------------------------- + t42.f1 t42.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t43; +--------------------------------------------------------- + t43.f1 t43.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t44; +--------------------------------------------------------- + t44.f1 t44.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t45; +--------------------------------------------------------- + t45.f1 t45.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t46; +--------------------------------------------------------- + t46.f1 t46.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t47; +--------------------------------------------------------- + t47.f1 t47.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t48; +--------------------------------------------------------- + t48.f1 t48.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t49; +--------------------------------------------------------- + t49.f1 t49.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t50; +--------------------------------------------------------- + t50.f1 t50.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t51; +--------------------------------------------------------- + t51.f1 t51.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t52; +--------------------------------------------------------- + t52.f1 t52.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t53; +--------------------------------------------------------- + t53.f1 t53.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t54; +--------------------------------------------------------- + t54.f1 t54.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t55; +--------------------------------------------------------- + t55.f1 t55.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t56; +--------------------------------------------------------- + t56.f1 t56.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t57; +--------------------------------------------------------- + t57.f1 t57.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t58; +--------------------------------------------------------- + t58.f1 t58.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t59; +--------------------------------------------------------- + t59.f1 t59.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t60; +--------------------------------------------------------- + t60.f1 t60.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t61; +--------------------------------------------------------- + t61.f1 t61.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t62; +--------------------------------------------------------- + t62.f1 t62.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t63; +--------------------------------------------------------- + t63.f1 t63.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t64; +--------------------------------------------------------- + t64.f1 t64.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t65; +--------------------------------------------------------- + t65.f1 t65.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t66; +--------------------------------------------------------- + t66.f1 t66.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t67; +--------------------------------------------------------- + t67.f1 t67.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t68; +--------------------------------------------------------- + t68.f1 t68.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t69; +--------------------------------------------------------- + t69.f1 t69.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t70; +--------------------------------------------------------- + t70.f1 t70.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t71; +--------------------------------------------------------- + t71.f1 t71.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t72; +--------------------------------------------------------- + t72.f1 t72.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t73; +--------------------------------------------------------- + t73.f1 t73.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t74; +--------------------------------------------------------- + t74.f1 t74.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t75; +--------------------------------------------------------- + t75.f1 t75.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t76; +--------------------------------------------------------- + t76.f1 t76.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t77; +--------------------------------------------------------- + t77.f1 t77.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t78; +--------------------------------------------------------- + t78.f1 t78.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t79; +--------------------------------------------------------- + t79.f1 t79.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t80; +--------------------------------------------------------- + t80.f1 t80.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t81; +--------------------------------------------------------- + t81.f1 t81.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t82; +--------------------------------------------------------- + t82.f1 t82.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t83; +--------------------------------------------------------- + t83.f1 t83.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t84; +--------------------------------------------------------- + t84.f1 t84.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t85; +--------------------------------------------------------- + t85.f1 t85.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t86; +--------------------------------------------------------- + t86.f1 t86.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t87; +--------------------------------------------------------- + t87.f1 t87.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t88; +--------------------------------------------------------- + t88.f1 t88.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t89; +--------------------------------------------------------- + t89.f1 t89.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t90; +--------------------------------------------------------- + t90.f1 t90.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t91; +--------------------------------------------------------- + t91.f1 t91.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t92; +--------------------------------------------------------- + t92.f1 t92.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t93; +--------------------------------------------------------- + t93.f1 t93.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t94; +--------------------------------------------------------- + t94.f1 t94.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t95; +--------------------------------------------------------- + t95.f1 t95.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t96; +--------------------------------------------------------- + t96.f1 t96.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t97; +--------------------------------------------------------- + t97.f1 t97.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t98; +--------------------------------------------------------- + t98.f1 t98.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t99; +--------------------------------------------------------- + t99.f1 t99.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t100; +--------------------------------------------------------- + t100.f1 t100.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + diff --git a/test/cache/Bidirectional/exp.test014.ksh b/test/cache/Bidirectional/exp.test014.ksh new file mode 100644 index 00000000..4449c7bd --- /dev/null +++ b/test/cache/Bidirectional/exp.test014.ksh @@ -0,0 +1,1609 @@ +table creation file created +select file created +Update file created +Trigger file generated +Drop trigger file generated +Log table created in target DB +server started +echo select * from t1; +--------------------------------------------------------- + t1.f1 t1.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t2; +--------------------------------------------------------- + t2.f1 t2.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t3; +--------------------------------------------------------- + t3.f1 t3.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t4; +--------------------------------------------------------- + t4.f1 t4.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t5; +--------------------------------------------------------- + t5.f1 t5.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t6; +--------------------------------------------------------- + t6.f1 t6.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t7; +--------------------------------------------------------- + t7.f1 t7.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t8; +--------------------------------------------------------- + t8.f1 t8.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t9; +--------------------------------------------------------- + t9.f1 t9.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t10; +--------------------------------------------------------- + t10.f1 t10.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t11; +--------------------------------------------------------- + t11.f1 t11.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t12; +--------------------------------------------------------- + t12.f1 t12.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t13; +--------------------------------------------------------- + t13.f1 t13.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t14; +--------------------------------------------------------- + t14.f1 t14.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t15; +--------------------------------------------------------- + t15.f1 t15.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t16; +--------------------------------------------------------- + t16.f1 t16.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t17; +--------------------------------------------------------- + t17.f1 t17.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t18; +--------------------------------------------------------- + t18.f1 t18.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t19; +--------------------------------------------------------- + t19.f1 t19.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t20; +--------------------------------------------------------- + t20.f1 t20.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t21; +--------------------------------------------------------- + t21.f1 t21.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t22; +--------------------------------------------------------- + t22.f1 t22.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t23; +--------------------------------------------------------- + t23.f1 t23.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t24; +--------------------------------------------------------- + t24.f1 t24.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t25; +--------------------------------------------------------- + t25.f1 t25.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t26; +--------------------------------------------------------- + t26.f1 t26.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t27; +--------------------------------------------------------- + t27.f1 t27.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t28; +--------------------------------------------------------- + t28.f1 t28.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t29; +--------------------------------------------------------- + t29.f1 t29.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t30; +--------------------------------------------------------- + t30.f1 t30.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t31; +--------------------------------------------------------- + t31.f1 t31.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t32; +--------------------------------------------------------- + t32.f1 t32.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t33; +--------------------------------------------------------- + t33.f1 t33.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t34; +--------------------------------------------------------- + t34.f1 t34.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t35; +--------------------------------------------------------- + t35.f1 t35.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t36; +--------------------------------------------------------- + t36.f1 t36.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t37; +--------------------------------------------------------- + t37.f1 t37.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t38; +--------------------------------------------------------- + t38.f1 t38.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t39; +--------------------------------------------------------- + t39.f1 t39.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t40; +--------------------------------------------------------- + t40.f1 t40.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t41; +--------------------------------------------------------- + t41.f1 t41.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t42; +--------------------------------------------------------- + t42.f1 t42.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t43; +--------------------------------------------------------- + t43.f1 t43.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t44; +--------------------------------------------------------- + t44.f1 t44.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t45; +--------------------------------------------------------- + t45.f1 t45.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t46; +--------------------------------------------------------- + t46.f1 t46.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t47; +--------------------------------------------------------- + t47.f1 t47.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t48; +--------------------------------------------------------- + t48.f1 t48.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t49; +--------------------------------------------------------- + t49.f1 t49.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t50; +--------------------------------------------------------- + t50.f1 t50.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t51; +--------------------------------------------------------- + t51.f1 t51.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t52; +--------------------------------------------------------- + t52.f1 t52.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t53; +--------------------------------------------------------- + t53.f1 t53.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t54; +--------------------------------------------------------- + t54.f1 t54.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t55; +--------------------------------------------------------- + t55.f1 t55.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t56; +--------------------------------------------------------- + t56.f1 t56.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t57; +--------------------------------------------------------- + t57.f1 t57.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t58; +--------------------------------------------------------- + t58.f1 t58.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t59; +--------------------------------------------------------- + t59.f1 t59.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t60; +--------------------------------------------------------- + t60.f1 t60.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t61; +--------------------------------------------------------- + t61.f1 t61.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t62; +--------------------------------------------------------- + t62.f1 t62.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t63; +--------------------------------------------------------- + t63.f1 t63.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t64; +--------------------------------------------------------- + t64.f1 t64.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t65; +--------------------------------------------------------- + t65.f1 t65.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t66; +--------------------------------------------------------- + t66.f1 t66.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t67; +--------------------------------------------------------- + t67.f1 t67.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t68; +--------------------------------------------------------- + t68.f1 t68.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t69; +--------------------------------------------------------- + t69.f1 t69.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t70; +--------------------------------------------------------- + t70.f1 t70.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t71; +--------------------------------------------------------- + t71.f1 t71.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t72; +--------------------------------------------------------- + t72.f1 t72.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t73; +--------------------------------------------------------- + t73.f1 t73.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t74; +--------------------------------------------------------- + t74.f1 t74.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t75; +--------------------------------------------------------- + t75.f1 t75.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t76; +--------------------------------------------------------- + t76.f1 t76.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t77; +--------------------------------------------------------- + t77.f1 t77.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t78; +--------------------------------------------------------- + t78.f1 t78.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t79; +--------------------------------------------------------- + t79.f1 t79.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t80; +--------------------------------------------------------- + t80.f1 t80.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t81; +--------------------------------------------------------- + t81.f1 t81.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t82; +--------------------------------------------------------- + t82.f1 t82.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t83; +--------------------------------------------------------- + t83.f1 t83.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t84; +--------------------------------------------------------- + t84.f1 t84.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t85; +--------------------------------------------------------- + t85.f1 t85.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t86; +--------------------------------------------------------- + t86.f1 t86.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t87; +--------------------------------------------------------- + t87.f1 t87.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t88; +--------------------------------------------------------- + t88.f1 t88.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t89; +--------------------------------------------------------- + t89.f1 t89.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t90; +--------------------------------------------------------- + t90.f1 t90.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t91; +--------------------------------------------------------- + t91.f1 t91.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t92; +--------------------------------------------------------- + t92.f1 t92.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t93; +--------------------------------------------------------- + t93.f1 t93.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t94; +--------------------------------------------------------- + t94.f1 t94.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t95; +--------------------------------------------------------- + t95.f1 t95.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t96; +--------------------------------------------------------- + t96.f1 t96.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t97; +--------------------------------------------------------- + t97.f1 t97.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t98; +--------------------------------------------------------- + t98.f1 t98.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t99; +--------------------------------------------------------- + t99.f1 t99.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t100; +--------------------------------------------------------- + t100.f1 t100.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +Update some record in target database +Records in csql after update in target DB +echo select * from t1; +--------------------------------------------------------- + t1.f1 t1.f2 +--------------------------------------------------------- + 1 2 + 10 50 + 11 50 + +echo select * from t2; +--------------------------------------------------------- + t2.f1 t2.f2 +--------------------------------------------------------- + 1 2 + 10 50 + 11 50 + +echo select * from t3; +--------------------------------------------------------- + t3.f1 t3.f2 +--------------------------------------------------------- + 1 2 + 10 50 + 11 50 + +echo select * from t4; +--------------------------------------------------------- + t4.f1 t4.f2 +--------------------------------------------------------- + 1 2 + 10 50 + 11 50 + +echo select * from t5; +--------------------------------------------------------- + t5.f1 t5.f2 +--------------------------------------------------------- + 1 2 + 10 50 + 11 50 + +echo select * from t6; +--------------------------------------------------------- + t6.f1 t6.f2 +--------------------------------------------------------- + 1 2 + 10 50 + 11 50 + +echo select * from t7; +--------------------------------------------------------- + t7.f1 t7.f2 +--------------------------------------------------------- + 1 2 + 10 50 + 11 50 + +echo select * from t8; +--------------------------------------------------------- + t8.f1 t8.f2 +--------------------------------------------------------- + 1 2 + 10 50 + 11 50 + +echo select * from t9; +--------------------------------------------------------- + t9.f1 t9.f2 +--------------------------------------------------------- + 1 2 + 10 50 + 11 50 + +echo select * from t10; +--------------------------------------------------------- + t10.f1 t10.f2 +--------------------------------------------------------- + 1 2 + 10 50 + 11 50 + +echo select * from t11; +--------------------------------------------------------- + t11.f1 t11.f2 +--------------------------------------------------------- + 1 2 + 10 50 + 11 50 + +echo select * from t12; +--------------------------------------------------------- + t12.f1 t12.f2 +--------------------------------------------------------- + 1 2 + 10 50 + 11 50 + +echo select * from t13; +--------------------------------------------------------- + t13.f1 t13.f2 +--------------------------------------------------------- + 1 2 + 10 50 + 11 50 + +echo select * from t14; +--------------------------------------------------------- + t14.f1 t14.f2 +--------------------------------------------------------- + 1 2 + 10 50 + 11 50 + +echo select * from t15; +--------------------------------------------------------- + t15.f1 t15.f2 +--------------------------------------------------------- + 1 2 + 10 50 + 11 50 + +echo select * from t16; +--------------------------------------------------------- + t16.f1 t16.f2 +--------------------------------------------------------- + 1 2 + 10 50 + 11 50 + +echo select * from t17; +--------------------------------------------------------- + t17.f1 t17.f2 +--------------------------------------------------------- + 1 2 + 10 50 + 11 50 + +echo select * from t18; +--------------------------------------------------------- + t18.f1 t18.f2 +--------------------------------------------------------- + 1 2 + 10 50 + 11 50 + +echo select * from t19; +--------------------------------------------------------- + t19.f1 t19.f2 +--------------------------------------------------------- + 1 2 + 10 50 + 11 50 + +echo select * from t20; +--------------------------------------------------------- + t20.f1 t20.f2 +--------------------------------------------------------- + 1 2 + 10 50 + 11 50 + +echo select * from t21; +--------------------------------------------------------- + t21.f1 t21.f2 +--------------------------------------------------------- + 1 2 + 10 50 + 11 50 + +echo select * from t22; +--------------------------------------------------------- + t22.f1 t22.f2 +--------------------------------------------------------- + 1 2 + 10 50 + 11 50 + +echo select * from t23; +--------------------------------------------------------- + t23.f1 t23.f2 +--------------------------------------------------------- + 1 2 + 10 50 + 11 50 + +echo select * from t24; +--------------------------------------------------------- + t24.f1 t24.f2 +--------------------------------------------------------- + 1 2 + 10 50 + 11 50 + +echo select * from t25; +--------------------------------------------------------- + t25.f1 t25.f2 +--------------------------------------------------------- + 1 2 + 10 50 + 11 50 + +echo select * from t26; +--------------------------------------------------------- + t26.f1 t26.f2 +--------------------------------------------------------- + 1 2 + 10 50 + 11 50 + +echo select * from t27; +--------------------------------------------------------- + t27.f1 t27.f2 +--------------------------------------------------------- + 1 2 + 10 50 + 11 50 + +echo select * from t28; +--------------------------------------------------------- + t28.f1 t28.f2 +--------------------------------------------------------- + 1 2 + 10 50 + 11 50 + +echo select * from t29; +--------------------------------------------------------- + t29.f1 t29.f2 +--------------------------------------------------------- + 1 2 + 10 50 + 11 50 + +echo select * from t30; +--------------------------------------------------------- + t30.f1 t30.f2 +--------------------------------------------------------- + 1 2 + 10 50 + 11 50 + +echo select * from t31; +--------------------------------------------------------- + t31.f1 t31.f2 +--------------------------------------------------------- + 1 2 + 10 50 + 11 50 + +echo select * from t32; +--------------------------------------------------------- + t32.f1 t32.f2 +--------------------------------------------------------- + 1 2 + 10 50 + 11 50 + +echo select * from t33; +--------------------------------------------------------- + t33.f1 t33.f2 +--------------------------------------------------------- + 1 2 + 10 50 + 11 50 + +echo select * from t34; +--------------------------------------------------------- + t34.f1 t34.f2 +--------------------------------------------------------- + 1 2 + 10 50 + 11 50 + +echo select * from t35; +--------------------------------------------------------- + t35.f1 t35.f2 +--------------------------------------------------------- + 1 2 + 10 50 + 11 50 + +echo select * from t36; +--------------------------------------------------------- + t36.f1 t36.f2 +--------------------------------------------------------- + 1 2 + 10 50 + 11 50 + +echo select * from t37; +--------------------------------------------------------- + t37.f1 t37.f2 +--------------------------------------------------------- + 1 2 + 10 50 + 11 50 + +echo select * from t38; +--------------------------------------------------------- + t38.f1 t38.f2 +--------------------------------------------------------- + 1 2 + 10 50 + 11 50 + +echo select * from t39; +--------------------------------------------------------- + t39.f1 t39.f2 +--------------------------------------------------------- + 1 2 + 10 50 + 11 50 + +echo select * from t40; +--------------------------------------------------------- + t40.f1 t40.f2 +--------------------------------------------------------- + 1 2 + 10 50 + 11 50 + +echo select * from t41; +--------------------------------------------------------- + t41.f1 t41.f2 +--------------------------------------------------------- + 1 2 + 10 50 + 11 50 + +echo select * from t42; +--------------------------------------------------------- + t42.f1 t42.f2 +--------------------------------------------------------- + 1 2 + 10 50 + 11 50 + +echo select * from t43; +--------------------------------------------------------- + t43.f1 t43.f2 +--------------------------------------------------------- + 1 2 + 10 50 + 11 50 + +echo select * from t44; +--------------------------------------------------------- + t44.f1 t44.f2 +--------------------------------------------------------- + 1 2 + 10 50 + 11 50 + +echo select * from t45; +--------------------------------------------------------- + t45.f1 t45.f2 +--------------------------------------------------------- + 1 2 + 10 50 + 11 50 + +echo select * from t46; +--------------------------------------------------------- + t46.f1 t46.f2 +--------------------------------------------------------- + 1 2 + 10 50 + 11 50 + +echo select * from t47; +--------------------------------------------------------- + t47.f1 t47.f2 +--------------------------------------------------------- + 1 2 + 10 50 + 11 50 + +echo select * from t48; +--------------------------------------------------------- + t48.f1 t48.f2 +--------------------------------------------------------- + 1 2 + 10 50 + 11 50 + +echo select * from t49; +--------------------------------------------------------- + t49.f1 t49.f2 +--------------------------------------------------------- + 1 2 + 10 50 + 11 50 + +echo select * from t50; +--------------------------------------------------------- + t50.f1 t50.f2 +--------------------------------------------------------- + 1 2 + 10 50 + 11 50 + +echo select * from t51; +--------------------------------------------------------- + t51.f1 t51.f2 +--------------------------------------------------------- + 1 2 + 10 50 + 11 50 + +echo select * from t52; +--------------------------------------------------------- + t52.f1 t52.f2 +--------------------------------------------------------- + 1 2 + 10 50 + 11 50 + +echo select * from t53; +--------------------------------------------------------- + t53.f1 t53.f2 +--------------------------------------------------------- + 1 2 + 10 50 + 11 50 + +echo select * from t54; +--------------------------------------------------------- + t54.f1 t54.f2 +--------------------------------------------------------- + 1 2 + 10 50 + 11 50 + +echo select * from t55; +--------------------------------------------------------- + t55.f1 t55.f2 +--------------------------------------------------------- + 1 2 + 10 50 + 11 50 + +echo select * from t56; +--------------------------------------------------------- + t56.f1 t56.f2 +--------------------------------------------------------- + 1 2 + 10 50 + 11 50 + +echo select * from t57; +--------------------------------------------------------- + t57.f1 t57.f2 +--------------------------------------------------------- + 1 2 + 10 50 + 11 50 + +echo select * from t58; +--------------------------------------------------------- + t58.f1 t58.f2 +--------------------------------------------------------- + 1 2 + 10 50 + 11 50 + +echo select * from t59; +--------------------------------------------------------- + t59.f1 t59.f2 +--------------------------------------------------------- + 1 2 + 10 50 + 11 50 + +echo select * from t60; +--------------------------------------------------------- + t60.f1 t60.f2 +--------------------------------------------------------- + 1 2 + 10 50 + 11 50 + +echo select * from t61; +--------------------------------------------------------- + t61.f1 t61.f2 +--------------------------------------------------------- + 1 2 + 10 50 + 11 50 + +echo select * from t62; +--------------------------------------------------------- + t62.f1 t62.f2 +--------------------------------------------------------- + 1 2 + 10 50 + 11 50 + +echo select * from t63; +--------------------------------------------------------- + t63.f1 t63.f2 +--------------------------------------------------------- + 1 2 + 10 50 + 11 50 + +echo select * from t64; +--------------------------------------------------------- + t64.f1 t64.f2 +--------------------------------------------------------- + 1 2 + 10 50 + 11 50 + +echo select * from t65; +--------------------------------------------------------- + t65.f1 t65.f2 +--------------------------------------------------------- + 1 2 + 10 50 + 11 50 + +echo select * from t66; +--------------------------------------------------------- + t66.f1 t66.f2 +--------------------------------------------------------- + 1 2 + 10 50 + 11 50 + +echo select * from t67; +--------------------------------------------------------- + t67.f1 t67.f2 +--------------------------------------------------------- + 1 2 + 10 50 + 11 50 + +echo select * from t68; +--------------------------------------------------------- + t68.f1 t68.f2 +--------------------------------------------------------- + 1 2 + 10 50 + 11 50 + +echo select * from t69; +--------------------------------------------------------- + t69.f1 t69.f2 +--------------------------------------------------------- + 1 2 + 10 50 + 11 50 + +echo select * from t70; +--------------------------------------------------------- + t70.f1 t70.f2 +--------------------------------------------------------- + 1 2 + 10 50 + 11 50 + +echo select * from t71; +--------------------------------------------------------- + t71.f1 t71.f2 +--------------------------------------------------------- + 1 2 + 10 50 + 11 50 + +echo select * from t72; +--------------------------------------------------------- + t72.f1 t72.f2 +--------------------------------------------------------- + 1 2 + 10 50 + 11 50 + +echo select * from t73; +--------------------------------------------------------- + t73.f1 t73.f2 +--------------------------------------------------------- + 1 2 + 10 50 + 11 50 + +echo select * from t74; +--------------------------------------------------------- + t74.f1 t74.f2 +--------------------------------------------------------- + 1 2 + 10 50 + 11 50 + +echo select * from t75; +--------------------------------------------------------- + t75.f1 t75.f2 +--------------------------------------------------------- + 1 2 + 10 50 + 11 50 + +echo select * from t76; +--------------------------------------------------------- + t76.f1 t76.f2 +--------------------------------------------------------- + 1 2 + 10 50 + 11 50 + +echo select * from t77; +--------------------------------------------------------- + t77.f1 t77.f2 +--------------------------------------------------------- + 1 2 + 10 50 + 11 50 + +echo select * from t78; +--------------------------------------------------------- + t78.f1 t78.f2 +--------------------------------------------------------- + 1 2 + 10 50 + 11 50 + +echo select * from t79; +--------------------------------------------------------- + t79.f1 t79.f2 +--------------------------------------------------------- + 1 2 + 10 50 + 11 50 + +echo select * from t80; +--------------------------------------------------------- + t80.f1 t80.f2 +--------------------------------------------------------- + 1 2 + 10 50 + 11 50 + +echo select * from t81; +--------------------------------------------------------- + t81.f1 t81.f2 +--------------------------------------------------------- + 1 2 + 10 50 + 11 50 + +echo select * from t82; +--------------------------------------------------------- + t82.f1 t82.f2 +--------------------------------------------------------- + 1 2 + 10 50 + 11 50 + +echo select * from t83; +--------------------------------------------------------- + t83.f1 t83.f2 +--------------------------------------------------------- + 1 2 + 10 50 + 11 50 + +echo select * from t84; +--------------------------------------------------------- + t84.f1 t84.f2 +--------------------------------------------------------- + 1 2 + 10 50 + 11 50 + +echo select * from t85; +--------------------------------------------------------- + t85.f1 t85.f2 +--------------------------------------------------------- + 1 2 + 10 50 + 11 50 + +echo select * from t86; +--------------------------------------------------------- + t86.f1 t86.f2 +--------------------------------------------------------- + 1 2 + 10 50 + 11 50 + +echo select * from t87; +--------------------------------------------------------- + t87.f1 t87.f2 +--------------------------------------------------------- + 1 2 + 10 50 + 11 50 + +echo select * from t88; +--------------------------------------------------------- + t88.f1 t88.f2 +--------------------------------------------------------- + 1 2 + 10 50 + 11 50 + +echo select * from t89; +--------------------------------------------------------- + t89.f1 t89.f2 +--------------------------------------------------------- + 1 2 + 10 50 + 11 50 + +echo select * from t90; +--------------------------------------------------------- + t90.f1 t90.f2 +--------------------------------------------------------- + 1 2 + 10 50 + 11 50 + +echo select * from t91; +--------------------------------------------------------- + t91.f1 t91.f2 +--------------------------------------------------------- + 1 2 + 10 50 + 11 50 + +echo select * from t92; +--------------------------------------------------------- + t92.f1 t92.f2 +--------------------------------------------------------- + 1 2 + 10 50 + 11 50 + +echo select * from t93; +--------------------------------------------------------- + t93.f1 t93.f2 +--------------------------------------------------------- + 1 2 + 10 50 + 11 50 + +echo select * from t94; +--------------------------------------------------------- + t94.f1 t94.f2 +--------------------------------------------------------- + 1 2 + 10 50 + 11 50 + +echo select * from t95; +--------------------------------------------------------- + t95.f1 t95.f2 +--------------------------------------------------------- + 1 2 + 10 50 + 11 50 + +echo select * from t96; +--------------------------------------------------------- + t96.f1 t96.f2 +--------------------------------------------------------- + 1 2 + 10 50 + 11 50 + +echo select * from t97; +--------------------------------------------------------- + t97.f1 t97.f2 +--------------------------------------------------------- + 1 2 + 10 50 + 11 50 + +echo select * from t98; +--------------------------------------------------------- + t98.f1 t98.f2 +--------------------------------------------------------- + 1 2 + 10 50 + 11 50 + +echo select * from t99; +--------------------------------------------------------- + t99.f1 t99.f2 +--------------------------------------------------------- + 1 2 + 10 50 + 11 50 + +echo select * from t100; +--------------------------------------------------------- + t100.f1 t100.f2 +--------------------------------------------------------- + 1 2 + 10 50 + 11 50 + diff --git a/test/cache/Bidirectional/exp.test015.ksh b/test/cache/Bidirectional/exp.test015.ksh new file mode 100644 index 00000000..f0eee952 --- /dev/null +++ b/test/cache/Bidirectional/exp.test015.ksh @@ -0,0 +1,1409 @@ +table creation file created +select file created +Update file created +Trigger file generated +Drop trigger file generated +Log table created in target DB +server started +echo select * from t1; +--------------------------------------------------------- + t1.f1 t1.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t2; +--------------------------------------------------------- + t2.f1 t2.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t3; +--------------------------------------------------------- + t3.f1 t3.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t4; +--------------------------------------------------------- + t4.f1 t4.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t5; +--------------------------------------------------------- + t5.f1 t5.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t6; +--------------------------------------------------------- + t6.f1 t6.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t7; +--------------------------------------------------------- + t7.f1 t7.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t8; +--------------------------------------------------------- + t8.f1 t8.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t9; +--------------------------------------------------------- + t9.f1 t9.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t10; +--------------------------------------------------------- + t10.f1 t10.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t11; +--------------------------------------------------------- + t11.f1 t11.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t12; +--------------------------------------------------------- + t12.f1 t12.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t13; +--------------------------------------------------------- + t13.f1 t13.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t14; +--------------------------------------------------------- + t14.f1 t14.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t15; +--------------------------------------------------------- + t15.f1 t15.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t16; +--------------------------------------------------------- + t16.f1 t16.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t17; +--------------------------------------------------------- + t17.f1 t17.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t18; +--------------------------------------------------------- + t18.f1 t18.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t19; +--------------------------------------------------------- + t19.f1 t19.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t20; +--------------------------------------------------------- + t20.f1 t20.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t21; +--------------------------------------------------------- + t21.f1 t21.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t22; +--------------------------------------------------------- + t22.f1 t22.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t23; +--------------------------------------------------------- + t23.f1 t23.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t24; +--------------------------------------------------------- + t24.f1 t24.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t25; +--------------------------------------------------------- + t25.f1 t25.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t26; +--------------------------------------------------------- + t26.f1 t26.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t27; +--------------------------------------------------------- + t27.f1 t27.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t28; +--------------------------------------------------------- + t28.f1 t28.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t29; +--------------------------------------------------------- + t29.f1 t29.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t30; +--------------------------------------------------------- + t30.f1 t30.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t31; +--------------------------------------------------------- + t31.f1 t31.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t32; +--------------------------------------------------------- + t32.f1 t32.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t33; +--------------------------------------------------------- + t33.f1 t33.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t34; +--------------------------------------------------------- + t34.f1 t34.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t35; +--------------------------------------------------------- + t35.f1 t35.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t36; +--------------------------------------------------------- + t36.f1 t36.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t37; +--------------------------------------------------------- + t37.f1 t37.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t38; +--------------------------------------------------------- + t38.f1 t38.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t39; +--------------------------------------------------------- + t39.f1 t39.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t40; +--------------------------------------------------------- + t40.f1 t40.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t41; +--------------------------------------------------------- + t41.f1 t41.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t42; +--------------------------------------------------------- + t42.f1 t42.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t43; +--------------------------------------------------------- + t43.f1 t43.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t44; +--------------------------------------------------------- + t44.f1 t44.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t45; +--------------------------------------------------------- + t45.f1 t45.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t46; +--------------------------------------------------------- + t46.f1 t46.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t47; +--------------------------------------------------------- + t47.f1 t47.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t48; +--------------------------------------------------------- + t48.f1 t48.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t49; +--------------------------------------------------------- + t49.f1 t49.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t50; +--------------------------------------------------------- + t50.f1 t50.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t51; +--------------------------------------------------------- + t51.f1 t51.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t52; +--------------------------------------------------------- + t52.f1 t52.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t53; +--------------------------------------------------------- + t53.f1 t53.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t54; +--------------------------------------------------------- + t54.f1 t54.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t55; +--------------------------------------------------------- + t55.f1 t55.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t56; +--------------------------------------------------------- + t56.f1 t56.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t57; +--------------------------------------------------------- + t57.f1 t57.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t58; +--------------------------------------------------------- + t58.f1 t58.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t59; +--------------------------------------------------------- + t59.f1 t59.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t60; +--------------------------------------------------------- + t60.f1 t60.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t61; +--------------------------------------------------------- + t61.f1 t61.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t62; +--------------------------------------------------------- + t62.f1 t62.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t63; +--------------------------------------------------------- + t63.f1 t63.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t64; +--------------------------------------------------------- + t64.f1 t64.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t65; +--------------------------------------------------------- + t65.f1 t65.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t66; +--------------------------------------------------------- + t66.f1 t66.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t67; +--------------------------------------------------------- + t67.f1 t67.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t68; +--------------------------------------------------------- + t68.f1 t68.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t69; +--------------------------------------------------------- + t69.f1 t69.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t70; +--------------------------------------------------------- + t70.f1 t70.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t71; +--------------------------------------------------------- + t71.f1 t71.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t72; +--------------------------------------------------------- + t72.f1 t72.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t73; +--------------------------------------------------------- + t73.f1 t73.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t74; +--------------------------------------------------------- + t74.f1 t74.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t75; +--------------------------------------------------------- + t75.f1 t75.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t76; +--------------------------------------------------------- + t76.f1 t76.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t77; +--------------------------------------------------------- + t77.f1 t77.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t78; +--------------------------------------------------------- + t78.f1 t78.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t79; +--------------------------------------------------------- + t79.f1 t79.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t80; +--------------------------------------------------------- + t80.f1 t80.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t81; +--------------------------------------------------------- + t81.f1 t81.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t82; +--------------------------------------------------------- + t82.f1 t82.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t83; +--------------------------------------------------------- + t83.f1 t83.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t84; +--------------------------------------------------------- + t84.f1 t84.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t85; +--------------------------------------------------------- + t85.f1 t85.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t86; +--------------------------------------------------------- + t86.f1 t86.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t87; +--------------------------------------------------------- + t87.f1 t87.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t88; +--------------------------------------------------------- + t88.f1 t88.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t89; +--------------------------------------------------------- + t89.f1 t89.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t90; +--------------------------------------------------------- + t90.f1 t90.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t91; +--------------------------------------------------------- + t91.f1 t91.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t92; +--------------------------------------------------------- + t92.f1 t92.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t93; +--------------------------------------------------------- + t93.f1 t93.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t94; +--------------------------------------------------------- + t94.f1 t94.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t95; +--------------------------------------------------------- + t95.f1 t95.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t96; +--------------------------------------------------------- + t96.f1 t96.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t97; +--------------------------------------------------------- + t97.f1 t97.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t98; +--------------------------------------------------------- + t98.f1 t98.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t99; +--------------------------------------------------------- + t99.f1 t99.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +echo select * from t100; +--------------------------------------------------------- + t100.f1 t100.f2 +--------------------------------------------------------- + 1 2 + 10 20 + 11 21 + +Delete some record in target database +Records in csql after Delete some recode from target DB +echo select * from t1; +--------------------------------------------------------- + t1.f1 t1.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t2; +--------------------------------------------------------- + t2.f1 t2.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t3; +--------------------------------------------------------- + t3.f1 t3.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t4; +--------------------------------------------------------- + t4.f1 t4.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t5; +--------------------------------------------------------- + t5.f1 t5.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t6; +--------------------------------------------------------- + t6.f1 t6.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t7; +--------------------------------------------------------- + t7.f1 t7.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t8; +--------------------------------------------------------- + t8.f1 t8.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t9; +--------------------------------------------------------- + t9.f1 t9.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t10; +--------------------------------------------------------- + t10.f1 t10.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t11; +--------------------------------------------------------- + t11.f1 t11.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t12; +--------------------------------------------------------- + t12.f1 t12.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t13; +--------------------------------------------------------- + t13.f1 t13.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t14; +--------------------------------------------------------- + t14.f1 t14.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t15; +--------------------------------------------------------- + t15.f1 t15.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t16; +--------------------------------------------------------- + t16.f1 t16.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t17; +--------------------------------------------------------- + t17.f1 t17.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t18; +--------------------------------------------------------- + t18.f1 t18.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t19; +--------------------------------------------------------- + t19.f1 t19.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t20; +--------------------------------------------------------- + t20.f1 t20.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t21; +--------------------------------------------------------- + t21.f1 t21.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t22; +--------------------------------------------------------- + t22.f1 t22.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t23; +--------------------------------------------------------- + t23.f1 t23.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t24; +--------------------------------------------------------- + t24.f1 t24.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t25; +--------------------------------------------------------- + t25.f1 t25.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t26; +--------------------------------------------------------- + t26.f1 t26.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t27; +--------------------------------------------------------- + t27.f1 t27.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t28; +--------------------------------------------------------- + t28.f1 t28.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t29; +--------------------------------------------------------- + t29.f1 t29.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t30; +--------------------------------------------------------- + t30.f1 t30.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t31; +--------------------------------------------------------- + t31.f1 t31.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t32; +--------------------------------------------------------- + t32.f1 t32.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t33; +--------------------------------------------------------- + t33.f1 t33.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t34; +--------------------------------------------------------- + t34.f1 t34.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t35; +--------------------------------------------------------- + t35.f1 t35.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t36; +--------------------------------------------------------- + t36.f1 t36.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t37; +--------------------------------------------------------- + t37.f1 t37.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t38; +--------------------------------------------------------- + t38.f1 t38.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t39; +--------------------------------------------------------- + t39.f1 t39.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t40; +--------------------------------------------------------- + t40.f1 t40.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t41; +--------------------------------------------------------- + t41.f1 t41.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t42; +--------------------------------------------------------- + t42.f1 t42.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t43; +--------------------------------------------------------- + t43.f1 t43.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t44; +--------------------------------------------------------- + t44.f1 t44.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t45; +--------------------------------------------------------- + t45.f1 t45.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t46; +--------------------------------------------------------- + t46.f1 t46.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t47; +--------------------------------------------------------- + t47.f1 t47.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t48; +--------------------------------------------------------- + t48.f1 t48.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t49; +--------------------------------------------------------- + t49.f1 t49.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t50; +--------------------------------------------------------- + t50.f1 t50.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t51; +--------------------------------------------------------- + t51.f1 t51.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t52; +--------------------------------------------------------- + t52.f1 t52.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t53; +--------------------------------------------------------- + t53.f1 t53.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t54; +--------------------------------------------------------- + t54.f1 t54.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t55; +--------------------------------------------------------- + t55.f1 t55.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t56; +--------------------------------------------------------- + t56.f1 t56.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t57; +--------------------------------------------------------- + t57.f1 t57.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t58; +--------------------------------------------------------- + t58.f1 t58.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t59; +--------------------------------------------------------- + t59.f1 t59.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t60; +--------------------------------------------------------- + t60.f1 t60.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t61; +--------------------------------------------------------- + t61.f1 t61.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t62; +--------------------------------------------------------- + t62.f1 t62.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t63; +--------------------------------------------------------- + t63.f1 t63.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t64; +--------------------------------------------------------- + t64.f1 t64.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t65; +--------------------------------------------------------- + t65.f1 t65.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t66; +--------------------------------------------------------- + t66.f1 t66.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t67; +--------------------------------------------------------- + t67.f1 t67.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t68; +--------------------------------------------------------- + t68.f1 t68.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t69; +--------------------------------------------------------- + t69.f1 t69.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t70; +--------------------------------------------------------- + t70.f1 t70.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t71; +--------------------------------------------------------- + t71.f1 t71.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t72; +--------------------------------------------------------- + t72.f1 t72.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t73; +--------------------------------------------------------- + t73.f1 t73.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t74; +--------------------------------------------------------- + t74.f1 t74.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t75; +--------------------------------------------------------- + t75.f1 t75.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t76; +--------------------------------------------------------- + t76.f1 t76.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t77; +--------------------------------------------------------- + t77.f1 t77.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t78; +--------------------------------------------------------- + t78.f1 t78.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t79; +--------------------------------------------------------- + t79.f1 t79.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t80; +--------------------------------------------------------- + t80.f1 t80.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t81; +--------------------------------------------------------- + t81.f1 t81.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t82; +--------------------------------------------------------- + t82.f1 t82.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t83; +--------------------------------------------------------- + t83.f1 t83.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t84; +--------------------------------------------------------- + t84.f1 t84.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t85; +--------------------------------------------------------- + t85.f1 t85.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t86; +--------------------------------------------------------- + t86.f1 t86.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t87; +--------------------------------------------------------- + t87.f1 t87.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t88; +--------------------------------------------------------- + t88.f1 t88.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t89; +--------------------------------------------------------- + t89.f1 t89.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t90; +--------------------------------------------------------- + t90.f1 t90.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t91; +--------------------------------------------------------- + t91.f1 t91.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t92; +--------------------------------------------------------- + t92.f1 t92.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t93; +--------------------------------------------------------- + t93.f1 t93.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t94; +--------------------------------------------------------- + t94.f1 t94.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t95; +--------------------------------------------------------- + t95.f1 t95.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t96; +--------------------------------------------------------- + t96.f1 t96.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t97; +--------------------------------------------------------- + t97.f1 t97.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t98; +--------------------------------------------------------- + t98.f1 t98.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t99; +--------------------------------------------------------- + t99.f1 t99.f2 +--------------------------------------------------------- + 1 2 + +echo select * from t100; +--------------------------------------------------------- + t100.f1 t100.f2 +--------------------------------------------------------- + 1 2 + diff --git a/test/cache/Bidirectional/exp.test016.ksh b/test/cache/Bidirectional/exp.test016.ksh new file mode 100644 index 00000000..93f12412 --- /dev/null +++ b/test/cache/Bidirectional/exp.test016.ksh @@ -0,0 +1,66 @@ +Log table created in target DB +server started +echo select * from t1; +--------------------------------------------------------- + t1.f1 t1.f2 +--------------------------------------------------------- + 1 11 + 2 21 + 3 31 + 4 41 + 5 51 + 6 61 + 7 71 + 8 81 + 9 91 + 10 101 + +echo select * from t2; +--------------------------------------------------------- + t2.f1 t2.f2 +--------------------------------------------------------- + 1 11 + 2 21 + 3 31 + 4 41 + 5 51 + 6 61 + 7 71 + 8 81 + 9 91 + 10 101 + +echo select * from t1; +--------------------------------------------------------- + t1.f1 t1.f2 +--------------------------------------------------------- + 1 11 + 2 21 + 3 31 + 4 41 + 5 51 + 6 61 + 7 71 + 8 81 + 9 91 + 10 101 + 11 NULL + 12 NULL + +echo select * from t2; +--------------------------------------------------------- + t2.f1 t2.f2 +--------------------------------------------------------- + 1 11 + 2 21 + 3 31 + 4 41 + 5 51 + 6 61 + 7 71 + 8 81 + 9 91 + 10 101 + 11 NULL + 12 NULL + diff --git a/test/cache/Bidirectional/exp.test017.ksh b/test/cache/Bidirectional/exp.test017.ksh new file mode 100644 index 00000000..7b960d61 --- /dev/null +++ b/test/cache/Bidirectional/exp.test017.ksh @@ -0,0 +1,30 @@ +Log table created in target DB +server started +--------------------------------------------------------- + t1.f1 t1.f2 +--------------------------------------------------------- + 1 papu + 2 papu + 3 papu + 4 papu + 5 papu + 6 papu + 7 papu + 8 papu + 9 papu + +--------------------------------------------------------- + t1.f1 t1.f2 +--------------------------------------------------------- + 1 papu + 2 papu + 3 papu + 4 papu + 5 papu + 6 papu + 7 papu + 8 papu + 9 papu + 100 papu + 101 biju + diff --git a/test/cache/Bidirectional/exp.test018.ksh b/test/cache/Bidirectional/exp.test018.ksh new file mode 100644 index 00000000..23fbf806 --- /dev/null +++ b/test/cache/Bidirectional/exp.test018.ksh @@ -0,0 +1,19 @@ +Log table created in target DB +server started +--------------------------------------------------------- + t1.f1 t1.f2 t1.f3 t1.f4 +--------------------------------------------------------- + 11 papu 12 123135 + 12 papu 12 123136 + 13 papu 12 123137 + 14 papu 12 123138 + +--------------------------------------------------------- + t1.f1 t1.f2 t1.f3 t1.f4 +--------------------------------------------------------- + 11 papu 12 123135 + 12 papu 12 123136 + 13 papu 12 123137 + 14 papu 12 123138 + 17 papu 12 123124 + diff --git a/test/cache/Bidirectional/exp.test019.ksh b/test/cache/Bidirectional/exp.test019.ksh new file mode 100644 index 00000000..45b9782d --- /dev/null +++ b/test/cache/Bidirectional/exp.test019.ksh @@ -0,0 +1,19 @@ +Log table created in target DB +server started +--------------------------------------------------------- + t1.f1 t1.f2 +--------------------------------------------------------- + 11 papu + 12 papu + 13 papu + 14 papu + +--------------------------------------------------------- + t1.f1 t1.f2 +--------------------------------------------------------- + 11 papu + 12 papu + 13 papu + 14 papu + 17 papu + diff --git a/test/cache/Bidirectional/exp.test020.ksh b/test/cache/Bidirectional/exp.test020.ksh new file mode 100644 index 00000000..b5d1f5c7 --- /dev/null +++ b/test/cache/Bidirectional/exp.test020.ksh @@ -0,0 +1,19 @@ +Log table created in target DB +server started +--------------------------------------------------------- + t1.f1 t1.f3 t1.f2 +--------------------------------------------------------- + 11 12 papu + 12 12 papu + 13 12 papu + 14 12 papu + +--------------------------------------------------------- + t1.f1 t1.f3 t1.f2 +--------------------------------------------------------- + 11 12 papu + 12 12 papu + 13 12 papu + 14 12 papu + 17 12 papu + diff --git a/test/cache/Bidirectional/exp.test021.ksh b/test/cache/Bidirectional/exp.test021.ksh new file mode 100644 index 00000000..61d07391 --- /dev/null +++ b/test/cache/Bidirectional/exp.test021.ksh @@ -0,0 +1,21 @@ +Log table created in target DB +server started +--------------------------------------------------------- + t1.f1 t1.f2 t1.f4 +--------------------------------------------------------- + 11 papu11 123135 + 12 papu12 123136 + 13 papu13 123137 + 14 papu14 123138 + +--------------------------------------------------------- + t1.f1 t1.f2 t1.f4 +--------------------------------------------------------- + 11 papu11 123135 + 12 papu12 123136 + 13 papu13 123137 + 14 papu14 123138 + 17 papu 123124 + 7 biju 123125 + 10 tapu 1231266 + diff --git a/test/cache/Bidirectional/exp.test022.ksh b/test/cache/Bidirectional/exp.test022.ksh new file mode 100644 index 00000000..6ba5965a --- /dev/null +++ b/test/cache/Bidirectional/exp.test022.ksh @@ -0,0 +1,19 @@ +Log table created in target DB +server started +--------------------------------------------------------- + t1.f1 t1.f3 t1.f2 +--------------------------------------------------------- + 11 12 papu11 + 12 12 papu12 + 13 12 papu13 + 14 12 papu14 + +--------------------------------------------------------- + t1.f1 t1.f3 t1.f2 +--------------------------------------------------------- + 11 12 papu11 + 12 12 papu12 + 13 12 papu13 + 14 12 papu14 + 17 12 papu + diff --git a/test/cache/Bidirectional/insert.sql b/test/cache/Bidirectional/insert.sql new file mode 100644 index 00000000..4c4389b3 --- /dev/null +++ b/test/cache/Bidirectional/insert.sql @@ -0,0 +1,2 @@ +insert into t1 values(12,123); +insert into t2 values(15,125); diff --git a/test/cache/Bidirectional/mysqlcreatelogtable.sql b/test/cache/Bidirectional/mysqlcreatelogtable.sql new file mode 100644 index 00000000..a8ad0426 --- /dev/null +++ b/test/cache/Bidirectional/mysqlcreatelogtable.sql @@ -0,0 +1 @@ +create table csql_log_int (tablename char(64), pkid int, operation int, cacheid int, id int not null unique auto_increment) engine='innodb'; diff --git a/test/cache/Bidirectional/mysqldeletelogtable.sql b/test/cache/Bidirectional/mysqldeletelogtable.sql new file mode 100644 index 00000000..f9236c77 --- /dev/null +++ b/test/cache/Bidirectional/mysqldeletelogtable.sql @@ -0,0 +1 @@ +delete from csql_log_int; diff --git a/test/cache/Bidirectional/oraclecreatelogtable.sql b/test/cache/Bidirectional/oraclecreatelogtable.sql new file mode 100644 index 00000000..849ebddf --- /dev/null +++ b/test/cache/Bidirectional/oraclecreatelogtable.sql @@ -0,0 +1,4 @@ +drop table csql_log_int; +drop SEQUENCE CSQL_ID; +create table csql_log_int(tablename char(64), pkid number(9), operation number(9), cacheid number(9), id number(9) not null ); +CREATE SEQUENCE "CSQL_ID" MINVALUE 1 INCREMENT BY 1 START WITH 1 ; diff --git a/test/cache/Bidirectional/psqlcreatelogtable.sql b/test/cache/Bidirectional/psqlcreatelogtable.sql new file mode 100644 index 00000000..72acb8d5 --- /dev/null +++ b/test/cache/Bidirectional/psqlcreatelogtable.sql @@ -0,0 +1,2 @@ +create table csql_log_int(tablename varchar(64), pkid int, operation int,cacheid int); +alter table csql_log_int add id serial; diff --git a/test/cache/Bidirectional/select.sql b/test/cache/Bidirectional/select.sql new file mode 100644 index 00000000..bc549f2b --- /dev/null +++ b/test/cache/Bidirectional/select.sql @@ -0,0 +1,4 @@ +echo select * from t1; +select * from t1; +echo select * from t2; +select * from t2; diff --git a/test/cache/Bidirectional/sybasecreate.sql b/test/cache/Bidirectional/sybasecreate.sql new file mode 100644 index 00000000..f25d01aa --- /dev/null +++ b/test/cache/Bidirectional/sybasecreate.sql @@ -0,0 +1,22 @@ +create table t1 (f1 int , f2 int NULL,primary key(f1)); +insert into t1 values(1,11); +insert into t1 values(2,21); +insert into t1 values(3,31); +insert into t1 values(4,41); +insert into t1 values(5,51); +insert into t1 values(6,61); +insert into t1 values(7,71); +insert into t1 values(8,81); +insert into t1 values(9,91); +insert into t1 values(10,101); +create table t2 (f1 int , f2 int NULL, primary key(f1)); +insert into t2 values(1,11); +insert into t2 values(2,21); +insert into t2 values(3,31); +insert into t2 values(4,41); +insert into t2 values(5,51); +insert into t2 values(6,61); +insert into t2 values(7,71); +insert into t2 values(8,81); +insert into t2 values(9,91); +insert into t2 values(10,101); diff --git a/test/cache/Bidirectional/sybasecreatelogtable.sql b/test/cache/Bidirectional/sybasecreatelogtable.sql new file mode 100644 index 00000000..373d0155 --- /dev/null +++ b/test/cache/Bidirectional/sybasecreatelogtable.sql @@ -0,0 +1 @@ +create table csql_log_int(tablename char(64), pkid int, operation int,cacheid int, id int identity primary key); diff --git a/test/cache/Bidirectional/test001.ksh b/test/cache/Bidirectional/test001.ksh new file mode 100755 index 00000000..b2bb4a20 --- /dev/null +++ b/test/cache/Bidirectional/test001.ksh @@ -0,0 +1,115 @@ +#!/bin/ksh +# Test Case + +# Bi-directional cache test +# Cache t1 and t2 table +# Set bidirectional flag in csql.conf to true,delete log table from target db if exist + +input=${PWD}/cache/Bidirectional/mysqlcreatelogtable.sql + +REL_PATH=. +if [ -s "$input" ] +then + REL_PATH=${PWD}/cache/Bidirectional +fi +rm -f /tmp/csql.conf +cp $REL_PATH/csql.conf /tmp +export CSQL_CONFIG_FILE=/tmp/csql.conf +echo DSN=$DSN >>$CSQL_CONFIG_FILE +DS="$DSN $DBUSER $PASSWORD" +rm -f /tmp/csql/csqlds.conf +touch /tmp/csql/csqlds.conf +$CSQL_INSTALL_ROOT/bin/csqlds -U $DBUSER -P $PASSWORD -D $DSN -N $TDB -a +if [ $? -ne 0 ] +then + exit 1; +fi +if [ "$DSN" = "myodbc3" ] +then + LOG_FILE=$REL_PATH/mysqlcreatelogtable.sql + TRI_FILE1=$REL_PATH/trigger.sql + TRI_FILE2=$REL_PATH/trigger1.sql +elif [ "$DSN" = "psql" ] +then + LOG_FILE=$REL_PATH/psqlcreatelogtable.sql + TRI_FILE1=$REL_PATH/trigger.psql + TRI_FILE2=$REL_PATH/trigger1.psql +elif [ "$DSN" = "oracle" ] +then + LOG_FILE=$REL_PATH/oraclecreatelogtable.sql + TRI_FILE1=$REL_PATH/trigger.oracle + TRI_FILE2=$REL_PATH/trigger1.oracle +elif [ "$DSN" = "sybase" ] +then + LOG_FILE=$REL_PATH/sybasecreatelogtable.sql + TRI_FILE1=$REL_PATH/trigger.sybase + TRI_FILE2=$REL_PATH/trigger1.sybase +elif [ "$DSN" = "db2" ] +then + LOG_FILE=$REL_PATH/db2createlogtable.sql + TRI_FILE1=$REL_PATH/trigger.db2 + TRI_FILE2=$REL_PATH/trigger1.db2 +else + LOG_FILE= + TRI_FILE1= + TRI_FILE2= +fi + +#echo $DS +isql $DS < ${REL_PATH}/drop.sql >/dev/null 2>&1 +isql $DS < $REL_PATH/create.sql >/dev/null 2>&1 +if [ $? -ne 0 ] +then + echo "DSN is not set for target db" + exit 1 +fi +echo "drop table csql_log_int;">$REL_PATH/log.sql +echo No log table in target DB +isql $DS <$REL_PATH/log.sql >/dev/null 2>&1 +rm -f $REL_PATH/log.sql +rm -f /tmp/csql/csqltable.conf +touch /tmp/csql/csqltable.conf +isql $DS <$TRI_FILE1 >/dev/null +isql $DS <$TRI_FILE2 >/dev/null + + +$CSQL_INSTALL_ROOT/bin/csqlserver >/dev/null 2>&1 & +pid=$! +sleep 5 +for a in 1 2 +do + $CSQL_INSTALL_ROOT/bin/cachetable -t t$a -d $DSN + if [ $? -ne 0 ] + then + kill `ps -ef | grep csqlcacheserver | awk -F" " '{ print $2 }'` + kill -9 $pid + isql $DS < ${REL_PATH}/drop.sql >/dev/null 2>&1 + ipcrm -M 4000 -M 4500 + exit 3; + fi +done +echo "server started" +$CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/select.sql +if [ $? -ne 0 ] +then + echo "unable to locate cache 1" + kill `ps -ef | grep csqlcacheserver | awk -F" " '{ print $2 }'` + kill -9 $pid + isql $DS < ${REL_PATH}/drop.sql >/dev/null 2>&1 + ipcrm -M 4000 -M 4500 + exit 2 +fi + +isql $DS < ${REL_PATH}/insert.sql >/dev/null 2>&1 +sleep 15 +$CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/select.sql + +$CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/drop.sql > /dev/null 2>&1 +isql $DS < ${REL_PATH}/drop.sql >/dev/null 2>&1 +rm -f /tmp/csql/csqltable.conf +touch /tmp/csql/csqltable.conf + +kill `ps -ef | grep csqlcacheserver | awk -F" " '{ print $2 }'` +kill -9 $pid +ipcrm -M 4000 -M 4500 +exit 0; diff --git a/test/cache/Bidirectional/test002.ksh b/test/cache/Bidirectional/test002.ksh new file mode 100755 index 00000000..269a0c22 --- /dev/null +++ b/test/cache/Bidirectional/test002.ksh @@ -0,0 +1,116 @@ +#!/bin/ksh +# Test Case + +# Bi-directional cache test +# Cache t1 and t2 table +# Set bidirectional flag in csql.conf to true,Create log table in target database +#Donot run trigger +input=${PWD}/cache/Bidirectional/mysqlcreatelogtable.sql + +REL_PATH=. +if [ -s "$input" ] +then + REL_PATH=${PWD}/cache/Bidirectional +fi + +rm -f /tmp/csql.conf +cp $REL_PATH/csql.conf /tmp +export CSQL_CONFIG_FILE=/tmp/csql.conf +echo DSN=$DSN >>$CSQL_CONFIG_FILE +DS="$DSN $DBUSER $PASSWORD" +rm -f /tmp/csql/csqlds.conf +touch /tmp/csql/csqlds.conf +$CSQL_INSTALL_ROOT/bin/csqlds -U $DBUSER -P $PASSWORD -D $DSN -N $TDB -a +if [ $? -ne 0 ] +then + exit 1; +fi + +if [ "$DSN" = "myodbc3" ] +then + LOG_FILE=$REL_PATH/mysqlcreatelogtable.sql + TRI_FILE1=$REL_PATH/trigger.sql + TRI_FILE2=$REL_PATH/trigger1.sql +elif [ "$DSN" = "psql" ] +then + LOG_FILE=$REL_PATH/psqlcreatelogtable.sql + TRI_FILE1=$REL_PATH/trigger.psql + TRI_FILE2=$REL_PATH/trigger1.psql +elif [ "$DSN" = "oracle" ] +then + LOG_FILE=$REL_PATH/oraclecreatelogtable.sql + TRI_FILE1=$REL_PATH/trigger.oracle + TRI_FILE2=$REL_PATH/trigger1.oracle +elif [ "$DSN" = "sybase" ] +then + LOG_FILE=$REL_PATH/sybasecreatelogtable.sql + TRI_FILE1=$REL_PATH/trigger.sybase + TRI_FILE2=$REL_PATH/trigger1.sybase +elif [ "$DSN" = "db2" ] +then + LOG_FILE=$REL_PATH/db2createlogtable.sql + TRI_FILE1=$REL_PATH/trigger.db2 + TRI_FILE2=$REL_PATH/trigger1.db2 +else + LOG_FILE= + TRI_FILE1= + TRI_FILE2= +fi + +isql $DS < $REL_PATH/mysqlcreatelogtable.sql >/dev/null 2>&1 +if [ $? -ne 0 ] +then + echo "DSN is not set for target db" + exit 1 +fi + +echo Log table created in target DB + +isql $DS < $REL_PATH/create.sql >/dev/null 2>&1 +rm -f /tmp/csql/csqltable.conf +touch /tmp/csql/csqltable.conf +isql $DS <$REL_PATH/droptrigger.sql >/dev/null + +$CSQL_INSTALL_ROOT/bin/csqlserver >/dev/null 2>&1 & +pid=$! +sleep 5 + +for a in 1 2 +do + $CSQL_INSTALL_ROOT/bin/cachetable -t t$a -d $DSN + if [ $? -ne 0 ] + then + kill `ps -ef | grep csqlcacheserver | awk -F" " '{ print $2 }'` + isql $DS < ${REL_PATH}/drop.sql >/dev/null 2>&1 + kill -9 $pid + ipcrm -M 4000 -M 4500 + exit 3; + fi + sleep 2 +done + +echo "server started" +$CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/select.sql +if [ $? -ne 0 ] +then + echo "unable to locate cache 1" + kill `ps -ef | grep csqlcacheserver | awk -F" " '{ print $2 }'` + kill -9 $pid + isql $DS < ${REL_PATH}/drop.sql >/dev/null 2>&1 + ipcrm -M 4000 -M 4500 + exit 1 +fi + +isql $DS < ${REL_PATH}/insert.sql >/dev/null 2>&1 +sleep 15 +$CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/select.sql + +$CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/drop.sql > /dev/null 2>&1 +isql $DS < ${REL_PATH}/drop.sql >/dev/null 2>&1 +rm -f /tmp/csql/csqltable.conf +touch /tmp/csql/csqltable.conf + +kill `ps -ef | grep csqlcacheserver | awk -F" " '{ print $2 }'` +kill -9 $pid +ipcrm -M 4000 -M 4500 +exit 0; diff --git a/test/cache/Bidirectional/test003.ksh b/test/cache/Bidirectional/test003.ksh new file mode 100755 index 00000000..680a73ac --- /dev/null +++ b/test/cache/Bidirectional/test003.ksh @@ -0,0 +1,119 @@ +#!/bin/ksh +# Test Case + +# Bi-directional cache test +# Create two table t1,t1 that has no primary key +# Set bidirectional flag in csql.conf to true,Create log table in the cache and run Trigger + +input=${PWD}/cache/Bidirectional/mysqlcreatelogtable.sql + +REL_PATH=. +if [ -s "$input" ] +then + REL_PATH=${PWD}/cache/Bidirectional +fi + +rm /tmp/csql.conf +cp $REL_PATH/csql.conf /tmp +export CSQL_CONFIG_FILE=/tmp/csql.conf +echo DSN=$DSN >>$CSQL_CONFIG_FILE +DS="$DSN $DBUSER $PASSWORD" +rm -f /tmp/csql/csqlds.conf +touch /tmp/csql/csqlds.conf +$CSQL_INSTALL_ROOT/bin/csqlds -U $DBUSER -P $PASSWORD -D $DSN -N $TDB -a +if [ $? -ne 0 ] +then + exit 1; +fi + +if [ "$DSN" = "myodbc3" ] +then + LOG_FILE=$REL_PATH/mysqlcreatelogtable.sql + TRI_FILE1=$REL_PATH/trigger.sql + TRI_FILE2=$REL_PATH/trigger1.sql +elif [ "$DSN" = "psql" ] +then + LOG_FILE=$REL_PATH/psqlcreatelogtable.sql + TRI_FILE1=$REL_PATH/trigger.psql + TRI_FILE2=$REL_PATH/trigger1.psql +elif [ "$DSN" = "oracle" ] +then + LOG_FILE=$REL_PATH/oraclecreatelogtable.sql + TRI_FILE1=$REL_PATH/trigger.oracle + TRI_FILE2=$REL_PATH/trigger1.oracle +elif [ "$DSN" = "sybase" ] +then + LOG_FILE=$REL_PATH/sybasecreatelogtable.sql + TRI_FILE1=$REL_PATH/trigger.sybase + TRI_FILE2=$REL_PATH/trigger1.sybase +elif [ "$DSN" = "db2" ] +then + LOG_FILE=$REL_PATH/db2createlogtable.sql + TRI_FILE1=$REL_PATH/trigger.db2 + TRI_FILE2=$REL_PATH/trigger1.db2 +else + LOG_FILE= + TRI_FILE1= + TRI_FILE2= +fi + +#echo $DS + +isql $DS < $LOG_FILE >/dev/null 2>&1 +if [ $? -ne 0 ] +then + echo "DSN is not set for target db" + exit 1 +fi + +echo log table created in target db. + +isql $DS < $REL_PATH/create1.sql >/dev/null 2>&1 +rm -f /tmp/csql/csqltable.conf +touch /tmp/csql/csqltable.conf +isql $DS <$TRI_FILE1 >/dev/null +isql $DS <$TRI_FILE2 >/dev/null + + +$CSQL_INSTALL_ROOT/bin/csqlserver >/dev/null 2>&1 & +pid=$! +sleep 5 +for a in 1 2 +do + $CSQL_INSTALL_ROOT/bin/cachetable -t t$a -d $DSN + if [ $? -eq 0 ] + then + kill `ps -ef | grep csqlcacheserver | awk -F" " '{ print $2 }'` + kill -9 $pid + isql $DS < ${REL_PATH}/drop.sql >/dev/null 2>&1 + ipcrm -M 4000 -M 4500 + exit 3; + fi + sleep 2 +done + +echo "server started" +$CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/select.sql >/dev/null 2>&1 +if [ $? -ne 0 ] +then + kill `ps -ef | grep csqlcacheserver | awk -F" " '{ print $2 }'` + kill -9 $pid + ipcrm -M 4000 -M 4500 + isql $DS < ${REL_PATH}/drop.sql >/dev/null 2>&1 + exit 2 +fi + +isql $DS < ${REL_PATH}/insert.sql >/dev/null 2>&1 +sleep 15 +$CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/select.sql >/dev/null 2>&1 + +$CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/drop.sql > /dev/null 2>&1 +isql $DS < ${REL_PATH}/drop.sql >/dev/null 2>&1 +rm -f /tmp/csql/csqltable.conf +touch /tmp/csql/csqltable.conf + +kill `ps -ef | grep csqlcacheserver | awk -F" " '{ print $2 }'` +kill -9 $pid +ipcrm -M 4000 -M 4500 +exit 0; + diff --git a/test/cache/Bidirectional/test004.ksh b/test/cache/Bidirectional/test004.ksh new file mode 100755 index 00000000..314eecca --- /dev/null +++ b/test/cache/Bidirectional/test004.ksh @@ -0,0 +1,120 @@ +#!/bin/ksh +# Test Case + +# Bi-directional cache test +# Cache t1 and t2 table with primary key field +# Set bidirectional flag in csql.conf to true,Create log table from target db .Run trigger. + +input=${PWD}/cache/Bidirectional/mysqlcreatelogtable.sql + +REL_PATH=. +if [ -s "$input" ] +then + REL_PATH=${PWD}/cache/Bidirectional +fi +rm /tmp/csql.conf +cp $REL_PATH/csql.conf /tmp +export CSQL_CONFIG_FILE=/tmp/csql.conf +echo DSN=$DSN >>$CSQL_CONFIG_FILE +DS="$DSN $DBUSER $PASSWORD" +rm -f /tmp/csql/csqlds.conf +touch /tmp/csql/csqlds.conf +$CSQL_INSTALL_ROOT/bin/csqlds -U $DBUSER -P $PASSWORD -D $DSN -N $TDB -a +if [ $? -ne 0 ] +then + exit 1; +fi +if [ "$DSN" = "myodbc3" ] +then + LOG_FILE=$REL_PATH/mysqlcreatelogtable.sql + TRI_FILE1=$REL_PATH/trigger.sql + TRI_FILE2=$REL_PATH/trigger1.sql +elif [ "$DSN" = "psql" ] +then + LOG_FILE=$REL_PATH/psqlcreatelogtable.sql + TRI_FILE1=$REL_PATH/trigger.psql + TRI_FILE2=$REL_PATH/trigger1.psql +elif [ "$DSN" = "oracle" ] +then + LOG_FILE=$REL_PATH/oraclecreatelogtable.sql + TRI_FILE1=$REL_PATH/trigger.oracle + TRI_FILE2=$REL_PATH/trigger1.oracle +elif [ "$DSN" = "sybase" ] +then + LOG_FILE=$REL_PATH/sybasecreatelogtable.sql + TRI_FILE1=$REL_PATH/trigger.sybase + TRI_FILE2=$REL_PATH/trigger1.sybase +elif [ "$DSN" = "db2" ] +then + LOG_FILE=$REL_PATH/db2createlogtable.sql + TRI_FILE1=$REL_PATH/trigger.db2 + TRI_FILE2=$REL_PATH/trigger1.db2 +else + LOG_FILE= + TRI_FILE1= + TRI_FILE2= +fi + +#echo $DS +isql $DS < $LOG_FILE >/dev/null 2>&1 +if [ $? -ne 0 ] +then + echo "DSN is not set for target db" + exit 1 +fi + +echo Log table created in target DB + +isql $DS < $REL_PATH/create.sql >/dev/null 2>&1 +rm -f /tmp/csql/csqltable.conf +touch /tmp/csql/csqltable.conf +isql $DS < $TRI_FILE1 >/dev/null +isql $DS < $TRI_FILE2 >/dev/null + +$CSQL_INSTALL_ROOT/bin/csqlserver >/dev/null 2>&1 & +pid=$! +sleep 5 +echo "server started" + +for a in 1 2 +do + $CSQL_INSTALL_ROOT/bin/cachetable -t t$a -d $DSN + if [ $? -ne 0 ] + then + isql $DS < ${REL_PATH}/drop.sql >/dev/null 2>&1 + isql $DS < ${REL_PATH}/mysqldeletelogtable.sql >/dev/null 2>&1 + kill `ps -ef | grep csqlcacheserver | awk -F" " '{ print $2 }'` + kill -9 $pid + ipcrm -M 4000 -M 4500 + exit 3; + fi + sleep 2 +done + +$CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/select.sql +if [ $? -ne 0 ] +then + echo "unable to locate cache 1" + isql $DS < ${REL_PATH}/drop.sql >/dev/null 2>&1 + isql $DS < ${REL_PATH}/mysqldeletelogtable.sql >/dev/null 2>&1 + kill `ps -ef | grep csqlcacheserver | awk -F" " '{ print $2 }'` + kill -9 $pid + ipcrm -M 4000 -M 4500 + exit 2 +fi + +isql $DS < ${REL_PATH}/insert.sql >/dev/null 2>&1 +sleep 15 +$CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/select.sql + +$CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/drop.sql > /dev/null 2>&1 +isql $DS < ${REL_PATH}/drop.sql >/dev/null 2>&1 +isql $DS < ${REL_PATH}/mysqldeletelogtable.sql >/dev/null 2>&1 +rm -f /tmp/csql/csqltable.conf +touch /tmp/csql/csqltable.conf + +kill `ps -ef | grep csqlcacheserver | awk -F" " '{ print $2 }'` +kill -9 $pid +ipcrm -M 4000 -M 4500 +exit 0; + diff --git a/test/cache/Bidirectional/test005.ksh b/test/cache/Bidirectional/test005.ksh new file mode 100755 index 00000000..21b46478 --- /dev/null +++ b/test/cache/Bidirectional/test005.ksh @@ -0,0 +1,171 @@ +#!/bin/ksh +# Test Case + +#Bi-directional mutiple cache node test +#Two Cache Node and t1 and t2 table to be cached +# insert operation in target database + +input=${PWD}/cache/Bidirectional/mysqlcreatelogtable.sql + +REL_PATH=. +if [ -s "$input" ] +then + REL_PATH=${PWD}/cache/Bidirectional +fi + +rm -f /tmp/csql.conf +cp $REL_PATH/csql.conf /tmp +export CSQL_CONFIG_FILE=/tmp/csql.conf +echo DSN=$DSN >>$CSQL_CONFIG_FILE +DS="$DSN $DBUSER $PASSWORD" +rm -f /tmp/csql/csqlds.conf +touch /tmp/csql/csqlds.conf +$CSQL_INSTALL_ROOT/bin/csqlds -U $DBUSER -P $PASSWORD -D $DSN -N $TDB -a +if [ $? -ne 0 ] +then + exit 1; +fi +if [ "$DSN" = "myodbc3" ] +then + LOG_FILE=$REL_PATH/mysqlcreatelogtable.sql + TRI_FILE1=$REL_PATH/trigger.sql + TRI_FILE2=$REL_PATH/trigger1.sql +elif [ "$DSN" = "psql" ] +then + LOG_FILE=$REL_PATH/psqlcreatelogtable.sql + TRI_FILE1=$REL_PATH/trigger.psql + TRI_FILE2=$REL_PATH/trigger1.psql +elif [ "$DSN" = "oracle" ] +then + LOG_FILE=$REL_PATH/oraclecreatelogtable.sql + TRI_FILE1=$REL_PATH/triggermul.oracle + TRI_FILE2=$REL_PATH/trigger1mul.oracle +elif [ "$DSN" = "sybase" ] +then + LOG_FILE=$REL_PATH/sybasecreatelogtable.sql + TRI_FILE1=$REL_PATH/trigger.sybase + TRI_FILE2=$REL_PATH/trigger1.sybase +elif [ "$DSN" = "db2" ] +then + LOG_FILE=$REL_PATH/db2createlogtable.sql + TRI_FILE1=$REL_PATH/trigger.db2 + TRI_FILE2=$REL_PATH/trigger1.db2 +else + LOG_FILE= + TRI_FILE1= + TRI_FILE2= +fi + +#echo $DS + +isql $DS < $LOG_FILE >/dev/null 2>&1 +if [ $? -ne 0 ] +then + echo "DSN is not set for target db" + exit 1 +fi + +echo table csql_log_int is created with records in target db + +isql $DS < $REL_PATH/create.sql >/dev/null 2>&1 +rm -f /tmp/csql/csqltable.conf +touch /tmp/csql/csqltable.conf +isql $DS < $TRI_FILE1 >/dev/null +isql $DS < $TRI_FILE2 >/dev/null + + +$CSQL_INSTALL_ROOT/bin/csqlserver >/dev/null 2>&1 & +pid=$! +sleep 5 +echo "server 1 started" + +for a in 1 2 +do + $CSQL_INSTALL_ROOT/bin/cachetable -t t$a -d $DSN + if [ $? -ne 0 ] + then + isql $DS < ${REL_PATH}/mysqldeletelogtable.sql >/dev/null 2>&1 + isql $DS < ${REL_PATH}/drop.sql >/dev/null 2>&1 + kill `ps -ef | grep csqlcacheserver | awk -F" " '{ print $2 }'` + kill -9 $pid + ipcrm -M 4000 -M 4500 + exit 3; + fi + sleep 2 +done + +echo "cache node 2" +$CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/select.sql +if [ $? -ne 0 ] +then + echo "unable to locate cache 1" + isql $DS < ${REL_PATH}/mysqldeletelogtable.sql >/dev/null 2>&1 + isql $DS < ${REL_PATH}/drop.sql >/dev/null 2>&1 + kill `ps -ef | grep csqlcacheserver | awk -F" " '{ print $2 }'` + kill -9 $pid + ipcrm -M 4000 -M 4500 + exit 2 +fi +mkdir /tmp/log/csql1 >/dev/null 2>&1 +mkdir /tmp/csql1 >/dev/null 2>&1 +rm -f /tmp/csql1/csqltable.conf +touch /tmp/csql1/csqltable.conf + +rm -f /tmp/csql1.conf +cp $REL_PATH/conf/csql.conf /tmp/csql1.conf +export CSQL_CONFIG_FILE=/tmp/csql1.conf +echo DSN=$DSN >>$CSQL_CONFIG_FILE + +$CSQL_INSTALL_ROOT/bin/csqlserver >/dev/null 2>&1 & +pid1=$! +sleep 5 +echo "server 2 started" + +for a in 1 2 +do + $CSQL_INSTALL_ROOT/bin/cachetable -t t$a -d $DSN + if [ $? -ne 0 ] + then + isql $DS < ${REL_PATH}/mysqldeletelogtable.sql >/dev/null 2>&1 + isql $DS < ${REL_PATH}/drop.sql >/dev/null 2>&1 + kill `ps -ef | grep csqlcacheserver | awk -F" " '{ print $2 }'` + kill -9 $pid $pid1 + ipcrm -M 4000 -M 4500 -M 5000 -M 5500 + exit 6; + fi + sleep 2 +done + + +echo "cache node 1" +$CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/select.sql +if [ $? -ne 0 ] +then + echo "unable to locate cache 1" + isql $DS < ${REL_PATH}/mysqldeletelogtable.sql >/dev/null 2>&1 + isql $DS < ${REL_PATH}/drop.sql >/dev/null 2>&1 + kill `ps -ef | grep csqlcacheserver | awk -F" " '{ print $2 }'` + kill -9 $pid $pid1 + ipcrm -M 4000 -M 4500 -M 5000 -M 5500 + exit 4 +fi + +isql $DS < ${REL_PATH}/insert.sql >/dev/null 2>&1 +sleep 20 +$CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/select.sql + +export CSQL_CONFIG_FILE=/tmp/csql.conf +echo "cache node 2" +$CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/select.sql + +$CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/drop.sql > /dev/null 2>&1 +isql $DS < ${REL_PATH}/drop.sql >/dev/null 2>&1 +rm -f /tmp/csql/csqltable.conf +touch /tmp/csql/csqltable.conf +rm -f /tmp/csql1/csqltable.conf +touch /tmp/csql1/csqltable.conf +isql $DS < ${REL_PATH}/mysqldeletelogtable.sql >/dev/null 2>&1 +kill `ps -ef | grep csqlcacheserver | awk -F" " '{ print $2 }'` +kill -9 $pid $pid1 +ipcrm -M 4000 -M 4500 -M 5000 -M 5500 +exit 0; diff --git a/test/cache/Bidirectional/test006.ksh b/test/cache/Bidirectional/test006.ksh new file mode 100755 index 00000000..e6662fb0 --- /dev/null +++ b/test/cache/Bidirectional/test006.ksh @@ -0,0 +1,121 @@ +#!/bin/ksh +# Test Case + +# Bi-directional cache test +# Cache t1 and t2 table with primary key field +# Set bidirectional flag in csql.conf to true,Create log table from target db .Run trigger. + +input=${PWD}/cache/Bidirectional/mysqlcreatelogtable.sql + +REL_PATH=. +if [ -s "$input" ] +then + REL_PATH=${PWD}/cache/Bidirectional +fi + +rm -f /tmp/csql.conf +cp $REL_PATH/csql.conf /tmp +export CSQL_CONFIG_FILE=/tmp/csql.conf +echo DSN=$DSN >>$CSQL_CONFIG_FILE +DS="$DSN $DBUSER $PASSWORD" +rm -f /tmp/csql/csqlds.conf +touch /tmp/csql/csqlds.conf +$CSQL_INSTALL_ROOT/bin/csqlds -U $DBUSER -P $PASSWORD -D $DSN -N $TDB -a +if [ $? -ne 0 ] +then + exit 1; +fi +if [ "$DSN" = "myodbc3" ] +then + LOG_FILE=$REL_PATH/mysqlcreatelogtable.sql + TRI_FILE1=$REL_PATH/trigger.sql + TRI_FILE2=$REL_PATH/trigger1.sql +elif [ "$DSN" = "psql" ] +then + LOG_FILE=$REL_PATH/psqlcreatelogtable.sql + TRI_FILE1=$REL_PATH/trigger.psql + TRI_FILE2=$REL_PATH/trigger1.psql +elif [ "$DSN" = "oracle" ] +then + LOG_FILE=$REL_PATH/oraclecreatelogtable.sql + TRI_FILE1=$REL_PATH/trigger.oracle + TRI_FILE2=$REL_PATH/trigger1.oracle +elif [ "$DSN" = "sybase" ] +then + LOG_FILE=$REL_PATH/sybasecreatelogtable.sql + TRI_FILE1=$REL_PATH/trigger.sybase + TRI_FILE2=$REL_PATH/trigger1.sybase +elif [ "$DSN" = "db2" ] +then + LOG_FILE=$REL_PATH/db2createlogtable.sql + TRI_FILE1=$REL_PATH/trigger.db2 + TRI_FILE2=$REL_PATH/trigger1.db2 +else + LOG_FILE= + TRI_FILE1= + TRI_FILE2= +fi + +isql $DS < $LOG_FILE >/dev/null 2>&1 +if [ $? -ne 0 ] +then + echo "DSN is not set for target db" + exit 1 +fi + +echo Log table created in target DB + +isql $DS < $REL_PATH/create.sql >/dev/null 2>&1 +rm -f /tmp/csql/csqltable.conf +touch /tmp/csql/csqltable.conf +isql $DS <$TRI_FILE1 >/dev/null +isql $DS <$TRI_FILE2 >/dev/null + + +$CSQL_INSTALL_ROOT/bin/csqlserver >/dev/null 2>&1 & +pid=$! +sleep 5 +for a in 1 2 +do + $CSQL_INSTALL_ROOT/bin/cachetable -t t$a -d $DSN + if [ $? -ne 0 ] + then + kill `ps -ef | grep csqlcacheserver | awk -F" " '{ print $2 }'` + kill -9 $pid + ipcrm -M 4000 -M 4500 + isql $DS < ${REL_PATH}/mysqldeletelogtable.sql >/dev/null 2>&1 + isql $DS < ${REL_PATH}/drop.sql >/dev/null 2>&1 + exit 3; + fi + sleep 2 +done + +echo "server started" +$CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/select.sql +if [ $? -ne 0 ] +then + echo "unable to locate cache 1" + isql $DS < ${REL_PATH}/mysqldeletelogtable.sql >/dev/null 2>&1 + isql $DS < ${REL_PATH}/drop.sql >/dev/null 2>&1 + rm -f /tmp/csql/csqltable.conf + touch /tmp/csql/csqltable.conf + kill `ps -ef | grep csqlcacheserver | awk -F" " '{ print $2 }'` + kill -9 $pid + ipcrm -M 4000 -M 4500 + exit 1 +fi +echo "Update some record in target database" +isql $DS < ${REL_PATH}/update.sql >/dev/null 2>&1 +sleep 25 +$CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/select.sql + +$CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/drop.sql > /dev/null 2>&1 +isql $DS < ${REL_PATH}/drop.sql >/dev/null 2>&1 +rm -f /tmp/csql/csqltable.conf +touch /tmp/csql/csqltable.conf +isql $DS < $REL_PATH/mysqldeletelogtable.sql >/dev/null 2>&1 +kill `ps -ef | grep csqlcacheserver | awk -F" " '{ print $2 }'` +kill -9 $pid +ipcrm -M 4000 -M 4500 +exit 0; + diff --git a/test/cache/Bidirectional/test007.ksh b/test/cache/Bidirectional/test007.ksh new file mode 100755 index 00000000..d494a74e --- /dev/null +++ b/test/cache/Bidirectional/test007.ksh @@ -0,0 +1,120 @@ +#!/bin/ksh +# Test Case + +# Bi-directional cache test +# Cache t1 and t2 table with primary key field +# Set bidirectional flag in csql.conf to true,Create log table from target db .Run trigger. + +input=${PWD}/cache/Bidirectional/mysqlcreatelogtable.sql + +REL_PATH=. +if [ -s "$input" ] +then + REL_PATH=${PWD}/cache/Bidirectional +fi + +rm -f /tmp/csql.conf +cp $REL_PATH/csql.conf /tmp +export CSQL_CONFIG_FILE=/tmp/csql.conf +echo DSN=$DSN >>$CSQL_CONFIG_FILE +DS="$DSN $DBUSER $PASSWORD" +rm -f /tmp/csql/csqlds.conf +touch /tmp/csql/csqlds.conf +$CSQL_INSTALL_ROOT/bin/csqlds -U $DBUSER -P $PASSWORD -D $DSN -N $TDB -a +if [ $? -ne 0 ] +then + exit 1; +fi +if [ "$DSN" = "myodbc3" ] +then + LOG_FILE=$REL_PATH/mysqlcreatelogtable.sql + TRI_FILE1=$REL_PATH/trigger.sql + TRI_FILE2=$REL_PATH/trigger1.sql +elif [ "$DSN" = "psql" ] +then + LOG_FILE=$REL_PATH/psqlcreatelogtable.sql + TRI_FILE1=$REL_PATH/trigger.psql + TRI_FILE2=$REL_PATH/trigger1.psql +elif [ "$DSN" = "oracle" ] +then + LOG_FILE=$REL_PATH/oraclecreatelogtable.sql + TRI_FILE1=$REL_PATH/trigger.oracle + TRI_FILE2=$REL_PATH/trigger1.oracle +elif [ "$DSN" = "sybase" ] +then + LOG_FILE=$REL_PATH/sybasecreatelogtable.sql + TRI_FILE1=$REL_PATH/trigger.sybase + TRI_FILE2=$REL_PATH/trigger1.sybase +elif [ "$DSN" = "db2" ] +then + LOG_FILE=$REL_PATH/db2createlogtable.sql + TRI_FILE1=$REL_PATH/trigger.db2 + TRI_FILE2=$REL_PATH/trigger1.db2 +else + LOG_FILE= + TRI_FILE1= + TRI_FILE2= +fi + +#echo $DS + +isql $DS < $LOG_FILE >/dev/null 2>&1 +if [ $? -ne 0 ] +then + echo "DSN is not set for target db" + exit 1 +fi + +echo Log table created in target DB + +isql $DS < $REL_PATH/create.sql >/dev/null 2>&1 +rm -f /tmp/csql/csqltable.conf +touch /tmp/csql/csqltable.conf +isql $DS <$TRI_FILE1 >/dev/null +isql $DS <$TRI_FILE2 >/dev/null + + +$CSQL_INSTALL_ROOT/bin/csqlserver >/dev/null 2>&1 & +pid=$! +sleep 5 +echo "server started" +for a in 1 2 +do + $CSQL_INSTALL_ROOT/bin/cachetable -t t$a -d $DSN + if [ $? -ne 0 ] + then + kill `ps -ef | grep csqlcacheserver | awk -F" " '{ print $2 }'` + kill -9 $pid + ipcrm -M 4000 -M 4500 + isql $DS < ${REL_PATH}/mysqldeletelogtable.sql >/dev/null 2>&1 + isql $DS < ${REL_PATH}/drop.sql >/dev/null 2>&1 + exit 3; + fi + sleep 2 +done + +$CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/select.sql +if [ $? -ne 0 ] +then + echo "unable to locate cache 1" + isql $DS < $REL_PATH/mysqldeletelogtable.sql >/dev/null 2>&1 + kill `ps -ef | grep csqlcacheserver | awk -F" " '{ print $2 }'` + kill -9 $pid + ipcrm -M 4000 -M 4500 + exit 2 +fi +echo "Delete some record from target database" +isql $DS < ${REL_PATH}/delete.sql >/dev/null 2>&1 +sleep 15 +$CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/select.sql + +$CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/drop.sql > /dev/null 2>&1 +isql $DS < ${REL_PATH}/drop.sql >/dev/null 2>&1 +rm -f /tmp/csql/csqltable.conf +touch /tmp/csql/csqltable.conf +isql $DS < $REL_PATH/mysqldeletelogtable.sql >/dev/null 2>&1 +kill `ps -ef | grep csqlcacheserver | awk -F" " '{ print $2 }'` +kill -9 $pid +ipcrm -M 4000 -M 4500 +exit 0; + diff --git a/test/cache/Bidirectional/test008.ksh b/test/cache/Bidirectional/test008.ksh new file mode 100755 index 00000000..b90981cb --- /dev/null +++ b/test/cache/Bidirectional/test008.ksh @@ -0,0 +1,166 @@ +#!/bin/ksh +# Test Case + +# Bi-directional mutiple cache node test +# Two Cache Node and t1 and t2 table to be cached +# insert operation in one cache node database + +input=${PWD}/cache/Bidirectional/mysqlcreatelogtable.sql + +REL_PATH=. +if [ -s "$input" ] +then + REL_PATH=${PWD}/cache/Bidirectional +fi + +rm -f /tmp/csql.conf +cp $REL_PATH/csql.conf /tmp +export CSQL_CONFIG_FILE=/tmp/csql.conf + +#echo $DSQL_CONFIG_FILE /tmp/csql.conf +export CSQL_CONFIG_FILE=/tmp/csql.conf +echo DSN=$DSN >>$CSQL_CONFIG_FILE +DS="$DSN $DBUSER $PASSWORD" +rm -f /tmp/csql/csqlds.conf +touch /tmp/csql/csqlds.conf +$CSQL_INSTALL_ROOT/bin/csqlds -U $DBUSER -P $PASSWORD -D $DSN -N $TDB -a +if [ $? -ne 0 ] +then + exit 1; +fi +if [ "$DSN" = "myodbc3" ] +then + LOG_FILE=$REL_PATH/mysqlcreatelogtable.sql + TRI_FILE1=$REL_PATH/trigger.sql + TRI_FILE2=$REL_PATH/trigger1.sql +elif [ "$DSN" = "psql" ] +then + LOG_FILE=$REL_PATH/psqlcreatelogtable.sql + TRI_FILE1=$REL_PATH/trigger.psql + TRI_FILE2=$REL_PATH/trigger1.psql +elif [ "$DSN" = "oracle" ] +then + LOG_FILE=$REL_PATH/oraclecreatelogtable.sql + TRI_FILE1=$REL_PATH/triggermul.oracle + TRI_FILE2=$REL_PATH/trigger1mul.oracle +elif [ "$DSN" = "sybase" ] +then + LOG_FILE=$REL_PATH/sybasecreatelogtable.sql + TRI_FILE1=$REL_PATH/trigger.sybase + TRI_FILE2=$REL_PATH/trigger1.sybase +elif [ $DSN = "db2" ] +then + LOG_FILE=$REL_PATH/db2createlogtable.sql + TRI_FILE1=$REL_PATH/trigger.db2 + TRI_FILE2=$REL_PATH/trigger1.db2 +else + LOG_FILE= + TRI_FILE1= + TRI_FILE2= +fi + + +isql $DS < $LOG_FILE >/dev/null 2>&1 +if [ $? -ne 0 ] +then + echo "DSN is not set for target db" + exit 1 +fi + +echo table csql_log_int is created with records in target db + +isql $DS < $REL_PATH/create.sql >/dev/null 2>&1 +rm -f /tmp/csql/csqltable.conf +touch /tmp/csql/csqltable.conf +isql $DS < $TRI_FILE1 >/dev/null 2>&1 +isql $DS < $TRI_FILE2 >/dev/null 2>&1 + +$CSQL_INSTALL_ROOT/bin/csqlserver >/dev/null 2>&1 & +pid=$! +sleep 5 +echo "server 1 started" +for a in 1 2 +do + $CSQL_INSTALL_ROOT/bin/cachetable -t t$a -d $DSN + if [ $? -ne 0 ] + then + kill `ps -ef | grep csqlcacheserver | awk -F" " '{ print $2 }'` + kill -9 $pid + ipcrm -M 4000 -M 4500 + isql $DS < ${REL_PATH}/mysqldeletelogtable.sql >/dev/null 2>&1 + isql $DS < ${REL_PATH}/drop.sql >/dev/null 2>&1 + exit 3; + fi + sleep 2 +done + +echo "cache node 2" +$CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/select.sql +if [ $? -ne 0 ] +then + echo "unable to locate cache 1" + exit 2 +fi +mkdir /tmp/csql1 >/dev/null 2>&1 +rm -f /tmp/csql1/csqltable.conf +touch /tmp/csql1/csqltable.conf + +rm -f /tmp/csql1.conf +cp $REL_PATH/conf/csql.conf /tmp/csql1.conf +export CSQL_CONFIG_FILE=/tmp/csql1.conf +echo DSN=$DSN >>$CSQL_CONFIG_FILE + +$CSQL_INSTALL_ROOT/bin/csqlserver >/dev/null 2>&1 & +pid1=$! +sleep 5 +echo "server 2 started" +for a in 1 2 +do + $CSQL_INSTALL_ROOT/bin/cachetable -t t$a -d $DSN + if [ $? -ne 0 ] + then + kill `ps -ef | grep csqlcacheserver | awk -F" " '{ print $2 }'` + kill -9 $pid $pid1 + ipcrm -M 4000 -M 4500 -M 5000 -M 5500 + isql $DS < ${REL_PATH}/mysqldeletelogtable.sql >/dev/null 2>&1 + isql $DS < ${REL_PATH}/drop.sql >/dev/null 2>&1 + exit 6; + fi + sleep 2 +done + +echo "cache node 1" +$CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/select.sql +if [ $? -ne 0 ] +then + kill `ps -ef | grep csqlcacheserver | awk -F" " '{ print $2 }'` + kill -9 $pid + ipcrm -M 4000 -M 4500 + isql $DS < ${REL_PATH}/mysqldeletelogtable.sql >/dev/null 2>&1 + isql $DS < ${REL_PATH}/drop.sql >/dev/null 2>&1 + echo "unable to locate cache 1" + exit 4 +fi + +$CSQL_INSTALL_ROOT/bin/csql -g < ${REL_PATH}/insert.sql >/dev/null 2>&1 +sleep 20 +echo "cache node 1" +$CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/select.sql + +export CSQL_CONFIG_FILE=/tmp/csql.conf +echo "cache node 2" +$CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/select.sql + +$CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/drop.sql > /dev/null 2>&1 +isql $DS < ${REL_PATH}/drop.sql >/dev/null 2>&1 +rm -f /tmp/csql/csqltable.conf +touch /tmp/csql/csqltable.conf +rm -f /tmp/csql1/csqltable.conf +touch /tmp/csql1/csqltable.conf +isql $DS < $REL_PATH/mysqldeletelogtable.sql >/dev/null 2>&1 + +kill `ps -ef | grep csqlcacheserver | awk -F" " '{ print $2 }'` +kill -9 $pid $pid1 +ipcrm -M 4000 -M 4500 -M 5000 -M 5500 +exit 0; + diff --git a/test/cache/Bidirectional/test009.ksh b/test/cache/Bidirectional/test009.ksh new file mode 100755 index 00000000..59075392 --- /dev/null +++ b/test/cache/Bidirectional/test009.ksh @@ -0,0 +1,164 @@ +#!/bin/ksh +# Test Case + +# Bi-directional mutiple cache node test +# Two Cache Node and t1 and t2 table to be cached +# Update in Target database + +input=${PWD}/cache/Bidirectional/mysqlcreatelogtable.sql + +REL_PATH=. +if [ -s "$input" ] +then + REL_PATH=${PWD}/cache/Bidirectional +fi + +rm -f /tmp/csql.conf +cp $REL_PATH/csql.conf /tmp +export CSQL_CONFIG_FILE=/tmp/csql.conf +echo DSN=$DSN >>$CSQL_CONFIG_FILE +DS="$DSN $DBUSER $PASSWORD" +rm -f /tmp/csql/csqlds.conf +touch /tmp/csql/csqlds.conf +$CSQL_INSTALL_ROOT/bin/csqlds -U $DBUSER -P $PASSWORD -D $DSN -N $TDB -a +if [ $? -ne 0 ] +then + exit 1; +fi +if [ "$DSN" = "myodbc3" ] +then + LOG_FILE=$REL_PATH/mysqlcreatelogtable.sql + TRI_FILE1=$REL_PATH/trigger.sql + TRI_FILE2=$REL_PATH/trigger1.sql +elif [ "$DSN" = "psql" ] +then + LOG_FILE=$REL_PATH/psqlcreatelogtable.sql + TRI_FILE1=$REL_PATH/trigger.psql + TRI_FILE2=$REL_PATH/trigger1.psql +elif [ "$DSN" = "oracle" ] +then + LOG_FILE=$REL_PATH/oraclecreatelogtable.sql + TRI_FILE1=$REL_PATH/triggermul.oracle + TRI_FILE2=$REL_PATH/trigger1mul.oracle +elif [ "$DSN" = "sybase" ] +then + LOG_FILE=$REL_PATH/sybasecreatelogtable.sql + TRI_FILE1=$REL_PATH/trigger.sybase + TRI_FILE2=$REL_PATH/trigger1.sybase +elif [ "$DSN" = "db2" ] +then + LOG_FILE=$REL_PATH/db2createlogtable.sql + TRI_FILE1=$REL_PATH/trigger.db2 + TRI_FILE2=$REL_PATH/trigger1.db2 +else + LOG_FILE= + TRI_FILE1= + TRI_FILE2= +fi + +#echo $DS + +isql $DS < $LOG_FILE >/dev/null 2>&1 +if [ $? -ne 0 ] +then + echo "DSN is not set for target db" + exit 1 +fi + +echo table csql_log_int is created with records in target db +isql $DS < $REL_PATH/create.sql >/dev/null 2>&1 +rm -f /tmp/csql/csqltable.conf +touch /tmp/csql/csqltable.conf +isql $DS < $TRI_FILE1 >/dev/null +isql $DS < $TRI_FILE2 >/dev/null + + +$CSQL_INSTALL_ROOT/bin/csqlserver >/dev/null 2>&1 & +pid=$! +sleep 5 +echo "server 1 started" +for a in 1 2 +do + $CSQL_INSTALL_ROOT/bin/cachetable -t t$a -d $DSN + if [ $? -ne 0 ] + then + kill `ps -ef | grep csqlcacheserver | awk -F" " '{ print $2 }'` + kill -9 $pid + ipcrm -M 4000 -M 4500 + isql $DS < ${REL_PATH}/mysqldeletelogtable.sql >/dev/null 2>&1 + isql $DS < ${REL_PATH}/drop.sql >/dev/null 2>&1 + exit 3; + fi + sleep 2 +done +echo "cache node 2" +$CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/select.sql +if [ $? -ne 0 ] +then + echo "unable to locate cache 1" + isql $DS < $REL_PATH/mysqldeletelogtable.sql >/dev/null 2>&1 + kill `ps -ef | grep csqlcacheserver | awk -F" " '{ print $2 }'` + kill -9 $pid + ipcrm -M 4000 -M 4500 + exit 4; +fi +mkdir /tmp/csql1 >/dev/null 2>&1 +rm -f /tmp/csql1/csqltable.conf +touch /tmp/csql1/csqltable.conf + +rm -f /tmp/csql1.conf +cp $REL_PATH/conf/csql.conf /tmp/csql1.conf +export CSQL_CONFIG_FILE=/tmp/csql1.conf +echo DSN=$DSN >>$CSQL_CONFIG_FILE +$CSQL_INSTALL_ROOT/bin/csqlserver >/dev/null 2>&1 & +pid1=$! +sleep 5 +echo "server 2 started" + +for a in 1 2 +do + $CSQL_INSTALL_ROOT/bin/cachetable -t t$a -d $DSN + if [ $? -ne 0 ] + then + kill `ps -ef | grep csqlcacheserver | awk -F" " '{ print $2 }'` + kill -9 $pid $pid1 + ipcrm -M 4000 -M 4500 -M 5000 -M 5500 + isql $DS < ${REL_PATH}/mysqldeletelogtable.sql >/dev/null 2>&1 + isql $DS < ${REL_PATH}/drop.sql >/dev/null 2>&1 + exit 6; + fi + sleep 2 +done + +echo "cache node 1" +$CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/select.sql +if [ $? -ne 0 ] +then + kill `ps -ef | grep csqlcacheserver | awk -F" " '{ print $2 }'` + kill -9 $pid + ipcrm -M 4000 -M 4500 + echo "unable to locate cache 1" + isql $DS < $REL_PATH/mysqldeletelogtable.sql >/dev/null 2>&1 + exit 4 +fi +echo "update some record in target database" +isql $DS < ${REL_PATH}/update.sql > /dev/null 2>&1 +sleep 15 +echo "cache node 1" +$CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/select.sql +export CSQL_CONFIG_FILE=/tmp/csql.conf +echo "cache node 2" +$CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/select.sql + +$CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/drop.sql > /dev/null 2>&1 +isql $DS < ${REL_PATH}/drop.sql >/dev/null 2>&1 +rm -f /tmp/csql/csqltable.conf +touch /tmp/csql/csqltable.conf +rm -f /tmp/csql1/csqltable.conf +touch /tmp/csql1/csqltable.conf +isql $DS < $REL_PATH/mysqldeletelogtable.sql >/dev/null 2>&1 +kill `ps -ef | grep csqlcacheserver | awk -F" " '{ print $2 }'` +kill -9 $pid $pid1 +ipcrm -M 4000 -M 4500 -M 5000 -M 5500 +exit 0; + diff --git a/test/cache/Bidirectional/test010.ksh b/test/cache/Bidirectional/test010.ksh new file mode 100755 index 00000000..d6528765 --- /dev/null +++ b/test/cache/Bidirectional/test010.ksh @@ -0,0 +1,165 @@ +#!/bin/ksh +# Test Case + +# Bi-directional mutiple cache node test +# Two Cache Node and t1 and t2 table to be cached +# Update operation in one cache node database + +input=${PWD}/cache/Bidirectional/mysqlcreatelogtable.sql + +REL_PATH=. +if [ -s "$input" ] +then + REL_PATH=${PWD}/cache/Bidirectional +fi + +rm -f /tmp/csql.conf +cp $REL_PATH/csql.conf /tmp +export CSQL_CONFIG_FILE=/tmp/csql.conf +echo DSN=$DSN >>$CSQL_CONFIG_FILE +DS="$DSN $DBUSER $PASSWORD" +rm -f /tmp/csql/csqlds.conf +touch /tmp/csql/csqlds.conf +$CSQL_INSTALL_ROOT/bin/csqlds -U $DBUSER -P $PASSWORD -D $DSN -N $TDB -a +if [ $? -ne 0 ] +then + exit 1; +fi +if [ "$DSN" = "myodbc3" ] +then + LOG_FILE=$REL_PATH/mysqlcreatelogtable.sql + TRI_FILE1=$REL_PATH/trigger.sql + TRI_FILE2=$REL_PATH/trigger1.sql +elif [ "$DSN" = "psql" ] +then + LOG_FILE=$REL_PATH/psqlcreatelogtable.sql + TRI_FILE1=$REL_PATH/trigger.psql + TRI_FILE2=$REL_PATH/trigger1.psql +elif [ "$DSN" = "oracle" ] +then + LOG_FILE=$REL_PATH/oraclecreatelogtable.sql + TRI_FILE1=$REL_PATH/triggermul.oracle + TRI_FILE2=$REL_PATH/trigger1mul.oracle +elif [ "$DSN" = "sybase" ] +then + LOG_FILE=$REL_PATH/sybasecreatelogtable.sql + TRI_FILE1=$REL_PATH/trigger.sybase + TRI_FILE2=$REL_PATH/trigger1.sybase +elif [ "$DSN" = "db2" ] +then + LOG_FILE=$REL_PATH/db2createlogtable.sql + TRI_FILE1=$REL_PATH/trigger.db2 + TRI_FILE2=$REL_PATH/trigger1.db2 +else + LOG_FILE= + TRI_FILE1= + TRI_FILE2= +fi + +#echo $DS + +isql $DS < $LOG_FILE >/dev/null 2>&1 +if [ $? -ne 0 ] +then + echo "DSN is not set for target db" + exit 1 +fi + +echo table csql_log_int is created with records in target db + +isql $DS < $REL_PATH/create.sql >/dev/null 2>&1 +rm -f /tmp/csql/csqltable.conf +touch /tmp/csql/csqltable.conf +isql $DS < $TRI_FILE1 >/dev/null +isql $DS < $TRI_FILE2 >/dev/null + + +$CSQL_INSTALL_ROOT/bin/csqlserver >/dev/null 2>&1 & +pid=$! +sleep 5 +echo "server 1 started" +for a in 1 2 +do + $CSQL_INSTALL_ROOT/bin/cachetable -t t$a -d $DSN + if [ $? -ne 0 ] + then + kill `ps -ef | grep csqlcacheserver | awk -F" " '{ print $2 }'` + kill -9 $pid + ipcrm -M 4000 -M 4500 + isql $DS < ${REL_PATH}/mysqldeletelogtable.sql >/dev/null 2>&1 + isql $DS < ${REL_PATH}/drop.sql >/dev/null 2>&1 + exit 3; + fi + sleep 3 +done + +echo "cache node 2" +$CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/select.sql +if [ $? -ne 0 ] +then + echo "unable to locate cache 1" + isql $DS < $REL_PATH/mysqldeletelogtable.sql >/dev/null 2>&1 + isql $DS < ${REL_PATH}/drop.sql >/dev/null 2>&1 + exit 3 +fi +mkdir /tmp/csql1 >/dev/null 2>&1 +rm -f /tmp/csql1/csqltable.conf +touch /tmp/csql1/csqltable.conf + +rm -f /tmp/csql1.conf +cp $REL_PATH/conf/csql.conf /tmp/csql1.conf +export CSQL_CONFIG_FILE=/tmp/csql1.conf +echo DSN=$DSN >>$CSQL_CONFIG_FILE +$CSQL_INSTALL_ROOT/bin/csqlserver >/dev/null 2>&1 & +pid1=$! +sleep 5 +echo "server 2 started" +for a in 1 2 +do + $CSQL_INSTALL_ROOT/bin/cachetable -t t$a -d $DSN + if [ $? -ne 0 ] + then + kill `ps -ef | grep csqlcacheserver | awk -F" " '{ print $2 }'` + kill -9 $pid $pid1 + ipcrm -M 4000 -M 4500 -M 5000 -M 5500 + isql $DS < ${REL_PATH}/mysqldeletelogtable.sql >/dev/null 2>&1 + isql $DS < ${REL_PATH}/drop.sql >/dev/null 2>&1 + exit 3; + fi + sleep 3 +done + +echo "cache node 1" +$CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/select.sql +if [ $? -ne 0 ] +then + kill `ps -ef | grep csqlcacheserver | awk -F" " '{ print $2 }'` + kill -9 $pid $pid1 + ipcrm -M 4000 -M 4500 -M 5000 -M 5500 + echo "unable to locate cache 1" + isql $DS < ${REL_PATH}/drop.sql >/dev/null 2>&1 + isql $DS < $REL_PATH/mysqldeletelogtable.sql >/dev/null 2>&1 + exit 4 +fi +echo "Update operation in cache node 1" +$CSQL_INSTALL_ROOT/bin/csql -g < ${REL_PATH}/update.sql > /dev/null 2>&1 +sleep 15 +echo "cache node 1" +$CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/select.sql + +export CSQL_CONFIG_FILE=/tmp/csql.conf +echo "cache node 2" +$CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/select.sql + +$CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/drop.sql > /dev/null 2>&1 +isql $DS < ${REL_PATH}/drop.sql >/dev/null 2>&1 +rm -f /tmp/csql/csqltable.conf +touch /tmp/csql/csqltable.conf +rm -f /tmp/csql1/csqltable.conf +touch /tmp/csql1/csqltable.conf +isql $DS < $REL_PATH/mysqldeletelogtable.sql >/dev/null 2>&1 +kill `ps -ef | grep csqlcacheserver | awk -F" " '{ print $2 }'` +kill -9 $pid $pid1 +ipcrm -M 4000 -M 4500 -M 5000 -M 5500 +exit 0; + diff --git a/test/cache/Bidirectional/test011.ksh b/test/cache/Bidirectional/test011.ksh new file mode 100755 index 00000000..67faa8b3 --- /dev/null +++ b/test/cache/Bidirectional/test011.ksh @@ -0,0 +1,165 @@ +#!/bin/ksh +# Test Case + +# Bi-directional mutiple cache node test +# Two Cache Node and t1 and t2 table to be cached +# Delete opration in Target database + +input=${PWD}/cache/Bidirectional/mysqlcreatelogtable.sql + +REL_PATH=. +if [ -s "$input" ] +then + REL_PATH=${PWD}/cache/Bidirectional +fi + +rm -f /tmp/csql.conf +cp $REL_PATH/csql.conf /tmp +export CSQL_CONFIG_FILE=/tmp/csql.conf +echo DSN=$DSN >>$CSQL_CONFIG_FILE +DS="$DSN $DBUSER $PASSWORD" +rm -f /tmp/csql/csqlds.conf +touch /tmp/csql/csqlds.conf +$CSQL_INSTALL_ROOT/bin/csqlds -U $DBUSER -P $PASSWORD -D $DSN -N $TDB -a +if [ $? -ne 0 ] +then + exit 1; +fi +if [ "$DSN" = "myodbc3" ] +then + LOG_FILE=$REL_PATH/mysqlcreatelogtable.sql + TRI_FILE1=$REL_PATH/trigger.sql + TRI_FILE2=$REL_PATH/trigger1.sql +elif [ "$DSN" = "psql" ] +then + LOG_FILE=$REL_PATH/psqlcreatelogtable.sql + TRI_FILE1=$REL_PATH/trigger.psql + TRI_FILE2=$REL_PATH/trigger1.psql +elif [ "$DSN" = "oracle" ] +then + LOG_FILE=$REL_PATH/oraclecreatelogtable.sql + TRI_FILE1=$REL_PATH/triggermul.oracle + TRI_FILE2=$REL_PATH/trigger1mul.oracle +elif [ "$DSN" = "sybase" ] +then + LOG_FILE=$REL_PATH/sybasecreatelogtable.sql + TRI_FILE1=$REL_PATH/trigger.sybase + TRI_FILE2=$REL_PATH/trigger1.sybase +elif [ "$DSN" = "db2" ] +then + LOG_FILE=$REL_PATH/db2createlogtable.sql + TRI_FILE1=$REL_PATH/trigger.db2 + TRI_FILE2=$REL_PATH/trigger1.db2 +else + LOG_FILE= + TRI_FILE1= + TRI_FILE2= +fi + +#echo $DS + +isql $DS < $LOG_FILE >/dev/null 2>&1 +if [ $? -ne 0 ] +then + echo "DSN is not set for target db" + exit 1 +fi + +echo table csql_log_int is created with records in target db + +isql $DS < $REL_PATH/create.sql >/dev/null 2>&1 +rm -f /tmp/csql/csqltable.conf +touch /tmp/csql/csqltable.conf +isql $DS < $TRI_FILE1 >/dev/null +isql $DS < $TRI_FILE2 >/dev/null + + +$CSQL_INSTALL_ROOT/bin/csqlserver >/dev/null 2>&1 & +pid=$! +sleep 5 +echo "server 1 started" +for a in 1 2 +do + $CSQL_INSTALL_ROOT/bin/cachetable -t t$a -d $DSN + if [ $? -ne 0 ] + then + kill `ps -ef | grep csqlcacheserver | awk -F" " '{ print $2 }'` + kill -9 $pid + ipcrm -M 4000 -M 4500 + exit 3; + fi + sleep 2 +done + + +echo "cache node 2" +$CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/select.sql +if [ $? -ne 0 ] +then + echo "unable to locate cache 1" + isql $DS < $REL_PATH/mysqldeletelogtable.sql >/dev/null 2>&1 + kill `ps -ef | grep csqlcacheserver | awk -F" " '{ print $2 }'` + kill -9 $pid + ipcrm -M 4000 -M 4500 + exit 3 +fi +mkdir /tmp/csql1 >/dev/null 2>&1 +rm -f /tmp/csql1/csqltable.conf +touch /tmp/csql1/csqltable.conf + +rm /tmp/csql1.conf +cp $REL_PATH/conf/csql.conf /tmp/csql1.conf +export CSQL_CONFIG_FILE=/tmp/csql1.conf +echo DSN=$DSN >>$CSQL_CONFIG_FILE +$CSQL_INSTALL_ROOT/bin/csqlserver >/dev/null 2>&1 & +pid1=$! +sleep 5 +echo "server 2 started" +for a in 1 2 +do + $CSQL_INSTALL_ROOT/bin/cachetable -t t$a -d $DSN + if [ $? -ne 0 ] + then + kill `ps -ef | grep csqlcacheserver | awk -F" " '{ print $2 }'` + kill -9 $pid $pid1 + ipcrm -M 4000 -M 4500 -M 5000 -M 5500 + isql $DS < ${REL_PATH}/mysqldeletelogtable.sql >/dev/null 2>&1 + isql $DS < ${REL_PATH}/drop.sql >/dev/null 2>&1 + exit 5; + fi + sleep 2 +done + +echo "cache node 1" +$CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/select.sql +if [ $? -ne 0 ] +then + kill `ps -ef | grep csqlcacheserver | awk -F" " '{ print $2 }'` + kill -9 $pid $pid1 + ipcrm -M 4000 -M 4500 -M 5000 -M 5500 + echo "unable to locate cache 1" + isql $DS < $REL_PATH/mysqldeletelogtable.sql >/dev/null 2>&1 + exit 4 +fi +echo "Delete some record in target database" +isql $DS < ${REL_PATH}/delete.sql > /dev/null 2>&1 +sleep 15 +echo "cache node 1" +$CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/select.sql + +export CSQL_CONFIG_FILE=/tmp/csql.conf +echo "cache node 2" +$CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/select.sql + +$CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/drop.sql > /dev/null 2>&1 +isql $DS < ${REL_PATH}/drop.sql >/dev/null 2>&1 +rm -f /tmp/csql/csqltable.conf +touch /tmp/csql/csqltable.conf +rm -f /tmp/csql1/csqltable.conf +touch /tmp/csql1/csqltable.conf +isql $DS < $REL_PATH/mysqldeletelogtable.sql >/dev/null 2>&1 +kill `ps -ef | grep csqlcacheserver | awk -F" " '{ print $2 }'` +kill -9 $pid $pid1 +ipcrm -M 4000 -M 4500 -M 5000 -M 5500 +exit 0; + diff --git a/test/cache/Bidirectional/test012.ksh b/test/cache/Bidirectional/test012.ksh new file mode 100755 index 00000000..ec8e76b1 --- /dev/null +++ b/test/cache/Bidirectional/test012.ksh @@ -0,0 +1,165 @@ +#!/bin/ksh +# Test Case + +# Bi-directional mutiple cache node test +# Two Cache Node and t1 and t2 table to be cached +# Delete operation in one cache node database + +input=${PWD}/cache/Bidirectional/mysqlcreatelogtable.sql + +REL_PATH=. +if [ -s "$input" ] +then + REL_PATH=${PWD}/cache/Bidirectional +fi + +rm -f /tmp/csql.conf +cp $REL_PATH/csql.conf /tmp +export CSQL_CONFIG_FILE=/tmp/csql.conf +echo DSN=$DSN >>$CSQL_CONFIG_FILE +DS="$DSN $DBUSER $PASSWORD" +rm -f /tmp/csql/csqlds.conf +touch /tmp/csql/csqlds.conf +$CSQL_INSTALL_ROOT/bin/csqlds -U $DBUSER -P $PASSWORD -D $DSN -N $TDB -a +if [ $? -ne 0 ] +then + exit 1; +fi +if [ "$DSN" = "myodbc3" ] +then + LOG_FILE=$REL_PATH/mysqlcreatelogtable.sql + TRI_FILE1=$REL_PATH/trigger.sql + TRI_FILE2=$REL_PATH/trigger1.sql +elif [ "$DSN" = "psql" ] +then + LOG_FILE=$REL_PATH/psqlcreatelogtable.sql + TRI_FILE1=$REL_PATH/trigger.psql + TRI_FILE2=$REL_PATH/trigger1.psql +elif [ "$DSN" = "oracle" ] +then + LOG_FILE=$REL_PATH/oraclecreatelogtable.sql + TRI_FILE1=$REL_PATH/triggermul.oracle + TRI_FILE2=$REL_PATH/trigger1mul.oracle +elif [ "$DSN" = "sybase" ] +then + LOG_FILE=$REL_PATH/sybasecreatelogtable.sql + TRI_FILE1=$REL_PATH/trigger.sybase + TRI_FILE2=$REL_PATH/trigger1.sybase +elif [ "$DSN" = "db2" ] +then + LOG_FILE=$REL_PATH/db2createlogtable.sql + TRI_FILE1=$REL_PATH/trigger.db2 + TRI_FILE2=$REL_PATH/trigger1.db2 +else + LOG_FILE= + TRI_FILE1= + TRI_FILE2= +fi + +#echo $DS + +isql $DS < $LOG_FILE >/dev/null 2>&1 +if [ $? -ne 0 ] +then + echo "DSN is not set for target db" + exit 1 +fi + +echo table csql_log_int is created with records in target db + +isql $DS < $REL_PATH/create.sql >/dev/null 2>&1 +rm -f /tmp/csql/csqltable.conf +touch /tmp/csql/csqltable.conf +isql $DS < $TRI_FILE1 >/dev/null +isql $DS < $TRI_FILE2 >/dev/null + + +$CSQL_INSTALL_ROOT/bin/csqlserver >/dev/null 2>&1 & +pid=$! +sleep 5 +echo "server 1 started" + +for a in 1 2 +do + $CSQL_INSTALL_ROOT/bin/cachetable -t t$a -d $DSN + if [ $? -ne 0 ] + then + kill `ps -ef | grep csqlcacheserver | awk -F" " '{ print $2 }'` + kill -9 $pid + ipcrm -M 4000 -M 4500 + isql $DS < ${REL_PATH}/mysqldeletelogtable.sql >/dev/null 2>&1 + isql $DS < ${REL_PATH}/drop.sql >/dev/null 2>&1 + exit 3; + fi + sleep 2 +done + +echo "cache node 2" +$CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/select.sql +if [ $? -ne 0 ] +then + echo "unable to locate cache 1" + isql $DS < $REL_PATH/mysqldeletelogtable.sql >/dev/null 2>&1 + kill `ps -ef | grep csqlcacheserver | awk -F" " '{ print $2 }'` + kill -9 $pid + ipcrm -M 4000 -M 4500 + exit 3 +fi +mkdir /tmp/csql1 >/dev/null 2>&1 +rm -f /tmp/csql1/csqltable.conf +touch /tmp/csql1/csqltable.conf + +rm -f /tmp/csql1.conf +cp $REL_PATH/conf/csql.conf /tmp/csql1.conf +export CSQL_CONFIG_FILE=/tmp/csql1.conf +echo DSN=$DSN >>$CSQL_CONFIG_FILE +$CSQL_INSTALL_ROOT/bin/csqlserver >/dev/null 2>&1 & +pid1=$! +sleep 5 +echo "server 2 started" +for a in 1 2 +do + $CSQL_INSTALL_ROOT/bin/cachetable -t t$a -d $DSN + if [ $? -ne 0 ] + then + kill `ps -ef | grep csqlcacheserver | awk -F" " '{ print $2 }'` + kill -9 $pid $pid1 + ipcrm -M 4000 -M 4500 -M 5000 -M 5500 + exit 6; + fi + sleep 2 +done + +echo "cache node 1" +$CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/select.sql +if [ $? -ne 0 ] +then + kill `ps -ef | grep csqlcacheserver | awk -F" " '{ print $2 }'` + kill -9 $pid $pid1 + ipcrm -M 4000 -M 4500 -M 5000 -M 5500 + echo "unable to locate cache 1" + isql $DS < $REL_PATH/mysqldeletelogtable.sql >/dev/null 2>&1 + exit 4 +fi +echo "Delete operation in cache node 1" +$CSQL_INSTALL_ROOT/bin/csql -g < ${REL_PATH}/delete.sql > /dev/null 2>&1 +sleep 20 +echo "cache node 1" +$CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/select.sql + +export CSQL_CONFIG_FILE=/tmp/csql.conf +echo "cache node 2" +$CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/select.sql + +$CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/drop.sql > /dev/null 2>&1 +isql $DS < ${REL_PATH}/drop.sql >/dev/null 2>&1 +rm -f /tmp/csql/csqltable.conf +touch /tmp/csql/csqltable.conf +rm -f /tmp/csql1/csqltable.conf +touch /tmp/csql1/csqltable.conf +isql $DS < $REL_PATH/mysqldeletelogtable.sql >/dev/null 2>&1 +kill `ps -ef | grep csqlcacheserver | awk -F" " '{ print $2 }'` +kill -9 $pid $pid1 +ipcrm -M 4000 -M 4500 -M 5000 -M 5500 +exit 0; + diff --git a/test/cache/Bidirectional/test013.ksh b/test/cache/Bidirectional/test013.ksh new file mode 100755 index 00000000..d17641ac --- /dev/null +++ b/test/cache/Bidirectional/test013.ksh @@ -0,0 +1,183 @@ +#!/bin/ksh +# Test Case +# Create 100 table in target database with a integer primary key. +# Run trigger for all table. Make sure Log table is in target database +# Run cache server with bi-directional and cache flag true. Cache all tables. +# Insert record in each table in target database. Check in csql node records are inserted or not +# Author := Bijaya + +input=${PWD}/cache/Bidirectional/mysqlcreatelogtable.sql + +REL_PATH=. +if [ -s "$input" ] +then + REL_PATH=${PWD}/cache/Bidirectional +fi +a=1 +while [[ $a -lt 101 ]];do + if [ $DSN = "oracle" ] + then + echo "create table t$a(f1 number(8),f2 number(8),primary key(f1));" + else + echo "create table t$a(f1 int,f2 int,primary key(f1));" + fi + echo "insert into t$a values(1,2);" + (( a +=1 )) +done >> $REL_PATH/create100table.sql +echo "table creation file created" +a=1 +while [[ $a -lt 101 ]];do + echo "insert into t$a values(10,20);" + echo "insert into t$a values(11,21);" + echo "commit;" + (( a +=1 )) +done >> $REL_PATH/insertinto100.sql +echo "insert record file creates" +a=1 +while [[ $a -lt 101 ]];do + echo "echo select * from t$a;" + echo "select * from t$a;" + (( a +=1 )) +done >>$REL_PATH/selectfrom100.sql + +echo "select file created" +a=1 +while [[ $a -lt 101 ]];do + echo "drop table t$a;" + (( a +=1 )) +done >>$REL_PATH/drop100table.sql + +rm -f /tmp/csql1.conf +cp $REL_PATH/csql1.conf /tmp +export CSQL_CONFIG_FILE=/tmp/csql1.conf +DS="$DSN $DBUSER $PASSWORD" +rm -f /tmp/csql1/csqlds.conf +touch /tmp/csql1/csqlds.conf +$CSQL_INSTALL_ROOT/bin/csqlds -U $DBUSER -P $PASSWORD -D $DSN -N $TDB -a +if [ $? -ne 0 ] +then + exit 1; +fi +echo DSN=$DSN >>$CSQL_CONFIG_FILE +if [ $DSN = "myodbc3" ] +then + echo "use test;">>$REL_PATH/inserttrigger100.sql + a=1 + while [[ $a -lt 101 ]];do + echo "drop trigger if exists triggerinsertt$a;" + echo "create trigger triggerinsertt$a AFTER INSERT on t$a FOR EACH ROW BEGIN Insert into csql_log_int (tablename, pkid, operation,cacheid) values ('t$a', NEW.f1, 1,1); End;" + (( a +=1 )) + done >> $REL_PATH/inserttrigger100.sql + echo "trigger file generated" + a=1 + while [[ $a -lt 101 ]];do + echo "drop trigger if exists triggerinsertt$a;" + (( a +=1 )) + done >>$REL_PATH/dropinserttrigger.sql + echo "drop trigger file generated" + LOG_FILE=$REL_PATH/mysqlcreatelogtable.sql +elif [ "$DSN" = "psql" ] +then + echo "CREATE LANGUAGE plpgsql;">$REL_PATH/inserttrigger100.sql + a=1 + while [[ $a -lt 101 ]];do + echo "DROP FUNCTION IF EXISTS log_insert_t$a() CASCADE ;" + echo "CREATE OR REPLACE FUNCTION log_insert_t$a() RETURNS trigger AS \$triggerinsertt$a$ BEGIN insert into csql_log_int (tablename, pkid, operation, cacheid) values ('t$a', NEW.f1, 1, 1); RETURN NEW; END; \$triggerinsertt$a$ LANGUAGE plpgsql;" + echo "create trigger triggerinsertt$a AFTER INSERT on t$a FOR EACH ROW EXECUTE PROCEDURE log_insert_t$a();" + (( a +=1 )) + done >> $REL_PATH/inserttrigger100.sql + echo "trigger file generated" + a=1 + while [[ $a -lt 101 ]];do + echo "DROP FUNCTION IF EXISTS log_insert_t$a() CASCADE ;" + (( a +=1 )) + done >$REL_PATH/dropinserttrigger.sql + echo "drop trigger file generated" + LOG_FILE=$REL_PATH/psqlcreatelogtable.sql +elif [ "$DSN" = "oracle" ] +then + a=1 + while [[ $a -lt 101 ]];do + echo "CREATE OR REPLACE TRIGGER triggert$a AFTER insert on t$a FOR EACH ROW declare rid PLS_INTEGER; begin SELECT CSQL_ID.NEXTVAL INTO rid FROM dual; if inserting then insert into csql_log_int values ('t$a',:new.f1,1,1,rid); end if; end;" + (( a +=1 )) + done >> $REL_PATH/inserttrigger100.sql + echo "trigger file generated" + a=1 + while [[ $a -lt 101 ]];do + echo "drop trigger triggert$a;" + (( a +=1 )) + done >$REL_PATH/dropinserttrigger.sql + echo "drop trigger file generated" + LOG_FILE=$REL_PATH/oraclecreatelogtable.sql +elif [ "$DSN" = "sybase" ] +then + echo "sybase Trigger Missing" +fi +#echo $DS +isql $DS < $LOG_FILE >/dev/null 2>&1 +if [ $? -ne 0 ] +then + echo "DSN is not set for target db" + rm -f $REL_PATH/create100table.sql + rm -f $REL_PATH/insertinto100.sql + rm -f $REL_PATH/selectfrom100.sql + rm -f $REL_PATH/drop100table.sql + rm -f $REL_PATH/inserttrigger100.sql + rm -f $REL_PATH/dropinserttrigger.sql + exit 1 +fi +echo Log table created in target DB +isql $DS < $REL_PATH/create100table.sql >/dev/null +rm -f /tmp/csql/csqltable.conf +touch /tmp/csql/csqltable.conf +isql $DS <$REL_PATH/inserttrigger100.sql >/dev/null + +a=1 +while [[ $a -lt 101 ]];do + echo "1 t$a NULL NULL NULL $DSN" + (( a +=1 )) +done >> /tmp/csql/csqltable.conf + +$CSQL_INSTALL_ROOT/bin/csqlserver -c >/dev/null 2>&1 & +pid=$! +sleep 30 +echo "server started" + +$CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/selectfrom100.sql +if [ $? -ne 0 ] +then + echo "unable to locate cache 1" + isql $DS < ${REL_PATH}/drop100table.sql >/dev/null 2>&1 + rm -f $REL_PATH/create100table.sql + rm -f $REL_PATH/insertinto100.sql + rm -f $REL_PATH/selectfrom100.sql + rm -f $REL_PATH/drop100table.sql + rm -f $REL_PATH/inserttrigger100.sql + rm -f $REL_PATH/dropinserttrigger.sql + exit 2 +fi + +echo "Insert some record in target database" +isql $DS < ${REL_PATH}/insertinto100.sql >/dev/null 2>&1 +sleep 30 + +echo "Records in csql after insert in target DB" +$CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/selectfrom100.sql + +$CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/drop100table.sql > /dev/null 2>&1 +isql $DS < ${REL_PATH}/drop100table.sql >/dev/null 2>&1 +rm -f /tmp/csql/csqltable.conf +touch /tmp/csql/csqltable.conf +isql $DS < $REL_PATH/dropinserttrigger.sql >/dev/null 2>&1 +isql $DS < $REL_PATH/mysqldeletelogtable.sql >/dev/null 2>&1 +kill `ps -ef | grep csqlcacheserver | awk -F" " '{ print $2 }'` +kill -9 $pid +ipcrm -M 4000 -M 4500 + +rm -f $REL_PATH/create100table.sql +rm -f $REL_PATH/insertinto100.sql +rm -f $REL_PATH/selectfrom100.sql +rm -f $REL_PATH/drop100table.sql +rm -f $REL_PATH/inserttrigger100.sql +rm -f $REL_PATH/dropinserttrigger.sql +exit 0; diff --git a/test/cache/Bidirectional/test014.ksh b/test/cache/Bidirectional/test014.ksh new file mode 100755 index 00000000..7657a81e --- /dev/null +++ b/test/cache/Bidirectional/test014.ksh @@ -0,0 +1,184 @@ +#!/bin/ksh +# Test Case +# Create 100 table in target database with a integer primary key. +# Run trigger for all table. Make sure Log table is in target database +# Run cache server with bi-directional and cache flag true. Cache all tables. +# Update some record in each table in target database. Check in csql node records are inserted or not . +# Author := Bijaya + +input=${PWD}/cache/Bidirectional/mysqlcreatelogtable.sql + +REL_PATH=. +if [ -s "$input" ] +then + REL_PATH=${PWD}/cache/Bidirectional +fi + +a=1 +while [[ $a -lt 101 ]];do + echo "create table t$a(f1 int,f2 int,primary key(f1));" + echo "insert into t$a values(1,2);" + echo "insert into t$a values(10,20);" + echo "insert into t$a values(11,21);" + (( a +=1 )) +done >>$REL_PATH/create100table.sql +echo "table creation file created" + +a=1 +while [[ $a -lt 101 ]];do + echo "echo select * from t$a;" + echo "select * from t$a;" + (( a +=1 )) +done >>$REL_PATH/selectfrom100.sql +echo "select file created" + +a=1 +while [[ $a -lt 101 ]];do + echo "drop table t$a;" + (( a +=1 )) +done >>$REL_PATH/drop100table.sql + +a=1 +while [[ $a -lt 101 ]];do + echo "update t$a set f2=50 where f2 >19;" + (( a +=1 )) +done >> $REL_PATH/update100table.sql +echo "Update file created" +rm -f /tmp/csql1.conf +cp $REL_PATH/csql1.conf /tmp +export CSQL_CONFIG_FILE=/tmp/csql1.conf +rm -f /tmp/csql1/csqlds.conf +touch /tmp/csql1/csqlds.conf +$CSQL_INSTALL_ROOT/bin/csqlds -U $DBUSER -P $PASSWORD -D $DSN -N $TDB -a +if [ $? -ne 0 ] +then + exit 1; +fi +DS="$DSN $DBUSER $PASSWORD" +echo DSN=$DSN >>$CSQL_CONFIG_FILE +if [ $DSN = "myodbc3" ] +then + LOG_FILE=$REL_PATH/mysqlcreatelogtable.sql + echo "use test;">>$REL_PATH/updatetrigger100.sql + a=1 + while [[ $a -lt 101 ]];do + echo "drop trigger if exists triggerupdatet$a;" + echo "create trigger triggerupdatet$a AFTER UPDATE on t$a FOR EACH ROW BEGIN Insert into csql_log_int (tablename, pkid, operation,cacheid) values ('t$a', OLD.f1, 2,1);Insert into csql_log_int (tablename, pkid, operation,cacheid) values ('t$a', NEW.f1, 1,1); End;" + (( a +=1 )) + done >> $REL_PATH/updatetrigger100.sql + echo "Trigger file generated" + a=1 + while [[ $a -lt 101 ]];do + echo "drop trigger if exists triggerupdatet$a;" + (( a +=1 )) + done >>$REL_PATH/dropupdatetrigger.sql + echo "Drop trigger file generated" +elif [ $DSN = "psql" ] +then + a=1 + while [[ $a -lt 101 ]];do + echo "DROP FUNCTION IF EXISTS log_update_t$a() CASCADE ;" + echo "CREATE OR REPLACE FUNCTION log_update_t$a() RETURNS trigger AS \$triggerupdatet$a$ BEGIN insert into csql_log_int (tablename, pkid, operation, cacheid) values ('t$a', OLD.f1, 2, 1); insert into csql_log_int (tablename, pkid, operation, cacheid) values ('t$a', NEW.f1, 1, 1); RETURN NEW; END; \$triggerupdatet$a$ LANGUAGE plpgsql;" + echo "create trigger triggerupdatet$a AFTER UPDATE on t$a FOR EACH ROW EXECUTE PROCEDURE log_update_t$a();" + (( a +=1 )) + done >> $REL_PATH/updatetrigger100.sql + echo "Trigger file generated" + + a=1 + while [[ $a -lt 101 ]];do + echo "DROP FUNCTION IF EXISTS log_update_t$a() CASCADE ;" + (( a +=1 )) + done >>$REL_PATH/dropupdatetrigger.sql + echo "Drop trigger file generated" + + LOG_FILE=$REL_PATH/psqlcreatelogtable.sql +elif [ $DSN = "oracle" ] +then + a=1 + while [[ $a -lt 101 ]];do + echo "CREATE OR REPLACE TRIGGER triggert$a AFTER update on t$a FOR EACH ROW declare rid PLS_INTEGER; begin SELECT CSQL_ID.NEXTVAL INTO rid FROM dual; if updating then insert into csql_log_int values ('t$a',:old.f1,2,1,rid); SELECT CSQL_ID.NEXTVAL INTO rid FROM dual; insert into csql_log_int values ('t$a',:new.f1,1,1,rid); end if; end;" + (( a +=1 )) + done >> $REL_PATH/updatetrigger100.sql + echo "Trigger file generated" + a=1 + while [[ $a -lt 101 ]];do + echo "DROP TRIGGER triggert$a;" + (( a +=1 )) + done >>$REL_PATH/dropupdatetrigger.sql + echo "Drop trigger file generated" + + LOG_FILE=$REL_PATH/oraclecreatelogtable.sql + echo TARGET_DATABASE=oracle >>$CSQL_CONFIG_FILE +elif [ $DSN = "sybase" ] +then + echo "Sybase trigger Missinf" +else + echo "other triger" +fi +#echo $DS +isql $DS < $LOG_FILE >/dev/null 2>&1 +if [ $? -ne 0 ] +then + echo "DSN is not set for target db" + rm -f $REL_PATH/create100table.sql + rm -f $REL_PATH/update100table.sql + rm -f $REL_PATH/selectfrom100.sql + rm -f $REL_PATH/drop100table.sql + rm -f $REL_PATH/dropupdatetrigger.sql + rm -f $REL_PATH/updatetrigger100.sql + exit 1 +fi +echo Log table created in target DB +isql $DS < $REL_PATH/create100table.sql >/dev/null +rm -f /tmp/csql/csqltable.conf +touch /tmp/csql/csqltable.conf +isql $DS <$REL_PATH/updatetrigger100.sql >/dev/null + +a=1 +while [[ $a -lt 101 ]];do + echo "1 t$a NULL NULL NULL $DSN" + (( a +=1 )) +done >> /tmp/csql/csqltable.conf + +$CSQL_INSTALL_ROOT/bin/csqlserver -c >/dev/null 2>&1 & +pid=$! +sleep 30 +echo "server started" + +$CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/selectfrom100.sql +if [ $? -ne 0 ] +then + echo "unable to locate cache 1" + isql $DS < ${REL_PATH}/drop100table.sql >/dev/null 2>&1 + rm -f $REL_PATH/create100table.sql + rm -f $REL_PATH/update100table.sql + rm -f $REL_PATH/selectfrom100.sql + rm -f $REL_PATH/drop100table.sql + rm -f $REL_PATH/dropupdatetrigger.sql + rm -f $REL_PATH/updatetrigger100.sql + exit 2 +fi + +echo "Update some record in target database" +isql $DS < ${REL_PATH}/update100table.sql >/dev/null 2>&1 +sleep 30 +echo "Records in csql after update in target DB" +$CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/selectfrom100.sql + +$CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/drop100table.sql > /dev/null 2>&1 +isql $DS < ${REL_PATH}/drop100table.sql >/dev/null 2>&1 +rm -f /tmp/csql/csqltable.conf +touch /tmp/csql/csqltable.conf +isql $DS < $REL_PATH/dropupdatetrigger.sql >/dev/null 2>&1 +isql $DS < $REL_PATH/mysqldeletelogtable.sql >/dev/null 2>&1 +kill `ps -ef | grep csqlcacheserver | awk -F" " '{ print $2 }'` +kill -9 $pid +ipcrm -M 4000 -M 4500 + +rm -f $REL_PATH/create100table.sql +rm -f $REL_PATH/update100table.sql +rm -f $REL_PATH/selectfrom100.sql +rm -f $REL_PATH/drop100table.sql +rm -f $REL_PATH/updatetrigger100.sql +rm -f $REL_PATH/dropupdatetrigger.sql +exit 0; diff --git a/test/cache/Bidirectional/test015.ksh b/test/cache/Bidirectional/test015.ksh new file mode 100755 index 00000000..0b62ef58 --- /dev/null +++ b/test/cache/Bidirectional/test015.ksh @@ -0,0 +1,187 @@ +#!/bin/ksh +# Test Case +# Create 100 table in target database with a integer primary key. +# Run trigger for all table. Make sure Log table is in target database +# Run cache server with bi-directional and cache flag true. Cache all tables. +# Delete some record in each table in target database. Check in csql node records are inserted or not. +# Author := Bijaya + +input=${PWD}/cache/Bidirectional/mysqlcreatelogtable.sql + +REL_PATH=. +if [ -s "$input" ] +then + REL_PATH=${PWD}/cache/Bidirectional +fi + +a=1 +while [[ $a -lt 101 ]];do +echo "create table t$a(f1 int,f2 int,primary key(f1));" +echo "insert into t$a values(1,2);" +echo "insert into t$a values(10,20);" +echo "insert into t$a values(11,21);" +(( a +=1 )) +done >>$REL_PATH/create100table.sql +echo "table creation file created" + +a=1 +while [[ $a -lt 101 ]];do +echo "echo select * from t$a;" +echo "select * from t$a;" +(( a +=1 )) +done >>$REL_PATH/selectfrom100.sql +echo "select file created" + +a=1 +while [[ $a -lt 101 ]];do +echo "drop table t$a;" +(( a +=1 )) +done >>$REL_PATH/drop100table.sql + + +a=1 +while [[ $a -lt 101 ]];do +echo "delete from t$a where f2 >19;" +(( a +=1 )) +done >> $REL_PATH/deletefrom100table.sql +echo "Update file created" + +rm -f /tmp/csql1.conf +cp $REL_PATH/csql1.conf /tmp +export CSQL_CONFIG_FILE=/tmp/csql1.conf +rm -f /tmp/csql1/csqlds.conf +touch /tmp/csql1/csqlds.conf +$CSQL_INSTALL_ROOT/bin/csqlds -U $DBUSER -P $PASSWORD -D $DSN -N $TDB -a +if [ $? -ne 0 ] +then + exit 1; +fi +DS="$DSN $DBUSER $PASSWORD" +echo DSN=$DSN >>$CSQL_CONFIG_FILE + +if [ $DSN = "myodbc3" ] +then + echo "use test;">>$REL_PATH/deletetrigger100.sql + a=1 + while [[ $a -lt 101 ]];do + echo "drop trigger if exists triggerdeletet$a;" + echo "create trigger triggerdeletet$a AFTER DELETE on t$a FOR EACH ROW BEGIN Insert into csql_log_int (tablename, pkid, operation,cacheid) values ('t$a', OLD.f1, 2,1); End;" + (( a +=1 )) + done >> $REL_PATH/deletetrigger100.sql + echo "Trigger file generated" + + a=1 + while [[ $a -lt 101 ]];do + echo "drop trigger if exists triggerdeletet$a;" + (( a +=1 )) + done >>$REL_PATH/dropdeletetrigger.sql + echo "Drop trigger file generated" + LOG_FILE=$REL_PATH/mysqlcreatelogtable.sql +elif [ $DSN = "psql" ] +then + echo "CREATE LANGUAGE plpgsql;">$REL_PATH/deletetrigger100.sql + a=1 + while [[ $a -lt 101 ]];do + echo "DROP FUNCTION IF EXISTS log_delete_t$a() CASCADE ;" + echo "CREATE OR REPLACE FUNCTION log_delete_t$a() RETURNS trigger AS \$triggerdeletet$a$ BEGIN insert into csql_log_int (tablename, pkid, operation, cacheid) values ('t$a', OLD.f1, 2, 1); RETURN NEW; END; \$triggerdeletet$a$ LANGUAGE plpgsql;" + echo "create trigger triggerdeletet$a AFTER DELETE on t$a FOR EACH ROW EXECUTE PROCEDURE log_delete_t$a();" + (( a +=1 )) + done >> $REL_PATH/deletetrigger100.sql + echo "Trigger file generated" + + a=1 + while [[ $a -lt 101 ]];do + echo "DROP FUNCTION IF EXISTS log_delete_t$a() CASCADE ;" + (( a +=1 )) + done >>$REL_PATH/dropdeletetrigger.sql + echo "Drop trigger file generated" + LOG_FILE=$REL_PATH/psqlcreatelogtable.sql +elif [ $DSN = "oracle" ] +then + a=1 + while [[ $a -lt 101 ]];do + echo "CREATE OR REPLACE TRIGGER triggertdel$a AFTER delete on t$a FOR EACH ROW declare rid PLS_INTEGER; begin SELECT CSQL_ID.NEXTVAL INTO rid FROM dual; if deleting then insert into csql_log_int values ('t$a',:old.f1,2,1,rid); end if; end;" + (( a +=1 )) + done >> $REL_PATH/deletetrigger100.sql + echo "Trigger file generated" + + a=1 + while [[ $a -lt 101 ]];do + echo "DROP TRIGGER triggertdel$a;" + (( a +=1 )) + done >>$REL_PATH/dropdeletetrigger.sql + echo "Drop trigger file generated" + LOG_FILE=$REL_PATH/oraclecreatelogtable.sql +elif [ $DSN = "sybase" ] +then + echo "sybase trigger missing" +else + echo "other trigger" +fi +#echo $DS +isql $DS < $LOG_FILE >/dev/null 2>&1 +if [ $? -ne 0 ] +then + echo "DSN is not set for target db" + rm -f $REL_PATH/create100table.sql + rm -f $REL_PATH/deletefrom100table.sql + rm -f $REL_PATH/selectfrom100.sql + rm -f $REL_PATH/drop100table.sql + rm -f $REL_PATH/dropdeletetrigger.sql + rm -f $REL_PATH/deletetrigger100.sql + exit 1 +fi +echo Log table created in target DB +isql $DS < $REL_PATH/create100table.sql >/dev/null +rm -f /tmp/csql/csqltable.conf +touch /tmp/csql/csqltable.conf +isql $DS <$REL_PATH/deletetrigger100.sql >/dev/null + +a=1 +while [[ $a -lt 101 ]];do + echo "1 t$a NULL NULL NULL $DSN" + (( a +=1 )) +done >> /tmp/csql/csqltable.conf + +$CSQL_INSTALL_ROOT/bin/csqlserver -c >/dev/null 2>&1 & +pid=$! +sleep 30 +echo "server started" + +$CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/selectfrom100.sql +if [ $? -ne 0 ] +then + echo "unable to locate cache 1" + isql $DS < ${REL_PATH}/drop100table.sql >/dev/null 2>&1 + rm -f $REL_PATH/create100table.sql + rm -f $REL_PATH/deletefrom100table.sql + rm -f $REL_PATH/selectfrom100.sql + rm -f $REL_PATH/drop100table.sql + rm -f $REL_PATH/dropdeletetrigger.sql + rm -f $REL_PATH/deletetrigger100.sql + exit 2 +fi + +echo "Delete some record in target database" +isql $DS < ${REL_PATH}/deletefrom100table.sql >/dev/null 2>&1 +sleep 30 +echo "Records in csql after Delete some recode from target DB" +$CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/selectfrom100.sql + +$CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/drop100table.sql > /dev/null 2>&1 +isql $DS < ${REL_PATH}/drop100table.sql >/dev/null 2>&1 +rm -f /tmp/csql/csqltable.conf +touch /tmp/csql/csqltable.conf +isql $DS < $REL_PATH/dropdeletetrigger.sql >/dev/null 2>&1 +isql $DS < $REL_PATH/mysqldeletelogtable.sql >/dev/null 2>&1 +kill `ps -ef | grep csqlcacheserver | awk -F" " '{ print $2 }'` +kill -9 $pid +ipcrm -M 4000 -M 4500 + +rm -f $REL_PATH/create100table.sql +rm -f $REL_PATH/deletefrom100table.sql +rm -f $REL_PATH/selectfrom100.sql +rm -f $REL_PATH/drop100table.sql +rm -f $REL_PATH/deletetrigger100.sql +rm -f $REL_PATH/dropdeletetrigger.sql +exit 0; diff --git a/test/cache/Bidirectional/test016.ksh b/test/cache/Bidirectional/test016.ksh new file mode 100755 index 00000000..1a40f322 --- /dev/null +++ b/test/cache/Bidirectional/test016.ksh @@ -0,0 +1,123 @@ +#!/bin/ksh +# Test Case + +# Bi-directional cache test +# Create table t1 and t2 in target database with field f1 int ,f2 char primary key(f1). Make sure log table is in target database. Run trigger in integer primary key field. +# Set bidirectional flag to true. Insert some record with null values.Test the values in cache tool is null or not. +input=${PWD}/cache/Bidirectional/mysqlcreatelogtable.sql + +REL_PATH=. +if [ -s "$input" ] +then + REL_PATH=${PWD}/cache/Bidirectional +fi +rm /tmp/csql.conf +cp $REL_PATH/csql.conf /tmp +export CSQL_CONFIG_FILE=/tmp/csql.conf +echo DSN=$DSN >>$CSQL_CONFIG_FILE +DS="$DSN $DBUSER $PASSWORD" +rm -f /tmp/csql/csqlds.conf +touch /tmp/csql/csqlds.conf +$CSQL_INSTALL_ROOT/bin/csqlds -U $DBUSER -P $PASSWORD -D $DSN -N $TDB -a +if [ $? -ne 0 ] +then + exit 1; +fi +if [ "$DSN" = "myodbc3" ] +then + LOG_FILE=$REL_PATH/mysqlcreatelogtable.sql + TRI_FILE1=$REL_PATH/trigger.sql + TRI_FILE2=$REL_PATH/trigger1.sql +elif [ "$DSN" = "psql" ] +then + LOG_FILE=$REL_PATH/psqlcreatelogtable.sql + TRI_FILE1=$REL_PATH/trigger.psql + TRI_FILE2=$REL_PATH/trigger1.psql +elif [ "$DSN" = "oracle" ] +then + LOG_FILE=$REL_PATH/oraclecreatelogtable.sql + TRI_FILE1=$REL_PATH/trigger.oracle + TRI_FILE2=$REL_PATH/trigger1.oracle +elif [ "$DSN" = "sybase" ] +then + LOG_FILE=$REL_PATH/sybasecreatelogtable.sql + TRI_FILE1=$REL_PATH/trigger.sybase + TRI_FILE2=$REL_PATH/trigger1.sybase +elif [ "$DSN" = "db2" ] +then + LOG_FILE=$REL_PATH/db2createlogtable.sql + TRI_FILE1=$REL_PATH/trigger.db2 + TRI_FILE2=$REL_PATH/trigger1.db2 +else + LOG_FILE= + TRI_FILE1= + TRI_FILE2= +fi + +#echo $DS +isql $DS < $LOG_FILE >/dev/null 2>&1 +if [ $? -ne 0 ] +then + echo "DSN is not set for target db" + exit 1 +fi + +echo Log table created in target DB +if [ "$DSN" = "sybase" ] +then + isql $DS < $REL_PATH/sybasecreate.sql >/dev/null 2>&1 +else + isql $DS < $REL_PATH/create.sql >/dev/null 2>&1 +fi +rm -f /tmp/csql/csqltable.conf +touch /tmp/csql/csqltable.conf +isql $DS <$TRI_FILE1 >/dev/null +isql $DS <$TRI_FILE2 >/dev/null + + +$CSQL_INSTALL_ROOT/bin/csqlserver >/dev/null 2>&1 & +pid=$! +sleep 5 +echo "server started" +for a in 1 2 +do + $CSQL_INSTALL_ROOT/bin/cachetable -t t$a -d $DSN + if [ $? -ne 0 ] + then + kill `ps -ef | grep csqlcacheserver | awk -F" " '{ print $2 }'` + kill -9 $pid + ipcrm -M 4000 -M 4500 + isql $DS < ${REL_PATH}/drop.sql >/dev/null 2>&1 + exit 3; + fi + sleep 2 +done + +$CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/select.sql +if [ $? -ne 0 ] +then + echo "unable to locate cache 1" + kill `ps -ef | grep csqlcacheserver | awk -F" " '{ print $2 }'` + kill -9 $pid + ipcrm -M 4000 -M 4500 + exit 2 +fi +for a in 1 2 +do + echo "insert into t$a values(11,NULL);" + echo "insert into t$a values(12,NULL);" +done >> $REL_PATH/insert1.sql +isql $DS < ${REL_PATH}/insert1.sql >/dev/null 2>&1 +sleep 15 +$CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/select.sql + +$CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/drop.sql > /dev/null 2>&1 +isql $DS < ${REL_PATH}/drop.sql >/dev/null 2>&1 +rm -f /tmp/csql/csqltable.conf +touch /tmp/csql/csqltable.conf +rm -f ${REL_PATH}/insert1.sql +kill `ps -ef | grep csqlcacheserver | awk -F" " '{ print $2 }'` +kill -9 $pid +ipcrm -M 4000 -M 4500 +exit 0; + diff --git a/test/cache/Bidirectional/test017.ksh b/test/cache/Bidirectional/test017.ksh new file mode 100755 index 00000000..12fc17a5 --- /dev/null +++ b/test/cache/Bidirectional/test017.ksh @@ -0,0 +1,150 @@ +#!/bin/ksh +# Test Case + +# Bi-directional cache test +# Create table t1 and t2 in target database with field f1 int ,f2 char primary key(f1). Make sure log table is in target database. Run trigger in integer primary key field. +# Set bidirectional flag to true. Insert some record with null values.Test the values in cache tool is null or not. +input=${PWD}/cache/Bidirectional/mysqlcreatelogtable.sql + +REL_PATH=. +if [ -s "$input" ] +then + REL_PATH=${PWD}/cache/Bidirectional +fi +rm /tmp/csql.conf +cp $REL_PATH/csql.conf /tmp +export CSQL_CONFIG_FILE=/tmp/csql.conf +echo DSN=$DSN >>$CSQL_CONFIG_FILE +DS="$DSN $DBUSER $PASSWORD" +rm -f /tmp/csql/csqlds.conf +touch /tmp/csql/csqlds.conf +$CSQL_INSTALL_ROOT/bin/csqlds -U $DBUSER -P $PASSWORD -D $DSN -N $TDB -a +if [ $? -ne 0 ] +then + exit 1; +fi +if [ "$DSN" = "myodbc3" ] +then + LOG_FILE=$REL_PATH/mysqlcreatelogtable.sql + TRI_FILE1=$REL_PATH/trigger.sql + TRI_FILE2=$REL_PATH/trigger1.sql +elif [ "$DSN" = "psql" ] +then + LOG_FILE=$REL_PATH/psqlcreatelogtable.sql + TRI_FILE1=$REL_PATH/trigger.psql + TRI_FILE2=$REL_PATH/trigger1.psql +elif [ "$DSN" = "oracle" ] +then + LOG_FILE=$REL_PATH/oraclecreatelogtable.sql + TRI_FILE1=$REL_PATH/trigger.oracle + TRI_FILE2=$REL_PATH/trigger1.oracle +elif [ "$DSN" = "sybase" ] +then + LOG_FILE=$REL_PATH/sybasecreatelogtable.sql + TRI_FILE1=$REL_PATH/trigger.sybase + TRI_FILE2=$REL_PATH/trigger1.sybase +elif [ "$DSN" = "db2" ] +then + LOG_FILE=$REL_PATH/db2createlogtable.sql + TRI_FILE1=$REL_PATH/trigger.db2 + TRI_FILE2=$REL_PATH/trigger1.db2 +else + LOG_FILE= + TRI_FILE1= + TRI_FILE2= +fi + +#echo $DS +isql $DS < $LOG_FILE >/dev/null 2>&1 +if [ $? -ne 0 ] +then + echo "DSN is not set for target db" + exit 1 +fi + +echo Log table created in target DB + +rm -f /tmp/csql/csqltable.conf +touch /tmp/csql/csqltable.conf +if [ $DSN = "oracle" ] +then + echo "create table t1(f1 int ,f2 char(12),f3 smallint, f4 number(38),primary key(f1));">$REL_PATH/t1.sql +elif [ $DSN = "sybase" ] +then + echo "create table t1(f1 int ,f2 char(12) NULL,f3 smallint NULL, f4 bigint NULL,primary key(f1));">$REL_PATH/t1.sql +else + echo "create table t1(f1 int NOT NULL,f2 char(12),f3 smallint, f4 bigint,primary key(f1));">$REL_PATH/t1.sql +fi +for a in 1 2 3 4 5 6 7 8 9 +do +echo "insert into t1 values($a,'papu',12, 123124);" +done>>$REL_PATH/t1.sql + +isql $DS < $REL_PATH/t1.sql >/dev/null 2>&1 +if [ $? -ne 0 ] +then + echo "unable to creste in target db" + rm -f $REL_PATH/t1.sql + exit 2 +fi +isql $DS <$TRI_FILE1 >/dev/null + +$CSQL_INSTALL_ROOT/bin/csqlserver >/dev/null 2>&1 & +pid=$! +sleep 5 +echo "server started" +echo "drop table t1;">${REL_PATH}/dt1.sql + +$CSQL_INSTALL_ROOT/bin/cachetable -t t1 -f "f1,f2" +if [ $? -ne 0 ] +then + echo "Unable to cache" + isql $DS <${REL_PATH}/dt1.sql >/dev/null 2>&1 + rm -f $REL_PATH/t1.sql ${REL_PATH}/dt1.sql + isql $DS <${REL_PATH}/mysqldeletelogtable.sql >/dev/null 2>&1 + kill `ps -ef | grep csqlcacheserver | awk -F" " '{ print $2 }'` + kill -9 $pid + ipcrm -M 4000 -M 4500 + exit 3 +fi +echo "select * from t1;">$REL_PATH/sel.sql +$CSQL_INSTALL_ROOT/bin/csql -g -s $REL_PATH/sel.sql +if [ $? -ne 0 ] +then + echo "In select" + isql $DS <${REL_PATH}/dt1.sql >/dev/null 2>&1 + rm -f $REL_PATH/t1.sql ${REL_PATH}/dt1.sql $REL_PATH/sel.sql + isql $DS <${REL_PATH}/mysqldeletelogtable.sql >/dev/null 2>&1 + kill `ps -ef | grep csqlcacheserver | awk -F" " '{ print $2 }'` + kill -9 $pid + ipcrm -M 4000 -M 4500 + exit 4 +fi + +echo "insert into t1 values(100,'papu',12,123124);">$REL_PATH/insert1.sql +echo "insert into t1 values(101,'biju',12,123125);">>$REL_PATH/insert1.sql +isql $DS < ${REL_PATH}/insert1.sql >/dev/null 2>&1 +sleep 20 +$CSQL_INSTALL_ROOT/bin/csql -g -s $REL_PATH/sel.sql +if [ $? -ne 0 ] +then + echo "In 2nd select" + isql $DS <${REL_PATH}/dt1.sql >/dev/null 2>&1 + rm -f $REL_PATH/t1.sql ${REL_PATH}/dt1.sql $REL_PATH/sel.sql $REL_PATH/insert1.sql + isql $DS <${REL_PATH}/mysqldeletelogtable.sql >/dev/null 2>&1 + kill `ps -ef | grep csqlcacheserver | awk -F" " '{ print $2 }'` + kill -9 $pid + ipcrm -M 4000 -M 4500 + exit 5 +fi + +$CSQL_INSTALL_ROOT/bin/cachetable -t t1 -u +isql $DS <${REL_PATH}/dt1.sql >/dev/null 2>&1 +isql $DS <${REL_PATH}/mysqldeletelogtable.sql >/dev/null 2>&1 + +rm -f $REL_PATH/t1.sql ${REL_PATH}/dt1.sql $REL_PATH/sel.sql $REL_PATH/insert1.sql +kill `ps -ef | grep csqlcacheserver | awk -F" " '{ print $2 }'` +kill -9 $pid +ipcrm -M 4000 -M 4500 +exit 0 + diff --git a/test/cache/Bidirectional/test018.ksh b/test/cache/Bidirectional/test018.ksh new file mode 100755 index 00000000..5baf2443 --- /dev/null +++ b/test/cache/Bidirectional/test018.ksh @@ -0,0 +1,150 @@ +#!/bin/ksh +# Test Case + +# Bi-directional cache test +#Create table t1 with field f1 int ,f2 char,f3 smallint , f4 bigint, primarykey(f1) . Make bidirectional flag and cache flag true. run trigger ,create log table in target db.Cache the table by -c f1>10 . +# Insert record in target db with f1 values as f1>10 and f1<10 and f1 =10 and select from t1 it should shows records having f1 gretter than 10. +# Author:= Bijaya + +input=${PWD}/cache/Bidirectional/mysqlcreatelogtable.sql + +REL_PATH=. +if [ -s "$input" ] +then + REL_PATH=${PWD}/cache/Bidirectional +fi +rm /tmp/csql.conf +cp $REL_PATH/csql.conf /tmp +export CSQL_CONFIG_FILE=/tmp/csql.conf +echo DSN=$DSN >>$CSQL_CONFIG_FILE +DS="$DSN $DBUSER $PASSWORD" +rm -f /tmp/csql/csqlds.conf +touch /tmp/csql/csqlds.conf +$CSQL_INSTALL_ROOT/bin/csqlds -U $DBUSER -P $PASSWORD -D $DSN -N $TDB -a +if [ $? -ne 0 ] +then + exit 1; +fi +if [ "$DSN" = "myodbc3" ] +then + LOG_FILE=$REL_PATH/mysqlcreatelogtable.sql + TRI_FILE1=$REL_PATH/trigger.sql + TRI_FILE2=$REL_PATH/trigger1.sql +elif [ "$DSN" = "psql" ] +then + LOG_FILE=$REL_PATH/psqlcreatelogtable.sql + TRI_FILE1=$REL_PATH/trigger.psql + TRI_FILE2=$REL_PATH/trigger1.psql +elif [ "$DSN" = "oracle" ] +then + LOG_FILE=$REL_PATH/oraclecreatelogtable.sql + TRI_FILE1=$REL_PATH/trigger.oracle + TRI_FILE2=$REL_PATH/trigger1.oracle +elif [ "$DSN" = "sybase" ] +then + LOG_FILE=$REL_PATH/sybasecreatelogtable.sql + TRI_FILE1=$REL_PATH/trigger.sybase + TRI_FILE2=$REL_PATH/trigger1.sybase +elif [ "$DSN" = "db2" ] +then + LOG_FILE=$REL_PATH/db2createlogtable.sql + TRI_FILE1=$REL_PATH/trigger.db2 + TRI_FILE2=$REL_PATH/trigger1.db2 +else + LOG_FILE= + TRI_FILE1= + TRI_FILE2= +fi + +#echo $DS +isql $DS < $LOG_FILE >/dev/null 2>&1 +if [ $? -ne 0 ] +then + echo "DSN is not set for target db" + exit 1 +fi + +echo Log table created in target DB + +rm -f /tmp/csql/csqltable.conf +touch /tmp/csql/csqltable.conf +if [ $DSN = "oracle" ] +then + echo "create table t1(f1 int ,f2 char(12),f3 smallint, f4 number(38),primary key(f1));">$REL_PATH/t1.sql +else + echo "create table t1(f1 int NOT NULL ,f2 char(12),f3 smallint, f4 bigint,primary key(f1));">$REL_PATH/t1.sql +fi +for a in 11 12 13 14 +do +echo "insert into t1 values($a,'papu',12,$a+123124);" +done>>$REL_PATH/t1.sql + +isql $DS < $REL_PATH/t1.sql >/dev/null 2>&1 +if [ $? -ne 0 ] +then + echo "unable to creste in target db" + rm -f $REL_PATH/t1.sql + exit 2 +fi +isql $DS <$TRI_FILE1 >/dev/null + +$CSQL_INSTALL_ROOT/bin/csqlserver >/dev/null 2>&1 & +pid=$! +sleep 5 +echo "server started" +echo "drop table t1;">${REL_PATH}/dt1.sql + +$CSQL_INSTALL_ROOT/bin/cachetable -t t1 -c "f1>10" +if [ $? -ne 0 ] +then + echo "Unable to cache" + isql $DS <${REL_PATH}/dt1.sql >/dev/null 2>&1 + rm -f $REL_PATH/t1.sql ${REL_PATH}/dt1.sql + isql $DS <${REL_PATH}/mysqldeletelogtable.sql >/dev/null 2>&1 + kill `ps -ef | grep csqlcacheserver | awk -F" " '{ print $2 }'` + kill -9 $pid + ipcrm -M 4000 -M 4500 + exit 3 +fi +echo "select * from t1;">$REL_PATH/sel.sql +$CSQL_INSTALL_ROOT/bin/csql -g -s $REL_PATH/sel.sql +if [ $? -ne 0 ] +then + echo "In select" + isql $DS <${REL_PATH}/dt1.sql >/dev/null 2>&1 + rm -f $REL_PATH/t1.sql ${REL_PATH}/dt1.sql $REL_PATH/sel.sql + isql $DS <${REL_PATH}/mysqldeletelogtable.sql >/dev/null 2>&1 + kill `ps -ef | grep csqlcacheserver | awk -F" " '{ print $2 }'` + kill -9 $pid + ipcrm -M 4000 -M 4500 + exit 4 +fi + +echo "insert into t1 values(17,'papu',12,123124);">$REL_PATH/insert1.sql +echo "insert into t1 values(7,'biju',12,123125);">>$REL_PATH/insert1.sql +echo "insert into t1 values(10,'tapu',12,1231266);">>$REL_PATH/insert1.sql +isql $DS < ${REL_PATH}/insert1.sql >/dev/null 2>&1 +sleep 15 +$CSQL_INSTALL_ROOT/bin/csql -g -s $REL_PATH/sel.sql +if [ $? -ne 0 ] +then + echo "In 2nd select" + isql $DS <${REL_PATH}/dt1.sql >/dev/null 2>&1 + rm -f $REL_PATH/t1.sql ${REL_PATH}/dt1.sql $REL_PATH/sel.sql $REL_PATH/insert1.sql + isql $DS <${REL_PATH}/mysqldeletelogtable.sql >/dev/null 2>&1 + kill `ps -ef | grep csqlcacheserver | awk -F" " '{ print $2 }'` + kill -9 $pid + ipcrm -M 4000 -M 4500 + exit 5 +fi + +$CSQL_INSTALL_ROOT/bin/cachetable -t t1 -u +isql $DS <${REL_PATH}/dt1.sql >/dev/null 2>&1 +isql $DS <${REL_PATH}/mysqldeletelogtable.sql >/dev/null 2>&1 + +rm -f $REL_PATH/t1.sql ${REL_PATH}/dt1.sql $REL_PATH/sel.sql $REL_PATH/insert1.sql +kill `ps -ef | grep csqlcacheserver | awk -F" " '{ print $2 }'` +kill -9 $pid +ipcrm -M 4000 -M 4500 +exit 0 + diff --git a/test/cache/Bidirectional/test019.ksh b/test/cache/Bidirectional/test019.ksh new file mode 100755 index 00000000..6bf1e273 --- /dev/null +++ b/test/cache/Bidirectional/test019.ksh @@ -0,0 +1,151 @@ +#!/bin/ksh +# Test Case + +# Bi-directional cache test +# Create table t1 with field f1 int ,f2 char,f3 smallint , f4 bigint, primarykey(f1) . Make bidirectional flag and cache flag true. run trigger ,create log table in target db.Cache the table by -c "f1>10" -f f1,f2 . +# Insert record in target db with f1 values as f1>10 and f1<10 and f1 =10 and select from t1 it should shows records having f1 gretter than 10 of f1 and f2 field. +# Author:= Bijaya + +input=${PWD}/cache/Bidirectional/mysqlcreatelogtable.sql + +REL_PATH=. +if [ -s "$input" ] +then + REL_PATH=${PWD}/cache/Bidirectional +fi +rm /tmp/csql.conf +cp $REL_PATH/csql.conf /tmp +export CSQL_CONFIG_FILE=/tmp/csql.conf +echo DSN=$DSN >>$CSQL_CONFIG_FILE +DS="$DSN $DBUSER $PASSWORD" +rm -f /tmp/csql/csqlds.conf +touch /tmp/csql/csqlds.conf +$CSQL_INSTALL_ROOT/bin/csqlds -U $DBUSER -P $PASSWORD -D $DSN -N $TDB -a +if [ $? -ne 0 ] +then + exit 1; +fi +if [ "$DSN" = "myodbc3" ] +then + LOG_FILE=$REL_PATH/mysqlcreatelogtable.sql + TRI_FILE1=$REL_PATH/trigger.sql + TRI_FILE2=$REL_PATH/trigger1.sql +elif [ "$DSN" = "psql" ] +then + LOG_FILE=$REL_PATH/psqlcreatelogtable.sql + TRI_FILE1=$REL_PATH/trigger.psql + TRI_FILE2=$REL_PATH/trigger1.psql +elif [ "$DSN" = "oracle" ] +then + LOG_FILE=$REL_PATH/oraclecreatelogtable.sql + TRI_FILE1=$REL_PATH/trigger.oracle + TRI_FILE2=$REL_PATH/trigger1.oracle +elif [ "$DSN" = "sybase" ] +then + LOG_FILE=$REL_PATH/sybasecreatelogtable.sql + TRI_FILE1=$REL_PATH/trigger.sybase + TRI_FILE2=$REL_PATH/trigger1.sybase +elif [ "$DSN" = "db2" ] +then + LOG_FILE=$REL_PATH/db2createlogtable.sql + TRI_FILE1=$REL_PATH/trigger.db2 + TRI_FILE2=$REL_PATH/trigger1.db2 +else + LOG_FILE= + TRI_FILE1= + TRI_FILE2= +fi + +#echo $DS +isql $DS < $LOG_FILE >/dev/null 2>&1 + +if [ $? -ne 0 ] +then + echo "DSN is not set for target db" + exit 1 +fi + +echo Log table created in target DB + +rm -f /tmp/csql/csqltable.conf +touch /tmp/csql/csqltable.conf +if [ $DSN = "oracle" ] +then + echo "create table t1(f1 int ,f2 char(12),f3 smallint, f4 number(38),primary key(f1));">$REL_PATH/t1.sql +else + echo "create table t1(f1 int NOT NULL,f2 char(12),f3 smallint, f4 bigint,primary key(f1));">$REL_PATH/t1.sql +fi +for a in 11 12 13 14 +do +echo "insert into t1 values($a,'papu',12,$a+123124);" +done>>$REL_PATH/t1.sql + +isql $DS < $REL_PATH/t1.sql >/dev/null 2>&1 +if [ $? -ne 0 ] +then + echo "unable to creste in target db" + rm -f $REL_PATH/t1.sql + exit 2 +fi +isql $DS <$TRI_FILE1 >/dev/null + +$CSQL_INSTALL_ROOT/bin/csqlserver >/dev/null 2>&1 & +pid=$! +sleep 5 +echo "server started" +echo "drop table t1;">${REL_PATH}/dt1.sql + +$CSQL_INSTALL_ROOT/bin/cachetable -t t1 -c "f1>10" -f f1,f2 +if [ $? -ne 0 ] +then + echo "Unable to cache" + isql $DS <${REL_PATH}/dt1.sql >/dev/null 2>&1 + rm -f $REL_PATH/t1.sql ${REL_PATH}/dt1.sql + isql $DS <${REL_PATH}/mysqldeletelogtable.sql >/dev/null 2>&1 + kill `ps -ef | grep csqlcacheserver | awk -F" " '{ print $2 }'` + kill -9 $pid + ipcrm -M 4000 -M 4500 + exit 3 +fi +echo "select * from t1;">$REL_PATH/sel.sql +$CSQL_INSTALL_ROOT/bin/csql -g -s $REL_PATH/sel.sql +if [ $? -ne 0 ] +then + echo "In select" + isql $DS <${REL_PATH}/dt1.sql >/dev/null 2>&1 + rm -f $REL_PATH/t1.sql ${REL_PATH}/dt1.sql $REL_PATH/sel.sql + isql $DS <${REL_PATH}/mysqldeletelogtable.sql >/dev/null 2>&1 + kill `ps -ef | grep csqlcacheserver | awk -F" " '{ print $2 }'` + kill -9 $pid + ipcrm -M 4000 -M 4500 + exit 4 +fi + +echo "insert into t1 values(17,'papu',12,123124);">$REL_PATH/insert1.sql +echo "insert into t1 values(7,'biju',12,123125);">>$REL_PATH/insert1.sql +echo "insert into t1 values(10,'tapu',12,1231266);">>$REL_PATH/insert1.sql +isql $DS < ${REL_PATH}/insert1.sql >/dev/null 2>&1 +sleep 15 +$CSQL_INSTALL_ROOT/bin/csql -g -s $REL_PATH/sel.sql +if [ $? -ne 0 ] +then + echo "In 2nd select" + isql $DS <${REL_PATH}/dt1.sql >/dev/null 2>&1 + rm -f $REL_PATH/t1.sql ${REL_PATH}/dt1.sql $REL_PATH/sel.sql $REL_PATH/insert1.sql + isql $DS <${REL_PATH}/mysqldeletelogtable.sql >/dev/null 2>&1 + kill `ps -ef | grep csqlcacheserver | awk -F" " '{ print $2 }'` + kill -9 $pid + ipcrm -M 4000 -M 4500 + exit 5 +fi + +$CSQL_INSTALL_ROOT/bin/cachetable -t t1 -u +isql $DS <${REL_PATH}/dt1.sql >/dev/null 2>&1 +isql $DS <${REL_PATH}/mysqldeletelogtable.sql >/dev/null 2>&1 + +rm -f $REL_PATH/t1.sql ${REL_PATH}/dt1.sql $REL_PATH/sel.sql $REL_PATH/insert1.sql +kill `ps -ef | grep csqlcacheserver | awk -F" " '{ print $2 }'` +kill -9 $pid +ipcrm -M 4000 -M 4500 +exit 0 + diff --git a/test/cache/Bidirectional/test020.ksh b/test/cache/Bidirectional/test020.ksh new file mode 100755 index 00000000..b4a494e4 --- /dev/null +++ b/test/cache/Bidirectional/test020.ksh @@ -0,0 +1,166 @@ +#!/bin/ksh +# Test Case + +# Bi-directional cache test +# Create table t1 with field f1 int unique ,f2 char,f3 smallint , f4 bigint . Make bidirectional flag and cache flag true. run trigger ,create log table in target db.Cache the table by -c f1>10 -f f1,f2,f3 -p f1 . +# Insert record with 4 field .and select from t1 it should shows records having fa gretter than 10 in 3 field. +# Author:= Bijaya + +input=${PWD}/cache/Bidirectional/mysqlcreatelogtable.sql + +REL_PATH=. +if [ -s "$input" ] +then + REL_PATH=${PWD}/cache/Bidirectional +fi +rm /tmp/csql.conf +cp $REL_PATH/csql.conf /tmp +export CSQL_CONFIG_FILE=/tmp/csql.conf +echo DSN=$DSN >>$CSQL_CONFIG_FILE +DS="$DSN $DBUSER $PASSWORD" +rm -f /tmp/csql/csqlds.conf +touch /tmp/csql/csqlds.conf +$CSQL_INSTALL_ROOT/bin/csqlds -U $DBUSER -P $PASSWORD -D $DSN -N $TDB -a +if [ $? -ne 0 ] +then + exit 1; +fi +if [ "$DSN" = "myodbc3" ] +then + LOG_FILE=$REL_PATH/mysqlcreatelogtable.sql + TRI_FILE1=$REL_PATH/trigger.sql + TRI_FILE2=$REL_PATH/trigger1.sql +elif [ "$DSN" = "psql" ] +then + LOG_FILE=$REL_PATH/psqlcreatelogtable.sql + TRI_FILE1=$REL_PATH/trigger.psql + TRI_FILE2=$REL_PATH/trigger1.psql +elif [ "$DSN" = "oracle" ] +then + LOG_FILE=$REL_PATH/oraclecreatelogtable.sql + TRI_FILE1=$REL_PATH/trigger.oracle + TRI_FILE2=$REL_PATH/trigger1.oracle +elif [ "$DSN" = "sybase" ] +then + LOG_FILE=$REL_PATH/sybasecreatelogtable.sql + TRI_FILE1=$REL_PATH/trigger.sybase + TRI_FILE2=$REL_PATH/trigger1.sybase +elif [ "$DSN" = "db2" ] +then + LOG_FILE= + TRI_FILE1= + TRI_FILE2= +else + LOG_FILE= + TRI_FILE1= + TRI_FILE2= +fi + +#echo $DS +isql $DS < $LOG_FILE >/dev/null 2>&1 +if [ $? -ne 0 ] +then + echo "DSN is not set for target db" + exit 1 +fi + +echo Log table created in target DB + +rm -f /tmp/csql/csqltable.conf +touch /tmp/csql/csqltable.conf + +echo "create table t1(f1 int ,f2 char(12),f3 int, f4 int);">$REL_PATH/t1.sql +echo "create unique index ind on t1(f1) ;">>$REL_PATH/t1.sql +for a in 11 12 13 14 +do +echo "insert into t1 values($a,'papu',12,123124);" +done>>$REL_PATH/t1.sql + +isql $DS < $REL_PATH/t1.sql >/dev/null +if [ $? -ne 0 ] +then + echo "unable to creste in target db" + rm -f $REL_PATH/t1.sql + exit 2 +fi +isql $DS <$TRI_FILE1 >/dev/null + +$CSQL_INSTALL_ROOT/bin/csqlserver >/dev/null 2>&1 & +pid=$! +sleep 5 +echo "server started" +echo "drop table t1;">${REL_PATH}/dt1.sql +if [ $DSN = "oracle" -o $DSN = "sybase" ] +then +{ +$CSQL_INSTALL_ROOT/bin/cachetable -t t1 -c "f1>10" -f f1,f3,f2 -p f1 -F +if [ $? -ne 0 ] +then + echo "Unable to cache" + isql $DS <${REL_PATH}/dt1.sql >/dev/null 2>&1 + rm -f $REL_PATH/t1.sql ${REL_PATH}/dt1.sql + isql $DS <${REL_PATH}/mysqldeletelogtable.sql >/dev/null 2>&1 + kill `ps -ef | grep csqlcacheserver | awk -F" " '{ print $2 }'` + kill -9 $pid + ipcrm -M 4000 -M 4500 + exit 3 +fi +} +else +{ +$CSQL_INSTALL_ROOT/bin/cachetable -t t1 -c "f1>10" -f f1,f3,f2 -p f1 +if [ $? -ne 0 ] +then + echo "Unable to cache" + isql $DS <${REL_PATH}/dt1.sql >/dev/null 2>&1 + rm -f $REL_PATH/t1.sql ${REL_PATH}/dt1.sql + isql $DS <${REL_PATH}/mysqldeletelogtable.sql >/dev/null 2>&1 + kill `ps -ef | grep csqlcacheserver | awk -F" " '{ print $2 }'` + kill -9 $pid + ipcrm -M 4000 -M 4500 + exit 3 +fi +} +fi +echo "select * from t1;">$REL_PATH/sel.sql +$CSQL_INSTALL_ROOT/bin/csql -g -s $REL_PATH/sel.sql +if [ $? -ne 0 ] +then + echo "In select" + isql $DS <${REL_PATH}/dt1.sql >/dev/null 2>&1 + rm -f $REL_PATH/t1.sql ${REL_PATH}/dt1.sql $REL_PATH/sel.sql + isql $DS <${REL_PATH}/mysqldeletelogtable.sql >/dev/null 2>&1 + kill `ps -ef | grep csqlcacheserver | awk -F" " '{ print $2 }'` + kill -9 $pid + ipcrm -M 4000 -M 4500 + exit 4 +fi + +echo "insert into t1 values(17,'papu',12,123124);">$REL_PATH/insert1.sql +echo "insert into t1 values(7,'biju',12,123125);">>$REL_PATH/insert1.sql +echo "insert into t1 values(10,'tapu',12,1231266);">>$REL_PATH/insert1.sql +isql $DS < ${REL_PATH}/insert1.sql >/dev/null 2>&1 +sleep 20 +$CSQL_INSTALL_ROOT/bin/csql -g -s $REL_PATH/sel.sql +if [ $? -ne 0 ] +then + echo "In 2nd select" + isql $DS <${REL_PATH}/dt1.sql >/dev/null 2>&1 + rm -f $REL_PATH/t1.sql ${REL_PATH}/dt1.sql $REL_PATH/sel.sql $REL_PATH/insert1.sql + isql $DS <${REL_PATH}/mysqldeletelogtable.sql >/dev/null 2>&1 + kill `ps -ef | grep csqlcacheserver | awk -F" " '{ print $2 }'` + kill -9 $pid + ipcrm -M 4000 -M 4500 + exit 5 +fi + +$CSQL_INSTALL_ROOT/bin/cachetable -t t1 -u +isql $DS <${REL_PATH}/dt1.sql >/dev/null 2>&1 +isql $DS <${REL_PATH}/mysqldeletelogtable.sql >/dev/null 2>&1 + +rm -f $REL_PATH/t1.sql ${REL_PATH}/dt1.sql $REL_PATH/sel.sql $REL_PATH/insert1.sql +kill `ps -ef | grep csqlcacheserver | awk -F" " '{ print $2 }'` +kill -9 $pid +ipcrm -M 4000 -M 4500 +exit 0 + diff --git a/test/cache/Bidirectional/test021.ksh b/test/cache/Bidirectional/test021.ksh new file mode 100755 index 00000000..bbc9c6c6 --- /dev/null +++ b/test/cache/Bidirectional/test021.ksh @@ -0,0 +1,166 @@ +#!/bin/ksh +# Test Case + +# Bi-directional cache test +# Create table t1 with field f1 int unique,f2 char,f3 smallint , f4 bigint ,primary key(f2). Make bidirectional flag and cache flag true. run trigger ,create log table in target db.Cache the table. +# Insert some record chack it should updateed in cache node. +# Author:= Bijaya + +input=${PWD}/cache/Bidirectional/mysqlcreatelogtable.sql + +REL_PATH=. +if [ -s "$input" ] +then + REL_PATH=${PWD}/cache/Bidirectional +fi +rm /tmp/csql.conf +cp $REL_PATH/csql.conf /tmp +export CSQL_CONFIG_FILE=/tmp/csql.conf +echo DSN=$DSN >>$CSQL_CONFIG_FILE +DS="$DSN $DBUSER $PASSWORD" +rm -f /tmp/csql/csqlds.conf +touch /tmp/csql/csqlds.conf +$CSQL_INSTALL_ROOT/bin/csqlds -U $DBUSER -P $PASSWORD -D $DSN -N $TDB -a +if [ $? -ne 0 ] +then + exit 1; +fi +if [ "$DSN" = "myodbc3" ] +then + LOG_FILE=$REL_PATH/mysqlcreatelogtable.sql + TRI_FILE1=$REL_PATH/trigger.sql + TRI_FILE2=$REL_PATH/trigger1.sql +elif [ "$DSN" = "psql" ] +then + LOG_FILE=$REL_PATH/psqlcreatelogtable.sql + TRI_FILE1=$REL_PATH/trigger.psql + TRI_FILE2=$REL_PATH/trigger1.psql +elif [ "$DSN" = "oracle" ] +then + LOG_FILE=$REL_PATH/oraclecreatelogtable.sql + TRI_FILE1=$REL_PATH/trigger.oracle + TRI_FILE2=$REL_PATH/trigger1.oracle +elif [ "$DSN" = "sybase" ] +then + LOG_FILE=$REL_PATH/sybasecreatelogtable.sql + TRI_FILE1=$REL_PATH/trigger.sybase + TRI_FILE2=$REL_PATH/trigger1.sybase +elif [ "$DSN" = "db2" ] +then + LOG_FILE= + TRI_FILE1= + TRI_FILE2= +else + LOG_FILE= + TRI_FILE1= + TRI_FILE2= +fi + +#echo $DS +isql $DS < $LOG_FILE >/dev/null 2>&1 +if [ $? -ne 0 ] +then + echo "DSN is not set for target db" + exit 1 +fi + +echo Log table created in target DB + +rm -f /tmp/csql/csqltable.conf +touch /tmp/csql/csqltable.conf + +echo "create table t1(f1 int ,f2 char(12),f3 int, f4 int,primary key(f2));">$REL_PATH/t1.sql +echo "create unique index ind on t1(f1) ;">>$REL_PATH/t1.sql +for a in 11 12 13 14 +do +echo "insert into t1 values($a,'papu$a',12,$a+123124);" +done>>$REL_PATH/t1.sql + +isql $DS < $REL_PATH/t1.sql >/dev/null 2>&1 +if [ $? -ne 0 ] +then + echo "unable to creste in target db" + rm -f $REL_PATH/t1.sql + exit 2 +fi +isql $DS <$TRI_FILE1 >/dev/null + +$CSQL_INSTALL_ROOT/bin/csqlserver >/dev/null 2>&1 & +pid=$! +sleep 5 +echo "server started" +echo "drop table t1;">${REL_PATH}/dt1.sql +if [ $DSN = "oracle" -o $DSN = "sybase" ] +then +{ +$CSQL_INSTALL_ROOT/bin/cachetable -t t1 -f f1,f2,f4 -p f1 -F +if [ $? -ne 0 ] +then + echo "Unable to cache" + isql $DS <${REL_PATH}/dt1.sql >/dev/null 2>&1 + rm -f $REL_PATH/t1.sql ${REL_PATH}/dt1.sql + isql $DS <${REL_PATH}/mysqldeletelogtable.sql >/dev/null 2>&1 + kill `ps -ef | grep csqlcacheserver | awk -F" " '{ print $2 }'` + kill -9 $pid + ipcrm -M 4000 -M 4500 + exit 3 +fi +} +else +{ +$CSQL_INSTALL_ROOT/bin/cachetable -t t1 -f f1,f2,f4 -p f1 +if [ $? -ne 0 ] +then + echo "Unable to cache" + isql $DS <${REL_PATH}/dt1.sql >/dev/null 2>&1 + rm -f $REL_PATH/t1.sql ${REL_PATH}/dt1.sql + isql $DS <${REL_PATH}/mysqldeletelogtable.sql >/dev/null 2>&1 + kill `ps -ef | grep csqlcacheserver | awk -F" " '{ print $2 }'` + kill -9 $pid + ipcrm -M 4000 -M 4500 + exit 3 +fi +} +fi +echo "select * from t1;">$REL_PATH/sel.sql +$CSQL_INSTALL_ROOT/bin/csql -g -s $REL_PATH/sel.sql +if [ $? -ne 0 ] +then + echo "In select" + isql $DS <${REL_PATH}/dt1.sql >/dev/null 2>&1 + rm -f $REL_PATH/t1.sql ${REL_PATH}/dt1.sql $REL_PATH/sel.sql + isql $DS <${REL_PATH}/mysqldeletelogtable.sql >/dev/null 2>&1 + kill `ps -ef | grep csqlcacheserver | awk -F" " '{ print $2 }'` + kill -9 $pid + ipcrm -M 4000 -M 4500 + exit 4 +fi + +echo "insert into t1 values(17,'papu',12,123124);">$REL_PATH/insert1.sql +echo "insert into t1 values(7,'biju',12,123125);">>$REL_PATH/insert1.sql +echo "insert into t1 values(10,'tapu',12,1231266);">>$REL_PATH/insert1.sql +isql $DS < ${REL_PATH}/insert1.sql >/dev/null 2>&1 +sleep 20 +$CSQL_INSTALL_ROOT/bin/csql -g -s $REL_PATH/sel.sql +if [ $? -ne 0 ] +then + echo "In 2nd select" + isql $DS <${REL_PATH}/dt1.sql >/dev/null 2>&1 + rm -f $REL_PATH/t1.sql ${REL_PATH}/dt1.sql $REL_PATH/sel.sql $REL_PATH/insert1.sql + isql $DS <${REL_PATH}/mysqldeletelogtable.sql >/dev/null 2>&1 + kill `ps -ef | grep csqlcacheserver | awk -F" " '{ print $2 }'` + kill -9 $pid + ipcrm -M 4000 -M 4500 + exit 5 +fi + +$CSQL_INSTALL_ROOT/bin/cachetable -t t1 -u +isql $DS <${REL_PATH}/dt1.sql >/dev/null 2>&1 +isql $DS <${REL_PATH}/mysqldeletelogtable.sql >/dev/null 2>&1 + +rm -f $REL_PATH/t1.sql ${REL_PATH}/dt1.sql $REL_PATH/sel.sql $REL_PATH/insert1.sql +kill `ps -ef | grep csqlcacheserver | awk -F" " '{ print $2 }'` +kill -9 $pid +ipcrm -M 4000 -M 4500 +exit 0 + diff --git a/test/cache/Bidirectional/test022.ksh b/test/cache/Bidirectional/test022.ksh new file mode 100755 index 00000000..7062b4dc --- /dev/null +++ b/test/cache/Bidirectional/test022.ksh @@ -0,0 +1,171 @@ +#!/bin/ksh +# Test Case + +# Bi-directional cache test +# Create table t1 with field f1 int unique, f2 char,f3 smallint , f4 bigint ,primary key(f2,f3) . Make bidirectional flag and cache flag true. run trigger ,create log table in target db.Cache the table by -f f1,f2,f3 -p f1 . insert record with 4 field .and select from t1 it should three field values. +# Author:= Bijaya + +input=${PWD}/cache/Bidirectional/mysqlcreatelogtable.sql + +REL_PATH=. +if [ -s "$input" ] +then + REL_PATH=${PWD}/cache/Bidirectional +fi +rm /tmp/csql.conf +cp $REL_PATH/csql.conf /tmp +export CSQL_CONFIG_FILE=/tmp/csql.conf +echo DSN=$DSN >>$CSQL_CONFIG_FILE +DS="$DSN $DBUSER $PASSWORD" +rm -f /tmp/csql/csqlds.conf +touch /tmp/csql/csqlds.conf +$CSQL_INSTALL_ROOT/bin/csqlds -U $DBUSER -P $PASSWORD -D $DSN -N $TDB -a +if [ $? -ne 0 ] +then + exit 1; +fi +if [ "$DSN" = "myodbc3" ] +then + LOG_FILE=$REL_PATH/mysqlcreatelogtable.sql + TRI_FILE1=$REL_PATH/trigger.sql + TRI_FILE2=$REL_PATH/trigger1.sql +elif [ "$DSN" = "psql" ] +then + LOG_FILE=$REL_PATH/psqlcreatelogtable.sql + TRI_FILE1=$REL_PATH/trigger.psql + TRI_FILE2=$REL_PATH/trigger1.psql +elif [ "$DSN" = "oracle" ] +then + LOG_FILE=$REL_PATH/oraclecreatelogtable.sql + TRI_FILE1=$REL_PATH/trigger.oracle + TRI_FILE2=$REL_PATH/trigger1.oracle +elif [ "$DSN" = "sybase" ] +then + LOG_FILE=$REL_PATH/sybasecreatelogtable.sql + TRI_FILE1=$REL_PATH/trigger.sybase + TRI_FILE2=$REL_PATH/trigger1.sybase +elif [ "$DSN" = "db2" ] +then + LOG_FILE=$REL_PATH/db2createlogtable.sql + TRI_FILE1=$REL_PATH/trigger.db2 + TRI_FILE2=$REL_PATH/trigger1.db2 +else + LOG_FILE= + TRI_FILE1= + TRI_FILE2= +fi + +#echo $DS +isql $DS < $LOG_FILE >/dev/null 2>&1 +if [ $? -ne 0 ] +then + echo "DSN is not set for target db" + exit 1 +fi + +echo Log table created in target DB + +rm -f /tmp/csql/csqltable.conf +touch /tmp/csql/csqltable.conf +echo "create table t1(f1 int ,f2 char(12),f3 int, f4 int,primary key(f2));">$REL_PATH/t1.sql + +if [ $DSN = "db2" ] +then +echo "create table t1(f1 int not null,f2 char(12) not null,f3 int, f4 int,primary key(f2));">$REL_PATH/t1.sql +fi + +echo "create unique index ind on t1(f1) ;">>$REL_PATH/t1.sql +for a in 11 12 13 14 +do +echo "insert into t1 values($a,'papu$a',12,$a+123124);" +done>>$REL_PATH/t1.sql + +isql $DS < $REL_PATH/t1.sql >/dev/null 2>&1 +if [ $? -ne 0 ] +then + echo "unable to creste in target db" + rm -f $REL_PATH/t1.sql + exit 2 +fi +isql $DS <$TRI_FILE1 >/dev/null + +$CSQL_INSTALL_ROOT/bin/csqlserver >/dev/null 2>&1 & +pid=$! +sleep 5 +echo "server started" +echo "drop table t1;">${REL_PATH}/dt1.sql +if [ $DSN = "oracle" -o $DSN = "sybase" -o $DSN = "db2" ] +then +{ +$CSQL_INSTALL_ROOT/bin/cachetable -t t1 -c "f1>10" -f f1,f3,f2 -p f1 -F +if [ $? -ne 0 ] +then + echo "Unable to cache" + isql $DS <${REL_PATH}/dt1.sql >/dev/null 2>&1 + rm -f $REL_PATH/t1.sql ${REL_PATH}/dt1.sql + isql $DS <${REL_PATH}/mysqldeletelogtable.sql >/dev/null 2>&1 + kill `ps -ef | grep csqlcacheserver | awk -F" " '{ print $2 }'` + kill -9 $pid + ipcrm -M 4000 -M 4500 + exit 3 +fi +} +else +{ +$CSQL_INSTALL_ROOT/bin/cachetable -t t1 -c "f1>10" -f f1,f3,f2 -p f1 +if [ $? -ne 0 ] +then + echo "Unable to cache" + isql $DS <${REL_PATH}/dt1.sql >/dev/null 2>&1 + rm -f $REL_PATH/t1.sql ${REL_PATH}/dt1.sql + isql $DS <${REL_PATH}/mysqldeletelogtable.sql >/dev/null 2>&1 + kill `ps -ef | grep csqlcacheserver | awk -F" " '{ print $2 }'` + kill -9 $pid + ipcrm -M 4000 -M 4500 + exit 3 +fi +} +fi + +echo "select * from t1;">$REL_PATH/sel.sql +$CSQL_INSTALL_ROOT/bin/csql -g -s $REL_PATH/sel.sql +if [ $? -ne 0 ] +then + echo "In select" + isql $DS <${REL_PATH}/dt1.sql >/dev/null 2>&1 + rm -f $REL_PATH/t1.sql ${REL_PATH}/dt1.sql $REL_PATH/sel.sql + isql $DS <${REL_PATH}/mysqldeletelogtable.sql >/dev/null 2>&1 + kill `ps -e | grep csqlcacheserver | awk -F" " '{ print $1 }'` + kill -9 $pid + ipcrm -M 4000 -M 4500 + exit 4 +fi + +echo "insert into t1 values(17,'papu',12,123124);">$REL_PATH/insert1.sql +echo "insert into t1 values(7,'biju',12,123125);">>$REL_PATH/insert1.sql +echo "insert into t1 values(10,'tapu',12,1231266);">>$REL_PATH/insert1.sql +isql $DS < ${REL_PATH}/insert1.sql >/dev/null 2>&1 +sleep 15 +$CSQL_INSTALL_ROOT/bin/csql -g -s $REL_PATH/sel.sql +if [ $? -ne 0 ] +then + echo "In 2nd select" + isql $DS <${REL_PATH}/dt1.sql >/dev/null 2>&1 + rm -f $REL_PATH/t1.sql ${REL_PATH}/dt1.sql $REL_PATH/sel.sql $REL_PATH/insert1.sql + isql $DS <${REL_PATH}/mysqldeletelogtable.sql >/dev/null 2>&1 + kill `ps -ef | grep csqlcacheserver | awk -F" " '{ print $2 }'` + kill -9 $pid + ipcrm -M 4000 -M 4500 + exit 5 +fi + +$CSQL_INSTALL_ROOT/bin/cachetable -t t1 -u +isql $DS <${REL_PATH}/dt1.sql >/dev/null 2>&1 +isql $DS <${REL_PATH}/mysqldeletelogtable.sql >/dev/null 2>&1 + +rm -f $REL_PATH/t1.sql ${REL_PATH}/dt1.sql $REL_PATH/sel.sql $REL_PATH/insert1.sql +kill `ps -ef | grep csqlcacheserver | awk -F" " '{ print $2 }'` +kill -9 $pid +ipcrm -M 4000 -M 4500 +exit 0 + diff --git a/test/cache/Bidirectional/trigger.psql b/test/cache/Bidirectional/trigger.psql new file mode 100644 index 00000000..c67b2f7d --- /dev/null +++ b/test/cache/Bidirectional/trigger.psql @@ -0,0 +1,7 @@ +DROP LANGUAGE IF EXISTS plpgsql CASCADE ; +CREATE LANGUAGE plpgsql; +CREATE OR REPLACE FUNCTION log_insert_t1() RETURNS trigger AS $triggerinsertt1$ BEGIN insert into csql_log_int (tablename, pkid, operation, cacheid) values ('t1', NEW.f1, 1, 1); insert into csql_log_int (tablename, pkid, operation, cacheid) values ('t1', NEW.f1, 1, 2); RETURN NEW; END; $triggerinsertt1$ LANGUAGE plpgsql; +create trigger triggerinsertt1 AFTER INSERT on t1 FOR EACH ROW EXECUTE PROCEDURE log_insert_t1(); +CREATE OR REPLACE FUNCTION log_update_t1() RETURNS trigger AS $triggerupdatet1$ BEGIN insert into csql_log_int (tablename, pkid, operation, cacheid) values ('t1', OLD.f1, 2, 1); insert into csql_log_int (tablename, pkid, operation, cacheid) values ('t1', NEW.f1, 1, 1); insert into csql_log_int (tablename, pkid, operation, cacheid) values ('t1', OLD.f1, 2, 2); insert into csql_log_int (tablename, pkid, operation, cacheid) values ('t1', NEW.f1, 1, 2); RETURN NEW; END; $triggerupdatet1$ LANGUAGE plpgsql; +create trigger triggerupdatet1 AFTER UPDATE on t1 FOR EACH ROW EXECUTE PROCEDURE log_update_t1(); +CREATE OR REPLACE FUNCTION log_delete_t1() RETURNS trigger AS $triggerdeletet1$ BEGIN insert into csql_log_int (tablename, pkid, operation, cacheid) values ('t1', OLD.f1, 2, 1); insert into csql_log_int (tablename, pkid, operation, cacheid) values ('t1', OLD.f1, 2, 2); RETURN NEW; END; $triggerdeletet1$ LANGUAGE plpgsql; create trigger triggerdeletet1 AFTER DELETE on t1 FOR EACH ROW EXECUTE PROCEDURE log_delete_t1(); diff --git a/test/cache/Bidirectional/trigger.sql b/test/cache/Bidirectional/trigger.sql new file mode 100644 index 00000000..669bd573 --- /dev/null +++ b/test/cache/Bidirectional/trigger.sql @@ -0,0 +1,7 @@ +drop trigger if exists triggerinsertt1; +drop trigger if exists triggerupdatet1; +drop trigger if exists triggerdeletet1; +create trigger triggerinsertt1 AFTER INSERT on t1 FOR EACH ROW BEGIN Insert into csql_log_int (tablename, pkid, operation,cacheid) values ('t1', NEW.f1, 1,1); Insert into csql_log_int (tablename, pkid, operation,cacheid) values ('t1', NEW.f1, 1,2);End; +create trigger triggerupdatet1 AFTER UPDATE on t1 FOR EACH ROW BEGIN Insert into csql_log_int (tablename, pkid, operation,cacheid) values ('t1', OLD.f1, 2,1);Insert into csql_log_int (tablename, pkid, operation,cacheid) values ('t1', NEW.f1, 1,1);Insert into csql_log_int (tablename, pkid, operation,cacheid) values ('t1', OLD.f1, 2,2);Insert into csql_log_int (tablename, pkid, operation,cacheid) values ('t1', NEW.f1, 1,2); End; +create trigger triggerdeletet1 AFTER DELETE on t1 FOR EACH ROW BEGIN Insert into csql_log_int (tablename, pkid, operation,cacheid) values ('t1', OLD.f1, 2,1); Insert into csql_log_int (tablename, pkid, operation,cacheid) values ('t1', OLD.f1, 2,2);End; + diff --git a/test/cache/Bidirectional/trigger1.psql b/test/cache/Bidirectional/trigger1.psql new file mode 100644 index 00000000..102104b2 --- /dev/null +++ b/test/cache/Bidirectional/trigger1.psql @@ -0,0 +1,10 @@ +CREATE LANGUAGE plpgsql; +DROP FUNCTION IF EXISTS log_insert_t2() CASCADE ; +CREATE OR REPLACE FUNCTION log_insert_t2() RETURNS trigger AS $triggerinsertt2$ BEGIN insert into csql_log_int (tablename, pkid, operation, cacheid) values ('t2', NEW.f1, 1, 1); insert into csql_log_int (tablename, pkid, operation, cacheid) values ('t2', NEW.f1, 1, 2); RETURN NEW; END; $triggerinsertt2$ LANGUAGE plpgsql; +create trigger triggerinsertt2 AFTER INSERT on t2 FOR EACH ROW EXECUTE PROCEDURE log_insert_t2(); +DROP FUNCTION IF EXISTS log_update_t2() CASCADE ; +CREATE OR REPLACE FUNCTION log_update_t2() RETURNS trigger AS $triggerupdatet2$ BEGIN insert into csql_log_int (tablename, pkid, operation, cacheid) values ('t2', OLD.f1, 2, 1); insert into csql_log_int (tablename, pkid, operation, cacheid) values ('t2', NEW.f1, 1, 1); insert into csql_log_int (tablename, pkid, operation, cacheid) values ('t2', OLD.f1, 2, 2); insert into csql_log_int (tablename, pkid, operation, cacheid) values ('t2', NEW.f1, 1, 2); RETURN NEW; END; $triggerupdatet2$ LANGUAGE plpgsql; +create trigger triggerupdatet2 AFTER UPDATE on t2 FOR EACH ROW EXECUTE PROCEDURE log_update_t2(); +DROP FUNCTION IF EXISTS log_delete_t2() CASCADE ; +CREATE OR REPLACE FUNCTION log_delete_t2() RETURNS trigger AS $triggerdeletet2$ BEGIN insert into csql_log_int (tablename, pkid, operation, cacheid) values ('t2', OLD.f1, 2, 1); insert into csql_log_int (tablename, pkid, operation, cacheid) values ('t2', OLD.f1, 2, 2); RETURN NEW; END; $triggerdeletet2$ LANGUAGE plpgsql; +create trigger triggerdeletet2 AFTER DELETE on t2 FOR EACH ROW EXECUTE PROCEDURE log_delete_t2(); diff --git a/test/cache/Bidirectional/trigger1.sql b/test/cache/Bidirectional/trigger1.sql new file mode 100644 index 00000000..00e4b185 --- /dev/null +++ b/test/cache/Bidirectional/trigger1.sql @@ -0,0 +1,7 @@ +use test; +drop trigger if exists triggerinsertt2; +drop trigger if exists triggerupdatet2; +drop trigger if exists triggerdeletet2; +create trigger triggerinsertt2 AFTER INSERT on t2 FOR EACH ROW BEGIN Insert into csql_log_int (tablename, pkid, operation,cacheid) values ('t2', NEW.f1, 1,1); Insert into csql_log_int (tablename, pkid, operation,cacheid) values ('t2', NEW.f1, 1,2);End; +create trigger triggerupdatet2 AFTER UPDATE on t2 FOR EACH ROW BEGIN Insert into csql_log_int (tablename, pkid, operation,cacheid) values ('t2', OLD.f1, 2,1); Insert into csql_log_int (tablename, pkid, operation,cacheid) values ('t2', NEW.f1, 1,1);Insert into csql_log_int (tablename, pkid, operation,cacheid) values ('t2', OLD.f1, 2,2);Insert into csql_log_int (tablename, pkid, operation,cacheid) values ('t2', NEW.f1, 1,2); End; +create trigger triggerdeletet2 AFTER DELETE on t2 FOR EACH ROW BEGIN Insert into csql_log_int (tablename, pkid, operation,cacheid) values ('t2', OLD.f1, 2,1); Insert into csql_log_int (tablename, pkid, operation,cacheid) values ('t2', OLD.f1, 2,2);End; diff --git a/test/cache/Bidirectional/update.sql b/test/cache/Bidirectional/update.sql new file mode 100644 index 00000000..0153477a --- /dev/null +++ b/test/cache/Bidirectional/update.sql @@ -0,0 +1,4 @@ +update t1 set f2 =50 where f1 < 6; +update t2 set f2 =110 where f1 <6; +commit; + diff --git a/test/cache/CacheTable/cre_ins_csql.sql b/test/cache/CacheTable/cre_ins_csql.sql new file mode 100644 index 00000000..2d5b87a7 --- /dev/null +++ b/test/cache/CacheTable/cre_ins_csql.sql @@ -0,0 +1,6 @@ +echo create table t1(f1 int); +create table t1(f1 int); +echo insert into t1 values(2); +insert into t1 values(2); +echo select * from t1; +select * from t1; diff --git a/test/cache/CacheTable/cre_ins_sybase.sql b/test/cache/CacheTable/cre_ins_sybase.sql new file mode 100644 index 00000000..362b2005 --- /dev/null +++ b/test/cache/CacheTable/cre_ins_sybase.sql @@ -0,0 +1,3 @@ +create table t1(f1 int); +insert into t1 values(1); +select * from t1; diff --git a/test/cache/CacheTable/cre_ins_tdb.sql b/test/cache/CacheTable/cre_ins_tdb.sql new file mode 100644 index 00000000..9592e25b --- /dev/null +++ b/test/cache/CacheTable/cre_ins_tdb.sql @@ -0,0 +1,6 @@ +echo create table t1(f1 int); +create table t1(f1 int); +echo insert into t1 values(1); +insert into t1 values(1); +echo select * from t1; +select * from t1; diff --git a/test/cache/CacheTable/create.sql b/test/cache/CacheTable/create.sql new file mode 100644 index 00000000..b8e3c055 --- /dev/null +++ b/test/cache/CacheTable/create.sql @@ -0,0 +1,22 @@ +create table t1 (t1f1 int not null primary key, t2f2 int); +insert into t1 values(1,11); +insert into t1 values(2,21); +insert into t1 values(3,31); +insert into t1 values(4,41); +insert into t1 values(5,51); +insert into t1 values(6,61); +insert into t1 values(7,71); +insert into t1 values(8,81); +insert into t1 values(9,91); +insert into t1 values(10,101); +create table t2 (t2f1 int not null primary key, t2f2 int); +insert into t2 values(1,11); +insert into t2 values(2,21); +insert into t2 values(3,31); +insert into t2 values(4,41); +insert into t2 values(5,51); +insert into t2 values(6,61); +insert into t2 values(7,71); +insert into t2 values(8,81); +insert into t2 values(9,91); +insert into t2 values(10,101); diff --git a/test/cache/CacheTable/create1.sql b/test/cache/CacheTable/create1.sql new file mode 100644 index 00000000..30d22802 --- /dev/null +++ b/test/cache/CacheTable/create1.sql @@ -0,0 +1 @@ +create table t4 (f1 int,f2 char(10),primary key(f1,f2)); diff --git a/test/cache/CacheTable/create1db2.sql b/test/cache/CacheTable/create1db2.sql new file mode 100644 index 00000000..b0a82d00 --- /dev/null +++ b/test/cache/CacheTable/create1db2.sql @@ -0,0 +1 @@ +create table t4 (f1 int not null,f2 char(10) not null,primary key(f1,f2)); diff --git a/test/cache/CacheTable/createt3.sql b/test/cache/CacheTable/createt3.sql new file mode 100644 index 00000000..3bc6c7c7 --- /dev/null +++ b/test/cache/CacheTable/createt3.sql @@ -0,0 +1,11 @@ +create table t3 (t3f1 int, t3f2 int, primary key (t3f1) ); +insert into t3 values(1,11); +insert into t3 values(2,21); +insert into t3 values(3,31); +insert into t3 values(4,41); +insert into t3 values(5,51); +insert into t3 values(6,61); +insert into t3 values(7,71); +insert into t3 values(8,81); +insert into t3 values(9,91); +insert into t3 values(10,101); diff --git a/test/cache/CacheTable/createt5.sql b/test/cache/CacheTable/createt5.sql new file mode 100644 index 00000000..b0adc64b --- /dev/null +++ b/test/cache/CacheTable/createt5.sql @@ -0,0 +1,2 @@ +create table t5 (f1 int unique,f2 int,primary key(f2)); +create table t6 (f1 int not null,f2 int not null); diff --git a/test/cache/CacheTable/createt5db2.sql b/test/cache/CacheTable/createt5db2.sql new file mode 100644 index 00000000..8c4c4637 --- /dev/null +++ b/test/cache/CacheTable/createt5db2.sql @@ -0,0 +1,2 @@ +create table t5 (f1 int ,f2 int not null,primary key(f2)); +create table t6 (f1 int not null,f2 int not null); diff --git a/test/cache/CacheTable/createtable.sql b/test/cache/CacheTable/createtable.sql new file mode 100644 index 00000000..2884df3a --- /dev/null +++ b/test/cache/CacheTable/createtable.sql @@ -0,0 +1,16 @@ +create table t1(t1f1 int NOT NULL,t1f2 char(10),primary key(t1f1)); +insert into t1 values(10,'AAA'); +insert into t1 values(20,'BBB'); +create table t2(t2f1 int NOT NULL,t2f2 char(10),primary key(t2f1)); +insert into t2 values(10,'AAA'); +insert into t2 values(20,'BBB'); +create table t3(t3f1 int NOT NULL,t3f2 char(10),primary key(t3f1)); +insert into t3 values(10,'AAA'); +insert into t3 values(20,'BBB'); +create table t4(t4f1 int NOT NULL,t4f2 char(10),primary key(t4f1)); +insert into t4 values(10,'AAA'); +insert into t4 values(20,'BBB'); +create table t5(t5f1 int,t5f2 char(10)); +insert into t5 values(10,'AAA'); +insert into t5 values(20,'BBB'); + diff --git a/test/cache/CacheTable/csql.conf b/test/cache/CacheTable/csql.conf new file mode 100644 index 00000000..25408e84 --- /dev/null +++ b/test/cache/CacheTable/csql.conf @@ -0,0 +1,110 @@ +# 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=1048576 + +#Maximum size of the user database file. +MAX_DB_SIZE=10485760 + +#Shared memory key to be used by the system to create and locate system database. +SYS_DB_KEY=4000 + +#Shared memory key to be used by the system to create and locate user database. +USER_DB_KEY=4500 + +#Log level 0->no logging 1->Fine 2->Finer 3->Finest +LOG_LEVEL=0 + +#Give full path for the log file where important system actions are stored. +LOG_FILE=/tmp/csql/log/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 + +# Can be set true only when DURABILITY is true +MMAP=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=true + +#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 + + +ENABLE_BIDIRECTIONAL_CACHE=false + +CACHE_RECEIVER_WAIT_SECS=10 + +#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 table information is stored +TABLE_CONFIG_FILE=/tmp/csql/csqltable.conf + +#Give full path of the file where all the DSN information is stored +DS_CONFIG_FILE=/tmp/csql/csqlds.conf + +#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/cache/CacheTable/csql1.conf b/test/cache/CacheTable/csql1.conf new file mode 100644 index 00000000..646535ee --- /dev/null +++ b/test/cache/CacheTable/csql1.conf @@ -0,0 +1,169 @@ +# CSQL System Configuration File + +#####################################Server Section######################## + +# Site ID for this CSQL server +SITE_ID=1 + +#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=1048576 + +#Maximum size of the user database file. +MAX_DB_SIZE=10485760 + +#Shared memory key to be used by the system to create and locate system database. +SYS_DB_KEY=4000 + +#Shared memory key to be used by the system to create and locate user database. +USER_DB_KEY=4500 + +#Log level 0->no logging 1->Fine 2->Finer 3->Finest +LOG_LEVEL=0 + +#Give full path for the log file where important system actions are stored. +LOG_FILE=/tmp/csql/log/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 + +#checkpoint server interval in seconds +CHECKPOINT_SECS=600 + +#minimum redo log size for checkpoint to be initiated +CHECKPOINT_LOG_SIZE=10485760 + +# Whether to enable memory map architecture for user database +MMAP=true + +# Specifies the durability mode for redo log generation +# Valid values are +# 1 ->uses standard redo logging with O_APPEND mode +# 2 ->uses standard logging with serialization +# 3 ->uses O_SYNC flag +# 4 ->uses O_DIRECT flag + +DURABLE_MODE=1 + +#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 + +# Give full path for the std error file to store all the errors during database operations +STDERR_FILE=stderr + +#Restarts auxillary servers (SQL, Cache,etc), if they crash +MONITOR_SERVERS=false + +#####################################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 + +#Statement Cache Size +STMT_CACHE_SIZE=10 + +#Enable statement cache for statements with no parameters +#Only SELECT statement with no date, time, timestamp fields will be cached. +STMT_CACHE_NOPARAM=false + +#####################################Cache Section######################## + +#Whether to enable caching of tables from target database +#CACHE_TABLE=false +CACHE_TABLE=true + +#DSN Name to connect to the target database. +#This should be present in ~/odbc.ini file +DSN=oracle + +# Whethere to enable bidirectional updates for cached tables. +ENABLE_BIDIRECTIONAL_CACHE=true + +CACHE_RECEIVER_WAIT_SECS=10 + +#Mode of operation SYNC or ASYNC +CACHE_MODE=SYNC + +# If CACHE_MODE=OFFLINE then size of OfflineLogFile +OFFLINE_FILE_SIZE=1048576 + +##########################SqlNetworkServer Section######################## + +# Whether to enable SqlNetwork server +CSQL_SQL_SERVER=false + +#Set port for Network access +PORT=5678 + +# Max number of seconds that the network layer waits to receive a pkt +NETWORK_RESPONSE_TIMEOUT=3 + +# Max number of seconds that the network layer waits to connect to sql server +NETWORK_CONNECT_TIMEOUT=5 + +#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 table information is stored +TABLE_CONFIG_FILE=/tmp/csql/csqltable.conf + +#Give full path of the file where all the DSN information is stored +DS_CONFIG_FILE=/tmp/csql/csqlds.conf + +#Give full path for the file where all the peer site information is stored +NETWORK_CONFIG_FILE=/tmp/csql/csqlnw.conf + +# Give full path for conflict Resolution file +CONFL_RESOL_FILE=/tmp/csql/conflResoFile.txt + +# MSGKEY for creating msg queue for MsgQueue Server +MSG_KEY=2525 + +# Maximum message that the message queue server is able to handle for +# asynchronous updates. This value is is default value of 'kernel.msgmax' +# parameter. +ASYNC_MSGMAX=8192 + +# Maximum number of messages that the message queue server will hold for a site +# that is down in the replication group. +MAX_QUEUE_LOGS=100 + +# Shared memory key for id generators +ID_SHM_KEY=1947 +#####################################End Section######################## +DSN=myodbc3 +DSN=myodbc3 +DSN=myodbc3 +DSN=myodbc3 +DSN=myodbc3 +DSN=myodbc3 +DSN=myodbc3 +DSN=myodbc3 diff --git a/test/cache/CacheTable/csqlinput.sql b/test/cache/CacheTable/csqlinput.sql new file mode 100644 index 00000000..e3d6952e --- /dev/null +++ b/test/cache/CacheTable/csqlinput.sql @@ -0,0 +1 @@ +CREATE TABLE t1 (f1 SMALLINT, f2 INT, primary key (f1)); diff --git a/test/cache/CacheTable/csqlinputoracle.sql b/test/cache/CacheTable/csqlinputoracle.sql new file mode 100644 index 00000000..2bd47d24 --- /dev/null +++ b/test/cache/CacheTable/csqlinputoracle.sql @@ -0,0 +1 @@ +create table t1(f1 bigint, f2 bigint, primary key(f1)); diff --git a/test/cache/CacheTable/csqlinputtest9.sql b/test/cache/CacheTable/csqlinputtest9.sql new file mode 100644 index 00000000..ef96a342 --- /dev/null +++ b/test/cache/CacheTable/csqlinputtest9.sql @@ -0,0 +1 @@ +CREATE TABLE t1 (f1 SMALLINT NOT NULL, f2 INT, primary key (f1)); diff --git a/test/cache/CacheTable/csqlinputtest9oracle.sql b/test/cache/CacheTable/csqlinputtest9oracle.sql new file mode 100644 index 00000000..d9cdb304 --- /dev/null +++ b/test/cache/CacheTable/csqlinputtest9oracle.sql @@ -0,0 +1 @@ +CREATE TABLE t1 (f1 BIGINT NOT NULL, f2 BIGINT, primary key (f1)); diff --git a/test/cache/CacheTable/csqlinputwithrec.sql b/test/cache/CacheTable/csqlinputwithrec.sql new file mode 100644 index 00000000..cd0b8748 --- /dev/null +++ b/test/cache/CacheTable/csqlinputwithrec.sql @@ -0,0 +1,3 @@ +CREATE TABLE t1 (f1 SMALLINT, f2 INT, primary key (f1)); +INSERT INTO t1 VALUES(3, 3333); +INSERT INTO t1 VALUES(4, 4444); diff --git a/test/cache/CacheTable/deletefromt1csql.sql b/test/cache/CacheTable/deletefromt1csql.sql new file mode 100644 index 00000000..cbff0b00 --- /dev/null +++ b/test/cache/CacheTable/deletefromt1csql.sql @@ -0,0 +1 @@ +delete from t1 where t1f1 in (1,3,5,7,9); diff --git a/test/cache/CacheTable/deletefromt2mysql.sql b/test/cache/CacheTable/deletefromt2mysql.sql new file mode 100644 index 00000000..d6b58361 --- /dev/null +++ b/test/cache/CacheTable/deletefromt2mysql.sql @@ -0,0 +1 @@ +delete from t2 where t2f1 in (2,4,6,8,10); diff --git a/test/cache/CacheTable/drop.sql b/test/cache/CacheTable/drop.sql new file mode 100644 index 00000000..853c1ad6 --- /dev/null +++ b/test/cache/CacheTable/drop.sql @@ -0,0 +1 @@ +drop table t1; diff --git a/test/cache/CacheTable/drop1.sql b/test/cache/CacheTable/drop1.sql new file mode 100644 index 00000000..a781646e --- /dev/null +++ b/test/cache/CacheTable/drop1.sql @@ -0,0 +1 @@ +drop table t4; diff --git a/test/cache/CacheTable/drop5.sql b/test/cache/CacheTable/drop5.sql new file mode 100644 index 00000000..a7bb213e --- /dev/null +++ b/test/cache/CacheTable/drop5.sql @@ -0,0 +1,2 @@ +drop table t5; +drop table t6; diff --git a/test/cache/CacheTable/drop_t1.sql b/test/cache/CacheTable/drop_t1.sql new file mode 100644 index 00000000..0bf7a82b --- /dev/null +++ b/test/cache/CacheTable/drop_t1.sql @@ -0,0 +1,2 @@ +echo drop table t1; +drop table t1; diff --git a/test/cache/CacheTable/dropall.sql b/test/cache/CacheTable/dropall.sql new file mode 100644 index 00000000..d7f36328 --- /dev/null +++ b/test/cache/CacheTable/dropall.sql @@ -0,0 +1,6 @@ +drop table t1; +drop table t2; +drop table t3; +drop table t4; +drop table t5; + diff --git a/test/cache/CacheTable/dropt1t2.sql b/test/cache/CacheTable/dropt1t2.sql new file mode 100644 index 00000000..436e4f57 --- /dev/null +++ b/test/cache/CacheTable/dropt1t2.sql @@ -0,0 +1,3 @@ +drop table t1; +drop table t2; + diff --git a/test/cache/CacheTable/droptable.sql b/test/cache/CacheTable/droptable.sql new file mode 100644 index 00000000..d7f36328 --- /dev/null +++ b/test/cache/CacheTable/droptable.sql @@ -0,0 +1,6 @@ +drop table t1; +drop table t2; +drop table t3; +drop table t4; +drop table t5; + diff --git a/test/cache/CacheTable/exp.test001.ksh b/test/cache/CacheTable/exp.test001.ksh new file mode 100644 index 00000000..a9e2005e --- /dev/null +++ b/test/cache/CacheTable/exp.test001.ksh @@ -0,0 +1,29 @@ +Usage: cachetable [ -U ] [ -P ] + [ -t [-D] [ -c "condition" ] + [-f "fieldListToCache"] + [ -p [-F] ] + [ -d ] + [ -l |] + [ -u [-s] ] + [ -s | -r | -E ] ] + [ -S | -R ] + + U -> Username to connect with csql. + P -> Password for above username. + t -> Table name to be cached in csql from target db. + D -> Enable direct access option to target database. + c -> Conditional expression used in std SQL WHERE clause. + f -> List of field names to be cached. Comma separated. + p -> Not Null unique index field name for Bidirectional + caching on which trigger needs to be run. + d -> Cache the table from the specified DSN. + l -> Retrieves all the cached tables from the specified DSN. + F -> Forceful caching. + s -> Load only the records from target db. + Assumes table is already created in csql. + u -> Unload the table. If used with -s option, + removes only records and preserves the schema. + r -> Reload the table. Get the latest image of table from target db. + E -> Elevate table status from Replicated to Cached and Replicated. + S -> Cache Description for cached tables. + R -> Recover all cached tables from the target database. diff --git a/test/cache/CacheTable/exp.test003.ksh b/test/cache/CacheTable/exp.test003.ksh new file mode 100644 index 00000000..9c58923e --- /dev/null +++ b/test/cache/CacheTable/exp.test003.ksh @@ -0,0 +1,4 @@ +CREATE TABLE t1 (f1 SMALLINT NOT NULL , f2 INT ); +CREATE INDEX t1_idx1_Primary on t1 ( f1 ) HASH UNIQUE; +INSERT INTO t1 VALUES(1,1111); +INSERT INTO t1 VALUES(2,2222); diff --git a/test/cache/CacheTable/exp.test008.ksh b/test/cache/CacheTable/exp.test008.ksh new file mode 100644 index 00000000..4e7a42e6 --- /dev/null +++ b/test/cache/CacheTable/exp.test008.ksh @@ -0,0 +1,10 @@ +CREATE TABLE t1 (f1 SMALLINT NOT NULL , f2 INT ); +CREATE INDEX t1_PRIMARY on t1 ( f1 ) HASH UNIQUE SIZE 10007 ; +INSERT INTO t1 VALUES(1,1111); +INSERT INTO t1 VALUES(2,2222); +CREATE TABLE t1 (f1 SMALLINT NOT NULL , f2 INT ); +CREATE INDEX t1_PRIMARY on t1 ( f1 ) HASH UNIQUE SIZE 10007 ; +INSERT INTO t1 VALUES(1,1111); +INSERT INTO t1 VALUES(2,2222); +INSERT INTO t1 VALUES(5,5555); +INSERT INTO t1 VALUES(6,6666); diff --git a/test/cache/CacheTable/exp.test010.ksh b/test/cache/CacheTable/exp.test010.ksh new file mode 100644 index 00000000..e493853b --- /dev/null +++ b/test/cache/CacheTable/exp.test010.ksh @@ -0,0 +1,25 @@ +table t1 and t2 are created with records in target db +Recovering table t1 NULL NULL +Recovering table t2 t2f1<5 NULL +--------------------------------------------------------- + t1.t1f1 t1.t2f2 +--------------------------------------------------------- + 1 11 + 2 21 + 3 31 + 4 41 + 5 51 + 6 61 + 7 71 + 8 81 + 9 91 + 10 101 + +--------------------------------------------------------- + t2.t2f1 t2.t2f2 +--------------------------------------------------------- + 1 11 + 2 21 + 3 31 + 4 41 + diff --git a/test/cache/CacheTable/exp.test012.ksh b/test/cache/CacheTable/exp.test012.ksh new file mode 100644 index 00000000..d1d20124 --- /dev/null +++ b/test/cache/CacheTable/exp.test012.ksh @@ -0,0 +1,59 @@ +table t1 and t2 are created with records in target db +Recovering table t1 NULL NULL +Recovering table t2 t2f1>5 NULL +--------------------------------------------------------- + t1.t1f1 t1.t2f2 +--------------------------------------------------------- + 1 11 + 2 21 + 3 31 + 4 41 + 5 51 + 6 61 + 7 71 + 8 81 + 9 91 + 10 101 + +--------------------------------------------------------- + t2.t2f1 t2.t2f2 +--------------------------------------------------------- + 6 61 + 7 71 + 8 81 + 9 91 + 10 101 + +Statement Executed: Rows Affected = 5 ++---------------------------------------+ +| Connected! | +| | +| sql-statement | +| help [tablename] | +| quit | +| | ++---------------------------------------+ +[?1034hSQL> delete from t2 where t2f1 in (2,4,6,8,10); +SQLRowCount returns 5 +SQL> table t1 reloaded +table t2 reloaded +--------------------------------------------------------- + t1.t1f1 t1.t2f2 +--------------------------------------------------------- + 1 11 + 2 21 + 3 31 + 4 41 + 5 51 + 6 61 + 7 71 + 8 81 + 9 91 + 10 101 + +--------------------------------------------------------- + t2.t2f1 t2.t2f2 +--------------------------------------------------------- + 7 71 + 9 91 + diff --git a/test/cache/CacheTable/exp.test012.ksh.SunOS b/test/cache/CacheTable/exp.test012.ksh.SunOS new file mode 100644 index 00000000..b55fad74 --- /dev/null +++ b/test/cache/CacheTable/exp.test012.ksh.SunOS @@ -0,0 +1,61 @@ +table t1 and t2 are created with records in target db +Recovering table t1 NULL NULL +Recovering table t2 t2f1>5 NULL +--------------------------------------------------------- + t1.t1f1 t1.t2f2 +--------------------------------------------------------- + 1 11 + 2 21 + 3 31 + 4 41 + 5 51 + 6 61 + 7 71 + 8 81 + 9 91 + 10 101 + +--------------------------------------------------------- + t2.t2f1 t2.t2f2 +--------------------------------------------------------- + 6 61 + 7 71 + 8 81 + 9 91 + 10 101 + +Statement Executed: Rows Affected = 5 ++---------------------------------------+ +| Connected! | +| | +| sql-statement | +| help [tablename] | +| quit | +| | ++---------------------------------------+ +SQL> SQLRowCount returns 5 +SQL> table t1 reloaded +table t2 reloaded +--------------------------------------------------------- + t1.t1f1 t1.t2f2 +--------------------------------------------------------- + 1 11 + 2 21 + 3 31 + 4 41 + 5 51 + 6 61 + 7 71 + 8 81 + 9 91 + 10 101 + +--------------------------------------------------------- + t2.t2f1 t2.t2f2 +--------------------------------------------------------- + 1 11 + 3 31 + 5 51 + 7 71 + 9 91 + diff --git a/test/cache/CacheTable/exp.test012.ksh.x86_64 b/test/cache/CacheTable/exp.test012.ksh.x86_64 new file mode 100644 index 00000000..b8c22a96 --- /dev/null +++ b/test/cache/CacheTable/exp.test012.ksh.x86_64 @@ -0,0 +1,59 @@ +table t1 and t2 are created with records in target db +Recovering table t1 NULL NULL +Recovering table t2 t2f1>5 NULL +--------------------------------------------------------- + t1.t1f1 t1.t2f2 +--------------------------------------------------------- + 1 11 + 2 21 + 3 31 + 4 41 + 5 51 + 6 61 + 7 71 + 8 81 + 9 91 + 10 101 + +--------------------------------------------------------- + t2.t2f1 t2.t2f2 +--------------------------------------------------------- + 6 61 + 7 71 + 8 81 + 9 91 + 10 101 + +Statement Executed: Rows Affected = 5 ++---------------------------------------+ +| Connected! | +| | +| sql-statement | +| help [tablename] | +| quit | +| | ++---------------------------------------+ +SQL> delete from t2 where t2f1 in (2,4,6,8,10); +SQLRowCount returns 5 +SQL> table t1 reloaded +table t2 reloaded +--------------------------------------------------------- + t1.t1f1 t1.t2f2 +--------------------------------------------------------- + 1 11 + 2 21 + 3 31 + 4 41 + 5 51 + 6 61 + 7 71 + 8 81 + 9 91 + 10 101 + +--------------------------------------------------------- + t2.t2f1 t2.t2f2 +--------------------------------------------------------- + 7 71 + 9 91 + diff --git a/test/cache/CacheTable/exp.test014.ksh b/test/cache/CacheTable/exp.test014.ksh new file mode 100644 index 00000000..a5aaf3bb --- /dev/null +++ b/test/cache/CacheTable/exp.test014.ksh @@ -0,0 +1,8 @@ +Table t1 created with two records in target db. +cachetable -t t1 -c "f1=1" +select * from t1; +--------------------------------------------------------- + t1.f1 t1.f2 +--------------------------------------------------------- + 1 1111 + diff --git a/test/cache/CacheTable/exp.test015.ksh b/test/cache/CacheTable/exp.test015.ksh new file mode 100644 index 00000000..fcd7d4eb --- /dev/null +++ b/test/cache/CacheTable/exp.test015.ksh @@ -0,0 +1,26 @@ +Table t1 and t2 created in target DB. +cachetable -t t1 +cachetable -t t2 -c "t2f1<5" +select query on t1 and t2 table +--------------------------------------------------------- + t1.t1f1 t1.t2f2 +--------------------------------------------------------- + 1 11 + 2 21 + 3 31 + 4 41 + 5 51 + 6 61 + 7 71 + 8 81 + 9 91 + 10 101 + +--------------------------------------------------------- + t2.t2f1 t2.t2f2 +--------------------------------------------------------- + 1 11 + 2 21 + 3 31 + 4 41 + diff --git a/test/cache/CacheTable/exp.test016.ksh b/test/cache/CacheTable/exp.test016.ksh new file mode 100644 index 00000000..c3c400a9 --- /dev/null +++ b/test/cache/CacheTable/exp.test016.ksh @@ -0,0 +1,5 @@ +Table t1 and t2 created in target DB. +cachetable -t t1 +cachetable -t t2 -c "t2f1<5" +Table t1 unloaded from CSQL +Table t2 unloaded from CSQl diff --git a/test/cache/CacheTable/exp.test017.ksh b/test/cache/CacheTable/exp.test017.ksh new file mode 100644 index 00000000..c94434cd --- /dev/null +++ b/test/cache/CacheTable/exp.test017.ksh @@ -0,0 +1,25 @@ +Table t1 and t2 created in target DB. +Recovering table t1 NULL NULL +Recovering table t2 t2f1<5 NULL +--------------------------------------------------------- + t1.t1f1 t1.t2f2 +--------------------------------------------------------- + 1 11 + 2 21 + 3 31 + 4 41 + 5 51 + 6 61 + 7 71 + 8 81 + 9 91 + 10 101 + +--------------------------------------------------------- + t2.t2f1 t2.t2f2 +--------------------------------------------------------- + 1 11 + 2 21 + 3 31 + 4 41 + diff --git a/test/cache/CacheTable/exp.test018.ksh b/test/cache/CacheTable/exp.test018.ksh new file mode 100644 index 00000000..b965a614 --- /dev/null +++ b/test/cache/CacheTable/exp.test018.ksh @@ -0,0 +1,7 @@ +select * from t1; +--------------------------------------------------------- + t1.f1 t1.f2 +--------------------------------------------------------- + 1 1111 + 2 2222 + diff --git a/test/cache/CacheTable/exp.test019.ksh b/test/cache/CacheTable/exp.test019.ksh new file mode 100644 index 00000000..0664d7cf --- /dev/null +++ b/test/cache/CacheTable/exp.test019.ksh @@ -0,0 +1,13 @@ +after cahe with -c option +select * from t1 +--------------------------------------------------------- + t1.f1 t1.f2 +--------------------------------------------------------- + 1 1111 + +after reload , select * from t1; +--------------------------------------------------------- + t1.f1 t1.f2 +--------------------------------------------------------- + 1 1111 + diff --git a/test/cache/CacheTable/exp.test020.ksh b/test/cache/CacheTable/exp.test020.ksh new file mode 100644 index 00000000..0ae9f39e --- /dev/null +++ b/test/cache/CacheTable/exp.test020.ksh @@ -0,0 +1,8 @@ +cache table 't1' can't be dropped +--------------------------------------------------------- + t1.f1 t1.f2 +--------------------------------------------------------- + 1 1111 + 2 2222 + +cache table 't1' unloaded by -u option diff --git a/test/cache/CacheTable/exp.test021.ksh b/test/cache/CacheTable/exp.test021.ksh new file mode 100644 index 00000000..37f2f9b9 --- /dev/null +++ b/test/cache/CacheTable/exp.test021.ksh @@ -0,0 +1,36 @@ +table t4 is created with records in target db +Recovering table t4 NULL NULL + + + t4 + + f1 + 0 + 4 + 1 + 1 + 0 + + + + f2 + 30 + 12 + 1 + 1 + 0 + + + +
+ + t4_PRIMARY + Hash Index + t4
+ f1 + f2 +
+Statement Executed: Rows Affected = 1 +Statement Executed: Rows Affected = 1 +Statement Executed: Rows Affected = 1 +Statement Executed: Rows Affected = 1 diff --git a/test/cache/CacheTable/exp.test022.ksh b/test/cache/CacheTable/exp.test022.ksh new file mode 100644 index 00000000..b1a5d3fd --- /dev/null +++ b/test/cache/CacheTable/exp.test022.ksh @@ -0,0 +1,111 @@ +table t5 is created with records in target db +Recovering table t5 NULL NULL +Recovering table t6 NULL NULL + + + t5 + + f1 + 0 + 4 + 0 + 0 + 0 + + + + f2 + 0 + 4 + 1 + 1 + 0 + + + + + t6 + + f1 + 0 + 4 + 0 + 1 + 0 + + + + f2 + 0 + 4 + 0 + 1 + 0 + + + +
+ + t5_PRIMARY + Hash Index + t5
+ f2 + t5_f1 + Hash Index + t5
+ f1 +
+ + + t5 + + f1 + 0 + 4 + 0 + 0 + 0 + + + + f2 + 0 + 4 + 1 + 1 + 0 + + + + + t6 + + f1 + 0 + 4 + 0 + 1 + 0 + + + + f2 + 0 + 4 + 0 + 1 + 0 + + + +
+ + t5_PRIMARY + Hash Index + t5
+ f2 + t5_f1 + Hash Index + t5
+ f1 +
diff --git a/test/cache/CacheTable/exp.test022.ksh.psql b/test/cache/CacheTable/exp.test022.ksh.psql new file mode 100644 index 00000000..be9448c0 --- /dev/null +++ b/test/cache/CacheTable/exp.test022.ksh.psql @@ -0,0 +1,111 @@ +table t5 is created with records in target db +Recovering table t5 NULL NULL +Recovering table t6 NULL NULL + + + t5 + + f1 + 0 + 4 + 0 + 0 + 0 + + + + f2 + 0 + 4 + 1 + 1 + 0 + + + + + t6 + + f1 + 0 + 4 + 0 + 0 + 0 + + + + f2 + 0 + 4 + 0 + 0 + 0 + + + +
+ + t5_PRIMARY + Hash Index + t5
+ f2 + t5_t5_f1_key + Hash Index + t5
+ f1 +
+ + + t5 + + f1 + 0 + 4 + 0 + 0 + 0 + + + + f2 + 0 + 4 + 1 + 1 + 0 + + + + + t6 + + f1 + 0 + 4 + 0 + 0 + 0 + + + + f2 + 0 + 4 + 0 + 0 + 0 + + + +
+ + t5_PRIMARY + Hash Index + t5
+ f2 + t5_t5_f1_key + Hash Index + t5
+ f1 +
diff --git a/test/cache/CacheTable/exp.test023.ksh b/test/cache/CacheTable/exp.test023.ksh new file mode 100644 index 00000000..9da63622 --- /dev/null +++ b/test/cache/CacheTable/exp.test023.ksh @@ -0,0 +1,12 @@ +Table t1 created with 5 records in target DB. +cachetable -t t1 -f "f1,f2,f3" +select * from t1; +--------------------------------------------------------- + t1.f1 t1.f2 t1.f3 +--------------------------------------------------------- + 1 test 111 + 2 test 222 + 3 test 333 + 4 test 444 + 5 test 555 + diff --git a/test/cache/CacheTable/exp.test024.ksh b/test/cache/CacheTable/exp.test024.ksh new file mode 100644 index 00000000..6d35ed2a --- /dev/null +++ b/test/cache/CacheTable/exp.test024.ksh @@ -0,0 +1,21 @@ +Table t1 and t2 created in target DB. +cachetable -t t1 -c "t1f1<5" +cachetable -t t2 -c "t2f1>15" -f "t2f1,t2f3,t2f5" +select query on t1 and t2 table +--------------------------------------------------------- + t1.t1f1 t1.t1f2 t1.t1f3 t1.t1f4 t1.t1f5 +--------------------------------------------------------- + 1 fmode 11 test 111 + 2 fmode 22 test 222 + 3 fmode 33 test 333 + 4 fmode 44 test 444 + +--------------------------------------------------------- + t2.t2f1 t2.t2f3 t2.t2f5 +--------------------------------------------------------- + 16 116 1116 + 17 117 1117 + 18 118 1118 + 19 119 1119 + 20 220 1120 + diff --git a/test/cache/CacheTable/exp.test025.ksh b/test/cache/CacheTable/exp.test025.ksh new file mode 100644 index 00000000..806804be --- /dev/null +++ b/test/cache/CacheTable/exp.test025.ksh @@ -0,0 +1,10 @@ +Table t1 created in target DB. +cachetable -t t1 -c "f1<3" -f "f1,f3,f5" +select from t1 table +--------------------------------------------------------- + t1.f1 t1.f3 t1.f5 +--------------------------------------------------------- + 1 111 1111 + 2 222 2222 + +Table t1 unloaded from CSQL diff --git a/test/cache/CacheTable/exp.test026.ksh b/test/cache/CacheTable/exp.test026.ksh new file mode 100644 index 00000000..4bccde73 --- /dev/null +++ b/test/cache/CacheTable/exp.test026.ksh @@ -0,0 +1,25 @@ +Table t1 and t2 created in target DB. +Recovering table t1 NULL NULL +Recovering table t2 t2f1<15 t2f1,t2f3,t2f5 +--------------------------------------------------------- + t1.t1f1 t1.t1f2 t1.t1f3 t1.t1f4 t1.t1f5 +--------------------------------------------------------- + 1 fmode 11 test 111 + 2 fmode 22 test 222 + 3 fmode 33 test 333 + 4 fmode 44 test 444 + 5 fmode 55 test 555 + 6 fmode 66 test 666 + 7 fmode 77 test 777 + 8 fmode 88 test 888 + 9 fmode 99 test 999 + 10 fmode 100 test 1000 + +--------------------------------------------------------- + t2.t2f1 t2.t2f3 t2.t2f5 +--------------------------------------------------------- + 11 111 1111 + 12 112 1112 + 13 113 1113 + 14 114 1114 + diff --git a/test/cache/CacheTable/exp.test027.ksh b/test/cache/CacheTable/exp.test027.ksh new file mode 100644 index 00000000..96a74b4c --- /dev/null +++ b/test/cache/CacheTable/exp.test027.ksh @@ -0,0 +1,6 @@ +after reload , select * from t1; +--------------------------------------------------------- + t1.f1 t1.f3 t1.f5 +--------------------------------------------------------- + 1 111 1111 + diff --git a/test/cache/CacheTable/exp.test028.ksh b/test/cache/CacheTable/exp.test028.ksh new file mode 100644 index 00000000..9a6f06be --- /dev/null +++ b/test/cache/CacheTable/exp.test028.ksh @@ -0,0 +1,10 @@ +select * from t1; +--------------------------------------------------------- + t1.f1 t1.f2 t1.f3 t1.f4 t1.f5 +--------------------------------------------------------- + 1 test 111 mode 1111 + 2 test 222 mode 2222 + 3 test 333 mode 3333 + 4 test 444 mode 4444 + 5 test 555 mode 5555 + diff --git a/test/cache/CacheTable/exp.test029.ksh b/test/cache/CacheTable/exp.test029.ksh new file mode 100644 index 00000000..fd4b5d90 --- /dev/null +++ b/test/cache/CacheTable/exp.test029.ksh @@ -0,0 +1,43 @@ +Table t1 and t2 created in target DB. +cachetable -t t5 -D +cachetable -t t6 -D +select query on t1 and t2 table +Statement Executed: Rows Affected = 1 +Statement Executed: Rows Affected = 1 +Statement Executed: Rows Affected = 1 +Statement Executed: Rows Affected = 1 +--------------------------------------------------------- + t5.f1 t5.f2 +--------------------------------------------------------- + +--------------------------------------------------------- + t6.f1 t6.f2 +--------------------------------------------------------- + ++---------------------------------------+ +| Connected! | +| | +| sql-statement | +| help [tablename] | +| quit | +| | ++---------------------------------------+ +[?1034hSQL> select * from t5; ++-----------+-----------+ +| f1 | f2 | ++-----------+-----------+ +| 15 | 20 | +| 16 | 21 | ++-----------+-----------+ +SQLRowCount returns 2 +2 rows fetched +SQL> select * from t6; ++-----------+-----------+ +| f1 | f2 | ++-----------+-----------+ +| 15 | 20 | +| 16 | 21 | ++-----------+-----------+ +SQLRowCount returns 2 +2 rows fetched +SQL> \ No newline at end of file diff --git a/test/cache/CacheTable/exp.test029.ksh.SunOS b/test/cache/CacheTable/exp.test029.ksh.SunOS new file mode 100644 index 00000000..ceca431d --- /dev/null +++ b/test/cache/CacheTable/exp.test029.ksh.SunOS @@ -0,0 +1,41 @@ +Table t1 and t2 created in target DB. +cachetable -t t5 -D +cachetable -t t6 -D +select query on t1 and t2 table +Statement Executed: Rows Affected = 1 +Statement Executed: Rows Affected = 1 +Statement Executed: Rows Affected = 1 +Statement Executed: Rows Affected = 1 +--------------------------------------------------------- + t5.f1 t5.f2 +--------------------------------------------------------- + +--------------------------------------------------------- + t6.f1 t6.f2 +--------------------------------------------------------- + ++---------------------------------------+ +| Connected! | +| | +| sql-statement | +| help [tablename] | +| quit | +| | ++---------------------------------------+ +SQL> +-----------+-----------+ +| f1 | f2 | ++-----------+-----------+ +| 15 | 20 | +| 16 | 21 | ++-----------+-----------+ +SQLRowCount returns 2 +2 rows fetched +SQL> +-----------+-----------+ +| f1 | f2 | ++-----------+-----------+ +| 15 | 20 | +| 16 | 21 | ++-----------+-----------+ +SQLRowCount returns 2 +2 rows fetched +SQL> \ No newline at end of file diff --git a/test/cache/CacheTable/exp.test029.ksh.psql b/test/cache/CacheTable/exp.test029.ksh.psql new file mode 100644 index 00000000..b67537d4 --- /dev/null +++ b/test/cache/CacheTable/exp.test029.ksh.psql @@ -0,0 +1,43 @@ +Table t1 and t2 created in target DB. +cachetable -t t5 -D +cachetable -t t6 -D +select query on t1 and t2 table +Statement Executed: Rows Affected = 1 +Statement Executed: Rows Affected = 1 +Statement Executed: Rows Affected = 1 +Statement Executed: Rows Affected = 1 +--------------------------------------------------------- + t5.f1 t5.f2 +--------------------------------------------------------- + +--------------------------------------------------------- + t6.f1 t6.f2 +--------------------------------------------------------- + ++---------------------------------------+ +| Connected! | +| | +| sql-statement | +| help [tablename] | +| quit | +| | ++---------------------------------------+ +[?1034hSQL> select * from t5; ++------------+------------+ +| f1 | f2 | ++------------+------------+ +| 15 | 20 | +| 16 | 21 | ++------------+------------+ +SQLRowCount returns 2 +2 rows fetched +SQL> select * from t6; ++------------+------------+ +| f1 | f2 | ++------------+------------+ +| 15 | 20 | +| 16 | 21 | ++------------+------------+ +SQLRowCount returns 2 +2 rows fetched +SQL> \ No newline at end of file diff --git a/test/cache/CacheTable/exp.test030.ksh b/test/cache/CacheTable/exp.test030.ksh new file mode 100644 index 00000000..6b349b61 --- /dev/null +++ b/test/cache/CacheTable/exp.test030.ksh @@ -0,0 +1,76 @@ +Table t5 and t6 created in target DB. +cachetable -t t5 -D -c "f1>=10" +cachetable -t t6 -D -c "f1>=10" +select query on t1 and t2 table +Statement Executed: Rows Affected = 1 +Statement execute failed with error -14 +Statement Executed: Rows Affected = 1 +Statement Executed: Rows Affected = 1 +--------------------------------------------------------- + t5.f1 t5.f2 +--------------------------------------------------------- + 10 11 + 11 12 + 12 13 + 13 14 + 14 15 + 15 16 + +--------------------------------------------------------- + t6.f1 t6.f2 +--------------------------------------------------------- + 10 11 + 11 12 + 12 13 + 13 14 + 14 15 + 15 16 + ++---------------------------------------+ +| Connected! | +| | +| sql-statement | +| help [tablename] | +| quit | +| | ++---------------------------------------+ +[?1034hSQL> select * from t5; ++-----------+-----------+ +| f1 | f2 | ++-----------+-----------+ +| 5 | 6 | +| 6 | 7 | +| 7 | 8 | +| 8 | 9 | +| 9 | 10 | +| 10 | 11 | +| 11 | 12 | +| 12 | 13 | +| 13 | 14 | +| 14 | 15 | +| 15 | 16 | +| 16 | 20 | ++-----------+-----------+ +SQLRowCount returns 12 +12 rows fetched +SQL> select * from t6; ++-----------+-----------+ +| f1 | f2 | ++-----------+-----------+ +| 5 | 6 | +| 6 | 7 | +| 7 | 8 | +| 8 | 9 | +| 9 | 10 | +| 10 | 11 | +| 11 | 12 | +| 12 | 13 | +| 13 | 14 | +| 14 | 15 | +| 15 | 16 | +| 16 | 20 | +| 15 | 21 | ++-----------+-----------+ +SQLRowCount returns 13 +13 rows fetched +SQL> \ No newline at end of file diff --git a/test/cache/CacheTable/exp.test030.ksh.SunOS b/test/cache/CacheTable/exp.test030.ksh.SunOS new file mode 100644 index 00000000..db61f50b --- /dev/null +++ b/test/cache/CacheTable/exp.test030.ksh.SunOS @@ -0,0 +1,71 @@ +Table t5 and t6 created in target DB. +cachetable -t t5 -D -c "f1>=10" +cachetable -t t6 -D -c "f1>=10" +select query on t1 and t2 table +Statement prepare failed with error -31 +Statement prepare failed with error -31 +Statement prepare failed with error -31 +Statement prepare failed with error -31 +--------------------------------------------------------- + t5.f1 t5.f2 +--------------------------------------------------------- + 10 11 + 11 12 + 12 13 + 13 14 + 14 15 + 15 16 + +--------------------------------------------------------- + t6.f1 t6.f2 +--------------------------------------------------------- + 10 11 + 11 12 + 12 13 + 13 14 + 14 15 + 15 16 + ++---------------------------------------+ +| Connected! | +| | +| sql-statement | +| help [tablename] | +| quit | +| | ++---------------------------------------+ +SQL> +-----------+-----------+ +| f1 | f2 | ++-----------+-----------+ +| 5 | 6 | +| 6 | 7 | +| 7 | 8 | +| 8 | 9 | +| 9 | 10 | +| 10 | 11 | +| 11 | 12 | +| 12 | 13 | +| 13 | 14 | +| 14 | 15 | +| 15 | 16 | ++-----------+-----------+ +SQLRowCount returns 11 +11 rows fetched +SQL> +-----------+-----------+ +| f1 | f2 | ++-----------+-----------+ +| 5 | 6 | +| 6 | 7 | +| 7 | 8 | +| 8 | 9 | +| 9 | 10 | +| 10 | 11 | +| 11 | 12 | +| 12 | 13 | +| 13 | 14 | +| 14 | 15 | +| 15 | 16 | ++-----------+-----------+ +SQLRowCount returns 11 +11 rows fetched +SQL> \ No newline at end of file diff --git a/test/cache/CacheTable/exp.test030.ksh.psql b/test/cache/CacheTable/exp.test030.ksh.psql new file mode 100644 index 00000000..c1705201 --- /dev/null +++ b/test/cache/CacheTable/exp.test030.ksh.psql @@ -0,0 +1,76 @@ +Table t5 and t6 created in target DB. +cachetable -t t5 -D -c "f1>=10" +cachetable -t t6 -D -c "f1>=10" +select query on t1 and t2 table +Statement Executed: Rows Affected = 1 +Statement execute failed with error -14 +Statement Executed: Rows Affected = 1 +Statement Executed: Rows Affected = 1 +--------------------------------------------------------- + t5.f1 t5.f2 +--------------------------------------------------------- + 10 11 + 11 12 + 12 13 + 13 14 + 14 15 + 15 16 + +--------------------------------------------------------- + t6.f1 t6.f2 +--------------------------------------------------------- + 10 11 + 11 12 + 12 13 + 13 14 + 14 15 + 15 16 + ++---------------------------------------+ +| Connected! | +| | +| sql-statement | +| help [tablename] | +| quit | +| | ++---------------------------------------+ +[?1034hSQL> select * from t5; ++------------+------------+ +| f1 | f2 | ++------------+------------+ +| 5 | 6 | +| 6 | 7 | +| 7 | 8 | +| 8 | 9 | +| 9 | 10 | +| 10 | 11 | +| 11 | 12 | +| 12 | 13 | +| 13 | 14 | +| 14 | 15 | +| 15 | 16 | +| 16 | 20 | ++------------+------------+ +SQLRowCount returns 12 +12 rows fetched +SQL> select * from t6; ++------------+------------+ +| f1 | f2 | ++------------+------------+ +| 5 | 6 | +| 6 | 7 | +| 7 | 8 | +| 8 | 9 | +| 9 | 10 | +| 10 | 11 | +| 11 | 12 | +| 12 | 13 | +| 13 | 14 | +| 14 | 15 | +| 15 | 16 | +| 16 | 20 | +| 15 | 21 | ++------------+------------+ +SQLRowCount returns 13 +13 rows fetched +SQL> \ No newline at end of file diff --git a/test/cache/CacheTable/exp.test032.ksh b/test/cache/CacheTable/exp.test032.ksh new file mode 100644 index 00000000..c4d0ff1c --- /dev/null +++ b/test/cache/CacheTable/exp.test032.ksh @@ -0,0 +1,48 @@ +t1create.sql file created +select file created +Select * from t1 in CSQL +--------------------------------------------------------- + t1.f1 t1.f2 +--------------------------------------------------------- + 1 INDIA1 + 11 NULL + 2 INDIA2 + 12 NULL + 3 INDIA3 + 13 NULL + 4 INDIA4 + 14 NULL + 5 INDIA5 + 15 NULL + +Checking for table created or not + + + t1 + + f1 + 0 + 4 + 1 + 1 + 0 + + + + f2 + 30 + 12 + 0 + 0 + 0 + + + +
+ + t1_PRIMARY + Hash Index + t1
+ f1 +
+cache table 't1' unloaded by -u option diff --git a/test/cache/CacheTable/exp.test043.ksh b/test/cache/CacheTable/exp.test043.ksh new file mode 100644 index 00000000..edabef57 --- /dev/null +++ b/test/cache/CacheTable/exp.test043.ksh @@ -0,0 +1,32 @@ + +(1). cachetable -S + +================================================================================================================= +|Mode| Table Name | Primary Key | Condition | Field List | DSN | +================================================================================================================= +| 1 | t1 | NULL | NULL | NULL | myodbc3 | +----------------------------------------------------------------------------------------------------------------- +| 2 | t2 | NULL | t2f1=11 | NULL | myodbc3 | +----------------------------------------------------------------------------------------------------------------- +| 4 | t3 | NULL | NULL | t3f1 | myodbc3 | +----------------------------------------------------------------------------------------------------------------- +| 8 | t4 | NULL | NULL | NULL | myodbc3 | +----------------------------------------------------------------------------------------------------------------- +|14 | t5 | NULL | t5f1=11 | t5f2 | myodbc3 | +----------------------------------------------------------------------------------------------------------------- + +(2). cachetable -t t5 -S + +================================================================================================================= +|Mode| Table Name | Primary Key | Condition | Field List | DSN | +================================================================================================================= +|14 | t5 | NULL | t5f1=11 | t5f2 | myodbc3 | +----------------------------------------------------------------------------------------------------------------- + +(3). cachetable -S (Cross Verification) + +================================================================================================================= +|Mode| Table Name | Primary Key | Condition | Field List | DSN | +================================================================================================================= +| Cached table does not exist. | +================================================================================================================= diff --git a/test/cache/CacheTable/exp.test043.ksh.psql b/test/cache/CacheTable/exp.test043.ksh.psql new file mode 100644 index 00000000..6b3d4e41 --- /dev/null +++ b/test/cache/CacheTable/exp.test043.ksh.psql @@ -0,0 +1,32 @@ + +(1). cachetable -S + +================================================================================================================= +|Mode| Table Name | Primary Key | Condition | Field List | DSN | +================================================================================================================= +| 1 | t1 | NULL | NULL | NULL | psql | +----------------------------------------------------------------------------------------------------------------- +| 2 | t2 | NULL | t2f1=11 | NULL | psql | +----------------------------------------------------------------------------------------------------------------- +| 4 | t3 | NULL | NULL | t3f1 | psql | +----------------------------------------------------------------------------------------------------------------- +| 8 | t4 | NULL | NULL | NULL | psql | +----------------------------------------------------------------------------------------------------------------- +|14 | t5 | NULL | t5f1=11 | t5f2 | psql | +----------------------------------------------------------------------------------------------------------------- + +(2). cachetable -t t5 -S + +================================================================================================================= +|Mode| Table Name | Primary Key | Condition | Field List | DSN | +================================================================================================================= +|14 | t5 | NULL | t5f1=11 | t5f2 | psql | +----------------------------------------------------------------------------------------------------------------- + +(3). cachetable -S (Cross Verification) + +================================================================================================================= +|Mode| Table Name | Primary Key | Condition | Field List | DSN | +================================================================================================================= +| Cached table does not exist. | +================================================================================================================= diff --git a/test/cache/CacheTable/exp.test044.ksh b/test/cache/CacheTable/exp.test044.ksh new file mode 100644 index 00000000..7c478f8c --- /dev/null +++ b/test/cache/CacheTable/exp.test044.ksh @@ -0,0 +1,9 @@ +server started +=========================== cachetable -t t1 -c "f1>12" -f "f1,f2" -p f1 ======================================= + +================================================================================================================= +|Mode| Table Name | Primary Key | Condition | Field List | DSN | +================================================================================================================= +| 6 | t1 | f1 | f1>12 | f1,f2 | myodbc3 | +----------------------------------------------------------------------------------------------------------------- + diff --git a/test/cache/CacheTable/exp.test044.ksh.psql b/test/cache/CacheTable/exp.test044.ksh.psql new file mode 100644 index 00000000..4c82c1d7 --- /dev/null +++ b/test/cache/CacheTable/exp.test044.ksh.psql @@ -0,0 +1,9 @@ +server started +=========================== cachetable -t t1 -c "f1>12" -f "f1,f2" -p f1 ======================================= + +================================================================================================================= +|Mode| Table Name | Primary Key | Condition | Field List | DSN | +================================================================================================================= +| 6 | t1 | f1 | f1>12 | f1,f2 | psql | +----------------------------------------------------------------------------------------------------------------- + diff --git a/test/cache/CacheTable/exp.test045.ksh b/test/cache/CacheTable/exp.test045.ksh new file mode 100644 index 00000000..57cefd7b --- /dev/null +++ b/test/cache/CacheTable/exp.test045.ksh @@ -0,0 +1,67 @@ +CREATING TABLE t1 and INSERTING 1 RECORDS IN TARGET DB ++---------------------------------------+ +| Connected! | +| | +| sql-statement | +| help [tablename] | +| quit | +| | ++---------------------------------------+ +[?1034hSQL> echo create table t1(f1 int); +SQL> create table t1(f1 int); +SQLRowCount returns 0 +SQL> echo insert into t1 values(1); +SQL> insert into t1 values(1); +SQLRowCount returns 1 +SQL> echo select * from t1; +SQL> select * from t1; ++-----------+ +| f1 | ++-----------+ +| 1 | ++-----------+ +SQLRowCount returns 1 +1 rows fetched +SQL> CREATING TABLE t1 and INSERTING 1 RECORDS AT CSQL +echo create table t1(f1 int); +Statement Executed +echo insert into t1 values(2); +Statement Executed: Rows Affected = 1 +echo select * from t1; +--------------------------------------------------------- + t1.f1 +--------------------------------------------------------- + 2 + +AFTER INSERT AT CSQL DATA IN TDB ++---------------------------------------+ +| Connected! | +| | +| sql-statement | +| help [tablename] | +| quit | +| | ++---------------------------------------+ +[?1034hSQL> echo select * from t1; +SQL> select * from t1; ++-----------+ +| f1 | ++-----------+ +| 1 | ++-----------+ +SQLRowCount returns 1 +1 rows fetched +SQL> echo drop table t1; +Statement Executed ++---------------------------------------+ +| Connected! | +| | +| sql-statement | +| help [tablename] | +| quit | +| | ++---------------------------------------+ +[?1034hSQL> echo drop table t1; +SQL> drop table t1; +SQLRowCount returns 0 +SQL> \ No newline at end of file diff --git a/test/cache/CacheTable/exp.test045.ksh.SunOS b/test/cache/CacheTable/exp.test045.ksh.SunOS new file mode 100644 index 00000000..73382fd6 --- /dev/null +++ b/test/cache/CacheTable/exp.test045.ksh.SunOS @@ -0,0 +1,57 @@ +CREATING TABLE t1 and INSERTING 1 RECORDS IN TARGET DB ++---------------------------------------+ +| Connected! | +| | +| sql-statement | +| help [tablename] | +| quit | +| | ++---------------------------------------+ +SQL> SQL> SQLRowCount returns 0 +SQL> SQL> SQLRowCount returns 1 +SQL> SQL> +-----------+ +| f1 | ++-----------+ +| 1 | ++-----------+ +SQLRowCount returns 1 +1 rows fetched +SQL> CREATING TABLE t1 and INSERTING 1 RECORDS AT CSQL +echo create table t1(f1 int); +Statement Executed +echo insert into t1 values(2); +Statement Executed: Rows Affected = 1 +echo select * from t1; +--------------------------------------------------------- + t1.f1 +--------------------------------------------------------- + 2 + +AFTER INSERT AT CSQL DATA IN TDB ++---------------------------------------+ +| Connected! | +| | +| sql-statement | +| help [tablename] | +| quit | +| | ++---------------------------------------+ +SQL> SQL> +-----------+ +| f1 | ++-----------+ +| 1 | ++-----------+ +SQLRowCount returns 1 +1 rows fetched +SQL> echo drop table t1; +Statement Executed ++---------------------------------------+ +| Connected! | +| | +| sql-statement | +| help [tablename] | +| quit | +| | ++---------------------------------------+ +SQL> SQL> SQLRowCount returns 0 +SQL> \ No newline at end of file diff --git a/test/cache/CacheTable/exp.test045.ksh.psql b/test/cache/CacheTable/exp.test045.ksh.psql new file mode 100644 index 00000000..6c1a8cf4 --- /dev/null +++ b/test/cache/CacheTable/exp.test045.ksh.psql @@ -0,0 +1,67 @@ +CREATING TABLE t1 and INSERTING 1 RECORDS IN TARGET DB ++---------------------------------------+ +| Connected! | +| | +| sql-statement | +| help [tablename] | +| quit | +| | ++---------------------------------------+ +[?1034hSQL> echo create table t1(f1 int); +SQL> create table t1(f1 int); +SQLRowCount returns 0 +SQL> echo insert into t1 values(1); +SQL> insert into t1 values(1); +SQLRowCount returns 1 +SQL> echo select * from t1; +SQL> select * from t1; ++------------+ +| f1 | ++------------+ +| 1 | ++------------+ +SQLRowCount returns 1 +1 rows fetched +SQL> CREATING TABLE t1 and INSERTING 1 RECORDS AT CSQL +echo create table t1(f1 int); +Statement Executed +echo insert into t1 values(2); +Statement Executed: Rows Affected = 1 +echo select * from t1; +--------------------------------------------------------- + t1.f1 +--------------------------------------------------------- + 2 + +AFTER INSERT AT CSQL DATA IN TDB ++---------------------------------------+ +| Connected! | +| | +| sql-statement | +| help [tablename] | +| quit | +| | ++---------------------------------------+ +[?1034hSQL> echo select * from t1; +SQL> select * from t1; ++------------+ +| f1 | ++------------+ +| 1 | ++------------+ +SQLRowCount returns 1 +1 rows fetched +SQL> echo drop table t1; +Statement Executed ++---------------------------------------+ +| Connected! | +| | +| sql-statement | +| help [tablename] | +| quit | +| | ++---------------------------------------+ +[?1034hSQL> echo drop table t1; +SQL> drop table t1; +SQLRowCount returns 0 +SQL> \ No newline at end of file diff --git a/test/cache/CacheTable/exp.test045.ksh.x86_64 b/test/cache/CacheTable/exp.test045.ksh.x86_64 new file mode 100644 index 00000000..1ded8120 --- /dev/null +++ b/test/cache/CacheTable/exp.test045.ksh.x86_64 @@ -0,0 +1,67 @@ +CREATING TABLE t1 and INSERTING 1 RECORDS IN TARGET DB ++---------------------------------------+ +| Connected! | +| | +| sql-statement | +| help [tablename] | +| quit | +| | ++---------------------------------------+ +SQL> echo create table t1(f1 int); +SQL> create table t1(f1 int); +SQLRowCount returns 0 +SQL> echo insert into t1 values(1); +SQL> insert into t1 values(1); +SQLRowCount returns 1 +SQL> echo select * from t1; +SQL> select * from t1; ++-----------+ +| f1 | ++-----------+ +| 1 | ++-----------+ +SQLRowCount returns 1 +1 rows fetched +SQL> CREATING TABLE t1 and INSERTING 1 RECORDS AT CSQL +echo create table t1(f1 int); +Statement Executed +echo insert into t1 values(2); +Statement Executed: Rows Affected = 1 +echo select * from t1; +--------------------------------------------------------- + t1.f1 +--------------------------------------------------------- + 2 + +AFTER INSERT AT CSQL DATA IN TDB ++---------------------------------------+ +| Connected! | +| | +| sql-statement | +| help [tablename] | +| quit | +| | ++---------------------------------------+ +SQL> echo select * from t1; +SQL> select * from t1; ++-----------+ +| f1 | ++-----------+ +| 1 | ++-----------+ +SQLRowCount returns 1 +1 rows fetched +SQL> echo drop table t1; +Statement Executed ++---------------------------------------+ +| Connected! | +| | +| sql-statement | +| help [tablename] | +| quit | +| | ++---------------------------------------+ +SQL> echo drop table t1; +SQL> drop table t1; +SQLRowCount returns 0 +SQL> \ No newline at end of file diff --git a/test/cache/CacheTable/fcsqlinput.sql b/test/cache/CacheTable/fcsqlinput.sql new file mode 100644 index 00000000..3b1e0afb --- /dev/null +++ b/test/cache/CacheTable/fcsqlinput.sql @@ -0,0 +1,2 @@ +CREATE TABLE t1(f1 INT,f2 CHAR(10),f3 INT,f4 CHAR(10),f5 INT,primary key(f1) ); + diff --git a/test/cache/CacheTable/fcsqlinputoracle.sql b/test/cache/CacheTable/fcsqlinputoracle.sql new file mode 100644 index 00000000..63a3f425 --- /dev/null +++ b/test/cache/CacheTable/fcsqlinputoracle.sql @@ -0,0 +1,2 @@ +CREATE TABLE t1(f1 BIGINT,f2 CHAR(10),f3 BIGINT,f4 CHAR(10),f5 BIGINT,primary key(f1)); + diff --git a/test/cache/CacheTable/fmodecreate.sql b/test/cache/CacheTable/fmodecreate.sql new file mode 100644 index 00000000..5da00481 --- /dev/null +++ b/test/cache/CacheTable/fmodecreate.sql @@ -0,0 +1,22 @@ +CREATE TABLE t1(t1f1 INT NOT NULL,t1f2 CHAR(10),t1f3 INT,t1f4 CHAR(10),t1f5 INT,primary key(t1f1)); +INSERT INTO t1 VALUES(1,'fmode',11,'test',111); +INSERT INTO t1 VALUES(2,'fmode',22,'test',222); +INSERT INTO t1 VALUES(3,'fmode',33,'test',333); +INSERT INTO t1 VALUES(4,'fmode',44,'test',444); +INSERT INTO t1 VALUES(5,'fmode',55,'test',555); +INSERT INTO t1 VALUES(6,'fmode',66,'test',666); +INSERT INTO t1 VALUES(7,'fmode',77,'test',777); +INSERT INTO t1 VALUES(8,'fmode',88,'test',888); +INSERT INTO t1 VALUES(9,'fmode',99,'test',999); +INSERT INTO t1 VALUES(10,'fmode',100,'test',1000); +CREATE TABLE t2(t2f1 INT NOT NULL,t2f2 CHAR(10),t2f3 INT,t2f4 CHAR(10),t2f5 INT,primary key(t2f1)); +INSERT INTO t2 VALUES(11,'fmode',111,'test',1111); +INSERT INTO t2 VALUES(12,'fmode',112,'test',1112); +INSERT INTO t2 VALUES(13,'fmode',113,'test',1113); +INSERT INTO t2 VALUES(14,'fmode',114,'test',1114); +INSERT INTO t2 VALUES(15,'fmode',115,'test',1115); +INSERT INTO t2 VALUES(16,'fmode',116,'test',1116); +INSERT INTO t2 VALUES(17,'fmode',117,'test',1117); +INSERT INTO t2 VALUES(18,'fmode',118,'test',1118); +INSERT INTO t2 VALUES(19,'fmode',119,'test',1119); +INSERT INTO t2 VALUES(20,'fmode',220,'test',1120); diff --git a/test/cache/CacheTable/fmodeinsert.sql b/test/cache/CacheTable/fmodeinsert.sql new file mode 100644 index 00000000..ff1828e2 --- /dev/null +++ b/test/cache/CacheTable/fmodeinsert.sql @@ -0,0 +1,6 @@ +CREATE TABLE t1(f1 INT NOT NULL,f2 CHAR(10),f3 INT,f4 CHAR(10),f5 INT,primary key(f1)); +INSERT INTO t1 VALUES(1,'test',111,'mode',1111); +INSERT INTO t1 VALUES(2,'test',222,'mode',2222); +INSERT INTO t1 VALUES(3,'test',333,'mode',3333); +INSERT INTO t1 VALUES(4,'test',444,'mode',4444); +INSERT INTO t1 VALUES(5,'test',555,'mode',5555); diff --git a/test/cache/CacheTable/frecords.sql b/test/cache/CacheTable/frecords.sql new file mode 100644 index 00000000..6dbb9f9b --- /dev/null +++ b/test/cache/CacheTable/frecords.sql @@ -0,0 +1,3 @@ +INSERT INTO t1 VALUES(6,'test',666,'mode',6666); +INSERT INTO t1 VALUES(7,'test',777,'mode',7777); +INSERT INTO t1 VALUES(8,'test',888,'mode',8888); diff --git a/test/cache/CacheTable/inputtest4.sql b/test/cache/CacheTable/inputtest4.sql new file mode 100644 index 00000000..a11b3e58 --- /dev/null +++ b/test/cache/CacheTable/inputtest4.sql @@ -0,0 +1,4 @@ +drop table t1; +CREATE TABLE t1 (f1 SMALLINT NOT NULL, f2 INT, primary key (f1)); +INSERT INTO t1 VALUES(1, 1111); +INSERT INTO t1 VALUES(2, 2222); diff --git a/test/cache/CacheTable/insert.sql b/test/cache/CacheTable/insert.sql new file mode 100644 index 00000000..bb6532da --- /dev/null +++ b/test/cache/CacheTable/insert.sql @@ -0,0 +1,2 @@ +insert into t1 values(5, 5555); +insert into t1 values(6, 6666); diff --git a/test/cache/CacheTable/insert1.sql b/test/cache/CacheTable/insert1.sql new file mode 100644 index 00000000..05caeef6 --- /dev/null +++ b/test/cache/CacheTable/insert1.sql @@ -0,0 +1,5 @@ +insert into t4 values(12,'jitu'); +insert into t4 values(12,'pupu'); +insert into t4 values(13,'jitu'); +insert into t4 values(13,'papu'); +commit; diff --git a/test/cache/CacheTable/select_t1.sql b/test/cache/CacheTable/select_t1.sql new file mode 100644 index 00000000..634e60a2 --- /dev/null +++ b/test/cache/CacheTable/select_t1.sql @@ -0,0 +1,2 @@ +echo select * from t1; +select * from t1; diff --git a/test/cache/CacheTable/selectstar.sql b/test/cache/CacheTable/selectstar.sql new file mode 100644 index 00000000..d72677dc --- /dev/null +++ b/test/cache/CacheTable/selectstar.sql @@ -0,0 +1,2 @@ +select * from t1; +select * from t2; diff --git a/test/cache/CacheTable/selectt1.sql b/test/cache/CacheTable/selectt1.sql new file mode 100644 index 00000000..f0d520a9 --- /dev/null +++ b/test/cache/CacheTable/selectt1.sql @@ -0,0 +1 @@ +select * from t1; diff --git a/test/cache/CacheTable/selectt2.sql b/test/cache/CacheTable/selectt2.sql new file mode 100644 index 00000000..68a32ae8 --- /dev/null +++ b/test/cache/CacheTable/selectt2.sql @@ -0,0 +1 @@ +select * from t2; diff --git a/test/cache/CacheTable/t1create_compo.sql b/test/cache/CacheTable/t1create_compo.sql new file mode 100644 index 00000000..8602b682 --- /dev/null +++ b/test/cache/CacheTable/t1create_compo.sql @@ -0,0 +1,2 @@ +CREATE TABLE t1(f1 int, f2 smallint, f3 int); +CREATE INDEX idx1 on t1(f1,f3) diff --git a/test/cache/CacheTable/test001.ksh b/test/cache/CacheTable/test001.ksh new file mode 100755 index 00000000..0aefaeb2 --- /dev/null +++ b/test/cache/CacheTable/test001.ksh @@ -0,0 +1,22 @@ +#!/bin/ksh +# Test Case +# 1. Check for help message: $ cachetable -? +echo CACHE_TABLE=true >>$CSQL_CONFIG_FILE +echo DSN=$DSN >>$CSQL_CONFIG_FILE +DS="$DSN $DBUSER $PASSWORD" +rm -f /tmp/csql/csqlds.conf +touch /tmp/csql/csqlds.conf +$CSQL_INSTALL_ROOT/bin/csqlds -U $DBUSER -P $PASSWORD -D $DSN -N $TDB -a +if [ $? -ne 0 ] +then + exit 1; +fi + +$CSQL_INSTALL_ROOT/bin/cachetable ? +if [ $? -ne 0 ] +then + exit 2; +fi +rm -f /tmp/csql/csqlds.conf +touch /tmp/csql/csqlds.conf +exit 0; diff --git a/test/cache/CacheTable/test002.ksh b/test/cache/CacheTable/test002.ksh new file mode 100755 index 00000000..bae72007 --- /dev/null +++ b/test/cache/CacheTable/test002.ksh @@ -0,0 +1,86 @@ +#!/bin/ksh +# Test Case +# 2. Create table t1 with primary key in mysql. Cache the table in csql. +# Check for user authentication: +# $ cachetable [-U username] [-P password] -t t1 +# by entering +# a. correct username correct password - should pass +# b. correct username wrong password - should return error +# c. wrong username correct password - should return error +# d. wrong username wrong password - should return error + +#Run this test only under csql/test or on this directory. +#Otherwise, it may fail + +input=${PWD}/cache/CacheTable/inputtest4.sql +REL_PATH=. +if [ -s "$input" ] +then + REL_PATH=${PWD}/cache/CacheTable +fi +cp $CSQL_CONFIG_FILE /tmp/csql.conf +echo CACHE_TABLE=true >>$CSQL_CONFIG_FILE +echo DSN=$DSN >>$CSQL_CONFIG_FILE +DS="$DSN $DBUSER $PASSWORD" +rm -f /tmp/csql/csqlds.conf +touch /tmp/csql/csqlds.conf +$CSQL_INSTALL_ROOT/bin/csqlds -U $DBUSER -P $PASSWORD -D $DSN -N $TDB -a +if [ $? -ne 0 ] +then + cp /tmp/csql.conf $CSQL_CONFIG_FILE + exit 1; +fi +echo $DS +isql $DS < ${REL_PATH}/inputtest4.sql >/dev/null 2>&1 +if [ $? -ne 0 ] +then + cp /tmp/csql.conf $CSQL_CONFIG_FILE + exit 1; +fi + +rm -f /tmp/csql/csqltable.conf +touch /tmp/csql/csqltable.conf + +# check with correct username and correct password +$CSQL_INSTALL_ROOT/bin/cachetable -U root -P manager -t t1 +if [ $? -ne 0 ] +then + cp /tmp/csql.conf $CSQL_CONFIG_FILE + exit 2; +fi + +# correct username and wrong password +$CSQL_INSTALL_ROOT/bin/cachetable -U root -P MANAGER -t t1 > /dev/null 2>&1 +if [ $? -eq 0 ] +then + cp /tmp/csql.conf $CSQL_CONFIG_FILE + exit 3; +fi + +# wrong username and correct password +$CSQL_INSTALL_ROOT/bin/cachetable -U ROOT -P manager -t t1 > /dev/null 2>&1 +if [ $? -eq 0 ] +then + cp /tmp/csql.conf $CSQL_CONFIG_FILE + exit 4; +fi + +#wrong username and wrong password +$CSQL_INSTALL_ROOT/bin/cachetable -U ROOT -P MANAGER -t t1 > /dev/null 2>&1 +if [ $? -eq 0 ] +then + cp /tmp/csql.conf $CSQL_CONFIG_FILE + exit 5; +fi + +rm -f /tmp/csql/csqltable.conf +touch /tmp/csql/csqltable.conf + +$CSQL_INSTALL_ROOT/bin/csql -s ${REL_PATH}/drop.sql > /dev/null 2>&1 +isql $DS < ${REL_PATH}/drop.sql >/dev/null 2>&1 +#rm -f /tmp/csql/csqltable.conf +#touch /tmp/csql/csqltable.conf + +cp /tmp/csql.conf $CSQL_CONFIG_FILE +exit 0; + diff --git a/test/cache/CacheTable/test003.ksh b/test/cache/CacheTable/test003.ksh new file mode 100755 index 00000000..7637b884 --- /dev/null +++ b/test/cache/CacheTable/test003.ksh @@ -0,0 +1,69 @@ +#!/bin/ksh +# Test Case + +# 3.create table, load with no definition option. should succeed and csqldump should display the records. + +#Run this test only under csql/test or on this directory. +#Otherwise, it may fail + +input=${PWD}/cache/CacheTable/inputtest4.sql +REL_PATH=. +if [ -s "$input" ] +then + REL_PATH=${PWD}/cache/CacheTable +fi + +cp $CSQL_CONFIG_FILE /tmp/csql.conf + +echo DSN=$DSN >>$CSQL_CONFIG_FILE +DS="$DSN $DBUSER $PASSWORD" +rm -f /tmp/csql/csqlds.conf +touch /tmp/csql/csqlds.conf +$CSQL_INSTALL_ROOT/bin/csqlds -U $DBUSER -P $PASSWORD -D $DSN -N $TDB -a +if [ $? -ne 0 ] +then + cp /tmp/csql.conf $CSQL_CONFIG_FILE + exit 1; +fi +echo CACHE_TABLE=true >>$CSQL_CONFIG_FILE +$CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/dropt1t2.sql > /dev/null 2>&1 + +isql $DS < ${REL_PATH}/inputtest4.sql >/dev/null 2>&1 +if [ "$DSN" = "oracle" ] +then + $CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/csqlinputoracle.sql > /dev/null 2>&1 +else + $CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/csqlinput.sql > /dev/null 2>&1 +fi +if [ $? -ne 0 ] +then + cp /tmp/csql.conf $CSQL_CONFIG_FILE + exit 1; +fi + +rm -f /tmp/csql/csqltable.conf +touch /tmp/csql/csqltable.conf + +$CSQL_INSTALL_ROOT/bin/cachetable -t t1 -s > /dev/null 2>&1 +if [ $? -ne 0 ] +then + cp /tmp/csql.conf $CSQL_CONFIG_FILE + exit 2; +fi + +rm -f /tmp/csql/csqltable.conf +touch /tmp/csql/csqltable.conf + +$CSQL_INSTALL_ROOT/bin/csqldump +if [ $? -ne 0 ] +then + cp /tmp/csql.conf $CSQL_CONFIG_FILE + exit 3; +fi +$CSQL_INSTALL_ROOT/bin/csql -s ${REL_PATH}/drop.sql > /dev/null 2>&1 +isql $DS < ${REL_PATH}/drop.sql >/dev/null 2>&1 +rm -f /tmp/csql/csqltable.conf +touch /tmp/csql/csqltable.conf +cp /tmp/csql.conf $CSQL_CONFIG_FILE +exit 0; + diff --git a/test/cache/CacheTable/test004.ksh b/test/cache/CacheTable/test004.ksh new file mode 100755 index 00000000..09e54246 --- /dev/null +++ b/test/cache/CacheTable/test004.ksh @@ -0,0 +1,58 @@ +#!/bin/ksh +# Test Case + +# 4.create table, insert some records into the table and then load with no definition option. should fail. + +#Run this test only under csql/test or on this directory. +#Otherwise, it may fail + +input=${PWD}/cache/CacheTable/inputtest4.sql +REL_PATH=. +if [ -s "$input" ] +then + REL_PATH=${PWD}/cache/CacheTable +fi + +cp $CSQL_CONFIG_FILE /tmp/csql.conf +echo CACHE_TABLE=true >>$CSQL_CONFIG_FILE +echo DSN=$DSN >>$CSQL_CONFIG_FILE +DS="$DSN $DBUSER $PASSWORD" +rm -f /tmp/csql/csqlds.conf +touch /tmp/csql/csqlds.conf +$CSQL_INSTALL_ROOT/bin/csqlds -U $DBUSER -P $PASSWORD -D $DSN -N $TDB -a +if [ $? -ne 0 ] +then + cp /tmp/csql.conf $CSQL_CONFIG_FILE + exit 1; +fi + +isql $DS < ${REL_PATH}/inputtest4.sql >/dev/null 2>&1 +$CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/csqlinputwithrec.sql > /dev/null 2>&1 +if [ $? -ne 0 ] +then + cp /tmp/csql.conf $CSQL_CONFIG_FILE + exit 1; +fi + +rm -f /tmp/csql/csqltable.conf +touch /tmp/csql/csqltable.conf + +$CSQL_INSTALL_ROOT/bin/cachetable -t t1 -s >/dev/null 2>&1 +if [ $? -eq 0 ] +then + $CSQL_INSTALL_ROOT/bin/csql -s ${REL_PATH}/drop.sql > /dev/null 2>&1 + isql $DSN < ${REL_PATH}/drop.sql >/dev/null 2>&1 + rm -f /tmp/csql/csqltable.conf + touch /tmp/csql/csqltable.conf + cp /tmp/csql.conf $CSQL_CONFIG_FILE + exit 2; +fi + +rm -f /tmp/csql/csqltable.conf +touch /tmp/csql/csqltable.conf +$CSQL_INSTALL_ROOT/bin/csql -s ${REL_PATH}/drop.sql > /dev/null 2>&1 +isql $DS < ${REL_PATH}/drop.sql >/dev/null 2>&1 + +cp /tmp/csql.conf $CSQL_CONFIG_FILE +exit 0; + diff --git a/test/cache/CacheTable/test005.ksh b/test/cache/CacheTable/test005.ksh new file mode 100755 index 00000000..b63a38f6 --- /dev/null +++ b/test/cache/CacheTable/test005.ksh @@ -0,0 +1,48 @@ +#!/bin/ksh +# Test Case + +# 5.create table, load with definition option. should fail. + +#Run this test only under csql/test or on this directory. +#Otherwise, it may fail + +input=${PWD}/cache/CacheTable/inputtest4.sql +REL_PATH=. +if [ -s "$input" ] +then + REL_PATH=${PWD}/cache/CacheTable +fi + +cp $CSQL_CONFIG_FILE /tmp/csql.conf +echo DSN=$DSN >>$CSQL_CONFIG_FILE +DS="$DSN $DBUSER $PASSWORD" +rm -f /tmp/csql/csqlds.conf +touch /tmp/csql/csqlds.conf +$CSQL_INSTALL_ROOT/bin/csqlds -U $DBUSER -P $PASSWORD -D $DSN -N $TDB -a +if [ $? -ne 0 ] +then + cp /tmp/csql.conf $CSQL_CONFIG_FILE + exit 1; +fi +echo CACHE_TABLE=true >>$CSQL_CONFIG_FILE +isql $DS < ${REL_PATH}/inputtest4.sql >/dev/null 2>&1 +$CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/csqlinput.sql > /dev/null 2>&1 + +rm -f /tmp/csql/csqltable.conf +touch /tmp/csql/csqltable.conf +ret=0 +$CSQL_INSTALL_ROOT/bin/cachetable -t t1 > /dev/null 2>&1 +if [ $? -eq 0 ] +then + ret=1; +fi + +rm -f /tmp/csql/csqltable.conf +touch /tmp/csql/csqltable.conf + +isql $DS < ${REL_PATH}/drop.sql >/dev/null 2>&1 +$CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/drop.sql > /dev/null 2>&1 + +cp /tmp/csql.conf $CSQL_CONFIG_FILE +exit $ret; + diff --git a/test/cache/CacheTable/test006.ksh b/test/cache/CacheTable/test006.ksh new file mode 100755 index 00000000..9c5238fb --- /dev/null +++ b/test/cache/CacheTable/test006.ksh @@ -0,0 +1,45 @@ +#!/bin/ksh +# Test Case + +# 6.load with definition option. should succeed. + +#Run this test only under csql/test or on this directory. +#Otherwise, it may fail + +input=${PWD}/cache/CacheTable/inputtest4.sql +REL_PATH=. +if [ -s "$input" ] +then + REL_PATH=${PWD}/cache/CacheTable +fi + +cp $CSQL_CONFIG_FILE /tmp/csql.conf +echo DSN=$DSN >>$CSQL_CONFIG_FILE +DS="$DSN $DBUSER $PASSWORD" +rm -f /tmp/csql/csqlds.conf +touch /tmp/csql/csqlds.conf +$CSQL_INSTALL_ROOT/bin/csqlds -U $DBUSER -P $PASSWORD -D $DSN -N $TDB -a +if [ $? -ne 0 ] +then + cp /tmp/csql.conf $CSQL_CONFIG_FILE + exit 1; +fi +echo CACHE_TABLE=true >>$CSQL_CONFIG_FILE +isql $DS < ${REL_PATH}/inputtest4.sql >/dev/null 2>&1 + +rm -f /tmp/csql/csqltable.conf +touch /tmp/csql/csqltable.conf +ret=0 +$CSQL_INSTALL_ROOT/bin/cachetable -t t1 > /dev/null 2>&1 +if [ $? -ne 0 ] +then + ret=1; +fi + +rm -f /tmp/csql/csqltable.conf +touch /tmp/csql/csqltable.conf + +isql $DS < ${REL_PATH}/drop.sql >/dev/null 2>&1 +$CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/drop.sql > /dev/null 2>&1 +cp /tmp/csql.conf $CSQL_CONFIG_FILE +exit $ret; diff --git a/test/cache/CacheTable/test007.ksh b/test/cache/CacheTable/test007.ksh new file mode 100755 index 00000000..049198b9 --- /dev/null +++ b/test/cache/CacheTable/test007.ksh @@ -0,0 +1,44 @@ +#!/bin/ksh +# Test Case + +# 7.Do not create table, load with no definition option. should fail. + +#Run this test only under csql/test or on this directory. +#Otherwise, it may fail + +input=${PWD}/cache/CacheTable/inputtest4.sql +REL_PATH=. +if [ -s "$input" ] +then + REL_PATH=${PWD}/cache/CacheTable +fi + +cp $CSQL_CONFIG_FILE /tmp/csql.conf +echo CACHE_TABLE=true >>$CSQL_CONFIG_FILE +echo DSN=$DSN >>$CSQL_CONFIG_FILE +DS="$DSN $DBUSER $PASSWORD" +rm -f /tmp/csql/csqlds.conf +touch /tmp/csql/csqlds.conf +$CSQL_INSTALL_ROOT/bin/csqlds -U $DBUSER -P $PASSWORD -D $DSN -N $TDB -a +if [ $? -ne 0 ] +then + cp /tmp/csql.conf $CSQL_CONFIG_FILE + exit 1; +fi + +isql $DS < ${REL_PATH}/inputtest4.sql >/dev/null 2>&1 + +rm -f /tmp/csql/csqltable.conf +touch /tmp/csql/csqltable.conf + +ret=1 +$CSQL_INSTALL_ROOT/bin/cachetable -t t1 -s > /dev/null 2>&1 +if [ $? -ne 0 ] +then + ret=0; +fi +isql $DS < ${REL_PATH}/drop.sql >/dev/null 2>&1 +rm -f /tmp/csql/csqltable.conf +touch /tmp/csql/csqltable.conf +cp /tmp/csql.conf $CSQL_CONFIG_FILE +exit $ret; diff --git a/test/cache/CacheTable/test008.ksh b/test/cache/CacheTable/test008.ksh new file mode 100755 index 00000000..06420df9 --- /dev/null +++ b/test/cache/CacheTable/test008.ksh @@ -0,0 +1,88 @@ +#!/bin/ksh +# Test Case + +# 8.load table. csqldump , +# unload table csqldump, insert record to mysql directly, +# reload table, csqldump and verify the results. +# reload should get the inserted record also. + +#Run this test only under csql/test or on this directory. +#Otherwise, it may fail + +dropAll() { +isql $DS < ${REL_PATH}/drop.sql >/dev/null 2>&1 +$CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/drop.sql > /dev/null 2>&1 +} + +input=${PWD}/cache/CacheTable/inputtest4.sql +REL_PATH=. +if [ -s "$input" ] +then + REL_PATH=${PWD}/cache/CacheTable +fi + +cp $CSQL_CONFIG_FILE /tmp/csql.conf +echo DSN=$DSN >>$CSQL_CONFIG_FILE +DS="$DSN $DBUSER $PASSWORD" +rm -f /tmp/csql/csqlds.conf +touch /tmp/csql/csqlds.conf +$CSQL_INSTALL_ROOT/bin/csqlds -U $DBUSER -P $PASSWORD -D $DSN -N $TDB -a +if [ $? -ne 0 ] +then + cp /tmp/csql.conf $CSQL_CONFIG_FILE + exit 1; +fi + +echo CACHE_TABLE=true >>$CSQL_CONFIG_FILE +isql $DS < ${REL_PATH}/inputtest4.sql >/dev/null 2>&1 + +rm -f /tmp/csql/csqltable.conf +touch /tmp/csql/csqltable.conf + +$CSQL_INSTALL_ROOT/bin/cachetable -t t1 +if [ $? -ne 0 ] +then + dropAll + cp /tmp/csql.conf $CSQL_CONFIG_FILE + exit 1; +fi + +mv /tmp/csql/csqltable.conf /tmp/csql/csqltable.conf.temp +rm -f /tmp/csql/csqltable.conf +touch /tmp/csql/csqltable.conf + +$CSQL_INSTALL_ROOT/bin/csqldump + +mv /tmp/csql/csqltable.conf.temp /tmp/csql/csqltable.conf +$CSQL_INSTALL_ROOT/bin/cachetable -t t1 -u >/dev/null 2>&1 +if [ $? -ne 0 ] +then + dropAll + cp /tmp/csql.conf $CSQL_CONFIG_FILE + exit 2; +fi + +$CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/drop.sql > /dev/null 2>&1 + +$CSQL_INSTALL_ROOT/bin/csqldump + +isql $DS < ${REL_PATH}/insert.sql >/dev/null 2>&1 + +$CSQL_INSTALL_ROOT/bin/cachetable -t t1 +if [ $? -ne 0 ] +then + dropAll + cp /tmp/csql.conf $CSQL_CONFIG_FILE + exit 3; +fi + +rm -f /tmp/csql/csqltable.conf +touch /tmp/csql/csqltable.conf + +$CSQL_INSTALL_ROOT/bin/csqldump + +dropAll + +cp /tmp/csql.conf $CSQL_CONFIG_FILE +exit 0; + diff --git a/test/cache/CacheTable/test009.ksh b/test/cache/CacheTable/test009.ksh new file mode 100755 index 00000000..de0441e1 --- /dev/null +++ b/test/cache/CacheTable/test009.ksh @@ -0,0 +1,87 @@ +#!/bin/ksh +# Test Case + +# 9.create table t1 (f1 int, f2 int) in mysql and +# create table t1 (f1 int, f2 int, f3 int) in csql. +# load with no definition option. should fail. + +#Run this test only under csql/test or on this directory. +#Otherwise, it may fail + +dropAll() { +rm -f /tmp/csql/csqltable.conf +touch /tmp/csql/csqltable.conf +isql $DS < ${REL_PATH}/drop.sql >/dev/null 2>&1 +$CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/drop.sql > /dev/null 2>&1 +} + + +input=${PWD}/cache/CacheTable/inputtest4.sql +REL_PATH=. +if [ -s "$input" ] +then + REL_PATH=${PWD}/cache/CacheTable +fi + +cp $CSQL_CONFIG_FILE /tmp/csql.conf +echo DSN=$DSN >>$CSQL_CONFIG_FILE +DS="$DSN $DBUSER $PASSWORD" +rm -f /tmp/csql/csqlds.conf +touch /tmp/csql/csqlds.conf +$CSQL_INSTALL_ROOT/bin/csqlds -U $DBUSER -P $PASSWORD -D $DSN -N $TDB -a +if [ $? -ne 0 ] +then + cp /tmp/csql.conf $CSQL_CONFIG_FILE + exit 1; +fi + +echo CACHE_TABLE=true >>$CSQL_CONFIG_FILE +echo "Inserting table t1 with records in targetDB" +isql $DS < ${REL_PATH}/inputtest4.sql 2>/dev/null + +rm -f /tmp/csql/csqltable.conf +touch /tmp/csql/csqltable.conf + +echo "Creating the same table t1 in csql without records" +if [ "$DSN" = "oracle" ] +then + $CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/csqlinputtest9oracle.sql +else + $CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/csqlinputtest9.sql +fi +if [ $? -ne 0 ] +then + dropAll + cp /tmp/csql.conf $CSQL_CONFIG_FILE + exit 2; +fi + +$CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/selectt1.sql +if [ $? -ne 0 ] +then + dropAll + cp /tmp/csql.conf $CSQL_CONFIG_FILE + exit 3; +fi + +echo "Caching the table with -s (only load records)" +$CSQL_INSTALL_ROOT/bin/cachetable -t t1 -s +if [ $? -ne 0 ] +then + dropAll + cp /tmp/csql.conf $CSQL_CONFIG_FILE + exit 4; +fi + +$CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/selectt1.sql +if [ $? -ne 0 ] +then + dropAll + cp /tmp/csql.conf $CSQL_CONFIG_FILE + exit 5; +fi + +dropAll +cp /tmp/csql.conf $CSQL_CONFIG_FILE +exit 0; + diff --git a/test/cache/CacheTable/test010.ksh b/test/cache/CacheTable/test010.ksh new file mode 100755 index 00000000..006e29b2 --- /dev/null +++ b/test/cache/CacheTable/test010.ksh @@ -0,0 +1,62 @@ +#!/bin/ksh +# Test Case + +# Create table t1 and t2 in mysql and insert 10 records each. +# Run $ cachetable -R +# Both the tables should be cached into csql with all the records intact. + +#Run this test only under csql/test or on this directory. +#Otherwise, it may fail +dropAll() { +rm -f /tmp/csql/csqltable.conf +touch /tmp/csql/csqltable.conf +#cp $CSQL_CONFIG_FILE /tmp/csql.conf +#echo DSN=$DSN >>$CSQL_CONFIG_FILE +isql $DS < ${REL_PATH}/dropall.sql >/dev/null 2>&1 +$CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/dropall.sql > /dev/null 2>&1 +#cp /tmp/csql.conf $CSQL_CONFIG_FILE +} + + +input=${PWD}/cache/CacheTable/create.sql +REL_PATH=. +if [ -s "$input" ] +then + REL_PATH=${PWD}/cache/CacheTable +fi + +cp $CSQL_CONFIG_FILE /tmp/csql.conf +echo CACHE_TABLE=true >>$CSQL_CONFIG_FILE +echo DSN=$DSN >>$CSQL_CONFIG_FILE +DS="$DSN $DBUSER $PASSWORD" +rm -f /tmp/csql/csqlds.conf +touch /tmp/csql/csqlds.conf +$CSQL_INSTALL_ROOT/bin/csqlds -U $DBUSER -P $PASSWORD -D $DSN -N $TDB -a +if [ $? -ne 0 ] +then + exit 1; +fi + +isql $DS < ${REL_PATH}/create.sql >/dev/null 2>&1 +echo table t1 and t2 are created with records in target db + +rm -f /tmp/csql/csqltable.conf +touch /tmp/csql/csqltable.conf + +# write to the file +echo "1 t1 NULL NULL NULL $DSN" > /tmp/csql/csqltable.conf +echo "2 t2 NULL t2f1<5 NULL $DSN" >> /tmp/csql/csqltable.conf + +$CSQL_INSTALL_ROOT/bin/cachetable -R +if [ $? -ne 0 ] +then + dropAll +cp /tmp/csql.conf $CSQL_CONFIG_FILE + exit 1; +fi + +$CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/selectstar.sql +dropAll +cp /tmp/csql.conf $CSQL_CONFIG_FILE +exit 0; + diff --git a/test/cache/CacheTable/test011.ksh b/test/cache/CacheTable/test011.ksh new file mode 100755 index 00000000..c6707588 --- /dev/null +++ b/test/cache/CacheTable/test011.ksh @@ -0,0 +1,93 @@ +#!/bin/ksh +# Test Case + +# Create table t1 and t2 in mysql and insert 10 records each. +# Cache the tables into csql with -R option. +# Unload both tables. Both the tables should get unloaded. + +#Run this test only under csql/test or on this directory. +#Otherwise, it may fail +dropAll() { +rm -f /tmp/csql/csqltable.conf +touch /tmp/csql/csqltable.conf +#cp $CSQL_CONFIG_FILE /tmp/csql.conf +#echo DSN=$DSN >>$CSQL_CONFIG_FILE +isql $DS < ${REL_PATH}/dropall.sql >/dev/null 2>&1 +$CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/dropall.sql > /dev/null 2>&1 +#cp /tmp/csql.conf $CSQL_CONFIG_FILE +} + + +input=${PWD}/cache/CacheTable/create.sql +REL_PATH=. +if [ -s "$input" ] +then + REL_PATH=${PWD}/cache/CacheTable +fi + +cp $CSQL_CONFIG_FILE /tmp/csql.conf +echo CACHE_TABLE=true >>$CSQL_CONFIG_FILE +echo DSN=$DSN >>$CSQL_CONFIG_FILE +DS="$DSN $DBUSER $PASSWORD" +rm -f /tmp/csql/csqlds.conf +touch /tmp/csql/csqlds.conf +$CSQL_INSTALL_ROOT/bin/csqlds -U $DBUSER -P $PASSWORD -D $DSN -N $TDB -a +if [ $? -ne 0 ] +then + cp /tmp/csql.conf $CSQL_CONFIG_FILE + exit 1; +fi + +isql $DS < ${REL_PATH}/create.sql >/dev/null 2>&1 +echo table t1 and t2 are created with records in target db + +rm -f /tmp/csql/csqltable.conf +touch /tmp/csql/csqltable.conf + +# write to csqltable.conf +echo "1 t1 NULL NULL NULL $DSN" > /tmp/csql/csqltable.conf +echo "2 t2 NULL t2f1<5 NULL $DSN" >> /tmp/csql/csqltable.conf + +$CSQL_INSTALL_ROOT/bin/cachetable -R +if [ $? -ne 0 ] +then + dropAll + cp /tmp/csql.conf $CSQL_CONFIG_FILE + exit 1; +fi + +$CSQL_INSTALL_ROOT/bin/cachetable -t t1 -u +if [ $? -ne 0 ] +then + dropAll + cp /tmp/csql.conf $CSQL_CONFIG_FILE + exit 2; +fi +echo table t1 unloaded +$CSQL_INSTALL_ROOT/bin/cachetable -t t2 -u +if [ $? -ne 0 ] +then + dropAll + cp /tmp/csql.conf $CSQL_CONFIG_FILE + exit 3; +fi +echo table t2 unloaded +grep t1 /tmp/csql/csqltable.conf +if [ $? -eq 0 ] +then + dropAll + cp /tmp/csql.conf $CSQL_CONFIG_FILE + exit 4; +fi + +grep t2 /tmp/csql/csqltable.conf +if [ $? -eq 0 ] +then + dropAll + cp /tmp/csql.conf $CSQL_CONFIG_FILE + exit 5; +fi +dropAll +cp /tmp/csql.conf $CSQL_CONFIG_FILE +exit 0; + diff --git a/test/cache/CacheTable/test012.ksh b/test/cache/CacheTable/test012.ksh new file mode 100755 index 00000000..c6677790 --- /dev/null +++ b/test/cache/CacheTable/test012.ksh @@ -0,0 +1,102 @@ +#!/bin/ksh +# Test Case + +# Create table t1 and t2 in mysql and insert 10 records each. +# Cache the tables into csql with -R option. +# Remove 5 entries from table t1 in csql and 5 entries from table t2 in mysql. +# Reload both tables with -r option. +# CSQL now should have 10 entries in t1 and 5 entries in t2 + +input=${PWD}/cache/CacheTable/create.sql +REL_PATH=. +if [ -s "$input" ] +then + REL_PATH=${PWD}/cache/CacheTable +fi + +cp $CSQL_CONFIG_FILE /tmp/csql.conf +echo CACHE_TABLE=true >>$CSQL_CONFIG_FILE +echo DSN=$DSN >>$CSQL_CONFIG_FILE +DS="$DSN $DBUSER $PASSWORD" +rm -f /tmp/csql/csqlds.conf +touch /tmp/csql/csqlds.conf +$CSQL_INSTALL_ROOT/bin/csqlds -U $DBUSER -P $PASSWORD -D $DSN -N $TDB -a +if [ $? -ne 0 ] +then + cp /tmp/csql.conf $CSQL_CONFIG_FILE + exit 1; +fi + +isql $DS < ${REL_PATH}/create.sql >/dev/null 2>&1 +echo table t1 and t2 are created with records in target db + +rm -f /tmp/csql/csqltable.conf +touch /tmp/csql/csqltable.conf + +# write to the csqltable.conf file +echo "1 t1 NULL NULL NULL $DSN" > /tmp/csql/csqltable.conf +echo "2 t2 NULL t2f1>5 NULL $DSN" >> /tmp/csql/csqltable.conf + +if [ "$VALGRIND" = "true" ] +then + valgrind --tool=memcheck --leak-check=full $CSQL_INSTALL_ROOT/bin/cachetable -R 2> $0.valgr +else + $CSQL_INSTALL_ROOT/bin/cachetable -R + if [ $? -ne 0 ] + then + cp /tmp/csql.conf $CSQL_CONFIG_FILE + exit 2; + fi +fi +if [ "$VALGRIND" = "true" ] +then + valgrind --tool=memcheck --leak-check=full $CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/selectstar.sql 2> $0.valgr +else + $CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/selectstar.sql +fi +if [ "$VALGRIND" = "true" ] +then + valgrind --tool=memcheck --leak-check=full $CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/deletefromt1csql.sql 2>> $0.valgr +else + $CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/deletefromt1csql.sql +fi +isql $DS < $REL_PATH/deletefromt2mysql.sql + +if [ "$VALGRIND" = "true" ] +then + valgrind --tool=memcheck --leak-check=full $CSQL_INSTALL_ROOT/bin/cachetable -t t1 -r 2>> $0.valgr +else + $CSQL_INSTALL_ROOT/bin/cachetable -t t1 -r + if [ $? -ne 0 ] + then + cp /tmp/csql.conf $CSQL_CONFIG_FILE + exit 2; + fi +fi +echo table t1 reloaded +if [ "$VALGRIND" = "true" ] +then + valgrind --tool=memcheck --leak-check=full $CSQL_INSTALL_ROOT/bin/cachetable -t t2 -r 2>> $0.valgr +else + $CSQL_INSTALL_ROOT/bin/cachetable -t t2 -r + if [ $? -ne 0 ] + then + cp /tmp/csql.conf $CSQL_CONFIG_FILE + exit 3; + fi +fi +echo table t2 reloaded + +if [ "$VALGRIND" = "true" ] +then + valgrind --tool=memcheck --leak-check=full $CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/selectstar.sql 2>> $0.valgr +else + $CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/selectstar.sql +fi +rm -f /tmp/csql/csqltable.conf +touch /tmp/csql/csqltable.conf +isql $DS < ${REL_PATH}/dropall.sql >/dev/null 2>&1 +$CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/dropall.sql > /dev/null 2>&1 +cp /tmp/csql.conf $CSQL_CONFIG_FILE +exit 0; + diff --git a/test/cache/CacheTable/test013.ksh b/test/cache/CacheTable/test013.ksh new file mode 100755 index 00000000..9b3e7094 --- /dev/null +++ b/test/cache/CacheTable/test013.ksh @@ -0,0 +1,68 @@ +#!/bin/ksh +# Test Case + +# Create table t1 and t2 in mysql and insert 10 records each. +# Cache the tables into csql with -R option. +# Create table t3 in csql only and insert few records. +# Unload t3 table. It should return error. + +input=${PWD}/cache/CacheTable/create.sql +REL_PATH=. +if [ -s "$input" ] +then + REL_PATH=${PWD}/cache/CacheTable +fi + +cp $CSQL_CONFIG_FILE /tmp/csql.conf +echo CACHE_TABLE=true >>$CSQL_CONFIG_FILE +echo DSN=$DSN >>$CSQL_CONFIG_FILE +DS="$DSN $DBUSER $PASSWORD" +rm -f /tmp/csql/csqlds.conf +touch /tmp/csql/csqlds.conf +$CSQL_INSTALL_ROOT/bin/csqlds -U $DBUSER -P $PASSWORD -D $DSN -N $TDB -a +if [ $? -ne 0 ] +then + cp /tmp/csql.conf $CSQL_CONFIG_FILE + exit 1; +fi + +isql $DS < ${REL_PATH}/create.sql >/dev/null 2>&1 +echo table t1 and t2 are created with records in target db + +rm -f /tmp/csql/csqltable.conf +touch /tmp/csql/csqltable.conf + +# write to csqltable.conf file +echo "1 t1 NULL NULL NULL $DSN" > /tmp/csql/csqltable.conf +echo "2 t2 NULL t2f1<5 NULL $DSN" >> /tmp/csql/csqltable.conf + +$CSQL_INSTALL_ROOT/bin/cachetable -R +if [ $? -ne 0 ] +then + rm -f /tmp/csql/csqltable.conf + touch /tmp/csql/csqltable.conf + isql $DS < ${REL_PATH}/dropall.sql >/dev/null 2>&1 + $CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/dropall.sql > /dev/null 2>&1 + cp /tmp/csql.conf $CSQL_CONFIG_FILE + exit 1; +fi + +$CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/createt3.sql 2>&1 >/dev/null + +$CSQL_INSTALL_ROOT/bin/cachetable -t t3 -u +if [ $? -eq 0 ] +then + rm -f /tmp/csql/csqltable.conf + touch /tmp/csql/csqltable.conf + isql $DS < ${REL_PATH}/dropall.sql >/dev/null 2>&1 + $CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/dropall.sql > /dev/null 2>&1 + cp /tmp/csql.conf $CSQL_CONFIG_FILE + exit 2; +fi + +rm /tmp/csql/csqltable.conf +touch /tmp/csql/csqltable.conf +isql $DS < ${REL_PATH}/dropall.sql >/dev/null 2>&1 +$CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/dropall.sql > /dev/null 2>&1 +cp /tmp/csql.conf $CSQL_CONFIG_FILE +exit 0; diff --git a/test/cache/CacheTable/test014.ksh b/test/cache/CacheTable/test014.ksh new file mode 100755 index 00000000..494ea638 --- /dev/null +++ b/test/cache/CacheTable/test014.ksh @@ -0,0 +1,66 @@ +#!/bin/ksh +# Test Case +#14. Create 't1' table in Target DB with two records, +# Load selected records into CSQL with -c "f1=1" option. +# Select from t1 in csql should display only one record with f1 value 1 + +# Author : Jitendra Lenka + +input=${PWD}/cache/CacheTable/inputtest4.sql +REL_PATH=. +if [ -s "$input" ] +then + REL_PATH=${PWD}/cache/CacheTable +fi + +cp $CSQL_CONFIG_FILE /tmp/csql.conf +echo CACHE_TABLE=true >>$CSQL_CONFIG_FILE + +echo DSN=$DSN >>$CSQL_CONFIG_FILE +DS="$DSN $DBUSER $PASSWORD" +rm -f /tmp/csql/csqlds.conf +touch /tmp/csql/csqlds.conf +$CSQL_INSTALL_ROOT/bin/csqlds -U $DBUSER -P $PASSWORD -D $DSN -N $TDB -a +if [ $? -ne 0 ] +then + cp /tmp/csql.conf $CSQL_CONFIG_FILE + exit 1; +fi +isql $DS < ${REL_PATH}/inputtest4.sql >/dev/null 2>&1 +if [ $? -ne 0 ] +then + cp /tmp/csql.conf $CSQL_CONFIG_FILE + exit 1; +fi + +echo Table t1 created with two records in target db. + +rm -f /tmp/csql/csqltable.conf +touch /tmp/csql/csqltable.conf + +#cache from target to csql with -c option +echo "cachetable -t t1 -c \"f1=1\" " +$CSQL_INSTALL_ROOT/bin/cachetable -t t1 -c "f1=1" >/dev/null 2>&1 +if [ $? -ne 0 ] +then + rm -f /tmp/csql/csqltable.conf + touch /tmp/csql/csqltable.conf + + $CSQL_INSTALL_ROOT/bin/csql -s ${REL_PATH}/drop.sql > /dev/null 2>&1 + isql $DS < ${REL_PATH}/drop.sql >/dev/null 2>&1 + cp /tmp/csql.conf $CSQL_CONFIG_FILE + exit 2; +fi + +echo "select * from t1;" +$CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/selectt1.sql + +rm -f /tmp/csql/csqltable.conf +touch /tmp/csql/csqltable.conf + +$CSQL_INSTALL_ROOT/bin/csql -s ${REL_PATH}/drop.sql > /dev/null 2>&1 +isql $DS < ${REL_PATH}/drop.sql >/dev/null 2>&1 + +cp /tmp/csql.conf $CSQL_CONFIG_FILE +exit 0; + diff --git a/test/cache/CacheTable/test015.ksh b/test/cache/CacheTable/test015.ksh new file mode 100755 index 00000000..c03d18bd --- /dev/null +++ b/test/cache/CacheTable/test015.ksh @@ -0,0 +1,87 @@ +#!/bin/ksh +#Test Case +#15. create table t1 and t2 in target DB with 10 records +# Load t1 table without condition option +# Load t2 with condition " t2f1 < 5 ". +# Select from t1, should show 10 records and t2 should show only 4 records + +# Author : Jitendra Lenka + +input=${PWD}/cache/CacheTable/inputtest4.sql +REL_PATH=. +if [ -s "$input" ] +then + REL_PATH=${PWD}/cache/CacheTable +fi + +cp $CSQL_CONFIG_FILE /tmp/csql.conf +echo CACHE_TABLE=true >>$CSQL_CONFIG_FILE +echo DSN=$DSN >>$CSQL_CONFIG_FILE +DS="$DSN $DBUSER $PASSWORD" +rm -f /tmp/csql/csqlds.conf +touch /tmp/csql/csqlds.conf +$CSQL_INSTALL_ROOT/bin/csqlds -U $DBUSER -P $PASSWORD -D $DSN -N $TDB -a +if [ $? -ne 0 ] +then + cp /tmp/csql.conf $CSQL_CONFIG_FILE + exit 1; +fi + +# create table t1,t2 in target DB. +isql $DS < ${REL_PATH}/create.sql >/dev/null 2>&1 +if [ $? -ne 0 ] +then + cp /tmp/csql.conf $CSQL_CONFIG_FILE + exit 1; +fi + +echo Table t1 and t2 created in target DB. + +rm -f /tmp/csql/csqltable.conf +touch /tmp/csql/csqltable.conf + +echo "cachetable -t t1" +echo "cachetable -t t2 -c \"t2f1<5\" " + +$CSQL_INSTALL_ROOT/bin/cachetable -t t1 >/dev/null 2>&1 +if [ $? -ne 0 ] +then + isql $DS < ${REL_PATH}/dropt1t2.sql >/dev/null 2>&1 + rm -f /tmp/csql/csqltable.conf + cp /tmp/csql.conf $CSQL_CONFIG_FILE + exit 2; +fi + +$CSQL_INSTALL_ROOT/bin/cachetable -t t2 -c "t2f1<5" +if [ $? -ne 0 ] +then + rm -f /tmp/csql/csqltable.conf + touch /tmp/csql/csqltable.conf + $CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/drop.sql >/dev/null 2>&1 + isql $DS < ${REL_PATH}/drop.sql >/dev/null 2>&1 + cp /tmp/csql.conf $CSQL_CONFIG_FILE + exit 3; +fi + + +echo "select query on t1 and t2 table" +$CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/selectstar.sql + +rm -f /tmp/csql/csqltable.conf +touch /tmp/csql/csqltable.conf + +$CSQL_INSTALL_ROOT/bin/csql -s ${REL_PATH}/dropt1t2.sql > /dev/null 2>&1 +isql $DS <${REL_PATH}/dropt1t2.sql >/dev/null 2>&1 +cp /tmp/csql.conf $CSQL_CONFIG_FILE +exit 0; + + + + + + + + + + + diff --git a/test/cache/CacheTable/test016.ksh b/test/cache/CacheTable/test016.ksh new file mode 100755 index 00000000..a87c14c1 --- /dev/null +++ b/test/cache/CacheTable/test016.ksh @@ -0,0 +1,104 @@ +#!/bin/ksh +#Test case +#16. create table t1,t2 in target DB with 10 records. +# load t1 table with condition option +# load t2 table with condition . + +# unload the two tables t1,t2 with -u option. + +# AUTHOR : Jitendra Lenka + +input=${PWD}/cache/CacheTable/inputtest4.sql +REL_PATH=. +if [ -s "$input" ] +then + REL_PATH=${PWD}/cache/CacheTable +fi + +cp $CSQL_CONFIG_FILE /tmp/csql.conf +echo DSN=$DSN >>$CSQL_CONFIG_FILE +DS="$DSN $DBUSER $PASSWORD" +rm -f /tmp/csql/csqlds.conf +touch /tmp/csql/csqlds.conf +$CSQL_INSTALL_ROOT/bin/csqlds -U $DBUSER -P $PASSWORD -D $DSN -N $TDB -a +if [ $? -ne 0 ] +then + exit 1; +fi + +echo CACHE_TABLE=true >>$CSQL_CONFIG_FILE +# create table t1,t2 in target DB. +isql $DS < ${REL_PATH}/create.sql >/dev/null 2>&1 +if [ $? -ne 0 ] +then + cp /tmp/csql.conf $CSQL_CONFIG_FILE + exit 1; +fi + +echo Table t1 and t2 created in target DB. + +rm -f /tmp/csql/csqltable.conf +touch /tmp/csql/csqltable.conf + +echo "cachetable -t t1" +echo "cachetable -t t2 -c \"t2f1<5\" " + +$CSQL_INSTALL_ROOT/bin/cachetable -t t1 >/dev/null 2>&1 +if [ $? -ne 0 ] +then + isql $DS < ${REL_PATH}/dropt1t2.sql >/dev/null 2>&1 + rm -f /tmp/csql/csqltable.conf + + cp /tmp/csql.conf $CSQL_CONFIG_FILE + exit 2; +fi + +echo "Table t1 unloaded from CSQL" + +$CSQL_INSTALL_ROOT/bin/cachetable -t t2 -c "t2f1<5" >/dev/null 2>&1 +if [ $? -ne 0 ] +then + rm -f /tmp/csql/csqltable.conf + touch /tmp/csql/csqltable.conf + + $CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/dropt1t2.sql >/dev/null 2>&1 + isql $DS < ${REL_PATH}/dropt1t2.sql >/dev/null 2>&1 + cp /tmp/csql.conf $CSQL_CONFIG_FILE + exit 3; +fi + +# unload the two tables from csql and remove entry from csqltable.conf + +echo "Table t2 unloaded from CSQl" +$CSQL_INSTALL_ROOT/bin/cachetable -t t1 -u >/dev/null 2>&1 +if [ $? -ne 0 ] +then + rm -f /tmp/csql/csqltable.conf + touch /tmp/csql/csqltable.conf + + $CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/dropt1t2.sql >/dev/null 2>&1 + isql $DS < ${REL_PATH}/dropt1t2.sql >/dev/null 2>&1 + + cp /tmp/csql.conf $CSQL_CONFIG_FILE + exit 4; +fi + +$CSQL_INSTALL_ROOT/bin/cachetable -t t2 -u >/dev/null 2>&1 +if [ $? -ne 0 ] +then + $CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/dropt1t2.sql >/dev/null 2>&1 + isql $DS < ${REL_PATH}/dropt1t2.sql >/dev/null 2>&1 + rm -f /tmp/csql/csqltable.conf + + cp /tmp/csql.conf $CSQL_CONFIG_FILE + exit 5; +fi + +$CSQL_INSTALL_ROOT/bin/csql -s ${REL_PATH}/dropt1t2.sql > /dev/null 2>&1 +isql $DS <${REL_PATH}/dropt1t2.sql >/dev/null 2>&1 +rm -f /tmp/csql/csqltable.conf +touch /tmp/csql/csqltable.conf + cp /tmp/csql.conf $CSQL_CONFIG_FILE +exit 0; + + diff --git a/test/cache/CacheTable/test017.ksh b/test/cache/CacheTable/test017.ksh new file mode 100755 index 00000000..adbe4aa3 --- /dev/null +++ b/test/cache/CacheTable/test017.ksh @@ -0,0 +1,74 @@ +#!/bin/ksh +#Test Case +#17. Create table t1 and t2 in target DB with 10 records. +# Add following entries in csqltable.conf file: +# 1:t1 NULL +# 2:t2 t2f1<5 +# Recover the two tables from the target DB with -R option. +# CSQL should contain 10 records of t1 and 4 records of t2 + +#Run this test only under csql/test or on this directory +#otherwise it may fail. + +#AUTHOR : Jitendra Lenka + +input=${PWD}/cache/CacheTable/inputtest4.sql +REL_PATH=. +if [ -s "$input" ] +then + REL_PATH=${PWD}/cache/CacheTable +fi + +cp $CSQL_CONFIG_FILE /tmp/csql.conf +echo CACHE_TABLE=true >>$CSQL_CONFIG_FILE +echo DSN=$DSN >>$CSQL_CONFIG_FILE +DS="$DSN $DBUSER $PASSWORD" +rm -f /tmp/csql/csqlds.conf +touch /tmp/csql/csqlds.conf +$CSQL_INSTALL_ROOT/bin/csqlds -U $DBUSER -P $PASSWORD -D $DSN -N $TDB -a +if [ $? -ne 0 ] +then + cp /tmp/csql.conf $CSQL_CONFIG_FILE + exit 1; +fi + +# create table t1,t2 in target DB. +isql $DS < ${REL_PATH}/create.sql >/dev/null 2>&1 +if [ $? -ne 0 ] +then + cp /tmp/csql.conf $CSQL_CONFIG_FILE + exit 1; +fi +echo Table t1 and t2 created in target DB. + +rm -f /tmp/csql/csqltable.conf +touch /tmp/csql/csqltable.conf + +echo "1 t1 NULL NULL NULL $DSN" > /tmp/csql/csqltable.conf +echo "2 t2 NULL t2f1<5 NULL $DSN" >> /tmp/csql/csqltable.conf + +# caching with -R option +$CSQL_INSTALL_ROOT/bin/cachetable -R +if [ $? -ne 0 ] +then + cp /tmp/csql.conf $CSQL_CONFIG_FILE + exit 2; +fi + +$CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/selectstar.sql +if [ $? -ne 0 ] +then + $CSQL_INSTALL_ROOT/bin/csql -s ${REL_PATH}/dropt1t2.sql > /dev/null 2>&1 + isql $DS < ${REL_PATH}/dropt1t2.sql >/dev/null 2>&1 + rm -f /tmp/csql/csqltable.conf + touch /tmp/csql/csqltable.conf + cp /tmp/csql.conf $CSQL_CONFIG_FILE + exit 3; +fi + +rm -f /tmp/csql/csqltable.conf +touch /tmp/csql/csqltable.conf +$CSQL_INSTALL_ROOT/bin/csql -s ${REL_PATH}/dropt1t2.sql > /dev/null 2>&1 +isql $DS < ${REL_PATH}/dropt1t2.sql >/dev/null 2>&1 +cp /tmp/csql.conf $CSQL_CONFIG_FILE +exit 0; diff --git a/test/cache/CacheTable/test018.ksh b/test/cache/CacheTable/test018.ksh new file mode 100755 index 00000000..6e99ac74 --- /dev/null +++ b/test/cache/CacheTable/test018.ksh @@ -0,0 +1,78 @@ +#!/bin/ksh +#Test Case + +#18. load t1 table with records in target DB, +# create a t1 table in CSQL without record. +# load with -s option, it should pass. + +# AUTHOR : Jitendra Lenka + +input=${PWD}/cache/CacheTable/inputtest4.sql +REL_PATH=. +if [ -s "$input" ] +then + REL_PATH=${PWD}/cache/CacheTable +fi + +cp $CSQL_CONFIG_FILE /tmp/csql.conf +echo CACHE_TABLE=true >>$CSQL_CONFIG_FILE +echo DSN=$DSN >>$CSQL_CONFIG_FILE +DS="$DSN $DBUSER $PASSWORD" +rm -f /tmp/csql/csqlds.conf +touch /tmp/csql/csqlds.conf +$CSQL_INSTALL_ROOT/bin/csqlds -U $DBUSER -P $PASSWORD -D $DSN -N $TDB -a +if [ $? -ne 0 ] +then + cp /tmp/csql.conf $CSQL_CONFIG_FILE + exit 1; +fi + +isql $DS < ${REL_PATH}/inputtest4.sql >/dev/null 2>&1 +if [ "$DSN" = "oracle" ] +then +$CSQL_INSTALL_ROOT/bin/csql -s ${REL_PATH}/csqlinputoracle.sql > /dev/null 2>&1 +else +$CSQL_INSTALL_ROOT/bin/csql -s ${REL_PATH}/csqlinput.sql > /dev/null 2>&1 +fi +if [ $? -ne 0 ] +then + isql $DS < ${REL_PATH}/drop.sql >/dev/null 2>&1 + rm -f /tmp/csql/csqltable.conf + touch /tmp/csql/csqltable.conf + cp /tmp/csql.conf $CSQL_CONFIG_FILE + exit 2; +fi + +rm -f /tmp/csql/csqltable.conf +touch /tmp/csql/csqltable.conf + +# caching with -s option +$CSQL_INSTALL_ROOT/bin/cachetable -t t1 -s >/dev/null 2>&1 +if [ $? -ne 0 ] +then + rm -f /tmp/csql/csqltable.conf + touch /tmp/csql/csqltable.conf + $CSQL_INSTALL_ROOT/bin/csql -s ${REL_PATH}/drop.sql > /dev/null 2>&1 + isql $DS < ${REL_PATH}/drop.sql >/dev/null 2>&1 + cp /tmp/csql.conf $CSQL_CONFIG_FILE + exit 3; +fi + +echo "select * from t1;" +$CSQL_INSTALL_ROOT/bin/csql -s ${REL_PATH}/selectt1.sql +if [ $? -ne 0 ] +then + rm -f /tmp/csql/csqltable.conf + touch /tmp/csql/csqltable.conf + $CSQL_INSTALL_ROOT/bin/csql -s ${REL_PATH}/drop.sql > /dev/null 2>&1 + isql $DS < ${REL_PATH}/drop.sql >/dev/null 2>&1 + cp /tmp/csql.conf $CSQL_CONFIG_FILE + exit 4; +fi +rm -f /tmp/csql/csqltable.conf +touch /tmp/csql/csqltable.conf + +$CSQL_INSTALL_ROOT/bin/csql -s ${REL_PATH}/drop.sql > /dev/null 2>&1 +isql $DS < ${REL_PATH}/drop.sql >/dev/null 2>&1 +cp /tmp/csql.conf $CSQL_CONFIG_FILE +exit 0; diff --git a/test/cache/CacheTable/test019.ksh b/test/cache/CacheTable/test019.ksh new file mode 100755 index 00000000..9009f936 --- /dev/null +++ b/test/cache/CacheTable/test019.ksh @@ -0,0 +1,105 @@ +#!/bin/ksh +#Test Case + +#19. create t1 table with some records in TDB, +# cache it with -c option. +# Insert some records which satisfy the cache condition into t1 in TDB. +# Insert some records which do not satisfy cache condition into t1 in TDB. +# Reload t1 with -r option +# CSQL should contain all records which satisfies cache condition from TDB + +#Run this test only under csql/test or on this directory. +#otherwise, it may fail. + +# AUTHOR : Jitendra Lenka +input=${PWD}/cache/CacheTable/inputtest4.sql +REL_PATH=. +if [ -s "$input" ] +then + REL_PATH=${PWD}/cache/CacheTable +fi + +cp $CSQL_CONFIG_FILE /tmp/csql.conf +echo CACHE_TABLE=true >>$CSQL_CONFIG_FILE +echo DSN=$DSN >>$CSQL_CONFIG_FILE +DS="$DSN $DBUSER $PASSWORD" +rm -f /tmp/csql/csqlds.conf +touch /tmp/csql/csqlds.conf +$CSQL_INSTALL_ROOT/bin/csqlds -U $DBUSER -P $PASSWORD -D $DSN -N $TDB -a +if [ $? -ne 0 ] +then + cp /tmp/csql.conf $CSQL_CONFIG_FILE + exit 1; +fi + +isql $DS < ${REL_PATH}/inputtest4.sql >/dev/null 2>&1 +if [ $? -ne 0 ] +then + cp /tmp/csql.conf $CSQL_CONFIG_FILE + exit 1; +fi + +rm -f /tmp/csql/csqltable.conf +touch /tmp/csql/csqltable.conf + +$CSQL_INSTALL_ROOT/bin/cachetable -t t1 -c "f1=1" >/dev/null 2>&1 +if [ $? -ne 0 ] +then + rm -f /tmp/csql/csqltable.conf + touch /tmp/csql/csqltable.conf + $CSQL_INSTALL_ROOT/bin/csql -s ${REL_PATH}/drop.sql > /dev/null 2>&1 + isql $DS < ${REL_PATH}/drop.sql >/dev/null 2>&1 + cp /tmp/csql.conf $CSQL_CONFIG_FILE + exit 2; +fi + +echo after cahe with -c option +echo "select * from t1" + +#select from t1 table +$CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/selectt1.sql +if [ $? -ne 0 ] +then + rm -f /tmp/csql/csqltable.conf + touch /tmp/csql/csqltable.conf + $CSQL_INSTALL_ROOT/bin/csql -s ${REL_PATH}/drop.sql > /dev/null 2>&1 + isql $DS < ${REL_PATH}/drop.sql >/dev/null 2>&1 + cp /tmp/csql.conf $CSQL_CONFIG_FILE + exit 3; +fi + + +isql $DS < ${REL_PATH}/insert.sql >/dev/null 2>&1 + +# again reload table with -r option. +$CSQL_INSTALL_ROOT/bin/cachetable -t t1 -r >/dev/null 2>&1 +if [ $? -ne 0 ] +then + rm -f /tmp/csql/csqltable.conf + touch /tmp/csql/csqltable.conf + $CSQL_INSTALL_ROOT/bin/csql -s ${REL_PATH}/drop.sql > /dev/null 2>&1 + isql $DS < ${REL_PATH}/drop.sql >/dev/null 2>&1 + cp /tmp/csql.conf $CSQL_CONFIG_FILE + exit 4; +fi + +#after reload, select from t1 +echo "after reload , select * from t1;" +$CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/selectt1.sql +if [ $? -ne 0 ] +then + rm -f /tmp/csql/csqltable.conf + touch /tmp/csql/csqltable.conf + $CSQL_INSTALL_ROOT/bin/csql -s ${REL_PATH}/drop.sql > /dev/null 2>&1 + isql $DS < ${REL_PATH}/drop.sql >/dev/null 2>&1 + cp /tmp/csql.conf $CSQL_CONFIG_FILE + exit 5; +fi + +rm -f /tmp/csql/csqltable.conf +touch /tmp/csql/csqltable.conf +$CSQL_INSTALL_ROOT/bin/csql -s ${REL_PATH}/drop.sql > /dev/null 2>&1 +isql $DS < ${REL_PATH}/drop.sql >/dev/null 2>&1 +cp /tmp/csql.conf $CSQL_CONFIG_FILE +exit 0; + diff --git a/test/cache/CacheTable/test020.ksh b/test/cache/CacheTable/test020.ksh new file mode 100755 index 00000000..b010d945 --- /dev/null +++ b/test/cache/CacheTable/test020.ksh @@ -0,0 +1,99 @@ +#!/bin/ksh + +# Create 't1' table with two records in target DB. \ +# cache t1 from target to csql. +# table 't1' can't be deleted by DROP statement. +# it should be unloaded by -u option + +# AUTHOR : Jitendra Lenka + +#!/bin/ksh +input=${PWD}/cache/CacheTable/inputtest4.sql +REL_PATH=. +if [ -s "$input" ] +then + REL_PATH=${PWD}/cache/CacheTable +fi + +rm -f /tmp/csql.conf +cp $REL_PATH/csql.conf /tmp +export CSQL_CONFIG_FILE=/tmp/csql.conf +echo DSN=$DSN >>$CSQL_CONFIG_FILE +DS="$DSN $DBUSER $PASSWORD" +rm -f /tmp/csql/csqlds.conf +touch /tmp/csql/csqlds.conf +$CSQL_INSTALL_ROOT/bin/csqlds -U $DBUSER -P $PASSWORD -D $DSN -N $TDB -a +if [ $? -ne 0 ] +then + exit 1; +fi + +isql $DS < ${REL_PATH}/inputtest4.sql >/dev/null 2>&1 +if [ $? -ne 0 ] +then + exit 1; +fi +rm -f /tmp/csql/csqltable.conf +touch /tmp/csql/csqltable.conf + +$CSQL_INSTALL_ROOT/bin/csqlserver >/dev/null 2>&1 & +pid=$! +sleep 5 + +$CSQL_INSTALL_ROOT/bin/cachetable -t t1 >/dev/null 2>&1 +if [ $? -ne 0 ] +then + rm -f /tmp/csql/csqltable.conf + touch /tmp/csql/csqltable.conf + $CSQL_INSTALL_ROOT/bin/csql -s ${REL_PATH}/drop.sql > /dev/null 2>&1 + isql $DS < ${REL_PATH}/drop.sql >/dev/null 2>&1 + kill -9 $pid + ipcrm -M 4000 -M 4500 + exit 2; +fi + +$CSQL_INSTALL_ROOT/bin/csql -s ${REL_PATH}/drop.sql >/dev/null 2>&1 +if [ $? -ne 0 ] +then + rm -f /tmp/csql/csqltable.conf + touch /tmp/csql/csqltable.conf + $CSQL_INSTALL_ROOT/bin/csql -s ${REL_PATH}/drop.sql > /dev/null 2>&1 + isql $DS < ${REL_PATH}/drop.sql >/dev/null 2>&1 + kill -9 $pid + ipcrm -M 4000 -M 4500 + exit 3; +fi +echo "cache table 't1' can't be dropped" + +$CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/selectt1.sql +if [ $? -ne 0 ] +then + rm -f /tmp/csql/csqltable.conf + touch /tmp/csql/csqltable.conf + $CSQL_INSTALL_ROOT/bin/csql -s ${REL_PATH}/drop.sql > /dev/null 2>&1 + isql $DS < ${REL_PATH}/drop.sql >/dev/null 2>&1 + kill -9 $pid + ipcrm -M 4000 -M 4500 + exit 4; +fi +$CSQL_INSTALL_ROOT/bin/cachetable -t t1 -u >/dev/null 2>&1 + +if [ $? -ne 0 ] +then + rm -f /tmp/csql/csqltable.conf + touch /tmp/csql/csqltable.conf + $CSQL_INSTALL_ROOT/bin/csql -s ${REL_PATH}/drop.sql > /dev/null 2>&1 + isql $DS < ${REL_PATH}/drop.sql >/dev/null 2>&1 + kill -9 $pid + ipcrm -M 4000 -M 4500 + exit 4; +fi + +echo "cache table 't1' unloaded by -u option" +rm -f /tmp/csql/csqltable.conf +touch /tmp/csql/csqltable.conf +$CSQL_INSTALL_ROOT/bin/csql -s ${REL_PATH}/drop.sql > /dev/null 2>&1 +isql $DS < ${REL_PATH}/drop.sql >/dev/null 2>&1 +kill -9 $pid +ipcrm -M 4000 -M 4500 +exit 0; diff --git a/test/cache/CacheTable/test021.ksh b/test/cache/CacheTable/test021.ksh new file mode 100755 index 00000000..ec1416ef --- /dev/null +++ b/test/cache/CacheTable/test021.ksh @@ -0,0 +1,90 @@ +#!/bin/ksh +# Test Case + +# Create table t4 with f1 int and f2 char,composite primary key (f1,f2) in target database +# Cache it with cachetable tool. +# Check the catalog table whether primary key is composite +# Insert some records which violate composite key +# Insertion should fail +# Unload the table. It should succeed. + +input=${PWD}/cache/CacheTable/create.sql +REL_PATH=. +if [ -s "$input" ] +then + REL_PATH=${PWD}/cache/CacheTable +fi +rm -f /tmp/csql.conf +cp $REL_PATH/csql.conf /tmp +export CSQL_CONFIG_FILE=/tmp/csql.conf +echo DSN=$DSN >>$CSQL_CONFIG_FILE +DS="$DSN $DBUSER $PASSWORD" +rm -f /tmp/csql/csqlds.conf +touch /tmp/csql/csqlds.conf +$CSQL_INSTALL_ROOT/bin/csqlds -U $DBUSER -P $PASSWORD -D $DSN -N $TDB -a +if [ $? -ne 0 ] +then + exit 1; +fi +if [ $DSN = "db2" ] +then + isql $DS < ${REL_PATH}/create1db2.sql >/dev/null 2>&1 +else + isql $DS < ${REL_PATH}/create1.sql >/dev/null 2>&1 +fi +if [ $? -ne 0 ] +then + exit 1; +fi +echo table t4 is created with records in target db +$CSQL_INSTALL_ROOT/bin/csqlserver >/dev/null 2>&1 & +pid=$! +sleep 5 + +rm -f /tmp/csql/csqltable.conf +touch /tmp/csql/csqltable.conf + +echo "1 t4 NULL NULL NULL $DSN" >> /tmp/csql/csqltable.conf + +$CSQL_INSTALL_ROOT/bin/cachetable -R +if [ $? -ne 0 ] +then + isql $DS < ${REL_PATH}/drop1.sql >/dev/null 2>&1 + rm -f /tmp/csql/csqltable.conf + touch /tmp/csql/csqltable.conf + kill -9 $pid + ipcrm -M 4000 -M 4500 + exit 2 +fi + +$CSQL_INSTALL_ROOT/bin/catalog -u root -p manager -l +if [ $? -ne 0 ] +then + isql $DS < ${REL_PATH}/drop1.sql >/dev/null 2>&1 + rm -f /tmp/csql/csqltable.conf + touch /tmp/csql/csqltable.conf + kill -9 $pid + ipcrm -M 4000 -M 4500 + exit 3 +fi + +$CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/insert1.sql + +if [ $? -ne 0 ] +then + isql $DS < ${REL_PATH}/drop1.sql >/dev/null 2>&1 + rm -f /tmp/csql/csqltable.conf + touch /tmp/csql/csqltable.conf + kill -9 $pid + ipcrm -M 4000 -M 4500 + exit 4 +fi + +$CSQL_INSTALL_ROOT/bin/cachetable -U root -P manager -t t4 -u +isql $DS < ${REL_PATH}/drop1.sql >/dev/null 2>&1 +rm -f /tmp/csql/csqltable.conf +touch /tmp/csql/csqltable.conf +kill -9 $pid +ipcrm -M 4000 -M 4500 +exit 0; + diff --git a/test/cache/CacheTable/test022.ksh b/test/cache/CacheTable/test022.ksh new file mode 100755 index 00000000..4c32815b --- /dev/null +++ b/test/cache/CacheTable/test022.ksh @@ -0,0 +1,91 @@ +#!/bin/ksh +# Test Case + +# Create table t5 with f1 int unique and f2 int,primary key (f2) in target database +# Cache it with cachetable tool. +# Check with catalog -D chunk tool whether index is created for both primary as well as unique. +# Insert some records in CSQL which violate unique key. It should fail. + +input=${PWD}/cache/CacheTable/createt5.sql +REL_PATH=. +if [ -s "$input" ] +then + REL_PATH=${PWD}/cache/CacheTable +fi +rm -f /tmp/csql.conf +cp $REL_PATH/csql.conf /tmp +export CSQL_CONFIG_FILE=/tmp/csql.conf +echo DSN=$DSN >>$CSQL_CONFIG_FILE +DS="$DSN $DBUSER $PASSWORD" +rm -f /tmp/csql/csqlds.conf +touch /tmp/csql/csqlds.conf +$CSQL_INSTALL_ROOT/bin/csqlds -U $DBUSER -P $PASSWORD -D $DSN -N $TDB -a +if [ $? -ne 0 ] +then + exit 1; +fi + +if [ $DSN = "oracle" ] +then + isql $DS < ${REL_PATH}/createt5.oracle >/dev/null 2>&1 +elif [ $DSN = "db2" ] +then + isql $DS < ${REL_PATH}/createt5db2.sql >/dev/null 2>&1 +else + isql $DS < ${REL_PATH}/createt5.sql >/dev/null 2>&1 +fi +if [ $? -ne 0 ] +then + exit 1; +fi +echo table t5 is created with records in target db + +rm -f /tmp/csql/csqltable.conf +touch /tmp/csql/csqltable.conf +$CSQL_INSTALL_ROOT/bin/csqlserver >/dev/null 2>&1 & +pid=$! +sleep 5 +echo "1 t5 NULL NULL NULL $DSN" >> /tmp/csql/csqltable.conf +echo "1 t6 NULL NULL NULL $DSN" >> /tmp/csql/csqltable.conf + +$CSQL_INSTALL_ROOT/bin/cachetable -R +if [ $? -ne 0 ] +then + kill -9 $pid + ipcrm -M 4000 -M 4500 + exit 1; +fi + +#$CSQL_INSTALL_ROOT/bin/csqldump + +$CSQL_INSTALL_ROOT/bin/catalog -u root -p manager -l +if [ $? -ne 0 ] +then + $CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/drop5.sql > /dev/null 2>&1 + rm -f /tmp/csql/csqltable.conf + touch /tmp/csql/csqltable.conf + kill -9 $pid + ipcrm -M 4000 -M 4500 + exit 2; +fi + +$CSQL_INSTALL_ROOT/bin/catalog -u root -p manager -l +if [ $? -ne 0 ] +then + $CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/drop5.sql > /dev/null 2>&1 + rm -f /tmp/csql/csqltable.conf + touch /tmp/csql/csqltable.conf + kill -9 $pid + ipcrm -M 4000 -M 4500 + exit 3; +fi +$CSQL_INSTALL_ROOT/bin/cachetable -U root -P manager -t t5 -u +$CSQL_INSTALL_ROOT/bin/cachetable -U root -P manager -t t6 -u +isql $DS < ${REL_PATH}/drop5.sql >/dev/null 2>&1 +$CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/drop5.sql > /dev/null 2>&1 +rm -f /tmp/csql/csqltable.conf +touch /tmp/csql/csqltable.conf +kill -9 $pid +ipcrm -M 4000 -M 4500 +exit 0; + diff --git a/test/cache/CacheTable/test023.ksh b/test/cache/CacheTable/test023.ksh new file mode 100755 index 00000000..7e488cf4 --- /dev/null +++ b/test/cache/CacheTable/test023.ksh @@ -0,0 +1,65 @@ +#!/bin/ksh +# Test Case +#23. create table 't1' with 5 fields in Target DB with records. +# Load the table 't1' in field mode in csql without condition. +# Example : select f1,f2,f3 from t1 ; +# Select * on CSQL should display values for f1,f2 and f3 + +#Author : Jitendra Lenka +input=${PWD}/cache/CacheTable/csql.conf +REL_PATH=. +if [ -s "$input" ] +then + REL_PATH=${PWD}/cache/CacheTable +fi +rm -f /tmp/csql.conf +cp $REL_PATH/csql.conf /tmp +export CSQL_CONFIG_FILE=/tmp/csql.conf +echo DSN=$DSN >>$CSQL_CONFIG_FILE +DS="$DSN $DBUSER $PASSWORD" +rm -f /tmp/csql/csqlds.conf +touch /tmp/csql/csqlds.conf +$CSQL_INSTALL_ROOT/bin/csqlds -U $DBUSER -P $PASSWORD -D $DSN -N $TDB -a +if [ $? -ne 0 ] +then + exit 1; +fi + +isql $DS < ${REL_PATH}/fmodeinsert.sql >/dev/null 2>&1 +if [ $? -ne 0 ] +then + exit 1; +fi + +echo Table t1 created with 5 records in target DB. + +rm -f /tmp/csql/csqltable.conf +touch /tmp/csql/csqltable.conf + +# cache from target to csql with -f option. +echo "cachetable -t t1 -f \"f1,f2,f3\" " +$CSQL_INSTALL_ROOT/bin/csqlserver >/dev/null 2>&1 & +pid=$! +sleep 5 + +$CSQL_INSTALL_ROOT/bin/cachetable -t t1 -f "f1,f2,f3" +if [ $? -ne 0 ] +then + rm -f /tmp/csql/csqltable.conf + touch /tmp/csql/csqltable.conf + kill -9 $pid + isql $DS < ${REL_PATH}/drop.sql >/dev/null 2>&1 + exit 2; +fi + +echo "select * from t1;" + +$CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/selectt1.sql +rm -f /tmp/csql/csqltable.conf +touch /tmp/csql/csqltable.conf + +isql $DS < ${REL_PATH}/drop.sql >/dev/null 2>&1 +kill -9 $pid +ipcrm -M 4000 -M 4500 + +exit 0; diff --git a/test/cache/CacheTable/test024.ksh b/test/cache/CacheTable/test024.ksh new file mode 100755 index 00000000..d601bd48 --- /dev/null +++ b/test/cache/CacheTable/test024.ksh @@ -0,0 +1,70 @@ +#!/bin/ksh +#Test Case 24 +# create table t1 and t2 in target db with 10 records +# load t1 table in csql with condition option and without field mode option. +# load table t2 with condition and field mode option. +# select from t2 table in CSQL and verify it displays only specified field +# values which satisfies the condition. + +#Author : Jitendra Lenka + +input=${PWD}/cache/CacheTable/ +REL_PATH=. +if [ -s "$input" ] +then + REL_PATH=${PWD}/cache/CacheTable +fi +rm -f /tmp/csql.conf +cp $CSQL_CONFIG_FILE /tmp +export CSQL_CONFIG_FILE=/tmp/csql.conf +echo CACHE_TABLE=true >>$CSQL_CONFIG_FILE +echo DSN=$DSN >>$CSQL_CONFIG_FILE +DS="$DSN $DBUSER $PASSWORD" +rm -f /tmp/csql/csqlds.conf +touch /tmp/csql/csqlds.conf +$CSQL_INSTALL_ROOT/bin/csqlds -U $DBUSER -P $PASSWORD -D $DSN -N $TDB -a +if [ $? -ne 0 ] +then + exit 1; +fi + +isql $DS < ${REL_PATH}/fmodecreate.sql >/dev/null 2>&1 +if [ $? -ne 0 ] +then + exit 1; +fi +echo Table t1 and t2 created in target DB. +rm -f /tmp/csql/csqltable.conf +touch /tmp/csql/csqltable.conf + +echo "cachetable -t t1 -c \"t1f1<5\" " +echo "cachetable -t t2 -c \"t2f1>15\" -f \"t2f1,t2f3,t2f5\" " + +$CSQL_INSTALL_ROOT/bin/cachetable -t t1 -c "t1f1<5" >/dev/null 2>&1 + if [ $? -ne 0 ] + then + isql $DS < ${REL_PATH}/dropt1t2.sql >/dev/null 2>&1 + rm -f /tmp/csql/csqltable.conf + touch /tmp/csql/csqltable.conf + exit 2; + fi + + $CSQL_INSTALL_ROOT/bin/cachetable -t t2 -c "t2f1>15" -f "t2f1,t2f3,t2f5" + if [ $? -ne 0 ] + then + rm -f /tmp/csql/csqltable.conf + touch /tmp/csql/csqltable.conf + $CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/drop.sql >/dev/null 2>&1 + isql $DS < ${REL_PATH}/drop.sql >/dev/null 2>&1 + exit 3; + fi + +echo "select query on t1 and t2 table" +$CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/selectstar.sql + +rm -f /tmp/csql/csqltable.conf +touch /tmp/csql/csqltable.conf + +$CSQL_INSTALL_ROOT/bin/csql -s ${REL_PATH}/dropt1t2.sql > /dev/null 2>&1 +isql $DS <${REL_PATH}/dropt1t2.sql >/dev/null 2>&1 +exit 0; diff --git a/test/cache/CacheTable/test025.ksh b/test/cache/CacheTable/test025.ksh new file mode 100755 index 00000000..9e272030 --- /dev/null +++ b/test/cache/CacheTable/test025.ksh @@ -0,0 +1,92 @@ +#!/bin/ksh +#Test case 25. +# Create table t1 in target database. +# load t1 table with condition and field mode option. +# unload the t1 table with -u option. + +#AUTHOR : Jitendra Lenka + +input=${PWD}/cache/CacheTable/inputtest4.sql +REL_PATH=. + +if [ -s "$input" ] +then + REL_PATH=${PWD}/cache/CacheTable +fi +rm -f /tmp/csql.conf +cp $CSQL_CONFIG_FILE /tmp +export CSQL_CONFIG_FILE=/tmp/csql.conf + +# create table t1 in target DB. +echo CACHE_TABLE=true >>$CSQL_CONFIG_FILE +echo DSN=$DSN >>$CSQL_CONFIG_FILE +DS="$DSN $DBUSER $PASSWORD" +rm -f /tmp/csql/csqlds.conf +touch /tmp/csql/csqlds.conf +$CSQL_INSTALL_ROOT/bin/csqlds -U $DBUSER -P $PASSWORD -D $DSN -N $TDB -a +if [ $? -ne 0 ] +then + exit 1; +fi + +isql $DS < ${REL_PATH}/fmodeinsert.sql >/dev/null 2>&1 +if [ $? -ne 0 ] +then + exit 1; +fi + +echo Table t1 created in target DB. + +rm -f /tmp/csql/csqltable.conf +touch /tmp/csql/csqltable.conf + +echo "cachetable -t t1 -c \"f1<3\" -f \"f1,f3,f5\"" +$CSQL_INSTALL_ROOT/bin/cachetable -t t1 -c "f1<3" -f "f1,f3,f5" >/dev/null 2>&1 +if [ $? -ne 0 ] +then + isql $DS < ${REL_PATH}/drop.sql >/dev/null 2>&1 + rm -f /tmp/csql/csqltable.conf + + exit 2; +fi + +echo "select from t1 table" + +$CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/selectt1.sql + if [ $? -ne 0 ] + then + rm -f /tmp/csql/csqltable.conf + touch /tmp/csql/csqltable.conf + + $CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/drop.sql >/dev/null 2>&1 + isql $DS < ${REL_PATH}/drop.sql >/dev/null 2>&1 + + exit 4; +fi + + +$CSQL_INSTALL_ROOT/bin/cachetable -t t1 -u >/dev/null 2>&1 + if [ $? -ne 0 ] + then + rm -f /tmp/csql/csqltable.conf + touch /tmp/csql/csqltable.conf + + $CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/drop.sql >/dev/null 2>&1 + isql $DS < ${REL_PATH}/drop.sql >/dev/null 2>&1 + + exit 4; +fi + +echo "Table t1 unloaded from CSQL" + + +rm -f /tmp/csql/csqltable.conf +touch /tmp/csql/csqltable.conf + +$CSQL_INSTALL_ROOT/bin/csql -s ${REL_PATH}/drop.sql > /dev/null 2>&1 +isql $DS <${REL_PATH}/drop.sql >/dev/null 2>&1 + exit 0; + + + + diff --git a/test/cache/CacheTable/test026.ksh b/test/cache/CacheTable/test026.ksh new file mode 100755 index 00000000..91aab368 --- /dev/null +++ b/test/cache/CacheTable/test026.ksh @@ -0,0 +1,67 @@ +#!/bin/ksh +#Test case 26. +# create table t1 and t2in target DB with 10 records. +# Recover the two tables from target db with -R option. +# The contains in the csqltable.conf file will be like this : +# 1:t1 NULL NULL +# 2:t2 t2f1<15 t2f1,t2f3,t2f5 + +#AUTHOR : Jitendra Lenka +input=${PWD}/cache/CacheTable/ +REL_PATH=. +if [ -s "$input" ] + then + REL_PATH=${PWD}/cache/CacheTable +fi +rm -f /tmp/csql.conf +cp $CSQL_CONFIG_FILE /tmp +export CSQL_CONFIG_FILE=/tmp/csql.conf + +# create table t1,t2 in target DB. +echo CACHE_TABLE=true >>$CSQL_CONFIG_FILE +echo DSN=$DSN >>$CSQL_CONFIG_FILE +DS="$DSN $DBUSER $PASSWORD" +rm -f /tmp/csql/csqlds.conf +touch /tmp/csql/csqlds.conf +$CSQL_INSTALL_ROOT/bin/csqlds -U $DBUSER -P $PASSWORD -D $DSN -N $TDB -a +if [ $? -ne 0 ] +then + exit 1; +fi + +isql $DS < ${REL_PATH}/fmodecreate.sql >/dev/null 2>&1 +if [ $? -ne 0 ] +then + exit 1; +fi + +echo Table t1 and t2 created in target DB. + +rm -f /tmp/csql/csqltable.conf +touch /tmp/csql/csqltable.conf + +echo "1 t1 NULL NULL NULL $DSN" >/tmp/csql/csqltable.conf +echo "2 t2 NULL t2f1<15 t2f1,t2f3,t2f5 $DSN" >>/tmp/csql/csqltable.conf + +# caching with -R option +$CSQL_INSTALL_ROOT/bin/cachetable -R +if [ $? -ne 0 ] + then exit 2; +fi + +$CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/selectstar.sql +if [ $? -ne 0 ] + then + $CSQL_INSTALL_ROOT/bin/csql -s ${REL_PATH}/dropt1t2.sql > /dev/null 2>&1 + isql $DS < ${REL_PATH}/dropt1t2.sql >/dev/null 2>&1 + rm -f /tmp/csql/csqltable.conf + touch /tmp/csql/csqltable.conf + exit 3; +fi + +rm -f /tmp/csql/csqltable.conf +touch /tmp/csql/csqltable.conf +$CSQL_INSTALL_ROOT/bin/csql -s ${REL_PATH}/dropt1t2.sql > /dev/null 2>&1 +isql $DS < ${REL_PATH}/dropt1t2.sql >/dev/null 2>&1 + +exit 0; diff --git a/test/cache/CacheTable/test027.ksh b/test/cache/CacheTable/test027.ksh new file mode 100755 index 00000000..a99fc391 --- /dev/null +++ b/test/cache/CacheTable/test027.ksh @@ -0,0 +1,82 @@ +#!/bin/ksh +#Test case 27. +# create t1 table with some records in target DB. +# cache it with -c and -f option +# Insert some records which satisfy the cache condition +# Insert some records which do not satisfy the cache condition +# Reload table with -r option +# It should get all records which satisfy the condition for specified fields + +# AUTHOR : Jitendra Lenka + +input=${PWD}/cache/CacheTable/ +REL_PATH=. +if [ -s "$input" ] + then + REL_PATH=${PWD}/cache/CacheTable +fi +rm -f /tmp/csql.conf +cp $CSQL_CONFIG_FILE /tmp +export CSQL_CONFIG_FILE=/tmp/csql.conf +echo CACHE_TABLE=true >>$CSQL_CONFIG_FILE +echo DSN=$DSN >>$CSQL_CONFIG_FILE +DS="$DSN $DBUSER $PASSWORD" +rm -f /tmp/csql/csqlds.conf +touch /tmp/csql/csqlds.conf +$CSQL_INSTALL_ROOT/bin/csqlds -U $DBUSER -P $PASSWORD -D $DSN -N $TDB -a +if [ $? -ne 0 ] +then + exit 1; +fi +isql $DS < ${REL_PATH}/fmodeinsert.sql >/dev/null 2>&1 +if [ $? -ne 0 ] + then + exit 1; +fi + +rm -f /tmp/csql/csqltable.conf +touch /tmp/csql/csqltable.conf + +$CSQL_INSTALL_ROOT/bin/cachetable -t t1 -c "f1=1" -f "f1,f3,f5" +if [ $? -ne 0 ] +then + rm -f /tmp/csql/csqltable.conf + touch /tmp/csql/csqltable.conf + + $CSQL_INSTALL_ROOT/bin/csql -s ${REL_PATH}/drop.sql > /dev/null 2>&1 + isql $DS < ${REL_PATH}/drop.sql >/dev/null 2>&1 + exit 2; +fi + +isql $DS < ${REL_PATH}/frecords.sql >/dev/null 2>&1 + +# again reload table with -r option. +$CSQL_INSTALL_ROOT/bin/cachetable -t t1 -r >/dev/null 2>&1 +if [ $? -ne 0 ] +then + rm -f /tmp/csql/csqltable.conf + touch /tmp/csql/csqltable.conf + + $CSQL_INSTALL_ROOT/bin/csql -s ${REL_PATH}/drop.sql > /dev/null 2>&1 + isql $DS < ${REL_PATH}/drop.sql >/dev/null 2>&1 + exit 3; +fi + +#after reload, select from t1 +echo "after reload , select * from t1;" +$CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/selectt1.sql +if [ $? -ne 0 ] + then + rm -f /tmp/csql/csqltable.conf + touch /tmp/csql/csqltable.conf + + $CSQL_INSTALL_ROOT/bin/csql -s ${REL_PATH}/drop.sql > /dev/null 2>&1 + isql $DS < ${REL_PATH}/drop.sql >/dev/null 2>&1 + exit 5; +fi + +rm -f /tmp/csql/csqltable.conf +touch /tmp/csql/csqltable.conf +$CSQL_INSTALL_ROOT/bin/csql -s ${REL_PATH}/drop.sql > /dev/null 2>&1 +isql $DS < ${REL_PATH}/drop.sql >/dev/null 2>&1 +exit 0; diff --git a/test/cache/CacheTable/test028.ksh b/test/cache/CacheTable/test028.ksh new file mode 100755 index 00000000..bd81ca04 --- /dev/null +++ b/test/cache/CacheTable/test028.ksh @@ -0,0 +1,76 @@ +#!/bin/ksh +#Test case 28. +# create table t1 with records in target DB. +# create a table with the same schema in csql . +# load with -s option. it should pass. + +#AUTHOR : Jitendra Lenka + +input=${PWD}/cache/CacheTable/ +REL_PATH=. +if [ -s "$input" ] +then +REL_PATH=${PWD}/cache/CacheTable +fi +rm -f /tmp/csql.conf +cp $CSQL_CONFIG_FILE /tmp +export CSQL_CONFIG_FILE=/tmp/csql.conf +echo CACHE_TABLE=true >>$CSQL_CONFIG_FILE +echo DSN=$DSN >>$CSQL_CONFIG_FILE +DS="$DSN $DBUSER $PASSWORD" +rm -f /tmp/csql/csqlds.conf +touch /tmp/csql/csqlds.conf +$CSQL_INSTALL_ROOT/bin/csqlds -U $DBUSER -P $PASSWORD -D $DSN -N $TDB -a +if [ $? -ne 0 ] +then + exit 1; +fi + +isql $DS < ${REL_PATH}/fmodeinsert.sql >/dev/null 2>&1 +if [ "$DSN" = "oracle" ] +then +$CSQL_INSTALL_ROOT/bin/csql -s ${REL_PATH}/fcsqlinputoracle.sql > /dev/null 2>&1 +else +$CSQL_INSTALL_ROOT/bin/csql -s ${REL_PATH}/fcsqlinput.sql > /dev/null 2>&1 +fi +if [ $? -ne 0 ] +then + isql $DS < ${REL_PATH}/drop.sql >/dev/null 2>&1 + rm -f /tmp/csql/csqltable.conf + touch /tmp/csql/csqltable.conf + exit 1; +fi + +rm -f /tmp/csql/csqltable.conf +touch /tmp/csql/csqltable.conf + +# caching with -s option +$CSQL_INSTALL_ROOT/bin/cachetable -t t1 -s >/dev/null 2>&1 +if [ $? -ne 0 ] +then + rm -f /tmp/csql/csqltable.conf + touch /tmp/csql/csqltable.conf + $CSQL_INSTALL_ROOT/bin/csql -s ${REL_PATH}/drop.sql > /dev/null 2>&1 + isql $DS < ${REL_PATH}/drop.sql >/dev/null 2>&1 + exit 3; +fi + +echo "select * from t1;" +$CSQL_INSTALL_ROOT/bin/csql -s ${REL_PATH}/selectt1.sql +if [ $? -ne 0 ] +then + rm -f /tmp/csql/csqltable.conf + touch /tmp/csql/csqltable.conf + $CSQL_INSTALL_ROOT/bin/csql -s ${REL_PATH}/drop.sql > /dev/null 2>&1 + isql $DS < ${REL_PATH}/drop.sql >/dev/null 2>&1 + exit 4; +fi + +rm -f /tmp/csql/csqltable.conf +touch /tmp/csql/csqltable.conf + + +$CSQL_INSTALL_ROOT/bin/csql -s ${REL_PATH}/drop.sql > /dev/null 2>&1 +isql $DS < ${REL_PATH}/drop.sql >/dev/null 2>&1 +exit 0; + diff --git a/test/cache/CacheTable/test029.ksh b/test/cache/CacheTable/test029.ksh new file mode 100755 index 00000000..de9be787 --- /dev/null +++ b/test/cache/CacheTable/test029.ksh @@ -0,0 +1,134 @@ +#!/bin/ksh +#Test Case +# Create table t5 and t6 in target DB +# Load t5 and t6 table without condition option with direct option +# Insert some record in CSQL tool as csql -g option +# It should insert into target database not in CSQL database + + +input=${PWD}/cache/CacheTable/inputtest4.sql +REL_PATH=. +if [ -s "$input" ] +then + REL_PATH=${PWD}/cache/CacheTable +fi +rm -f /tmp/csql.conf +cp $CSQL_CONFIG_FILE /tmp +export CSQL_CONFIG_FILE=/tmp/csql.conf + +# create table t1,t2 in target DB. +echo CACHE_TABLE=true >>$CSQL_CONFIG_FILE +echo DSN=$DSN >>$CSQL_CONFIG_FILE +DS="$DSN $DBUSER $PASSWORD" +rm -f /tmp/csql/csqlds.conf +touch /tmp/csql/csqlds.conf +$CSQL_INSTALL_ROOT/bin/csqlds -U $DBUSER -P $PASSWORD -D $DSN -N $TDB -a +if [ $? -ne 0 ] +then + exit 1; +fi +if [ $DSN = "db2" ] +then + isql $DS < ${REL_PATH}/createt5db2.sql >/dev/null 2>&1 +else + isql $DS < ${REL_PATH}/createt5.sql >/dev/null 2>&1 +fi +if [ $? -ne 0 ] +then + exit 2; +fi + +echo Table t1 and t2 created in target DB. + +rm -f /tmp/csql/csqltable.conf +touch /tmp/csql/csqltable.conf + +echo "cachetable -t t5 -D" +echo "cachetable -t t6 -D" + +$CSQL_INSTALL_ROOT/bin/cachetable -t t5 -D +if [ $? -ne 0 ] +then + isql $DS < ${REL_PATH}/drop5.sql >/dev/null 2>&1 + rm -f /tmp/csql/csqltable.conf + touch /tmp/csql/csqltable.conf + exit 3; +fi + +$CSQL_INSTALL_ROOT/bin/cachetable -t t6 -D +if [ $? -ne 0 ] +then + rm -f /tmp/csql/csqltable.conf + touch /tmp/csql/csqltable.conf + $CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/drop5.sql >/dev/null 2>&1 + isql $DS < ${REL_PATH}/drop5.sql >/dev/null 2>&1 + exit 4; +fi + +for a in 5 6 +do +echo "insert into t$a values(15,20);" +echo "insert into t$a values(16,21);" +done>>${REL_PATH}/insertt5t6.sql + +echo "select query on t1 and t2 table" +$CSQL_INSTALL_ROOT/bin/csql -g -s $REL_PATH/insertt5t6.sql +if [ $? -ne 0 ] +then + rm -f /tmp/csql/csqltable.conf + touch /tmp/csql/csqltable.conf + $CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/drop5.sql >/dev/null 2>&1 + isql $DS < ${REL_PATH}/drop5.sql >/dev/null 2>&1 + rm -f $REL_PATH/insertt5t6.sql + exit 5; +fi +for a in 5 6 +do +echo "select * from t$a;" +done>>${REL_PATH}/selectt5t6.sql + +$CSQL_INSTALL_ROOT/bin/csql -g -s $REL_PATH/selectt5t6.sql +if [ $? -ne 0 ] +then + rm -f /tmp/csql/csqltable.conf + touch /tmp/csql/csqltable.conf + $CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/drop5.sql >/dev/null 2>&1 + isql $DS < ${REL_PATH}/drop5.sql >/dev/null 2>&1 + rm -f $REL_PATH/insertt5t6.sql + rm -f $REL_PATH/selectt5t6.sql + exit 6; +fi +isql $DS < ${REL_PATH}/selectt5t6.sql +$CSQL_INSTALL_ROOT/bin/cachetable -t t6 -u +if [ $? -ne 0 ] +then + rm -f /tmp/csql/csqltable.conf + touch /tmp/csql/csqltable.conf + $CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/drop5.sql >/dev/null 2>&1 + isql $DS < ${REL_PATH}/drop5.sql >/dev/null 2>&1 + rm -f $REL_PATH/insertt5t6.sql + rm -f $REL_PATH/selectt5t6.sql + exit 7; +fi +$CSQL_INSTALL_ROOT/bin/cachetable -t t5 -u +if [ $? -ne 0 ] +then + rm -f /tmp/csql/csqltable.conf + touch /tmp/csql/csqltable.conf + $CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/drop5.sql >/dev/null 2>&1 + isql $DS < ${REL_PATH}/drop5.sql >/dev/null 2>&1 + rm -f $REL_PATH/insertt5t6.sql + rm -f $REL_PATH/selectt5t6.sql + exit 8; +fi + +rm -f /tmp/csql/csqltable.conf +touch /tmp/csql/csqltable.conf + +$CSQL_INSTALL_ROOT/bin/csql -s ${REL_PATH}/drop5.sql > /dev/null 2>&1 +isql $DS <${REL_PATH}/drop5.sql >/dev/null 2>&1 +rm -f $REL_PATH/insertt5t6.sql +rm -f $REL_PATH/selectt5t6.sql + +exit 0; + diff --git a/test/cache/CacheTable/test030.ksh b/test/cache/CacheTable/test030.ksh new file mode 100755 index 00000000..5859a468 --- /dev/null +++ b/test/cache/CacheTable/test030.ksh @@ -0,0 +1,146 @@ +#!/bin/ksh +#Test Case +# Create table t5 and t6 in target DB +# Load t5 and t6 table with condition option and direct option +# Insert some record in CSQL tool with csql -g option +# It should insert into target database not in CSQL database + + +input=${PWD}/cache/CacheTable/inputtest4.sql +REL_PATH=. +if [ -s "$input" ] +then + REL_PATH=${PWD}/cache/CacheTable +fi +rm -f /tmp/csql.conf +cp $CSQL_CONFIG_FILE /tmp +export CSQL_CONFIG_FILE=/tmp/csql.conf +echo CACHE_TABLE=true >>$CSQL_CONFIG_FILE +echo DSN=$DSN >>$CSQL_CONFIG_FILE +DS="$DSN $DBUSER $PASSWORD" +rm -f /tmp/csql/csqlds.conf +touch /tmp/csql/csqlds.conf +$CSQL_INSTALL_ROOT/bin/csqlds -U $DBUSER -P $PASSWORD -D $DSN -N $TDB -a +if [ $? -ne 0 ] +then + exit 1; +fi + +# create table t5,t6 in target DB. + +if [ $DSN = "db2" ] +then + isql $DS < ${REL_PATH}/createt5db2.sql >/dev/null 2>&1 +else + isql $DS < ${REL_PATH}/createt5.sql >/dev/null 2>&1 +fi +if [ $? -ne 0 ] +then + exit 2; +fi +echo Table t5 and t6 created in target DB. + +rm -f /tmp/csql/csqltable.conf +touch /tmp/csql/csqltable.conf + +for a in 5 6 7 8 9 10 11 12 13 14 15 +do +echo "insert into t5 values($a,$a+1);" +echo "insert into t6 values($a,$a+1);" +done>>${REL_PATH}/inserttarget.sql +isql $DS < ${REL_PATH}/inserttarget.sql >/dev/null 2>&1 + +echo "cachetable -t t5 -D -c \"f1>=10\"" +echo "cachetable -t t6 -D -c \"f1>=10\" " + +$CSQL_INSTALL_ROOT/bin/cachetable -t t5 -D -c "f1>=10" +if [ $? -ne 0 ] +then + isql $DS < ${REL_PATH}/drop5.sql >/dev/null 2>&1 + rm -f /tmp/csql/csqltable.conf + touch /tmp/csql/csqltable.conf + exit 3; +fi + +$CSQL_INSTALL_ROOT/bin/cachetable -t t6 -D -c "f1>=10" +if [ $? -ne 0 ] +then + rm -f /tmp/csql/csqltable.conf + touch /tmp/csql/csqltable.conf + $CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/drop5.sql >/dev/null 2>&1 + isql $DS < ${REL_PATH}/drop5.sql >/dev/null 2>&1 + rm -f ${REL_PATH}/inserttarget.sql + exit 4; +fi + +for a in 5 6 +do +echo "insert into t$a values(16,20);" +echo "insert into t$a values(15,21);" +done>>${REL_PATH}/insertt5t6.sql + +echo "select query on t1 and t2 table" +$CSQL_INSTALL_ROOT/bin/csql -g -s $REL_PATH/insertt5t6.sql +if [ $? -ne 0 ] +then + rm -f /tmp/csql/csqltable.conf + touch /tmp/csql/csqltable.conf + $CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/drop5.sql >/dev/null 2>&1 + isql $DS < ${REL_PATH}/drop5.sql >/dev/null 2>&1 + rm -f $REL_PATH/insertt5t6.sql + rm -f ${REL_PATH}/inserttarget.sql + exit 5; +fi +for a in 5 6 +do +echo "select * from t$a;" +done>>${REL_PATH}/selectt5t6.sql + +$CSQL_INSTALL_ROOT/bin/csql -g -s $REL_PATH/selectt5t6.sql +if [ $? -ne 0 ] +then + rm -f /tmp/csql/csqltable.conf + touch /tmp/csql/csqltable.conf + $CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/drop5.sql >/dev/null 2>&1 + isql $DS < ${REL_PATH}/drop5.sql >/dev/null 2>&1 + rm -f $REL_PATH/insertt5t6.sql + rm -f $REL_PATH/selectt5t6.sql + rm -f ${REL_PATH}/inserttarget.sql + exit 6; +fi +isql $DS < ${REL_PATH}/selectt5t6.sql +$CSQL_INSTALL_ROOT/bin/cachetable -t t6 -u +if [ $? -ne 0 ] +then + rm -f /tmp/csql/csqltable.conf + touch /tmp/csql/csqltable.conf + $CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/drop5.sql >/dev/null 2>&1 + isql $DS < ${REL_PATH}/drop5.sql >/dev/null 2>&1 + rm -f $REL_PATH/insertt5t6.sql + rm -f $REL_PATH/selectt5t6.sql + rm -f ${REL_PATH}/inserttarget.sql + exit 7; +fi +$CSQL_INSTALL_ROOT/bin/cachetable -t t5 -u +if [ $? -ne 0 ] +then + rm -f /tmp/csql/csqltable.conf + touch /tmp/csql/csqltable.conf + $CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/drop5.sql >/dev/null 2>&1 + isql $DS < ${REL_PATH}/drop5.sql >/dev/null 2>&1 + rm -f $REL_PATH/insertt5t6.sql + rm -f $REL_PATH/selectt5t6.sql + rm -f ${REL_PATH}/inserttarget.sql + exit 8; +fi + +#rm -f /tmp/csql/csqltable.conf +#touch /tmp/csql/csqltable.conf + +$CSQL_INSTALL_ROOT/bin/csql -s ${REL_PATH}/drop5.sql > /dev/null 2>&1 +isql $DS <${REL_PATH}/drop5.sql >/dev/null 2>&1 +rm -f $REL_PATH/insertt5t6.sql +rm -f $REL_PATH/selectt5t6.sql +rm -f ${REL_PATH}/inserttarget.sql +exit 0; + diff --git a/test/cache/CacheTable/test032.ksh b/test/cache/CacheTable/test032.ksh new file mode 100755 index 00000000..83d174e2 --- /dev/null +++ b/test/cache/CacheTable/test032.ksh @@ -0,0 +1,101 @@ +#!/bin/ksh + +# Create 't1' table with f1 int, f2 char(10) ,primarykey(f1) +# Insert some records with null values +# Cache t1 from target to csql. +# Select from CSQL cache node .It should give actual data as in target database +# it should be unloaded by -u option + +input=${PWD}/cache/CacheTable/inputtest4.sql +REL_PATH=. +if [ -s "$input" ] +then + REL_PATH=${PWD}/cache/CacheTable +fi + +if [ "$DSN" = "sybase" ] +then + echo "create table t1 (f1 int,f2 char(10) NULL,primary key(f1));" >${REL_PATH}/t1create.sql +elif [ "$DSN" = "db2" ] +then + echo "create table t1 (f1 int NOT NULL,f2 char(10),primary key(f1));" >${REL_PATH}/t1create.sql +else + echo "create table t1 (f1 int,f2 char(10) ,primary key(f1));" >${REL_PATH}/t1create.sql +fi + + +for a in 1 2 3 4 5 +do +echo "insert into t1 values($a,'INDIA$a');" +echo "insert into t1 values($a+10 , NULL);" +done>>${REL_PATH}/t1create.sql +echo "t1create.sql file created" +echo "select * from t1;">${REL_PATH}/sel.sql +echo "select file created" +rm -f /tmp/csql.conf +cp $CSQL_CONFIG_FILE /tmp +export CSQL_CONFIG_FILE=/tmp/csql.conf +echo CACHE_TABLE=true >>$CSQL_CONFIG_FILE +echo DSN=$DSN >>$CSQL_CONFIG_FILE +DS="$DSN $DBUSER $PASSWORD" +rm -f /tmp/csql/csqlds.conf +touch /tmp/csql/csqlds.conf +$CSQL_INSTALL_ROOT/bin/csqlds -U $DBUSER -P $PASSWORD -D $DSN -N $TDB -a +if [ $? -ne 0 ] +then + exit 1; +fi + +isql $DS < ${REL_PATH}/t1create.sql >/dev/null 2>&1 +if [ $? -ne 0 ] +then + rm -f ${REL_PATH}/sel.sql + rm -f ${REL_PATH}/t1create.sql + exit 1; +fi + +rm -f /tmp/csql/csqltable.conf +touch /tmp/csql/csqltable.conf + +$CSQL_INSTALL_ROOT/bin/cachetable -t t1 >/dev/null 2>&1 +if [ $? -ne 0 ] +then + rm -f ${REL_PATH}/sel.sql + rm -f ${REL_PATH}/t1create.sql + exit 2; +fi +echo "Select * from t1 in CSQL" +$CSQL_INSTALL_ROOT/bin/csql -s ${REL_PATH}/sel.sql +if [ $? -ne 0 ] +then + rm -f ${REL_PATH}/sel.sql + rm -f ${REL_PATH}/t1create.sql + exit 3; +fi + +echo "Checking for table created or not" +$CSQL_INSTALL_ROOT/bin/catalog -u root -p manager -l +if [ $? -ne 0 ] +then + rm -f ${REL_PATH}/sel.sql + rm -f ${REL_PATH}/t1create.sql + exit 4; +fi + +$CSQL_INSTALL_ROOT/bin/cachetable -t t1 -u >/dev/null 2>&1 +if [ $? -ne 0 ] +then + rm -f ${REL_PATH}/sel.sql + rm -f ${REL_PATH}/t1create.sql + exit 5; +fi +echo "cache table 't1' unloaded by -u option" +echo "drop table t1;">${REL_PATH}/dp.sql +$CSQL_INSTALL_ROOT/bin/csql -s ${REL_PATH}/dp.sql >/dev/null 2>&1 +rm -f /tmp/csql/csqltable.conf +touch /tmp/csql/csqltable.conf +isql $DS < ${REL_PATH}/dp.sql >/dev/null 2>&1 +rm -f ${REL_PATH}/dp.sql +rm -f ${REL_PATH}/sel.sql +rm -f ${REL_PATH}/t1create.sql +exit 0; diff --git a/test/cache/CacheTable/test033.ksh b/test/cache/CacheTable/test033.ksh new file mode 100755 index 00000000..eaaeaa1b --- /dev/null +++ b/test/cache/CacheTable/test033.ksh @@ -0,0 +1,68 @@ +#!/bin/ksh +# Test Case + +# Bi-directional cache test +# Create table t1 with field f1 int ,f2 char,f3 smallint , f4 bigint . +# Make bidirectional flag and cache flag true. +# Cache the table .it should fail telling no primary key. + +# Author:=bijaya + + +input=${PWD}/cache/CacheTable/csql1.conf + +REL_PATH=. +if [ -s "$input" ] +then + REL_PATH=${PWD}/cache/CacheTable +fi +export CSQL_CONFIG_FILE=$REL_PATH/csql1.conf +echo DSN=$DSN >>$CSQL_CONFIG_FILE +DS="$DSN $DBUSER $PASSWORD" +rm -f /tmp/csql/csqlds.conf +touch /tmp/csql/csqlds.conf +$CSQL_INSTALL_ROOT/bin/csqlds -U $DBUSER -P $PASSWORD -D $DSN -N $TDB -a +if [ $? -ne 0 ] +then + exit 1; +fi + +echo "create table t1(f1 int ,f2 char(12),f3 smallint , f4 bigint);">$REL_PATH/t1.sql +for a in 1 2 3 4 5 6 7 8 9 +do +echo "insert into t1 values($a,'papu',12,$a+123124);" +done>>t1.sql +isql $DS < $REL_PATH/t1.sql >/dev/null 2>&1 +if [ $? -ne 0 ] +then + echo "unable to creste in target db" + rm -f $REL_PATH/t1.sql + exit 1 +fi + +echo "drop table t1;">${REL_PATH}/dt1.sql +rm -f /tmp/csql/csqltable.conf +touch /tmp/csql/csqltable.conf + +$CSQL_INSTALL_ROOT/bin/csqlserver >/dev/null 2>&1 & +pid=$! +sleep 5 +echo "server started" +$CSQL_INSTALL_ROOT/bin/cachetable -t t1 +if [ $? -eq 0 ] +then + echo "Unable to cache" + isql $DS <${REL_PATH}/dt1.sql >/dev/null 2>&1 + rm -f $REL_PATH/t1.sql ${REL_PATH}/dt1.sql + kill -9 $pid + ipcrm -M 4000 -M 4500 + exit 2 +fi +isql $DS <${REL_PATH}/dt1.sql >/dev/null 2>&1 +rm -f /tmp/csql/csqltable.conf +touch /tmp/csql/csqltable.conf +rm -f $REL_PATH/t1.sql ${REL_PATH}/dt1.sql +kill -9 $pid +ipcrm -M 4000 -M 4500 +exit 0; + diff --git a/test/cache/CacheTable/test034.ksh b/test/cache/CacheTable/test034.ksh new file mode 100755 index 00000000..3ce5a4f0 --- /dev/null +++ b/test/cache/CacheTable/test034.ksh @@ -0,0 +1,67 @@ +#!/bin/ksh +# Test Case + +# Bi-directional cache test +# Create table t1 with field f1 int ,f2 char,f3 smallint, f4 bigint . Make bidirectional flag and cache flag true. Cache the table with -p fieldname it should fail +# Author:=bijaya + + +input=${PWD}/cache/CacheTable/csql1.conf + +REL_PATH=. +if [ -s "$input" ] +then + REL_PATH=${PWD}/cache/CacheTable +fi +rm -f /tmp/csql1.conf +cp $REL_PATH/csql1.conf /tmp +export CSQL_CONFIG_FILE=/tmp/csql1.conf +echo DSN=$DSN >>$CSQL_CONFIG_FILE +DS="$DSN $DBUSER $PASSWORD" +rm -f /tmp/csql/csqlds.conf +touch /tmp/csql/csqlds.conf +$CSQL_INSTALL_ROOT/bin/csqlds -U $DBUSER -P $PASSWORD -D $DSN -N $TDB -a +if [ $? -ne 0 ] +then + exit 1; +fi + +echo "create table t1(f1 int ,f2 char(12),f3 smallint , f4 bigint);">$REL_PATH/t1.sql +for a in 1 2 3 4 5 6 7 8 9 +do +echo "insert into t1 values($a,'papu',12,$a+123124);" +done>>t1.sql +isql $DS < $REL_PATH/t1.sql >/dev/null 2>&1 +if [ $? -ne 0 ] +then + echo "unable to creste in target db" + rm -f $REL_PATH/t1.sql + exit 1 +fi + +echo "drop table t1;">${REL_PATH}/dt1.sql +rm -f /tmp/csql/csqltable.conf +touch /tmp/csql/csqltable.conf + +$CSQL_INSTALL_ROOT/bin/csqlserver >/dev/null 2>&1 & +pid=$! +sleep 5 +echo "server started" +$CSQL_INSTALL_ROOT/bin/cachetable -t t1 -p f1 +if [ $? -eq 0 ] +then + echo "Unable to cache" + isql $DS <${REL_PATH}/dt1.sql >/dev/null 2>&1 + rm -f $REL_PATH/t1.sql ${REL_PATH}/dt1.sql + kill -9 $pid + ipcrm -M 4000 -M 4500 + exit 2 +fi +isql $DS <${REL_PATH}/dt1.sql >/dev/null 2>&1 +rm -f /tmp/csql/csqltable.conf +touch /tmp/csql/csqltable.conf +rm -f $REL_PATH/t1.sql ${REL_PATH}/dt1.sql +kill -9 $pid +ipcrm -M 4000 -M 4500 +exit 0; + diff --git a/test/cache/CacheTable/test035.ksh b/test/cache/CacheTable/test035.ksh new file mode 100755 index 00000000..61f0d412 --- /dev/null +++ b/test/cache/CacheTable/test035.ksh @@ -0,0 +1,69 @@ +#!/bin/ksh +# Test Case + +# Bi-directional cache test +# Create table t1 with field f1 int ,f2 char,f3 smallint , f4 bigint . Make bidirectional flag and cache flag true. Cache the table with -p f5 it should fail + +# Author:=bijaya + + +input=${PWD}/cache/CacheTable/inputtest4.sql +REL_PATH=. +if [ -s "$input" ] +then + REL_PATH=${PWD}/cache/CacheTable +fi +rm -f /tmp/csql1.conf +cp $REL_PATH/csql1.conf /tmp +export CSQL_CONFIG_FILE=/tmp/csql1.conf +echo DSN=$DSN >>$CSQL_CONFIG_FILE +DS="$DSN $DBUSER $PASSWORD" +rm -f /tmp/csql/csqlds.conf +touch /tmp/csql/csqlds.conf +$CSQL_INSTALL_ROOT/bin/csqlds -U $DBUSER -P $PASSWORD -D $DSN -N $TDB -a +if [ $? -ne 0 ] +then + exit 1; +fi + +echo "create table t1(f1 int ,f2 char(12),f3 smallint , f4 bigint);">$REL_PATH/t1.sql +for a in 1 2 3 4 5 6 7 8 9 +do +echo "insert into t1 values($a,'papu',12,$a+123124);" +done>>t1.sql +isql $DS < $REL_PATH/t1.sql >/dev/null 2>&1 +if [ $? -ne 0 ] +then + echo "unable to creste in target db" + rm -f $REL_PATH/t1.sql + exit 1 +fi + +echo "drop table t1;">${REL_PATH}/dt1.sql +rm -f /tmp/csql/csqltable.conf +touch /tmp/csql/csqltable.conf + +$CSQL_INSTALL_ROOT/bin/csqlserver >/dev/null 2>&1 & +pid=$! +sleep 5 +echo "server started" +$CSQL_INSTALL_ROOT/bin/cachetable -t t1 -p f5 +if [ $? -eq 0 ] +then + echo "Unable to cache" + isql $DS <${REL_PATH}/dt1.sql >/dev/null 2>&1 + rm -f $REL_PATH/t1.sql ${REL_PATH}/dt1.sql + rm -f /tmp/csql/csqltable.conf + touch /tmp/csql/csqltable.conf + kill -9 $pid + ipcrm -M 4000 -M 4500 + exit 2 +fi +isql $DS <${REL_PATH}/dt1.sql >/dev/null 2>&1 +rm -f /tmp/csql/csqltable.conf +touch /tmp/csql/csqltable.conf +rm -f $REL_PATH/t1.sql ${REL_PATH}/dt1.sql +kill -9 $pid +ipcrm -M 4000 -M 4500 +exit 0; + diff --git a/test/cache/CacheTable/test036.ksh b/test/cache/CacheTable/test036.ksh new file mode 100755 index 00000000..10229b2a --- /dev/null +++ b/test/cache/CacheTable/test036.ksh @@ -0,0 +1,68 @@ +#!/bin/ksh +# Test Case + +# Bi-directional cache test +# Create table t1 with field f1 int ,f2 char,f3 smallint , f4 bigint . Make bidirectional flag and cache flag true. Cache the table by -f f1,f2,f3 it should fail +# Author:=bijaya + + +input=${PWD}/cache/CacheTable/csql1.conf + +REL_PATH=. +if [ -s "$input" ] +then + REL_PATH=${PWD}/cache/CacheTable +fi +rm -f /tmp/csql1.conf +cp $REL_PATH/csql1.conf /tmp +export CSQL_CONFIG_FILE=/tmp/csql1.conf + +echo DSN=$DSN >>$CSQL_CONFIG_FILE +DS="$DSN $DBUSER $PASSWORD" +rm -f /tmp/csql/csqlds.conf +touch /tmp/csql/csqlds.conf +$CSQL_INSTALL_ROOT/bin/csqlds -U $DBUSER -P $PASSWORD -D $DSN -N $TDB -a +if [ $? -ne 0 ] +then + exit 1; +fi + +echo "create table t1(f1 int ,f2 char(12),f3 smallint , f4 bigint);">$REL_PATH/t1.sql +for a in 1 2 3 4 5 6 7 8 9 +do +echo "insert into t1 values($a,'papu',12,$a+123124);" +done>>t1.sql +isql $DS < $REL_PATH/t1.sql >/dev/null 2>&1 +if [ $? -ne 0 ] +then + echo "unable to creste in target db" + rm -f $REL_PATH/t1.sql + exit 1 +fi + +echo "drop table t1;">${REL_PATH}/dt1.sql +rm -f /tmp/csql/csqltable.conf +touch /tmp/csql/csqltable.conf + +$CSQL_INSTALL_ROOT/bin/csqlserver >/dev/null 2>&1 & +pid=$! +sleep 5 +echo "server started" +$CSQL_INSTALL_ROOT/bin/cachetable -t t1 -f f1,f2,f3 +if [ $? -eq 0 ] +then + echo "Unable to cache" + isql $DS <${REL_PATH}/dt1.sql >/dev/null 2>&1 + rm -f $REL_PATH/t1.sql ${REL_PATH}/dt1.sql + kill -9 $pid + ipcrm -M 4000 -M 4500 + exit 2 +fi +isql $DS <${REL_PATH}/dt1.sql >/dev/null 2>&1 +rm -f /tmp/csql/csqltable.conf +touch /tmp/csql/csqltable.conf +rm -f $REL_PATH/t1.sql ${REL_PATH}/dt1.sql +kill -9 $pid +ipcrm -M 4000 -M 4500 +exit 0; + diff --git a/test/cache/CacheTable/test037.ksh b/test/cache/CacheTable/test037.ksh new file mode 100755 index 00000000..79c67de7 --- /dev/null +++ b/test/cache/CacheTable/test037.ksh @@ -0,0 +1,86 @@ +#!/bin/ksh +# Test Case + +# Bi-directional cache test +# Create table t1 with field f1 int unique ,f2 char,f3 smallint , f4 bigint . Make bidirectional flag and cache flag true. Cache the table with cachetable -t t1 -f f1,f2,f3 -p f1 it should pass + +# Author:=bijaya + + +input=${PWD}/cache/CacheTable/csql1.conf + +REL_PATH=. +if [ -s "$input" ] +then + REL_PATH=${PWD}/cache/CacheTable +fi +rm -f /tmp/csql1.conf +cp $REL_PATH/csql1.conf /tmp +export CSQL_CONFIG_FILE=/tmp/csql1.conf +echo DSN=$DSN >>$CSQL_CONFIG_FILE +DS="$DSN $DBUSER $PASSWORD" +rm -f /tmp/csql/csqlds.conf +touch /tmp/csql/csqlds.conf +$CSQL_INSTALL_ROOT/bin/csqlds -U $DBUSER -P $PASSWORD -D $DSN -N $TDB -a +if [ $? -ne 0 ] +then + exit 1; +fi + +echo "create table t1(f1 int unique,f2 char(12),f3 smallint , f4 int);">$REL_PATH/t1.sql +if [ $DSN = "db2" ] +then + echo "create table t1(f1 int ,f2 char(12),f3 smallint , f4 int);">$REL_PATH/t1.sql +fi +for a in 1 2 3 4 5 6 7 8 9 +do +echo "insert into t1 values($a,'papu',12,$a+123124);" +done>>t1.sql +isql $DS < $REL_PATH/t1.sql >/dev/null 2>&1 +if [ $? -ne 0 ] +then + echo "unable to create in target db" + rm -f $REL_PATH/t1.sql + exit 1 +fi + +echo "drop table t1;">${REL_PATH}/dt1.sql +rm -f /tmp/csql/csqltable.conf +touch /tmp/csql/csqltable.conf + +$CSQL_INSTALL_ROOT/bin/csqlserver >/dev/null 2>&1 & +pid=$! +sleep 5 +echo "server started" +if [ "$DSN" = "oracle" -o "$DSN" = "sybase" -o "$DSN" = "db2" ] +then + $CSQL_INSTALL_ROOT/bin/cachetable -t t1 -p f1 -F + if [ $? -ne 0 ] + then + echo "Unable to cache" + isql $DS <${REL_PATH}/dt1.sql >/dev/null 2>&1 + rm -f $REL_PATH/t1.sql ${REL_PATH}/dt1.sql + kill -9 $pid + ipcrm -M 4000 -M 4500 + exit 2 + fi +else + $CSQL_INSTALL_ROOT/bin/cachetable -t t1 -p f1 + if [ $? -ne 0 ] + then + echo "Unable to cache" + isql $DS <${REL_PATH}/dt1.sql >/dev/null 2>&1 + rm -f $REL_PATH/t1.sql ${REL_PATH}/dt1.sql + kill -9 $pid + ipcrm -M 4000 -M 4500 + exit 3 + fi +fi +isql $DS <${REL_PATH}/dt1.sql >/dev/null 2>&1 +rm -f /tmp/csql/csqltable.conf +touch /tmp/csql/csqltable.conf +rm -f $REL_PATH/t1.sql ${REL_PATH}/dt1.sql +kill -9 $pid +ipcrm -M 4000 -M 4500 +exit 0; + diff --git a/test/cache/CacheTable/test038.ksh b/test/cache/CacheTable/test038.ksh new file mode 100755 index 00000000..65f79c4f --- /dev/null +++ b/test/cache/CacheTable/test038.ksh @@ -0,0 +1,68 @@ +#!/bin/ksh +# Test Case + +# Bi-directional cache test +# Create table t1 with field f1 int ,f2 char,f3 smallint , f4 bigint . Make bidirectional flag and cache flag true. Cache the table with cachetable -t t1 -f f2,f3 -p f1 it should fail + +# Author:=bijaya + + +input=${PWD}/cache/CacheTable/csql1.conf + +REL_PATH=. +if [ -s "$input" ] +then + REL_PATH=${PWD}/cache/CacheTable +fi +rm -f /tmp/csql1.conf +cp $REL_PATH/csql1.conf /tmp +export CSQL_CONFIG_FILE=/tmp/csql1.conf +echo DSN=$DSN >>$CSQL_CONFIG_FILE +DS="$DSN $DBUSER $PASSWORD" +rm -f /tmp/csql/csqlds.conf +touch /tmp/csql/csqlds.conf +$CSQL_INSTALL_ROOT/bin/csqlds -U $DBUSER -P $PASSWORD -D $DSN -N $TDB -a +if [ $? -ne 0 ] +then + exit 1; +fi + +echo "create table t1(f1 int ,f2 char(12),f3 smallint , f4 bigint);">$REL_PATH/t1.sql +for a in 1 2 3 4 5 6 7 8 9 +do +echo "insert into t1 values($a,'papu',12,$a+123124);" +done>>t1.sql +isql $DS < $REL_PATH/t1.sql >/dev/null 2>&1 +if [ $? -ne 0 ] +then + echo "unable to creste in target db" + rm -f $REL_PATH/t1.sql + exit 1 +fi + +echo "drop table t1;">${REL_PATH}/dt1.sql +rm -f /tmp/csql/csqltable.conf +touch /tmp/csql/csqltable.conf + +$CSQL_INSTALL_ROOT/bin/csqlserver >/dev/null 2>&1 & +pid=$! +sleep 5 +echo "server started" +$CSQL_INSTALL_ROOT/bin/cachetable -t t1 -f f2,f3 -p f1 +if [ $? -eq 0 ] +then + echo "Unable to cache" + isql $DS <${REL_PATH}/dt1.sql >/dev/null 2>&1 + rm -f $REL_PATH/t1.sql ${REL_PATH}/dt1.sql + kill -9 $pid + ipcrm -M 4000 -M 4500 + exit 2 +fi +isql $DS <${REL_PATH}/dt1.sql >/dev/null 2>&1 +rm -f /tmp/csql/csqltable.conf +touch /tmp/csql/csqltable.conf +rm -f $REL_PATH/t1.sql ${REL_PATH}/dt1.sql +kill -9 $pid +ipcrm -M 4000 -M 4500 +exit 0; + diff --git a/test/cache/CacheTable/test039.ksh b/test/cache/CacheTable/test039.ksh new file mode 100755 index 00000000..ac5719e5 --- /dev/null +++ b/test/cache/CacheTable/test039.ksh @@ -0,0 +1,70 @@ +#!/bin/ksh +# Test Case + +# Bi-directional cache test +# Create table t1 with field f1 int ,f2 char,f3 smallint , f4 bigint primary key(f1) . Make bidirectional flag and cache flag true. Cache the table with cachetable -t t1 -f f2,f3 it should fail + +# Author:=bijaya + + +input=${PWD}/cache/CacheTable/csql1.conf + +REL_PATH=. +if [ -s "$input" ] +then + REL_PATH=${PWD}/cache/CacheTable +fi +rm -f /tmp/csql1.conf +cp $REL_PATH/csql1.conf /tmp +export CSQL_CONFIG_FILE=/tmp/csql1.conf +echo DSN=$DSN >>$CSQL_CONFIG_FILE +DS="$DSN $DBUSER $PASSWORD" +rm -f /tmp/csql/csqlds.conf +touch /tmp/csql/csqlds.conf +$CSQL_INSTALL_ROOT/bin/csqlds -U $DBUSER -P $PASSWORD -D $DSN -N $TDB -a +if [ $? -ne 0 ] +then + exit 1; +fi + +echo "create table t1(f1 int ,f2 char(12),f3 smallint , f4 bigint,primary key(f1));">$REL_PATH/t1.sql +for a in 1 2 3 4 5 6 7 8 9 +do +echo "insert into t1 values($a,'papu',12,$a+123124);" +done>>t1.sql +isql $DS < $REL_PATH/t1.sql >/dev/null 2>&1 +if [ $? -ne 0 ] +then + echo "unable to creste in target db" + kill `ps -e | grep csqlcacheserver | gawk -F" " '{ print $1 }'` + rm -f $REL_PATH/t1.sql + exit 1 +fi + +echo "drop table t1;">${REL_PATH}/dt1.sql +rm -f /tmp/csql/csqltable.conf +touch /tmp/csql/csqltable.conf + +$CSQL_INSTALL_ROOT/bin/csqlserver >/dev/null 2>&1 & +pid=$! +sleep 5 +echo "server started" +$CSQL_INSTALL_ROOT/bin/cachetable -t t1 -f f2,f3,f4 +if [ $? -eq 0 ] +then + echo "Table is cached test case failed" + isql $DS <${REL_PATH}/dt1.sql >/dev/null 2>&1 + rm -f $REL_PATH/t1.sql ${REL_PATH}/dt1.sql + kill -9 $pid + ipcrm -M 4000 -M 4500 + kill `ps -e | grep csqlcacheserver | gawk -F" " '{ print $1 }'` + exit 2 +fi +isql $DS <${REL_PATH}/dt1.sql >/dev/null 2>&1 +rm -f /tmp/csql/csqltable.conf +touch /tmp/csql/csqltable.conf +rm -f $REL_PATH/t1.sql ${REL_PATH}/dt1.sql +kill -9 $pid +ipcrm -M 4000 -M 4500 +kill `ps -e | grep csqlcacheserver | gawk -F" " '{ print $1 }'` +exit 0; diff --git a/test/cache/CacheTable/test040.ksh b/test/cache/CacheTable/test040.ksh new file mode 100755 index 00000000..407bef69 --- /dev/null +++ b/test/cache/CacheTable/test040.ksh @@ -0,0 +1,79 @@ +#!/bin/ksh +# Test Case + +# Bi-directional cache test +# Create table t1 with field f1 int ,f2 char,f3 smallint , f4 bigint primary key(f1) . Make bidirectional flag and cache flag true. Cache the table with cachetable -t t1 -f f1,f2 it should pass + +# Author:=bijaya + + +input=${PWD}/cache/CacheTable/csql1.conf + +REL_PATH=. +if [ -s "$input" ] +then + REL_PATH=${PWD}/cache/CacheTable +fi +rm -f /tmp/csql1.conf +cp $REL_PATH/csql1.conf /tmp +export CSQL_CONFIG_FILE=/tmp/csql1.conf +echo DSN=$DSN >>$CSQL_CONFIG_FILE +DS="$DSN $DBUSER $PASSWORD" +rm -f /tmp/csql/csqlds.conf +touch /tmp/csql/csqlds.conf +$CSQL_INSTALL_ROOT/bin/csqlds -U $DBUSER -P $PASSWORD -D $DSN -N $TDB -a +if [ $? -ne 0 ] +then + exit 1; +fi + +echo $DS +echo "create table t1(f1 int ,f2 char(12),f3 smallint ,f4 int,primary key(f1));">$REL_PATH/t1.sql +if [ $DSN = "db2" ] +then + echo "create table t1(f1 int NOT NULL ,f2 char(12),f3 smallint ,f4 int,primary key(f1));">$REL_PATH/t1.sql +fi + +for a in 1 2 3 4 5 6 7 8 9 +do +echo "insert into t1 values($a,'papu',12,$a+123124);" +done>>t1.sql +isql $DS < $REL_PATH/t1.sql >/dev/null 2>&1 +if [ $? -ne 0 ] +then + echo "unable to creste in target db" + rm -f $REL_PATH/t1.sql + exit 1 +fi + +echo "drop table t1;">${REL_PATH}/dt1.sql +rm -f /tmp/csql/csqltable.conf +touch /tmp/csql/csqltable.conf + +$CSQL_INSTALL_ROOT/bin/csqlserver & +#>/dev/null 2>&1 & +pid=$! +sleep 5 +echo "server started" +$CSQL_INSTALL_ROOT/bin/cachetable -t t1 -f f1,f2,f3 +if [ $? -ne 0 ] +then + echo "Unable to cache" + isql $DS <${REL_PATH}/dt1.sql >/dev/null 2>&1 + rm -f $REL_PATH/t1.sql ${REL_PATH}/dt1.sql + kill -9 $pid + kill `ps -e | grep csqlcacheserver | gawk -F" " '{ print $1 }'` + ipcrm -M 4000 -M 4500 + exit 2 +fi +echo "table cached and the test script passed" +$CSQL_INSTALL_ROOT/bin/cachetable -t t1 -u +isql $DS <${REL_PATH}/dt1.sql >/dev/null 2>&1 +rm -f /tmp/csql/csqltable.conf +touch /tmp/csql/csqltable.conf +rm -f $REL_PATH/t1.sql ${REL_PATH}/dt1.sql +kill -9 $pid +kill `ps -e | grep csqlcacheserver | gawk -F" " '{ print $1 }'` +ipcrm -M 4000 -M 4500 +exit 0; + diff --git a/test/cache/CacheTable/test041.ksh b/test/cache/CacheTable/test041.ksh new file mode 100755 index 00000000..ccd134e9 --- /dev/null +++ b/test/cache/CacheTable/test041.ksh @@ -0,0 +1,69 @@ +#!/bin/ksh +# Test Case + +# Bi-directional cache test +# Create table t1 with field f1 int ,f2 char,f3 smallint , f4 int primary key(f1).Make bidirectional flag and cache flag true. Cache the table with cachetable -t t1 -f f1,f2,f3 -p f4 it should fail + +# Author:=bijaya + + +input=${PWD}/cache/CacheTable/csql1.conf + +REL_PATH=. +if [ -s "$input" ] +then + REL_PATH=${PWD}/cache/CacheTable +fi +rm -f /tmp/csql1.conf +cp $REL_PATH/csql1.conf /tmp +export CSQL_CONFIG_FILE=/tmp/csql1.conf + +echo DSN=$DSN >>$CSQL_CONFIG_FILE +DS="$DSN $DBUSER $PASSWORD" +rm -f /tmp/csql/csqlds.conf +touch /tmp/csql/csqlds.conf +$CSQL_INSTALL_ROOT/bin/csqlds -U $DBUSER -P $PASSWORD -D $DSN -N $TDB -a +if [ $? -ne 0 ] +then + exit 1; +fi + +echo "create table t1(f1 int ,f2 char(12),f3 smallint , f4 bigint,primary key(f1));">$REL_PATH/t1.sql +for a in 1 2 3 4 5 6 7 8 9 +do +echo "insert into t1 values($a,'papu',12,$a+123124);" +done>>t1.sql +isql $DS < $REL_PATH/t1.sql >/dev/null 2>&1 +if [ $? -ne 0 ] +then + echo "unable to creste in target db" + rm -f $REL_PATH/t1.sql + exit 1 +fi + +echo "drop table t1;">${REL_PATH}/dt1.sql +rm -f /tmp/csql/csqltable.conf +touch /tmp/csql/csqltable.conf + +$CSQL_INSTALL_ROOT/bin/csqlserver >/dev/null 2>&1 & +pid=$! +sleep 5 +echo "server started" +$CSQL_INSTALL_ROOT/bin/cachetable -t t1 -f f1,f2,f3 -p f4 +if [ $? -eq 0 ] +then + echo "Unable to cache" + isql $DS <${REL_PATH}/dt1.sql >/dev/null 2>&1 + rm -f $REL_PATH/t1.sql ${REL_PATH}/dt1.sql + kill -9 $pid + ipcrm -M 4000 -M 4500 + exit 2 +fi +isql $DS <${REL_PATH}/dt1.sql >/dev/null 2>&1 +rm -f /tmp/csql/csqltable.conf +touch /tmp/csql/csqltable.conf +rm -f $REL_PATH/t1.sql ${REL_PATH}/dt1.sql +kill -9 $pid +ipcrm -M 4000 -M 4500 +exit 0; + diff --git a/test/cache/CacheTable/test042.ksh b/test/cache/CacheTable/test042.ksh new file mode 100755 index 00000000..01eac260 --- /dev/null +++ b/test/cache/CacheTable/test042.ksh @@ -0,0 +1,94 @@ +#!/bin/ksh +# Test Case + +# Bi-directional cache test +# Create table t1 with field create table t1(f1 int unique,f2 char(12),f3 smallint , f4 bigint,primary key(f2));. Make bidirectional flag and cache flag true. Cache the table with cachetable -t t1 -f f1,f3,f4 -p f1 it should pass + +# Author:=bijaya + + +input=${PWD}/cache/CacheTable/csql1.conf + +REL_PATH=. +if [ -s "$input" ] +then + REL_PATH=${PWD}/cache/CacheTable +fi +rm -f /tmp/csql1.conf +cp $REL_PATH/csql1.conf /tmp +export CSQL_CONFIG_FILE=/tmp/csql1.conf +echo DSN=$DSN >>$CSQL_CONFIG_FILE +DS="$DSN $DBUSER $PASSWORD" +rm -f /tmp/csql/csqlds.conf +touch /tmp/csql/csqlds.conf +$CSQL_INSTALL_ROOT/bin/csqlds -U $DBUSER -P $PASSWORD -D $DSN -N $TDB -a +if [ $? -ne 0 ] +then + exit 1; +fi +if [ "$DSN" = "oracle" ] +then +echo "create table t1(f1 integer unique, f2 char(12), f3 smallint , f4 number(18), primary key(f2));">$REL_PATH/t1.sql +else +echo "create table t1(f1 int unique,f2 char(12),f3 smallint , f4 bigint,primary key(f2));">$REL_PATH/t1.sql +fi +if [ $DSN = "db2" ] +then + echo "create table t1(f1 int not null unique,f2 char(12) not null,f3 smallint , f4 bigint,primary key(f2));">$REL_PATH/t1.sql +fi +for a in 1 2 3 4 5 6 7 8 9 +do +echo "insert into t1 values($a,'papu',12,123124);" +done>>t1.sql +isql $DS < $REL_PATH/t1.sql >/dev/null 2>&1 +if [ $? -ne 0 ] +then + echo "unable to create in target db" + rm -f $REL_PATH/t1.sql + exit 2 +fi + +echo "drop table t1;">${REL_PATH}/dt1.sql +rm -f /tmp/csql/csqltable.conf +touch /tmp/csql/csqltable.conf + +$CSQL_INSTALL_ROOT/bin/csqlserver >/dev/null 2>&1 & +pid=$! +sleep 5 +echo "server started" +if [ $DSN = "oracle" -o "$DSN" = "sybase" -o "$DSN" = "db2" ] +then + $CSQL_INSTALL_ROOT/bin/cachetable -t t1 -f f1,f3,f4 -p f1 -F + if [ $? -eq 0 ] + then + echo "Table cached test script passed" + isql $DS <${REL_PATH}/dt1.sql >/dev/null 2>&1 + rm -f $REL_PATH/t1.sql ${REL_PATH}/dt1.sql + kill -9 $pid + kill `ps -e | grep csqlcacheserver | gawk -F" " '{ print $1 }'` + ipcrm -M 4000 -M 4500 + exit 0; + fi +else + $CSQL_INSTALL_ROOT/bin/cachetable -t t1 -f f1,f3,f4 -p f1 + if [ $? -eq 0 ] + then + echo "Table cached test script passed" + isql $DS <${REL_PATH}/dt1.sql >/dev/null 2>&1 + rm -f $REL_PATH/t1.sql ${REL_PATH}/dt1.sql + kill -9 $pid + kill `ps -e | grep csqlcacheserver | gawk -F" " '{ print $1 }'` + ipcrm -M 4000 -M 4500 + exit 0; + fi +fi +echo "Table not cached test script failed" +isql $DS <${REL_PATH}/dt1.sql >/dev/null 2>&1 +rm -f /tmp/csql/csqltable.conf +touch /tmp/csql/csqltable.conf +rm -f $REL_PATH/t1.sql ${REL_PATH}/dt1.sql +kill `ps -e | grep csqlcacheserver | gawk -F" " '{ print $1 }'` +kill -9 $pid +ipcrm -M 4000 -M 4500 +exit 3; + diff --git a/test/cache/CacheTable/test043.ksh b/test/cache/CacheTable/test043.ksh new file mode 100755 index 00000000..2abb3937 --- /dev/null +++ b/test/cache/CacheTable/test043.ksh @@ -0,0 +1,127 @@ +#!/bin/ksh +# Create t1,t2,t3,t4 and t5 table in target Database +# Cache all tables specifying different caching modes +# Use -S option to display cache information about each table +# drop all tables and use -S option +# It should display "no cached tables" + +input=${PWD}/cache/CacheTable/createtable.sql +REL_PATH=. +if [ -s "$input" ] +then + REL_PATH=${PWD}/cache/CacheTable +fi + +cp $CSQL_CONFIG_FILE /tmp/csql.conf + +echo DSN=$DSN >>$CSQL_CONFIG_FILE +DS="$DSN $DBUSER $PASSWORD" +rm -f /tmp/csql/csqlds.conf +touch /tmp/csql/csqlds.conf +$CSQL_INSTALL_ROOT/bin/csqlds -U $DBUSER -P $PASSWORD -D $DSN -N $TDB -a +if [ $? -ne 0 ] +then + exit 1; +fi + +echo CACHE_TABLE=true >>$CSQL_CONFIG_FILE +isql $DS < ${REL_PATH}/createtable.sql > /dev/null 2>&1 + +if [ $? -ne 0 ] + then + cp /tmp/csql.conf $CSQL_CONFIG_FILE + exit 2; +fi + +rm -f /tmp/csql/csqltable.conf +touch /tmp/csql/csqltable.conf + +#simple caching +$CSQL_INSTALL_ROOT/bin/cachetable -U root -P manager -t t1 >/dev/null 2>&1 +if [ $? -ne 0 ] +then + isql $DS < ${REL_PATH}/droptable.sql >/dev/null 2>&1 + cp /tmp/csql.conf $CSQL_CONFIG_FILE + exit 3; +fi + +#cachetable with condition,"-c" option +$CSQL_INSTALL_ROOT/bin/cachetable -U root -P manager -t t2 -c "t2f1=11" > /dev/null 2>&1 + +if [ $? -ne 0 ] +then + isql $DS < ${REL_PATH}/droptable.sql >/dev/null 2>&1 + cp /tmp/csql.conf $CSQL_CONFIG_FILE + exit 4; +fi + +#cache table with "-f" option +$CSQL_INSTALL_ROOT/bin/cachetable -U root -P manager -t t3 -f "t3f1" > /dev/null 2>&1 + +if [ $? -ne 0 ] +then + isql $DS < ${REL_PATH}/droptable.sql >/dev/null 2>&1 + cp /tmp/csql.conf $CSQL_CONFIG_FILE + exit 5; +fi + +# cache table with "-d" option +$CSQL_INSTALL_ROOT/bin/cachetable -U root -P manager -t t4 -D > /dev/null 2>&1 + +if [ $? -ne 0 ] +then + isql $DS < ${REL_PATH}/droptable.sql >/dev/null 2>&1 + cp /tmp/csql.conf $CSQL_CONFIG_FILE + exit 6; +fi + +#cache table with condition, field list and direct option +$CSQL_INSTALL_ROOT/bin/cachetable -U root -P manager -t t5 -c "t5f1=11" -f "t5f2" -D > /dev/null 2>&1 + +if [ $? -ne 0 ] +then + isql $DS < ${REL_PATH}/droptable.sql >/dev/null 2>&1 + cp /tmp/csql.conf $CSQL_CONFIG_FILE + exit 7; +fi + +#describe the cache tables -S option +echo "" +echo "(1). cachetable -S" +$CSQL_INSTALL_ROOT/bin/cachetable -U root -P manager -S +if [ $? -ne 0 ] +then + cp /tmp/csql.conf $CSQL_CONFIG_FILE + isql $DS < ${REL_PATH}/droptable.sql >/dev/null 2>&1 + exit 8; +fi + +#Describe the specific cache table with -S option +echo "(2). cachetable -t t5 -S" +$CSQL_INSTALL_ROOT/bin/cachetable -U root -P manager -t t5 -S +if [ $? -ne 0 ] +then + $CSQL_INSTALL_ROOT/bin/csql -s ${REL_PATH}/droptable.sql > /dev/null 2>&1 + isql $DS < ${REL_PATH}/droptable.sql >/dev/null 2>&1 + cp /tmp/csql.conf $CSQL_CONFIG_FILE + exit 9; +fi + +rm -f /tmp/csql/csqltable.conf +touch /tmp/csql/csqltable.conf + +$CSQL_INSTALL_ROOT/bin/csql -s ${REL_PATH}/droptable.sql > /dev/null 2>&1 +isql $DS < ${REL_PATH}/droptable.sql >/dev/null 2>&1 + +#use -S option when there is no table present in cache +echo "(3). cachetable -S (Cross Verification)" +$CSQL_INSTALL_ROOT/bin/cachetable -U root -P manager -S +if [ $? -ne 0 ] +then + cp /tmp/csql.conf $CSQL_CONFIG_FILE + exit 10; +fi + +cp /tmp/csql.conf $CSQL_CONFIG_FILE +exit 0; + diff --git a/test/cache/CacheTable/test044.ksh b/test/cache/CacheTable/test044.ksh new file mode 100755 index 00000000..52cc1f64 --- /dev/null +++ b/test/cache/CacheTable/test044.ksh @@ -0,0 +1,105 @@ +#!/bin/ksh +# Test Case + +# Bi-directional cache test, Describe with -S option. +# Create table t1 with field create table t1(f1 int unique,f2 char(12),f3 smallint , f4 bigint,primary key(f2));. Make bidirectional flag and cache flag true. Cache the table with cachetable -t t1 -f f1,f3,f4 -p f1 it should pass + +# Author: Jitendra + + +input=${PWD}/cache/CacheTable/csql1.conf + +REL_PATH=. +if [ -s "$input" ] +then + REL_PATH=${PWD}/cache/CacheTable +fi +rm -f /tmp/csql1.conf +cp $REL_PATH/csql1.conf /tmp +export CSQL_CONFIG_FILE=/tmp/csql1.conf +echo DSN=$DSN >>$CSQL_CONFIG_FILE +DS="$DSN $DBUSER $PASSWORD" +rm -f /tmp/csql/csqlds.conf +touch /tmp/csql/csqlds.conf +$CSQL_INSTALL_ROOT/bin/csqlds -U $DBUSER -P $PASSWORD -D $DSN -N $TDB -a +if [ $? -ne 0 ] +then + exit 1; +fi + + +echo "create table t1(f1 int unique,f2 char(12),f3 int,f4 int,primary key(f2));">$REL_PATH/t1.sql +if [ $DSN = "db2" ] +then + echo "create table t1(f1 int not null unique,f2 char(12) not null ,f3 int,f4 int,primary key(f2));">$REL_PATH/t1.sql +fi +for a in 1 2 3 4 5 6 7 8 9 +do +echo "insert into t1 values($a,'papu',12,$a+123124);" +done>>t1.sql +isql $DS < $REL_PATH/t1.sql >/dev/null 2>&1 +if [ $? -ne 0 ] +then + echo "unable to create in target db" + rm -f $REL_PATH/t1.sql + exit 1 +fi + +echo "drop table t1;">${REL_PATH}/dt1.sql +rm -f /tmp/csql/csqltable.conf +touch /tmp/csql/csqltable.conf + +$CSQL_INSTALL_ROOT/bin/csqlserver >/dev/null 2>&1 & +pid=$! +sleep 5 +echo "server started" +echo "=========================== cachetable -t t1 -c \"f1>12\" -f \"f1,f2\" -p f1 ======================================="; +if [ "$DSN" = "oracle" -o "$DSN" = "sybase" -o "$DSN" = "db2" ] +then +{ + $CSQL_INSTALL_ROOT/bin/cachetable -t t1 -c "f1>12" -f "f1,f2" -p f1 -F >/dev/null 2>&1 + if [ $? -ne 0 ] + then + echo "Unable to cache" + isql $DS <${REL_PATH}/dt1.sql >/dev/null 2>&1 + rm -f $REL_PATH/t1.sql ${REL_PATH}/dt1.sql + kill -9 $pid + ipcrm -M 4000 -M 4500 + exit 2 + fi +} +else +{ + $CSQL_INSTALL_ROOT/bin/cachetable -t t1 -c "f1>12" -f "f1,f2" -p f1 >/dev/null 2>&1 + if [ $? -ne 0 ] + then + echo "Unable to cache" + isql $DS <${REL_PATH}/dt1.sql >/dev/null 2>&1 + rm -f $REL_PATH/t1.sql ${REL_PATH}/dt1.sql + kill -9 $pid + ipcrm -M 4000 -M 4500 + exit 3 + fi +} +fi + +$CSQL_INSTALL_ROOT/bin/cachetable -S +if [ $? -ne 0 ] +then + echo "Unable to cache" + isql $DS <${REL_PATH}/dt1.sql >/dev/null 2>&1 + rm -f $REL_PATH/t1.sql ${REL_PATH}/dt1.sql + kill -9 $pid + ipcrm -M 4000 -M 4500 + exit 4 +fi + +$CSQL_INSTALL_ROOT/bin/cachetable -t t1 -u +isql $DS <${REL_PATH}/dt1.sql >/dev/null 2>&1 +rm -f /tmp/csql/csqltable.conf +touch /tmp/csql/csqltable.conf +rm -f $REL_PATH/t1.sql ${REL_PATH}/dt1.sql +kill -9 $pid +ipcrm -M 4000 -M 4500 +exit 0; + diff --git a/test/cache/CacheTable/test045.ksh b/test/cache/CacheTable/test045.ksh new file mode 100755 index 00000000..85278afb --- /dev/null +++ b/test/cache/CacheTable/test045.ksh @@ -0,0 +1,107 @@ +#!/bin/ksh +# Test Case +# Create table t1 in Target DB and insert 1 records in TDB. +# Set CACHE_TABLE=true in csql.conf +# Create a table t1 with same schema as TDB at CSQL. +# DML happen in CSQL, Should not propagate to target Database +# +CSQL_CONF=${PWD}/cache/CacheTable/csql.conf +REL_PATH=. +if [ -s "$CSQL_CONF" ] +then + REL_PATH=${PWD}/cache/CacheTable +fi + +rm -f /tmp/csql.conf +cp $REL_PATH/csql.conf /tmp +export CSQL_CONFIG_FILE=/tmp/csql.conf + +echo DSN=$DSN >>$CSQL_CONFIG_FILE +DS="$DSN $DBUSER $PASSWORD" +rm -f /tmp/csql/csqlds.conf +touch /tmp/csql/csqlds.conf +$CSQL_INSTALL_ROOT/bin/csqlds -U $DBUSER -P $PASSWORD -D $DSN -N $TDB -a +if [ $? -ne 0 ] +then + exit 1; +fi + +# Site1 Configuration +mkdir -p /tmp/CSQL +mkdir -p /tmp/CSQL/log +mkdir -p /tmp/CSQL/log/csql +mkdir -p /tmp/CSQL +mkdir -p /tmp/CSQL/db +cp /tmp/csql.conf /tmp/CSQL/ +echo SYS_DB_KEY=2288 >>/tmp/CSQL/csql.conf +echo USER_DB_KEY=3377 >>/tmp/CSQL/csql.conf +echo LOG_FILE=/tmp/CSQL/log/csql/log.out >>/tmp/CSQL/csql.conf +echo DATABASE_FILE=/tmp/CSQL/db >>/tmp/CSQL/csql.conf +echo CACHE_TABLE=true >>/tmp/CSQL/csql.conf +echo SITE_ID=1 >>/tmp/CSQL/csql.conf +echo TABLE_CONFIG_FILE=/tmp/CSQL/csqltable.conf >>/tmp/CSQL/csql.conf +sleep 2 +echo CREATING TABLE t1 and INSERTING 1 RECORDS IN TARGET DB +if [ "$DSN" = "sybase" ] +then + isql $DS < ${REL_PATH}/cre_ins_sybase.sql +else + isql $DS < ${REL_PATH}/cre_ins_tdb.sql +fi +if [ $? -ne 0 ] + then + isql $DS < ${REL_PATH}/drop_t1.sql + exit 1; +fi + +# Setup Environment For CSQL +export CSQL_CONFIG_FILE=/tmp/CSQL/csql.conf +rm -f /tmp/CSQL/csqltable.conf +touch /tmp/CSQL/csqltable.conf + +# RUN CSQL SERVER at CSQL +$CSQL_INSTALL_ROOT/bin/csqlserver >/dev/null 2>&1 & +pid1=$! +sleep 2 + +#Insertion at CSQL +echo CREATING TABLE t1 and INSERTING 1 RECORDS AT CSQL +$CSQL_INSTALL_ROOT/bin/csql -g -u root -p manager -s ${REL_PATH}/cre_ins_csql.sql +if [ $? -ne 0 ] + then + kill -9 $pid1 + ipcrm -M 2288 -M 3377 + isql $DS < ${REL_PATH}/drop_t1.sql + exit 2; +fi + +echo "AFTER INSERT AT CSQL DATA IN TDB" +isql $DS < ${REL_PATH}/select_t1.sql +if [ $? -ne 0 ] + then + kill -9 $pid1 + ipcrm -M 2288 -M 3377 + isql $DS < ${REL_PATH}/drop_t1.sql + exit 3; +fi + +$CSQL_INSTALL_ROOT/bin/csql -s ${REL_PATH}/drop_t1.sql +if [ $? -ne 0 ] +then + kill -9 $pid1 + ipcrm -M 2288 -M 3377 + exit 4; +fi + +isql $DS < ${REL_PATH}/drop_t1.sql +if [ $? -ne 0 ] + then + kill -9 $pid1 + ipcrm -M 2288 -M 3377 + exit 5; +fi + +rm -rf /tmp/CSQL +kill -9 $pid1 +ipcrm -M 2288 -M 3377 +exit 0; diff --git a/test/cache/CacheTable/test046.ksh b/test/cache/CacheTable/test046.ksh new file mode 100755 index 00000000..7c381b89 --- /dev/null +++ b/test/cache/CacheTable/test046.ksh @@ -0,0 +1,106 @@ +#!/bin/ksh +# Test Case +# Create table t1 in Target DB with 3 fields say (f1 int, f2 smallint, f3 int). +# Create composite index on f1 and f3 field. +# Set CACHE_TABLE=true in csql.conf +# Cache the table t1 +# She Catalog tool displays the composite key index informations or not +# +CSQL_CONF=${PWD}/cache/CacheTable/csql.conf +REL_PATH=. +if [ -s "$CSQL_CONF" ] +then + REL_PATH=${PWD}/cache/CacheTable +fi + +rm -f /tmp/csql.conf +cp $REL_PATH/csql.conf /tmp +export CSQL_CONFIG_FILE=/tmp/csql.conf + +echo DSN=$DSN >>$CSQL_CONFIG_FILE +DS="$DSN $DBUSER $PASSWORD" +rm -f /tmp/csql/csqlds.conf +touch /tmp/csql/csqlds.conf +$CSQL_INSTALL_ROOT/bin/csqlds -U $DBUSER -P $PASSWORD -D $DSN -N $TDB -a +if [ $? -ne 0 ] +then + exit 1; +fi + +# Site1 Configuration +mkdir -p /tmp/CSQL +mkdir -p /tmp/CSQL/log +mkdir -p /tmp/CSQL/log/csql +mkdir -p /tmp/CSQL +mkdir -p /tmp/CSQL/db +cp /tmp/csql.conf /tmp/CSQL/ +echo SYS_DB_KEY=2288 >>/tmp/CSQL/csql.conf +echo USER_DB_KEY=3377 >>/tmp/CSQL/csql.conf +echo LOG_FILE=/tmp/CSQL/log/csql/log.out >>/tmp/CSQL/csql.conf +echo DATABASE_FILE=/tmp/CSQL/db >>/tmp/CSQL/csql.conf +echo CACHE_TABLE=true >>/tmp/CSQL/csql.conf +echo SITE_ID=1 >>/tmp/CSQL/csql.conf +echo TABLE_CONFIG_FILE=/tmp/CSQL/csqltable.conf >>/tmp/CSQL/csql.conf +sleep 2 +echo CREATING TABLE t1 and INSERTING 1 RECORDS IN TARGET DB +echo "CREATE TABLE t1(f1 int, f2 smallint, f3 int);" >${REL_PATH}/t1create_compo.sql +echo "CREATE INDEX idx1 on t1(f1,f3)" >>${REL_PATH}/t1create_compo.sql + +isql $DS < ${REL_PATH}/t1create_compo.sql +if [ $? -ne 0 ] + then + rm -f ${REL_PATH}/t1create_compo.sql + isql $DS < ${REL_PATH}/drop_t1.sql + exit 1; +fi + +# Setup Environment For CSQL +export CSQL_CONFIG_FILE=/tmp/CSQL/csql.conf +rm -f /tmp/CSQL/csqltable.conf +touch /tmp/CSQL/csqltable.conf + +# RUN CSQL SERVER at CSQL +$CSQL_INSTALL_ROOT/bin/csqlserver >/dev/null 2>&1 & +pid1=$! +sleep 2 + +$CSQL_INSTALL_ROOT/bin/cachetable -t t1 +if [ $? -ne 0 ] + then + rm -f ${REL_PATH}/t1create_compo.sql + isql $DS < ${REL_PATH}/drop_t1.sql + ipcrm -M 2288 -M 3377 + exit 2; +fi + +$CSQL_INSTALL_ROOT/bin/catalog -l +if [ $? -ne 0 ] + then + $CSQL_INSTALL_ROOT/bin/cachetable -t t1 -u + rm -f ${REL_PATH}/t1create_compo.sql + isql $DS < ${REL_PATH}/drop_t1.sql + ipcrm -M 2288 -M 3377 + exit 3; +fi + +$CSQL_INSTALL_ROOT/bin/cachetable -t t1 -u +if [ $? -ne 0 ] + then + rm -f ${REL_PATH}/t1create_compo.sql + isql $DS < ${REL_PATH}/drop_t1.sql + ipcrm -M 2288 -M 3377 + exit 4; +fi + +isql $DS < ${REL_PATH}/drop_t1.sql +if [ $? -ne 0 ] + then + kill -9 $pid1 + ipcrm -M 2288 -M 3377 + exit 5; +fi + +rm -rf /tmp/CSQL +kill -9 $pid1 +ipcrm -M 2288 -M 3377 +exit 0; diff --git a/test/cache/CacheTable/test047.ksh b/test/cache/CacheTable/test047.ksh new file mode 100755 index 00000000..320842b3 --- /dev/null +++ b/test/cache/CacheTable/test047.ksh @@ -0,0 +1,132 @@ +#!/bin/ksh +# Test Case +# create table 't1' with 5 fields in Target DB with records. +# Load the table 't1' in field mode in csql without condition. +# Example : select f1,f2,f3 from t1 ; +# Select query executes the selected records from csql. +# + +#Author : Jitendra Lenka +input=${PWD}/cache/CacheTable/csql.conf +REL_PATH=. +if [ -s "$input" ] +then + REL_PATH=${PWD}/cache/CacheTable +fi +rm -f /tmp/csql.conf +cp $REL_PATH/csql.conf /tmp +export CSQL_CONFIG_FILE=/tmp/csql.conf +echo DSN=$DSN >>$CSQL_CONFIG_FILE +DS="$DSN $DBUSER $PASSWORD" +rm -f /tmp/csql/csqlds.conf +touch /tmp/csql/csqlds.conf +$CSQL_INSTALL_ROOT/bin/csqlds -U $DBUSER -P $PASSWORD -D $DSN -N $TDB -a +if [ $? -ne 0 ] +then + exit 1; +fi + +isql $DS < ${REL_PATH}/createtable.sql >/dev/null 2>&1 +if [ $? -ne 0 ] +then + exit 2; +fi + +echo Table t1,t2,t3,t4,t5 created with 2 records in target DB. + +rm -f /tmp/csql/csqltable.conf /tmp/csql/csqlds.db +touch /tmp/csql/csqltable.conf /tmp/csql/csqlds.db + +# cache from target to csql with -f option. +echo "cachetable -t t1 " +$CSQL_INSTALL_ROOT/bin/csqlserver >/dev/null 2>&1 & +pid=$! +sleep 5 + +$CSQL_INSTALL_ROOT/bin/cachetable -t t1 +if [ $? -ne 0 ] +then + rm -f /tmp/csql/csqltable.conf + touch /tmp/csql/csqltable.conf + $CSQL_INSTALL_ROOT/bin/csql -s ${REL_PATH}/dropall.sql > /dev/null 2>&1 + isql $DS < ${REL_PATH}/dropall.sql >/dev/null 2>&1 + kill -9 $pid + ipcrm -M 4000 -M 4500 + exit 3; +fi + +echo "select * from t1;" + +$CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/selectt1.sql + +#setting for "psql dsn" +DSNAME="psql" + +if [ $DSN != $DSNAME ] + then + echo "$DSNAME $POSTGRES_USER $POSTGRES_PASSWORD postgres" >>/tmp/csql/csqlds.conf # entries for csqlds.conf file. + isql $DSNAME $POSTGRES_USER $POSTGRES_PASSWORD < ${REL_PATH}/createtable.sql >/dev/null 2>&1 + if [ $? -ne 0 ] + then + rm -f /tmp/csql/csqltable.conf /tmp/csql/csqlds.conf + touch /tmp/csql/csqltable.conf /tmp/csql/csqlds.conf + $CSQL_INSTALL_ROOT/bin/csql -s ${REL_PATH}/dropall.sql > /dev/null 2>&1 + isql $DS < ${REL_PATH}/dropall.sql >/dev/null 2>&1 + kill -9 $pid + ipcrm -M 4000 -M 4500 + exit 4; + fi +else + DSNAME="myodbc3" + echo "$DSNAME NULL NULL postgres" >>/tmp/csql/csqlds.conf # entries for csqlds.conf file. + isql $DSNAME < ${REL_PATH}/createtable.sql >/dev/null 2>&1 + if [ $? -ne 0 ] + then + rm -f /tmp/csql/csqltable.conf /tmp/csql/csqlds.conf + touch /tmp/csql/csqltable.conf /tmp/csql/csqlds.conf + $CSQL_INSTALL_ROOT/bin/csql -s ${REL_PATH}/dropall.sql > /dev/null 2>&1 + isql $DS < ${REL_PATH}/dropall.sql >/dev/null 2>&1 + kill -9 $pid + ipcrm -M 4000 -M 4500 + exit 5; + fi + +fi + + +# cahetable with -d optiopn +# 'cachetable -t -d + +echo Table t1,t2,t3,t4,t5 created with 2 records in target DB. +echo "cachetable -t t2 -d psql" + +$CSQL_INSTALL_ROOT/bin/cachetable -t t2 -d $DSNAME +if [ $? -ne 0 ] +then + rm -f /tmp/csql/csqlds.conf + touch /tmp/csql/csqlds.conf + $CSQL_INSTALL_ROOT/bin/csql -s ${REL_PATH}/dropall.sql > /dev/null 2>&1 + isql $DS < ${REL_PATH}/dropall.sql >/dev/null 2>&1 + isql $DSNAME < ${REL_PATH}/dropall.sql >/dev/null 2>&1 + kill -9 $pid + ipcrm -M 4000 -M 4500 + exit 6; +fi + +echo "select * from t2;" +$CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/selectt2.sql + + + +rm -f /tmp/csql/csqltable.conf /tmp/csql/csqlds. conf +touch /tmp/csql/csqltable.conf /tmp/csql/csqlds.conf + +$CSQL_INSTALL_ROOT/bin/csql -s ${REL_PATH}/dropall.sql > /dev/null 2>&1 +isql $DS < ${REL_PATH}/dropall.sql >/dev/null 2>&1 +isql $DSNAME ${REL_PATH}/dropall.sql >/dev/null 2>&1 +kill -9 $pid +ipcrm -M 4000 -M 4500 + +exit 0; + + diff --git a/test/cache/CacheVerify/csqldel.sql b/test/cache/CacheVerify/csqldel.sql new file mode 100644 index 00000000..09f48c53 --- /dev/null +++ b/test/cache/CacheVerify/csqldel.sql @@ -0,0 +1 @@ +DELETE FROM t1 WHERE f1 >= 3 AND f1 < 5; diff --git a/test/cache/CacheVerify/csqldelete.sql b/test/cache/CacheVerify/csqldelete.sql new file mode 100644 index 00000000..26521a31 --- /dev/null +++ b/test/cache/CacheVerify/csqldelete.sql @@ -0,0 +1,3 @@ +delete from t1 where f1 = 4; +delete from t1 where f1 = 6; +delete from t1 where f1 = 9; diff --git a/test/cache/CacheVerify/csqlinput.sql b/test/cache/CacheVerify/csqlinput.sql new file mode 100644 index 00000000..1a987c7c --- /dev/null +++ b/test/cache/CacheVerify/csqlinput.sql @@ -0,0 +1,14 @@ +CREATE TABLE t1 (f1 SMALLINT, f2 INT, f3 BIGINT, f4 CHAR (20), f5 FLOAT, f6 DOUBLE, f7 DATE, f8 TIME, primary key(f1)); +INSERT INTO t1 VALUES(11, 2010,121212121, 'Prasad', 112.718, 111111111.222222, '2005/12/25', '21:42:35'); +INSERT INTO t1 VALUES(12, 2069,131313131, 'jiten', 122.718, 222222222.333333, '2025/12/25', '22:42:35'); +INSERT INTO t1 VALUES(13, 1857,141414141, 'hiten', 132.718, 333333333.444444, '2035/12/25', '23:42:35'); +INSERT INTO t1 VALUES(14, 1545,151515151, 'methane', 126.718, 444444444.555555, '2045/12/25', '00:42:35'); +INSERT INTO t1 VALUES(15, 1889,161616161, 'ethane', 211.718, 555555555.222222, '2065/12/25', '01:42:35'); +INSERT INTO t1 VALUES(16, 1789,171717171, 'sanjay', 222.718, 666666666.777777, '2010/12/25', '02:42:35'); +INSERT INTO t1 VALUES(17, 2032,181818181, 'vikrant', 233.718, 777777777.888888, '2020/12/25', '03:42:35'); +INSERT INTO t1 VALUES(18, 2038,444455555, 'nishant', 244.718, 888888888.999999, '2040/12/25', '04:42:35'); +INSERT INTO t1 VALUES(19, 2048,777755555, 'Sushant', 277.718, 333333333.999999, '2023/12/25', '05:42:35'); +INSERT INTO t1 VALUES(20, 1994,666633333, 'vishnu', 255.718, 333333333.666666, '2030/12/25', '06:42:35'); + + + diff --git a/test/cache/CacheVerify/csqloracleinput.sql b/test/cache/CacheVerify/csqloracleinput.sql new file mode 100644 index 00000000..72123c05 --- /dev/null +++ b/test/cache/CacheVerify/csqloracleinput.sql @@ -0,0 +1,11 @@ +CREATE TABLE t1 (f1 SMALLINT, f2 INT , f3 BIGINT , f4 CHAR (10), f5 FLOAT, primary key (f1) ); +INSERT INTO t1 VALUES(1, 2011, 111111111, 'Govind', 113.141); +INSERT INTO t1 VALUES(2, 1978, 222222222, 'Gopal', 114.567); +INSERT INTO t1 VALUES(3, 2008, 333333333, 'kishor', 122.700); +INSERT INTO t1 VALUES(4, 1973, 444444444, 'kiran', 142.718); +INSERT INTO t1 VALUES(5, 2005, 555555555, 'ganesh', 152.718); +INSERT INTO t1 VALUES(6, 1962, 666666666, 'suresh', 162.718); +INSERT INTO t1 VALUES(7, 1965, 777777777, 'Praba', 172.718); +INSERT INTO t1 VALUES(8, 1942, 888888888, 'karan', 182.718); +INSERT INTO t1 VALUES(9, 1956, 999999999, 'sharan', 192.718); +INSERT INTO t1 VALUES(10, 1999,101010101, 'vijay', 102.718); diff --git a/test/cache/CacheVerify/csqloracleinput1.sql b/test/cache/CacheVerify/csqloracleinput1.sql new file mode 100644 index 00000000..883b4758 --- /dev/null +++ b/test/cache/CacheVerify/csqloracleinput1.sql @@ -0,0 +1,14 @@ +CREATE TABLE t1 (f1 SMALLINT, f2 INT, f3 BIGINT, f4 CHAR (20), f5 FLOAT, primary key(f1)); +INSERT INTO t1 VALUES(11, 2010,121212121, 'Prasad', 112.718 ); +INSERT INTO t1 VALUES(12, 2069,131313131, 'jiten', 122.718 ); +INSERT INTO t1 VALUES(13, 1857,141414141, 'hiten', 132.718 ); +INSERT INTO t1 VALUES(14, 1545,151515151, 'methane', 126.718 ); +INSERT INTO t1 VALUES(15, 1889,161616161, 'ethane', 211.718 ); +INSERT INTO t1 VALUES(16, 1789,171717171, 'sanjay', 222.718 ); +INSERT INTO t1 VALUES(17, 2032,181818181, 'vikrant', 233.718 ); +INSERT INTO t1 VALUES(18, 2038,444455555, 'nishant', 244.718 ); +INSERT INTO t1 VALUES(19, 2048,777755555, 'Sushant', 277.718 ); +INSERT INTO t1 VALUES(20, 1994,666633333, 'vishnu', 255.718 ); + + + diff --git a/test/cache/CacheVerify/csqlupd.sql b/test/cache/CacheVerify/csqlupd.sql new file mode 100644 index 00000000..86b950a7 --- /dev/null +++ b/test/cache/CacheVerify/csqlupd.sql @@ -0,0 +1 @@ +UPDATE t1 SET f5=450 WHERE f1 >= 4; diff --git a/test/cache/CacheVerify/csqlupdate.sql b/test/cache/CacheVerify/csqlupdate.sql new file mode 100644 index 00000000..4d5e386f --- /dev/null +++ b/test/cache/CacheVerify/csqlupdate.sql @@ -0,0 +1,2 @@ +update t1 set f2 = 2020 where f1 = 2; +update t1 set f4 = 'rajani' where f1 = 5; diff --git a/test/cache/CacheVerify/db2input.sql b/test/cache/CacheVerify/db2input.sql new file mode 100644 index 00000000..9e2e4a37 --- /dev/null +++ b/test/cache/CacheVerify/db2input.sql @@ -0,0 +1,11 @@ +CREATE TABLE t1 (f1 SMALLINT NOT NULL, f2 INT , f3 BIGINT , f4 CHAR (10), f5 REAL , f6 FLOAT , f7 DATE , f8 TIME, primary key (f1) ); +INSERT INTO t1 VALUES(1, 2011, 111111111, 'Govind', 113.141, 111111111.111111, '1915-12-25', '11:42:35'); +INSERT INTO t1 VALUES(2, 1978, 222222222, 'Gopal', 114.567, 222222222.222222, '1926-05-16', '12:32:14'); +INSERT INTO t1 VALUES(3, 2008, 333333333, 'kishor', 122.700, 333333333.333333, '1937-08-15', '13:45:36'); +INSERT INTO t1 VALUES(4, 1973, 444444444, 'kiran', 142.718, 444444444.444444, '1946-12-25', '14:42:35'); +INSERT INTO t1 VALUES(5, 2005, 555555555, 'ganesh', 152.718, 555555555.555555, '1955-12-25', '15:42:35'); +INSERT INTO t1 VALUES(6, 1962, 666666666, 'suresh', 162.718, 666666666.666666, '1965-12-25', '16:42:35'); +INSERT INTO t1 VALUES(7, 1965, 777777777, 'Praba', 172.718, 777777777.777777, '1975-12-25', '17:42:35'); +INSERT INTO t1 VALUES(8, 1942, 888888888, 'karan', 182.718, 888888888.888888, '1985-12-25', '18:42:35'); +INSERT INTO t1 VALUES(9, 1956, 999999999, 'sharan', 192.718, 999999999.999999, '1995-12-25', '19:42:35'); +INSERT INTO t1 VALUES(10, 1999,101010101, 'vijay', 102.718, 111111111.999999, '1915-12-25', '20:42:35'); diff --git a/test/cache/CacheVerify/db2input10.sql b/test/cache/CacheVerify/db2input10.sql new file mode 100644 index 00000000..c167376c --- /dev/null +++ b/test/cache/CacheVerify/db2input10.sql @@ -0,0 +1,6 @@ +CREATE TABLE t1 (f1 SMALLINT NOT NULL, f2 INT, f3 BIGINT, f4 CHAR(10), f5 REAL, primary key (f1) ); +INSERT INTO t1 VALUES(1, 1, 1, 'Govind', 100.111); +INSERT INTO t1 VALUES(2, 2, 2, 'Gopal', 200.222); +INSERT INTO t1 VALUES(3, 3, 3, 'kishor', 300.333); +INSERT INTO t1 VALUES(4, 4, 4, 'kiran', 400.444); +INSERT INTO t1 VALUES(5, 5, 5, 'ganesh', 500.555); diff --git a/test/cache/CacheVerify/db2input11.sql b/test/cache/CacheVerify/db2input11.sql new file mode 100644 index 00000000..077705fd --- /dev/null +++ b/test/cache/CacheVerify/db2input11.sql @@ -0,0 +1,6 @@ +CREATE TABLE t1 (f1 SMALLINT , f2 INT NOT NULL, f3 BIGINT, f4 CHAR(10), f5 REAL, primary key (f2) ); +INSERT INTO t1 VALUES(1, 1, 1, 'Govind', 100.111); +INSERT INTO t1 VALUES(2, 2, 2, 'Gopal', 200.222); +INSERT INTO t1 VALUES(3, 3, 3, 'kishor', 300.333); +INSERT INTO t1 VALUES(4, 4, 4, 'kiran', 400.444); +INSERT INTO t1 VALUES(5, 5, 5, 'ganesh', 500.555); diff --git a/test/cache/CacheVerify/db2input12.sql b/test/cache/CacheVerify/db2input12.sql new file mode 100644 index 00000000..acaf587d --- /dev/null +++ b/test/cache/CacheVerify/db2input12.sql @@ -0,0 +1,6 @@ +CREATE TABLE t1 (f1 SMALLINT , f2 INT, f3 BIGINT NOT NULL, f4 CHAR (10), f5 REAL, primary key (f3) ); +INSERT INTO t1 VALUES(1, 1, 1, 'Govind', 100.111); +INSERT INTO t1 VALUES(2, 2, 2, 'Gopal', 200.222); +INSERT INTO t1 VALUES(3, 3, 3, 'kishor', 300.333); +INSERT INTO t1 VALUES(4, 4, 4, 'kiran', 400.444); +INSERT INTO t1 VALUES(5, 5, 5, 'ganesh', 500.555); diff --git a/test/cache/CacheVerify/db2input13.sql b/test/cache/CacheVerify/db2input13.sql new file mode 100644 index 00000000..714f8e5a --- /dev/null +++ b/test/cache/CacheVerify/db2input13.sql @@ -0,0 +1,6 @@ +CREATE TABLE t1 (f1 SMALLINT, f2 INT, f3 BIGINT, f4 CHAR (10) NOT NULL, f5 REAL, primary key (f4) ); +INSERT INTO t1 VALUES(1, 1, 1, 'Govind', 100.111); +INSERT INTO t1 VALUES(2, 2, 2, 'Gopal', 200.222); +INSERT INTO t1 VALUES(3, 3, 3, 'kishor', 300.333); +INSERT INTO t1 VALUES(4, 4, 4, 'kiran', 400.444); +INSERT INTO t1 VALUES(5, 5, 5, 'ganesh', 500.555); diff --git a/test/cache/CacheVerify/db2update.sql b/test/cache/CacheVerify/db2update.sql new file mode 100644 index 00000000..a541bde2 --- /dev/null +++ b/test/cache/CacheVerify/db2update.sql @@ -0,0 +1,2 @@ +update t1 set f7 = '2020-02-20' where f1 = 7; +update t1 set f8 = '20:20:20' where f1 = 10; diff --git a/test/cache/CacheVerify/drop.sql b/test/cache/CacheVerify/drop.sql new file mode 100644 index 00000000..853c1ad6 --- /dev/null +++ b/test/cache/CacheVerify/drop.sql @@ -0,0 +1 @@ +drop table t1; diff --git a/test/cache/CacheVerify/exp.test001.ksh b/test/cache/CacheVerify/exp.test001.ksh new file mode 100644 index 00000000..8403a559 --- /dev/null +++ b/test/cache/CacheVerify/exp.test001.ksh @@ -0,0 +1,7 @@ +Usage: cacheverify [-U username] [-P passwd] -t tablename [-p] [-f] + username -> username to connect with csql. + passwd -> password for the above username to connect with csql. + tablename -> cached table name in csql from target db. + p -> verification at primary key field level + f -> verification at record level + ? -> help diff --git a/test/cache/CacheVerify/exp.test004.ksh b/test/cache/CacheVerify/exp.test004.ksh new file mode 100644 index 00000000..c0bbf5d7 --- /dev/null +++ b/test/cache/CacheVerify/exp.test004.ksh @@ -0,0 +1,21 @@ + +Number of Records: +-------------------+-------------------+-------------------+ + Data | In CSQL | In TargetDB | +-------------------+-------------------+-------------------+ + No. Of Records | 2 | 2 | +-------------------+-------------------+-------------------+ + +Number of Records: +-------------------+-------------------+-------------------+ + Data | In CSQL | In TargetDB | +-------------------+-------------------+-------------------+ + No. Of Records | 2 | 2 | +-------------------+-------------------+-------------------+ + +Number of Records: +-------------------+-------------------+-------------------+ + Data | In CSQL | In TargetDB | +-------------------+-------------------+-------------------+ + No. Of Records | 2 | 2 | +-------------------+-------------------+-------------------+ diff --git a/test/cache/CacheVerify/exp.test006.ksh b/test/cache/CacheVerify/exp.test006.ksh new file mode 100644 index 00000000..ac9fa554 --- /dev/null +++ b/test/cache/CacheVerify/exp.test006.ksh @@ -0,0 +1,46 @@ + +Number of Records: +-------------------+-------------------+-------------------+ + Data | In CSQL | In TargetDB | +-------------------+-------------------+-------------------+ + No. Of Records | 10 | 10 | +-------------------+-------------------+-------------------+ + +Number of Records: +-------------------+-------------------+-------------------+ + Data | In CSQL | In TargetDB | +-------------------+-------------------+-------------------+ + No. Of Records | 10 | 10 | +-------------------+-------------------+-------------------+ + +Primary key field name is 'f1' + +Missing Records: Marked by 'X' +-------------------+-------------------+-------------------+ + Primary Key | In CSQL | In Target DB | +-------------------+-------------------+-------------------+ + No missing Records in either of the databases | +-------------------+-------------------+-------------------+ + +Number of Records: +-------------------+-------------------+-------------------+ + Data | In CSQL | In TargetDB | +-------------------+-------------------+-------------------+ + No. Of Records | 10 | 10 | +-------------------+-------------------+-------------------+ + +Primary key field name is 'f1' + +Missing Records: Marked by 'X' +-------------------+-------------------+-------------------+ + Primary Key | In CSQL | In Target DB | +-------------------+-------------------+-------------------+ + No missing Records in either of the databases | +-------------------+-------------------+-------------------+ + +Inconsistent Records for the same key: +-------------------+-------------------+-------------------+-------------------+ + Primary Key | Field Name | In CSQL | In Trgt DB | +-------------------+-------------------+-------------------+-------------------+ + The data is consistent in both the databases | +-------------------+-------------------+-------------------+-------------------+ diff --git a/test/cache/CacheVerify/exp.test007.ksh b/test/cache/CacheVerify/exp.test007.ksh new file mode 100644 index 00000000..0ca16ebe --- /dev/null +++ b/test/cache/CacheVerify/exp.test007.ksh @@ -0,0 +1,54 @@ + +Number of Records: +-------------------+-------------------+-------------------+ + Data | In CSQL | In TargetDB | +-------------------+-------------------+-------------------+ + No. Of Records | 7 | 8 | +-------------------+-------------------+-------------------+ + +Number of Records: +-------------------+-------------------+-------------------+ + Data | In CSQL | In TargetDB | +-------------------+-------------------+-------------------+ + No. Of Records | 7 | 8 | +-------------------+-------------------+-------------------+ + +Primary key field name is 'f1' + +Missing Records: Marked by 'X' +-------------------+-------------------+-------------------+ + Primary Key | In CSQL | In Target DB | +-------------------+-------------------+-------------------+ + 3 | | X | + 8 | | X | + 4 | X | | + 6 | X | | + 9 | X | | +-------------------+-------------------+-------------------+ + +Number of Records: +-------------------+-------------------+-------------------+ + Data | In CSQL | In TargetDB | +-------------------+-------------------+-------------------+ + No. Of Records | 7 | 8 | +-------------------+-------------------+-------------------+ + +Primary key field name is 'f1' + +Missing Records: Marked by 'X' +-------------------+-------------------+-------------------+ + Primary Key | In CSQL | In Target DB | +-------------------+-------------------+-------------------+ + 3 | | X | + 8 | | X | + 4 | X | | + 6 | X | | + 9 | X | | +-------------------+-------------------+-------------------+ + +Inconsistent Records for the same key: +-------------------+-------------------+-------------------+-------------------+ + Primary Key | Field Name | In CSQL | In Trgt DB | +-------------------+-------------------+-------------------+-------------------+ + The data is consistent for the records with the same key | +-------------------+-------------------+-------------------+-------------------+ diff --git a/test/cache/CacheVerify/exp.test008.ksh b/test/cache/CacheVerify/exp.test008.ksh new file mode 100644 index 00000000..3f0c3092 --- /dev/null +++ b/test/cache/CacheVerify/exp.test008.ksh @@ -0,0 +1,57 @@ + +Number of Records: +-------------------+-------------------+-------------------+ + Data | In CSQL | In TargetDB | +-------------------+-------------------+-------------------+ + No. Of Records | 7 | 8 | +-------------------+-------------------+-------------------+ + +Number of Records: +-------------------+-------------------+-------------------+ + Data | In CSQL | In TargetDB | +-------------------+-------------------+-------------------+ + No. Of Records | 7 | 8 | +-------------------+-------------------+-------------------+ + +Primary key field name is 'f1' + +Missing Records: Marked by 'X' +-------------------+-------------------+-------------------+ + Primary Key | In CSQL | In Target DB | +-------------------+-------------------+-------------------+ + 3 | | X | + 8 | | X | + 4 | X | | + 6 | X | | + 9 | X | | +-------------------+-------------------+-------------------+ + +Number of Records: +-------------------+-------------------+-------------------+ + Data | In CSQL | In TargetDB | +-------------------+-------------------+-------------------+ + No. Of Records | 7 | 8 | +-------------------+-------------------+-------------------+ + +Primary key field name is 'f1' + +Missing Records: Marked by 'X' +-------------------+-------------------+-------------------+ + Primary Key | In CSQL | In Target DB | +-------------------+-------------------+-------------------+ + 3 | | X | + 8 | | X | + 4 | X | | + 6 | X | | + 9 | X | | +-------------------+-------------------+-------------------+ + +Inconsistent Records for the same key: +-------------------+-------------------+-------------------+-------------------+ + Primary Key | Field Name | In CSQL | In Trgt DB | +-------------------+-------------------+-------------------+-------------------+ + 2 | t1.f2 | 2020 | 1978 | + 5 | t1.f4 | rajani | ganesh | + 7 | t1.f7 | 1975/12/25 | 2020/2/20 | + 10 | t1.f8 | 20:42:35.0 | 20:20:20.0 | +-------------------+-------------------+-------------------+-------------------+ diff --git a/test/cache/CacheVerify/exp.test009.ksh b/test/cache/CacheVerify/exp.test009.ksh new file mode 100644 index 00000000..a393c64c --- /dev/null +++ b/test/cache/CacheVerify/exp.test009.ksh @@ -0,0 +1,49 @@ + +Number of Records: +-------------------+-------------------+-------------------+ + Data | In CSQL | In TargetDB | +-------------------+-------------------+-------------------+ + No. Of Records | 10 | 10 | +-------------------+-------------------+-------------------+ + +Number of Records: +-------------------+-------------------+-------------------+ + Data | In CSQL | In TargetDB | +-------------------+-------------------+-------------------+ + No. Of Records | 10 | 10 | +-------------------+-------------------+-------------------+ + +Primary key field name is 'f1' + +Missing Records: Marked by 'X' +-------------------+-------------------+-------------------+ + Primary Key | In CSQL | In Target DB | +-------------------+-------------------+-------------------+ + No missing Records in either of the databases | +-------------------+-------------------+-------------------+ + +Number of Records: +-------------------+-------------------+-------------------+ + Data | In CSQL | In TargetDB | +-------------------+-------------------+-------------------+ + No. Of Records | 10 | 10 | +-------------------+-------------------+-------------------+ + +Primary key field name is 'f1' + +Missing Records: Marked by 'X' +-------------------+-------------------+-------------------+ + Primary Key | In CSQL | In Target DB | +-------------------+-------------------+-------------------+ + No missing Records in either of the databases | +-------------------+-------------------+-------------------+ + +Inconsistent Records for the same key: +-------------------+-------------------+-------------------+-------------------+ + Primary Key | Field Name | In CSQL | In Trgt DB | +-------------------+-------------------+-------------------+-------------------+ + 2 | t1.f2 | 2020 | 1978 | + 5 | t1.f4 | rajani | ganesh | + 7 | t1.f7 | 1975/12/25 | 2020/2/20 | + 10 | t1.f8 | 20:42:35.0 | 20:20:20.0 | +-------------------+-------------------+-------------------+-------------------+ diff --git a/test/cache/CacheVerify/exp.test010.ksh b/test/cache/CacheVerify/exp.test010.ksh new file mode 100644 index 00000000..98db395a --- /dev/null +++ b/test/cache/CacheVerify/exp.test010.ksh @@ -0,0 +1,137 @@ +cacheverify -t t1 + +Number of Records: +-------------------+-------------------+-------------------+ + Data | In CSQL | In TargetDB | +-------------------+-------------------+-------------------+ + No. Of Records | 5 | 5 | +-------------------+-------------------+-------------------+ +cacheverify -t t1 -p + +Number of Records: +-------------------+-------------------+-------------------+ + Data | In CSQL | In TargetDB | +-------------------+-------------------+-------------------+ + No. Of Records | 5 | 5 | +-------------------+-------------------+-------------------+ + +Primary key field name is 'f1' + +Missing Records: Marked by 'X' +-------------------+-------------------+-------------------+ + Primary Key | In CSQL | In Target DB | +-------------------+-------------------+-------------------+ + No missing Records in either of the databases | +-------------------+-------------------+-------------------+ +cacheverify -t t1 -f + +Number of Records: +-------------------+-------------------+-------------------+ + Data | In CSQL | In TargetDB | +-------------------+-------------------+-------------------+ + No. Of Records | 5 | 5 | +-------------------+-------------------+-------------------+ + +Primary key field name is 'f1' + +Missing Records: Marked by 'X' +-------------------+-------------------+-------------------+ + Primary Key | In CSQL | In Target DB | +-------------------+-------------------+-------------------+ + No missing Records in either of the databases | +-------------------+-------------------+-------------------+ + +Inconsistent Records for the same key: +-------------------+-------------------+-------------------+-------------------+ + Primary Key | Field Name | In CSQL | In Trgt DB | +-------------------+-------------------+-------------------+-------------------+ + The data is consistent in both the databases | +-------------------+-------------------+-------------------+-------------------+ +updating 2 records in csql through gateway +cacheverify -t t1 -f + +Number of Records: +-------------------+-------------------+-------------------+ + Data | In CSQL | In TargetDB | +-------------------+-------------------+-------------------+ + No. Of Records | 5 | 5 | +-------------------+-------------------+-------------------+ + +Primary key field name is 'f1' + +Missing Records: Marked by 'X' +-------------------+-------------------+-------------------+ + Primary Key | In CSQL | In Target DB | +-------------------+-------------------+-------------------+ + No missing Records in either of the databases | +-------------------+-------------------+-------------------+ + +Inconsistent Records for the same key: +-------------------+-------------------+-------------------+-------------------+ + Primary Key | Field Name | In CSQL | In Trgt DB | +-------------------+-------------------+-------------------+-------------------+ + The data is consistent in both the databases | +-------------------+-------------------+-------------------+-------------------+ +deleting 2 records in csql through gateway +cacheverify -t t1 -p + +Number of Records: +-------------------+-------------------+-------------------+ + Data | In CSQL | In TargetDB | +-------------------+-------------------+-------------------+ + No. Of Records | 3 | 3 | +-------------------+-------------------+-------------------+ + +Primary key field name is 'f1' + +Missing Records: Marked by 'X' +-------------------+-------------------+-------------------+ + Primary Key | In CSQL | In Target DB | +-------------------+-------------------+-------------------+ + No missing Records in either of the databases | +-------------------+-------------------+-------------------+ +updating 2 records in mysql +cacheverify -t t1 -f + +Number of Records: +-------------------+-------------------+-------------------+ + Data | In CSQL | In TargetDB | +-------------------+-------------------+-------------------+ + No. Of Records | 3 | 3 | +-------------------+-------------------+-------------------+ + +Primary key field name is 'f1' + +Missing Records: Marked by 'X' +-------------------+-------------------+-------------------+ + Primary Key | In CSQL | In Target DB | +-------------------+-------------------+-------------------+ + No missing Records in either of the databases | +-------------------+-------------------+-------------------+ + +Inconsistent Records for the same key: +-------------------+-------------------+-------------------+-------------------+ + Primary Key | Field Name | In CSQL | In Trgt DB | +-------------------+-------------------+-------------------+-------------------+ + 1 | t1.f5 | 100.111000 | 150.000000 | + 2 | t1.f5 | 200.222000 | 150.000000 | +-------------------+-------------------+-------------------+-------------------+ +deleting 2 records in mysql +cacheverify -t t1 -p + +Number of Records: +-------------------+-------------------+-------------------+ + Data | In CSQL | In TargetDB | +-------------------+-------------------+-------------------+ + No. Of Records | 3 | 1 | +-------------------+-------------------+-------------------+ + +Primary key field name is 'f1' + +Missing Records: Marked by 'X' +-------------------+-------------------+-------------------+ + Primary Key | In CSQL | In Target DB | +-------------------+-------------------+-------------------+ + 1 | | X | + 2 | | X | +-------------------+-------------------+-------------------+ diff --git a/test/cache/CacheVerify/exp.test011.ksh b/test/cache/CacheVerify/exp.test011.ksh new file mode 100644 index 00000000..fd6949fe --- /dev/null +++ b/test/cache/CacheVerify/exp.test011.ksh @@ -0,0 +1,137 @@ +cacheverify -t t1 + +Number of Records: +-------------------+-------------------+-------------------+ + Data | In CSQL | In TargetDB | +-------------------+-------------------+-------------------+ + No. Of Records | 5 | 5 | +-------------------+-------------------+-------------------+ +cacheverify -t t1 -p + +Number of Records: +-------------------+-------------------+-------------------+ + Data | In CSQL | In TargetDB | +-------------------+-------------------+-------------------+ + No. Of Records | 5 | 5 | +-------------------+-------------------+-------------------+ + +Primary key field name is 'f2' + +Missing Records: Marked by 'X' +-------------------+-------------------+-------------------+ + Primary Key | In CSQL | In Target DB | +-------------------+-------------------+-------------------+ + No missing Records in either of the databases | +-------------------+-------------------+-------------------+ +cacheverify -t t1 -f + +Number of Records: +-------------------+-------------------+-------------------+ + Data | In CSQL | In TargetDB | +-------------------+-------------------+-------------------+ + No. Of Records | 5 | 5 | +-------------------+-------------------+-------------------+ + +Primary key field name is 'f2' + +Missing Records: Marked by 'X' +-------------------+-------------------+-------------------+ + Primary Key | In CSQL | In Target DB | +-------------------+-------------------+-------------------+ + No missing Records in either of the databases | +-------------------+-------------------+-------------------+ + +Inconsistent Records for the same key: +-------------------+-------------------+-------------------+-------------------+ + Primary Key | Field Name | In CSQL | In Trgt DB | +-------------------+-------------------+-------------------+-------------------+ + The data is consistent in both the databases | +-------------------+-------------------+-------------------+-------------------+ +updating 2 records in csql through gateway +cacheverify -t t1 -f + +Number of Records: +-------------------+-------------------+-------------------+ + Data | In CSQL | In TargetDB | +-------------------+-------------------+-------------------+ + No. Of Records | 5 | 5 | +-------------------+-------------------+-------------------+ + +Primary key field name is 'f2' + +Missing Records: Marked by 'X' +-------------------+-------------------+-------------------+ + Primary Key | In CSQL | In Target DB | +-------------------+-------------------+-------------------+ + No missing Records in either of the databases | +-------------------+-------------------+-------------------+ + +Inconsistent Records for the same key: +-------------------+-------------------+-------------------+-------------------+ + Primary Key | Field Name | In CSQL | In Trgt DB | +-------------------+-------------------+-------------------+-------------------+ + The data is consistent in both the databases | +-------------------+-------------------+-------------------+-------------------+ +deleting 2 records in csql through gateway +cacheverify -t t1 -p + +Number of Records: +-------------------+-------------------+-------------------+ + Data | In CSQL | In TargetDB | +-------------------+-------------------+-------------------+ + No. Of Records | 3 | 3 | +-------------------+-------------------+-------------------+ + +Primary key field name is 'f2' + +Missing Records: Marked by 'X' +-------------------+-------------------+-------------------+ + Primary Key | In CSQL | In Target DB | +-------------------+-------------------+-------------------+ + No missing Records in either of the databases | +-------------------+-------------------+-------------------+ +updating 2 records in mysql +cacheverify -t t1 -f + +Number of Records: +-------------------+-------------------+-------------------+ + Data | In CSQL | In TargetDB | +-------------------+-------------------+-------------------+ + No. Of Records | 3 | 3 | +-------------------+-------------------+-------------------+ + +Primary key field name is 'f2' + +Missing Records: Marked by 'X' +-------------------+-------------------+-------------------+ + Primary Key | In CSQL | In Target DB | +-------------------+-------------------+-------------------+ + No missing Records in either of the databases | +-------------------+-------------------+-------------------+ + +Inconsistent Records for the same key: +-------------------+-------------------+-------------------+-------------------+ + Primary Key | Field Name | In CSQL | In Trgt DB | +-------------------+-------------------+-------------------+-------------------+ + 1 | t1.f5 | 100.111000 | 150.000000 | + 2 | t1.f5 | 200.222000 | 150.000000 | +-------------------+-------------------+-------------------+-------------------+ +deleting 2 records in mysql +cacheverify -t t1 -p + +Number of Records: +-------------------+-------------------+-------------------+ + Data | In CSQL | In TargetDB | +-------------------+-------------------+-------------------+ + No. Of Records | 3 | 1 | +-------------------+-------------------+-------------------+ + +Primary key field name is 'f2' + +Missing Records: Marked by 'X' +-------------------+-------------------+-------------------+ + Primary Key | In CSQL | In Target DB | +-------------------+-------------------+-------------------+ + 1 | | X | + 2 | | X | +-------------------+-------------------+-------------------+ diff --git a/test/cache/CacheVerify/exp.test012.ksh b/test/cache/CacheVerify/exp.test012.ksh new file mode 100644 index 00000000..84619b02 --- /dev/null +++ b/test/cache/CacheVerify/exp.test012.ksh @@ -0,0 +1,137 @@ +cacheverify -t t1 + +Number of Records: +-------------------+-------------------+-------------------+ + Data | In CSQL | In TargetDB | +-------------------+-------------------+-------------------+ + No. Of Records | 5 | 5 | +-------------------+-------------------+-------------------+ +cacheverify -t t1 -p + +Number of Records: +-------------------+-------------------+-------------------+ + Data | In CSQL | In TargetDB | +-------------------+-------------------+-------------------+ + No. Of Records | 5 | 5 | +-------------------+-------------------+-------------------+ + +Primary key field name is 'f3' + +Missing Records: Marked by 'X' +-------------------+-------------------+-------------------+ + Primary Key | In CSQL | In Target DB | +-------------------+-------------------+-------------------+ + No missing Records in either of the databases | +-------------------+-------------------+-------------------+ +cacheverify -t t1 -f + +Number of Records: +-------------------+-------------------+-------------------+ + Data | In CSQL | In TargetDB | +-------------------+-------------------+-------------------+ + No. Of Records | 5 | 5 | +-------------------+-------------------+-------------------+ + +Primary key field name is 'f3' + +Missing Records: Marked by 'X' +-------------------+-------------------+-------------------+ + Primary Key | In CSQL | In Target DB | +-------------------+-------------------+-------------------+ + No missing Records in either of the databases | +-------------------+-------------------+-------------------+ + +Inconsistent Records for the same key: +-------------------+-------------------+-------------------+-------------------+ + Primary Key | Field Name | In CSQL | In Trgt DB | +-------------------+-------------------+-------------------+-------------------+ + The data is consistent in both the databases | +-------------------+-------------------+-------------------+-------------------+ +updating 2 records in csql through gateway +cacheverify -t t1 -f + +Number of Records: +-------------------+-------------------+-------------------+ + Data | In CSQL | In TargetDB | +-------------------+-------------------+-------------------+ + No. Of Records | 5 | 5 | +-------------------+-------------------+-------------------+ + +Primary key field name is 'f3' + +Missing Records: Marked by 'X' +-------------------+-------------------+-------------------+ + Primary Key | In CSQL | In Target DB | +-------------------+-------------------+-------------------+ + No missing Records in either of the databases | +-------------------+-------------------+-------------------+ + +Inconsistent Records for the same key: +-------------------+-------------------+-------------------+-------------------+ + Primary Key | Field Name | In CSQL | In Trgt DB | +-------------------+-------------------+-------------------+-------------------+ + The data is consistent in both the databases | +-------------------+-------------------+-------------------+-------------------+ +deleting 2 records in csql through gateway +cacheverify -t t1 -p + +Number of Records: +-------------------+-------------------+-------------------+ + Data | In CSQL | In TargetDB | +-------------------+-------------------+-------------------+ + No. Of Records | 3 | 3 | +-------------------+-------------------+-------------------+ + +Primary key field name is 'f3' + +Missing Records: Marked by 'X' +-------------------+-------------------+-------------------+ + Primary Key | In CSQL | In Target DB | +-------------------+-------------------+-------------------+ + No missing Records in either of the databases | +-------------------+-------------------+-------------------+ +updating 2 records in mysql +cacheverify -t t1 -f + +Number of Records: +-------------------+-------------------+-------------------+ + Data | In CSQL | In TargetDB | +-------------------+-------------------+-------------------+ + No. Of Records | 3 | 3 | +-------------------+-------------------+-------------------+ + +Primary key field name is 'f3' + +Missing Records: Marked by 'X' +-------------------+-------------------+-------------------+ + Primary Key | In CSQL | In Target DB | +-------------------+-------------------+-------------------+ + No missing Records in either of the databases | +-------------------+-------------------+-------------------+ + +Inconsistent Records for the same key: +-------------------+-------------------+-------------------+-------------------+ + Primary Key | Field Name | In CSQL | In Trgt DB | +-------------------+-------------------+-------------------+-------------------+ + 1 | t1.f5 | 100.111000 | 150.000000 | + 2 | t1.f5 | 200.222000 | 150.000000 | +-------------------+-------------------+-------------------+-------------------+ +deleting 2 records in mysql +cacheverify -t t1 -p + +Number of Records: +-------------------+-------------------+-------------------+ + Data | In CSQL | In TargetDB | +-------------------+-------------------+-------------------+ + No. Of Records | 3 | 1 | +-------------------+-------------------+-------------------+ + +Primary key field name is 'f3' + +Missing Records: Marked by 'X' +-------------------+-------------------+-------------------+ + Primary Key | In CSQL | In Target DB | +-------------------+-------------------+-------------------+ + 1 | | X | + 2 | | X | +-------------------+-------------------+-------------------+ diff --git a/test/cache/CacheVerify/exp.test013.ksh b/test/cache/CacheVerify/exp.test013.ksh new file mode 100644 index 00000000..d3746527 --- /dev/null +++ b/test/cache/CacheVerify/exp.test013.ksh @@ -0,0 +1,137 @@ +cacheverify -t t1 + +Number of Records: +-------------------+-------------------+-------------------+ + Data | In CSQL | In TargetDB | +-------------------+-------------------+-------------------+ + No. Of Records | 5 | 5 | +-------------------+-------------------+-------------------+ +cacheverify -t t1 -p + +Number of Records: +-------------------+-------------------+-------------------+ + Data | In CSQL | In TargetDB | +-------------------+-------------------+-------------------+ + No. Of Records | 5 | 5 | +-------------------+-------------------+-------------------+ + +Primary key field name is 'f4' + +Missing Records: Marked by 'X' +-------------------+-------------------+-------------------+ + Primary Key | In CSQL | In Target DB | +-------------------+-------------------+-------------------+ + No missing Records in either of the databases | +-------------------+-------------------+-------------------+ +cacheverify -t t1 -f + +Number of Records: +-------------------+-------------------+-------------------+ + Data | In CSQL | In TargetDB | +-------------------+-------------------+-------------------+ + No. Of Records | 5 | 5 | +-------------------+-------------------+-------------------+ + +Primary key field name is 'f4' + +Missing Records: Marked by 'X' +-------------------+-------------------+-------------------+ + Primary Key | In CSQL | In Target DB | +-------------------+-------------------+-------------------+ + No missing Records in either of the databases | +-------------------+-------------------+-------------------+ + +Inconsistent Records for the same key: +-------------------+-------------------+-------------------+-------------------+ + Primary Key | Field Name | In CSQL | In Trgt DB | +-------------------+-------------------+-------------------+-------------------+ + The data is consistent in both the databases | +-------------------+-------------------+-------------------+-------------------+ +updating 2 records in csql through gateway +cacheverify -t t1 -f + +Number of Records: +-------------------+-------------------+-------------------+ + Data | In CSQL | In TargetDB | +-------------------+-------------------+-------------------+ + No. Of Records | 5 | 5 | +-------------------+-------------------+-------------------+ + +Primary key field name is 'f4' + +Missing Records: Marked by 'X' +-------------------+-------------------+-------------------+ + Primary Key | In CSQL | In Target DB | +-------------------+-------------------+-------------------+ + No missing Records in either of the databases | +-------------------+-------------------+-------------------+ + +Inconsistent Records for the same key: +-------------------+-------------------+-------------------+-------------------+ + Primary Key | Field Name | In CSQL | In Trgt DB | +-------------------+-------------------+-------------------+-------------------+ + The data is consistent in both the databases | +-------------------+-------------------+-------------------+-------------------+ +deleting 2 records in csql through gateway +cacheverify -t t1 -p + +Number of Records: +-------------------+-------------------+-------------------+ + Data | In CSQL | In TargetDB | +-------------------+-------------------+-------------------+ + No. Of Records | 3 | 3 | +-------------------+-------------------+-------------------+ + +Primary key field name is 'f4' + +Missing Records: Marked by 'X' +-------------------+-------------------+-------------------+ + Primary Key | In CSQL | In Target DB | +-------------------+-------------------+-------------------+ + No missing Records in either of the databases | +-------------------+-------------------+-------------------+ +updating 2 records in mysql +cacheverify -t t1 -f + +Number of Records: +-------------------+-------------------+-------------------+ + Data | In CSQL | In TargetDB | +-------------------+-------------------+-------------------+ + No. Of Records | 3 | 3 | +-------------------+-------------------+-------------------+ + +Primary key field name is 'f4' + +Missing Records: Marked by 'X' +-------------------+-------------------+-------------------+ + Primary Key | In CSQL | In Target DB | +-------------------+-------------------+-------------------+ + No missing Records in either of the databases | +-------------------+-------------------+-------------------+ + +Inconsistent Records for the same key: +-------------------+-------------------+-------------------+-------------------+ + Primary Key | Field Name | In CSQL | In Trgt DB | +-------------------+-------------------+-------------------+-------------------+ + Govind | t1.f5 | 100.111000 | 150.000000 | + Gopal | t1.f5 | 200.222000 | 150.000000 | +-------------------+-------------------+-------------------+-------------------+ +deleting 2 records in mysql +cacheverify -t t1 -p + +Number of Records: +-------------------+-------------------+-------------------+ + Data | In CSQL | In TargetDB | +-------------------+-------------------+-------------------+ + No. Of Records | 3 | 1 | +-------------------+-------------------+-------------------+ + +Primary key field name is 'f4' + +Missing Records: Marked by 'X' +-------------------+-------------------+-------------------+ + Primary Key | In CSQL | In Target DB | +-------------------+-------------------+-------------------+ + Govind | | X | + Gopal | | X | +-------------------+-------------------+-------------------+ diff --git a/test/cache/CacheVerify/inputtest4.sql b/test/cache/CacheVerify/inputtest4.sql new file mode 100644 index 00000000..446ee6fd --- /dev/null +++ b/test/cache/CacheVerify/inputtest4.sql @@ -0,0 +1,3 @@ +CREATE TABLE t1 (f1 INT, f2 INT); +INSERT INTO t1 VALUES(1, 1111); +INSERT INTO t1 VALUES(2, 2222); diff --git a/test/cache/CacheVerify/inputtest5.sql b/test/cache/CacheVerify/inputtest5.sql new file mode 100644 index 00000000..db0d5e8b --- /dev/null +++ b/test/cache/CacheVerify/inputtest5.sql @@ -0,0 +1,3 @@ +CREATE TABLE t1 (f1 SMALLINT, f2 INT, primary key (f1) ); +INSERT INTO t1 VALUES(1, 2011); +INSERT INTO t1 VALUES(2, 1978); diff --git a/test/cache/CacheVerify/mysqldel.sql b/test/cache/CacheVerify/mysqldel.sql new file mode 100644 index 00000000..55516c42 --- /dev/null +++ b/test/cache/CacheVerify/mysqldel.sql @@ -0,0 +1 @@ +DELETE FROM t1 WHERE f1 <= 2; diff --git a/test/cache/CacheVerify/mysqldelete.sql b/test/cache/CacheVerify/mysqldelete.sql new file mode 100644 index 00000000..57c79347 --- /dev/null +++ b/test/cache/CacheVerify/mysqldelete.sql @@ -0,0 +1,2 @@ +delete from t1 where f1 = 3; +delete from t1 where f1 = 8; diff --git a/test/cache/CacheVerify/mysqlinput.sql b/test/cache/CacheVerify/mysqlinput.sql new file mode 100644 index 00000000..87502d9c --- /dev/null +++ b/test/cache/CacheVerify/mysqlinput.sql @@ -0,0 +1,11 @@ +CREATE TABLE t1 (f1 SMALLINT, f2 INT , f3 BIGINT , f4 CHAR (10), f5 FLOAT , f6 DOUBLE , f7 DATE , f8 TIME, primary key (f1) ); +INSERT INTO t1 VALUES(1, 2011, 111111111, 'Govind', 113.141, 111111111.111111, '1915/12/25', '11:42:35'); +INSERT INTO t1 VALUES(2, 1978, 222222222, 'Gopal', 114.567, 222222222.222222, '1926/05/16', '12:32:14'); +INSERT INTO t1 VALUES(3, 2008, 333333333, 'kishor', 122.700, 333333333.333333, '1937/08/15', '13:45:36'); +INSERT INTO t1 VALUES(4, 1973, 444444444, 'kiran', 142.718, 444444444.444444, '1946/12/25', '14:42:35'); +INSERT INTO t1 VALUES(5, 2005, 555555555, 'ganesh', 152.718, 555555555.555555, '1955/12/25', '15:42:35'); +INSERT INTO t1 VALUES(6, 1962, 666666666, 'suresh', 162.718, 666666666.666666, '1965/12/25', '16:42:35'); +INSERT INTO t1 VALUES(7, 1965, 777777777, 'Praba', 172.718, 777777777.777777, '1975/12/25', '17:42:35'); +INSERT INTO t1 VALUES(8, 1942, 888888888, 'karan', 182.718, 888888888.888888, '1985/12/25', '18:42:35'); +INSERT INTO t1 VALUES(9, 1956, 999999999, 'sharan', 192.718, 999999999.999999, '1995/12/25', '19:42:35'); +INSERT INTO t1 VALUES(10, 1999,101010101, 'vijay', 102.718, 111111111.999999, '1915/12/25', '20:42:35'); diff --git a/test/cache/CacheVerify/mysqlinput10.sql b/test/cache/CacheVerify/mysqlinput10.sql new file mode 100644 index 00000000..95b26fde --- /dev/null +++ b/test/cache/CacheVerify/mysqlinput10.sql @@ -0,0 +1,6 @@ +CREATE TABLE t1 (f1 TINYINT, f2 INT, f3 BIGINT, f4 CHAR(10), f5 FLOAT, primary key (f1) ); +INSERT INTO t1 VALUES(1, 1, 1, 'Govind', 100.111); +INSERT INTO t1 VALUES(2, 2, 2, 'Gopal', 200.222); +INSERT INTO t1 VALUES(3, 3, 3, 'kishor', 300.333); +INSERT INTO t1 VALUES(4, 4, 4, 'kiran', 400.444); +INSERT INTO t1 VALUES(5, 5, 5, 'ganesh', 500.555); diff --git a/test/cache/CacheVerify/mysqlinput11.sql b/test/cache/CacheVerify/mysqlinput11.sql new file mode 100644 index 00000000..5b14c2e4 --- /dev/null +++ b/test/cache/CacheVerify/mysqlinput11.sql @@ -0,0 +1,6 @@ +CREATE TABLE t1 (f1 TINYINT, f2 INT, f3 BIGINT, f4 CHAR(10), f5 FLOAT, primary key (f2) ); +INSERT INTO t1 VALUES(1, 1, 1, 'Govind', 100.111); +INSERT INTO t1 VALUES(2, 2, 2, 'Gopal', 200.222); +INSERT INTO t1 VALUES(3, 3, 3, 'kishor', 300.333); +INSERT INTO t1 VALUES(4, 4, 4, 'kiran', 400.444); +INSERT INTO t1 VALUES(5, 5, 5, 'ganesh', 500.555); diff --git a/test/cache/CacheVerify/mysqlinput12.sql b/test/cache/CacheVerify/mysqlinput12.sql new file mode 100644 index 00000000..33a08072 --- /dev/null +++ b/test/cache/CacheVerify/mysqlinput12.sql @@ -0,0 +1,6 @@ +CREATE TABLE t1 (f1 TINYINT, f2 INT, f3 BIGINT, f4 CHAR(10), f5 FLOAT, primary key (f3) ); +INSERT INTO t1 VALUES(1, 1, 1, 'Govind', 100.111); +INSERT INTO t1 VALUES(2, 2, 2, 'Gopal', 200.222); +INSERT INTO t1 VALUES(3, 3, 3, 'kishor', 300.333); +INSERT INTO t1 VALUES(4, 4, 4, 'kiran', 400.444); +INSERT INTO t1 VALUES(5, 5, 5, 'ganesh', 500.555); diff --git a/test/cache/CacheVerify/mysqlinput13.sql b/test/cache/CacheVerify/mysqlinput13.sql new file mode 100644 index 00000000..6dd496bb --- /dev/null +++ b/test/cache/CacheVerify/mysqlinput13.sql @@ -0,0 +1,6 @@ +CREATE TABLE t1 (f1 TINYINT, f2 INT, f3 BIGINT, f4 CHAR(10), f5 FLOAT, primary key (f4) ); +INSERT INTO t1 VALUES(1, 1, 1, 'Govind', 100.111); +INSERT INTO t1 VALUES(2, 2, 2, 'Gopal', 200.222); +INSERT INTO t1 VALUES(3, 3, 3, 'kishor', 300.333); +INSERT INTO t1 VALUES(4, 4, 4, 'kiran', 400.444); +INSERT INTO t1 VALUES(5, 5, 5, 'ganesh', 500.555); diff --git a/test/cache/CacheVerify/mysqlupd.sql b/test/cache/CacheVerify/mysqlupd.sql new file mode 100644 index 00000000..34553aa9 --- /dev/null +++ b/test/cache/CacheVerify/mysqlupd.sql @@ -0,0 +1 @@ +UPDATE t1 SET f5=150 WHERE f1 <=2; diff --git a/test/cache/CacheVerify/mysqlupdate.sql b/test/cache/CacheVerify/mysqlupdate.sql new file mode 100644 index 00000000..ede06453 --- /dev/null +++ b/test/cache/CacheVerify/mysqlupdate.sql @@ -0,0 +1,2 @@ +update t1 set f7 = '2020/02/20' where f1 = 7; +update t1 set f8 = '20:20:20' where f1 = 10; diff --git a/test/cache/CacheVerify/oracleinput.sql b/test/cache/CacheVerify/oracleinput.sql new file mode 100644 index 00000000..d9ec9edd --- /dev/null +++ b/test/cache/CacheVerify/oracleinput.sql @@ -0,0 +1,11 @@ +CREATE TABLE t1 (f1 number(4), f2 number(9) , f3 number(30) , f4 CHAR (10), f5 FLOAT , primary key (f1) ); +INSERT INTO t1 VALUES(1, 2011, 111111111, 'Govind', 113.141); +INSERT INTO t1 VALUES(2, 1978, 222222222, 'Gopal', 114.567); +INSERT INTO t1 VALUES(3, 2008, 333333333, 'kishor', 122.700); +INSERT INTO t1 VALUES(4, 1973, 444444444, 'kiran', 142.718); +INSERT INTO t1 VALUES(5, 2005, 555555555, 'ganesh', 152.718); +INSERT INTO t1 VALUES(6, 1962, 666666666, 'suresh', 162.718); +INSERT INTO t1 VALUES(7, 1965, 777777777, 'Praba', 172.718); +INSERT INTO t1 VALUES(8, 1942, 888888888, 'karan', 182.718); +INSERT INTO t1 VALUES(9, 1956, 999999999, 'sharan', 192.718); +INSERT INTO t1 VALUES(10, 1999,101010101, 'vijay', 102.718); diff --git a/test/cache/CacheVerify/oracleinput10.sql b/test/cache/CacheVerify/oracleinput10.sql new file mode 100644 index 00000000..ecec4c59 --- /dev/null +++ b/test/cache/CacheVerify/oracleinput10.sql @@ -0,0 +1,6 @@ +CREATE TABLE t1 (f1 number(4), f2 number(9) , f3 number(30) , f4 CHAR (10), f5 FLOAT , primary key (f1) ); +INSERT INTO t1 VALUES(1, 1, 1, 'Govind', 100.111); +INSERT INTO t1 VALUES(2, 2, 2, 'Gopal', 200.222); +INSERT INTO t1 VALUES(3, 3, 3, 'kishor', 300.333); +INSERT INTO t1 VALUES(4, 4, 4, 'kiran', 400.444); +INSERT INTO t1 VALUES(5, 5, 5, 'ganesh', 500.555); diff --git a/test/cache/CacheVerify/oracleinput11.sql b/test/cache/CacheVerify/oracleinput11.sql new file mode 100644 index 00000000..939e4009 --- /dev/null +++ b/test/cache/CacheVerify/oracleinput11.sql @@ -0,0 +1,6 @@ +CREATE TABLE t1 (f1 number(4), f2 number(9) , f3 number(30) , f4 CHAR (10), f5 FLOAT , primary key (f2) ); +INSERT INTO t1 VALUES(1, 1, 1, 'Govind', 100.111); +INSERT INTO t1 VALUES(2, 2, 2, 'Gopal', 200.222); +INSERT INTO t1 VALUES(3, 3, 3, 'kishor', 300.333); +INSERT INTO t1 VALUES(4, 4, 4, 'kiran', 400.444); +INSERT INTO t1 VALUES(5, 5, 5, 'ganesh', 500.555); diff --git a/test/cache/CacheVerify/oracleinput12.sql b/test/cache/CacheVerify/oracleinput12.sql new file mode 100644 index 00000000..14863c5a --- /dev/null +++ b/test/cache/CacheVerify/oracleinput12.sql @@ -0,0 +1,6 @@ +CREATE TABLE t1 (f1 number(4), f2 number(9) , f3 number(30) , f4 CHAR (10), f5 FLOAT , primary key (f3) ); +INSERT INTO t1 VALUES(1, 1, 1, 'Govind', 100.111); +INSERT INTO t1 VALUES(2, 2, 2, 'Gopal', 200.222); +INSERT INTO t1 VALUES(3, 3, 3, 'kishor', 300.333); +INSERT INTO t1 VALUES(4, 4, 4, 'kiran', 400.444); +INSERT INTO t1 VALUES(5, 5, 5, 'ganesh', 500.555); diff --git a/test/cache/CacheVerify/oracleinput13.sql b/test/cache/CacheVerify/oracleinput13.sql new file mode 100644 index 00000000..16d5b34c --- /dev/null +++ b/test/cache/CacheVerify/oracleinput13.sql @@ -0,0 +1,6 @@ +CREATE TABLE t1 (f1 number(4), f2 number(9) , f3 number(30) , f4 CHAR (10), f5 FLOAT , primary key (f4) ); +INSERT INTO t1 VALUES(1, 1, 1, 'Govind', 100.111); +INSERT INTO t1 VALUES(2, 2, 2, 'Gopal', 200.222); +INSERT INTO t1 VALUES(3, 3, 3, 'kishor', 300.333); +INSERT INTO t1 VALUES(4, 4, 4, 'kiran', 400.444); +INSERT INTO t1 VALUES(5, 5, 5, 'ganesh', 500.555); diff --git a/test/cache/CacheVerify/oracleupdate.sql b/test/cache/CacheVerify/oracleupdate.sql new file mode 100644 index 00000000..c14eec67 --- /dev/null +++ b/test/cache/CacheVerify/oracleupdate.sql @@ -0,0 +1,2 @@ +update t1 set f3 = '1234567890' where f1 = 7; +update t1 set f5 = '23434.343' where f1 = 10; diff --git a/test/cache/CacheVerify/psqlinput.sql b/test/cache/CacheVerify/psqlinput.sql new file mode 100644 index 00000000..b0702429 --- /dev/null +++ b/test/cache/CacheVerify/psqlinput.sql @@ -0,0 +1,11 @@ +CREATE TABLE t1 (f1 SMALLINT, f2 INT , f3 BIGINT , f4 CHAR (10), f5 float4 , f6 float8 , f7 DATE , f8 TIME, primary key (f1) ); +INSERT INTO t1 VALUES(1, 2011, 111111111, 'Govind', 113.141, 111111111.111111, '1915/12/25', '11:42:35'); +INSERT INTO t1 VALUES(2, 1978, 222222222, 'Gopal', 114.567, 222222222.222222, '1926/05/16', '12:32:14'); +INSERT INTO t1 VALUES(3, 2008, 333333333, 'kishor', 122.700, 333333333.333333, '1937/08/15', '13:45:36'); +INSERT INTO t1 VALUES(4, 1973, 444444444, 'kiran', 142.718, 444444444.444444, '1946/12/25', '14:42:35'); +INSERT INTO t1 VALUES(5, 2005, 555555555, 'ganesh', 152.718, 555555555.555555, '1955/12/25', '15:42:35'); +INSERT INTO t1 VALUES(6, 1962, 666666666, 'suresh', 162.718, 666666666.666666, '1965/12/25', '16:42:35'); +INSERT INTO t1 VALUES(7, 1965, 777777777, 'Praba', 172.718, 777777777.777777, '1975/12/25', '17:42:35'); +INSERT INTO t1 VALUES(8, 1942, 888888888, 'karan', 182.718, 888888888.888888, '1985/12/25', '18:42:35'); +INSERT INTO t1 VALUES(9, 1956, 999999999, 'sharan', 192.718, 999999999.999999, '1995/12/25', '19:42:35'); +INSERT INTO t1 VALUES(10, 1999,101010101, 'vijay', 102.718, 111111111.999999, '1915/12/25', '20:42:35'); diff --git a/test/cache/CacheVerify/psqlinput10.sql b/test/cache/CacheVerify/psqlinput10.sql new file mode 100644 index 00000000..7a2e40c7 --- /dev/null +++ b/test/cache/CacheVerify/psqlinput10.sql @@ -0,0 +1,6 @@ +CREATE TABLE t1 (f1 SMALLINT, f2 INT, f3 BIGINT, f4 CHAR (10), f5 float4, primary key (f1) ); +INSERT INTO t1 VALUES(1, 1, 1, 'Govind', 100.111); +INSERT INTO t1 VALUES(2, 2, 2, 'Gopal', 200.222); +INSERT INTO t1 VALUES(3, 3, 3, 'kishor', 300.333); +INSERT INTO t1 VALUES(4, 4, 4, 'kiran', 400.444); +INSERT INTO t1 VALUES(5, 5, 5, 'ganesh', 500.555); diff --git a/test/cache/CacheVerify/psqlinput11.sql b/test/cache/CacheVerify/psqlinput11.sql new file mode 100644 index 00000000..4a3333f1 --- /dev/null +++ b/test/cache/CacheVerify/psqlinput11.sql @@ -0,0 +1,6 @@ +CREATE TABLE t1 (f1 SMALLINT, f2 INT, f3 BIGINT, f4 CHAR (10), f5 float4, primary key (f2) ); +INSERT INTO t1 VALUES(1, 1, 1, 'Govind', 100.111); +INSERT INTO t1 VALUES(2, 2, 2, 'Gopal', 200.222); +INSERT INTO t1 VALUES(3, 3, 3, 'kishor', 300.333); +INSERT INTO t1 VALUES(4, 4, 4, 'kiran', 400.444); +INSERT INTO t1 VALUES(5, 5, 5, 'ganesh', 500.555); diff --git a/test/cache/CacheVerify/psqlinput12.sql b/test/cache/CacheVerify/psqlinput12.sql new file mode 100644 index 00000000..fea9f1ef --- /dev/null +++ b/test/cache/CacheVerify/psqlinput12.sql @@ -0,0 +1,6 @@ +CREATE TABLE t1 (f1 SMALLINT, f2 INT, f3 BIGINT, f4 CHAR (10), f5 float4, primary key (f3) ); +INSERT INTO t1 VALUES(1, 1, 1, 'Govind', 100.111); +INSERT INTO t1 VALUES(2, 2, 2, 'Gopal', 200.222); +INSERT INTO t1 VALUES(3, 3, 3, 'kishor', 300.333); +INSERT INTO t1 VALUES(4, 4, 4, 'kiran', 400.444); +INSERT INTO t1 VALUES(5, 5, 5, 'ganesh', 500.555); diff --git a/test/cache/CacheVerify/psqlinput13.sql b/test/cache/CacheVerify/psqlinput13.sql new file mode 100644 index 00000000..7e0fa606 --- /dev/null +++ b/test/cache/CacheVerify/psqlinput13.sql @@ -0,0 +1,6 @@ +CREATE TABLE t1 (f1 SMALLINT, f2 INT, f3 BIGINT, f4 CHAR (10), f5 float4, primary key (f4) ); +INSERT INTO t1 VALUES(1, 1, 1, 'Govind', 100.111); +INSERT INTO t1 VALUES(2, 2, 2, 'Gopal', 200.222); +INSERT INTO t1 VALUES(3, 3, 3, 'kishor', 300.333); +INSERT INTO t1 VALUES(4, 4, 4, 'kiran', 400.444); +INSERT INTO t1 VALUES(5, 5, 5, 'ganesh', 500.555); diff --git a/test/cache/CacheVerify/sybaseinput.sql b/test/cache/CacheVerify/sybaseinput.sql new file mode 100644 index 00000000..0221aa0f --- /dev/null +++ b/test/cache/CacheVerify/sybaseinput.sql @@ -0,0 +1,11 @@ +CREATE TABLE t1 (f1 SMALLINT, f2 INT , f3 BIGINT , f4 CHAR (10), f5 REAL , f6 FLOAT , f7 DATE , f8 TIME, primary key (f1) ); +INSERT INTO t1 VALUES(1, 2011, 111111111, 'Govind', 113.141, 111111111.111111, '1915/12/25', '11:42:35'); +INSERT INTO t1 VALUES(2, 1978, 222222222, 'Gopal', 114.567, 222222222.222222, '1926/05/16', '12:32:14'); +INSERT INTO t1 VALUES(3, 2008, 333333333, 'kishor', 122.700, 333333333.333333, '1937/08/15', '13:45:36'); +INSERT INTO t1 VALUES(4, 1973, 444444444, 'kiran', 142.718, 444444444.444444, '1946/12/25', '14:42:35'); +INSERT INTO t1 VALUES(5, 2005, 555555555, 'ganesh', 152.718, 555555555.555555, '1955/12/25', '15:42:35'); +INSERT INTO t1 VALUES(6, 1962, 666666666, 'suresh', 162.718, 666666666.666666, '1965/12/25', '16:42:35'); +INSERT INTO t1 VALUES(7, 1965, 777777777, 'Praba', 172.718, 777777777.777777, '1975/12/25', '17:42:35'); +INSERT INTO t1 VALUES(8, 1942, 888888888, 'karan', 182.718, 888888888.888888, '1985/12/25', '18:42:35'); +INSERT INTO t1 VALUES(9, 1956, 999999999, 'sharan', 192.718, 999999999.999999, '1995/12/25', '19:42:35'); +INSERT INTO t1 VALUES(10, 1999,101010101, 'vijay', 102.718, 111111111.999999, '1915/12/25', '20:42:35'); diff --git a/test/cache/CacheVerify/sybaseinput10.sql b/test/cache/CacheVerify/sybaseinput10.sql new file mode 100644 index 00000000..0c26fb2e --- /dev/null +++ b/test/cache/CacheVerify/sybaseinput10.sql @@ -0,0 +1,6 @@ +CREATE TABLE t1 (f1 TINYINT, f2 INT, f3 BIGINT, f4 CHAR (10), f5 REAL, primary key (f1) ); +INSERT INTO t1 VALUES(1, 1, 1, 'Govind', 100.111); +INSERT INTO t1 VALUES(2, 2, 2, 'Gopal', 200.222); +INSERT INTO t1 VALUES(3, 3, 3, 'kishor', 300.333); +INSERT INTO t1 VALUES(4, 4, 4, 'kiran', 400.444); +INSERT INTO t1 VALUES(5, 5, 5, 'ganesh', 500.555); diff --git a/test/cache/CacheVerify/sybaseinput11.sql b/test/cache/CacheVerify/sybaseinput11.sql new file mode 100644 index 00000000..6a9f04d9 --- /dev/null +++ b/test/cache/CacheVerify/sybaseinput11.sql @@ -0,0 +1,6 @@ +CREATE TABLE t1 (f1 TINYINT, f2 INT, f3 BIGINT, f4 CHAR (10), f5 REAL, primary key (f2) ); +INSERT INTO t1 VALUES(1, 1, 1, 'Govind', 100.111); +INSERT INTO t1 VALUES(2, 2, 2, 'Gopal', 200.222); +INSERT INTO t1 VALUES(3, 3, 3, 'kishor', 300.333); +INSERT INTO t1 VALUES(4, 4, 4, 'kiran', 400.444); +INSERT INTO t1 VALUES(5, 5, 5, 'ganesh', 500.555); diff --git a/test/cache/CacheVerify/sybaseinput12.sql b/test/cache/CacheVerify/sybaseinput12.sql new file mode 100644 index 00000000..56923275 --- /dev/null +++ b/test/cache/CacheVerify/sybaseinput12.sql @@ -0,0 +1,6 @@ +CREATE TABLE t1 (f1 TINYINT, f2 INT, f3 BIGINT, f4 CHAR (10), f5 REAL, primary key (f3) ); +INSERT INTO t1 VALUES(1, 1, 1, 'Govind', 100.111); +INSERT INTO t1 VALUES(2, 2, 2, 'Gopal', 200.222); +INSERT INTO t1 VALUES(3, 3, 3, 'kishor', 300.333); +INSERT INTO t1 VALUES(4, 4, 4, 'kiran', 400.444); +INSERT INTO t1 VALUES(5, 5, 5, 'ganesh', 500.555); diff --git a/test/cache/CacheVerify/sybaseinput13.sql b/test/cache/CacheVerify/sybaseinput13.sql new file mode 100644 index 00000000..8a01f72f --- /dev/null +++ b/test/cache/CacheVerify/sybaseinput13.sql @@ -0,0 +1,6 @@ +CREATE TABLE t1 (f1 TINYINT, f2 INT, f3 BIGINT, f4 CHAR (10), f5 REAL, primary key (f4) ); +INSERT INTO t1 VALUES(1, 1, 1, 'Govind', 100.111); +INSERT INTO t1 VALUES(2, 2, 2, 'Gopal', 200.222); +INSERT INTO t1 VALUES(3, 3, 3, 'kishor', 300.333); +INSERT INTO t1 VALUES(4, 4, 4, 'kiran', 400.444); +INSERT INTO t1 VALUES(5, 5, 5, 'ganesh', 500.555); diff --git a/test/cache/CacheVerify/test001.ksh b/test/cache/CacheVerify/test001.ksh new file mode 100755 index 00000000..b4beee36 --- /dev/null +++ b/test/cache/CacheVerify/test001.ksh @@ -0,0 +1,22 @@ +#!/bin/ksh +# Test Case +# 1. Check for help message: $ cacheverify -? + +cp $CSQL_CONFIG_FILE /tmp/csql.conf +export CSQL_CONFIG_FILE=/tmp/csql.conf +DS="$DSN $DBUSER $PASSWORD" +echo DSN=$DSN >>$CSQL_CONFIG_FILE +rm -f /tmp/csql/csqlds.conf +touch /tmp/csql/csqlds.conf +$CSQL_INSTALL_ROOT/bin/csqlds -U $DBUSER -P $PASSWORD -D $DSN -N $TDB -a +if [ $? -ne 0 ] +then + exit 1; +fi +$CSQL_INSTALL_ROOT/bin/cacheverify ? +if [ $? -ne 0 ] +then + exit 1; +fi +exit 0; + diff --git a/test/cache/CacheVerify/test002.ksh b/test/cache/CacheVerify/test002.ksh new file mode 100755 index 00000000..2ee438e4 --- /dev/null +++ b/test/cache/CacheVerify/test002.ksh @@ -0,0 +1,90 @@ +#!/bin/ksh +# Test Case +# 2. Create table t1 with primary key in mysql. Cache the table in csql. +# Check for user authentication: +# $ cacheverify [-U username] [-P password] -t t1 +# by entering +# a. correct username correct password - should pass +# b. correct username wrong password - should return error +# c. wrong username correct password - should return error +# d. wrong username wrong password - should return error + +#Run this test only under csql/test or on this directory. +#Otherwise, it may fail + +input=${PWD}/cache/CacheVerify/inputtest4.sql +REL_PATH=. +if [ -s "$input" ] +then + REL_PATH=${PWD}/cache/CacheVerify +fi +cp $CSQL_CONFIG_FILE /tmp/csql.conf +export CSQL_CONFIG_FILE=/tmp/csql.conf +echo CACHE_TABLE=true >>$CSQL_CONFIG_FILE +echo DSN=$DSN >>$CSQL_CONFIG_FILE +DS="$DSN $DBUSER $PASSWORD" +rm -f /tmp/csql/csqlds.conf +touch /tmp/csql/csqlds.conf +$CSQL_INSTALL_ROOT/bin/csqlds -U $DBUSER -P $PASSWORD -D $DSN -N $TDB -a +if [ $? -ne 0 ] +then + exit 1; +fi + +isql $DS < ${REL_PATH}/inputtest4.sql >/dev/null 2>&1 +if [ $? -ne 0 ] +then + exit 1; +fi + +rm -f /tmp/csql/csqltable.conf +touch /tmp/csql/csqltable.conf +#$CSQL_INSTALL_ROOT/bin/csql -s ${REL_PATH}/inputtest4.sql > /dev/null 2>&1 +$CSQL_INSTALL_ROOT/bin/cachetable -t t1 +#> /dev/null 2>&1 +if [ $? -ne 0 ] +then + isql $DS < ${REL_PATH}/drop.sql >/dev/null 2>&1 + exit 2; +fi + + +# check with correct username and correct password +$CSQL_INSTALL_ROOT/bin/cacheverify -U root -P manager -t t1 +#> /dev/null 2>&1 +if [ $? -ne 0 ] +then + isql $DS < ${REL_PATH}/drop.sql >/dev/null 2>&1 + exit 3; +fi + +# correct username and wrong password +$CSQL_INSTALL_ROOT/bin/cacheverify -U root -P MANAGER -t t1 > /dev/null 2>&1 +if [ $? -eq 0 ] +then + isql $DS < ${REL_PATH}/drop.sql >/dev/null 2>&1 + exit 4; +fi + +# wrong username and correct password +$CSQL_INSTALL_ROOT/bin/cacheverify -U ROOT -P manager -t t1 > /dev/null 2>&1 +if [ $? -eq 0 ] +then + isql $DS < ${REL_PATH}/drop.sql >/dev/null 2>&1 + exit 5; +fi + +#wrong username and wrong password +$CSQL_INSTALL_ROOT/bin/cacheverify -U ROOT -P MANAGER -t t1 > /dev/null 2>&1 +if [ $? -eq 0 ] +then + isql $DS < ${REL_PATH}/drop.sql >/dev/null 2>&1 + exit 6; +fi + +rm -f /tmp/csql/csqltable.conf +touch /tmp/csql/csqltable.conf +$CSQL_INSTALL_ROOT/bin/csql -s ${REL_PATH}/drop.sql > /dev/null 2>&1 +isql $DS < ${REL_PATH}/drop.sql >/dev/null 2>&1 +exit 0; + diff --git a/test/cache/CacheVerify/test003.ksh b/test/cache/CacheVerify/test003.ksh new file mode 100755 index 00000000..bcfb7559 --- /dev/null +++ b/test/cache/CacheVerify/test003.ksh @@ -0,0 +1,24 @@ +#!/bin/ksh +# Test Case +# 3. Run cacheverify on a non existing table. +# It should give an error saying the table is not present. + +cp $CSQL_CONFIG_FILE /tmp/csql.conf +export CSQL_CONFIG_FILE=/tmp/csql.conf +DS="$DSN $DBUSER $PASSWORD" +echo DSN=$DSN >>$CSQL_CONFIG_FILE +rm -f /tmp/csql/csqlds.conf +touch /tmp/csql/csqlds.conf +$CSQL_INSTALL_ROOT/bin/csqlds -U $DBUSER -P $PASSWORD -D $DSN -N $TDB -a +if [ $? -ne 0 ] +then + exit 1; +fi +$CSQL_INSTALL_ROOT/bin/cacheverify -t not_exists > /dev/null 2>&1 +if [ $? -eq 0 ] +then + exit 1; +fi + +exit 0; + diff --git a/test/cache/CacheVerify/test004.ksh b/test/cache/CacheVerify/test004.ksh new file mode 100755 index 00000000..05a25ff8 --- /dev/null +++ b/test/cache/CacheVerify/test004.ksh @@ -0,0 +1,90 @@ +#!/bin/ksh +# Test Case +# 4. Create a table t1 with no primary key in mysql. and insert 2 tuples. +# Cache the table in csql. +# Run cacheverify -t t1. +# It should display number of records for csql and mysql respectively. +# Run cacheverify -t t1 -p. +# It should give an error saying no primary key is present on table t1. +# Run cacheverify -t t1 -f. +# It should give an error saying no primary key is present on table t1. + +#Run this test only under csql/test or on this directory. +#Otherwise, it may fail + +input=${PWD}/cache/CacheVerify/inputtest4.sql +REL_PATH=. +if [ -s "$input" ] +then + REL_PATH=${PWD}/cache/CacheVerify +fi + +cp $CSQL_CONFIG_FILE /tmp/csql.conf +export CSQL_CONFIG_FILE=/tmp/csql.conf +echo CACHE_TABLE=true >>$CSQL_CONFIG_FILE +echo DSN=$DSN >>$CSQL_CONFIG_FILE +DS="$DSN $DBUSER $PASSWORD" +rm -f /tmp/csql/csqlds.conf +touch /tmp/csql/csqlds.conf +$CSQL_INSTALL_ROOT/bin/csqlds -U $DBUSER -P $PASSWORD -D $DSN -N $TDB -a +if [ $? -ne 0 ] +then + exit 1; +fi + +if [ $DSN = "oracle" ] + then + isql $DS < ${REL_PATH}/inputtest4.oracle > /dev/null 2>&1 + if [ $? -ne 0 ] + then + exit 1; + fi + else + isql $DS < ${REL_PATH}/inputtest4.sql > /dev/null 2>&1 + if [ $? -ne 0 ] + then + exit 1; + fi +fi +if [ $? -ne 0 ] +then + exit 1; +fi + +rm -f /tmp/csql/csqltable.conf +touch /tmp/csql/csqltable.conf +echo "1 t1 NULL NULL NULL $DSN" >/tmp/csql/csqltable.conf +sleep 2 +$CSQL_INSTALL_ROOT/bin/cachetable -t t1 -R>/dev/null 2>&1 +if [ $? -ne 0 ] +then + isql $DS < ${REL_PATH}/drop.sql > /dev/null 2>&1 + exit 2; +fi + +$CSQL_INSTALL_ROOT/bin/cacheverify -t t1 +if [ $? -ne 0 ] +then + isql $DS < ${REL_PATH}/drop.sql > /dev/null 2>&1 + exit 3; +fi + +$CSQL_INSTALL_ROOT/bin/cacheverify -t t1 -p +if [ $? -eq 0 ] +then + isql $DS < ${REL_PATH}/drop.sql > /dev/null 2>&1 + exit 4; +fi + +$CSQL_INSTALL_ROOT/bin/cacheverify -t t1 -f +if [ $? -eq 0 ] +then + isql $DS < ${REL_PATH}/drop.sql > /dev/null 2>&1 + exit 5; +fi + +rm -f /tmp/csql/csqltable.conf +touch /tmp/csql/csqltable.conf +isql $DS < ${REL_PATH}/drop.sql > /dev/null 2>&1 +$CSQL_INSTALL_ROOT/bin/csql -s ${REL_PATH}/drop.sql > /dev/null 2>&1 +exit 0; diff --git a/test/cache/CacheVerify/test005.ksh b/test/cache/CacheVerify/test005.ksh new file mode 100755 index 00000000..7dbe620a --- /dev/null +++ b/test/cache/CacheVerify/test005.ksh @@ -0,0 +1,47 @@ +#!/bin/ksh +# Test Case +# 5. Create table t1 with primary key in csql. +# Make sure that t1 is not present in mysql and +# csqltable.conf file does not have any entry for t1. +# run $ cacheverify -t t1. +# It should give an error saying table t1 is not cached. + +#Run this test only under csql/test or on this directory. +#Otherwise, it may fail + +input=${PWD}/cache/CacheVerify/mysqlinput.sql +REL_PATH=. +if [ -s "$input" ] +then + REL_PATH=${PWD}/cache/CacheVerify +fi +cp $CSQL_CONFIG_FILE /tmp/csql.conf +export CSQL_CONFIG_FILE=/tmp/csql.conf +echo CACHE_TABLE=true >>$CSQL_CONFIG_FILE +echo DSN=$DSN >>$CSQL_CONFIG_FILE +DS="$DSN $DBUSER $PASSWORD" +rm -f /tmp/csql/csqlds.conf +touch /tmp/csql/csqlds.conf +$CSQL_INSTALL_ROOT/bin/csqlds -U $DBUSER -P $PASSWORD -D $DSN -N $TDB -a +if [ $? -ne 0 ] +then + exit 1; +fi + +$CSQL_INSTALL_ROOT/bin/csql -s ${REL_PATH}/mysqlinput.sql >/dev/null 2>&1 +if [ $? -ne 0 ] +then + exit 1; +fi + +rm -f /tmp/csql/csqltable.conf +touch /tmp/csql/csqltable.conf + +$CSQL_INSTALL_ROOT/bin/cacheverify -t t1 +if [ $? -ne 5 ] +then + exit 2; +fi + +$CSQL_INSTALL_ROOT/bin/csql -s ${REL_PATH}/drop.sql >/dev/null 2>&1 +exit 0; diff --git a/test/cache/CacheVerify/test006.ksh b/test/cache/CacheVerify/test006.ksh new file mode 100755 index 00000000..07de8d5c --- /dev/null +++ b/test/cache/CacheVerify/test006.ksh @@ -0,0 +1,102 @@ +#!/bin/ksh +# Test Case +# 6. Create table t1 in mysql with primary key. Insert 10 rows. +# Cache the table in csql. +# Run $ cacheverify -t t1 +# The output should display the number of records present in csql +# and mysql separately. +# Run $ cacheverify -t t1 -p +# The output should display no missing records in either database. +# Run $ cacheverify -t t1 -f +# The output should display no missing records and should display +# the data is consistent in both databases. + + +#Run this test only under csql/test or on this directory. +#Otherwise, it may fail + +input=${PWD}/cache/CacheVerify/mysqlinput.sql +REL_PATH=. +if [ -s "$input" ] +then + REL_PATH=${PWD}/cache/CacheVerify +fi + +cp $CSQL_CONFIG_FILE /tmp/csql.conf +export CSQL_CONFIG_FILE=/tmp/csql.conf +echo CACHE_TABLE=true >>$CSQL_CONFIG_FILE +echo DSN=$DSN >>$CSQL_CONFIG_FILE +DS="$DSN $DBUSER $PASSWORD" +rm -f /tmp/csql/csqlds.conf +touch /tmp/csql/csqlds.conf +$CSQL_INSTALL_ROOT/bin/csqlds -U $DBUSER -P $PASSWORD -D $DSN -N $TDB -a +if [ $? -ne 0 ] +then + exit 1; +fi + +if [ $DSN = "oracle" ] +then + isql $DS < ${REL_PATH}/oracleinput.sql >/dev/null 2>&1 + if [ $? -ne 0 ] + then + exit 1; + fi +elif [ $DSN = "myodbc3" ] +then + isql $DS < ${REL_PATH}/mysqlinput.sql >/dev/null 2>&1 + if [ $? -ne 0 ] + then + exit 1; + fi +elif [ $DSN = "sybase" ] +then + isql $DS < ${REL_PATH}/sybaseinput.sql >/dev/null 2>&1 + if [ $? -ne 0 ] + then + exit 1; + fi +elif [ $DSN = "db2" ] +then + isql $DS < ${REL_PATH}/db2input.sql >/dev/null 2>&1 + if [ $? -ne 0 ] + then + exit 1; + fi +else + isql $DS < ${REL_PATH}/psqlinput.sql >/dev/null 2>&1 + if [ $? -ne 0 ] + then + exit 1; + fi + +fi +rm -f /tmp/csql/csqltable.conf +touch /tmp/csql/csqltable.conf + + +$CSQL_INSTALL_ROOT/bin/cachetable -t t1 +if [ $? -ne 0 ] +then + exit 2; +fi + +$CSQL_INSTALL_ROOT/bin/cacheverify -t t1 +if [ $? -ne 0 ] +then + exit 3; +fi + +$CSQL_INSTALL_ROOT/bin/cacheverify -t t1 -p +if [ $? -ne 0 ] +then + exit 4; +fi + +$CSQL_INSTALL_ROOT/bin/cacheverify -t t1 -f +if [ $? -ne 0 ] +then + exit 5; +fi + +exit 0; diff --git a/test/cache/CacheVerify/test007.ksh b/test/cache/CacheVerify/test007.ksh new file mode 100755 index 00000000..b3c32a9e --- /dev/null +++ b/test/cache/CacheVerify/test007.ksh @@ -0,0 +1,68 @@ +#!/bin/ksh +# Test Case +# 7. For the above scenario, +# delete 3 tuples from csql and +# delete 2 tuples from mysql. +# Run $ cacheverify -t t1. +# The output should display number of records as 7 and 8 for csql and +# mysql respectively. +# Run $ cacheverify -t t1 -p. +# The output should display the primary key field values for missing +# records in either of the databases in ascending order. +# Run $ cacheverify -t t1 -f. +# The output should display the records are consistent for the same +# primary key. + +#Run this test only under csql/test or on this directory. +#Otherwise, it may fail + +input=${PWD}/cache/CacheVerify/csqldelete.sql +REL_PATH=. +if [ -s "$input" ] +then + REL_PATH=${PWD}/cache/CacheVerify +fi + +$CSQL_INSTALL_ROOT/bin/csql -s ${REL_PATH}/csqldelete.sql >/dev/null 2>&1 +if [ $? -ne 0 ] +then + exit 1; +fi + +cp $CSQL_CONFIG_FILE /tmp/csql.conf +export CSQL_CONFIG_FILE=/tmp/csql.conf +echo DSN=$DSN >>$CSQL_CONFIG_FILE +DS="$DSN $DBUSER $PASSWORD" +rm -f /tmp/csql/csqlds.conf +touch /tmp/csql/csqlds.conf +$CSQL_INSTALL_ROOT/bin/csqlds -U $DBUSER -P $PASSWORD -D $DSN -N $TDB -a +if [ $? -ne 0 ] +then + exit 1; +fi + +isql $DS < ${REL_PATH}/mysqldelete.sql >/dev/null 2>&1 +if [ $? -ne 0 ] +then + exit 2; +fi + +$CSQL_INSTALL_ROOT/bin/cacheverify -t t1 +if [ $? -ne 0 ] +then + exit 3; +fi + +$CSQL_INSTALL_ROOT/bin/cacheverify -t t1 -p +if [ $? -ne 0 ] +then + exit 4; +fi + +$CSQL_INSTALL_ROOT/bin/cacheverify -t t1 -f +if [ $? -ne 0 ] +then + exit 5; +fi + +exit 0; diff --git a/test/cache/CacheVerify/test008.ksh b/test/cache/CacheVerify/test008.ksh new file mode 100755 index 00000000..8e970672 --- /dev/null +++ b/test/cache/CacheVerify/test008.ksh @@ -0,0 +1,103 @@ +#!/bin/ksh +# Test Case + +# 8. For the previous scenario update 2 rows in csql and update 2 rows in mysql with different primary keys. +# Run $ cacheverify -t t1. +# The output should display number of records as 7 and 8 for csql +# and mysql respectively. +# Run $ cacheverify -t t1 -p. +# The output should display the primary key field values for missing +# records in either of the databases in ascending order. +# Run $ cacheverify -t t1 -f. +# The output should display the 4 inconsistent records. Only those +# fields with different values should be displayed for inconsistent +# records. + +#Run this test only under csql/test or on this directory. +#Otherwise, it may fail + +input=${PWD}/cache/CacheVerify/csqlupdate.sql +REL_PATH=. +if [ -s "$input" ] +then + REL_PATH=${PWD}/cache/CacheVerify +fi + +$CSQL_INSTALL_ROOT/bin/csql -s ${REL_PATH}/csqlupdate.sql >/dev/null 2>&1 +if [ $? -ne 0 ] +then + exit 1; +fi + +cp $CSQL_CONFIG_FILE /tmp/csql.conf +export CSQL_CONFIG_FILE=/tmp/csql.conf +echo DSN=$DSN >>$CSQL_CONFIG_FILE +DS="$DSN $DBUSER $PASSWORD" +rm -f /tmp/csql/csqlds.conf +touch /tmp/csql/csqlds.conf +$CSQL_INSTALL_ROOT/bin/csqlds -U $DBUSER -P $PASSWORD -D $DSN -N $TDB -a +if [ $? -ne 0 ] +then + exit 1; +fi + +if [ $DSN = "oracle" ] +then + isql $DS < ${REL_PATH}/oracleupdate.sql >/dev/null 2>&1 + if [ $? -ne 0 ] + then + isql $DS < $REL_PATH/drop.sql >/dev/null 2>&1 + exit 2; + fi +else + if [ $DSN = "db2" ] + then + isql $DS < ${REL_PATH}/db2update.sql >/dev/null 2>&1 + if [ $? -ne 0 ] + then + isql $DS < $REL_PATH/drop.sql >/dev/null 2>&1 + exit 2; + fi + else + isql $DS < ${REL_PATH}/mysqlupdate.sql >/dev/null 2>&1 + if [ $? -ne 0 ] + then + isql $DS < $REL_PATH/drop.sql >/dev/null 2>&1 + exit 2; + fi + fi +fi + +$CSQL_INSTALL_ROOT/bin/cacheverify -t t1 +if [ $? -ne 0 ] +then + rm -f /tmp/csql/csqltable.conf + touch /tmp/csql/csqltable.conf + isql $DS < $REL_PATH/drop.sql >/dev/null 2>&1 + exit 3; +fi + +$CSQL_INSTALL_ROOT/bin/cacheverify -t t1 -p +if [ $? -ne 0 ] +then + rm -f /tmp/csql/csqltable.conf + touch /tmp/csql/csqltable.conf + isql $DS < $REL_PATH/drop.sql >/dev/null 2>&1 + exit 4; +fi + +$CSQL_INSTALL_ROOT/bin/cacheverify -t t1 -f +if [ $? -ne 0 ] +then + rm -f /tmp/csql/csqltable.conf + touch /tmp/csql/csqltable.conf + isql $DS < $REL_PATH/drop.sql >/dev/null 2>&1 + exit 5; +fi + +rm -f /tmp/csql/csqltable.conf +touch /tmp/csql/csqltable.conf +isql $DS < $REL_PATH/drop.sql >/dev/null 2>&1 +$CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/drop.sql >/dev/null 2>&1 + +exit 0; diff --git a/test/cache/CacheVerify/test009.ksh b/test/cache/CacheVerify/test009.ksh new file mode 100755 index 00000000..4a784bfc --- /dev/null +++ b/test/cache/CacheVerify/test009.ksh @@ -0,0 +1,164 @@ +#!/bin/ksh +# Test Case +# 9. Create table t1 in mysql with primary key. Insert 10 rows. +# Cache the table in csql. +# Update 2 rows in csql and 2 rows in mysql with different primary keys. +# Run $ cacheverify -t t1. +# The output should display number of records as 10 for both csql and +# mysql respectively. +# Run $ cacheverify -t t1 -p. +# The output should display no missing records in either of the +# databases. +# Run $ cacheverify -t t1 -f. +# The output should display the 4 inconsistent records. +# Only those fields with different values should be displayed +# for inconsistent records. + +#Run this test only under csql/test or on this directory. +#Otherwise, it may fail + +input=${PWD}/cache/CacheVerify/mysqlinput.sql +REL_PATH=. +if [ -s "$input" ] +then + REL_PATH=${PWD}/cache/CacheVerify +fi + +cp $CSQL_CONFIG_FILE /tmp/csql.conf +export CSQL_CONFIG_FILE=/tmp/csql.conf +echo DSN=$DSN >>$CSQL_CONFIG_FILE +DS="$DSN $DBUSER $PASSWORD" +rm -f /tmp/csql/csqlds.conf +touch /tmp/csql/csqlds.conf +$CSQL_INSTALL_ROOT/bin/csqlds -U $DBUSER -P $PASSWORD -D $DSN -N $TDB -a +if [ $? -ne 0 ] +then + exit 1; +fi +if [ $DSN = "myodbc3" ] + then + isql $DS < ${REL_PATH}/mysqlinput.sql >/dev/null 2>&1 + if [ $? -ne 0 ] + then + exit 1; + fi +elif [ "$DSN" = "oracle" ] +then + isql $DS < ${REL_PATH}/oracleinput.sql >/dev/null 2>&1 + if [ $? -ne 0 ] + then + exit 1; + fi +elif [ "$DSN" = "sybase" ] +then + isql $DS < ${REL_PATH}/oracleinput.sql >/dev/null 2>&1 + if [ $? -ne 0 ] + then + exit 1; + fi +elif [ "$DSN" = "db2" ] +then + isql $DS < ${REL_PATH}/db2input.sql >/dev/null 2>&1 + if [ $? -ne 0 ] + then + exit 1; + fi +else + isql $DS < ${REL_PATH}/psqlinput.sql >/dev/null 2>&1 + if [ $? -ne 0 ] + then + exit 1; + fi +fi + +if [ "$DSN" = "oracle" ] +then + $CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/csqloracleinput.sql >/dev/null 2>&1 + if [ $? -ne 0 ] + then + isql $DS < $REL_PATH/drop.sql >/dev/null 2>&1 + exit 2; + fi +else + $CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/mysqlinput.sql >/dev/null 2>&1 + if [ $? -ne 0 ] + then + isql $DS < $REL_PATH/drop.sql >/dev/null 2>&1 + exit 2; + fi +fi +echo "1 t1 NULL NULL NULL $DSN" > /tmp/csql/csqltable.conf + + +if [ "$DSN" = "oracle" ] +then + isql $DS < ${REL_PATH}/oracleupdate.sql >/dev/null 2>&1 + if [ $? -ne 0 ] + then + rm -f /tmp/csql/csqltable.conf + touch /tmp/csql/csqltable.conf + isql $DS < $REL_PATH/drop.sql >/dev/null 2>&1 + exit 3; + fi +else + if [ $DSN = "db2" ] + then + isql $DS < ${REL_PATH}/db2update.sql >/dev/null 2>&1 + if [ $? -ne 0 ] + then + isql $DS < $REL_PATH/drop.sql >/dev/null 2>&1 + exit 3; + fi + else + isql $DS < ${REL_PATH}/mysqlupdate.sql >/dev/null 2>&1 + if [ $? -ne 0 ] + then + isql $DS < $REL_PATH/drop.sql >/dev/null 2>&1 + exit 3; + fi + fi +fi + +$CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/csqlupdate.sql >/dev/null 2>&1 +if [ $? -ne 0 ] +then + rm -f /tmp/csql/csqltable.conf + touch /tmp/csql/csqltable.conf + isql $DS < $REL_PATH/drop.sql >/dev/null 2>&1 + exit 4; +fi + +$CSQL_INSTALL_ROOT/bin/cacheverify -t t1 +if [ $? -ne 0 ] +then + echo $? + rm -f /tmp/csql/csqltable.conf + touch /tmp/csql/csqltable.conf + isql $DS < $REL_PATH/drop.sql >/dev/null 2>&1 + exit 5; +fi + +$CSQL_INSTALL_ROOT/bin/cacheverify -t t1 -p +if [ $? -ne 0 ] +then + rm -f /tmp/csql/csqltable.conf + touch /tmp/csql/csqltable.conf + isql $DS < $REL_PATH/drop.sql >/dev/null 2>&1 + exit 6; +fi + +$CSQL_INSTALL_ROOT/bin/cacheverify -t t1 -f +if [ $? -ne 0 ] +then + rm -f /tmp/csql/csqltable.conf + touch /tmp/csql/csqltable.conf + isql $DS < $REL_PATH/drop.sql >/dev/null 2>&1 + exit 7; +fi + +rm -f /tmp/csql/csqltable.conf +touch /tmp/csql/csqltable.conf +isql $DS < $REL_PATH/drop.sql >/dev/null 2>&1 +$CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/drop.sql >/dev/null 2>&1 + +exit 0; diff --git a/test/cache/CacheVerify/test010.ksh b/test/cache/CacheVerify/test010.ksh new file mode 100755 index 00000000..0f582e0c --- /dev/null +++ b/test/cache/CacheVerify/test010.ksh @@ -0,0 +1,207 @@ +#!/bin/ksh +# Test Case +#cacheverify test after all Non-select dml (primary key on tinyint field) (cache/CacheVerify/test010.ksh) +#Create table t1 in mysql with primary key on tinyint field. Insert 5 rows. +#Cache the table in csql. +#Run $ cacheverify -t t1. The output should display the number of records present in csql and mysql same. +#Run $ cacheverify -t t1 -p. The output should display no missing records in either database. +#Run $ cacheverify -t t1 -f. The output should display no missing records and should display the data is consistent in both databases. +#Update 2 records in csql using csql -g. +#Run $ cacheverify -t t1 -f +#The output should display no missing records and should display the data is consistent in both databases. +#delete 2 records in csql using csql -g. +#Run $ cacheverify -t t1 -p +#The output should display no missing records in either database. +#Update 2 records in Mysql. +#Run $ cacheverify -t t1 -f. +#The output should display the 4 inconsistent records. Only those fields with different values should be displayed for inconsistent records. +#delete 2 records in Mysql. +#Run $ cacheverify -t t1 -p. +#The output should display the primary key field values for missing records in either of the databases in ascending order. + +input=${PWD}/cache/CacheVerify/mysqlinput10.sql +REL_PATH=. +if [ -s "$input" ] +then + REL_PATH=${PWD}/cache/CacheVerify +fi + +rm -f /tmp/csql/csqltable.conf +touch /tmp/csql/csqltable.conf + +cp $CSQL_CONFIG_FILE /tmp/csql.conf +export CSQL_CONFIG_FILE=/tmp/csql.conf +echo CACHE_TABLE=true>>$CSQL_CONFIG_FILE +echo DSN=$DSN >>$CSQL_CONFIG_FILE +DS="$DSN $DBUSER $PASSWORD" +rm -f /tmp/csql/csqlds.conf +touch /tmp/csql/csqlds.conf +$CSQL_INSTALL_ROOT/bin/csqlds -U $DBUSER -P $PASSWORD -D $DSN -N $TDB -a +if [ $? -ne 0 ] +then + exit 1; +fi + +if [ $DSN = "myodbc3" ] +then + isql $DS < ${REL_PATH}/mysqlinput10.sql >/dev/null 2>&1 +elif [ $DSN = "oracle" ] +then + isql $DS < ${REL_PATH}/oracleinput10.sql >/dev/null 2>&1 +elif [ $DSN = "sybase" ] +then + isql $DS < ${REL_PATH}/sybaseinput10.sql >/dev/null 2>&1 +elif [ $DSN = "db2" ] +then + isql $DS < ${REL_PATH}/db2input10.sql >/dev/null 2>&1 +else + isql $DS < ${REL_PATH}/psqlinput10.sql >/dev/null 2>&1 +fi +if [ $? -ne 0 ] +then + rm -f /tmp/csql/csqltable.conf + touch /tmp/csql/csqltable.conf + isql $DS < $REL_PATH/drop.sql >/dev/null 2>&1 + exit 2; +fi +rm -f /tmp/csql/csqltable.conf +touch /tmp/csql/csqltable.conf + +sleep 1 +$CSQL_INSTALL_ROOT/bin/cachetable -t t1 +if [ $? -ne 0 ] +then + rm -f /tmp/csql/csqltable.conf + touch /tmp/csql/csqltable.conf + isql $DS < $REL_PATH/drop.sql >/dev/null 2>&1 + $CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/drop.sql >/dev/null 2>&1 + exit 3; +fi + +sleep 1 +echo cacheverify -t t1 +$CSQL_INSTALL_ROOT/bin/cacheverify -t t1 +if [ $? -ne 0 ] +then + rm -f /tmp/csql/csqltable.conf + touch /tmp/csql/csqltable.conf + isql $DS < $REL_PATH/drop.sql >/dev/null 2>&1 + $CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/drop.sql >/dev/null 2>&1 + exit 4; +fi + +echo cacheverify -t t1 -p +$CSQL_INSTALL_ROOT/bin/cacheverify -t t1 -p +if [ $? -ne 0 ] +then + rm -f /tmp/csql/csqltable.conf + touch /tmp/csql/csqltable.conf + isql $DS < $REL_PATH/drop.sql >/dev/null 2>&1 + $CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/drop.sql >/dev/null 2>&1 + exit 5; +fi + +echo cacheverify -t t1 -f +$CSQL_INSTALL_ROOT/bin/cacheverify -t t1 -f +if [ $? -ne 0 ] +then + rm -f /tmp/csql/csqltable.conf + touch /tmp/csql/csqltable.conf + isql $DS < $REL_PATH/drop.sql >/dev/null 2>&1 + $CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/drop.sql >/dev/null 2>&1 + exit 6; +fi + +echo updating 2 records in csql through gateway +$CSQL_INSTALL_ROOT/bin/csql -g -s ${REL_PATH}/csqlupd.sql >/dev/null 2>&1 +if [ $? -ne 0 ] +then + rm -f /tmp/csql/csqltable.conf + touch /tmp/csql/csqltable.conf + isql $DS < $REL_PATH/drop.sql >/dev/null 2>&1 + $CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/drop.sql >/dev/null 2>&1 + exit 7; +fi + +echo cacheverify -t t1 -f +$CSQL_INSTALL_ROOT/bin/cacheverify -t t1 -f +if [ $? -ne 0 ] +then + rm -f /tmp/csql/csqltable.conf + touch /tmp/csql/csqltable.conf + isql $DS < $REL_PATH/drop.sql >/dev/null 2>&1 + $CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/drop.sql >/dev/null 2>&1 + exit 8; +fi + +echo deleting 2 records in csql through gateway +$CSQL_INSTALL_ROOT/bin/csql -g -s ${REL_PATH}/csqldel.sql >/dev/null 2>&1 +if [ $? -ne 0 ] +then + rm -f /tmp/csql/csqltable.conf + touch /tmp/csql/csqltable.conf + isql $DS < $REL_PATH/drop.sql >/dev/null 2>&1 + $CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/drop.sql >/dev/null 2>&1 + exit 9; +fi + +echo cacheverify -t t1 -p +$CSQL_INSTALL_ROOT/bin/cacheverify -t t1 -p +if [ $? -ne 0 ] +then + rm -f /tmp/csql/csqltable.conf + touch /tmp/csql/csqltable.conf + isql $DS < $REL_PATH/drop.sql >/dev/null 2>&1 + $CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/drop.sql >/dev/null 2>&1 + exit 10; +fi + +echo updating 2 records in mysql +isql $DS < ${REL_PATH}/mysqlupd.sql >/dev/null 2>&1 +if [ $? -ne 0 ] +then + rm -f /tmp/csql/csqltable.conf + touch /tmp/csql/csqltable.conf + isql $DS < $REL_PATH/drop.sql >/dev/null 2>&1 + $CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/drop.sql >/dev/null 2>&1 + exit 11; +fi + +echo cacheverify -t t1 -f +$CSQL_INSTALL_ROOT/bin/cacheverify -t t1 -f +if [ $? -ne 0 ] +then + rm -f /tmp/csql/csqltable.conf + touch /tmp/csql/csqltable.conf + isql $DS < $REL_PATH/drop.sql >/dev/null 2>&1 + $CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/drop.sql >/dev/null 2>&1 + exit 12; +fi + +echo deleting 2 records in mysql +isql $DS < ${REL_PATH}/mysqldel.sql >/dev/null 2>&1 +if [ $? -ne 0 ] +then + rm -f /tmp/csql/csqltable.conf + touch /tmp/csql/csqltable.conf + isql $DS < $REL_PATH/drop.sql >/dev/null 2>&1 + $CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/drop.sql >/dev/null 2>&1 + exit 13; +fi + +echo cacheverify -t t1 -p +$CSQL_INSTALL_ROOT/bin/cacheverify -t t1 -p +if [ $? -ne 0 ] +then + rm -f /tmp/csql/csqltable.conf + touch /tmp/csql/csqltable.conf + isql $DS < $REL_PATH/drop.sql >/dev/null 2>&1 + $CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/drop.sql >/dev/null 2>&1 + exit 14; +fi + +rm -f /tmp/csql/csqltable.conf +touch /tmp/csql/csqltable.conf +isql $DS < $REL_PATH/drop.sql >/dev/null 2>&1 +$CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/drop.sql >/dev/null 2>&1 +exit 0; diff --git a/test/cache/CacheVerify/test011.ksh b/test/cache/CacheVerify/test011.ksh new file mode 100755 index 00000000..9c0744c6 --- /dev/null +++ b/test/cache/CacheVerify/test011.ksh @@ -0,0 +1,208 @@ +#!/bin/ksh +# Test Case +#cacheverify test after all Non-select dml (primary key on int field) (cache/CacheVerify/test010.ksh) +#Create table t1 in mysql with primary key on int field. Insert 5 rows. +#Cache the table in csql. +#Run $ cacheverify -t t1. The output should display the number of records present in csql and mysql same. +#Run $ cacheverify -t t1 -p. The output should display no missing records in either database. +#Run $ cacheverify -t t1 -f. The output should display no missing records and should display the data is consistent in both databases. +#Update 2 records in csql using csql -g. +#Run $ cacheverify -t t1 -f +#The output should display no missing records and should display the data is consistent in both databases. +#delete 2 records in csql using csql -g. +#Run $ cacheverify -t t1 -p +#The output should display no missing records in either database. +#Update 2 records in Mysql. +#Run $ cacheverify -t t1 -f. +#The output should display the 4 inconsistent records. Only those fields with different values should be displayed for inconsistent records. +#delete 2 records in Mysql. +#Run $ cacheverify -t t1 -p. +#The output should display the primary key field values for missing records in either of the databases in ascending order. + +input=${PWD}/cache/CacheVerify/mysqlinput10.sql +REL_PATH=. +if [ -s "$input" ] +then + REL_PATH=${PWD}/cache/CacheVerify +fi + +rm -f /tmp/csql/csqltable.conf +touch /tmp/csql/csqltable.conf + +cp $CSQL_CONFIG_FILE /tmp/csql.conf +export CSQL_CONFIG_FILE=/tmp/csql.conf +echo DSN=$DSN >>$CSQL_CONFIG_FILE +echo CACHE_TABLE=true>>$CSQL_CONFIG_FILE +DS="$DSN $DBUSER $PASSWORD" +rm -f /tmp/csql/csqlds.conf +touch /tmp/csql/csqlds.conf +$CSQL_INSTALL_ROOT/bin/csqlds -U $DBUSER -P $PASSWORD -D $DSN -N $TDB -a +if [ $? -ne 0 ] +then + exit 1; +fi + +if [ $DSN = "myodbc3" ] +then + isql $DS < ${REL_PATH}/mysqlinput11.sql >/dev/null 2>&1 +elif [ $DSN = "oracle" ] +then + isql $DS < ${REL_PATH}/oracleinput11.sql >/dev/null 2>&1 +elif [ $DSN = "sybase" ] +then + isql $DS < ${REL_PATH}/sybaseinput11.sql >/dev/null 2>&1 +elif [ $DSN = "db2" ] +then + isql $DS < ${REL_PATH}/db2input11.sql >/dev/null 2>&1 +else + isql $DS < ${REL_PATH}/psqlinput11.sql >/dev/null 2>&1 +fi +if [ $? -ne 0 ] +then + rm -f /tmp/csql/csqltable.conf + touch /tmp/csql/csqltable.conf + isql $DS < $REL_PATH/drop.sql >/dev/null 2>&1 + exit 2; +fi +rm -f /tmp/csql/csqltable.conf +touch /tmp/csql/csqltable.conf + +sleep 1 + +$CSQL_INSTALL_ROOT/bin/cachetable -t t1 +if [ $? -ne 0 ] +then + rm -f /tmp/csql/csqltable.conf + touch /tmp/csql/csqltable.conf + isql $DS < $REL_PATH/drop.sql >/dev/null 2>&1 + $CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/drop.sql >/dev/null 2>&1 + exit 3; +fi + +sleep 1 +echo cacheverify -t t1 +$CSQL_INSTALL_ROOT/bin/cacheverify -t t1 +if [ $? -ne 0 ] +then + rm -f /tmp/csql/csqltable.conf + touch /tmp/csql/csqltable.conf + isql $DS < $REL_PATH/drop.sql >/dev/null 2>&1 + $CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/drop.sql >/dev/null 2>&1 + exit 4; +fi + +echo cacheverify -t t1 -p +$CSQL_INSTALL_ROOT/bin/cacheverify -t t1 -p +if [ $? -ne 0 ] +then + rm -f /tmp/csql/csqltable.conf + touch /tmp/csql/csqltable.conf + isql $DS < $REL_PATH/drop.sql >/dev/null 2>&1 + $CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/drop.sql >/dev/null 2>&1 + exit 5; +fi + +echo cacheverify -t t1 -f +$CSQL_INSTALL_ROOT/bin/cacheverify -t t1 -f +if [ $? -ne 0 ] +then + rm -f /tmp/csql/csqltable.conf + touch /tmp/csql/csqltable.conf + isql $DS < $REL_PATH/drop.sql >/dev/null 2>&1 + $CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/drop.sql >/dev/null 2>&1 + exit 6; +fi + +echo updating 2 records in csql through gateway +$CSQL_INSTALL_ROOT/bin/csql -g -s ${REL_PATH}/csqlupd.sql >/dev/null 2>&1 +if [ $? -ne 0 ] +then + rm -f /tmp/csql/csqltable.conf + touch /tmp/csql/csqltable.conf + isql $DS < $REL_PATH/drop.sql >/dev/null 2>&1 + $CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/drop.sql >/dev/null 2>&1 + exit 7; +fi + +echo cacheverify -t t1 -f +$CSQL_INSTALL_ROOT/bin/cacheverify -t t1 -f +if [ $? -ne 0 ] +then + rm -f /tmp/csql/csqltable.conf + touch /tmp/csql/csqltable.conf + isql $DS < $REL_PATH/drop.sql >/dev/null 2>&1 + $CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/drop.sql >/dev/null 2>&1 + exit 8; +fi + +echo deleting 2 records in csql through gateway +$CSQL_INSTALL_ROOT/bin/csql -g -s ${REL_PATH}/csqldel.sql >/dev/null 2>&1 +if [ $? -ne 0 ] +then + rm -f /tmp/csql/csqltable.conf + touch /tmp/csql/csqltable.conf + isql $DS < $REL_PATH/drop.sql >/dev/null 2>&1 + $CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/drop.sql >/dev/null 2>&1 + exit 9; +fi + +echo cacheverify -t t1 -p +$CSQL_INSTALL_ROOT/bin/cacheverify -t t1 -p +if [ $? -ne 0 ] +then + rm -f /tmp/csql/csqltable.conf + touch /tmp/csql/csqltable.conf + isql $DS < $REL_PATH/drop.sql >/dev/null 2>&1 + $CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/drop.sql >/dev/null 2>&1 + exit 10; +fi + +echo updating 2 records in mysql +isql $DS < ${REL_PATH}/mysqlupd.sql >/dev/null 2>&1 +if [ $? -ne 0 ] +then + rm -f /tmp/csql/csqltable.conf + touch /tmp/csql/csqltable.conf + isql $DS < $REL_PATH/drop.sql >/dev/null 2>&1 + $CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/drop.sql >/dev/null 2>&1 + exit 11; +fi + +echo cacheverify -t t1 -f +$CSQL_INSTALL_ROOT/bin/cacheverify -t t1 -f +if [ $? -ne 0 ] +then + rm -f /tmp/csql/csqltable.conf + touch /tmp/csql/csqltable.conf + isql $DS < $REL_PATH/drop.sql >/dev/null 2>&1 + $CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/drop.sql >/dev/null 2>&1 + exit 12; +fi + +echo deleting 2 records in mysql +isql $DS < ${REL_PATH}/mysqldel.sql >/dev/null 2>&1 +if [ $? -ne 0 ] +then + rm -f /tmp/csql/csqltable.conf + touch /tmp/csql/csqltable.conf + isql $DS < $REL_PATH/drop.sql >/dev/null 2>&1 + $CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/drop.sql >/dev/null 2>&1 + exit 13; +fi + +echo cacheverify -t t1 -p +$CSQL_INSTALL_ROOT/bin/cacheverify -t t1 -p +if [ $? -ne 0 ] +then + rm -f /tmp/csql/csqltable.conf + touch /tmp/csql/csqltable.conf + isql $DS < $REL_PATH/drop.sql >/dev/null 2>&1 + $CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/drop.sql >/dev/null 2>&1 + exit 14; +fi + +rm -f /tmp/csql/csqltable.conf +touch /tmp/csql/csqltable.conf +isql $DS < $REL_PATH/drop.sql >/dev/null 2>&1 +$CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/drop.sql >/dev/null 2>&1 +exit 0; diff --git a/test/cache/CacheVerify/test012.ksh b/test/cache/CacheVerify/test012.ksh new file mode 100755 index 00000000..02768e33 --- /dev/null +++ b/test/cache/CacheVerify/test012.ksh @@ -0,0 +1,208 @@ +#!/bin/ksh +# Test Case +#cacheverify test after all Non-select dml (primary key on bigint field) (cache/CacheVerify/test010.ksh) +#Create table t1 in mysql with primary key on bigint field. Insert 5 rows. +#Cache the table in csql. +#Run $ cacheverify -t t1. The output should display the number of records present in csql and mysql same. +#Run $ cacheverify -t t1 -p. The output should display no missing records in either database. +#Run $ cacheverify -t t1 -f. The output should display no missing records and should display the data is consistent in both databases. +#Update 2 records in csql using csql -g. +#Run $ cacheverify -t t1 -f +#The output should display no missing records and should display the data is consistent in both databases. +#delete 2 records in csql using csql -g. +#Run $ cacheverify -t t1 -p +#The output should display no missing records in either database. +#Update 2 records in Mysql. +#Run $ cacheverify -t t1 -f. +#The output should display the 4 inconsistent records. Only those fields with different values should be displayed for inconsistent records. +#delete 2 records in Mysql. +#Run $ cacheverify -t t1 -p. +#The output should display the primary key field values for missing records in either of the databases in ascending order. + +input=${PWD}/cache/CacheVerify/mysqlinput10.sql +REL_PATH=. +if [ -s "$input" ] +then + REL_PATH=${PWD}/cache/CacheVerify +fi + +rm -f /tmp/csql/csqltable.conf +touch /tmp/csql/csqltable.conf + +cp $CSQL_CONFIG_FILE /tmp/csql.conf +export CSQL_CONFIG_FILE=/tmp/csql.conf +echo DSN=$DSN >>$CSQL_CONFIG_FILE +echo CACHE_TABLE=true>>$CSQL_CONFIG_FILE +DS="$DSN $DBUSER $PASSWORD" +rm -f /tmp/csql/csqlds.conf +touch /tmp/csql/csqlds.conf +$CSQL_INSTALL_ROOT/bin/csqlds -U $DBUSER -P $PASSWORD -D $DSN -N $TDB -a +if [ $? -ne 0 ] +then + exit 1; +fi + +if [ $DSN = "myodbc3" ] +then + isql $DS < ${REL_PATH}/mysqlinput12.sql >/dev/null 2>&1 +elif [ $DSN = "oracle" ] +then + isql $DS < ${REL_PATH}/oracleinput12.sql >/dev/null 2>&1 +elif [ $DSN = "sybase" ] +then + isql $DS < ${REL_PATH}/sybaseinput12.sql >/dev/null 2>&1 +elif [ $DSN = "db2" ] +then + isql $DS < ${REL_PATH}/db2input12.sql >/dev/null 2>&1 +else + isql $DS < ${REL_PATH}/psqlinput12.sql >/dev/null 2>&1 +fi +if [ $? -ne 0 ] +then + rm -f /tmp/csql/csqltable.conf + touch /tmp/csql/csqltable.conf + isql $DS < $REL_PATH/drop.sql >/dev/null 2>&1 + exit 2; +fi +rm -f /tmp/csql/csqltable.conf +touch /tmp/csql/csqltable.conf + +sleep 1 + +$CSQL_INSTALL_ROOT/bin/cachetable -t t1 +if [ $? -ne 0 ] +then + rm -f /tmp/csql/csqltable.conf + touch /tmp/csql/csqltable.conf + isql $DS < $REL_PATH/drop.sql >/dev/null 2>&1 + $CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/drop.sql >/dev/null 2>&1 + exit 3; +fi + +sleep 1 +echo cacheverify -t t1 +$CSQL_INSTALL_ROOT/bin/cacheverify -t t1 +if [ $? -ne 0 ] +then + rm -f /tmp/csql/csqltable.conf + touch /tmp/csql/csqltable.conf + isql $DS < $REL_PATH/drop.sql >/dev/null 2>&1 + $CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/drop.sql >/dev/null 2>&1 + exit 4; +fi + +echo cacheverify -t t1 -p +$CSQL_INSTALL_ROOT/bin/cacheverify -t t1 -p +if [ $? -ne 0 ] +then + rm -f /tmp/csql/csqltable.conf + touch /tmp/csql/csqltable.conf + isql $DS < $REL_PATH/drop.sql >/dev/null 2>&1 + $CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/drop.sql >/dev/null 2>&1 + exit 5; +fi + +echo cacheverify -t t1 -f +$CSQL_INSTALL_ROOT/bin/cacheverify -t t1 -f +if [ $? -ne 0 ] +then + rm -f /tmp/csql/csqltable.conf + touch /tmp/csql/csqltable.conf + isql $DS < $REL_PATH/drop.sql >/dev/null 2>&1 + $CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/drop.sql >/dev/null 2>&1 + exit 6; +fi + +echo updating 2 records in csql through gateway +$CSQL_INSTALL_ROOT/bin/csql -g -s ${REL_PATH}/csqlupd.sql >/dev/null 2>&1 +if [ $? -ne 0 ] +then + rm -f /tmp/csql/csqltable.conf + touch /tmp/csql/csqltable.conf + isql $DS < $REL_PATH/drop.sql >/dev/null 2>&1 + $CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/drop.sql >/dev/null 2>&1 + exit 7; +fi + +echo cacheverify -t t1 -f +$CSQL_INSTALL_ROOT/bin/cacheverify -t t1 -f +if [ $? -ne 0 ] +then + rm -f /tmp/csql/csqltable.conf + touch /tmp/csql/csqltable.conf + isql $DS < $REL_PATH/drop.sql >/dev/null 2>&1 + $CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/drop.sql >/dev/null 2>&1 + exit 8; +fi + +echo deleting 2 records in csql through gateway +$CSQL_INSTALL_ROOT/bin/csql -g -s ${REL_PATH}/csqldel.sql >/dev/null 2>&1 +if [ $? -ne 0 ] +then + rm -f /tmp/csql/csqltable.conf + touch /tmp/csql/csqltable.conf + isql $DS < $REL_PATH/drop.sql >/dev/null 2>&1 + $CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/drop.sql >/dev/null 2>&1 + exit 9; +fi + +echo cacheverify -t t1 -p +$CSQL_INSTALL_ROOT/bin/cacheverify -t t1 -p +if [ $? -ne 0 ] +then + rm -f /tmp/csql/csqltable.conf + touch /tmp/csql/csqltable.conf + isql $DS < $REL_PATH/drop.sql >/dev/null 2>&1 + $CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/drop.sql >/dev/null 2>&1 + exit 10; +fi + +echo updating 2 records in mysql +isql $DS < ${REL_PATH}/mysqlupd.sql >/dev/null 2>&1 +if [ $? -ne 0 ] +then + rm -f /tmp/csql/csqltable.conf + touch /tmp/csql/csqltable.conf + isql $DS < $REL_PATH/drop.sql >/dev/null 2>&1 + $CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/drop.sql >/dev/null 2>&1 + exit 11; +fi + +echo cacheverify -t t1 -f +$CSQL_INSTALL_ROOT/bin/cacheverify -t t1 -f +if [ $? -ne 0 ] +then + rm -f /tmp/csql/csqltable.conf + touch /tmp/csql/csqltable.conf + isql $DS < $REL_PATH/drop.sql >/dev/null 2>&1 + $CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/drop.sql >/dev/null 2>&1 + exit 12; +fi + +echo deleting 2 records in mysql +isql $DS < ${REL_PATH}/mysqldel.sql >/dev/null 2>&1 +if [ $? -ne 0 ] +then + rm -f /tmp/csql/csqltable.conf + touch /tmp/csql/csqltable.conf + isql $DS < $REL_PATH/drop.sql >/dev/null 2>&1 + $CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/drop.sql >/dev/null 2>&1 + exit 13; +fi + +echo cacheverify -t t1 -p +$CSQL_INSTALL_ROOT/bin/cacheverify -t t1 -p +if [ $? -ne 0 ] +then + rm -f /tmp/csql/csqltable.conf + touch /tmp/csql/csqltable.conf + isql $DS < $REL_PATH/drop.sql >/dev/null 2>&1 + $CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/drop.sql >/dev/null 2>&1 + exit 14; +fi + +rm -f /tmp/csql/csqltable.conf +touch /tmp/csql/csqltable.conf +isql $DS < $REL_PATH/drop.sql >/dev/null 2>&1 +$CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/drop.sql >/dev/null 2>&1 +exit 0; diff --git a/test/cache/CacheVerify/test013.ksh b/test/cache/CacheVerify/test013.ksh new file mode 100755 index 00000000..a1bca552 --- /dev/null +++ b/test/cache/CacheVerify/test013.ksh @@ -0,0 +1,208 @@ +#!/bin/ksh +# Test Case +#cacheverify test after all Non-select dml (primary key on char field) (cache/CacheVerify/test010.ksh) +#Create table t1 in mysql with primary key on char field. Insert 5 rows. +#Cache the table in csql. +#Run $ cacheverify -t t1. The output should display the number of records present in csql and mysql same. +#Run $ cacheverify -t t1 -p. The output should display no missing records in either database. +#Run $ cacheverify -t t1 -f. The output should display no missing records and should display the data is consistent in both databases. +#Update 2 records in csql using csql -g. +#Run $ cacheverify -t t1 -f +#The output should display no missing records and should display the data is consistent in both databases. +#delete 2 records in csql using csql -g. +#Run $ cacheverify -t t1 -p +#The output should display no missing records in either database. +#Update 2 records in Mysql. +#Run $ cacheverify -t t1 -f. +#The output should display the 4 inconsistent records. Only those fields with different values should be displayed for inconsistent records. +#delete 2 records in Mysql. +#Run $ cacheverify -t t1 -p. +#The output should display the primary key field values for missing records in either of the databases in ascending order. + +input=${PWD}/cache/CacheVerify/mysqlinput10.sql +REL_PATH=. +if [ -s "$input" ] +then + REL_PATH=${PWD}/cache/CacheVerify +fi + +rm -f /tmp/csql/csqltable.conf +touch /tmp/csql/csqltable.conf + +cp $CSQL_CONFIG_FILE /tmp/csql.conf +export CSQL_CONFIG_FILE=/tmp/csql.conf +echo CACHE_TABLE=true>>$CSQL_CONFIG_FILE +echo DSN=$DSN >>$CSQL_CONFIG_FILE +DS="$DSN $DBUSER $PASSWORD" +rm -f /tmp/csql/csqlds.conf +touch /tmp/csql/csqlds.conf +$CSQL_INSTALL_ROOT/bin/csqlds -U $DBUSER -P $PASSWORD -D $DSN -N $TDB -a +if [ $? -ne 0 ] +then + exit 1; +fi + +if [ $DSN = "myodbc3" ] +then + isql $DS < ${REL_PATH}/mysqlinput13.sql >/dev/null 2>&1 +elif [ $DSN = "oracle" ] +then + isql $DS < ${REL_PATH}/oracleinput13.sql >/dev/null 2>&1 +elif [ $DSN = "sybase" ] +then + isql $DS < ${REL_PATH}/sybaseinput13.sql >/dev/null 2>&1 +elif [ $DSN = "db2" ] +then + isql $DS < ${REL_PATH}/db2input13.sql >/dev/null 2>&1 +else + isql $DS < ${REL_PATH}/psqlinput13.sql >/dev/null 2>&1 +fi +if [ $? -ne 0 ] +then + rm -f /tmp/csql/csqltable.conf + touch /tmp/csql/csqltable.conf + isql $DS < $REL_PATH/drop.sql >/dev/null 2>&1 + exit 2; +fi +rm -f /tmp/csql/csqltable.conf +touch /tmp/csql/csqltable.conf + +sleep 1 + +$CSQL_INSTALL_ROOT/bin/cachetable -t t1 +if [ $? -ne 0 ] +then + rm -f /tmp/csql/csqltable.conf + touch /tmp/csql/csqltable.conf + isql $DS < $REL_PATH/drop.sql >/dev/null 2>&1 + $CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/drop.sql >/dev/null 2>&1 + exit 3; +fi + +sleep 1 +echo cacheverify -t t1 +$CSQL_INSTALL_ROOT/bin/cacheverify -t t1 +if [ $? -ne 0 ] +then + rm -f /tmp/csql/csqltable.conf + touch /tmp/csql/csqltable.conf + isql $DS < $REL_PATH/drop.sql >/dev/null 2>&1 + $CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/drop.sql >/dev/null 2>&1 + exit 4; +fi + +echo cacheverify -t t1 -p +$CSQL_INSTALL_ROOT/bin/cacheverify -t t1 -p +if [ $? -ne 0 ] +then + rm -f /tmp/csql/csqltable.conf + touch /tmp/csql/csqltable.conf + isql $DS < $REL_PATH/drop.sql >/dev/null 2>&1 + $CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/drop.sql >/dev/null 2>&1 + exit 5; +fi + +echo cacheverify -t t1 -f +$CSQL_INSTALL_ROOT/bin/cacheverify -t t1 -f +if [ $? -ne 0 ] +then + rm -f /tmp/csql/csqltable.conf + touch /tmp/csql/csqltable.conf + isql $DS < $REL_PATH/drop.sql >/dev/null 2>&1 + $CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/drop.sql >/dev/null 2>&1 + exit 6; +fi + +echo updating 2 records in csql through gateway +$CSQL_INSTALL_ROOT/bin/csql -g -s ${REL_PATH}/csqlupd.sql >/dev/null 2>&1 +if [ $? -ne 0 ] +then + rm -f /tmp/csql/csqltable.conf + touch /tmp/csql/csqltable.conf + isql $DS < $REL_PATH/drop.sql >/dev/null 2>&1 + $CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/drop.sql >/dev/null 2>&1 + exit 7; +fi + +echo cacheverify -t t1 -f +$CSQL_INSTALL_ROOT/bin/cacheverify -t t1 -f +if [ $? -ne 0 ] +then + rm -f /tmp/csql/csqltable.conf + touch /tmp/csql/csqltable.conf + isql $DS < $REL_PATH/drop.sql >/dev/null 2>&1 + $CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/drop.sql >/dev/null 2>&1 + exit 8; +fi + +echo deleting 2 records in csql through gateway +$CSQL_INSTALL_ROOT/bin/csql -g -s ${REL_PATH}/csqldel.sql >/dev/null 2>&1 +if [ $? -ne 0 ] +then + rm -f /tmp/csql/csqltable.conf + touch /tmp/csql/csqltable.conf + isql $DS < $REL_PATH/drop.sql >/dev/null 2>&1 + $CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/drop.sql >/dev/null 2>&1 + exit 9; +fi + +echo cacheverify -t t1 -p +$CSQL_INSTALL_ROOT/bin/cacheverify -t t1 -p +if [ $? -ne 0 ] +then + rm -f /tmp/csql/csqltable.conf + touch /tmp/csql/csqltable.conf + isql $DS < $REL_PATH/drop.sql >/dev/null 2>&1 + $CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/drop.sql >/dev/null 2>&1 + exit 10; +fi + +echo updating 2 records in mysql +isql $DS < ${REL_PATH}/mysqlupd.sql >/dev/null 2>&1 +if [ $? -ne 0 ] +then + rm -f /tmp/csql/csqltable.conf + touch /tmp/csql/csqltable.conf + isql $DS < $REL_PATH/drop.sql >/dev/null 2>&1 + $CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/drop.sql >/dev/null 2>&1 + exit 11; +fi + +echo cacheverify -t t1 -f +$CSQL_INSTALL_ROOT/bin/cacheverify -t t1 -f +if [ $? -ne 0 ] +then + rm -f /tmp/csql/csqltable.conf + touch /tmp/csql/csqltable.conf + isql $DS < $REL_PATH/drop.sql >/dev/null 2>&1 + $CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/drop.sql >/dev/null 2>&1 + exit 12; +fi + +echo deleting 2 records in mysql +isql $DS < ${REL_PATH}/mysqldel.sql >/dev/null 2>&1 +if [ $? -ne 0 ] +then + rm -f /tmp/csql/csqltable.conf + touch /tmp/csql/csqltable.conf + isql $DS < $REL_PATH/drop.sql >/dev/null 2>&1 + $CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/drop.sql >/dev/null 2>&1 + exit 13; +fi + +echo cacheverify -t t1 -p +$CSQL_INSTALL_ROOT/bin/cacheverify -t t1 -p +if [ $? -ne 0 ] +then + rm -f /tmp/csql/csqltable.conf + touch /tmp/csql/csqltable.conf + isql $DS < $REL_PATH/drop.sql >/dev/null 2>&1 + $CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/drop.sql >/dev/null 2>&1 + exit 14; +fi + +rm -f /tmp/csql/csqltable.conf +touch /tmp/csql/csqltable.conf +isql $DS < $REL_PATH/drop.sql >/dev/null 2>&1 +$CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/drop.sql >/dev/null 2>&1 +exit 0; diff --git a/test/cache/DDL/csql.conf b/test/cache/DDL/csql.conf new file mode 100644 index 00000000..b0785fd2 --- /dev/null +++ b/test/cache/DDL/csql.conf @@ -0,0 +1,117 @@ +# 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=1048576 + +#Maximum size of the user database file. +MAX_DB_SIZE=10485760 + +#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 + +#Log level 0->no logging 1->Fine 2->Finer 3->Finest +LOG_LEVEL=0 + +#Give full path for the log file where important system actions are stored. +LOG_FILE=/tmp/csql/log/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 + +# Can be set true only when DURABILITY is true +MMAP=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=true + +#Set cache id for multiple bidirectional cache node for single data source +SITE_ID=1 + +# Name of Target Database (mysql ,postgres, oracle etc...) +#TARGET_DATABASE=mysql + +#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 + +#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 table information is stored +TABLE_CONFIG_FILE=/tmp/csql/csqltable.conf + +#Give full path of the file where all the DSN information is stored +DS_CONFIG_FILE=/tmp/csql/csqlds.conf + +#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/cache/DDL/csqlinputtest1.sql b/test/cache/DDL/csqlinputtest1.sql new file mode 100644 index 00000000..6e163058 --- /dev/null +++ b/test/cache/DDL/csqlinputtest1.sql @@ -0,0 +1,3 @@ +CREATE TABLE t1 (f1 SMALLINT, f2 INT, f3 BIGINT, f4 CHAR (20), f5 FLOAT, f6 DOUBLE, f7 DATE, f8 TIME, f9 TIMESTAMP, primary key(f1)); +INSERT INTO t1 VALUES(1, 2010, 121212121, 'Prasad', 112.718, 111111111.222222, '2005/12/25', '21:42:35', '2005/12/25 21:42:35'); +INSERT INTO t1 VALUES(2, 2069, 131313131, 'jiten', 122.718, 222222222.333333, '2025/12/25', '22:42:35', '2025/12/25 22:42:35'); diff --git a/test/cache/DDL/db2inputtest1.sql b/test/cache/DDL/db2inputtest1.sql new file mode 100644 index 00000000..a7f9ca93 --- /dev/null +++ b/test/cache/DDL/db2inputtest1.sql @@ -0,0 +1,11 @@ +CREATE TABLE t1 (f1 SMALLINT NOT NULL primary key, f2 INT , f3 BIGINT , f4 CHAR (10), f5 REAL , f6 FLOAT , f7 DATE , f8 TIME , f9 TIMESTAMP ); +INSERT INTO t1 VALUES(1, 2011, 111111111, 'Govind', 113.141, 111111111.111111, '1915/12/25', '11:42:35', '1971/12/25 11:42:35'); +INSERT INTO t1 VALUES(2, 1978, 222222222, 'Gopal', 114.567, 222222222.222222, '1926/05/16', '12:32:14', '1972/05/16 12:32:14'); +INSERT INTO t1 VALUES(3, 2008, 333333333, 'kishor', 122.700, 333333333.333333, '1937/08/15', '13:45:36', '1973/08/15 13:45:36'); +INSERT INTO t1 VALUES(4, 1973, 444444444, 'kiran', 142.718, 444444444.444444, '1946/12/25', '14:42:35', '1974/12/25 14:42:35'); +INSERT INTO t1 VALUES(5, 2005, 555555555, 'ganesh', 152.718, 555555555.555555, '1955/12/25', '15:42:35', '1975/12/25 15:42:35'); +INSERT INTO t1 VALUES(6, 1962, 666666666, 'suresh', 162.718, 666666666.666666, '1965/12/25', '16:42:35', '1976/12/25 16:42:35'); +INSERT INTO t1 VALUES(7, 1965, 777777777, 'Praba', 172.718, 777777777.777777, '1975/12/25', '17:42:35', '1977/12/25 17:42:35'); +INSERT INTO t1 VALUES(8, 1942, 888888888, 'karan', 182.718, 888888888.888888, '1985/12/25', '18:42:35', '1978/12/25 18:42:35'); +INSERT INTO t1 VALUES(9, 1956, 999999999, 'sharan', 192.718, 999999999.999999, '1995/12/25', '19:42:35', '1979/12/25 19:42:35'); +INSERT INTO t1 VALUES(10, 1999,101010101, 'vijay', 102.718, 111111111.999999, '1915/12/25', '20:42:35', '1980/12/25 20:42:35'); diff --git a/test/cache/DDL/dropall.sql b/test/cache/DDL/dropall.sql new file mode 100644 index 00000000..853c1ad6 --- /dev/null +++ b/test/cache/DDL/dropall.sql @@ -0,0 +1 @@ +drop table t1; diff --git a/test/cache/DDL/exp.test001.ksh b/test/cache/DDL/exp.test001.ksh new file mode 100644 index 00000000..328e4034 --- /dev/null +++ b/test/cache/DDL/exp.test001.ksh @@ -0,0 +1,19 @@ +Statement Executed +Statement Executed: Rows Affected = 1 +Statement Executed: Rows Affected = 1 +--------------------------------------------------------- + t1.f1 t1.f2 t1.f3 t1.f4 t1.f5 t1.f6 t1.f7 t1.f8 t1.f9 +--------------------------------------------------------- + 1 2010 121212121 Prasad 112.718002 111111111.222222 2005/12/25 21:42:35.0 2005/12/25 21:42:35.0 + 2 2069 131313131 jiten 122.718002 222222222.333333 2025/12/25 22:42:35.0 2025/12/25 22:42:35.0 + ++---------------------------------------+ +| Connected! | +| | +| sql-statement | +| help [tablename] | +| quit | +| | ++---------------------------------------+ +[?1034hSQL> select * from t1; +SQL> \ No newline at end of file diff --git a/test/cache/DDL/exp.test001.ksh.SunOS b/test/cache/DDL/exp.test001.ksh.SunOS new file mode 100644 index 00000000..529ec46b --- /dev/null +++ b/test/cache/DDL/exp.test001.ksh.SunOS @@ -0,0 +1,18 @@ +Statement Executed +Statement Executed: Rows Affected = 1 +Statement Executed: Rows Affected = 1 +--------------------------------------------------------- + t1.f1 t1.f2 t1.f3 t1.f4 t1.f5 t1.f6 t1.f7 t1.f8 t1.f9 +--------------------------------------------------------- + 1 2010 121212121 Prasad 112.718002 111111111.222222 2005/12/25 21:42:35.0 2005/12/25 21:42:35.0 + 2 2069 131313131 jiten 122.718002 222222222.333333 2025/12/25 22:42:35.0 2025/12/25 22:42:35.0 + ++---------------------------------------+ +| Connected! | +| | +| sql-statement | +| help [tablename] | +| quit | +| | ++---------------------------------------+ +SQL> SQL> \ No newline at end of file diff --git a/test/cache/DDL/exp.test001.ksh.x86_64 b/test/cache/DDL/exp.test001.ksh.x86_64 new file mode 100644 index 00000000..ffd67539 --- /dev/null +++ b/test/cache/DDL/exp.test001.ksh.x86_64 @@ -0,0 +1,19 @@ +Statement Executed +Statement Executed: Rows Affected = 1 +Statement Executed: Rows Affected = 1 +--------------------------------------------------------- + t1.f1 t1.f2 t1.f3 t1.f4 t1.f5 t1.f6 t1.f7 t1.f8 t1.f9 +--------------------------------------------------------- + 1 2010 121212121 Prasad 112.718002 111111111.222222 2005/12/25 21:42:35.0 2005/12/25 21:42:35.0 + 2 2069 131313131 jiten 122.718002 222222222.333333 2025/12/25 22:42:35.0 2025/12/25 22:42:35.0 + ++---------------------------------------+ +| Connected! | +| | +| sql-statement | +| help [tablename] | +| quit | +| | ++---------------------------------------+ +SQL> select * from t1; +SQL> \ No newline at end of file diff --git a/test/cache/DDL/exp.test002.ksh b/test/cache/DDL/exp.test002.ksh new file mode 100644 index 00000000..7878e7b5 --- /dev/null +++ b/test/cache/DDL/exp.test002.ksh @@ -0,0 +1,4 @@ +Statement execute failed with error -8 +Statement execute failed with error -14 +Statement execute failed with error -14 +Statement Executed diff --git a/test/cache/DDL/exp.test004.ksh b/test/cache/DDL/exp.test004.ksh new file mode 100644 index 00000000..505344a3 --- /dev/null +++ b/test/cache/DDL/exp.test004.ksh @@ -0,0 +1,39 @@ +Statement Executed + + + t1 + + f1 + 0 + 4 + 0 + 0 + 0 + + + + f2 + 0 + 4 + 0 + 0 + 0 + + + + f3 + 30 + 12 + 0 + 0 + 0 + + + +
+ + ind1 + Hash Index + t1
+ f2 +
diff --git a/test/cache/DDL/mysqlinputtest1.sql b/test/cache/DDL/mysqlinputtest1.sql new file mode 100644 index 00000000..4e2436f5 --- /dev/null +++ b/test/cache/DDL/mysqlinputtest1.sql @@ -0,0 +1,11 @@ +CREATE TABLE t1 (f1 SMALLINT primary key, f2 INT , f3 BIGINT , f4 CHAR (10), f5 FLOAT , f6 float8 , f7 DATE , f8 TIME , f9 TIMESTAMP ); +INSERT INTO t1 VALUES(1, 2011, 111111111, 'Govind', 113.141, 111111111.111111, '1915/12/25', '11:42:35', '1971/12/25 11:42:35'); +INSERT INTO t1 VALUES(2, 1978, 222222222, 'Gopal', 114.567, 222222222.222222, '1926/05/16', '12:32:14', '1972/05/16 12:32:14'); +INSERT INTO t1 VALUES(3, 2008, 333333333, 'kishor', 122.700, 333333333.333333, '1937/08/15', '13:45:36', '1973/08/15 13:45:36'); +INSERT INTO t1 VALUES(4, 1973, 444444444, 'kiran', 142.718, 444444444.444444, '1946/12/25', '14:42:35', '1974/12/25 14:42:35'); +INSERT INTO t1 VALUES(5, 2005, 555555555, 'ganesh', 152.718, 555555555.555555, '1955/12/25', '15:42:35', '1975/12/25 15:42:35'); +INSERT INTO t1 VALUES(6, 1962, 666666666, 'suresh', 162.718, 666666666.666666, '1965/12/25', '16:42:35', '1976/12/25 16:42:35'); +INSERT INTO t1 VALUES(7, 1965, 777777777, 'Praba', 172.718, 777777777.777777, '1975/12/25', '17:42:35', '1977/12/25 17:42:35'); +INSERT INTO t1 VALUES(8, 1942, 888888888, 'karan', 182.718, 888888888.888888, '1985/12/25', '18:42:35', '1978/12/25 18:42:35'); +INSERT INTO t1 VALUES(9, 1956, 999999999, 'sharan', 192.718, 999999999.999999, '1995/12/25', '19:42:35', '1979/12/25 19:42:35'); +INSERT INTO t1 VALUES(10, 1999,101010101, 'vijay', 102.718, 111111111.999999, '1915/12/25', '20:42:35', '1980/12/25 20:42:35'); diff --git a/test/cache/DDL/mysqlinputtest2.sql b/test/cache/DDL/mysqlinputtest2.sql new file mode 100644 index 00000000..e4c1eaf0 --- /dev/null +++ b/test/cache/DDL/mysqlinputtest2.sql @@ -0,0 +1,3 @@ +CREATE TABLE t1 (f1 SMALLINT, f2 INT, f3 BIGINT, f4 CHAR (20), f5 FLOAT, f6 float8, f7 DATE, f8 TIME, f9 TIMESTAMP, primary key(f1)); +INSERT INTO t1 VALUES(1, 2010, 121212121, 'Prasad', 112.718, 111111111.222222, '2005/12/25', '21:42:35', '2005/12/25 21:42:35'); +INSERT INTO t1 VALUES(2, 2069, 131313131, 'jiten', 122.718, 222222222.333333, '2025/12/25', '22:42:35', '2025/12/25 22:42:35'); diff --git a/test/cache/DDL/selectstar.sql b/test/cache/DDL/selectstar.sql new file mode 100644 index 00000000..f0d520a9 --- /dev/null +++ b/test/cache/DDL/selectstar.sql @@ -0,0 +1 @@ +select * from t1; diff --git a/test/cache/DDL/sybaseinputtest1.sql b/test/cache/DDL/sybaseinputtest1.sql new file mode 100644 index 00000000..3a52c806 --- /dev/null +++ b/test/cache/DDL/sybaseinputtest1.sql @@ -0,0 +1,11 @@ +CREATE TABLE t1 (f1 SMALLINT primary key, f2 INT , f3 BIGINT , f4 CHAR (10), f5 REAL , f6 FLOAT , f7 DATE , f8 TIME , f9 DATETIME ); +INSERT INTO t1 VALUES(1, 2011, 111111111, 'Govind', 113.141, 111111111.111111, '1915/12/25', '11:42:35', '1971/12/25 11:42:35'); +INSERT INTO t1 VALUES(2, 1978, 222222222, 'Gopal', 114.567, 222222222.222222, '1926/05/16', '12:32:14', '1972/05/16 12:32:14'); +INSERT INTO t1 VALUES(3, 2008, 333333333, 'kishor', 122.700, 333333333.333333, '1937/08/15', '13:45:36', '1973/08/15 13:45:36'); +INSERT INTO t1 VALUES(4, 1973, 444444444, 'kiran', 142.718, 444444444.444444, '1946/12/25', '14:42:35', '1974/12/25 14:42:35'); +INSERT INTO t1 VALUES(5, 2005, 555555555, 'ganesh', 152.718, 555555555.555555, '1955/12/25', '15:42:35', '1975/12/25 15:42:35'); +INSERT INTO t1 VALUES(6, 1962, 666666666, 'suresh', 162.718, 666666666.666666, '1965/12/25', '16:42:35', '1976/12/25 16:42:35'); +INSERT INTO t1 VALUES(7, 1965, 777777777, 'Praba', 172.718, 777777777.777777, '1975/12/25', '17:42:35', '1977/12/25 17:42:35'); +INSERT INTO t1 VALUES(8, 1942, 888888888, 'karan', 182.718, 888888888.888888, '1985/12/25', '18:42:35', '1978/12/25 18:42:35'); +INSERT INTO t1 VALUES(9, 1956, 999999999, 'sharan', 192.718, 999999999.999999, '1995/12/25', '19:42:35', '1979/12/25 19:42:35'); +INSERT INTO t1 VALUES(10, 1999,101010101, 'vijay', 102.718, 111111111.999999, '1915/12/25', '20:42:35', '1980/12/25 20:42:35'); diff --git a/test/cache/DDL/test001.ksh b/test/cache/DDL/test001.ksh new file mode 100755 index 00000000..4c5711e7 --- /dev/null +++ b/test/cache/DDL/test001.ksh @@ -0,0 +1,45 @@ +#!/bin/ksh + +# Create table t5. It should be created only in csql and not in TDB + +CSQL_CONF=${PWD}/cache/DDL/csql.conf +input=${PWD}/cache/DDL/csqlinputtest1.sql +REL_PATH=. +if [ -s "$input" ] +then + REL_PATH=${PWD}/cache/DDL +fi +rm -f /tmp/csql.conf +cp $REL_PATH/csql.conf /tmp +export CSQL_CONFIG_FILE=/tmp/csql.conf + +echo DSN=$DSN >>$CSQL_CONFIG_FILE +DS="$DSN $DBUSER $PASSWORD" +rm -f /tmp/csql/csqlds.conf +touch /tmp/csql/csqlds.conf +$CSQL_INSTALL_ROOT/bin/csqlds -U $DBUSER -P $PASSWORD -D $DSN -N $TDB -a +if [ $? -ne 0 ] +then + exit 1; +fi + +isql $DS < $REL_PATH/dropall.sql >/dev/null 2>&1 +rm /tmp/csql/csqltable.conf +touch /tmp/csql/csqltable.conf + +$CSQL_INSTALL_ROOT/bin/csqlserver >/dev/null 2>&1 & +pid=$! +sleep 5 +$CSQL_INSTALL_ROOT/bin/csql -g -s $REL_PATH/csqlinputtest1.sql +$CSQL_INSTALL_ROOT/bin/csql -g -s $REL_PATH/selectstar.sql + +isql $DS < $REL_PATH/selectstar.sql +if [ $? -ne 0 ] +then + exit 1; +fi + +$CSQL_INSTALL_ROOT/bin/csql -g -s $REL_PATH/dropall.sql >/dev/null 2>&1 +kill -9 $pid +ipcrm -M 1199 -M 2277 -M 1947 +exit 0 diff --git a/test/cache/DDL/test002.ksh b/test/cache/DDL/test002.ksh new file mode 100755 index 00000000..3db7c853 --- /dev/null +++ b/test/cache/DDL/test002.ksh @@ -0,0 +1,67 @@ +#!/bin/ksh + +# create table t1 in csql and TDB. Recover t1. +# It should fail saying table already exists + +CSQL_CONF=${PWD}/cache/DDL/csql.conf +input=${PWD}/cache/DDL/mysqlinputtest1.sql +REL_PATH=. +if [ -s "$input" ] +then + REL_PATH=${PWD}/cache/DDL +fi + +rm -f /tmp/csql.conf +cp $REL_PATH/csql.conf /tmp +export CSQL_CONFIG_FILE=/tmp/csql.conf + +DS="$DSN $DBUSER $PASSWORD" +echo DSN=$DSN >>$CSQL_CONFIG_FILE +rm -f /tmp/csql/csqlds.conf +touch /tmp/csql/csqlds.conf +$CSQL_INSTALL_ROOT/bin/csqlds -U $DBUSER -P $PASSWORD -D $DSN -N $TDB -a +if [ $? -ne 0 ] +then + exit 1; +fi + + +if [ $DSN = "oracle" ] +then + isql $DS < $REL_PATH/oratest1.oracle > /dev/null 2>&1 +elif [ "$DSN" = "sybase" ] +then + isql $DS < $REL_PATH/sybaseinputtest1.sql > /dev/null 2>&1 +elif [ "$DSN" = "db2" ] +then + isql $DS < $REL_PATH/db2inputtest1.sql > /dev/null 2>&1 +else + isql $DS < $REL_PATH/mysqlinputtest1.sql > /dev/null 2>&1 +fi + +# edit /tmp/csql/csqltable.conf +rm -f /tmp/csql/csqltable.conf +touch /tmp/csql/csqltable.conf +echo "1 t1 NULL NULL NULL $DSN" >/tmp/csql/csqltable.conf +$CSQL_INSTALL_ROOT/bin/csqlserver -c > /dev/null 2>&1 & +pid=$! +sleep 5 +if [ "$VALGRIND" = "true" ] +then + valgrind --tool=memcheck --leak-check=full $CSQL_INSTALL_ROOT/bin/csql -g -s $REL_PATH/csqlinputtest1.sql 2> $0.valgrelse +else + $CSQL_INSTALL_ROOT/bin/csql -g -s $REL_PATH/csqlinputtest1.sql +fi +isql $DS < $REL_PATH/dropall.sql > /dev/null 2>&1 +rm -f /tmp/csql/csqltable.conf /tmp/csql/csqlds.conf +touch /tmp/csql/csqltable.conf /tmp/csql/csqlds.conf +if [ "$VALGRIND" = "true" ] +then + valgrind --tool=memcheck --leak-check=full $CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/dropall.sql 2>> $0.valgr +else + $CSQL_INSTALL_ROOT/bin/csql -s $REL_PATH/dropall.sql +fi + +kill -9 $pid +ipcrm -M 1199 -M 2277 -M 1947 +exit 0; diff --git a/test/cache/DDL/test003.ksh b/test/cache/DDL/test003.ksh new file mode 100755 index 00000000..9551c300 --- /dev/null +++ b/test/cache/DDL/test003.ksh @@ -0,0 +1,90 @@ +#!/bin/ksh + +# Cache table t1 from target database and drop the table. It should give an error. + +# Run this test only under csql/test or on this directory. +# Otherwise, it may fail +CSQL_CONF=${PWD}/cache/DDL/csql.conf +input=${PWD}/cache/DDL/csqlinputtest1.sql +REL_PATH=. +if [ -s "$input" ] +then + REL_PATH=${PWD}/cache/DDL +fi + +rm -f /tmp/csql.conf +cp $REL_PATH/csql.conf /tmp +export CSQL_CONFIG_FILE=/tmp/csql.conf + +echo DSN=$DSN >>$CSQL_CONFIG_FILE +DS="$DSN $DBUSER $PASSWORD" +rm -f /tmp/csql/csqlds.conf +touch /tmp/csql/csqlds.conf +$CSQL_INSTALL_ROOT/bin/csqlds -U $DBUSER -P $PASSWORD -D $DSN -N $TDB -a +if [ $? -ne 0 ] +then + exit 1; +fi + +if [ $DSN = "oracle" ] +then + isql $DS < $REL_PATH/oratest1.oracle >/dev/null +elif [ "$DSN" = "sybase" ] +then + isql $DS < $REL_PATH/sybaseinputtest1.sql > /dev/null 2>&1 +elif [ "$DSN" = "db2" ] +then + isql $DS < $REL_PATH/db2inputtest1.sql > /dev/null 2>&1 +else + isql $DS < $REL_PATH/mysqlinputtest2.sql >/dev/null +fi + + +if [ $? -ne 0 ] +then + echo "unable to create in target db" + exit 1 +fi + +rm /tmp/csql/csqltable.conf +touch /tmp/csql/csqltable.conf +$CSQL_INSTALL_ROOT/bin/csqlserver >/dev/null 2>&1 & +pid=$! +sleep 5 +if [ "$VALGRIND" = "true" ] +then + valgrind --tool=memcheck --leak-check=full $CSQL_INSTALL_ROOT/bin/cachetable -t t1 2> $0.valgr +else + $CSQL_INSTALL_ROOT/bin/cachetable -t t1 + if [ $? -ne 0 ] + then + echo "unable to cache table from target db" + rm /tmp/csql/csqltable.conf /tmp/csql/csqlds.conf + touch /tmp/csql/csqltable.conf /tmp/csql/csqlds.conf + isql $DS < $REL_PATH/dropall.sql >/dev/null 2>&1 + exit 2 + fi +fi + +$CSQL_INSTALL_ROOT/bin/csql -g -s $REL_PATH/dropall.sql + +if [ "$VALGRIND" = "true" ] +then + valgrind --tool=memcheck --leak-check=full $CSQL_INSTALL_ROOT/bin/cachetable -t t1 -u 2>> $0.valgr +else + $CSQL_INSTALL_ROOT/bin/cachetable -t t1 -u + if [ $? -ne 0 ] + then + echo "unable to Unload the table" + rm /tmp/csql/csqltable.conf /tmp/csql/csqlds.conf + touch /tmp/csql/csqltable.conf /tmp/csql/csqlds.conf + isql $DS < $REL_PATH/dropall.sql >/dev/null 2>&1 + exit 3 + fi +fi +isql $DS < $REL_PATH/dropall.sql >/dev/null 2>&1 +kill -9 $pid +ipcrm -M 1199 -M 2277 -M 1947 +rm /tmp/csql/csqltable.conf /tmp/csql/csqlds.conf +touch /tmp/csql/csqltable.conf /tmp/csql/csqlds.conf +exit 0 diff --git a/test/cache/DDL/test004.ksh b/test/cache/DDL/test004.ksh new file mode 100755 index 00000000..d3614781 --- /dev/null +++ b/test/cache/DDL/test004.ksh @@ -0,0 +1,96 @@ +#!/bin/ksh + +# Load table t1 from MySQL using csql -g enter the following command +# create index idx on t1 (f1),Index should be created only in csql and not in mysql + +# Run this test only under csql/test or on this directory. +# Otherwise, it may fail +CSQL_CONF=${PWD}/cache/DDL/csql.conf +input=${PWD}/cache/DDL/csqlinputtest1.sql +REL_PATH=. +if [ -s "$input" ] +then + REL_PATH=${PWD}/cache/DDL +fi + +rm -f /tmp/csql.conf +cp $REL_PATH/csql.conf /tmp +export CSQL_CONFIG_FILE=/tmp/csql.conf + +echo DSN=$DSN >>$CSQL_CONFIG_FILE +DS="$DSN $DBUSER $PASSWORD" +rm -f /tmp/csql/csqlds.conf +touch /tmp/csql/csqlds.conf +$CSQL_INSTALL_ROOT/bin/csqlds -U $DBUSER -P $PASSWORD -D $DSN -N $TDB -a +if [ $? -ne 0 ] +then + exit 1; +fi + + +echo "create table t1(f1 int,f2 int,f3 char(10));">$REL_PATH/t1.sql +isql $DS < $REL_PATH/t1.sql >/dev/null +if [ $? -ne 0 ] +then + rm -f /tmp/csql/csqlds.conf + touch /tmp/csql/csqlds.conf + echo "unable to create in target db" + cp /tmp/csql.conf $CSQL_CONFIG_FILE + rm -f $REL_PATH/t1.sql + exit 1 +fi + +rm /tmp/csql/csqltable.conf +touch /tmp/csql/csqltable.conf +$CSQL_INSTALL_ROOT/bin/csqlserver >/dev/null 2>&1 & +pid=$! +sleep 5 +$CSQL_INSTALL_ROOT/bin/cachetable -t t1 +if [ $? -ne 0 ] +then + echo "unable to cache table from target db" + rm -f /tmp/csql/csqlds.conf + touch /tmp/csql/csqlds.conf + isql $DS < $REL_PATH/dropall.sql >/dev/null 2>&1 + rm -f $REL_PATH/t1.sql + exit 2 +fi +echo "create index ind1 on t1(f2);">$REL_PATH/cre.sql +$CSQL_INSTALL_ROOT/bin/csql -g -s $REL_PATH/cre.sql +$CSQL_INSTALL_ROOT/bin/catalog -u root -p manager -l +if [ $? -ne 0 ] +then + echo "unable to Unload the table" + rm -f /tmp/csql/csqlds.conf + touch /tmp/csql/csqlds.conf + isql $DS < $REL_PATH/dropall.sql >/dev/null 2>&1 + rm -f $REL_PATH/t1.sql + rm -f $REL_PATH/cre.sql + kill -9 $pid + ipcrm -M 1199 -M 2277 -M 1947 + exit 3 +fi +echo "desc t1;">$REL_PATH/a.sql +$CSQL_INSTALL_ROOT/bin/cachetable -t t1 -u +if [ $? -ne 0 ] +then + echo "unable to Unload the table" + isql $DS < $REL_PATH/dropall.sql >/dev/null 2>&1 + rm -f /tmp/csql/csqlds.conf + touch /tmp/csql/csqlds.conf + rm -f $REL_PATH/t1.sql + rm -f $REL_PATH/cre.sql + rm -f $REL_PATH/a.sql + kill -9 $pid + ipcrm -M 1199 -M 2277 -M 1947 + exit 4 +fi +isql $DS < $REL_PATH/dropall.sql >/dev/null 2>&1 +kill -9 $pid +ipcrm -M 1199 -M 2277 -M 1947 +rm /tmp/csql/csqltable.conf /tmp/csql/csqlds.conf +touch /tmp/csql/csqltable.conf /tmp/csql/csqlds.conf +rm -f $REL_PATH/t1.sql +rm -f $REL_PATH/cre.sql +rm -f $REL_PATH/a.sql +exit 0 -- 2.11.4.GIT