Annotation of embedaddon/php/ext/oci8/tests/commit_old.phpt, revision 1.1.1.1

1.1       misho       1: --TEST--
                      2: ocicommit()/ocirollback()
                      3: --SKIPIF--
                      4: <?php
                      5: $target_dbs = array('oracledb' => true, 'timesten' => false);  // test runs on these DBs
                      6: require(dirname(__FILE__).'/skipif.inc');
                      7: ?> 
                      8: --FILE--
                      9: <?php
                     10: 
                     11: require dirname(__FILE__)."/connect.inc";
                     12: require dirname(__FILE__).'/create_table.inc';
                     13: 
                     14: $insert_sql = "INSERT INTO ".$schema.$table_name." (id, value) VALUES (1,1)";
                     15: 
                     16: if (!($s = ociparse($c, $insert_sql))) {
                     17:        die("ociparse(insert) failed!\n");
                     18: }
                     19: 
                     20: for ($i = 0; $i<3; $i++) {
                     21:        if (!ociexecute($s, OCI_DEFAULT)) {
                     22:                die("ociexecute(insert) failed!\n");
                     23:        }
                     24: }
                     25: 
                     26: var_dump(ocirollback($c));
                     27: 
                     28: $select_sql = "SELECT * FROM ".$schema.$table_name."";
                     29: 
                     30: if (!($select = ociparse($c, $select_sql))) {
                     31:        die("ociparse(select) failed!\n");
                     32: }
                     33: 
                     34: if (!oci_execute($select)) {
                     35:        die("ociexecute(select) failed!\n");
                     36: }
                     37: var_dump(ocifetchstatement($select, $all));
                     38: var_dump($all);
                     39: 
                     40: /* ocifetchstatement */
                     41: if (!ociexecute($s)) {
                     42:        die("ociexecute(select) failed!\n");
                     43: }
                     44: 
                     45: $insert_sql = "INSERT INTO ".$schema.$table_name." (id, value) VALUES (1,1)";
                     46: 
                     47: if (!($s = ociparse($c, $insert_sql))) {
                     48:     die("ociparse(insert) failed!\n");
                     49: }
                     50: 
                     51: for ($i = 0; $i<3; $i++) {
                     52:     if (!ociexecute($s, OCI_DEFAULT)) {
                     53:         die("ociexecute(insert) failed!\n");
                     54:     }
                     55: }
                     56: 
                     57: var_dump(ocicommit($c));
                     58: 
                     59: if (!ociexecute($select)) {
                     60:        die("ociexecute(select) failed!\n");
                     61: }
                     62: var_dump(ocifetchstatement($select, $all));
                     63: var_dump($all);
                     64: 
                     65: 
                     66: require dirname(__FILE__).'/drop_table.inc';
                     67:        
                     68: echo "Done\n";
                     69: ?>
                     70: --EXPECT--
                     71: bool(true)
                     72: int(0)
                     73: array(5) {
                     74:   ["ID"]=>
                     75:   array(0) {
                     76:   }
                     77:   ["VALUE"]=>
                     78:   array(0) {
                     79:   }
                     80:   ["BLOB"]=>
                     81:   array(0) {
                     82:   }
                     83:   ["CLOB"]=>
                     84:   array(0) {
                     85:   }
                     86:   ["STRING"]=>
                     87:   array(0) {
                     88:   }
                     89: }
                     90: bool(true)
                     91: int(4)
                     92: array(5) {
                     93:   ["ID"]=>
                     94:   array(4) {
                     95:     [0]=>
                     96:     string(1) "1"
                     97:     [1]=>
                     98:     string(1) "1"
                     99:     [2]=>
                    100:     string(1) "1"
                    101:     [3]=>
                    102:     string(1) "1"
                    103:   }
                    104:   ["VALUE"]=>
                    105:   array(4) {
                    106:     [0]=>
                    107:     string(1) "1"
                    108:     [1]=>
                    109:     string(1) "1"
                    110:     [2]=>
                    111:     string(1) "1"
                    112:     [3]=>
                    113:     string(1) "1"
                    114:   }
                    115:   ["BLOB"]=>
                    116:   array(4) {
                    117:     [0]=>
                    118:     NULL
                    119:     [1]=>
                    120:     NULL
                    121:     [2]=>
                    122:     NULL
                    123:     [3]=>
                    124:     NULL
                    125:   }
                    126:   ["CLOB"]=>
                    127:   array(4) {
                    128:     [0]=>
                    129:     NULL
                    130:     [1]=>
                    131:     NULL
                    132:     [2]=>
                    133:     NULL
                    134:     [3]=>
                    135:     NULL
                    136:   }
                    137:   ["STRING"]=>
                    138:   array(4) {
                    139:     [0]=>
                    140:     NULL
                    141:     [1]=>
                    142:     NULL
                    143:     [2]=>
                    144:     NULL
                    145:     [3]=>
                    146:     NULL
                    147:   }
                    148: }
                    149: Done

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>