Annotation of embedaddon/php/ext/oci8/tests/commit_002.phpt, revision 1.1

1.1     ! misho       1: --TEST--
        !             2: Test oci_commit failure
        !             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: 
        !            13: // Initialization
        !            14: 
        !            15: $stmtarray = array(
        !            16:        "drop table commit_002_tab",
        !            17:        "create table commit_002_tab
        !            18:      ( x int constraint commit_002_tab_check_x check ( x > 0 ) deferrable initially immediate,
        !            19:        y int constraint commit_002_tab_check_y check ( y > 0 ) deferrable initially deferred)"
        !            20: );
        !            21: 
        !            22: oci8_test_sql_execute($c, $stmtarray);
        !            23: 
        !            24: // Run Test
        !            25: 
        !            26: echo "First Insert\n";
        !            27: $s = oci_parse($c, "insert into commit_002_tab values (-1, 1)");
        !            28: $r = @oci_execute($s, OCI_DEFAULT);
        !            29: if (!$r) {
        !            30:     $m = oci_error($s);
        !            31:     echo 'Could not execute: '. $m['message'] . "\n";
        !            32: }
        !            33: $r = oci_commit($c);
        !            34: if (!$r) {
        !            35:     $m = oci_error($c);
        !            36:     echo 'Could not commit: '. $m['message'] . "\n";
        !            37: }
        !            38: 
        !            39: 
        !            40: echo "Second Insert\n";
        !            41: $s = oci_parse($c, "insert into commit_002_tab values (1, -1)");
        !            42: $r = @oci_execute($s, OCI_NO_AUTO_COMMIT);
        !            43: if (!$r) {
        !            44:     $m = oci_error($s);
        !            45:     echo 'Could not execute: '. $m['message'] . "\n";
        !            46: }
        !            47: $r = oci_commit($c);
        !            48: if (!$r) {
        !            49:     $m = oci_error($c);
        !            50:     echo 'Could not commit: '. $m['message'] . "\n";
        !            51: }
        !            52: 
        !            53: 
        !            54: // Clean up
        !            55: 
        !            56: $stmtarray = array(
        !            57:        "drop table commit_002_tab"
        !            58: );
        !            59: 
        !            60: oci8_test_sql_execute($c, $stmtarray);
        !            61: 
        !            62: ?>
        !            63: ===DONE===
        !            64: <?php exit(0); ?>
        !            65: --EXPECTF--
        !            66: First Insert
        !            67: Could not execute: ORA-02290: %s (%s.COMMIT_002_TAB_CHECK_X) %s
        !            68: Second Insert
        !            69: 
        !            70: Warning: oci_commit(): ORA-02091: %s
        !            71: ORA-02290: %s (%s.COMMIT_002_TAB_CHECK_Y) %s in %scommit_002.php on line %d
        !            72: Could not commit: ORA-02091: %s
        !            73: ORA-02290: %s (%s.COMMIT_002_TAB_CHECK_Y) %s
        !            74: ===DONE===

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