Annotation of embedaddon/php/ext/oci8/tests/bug36403.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: Bug #36403 (oci_execute no longer supports OCI_DESCRIBE_ONLY)
! 3: --SKIPIF--
! 4: <?php
! 5: if (!extension_loaded('oci8')) die ("skip no oci8 extension");
! 6: if (preg_match('/^1[01]\./', oci_client_version()) != 1) {
! 7: die("skip expected output only valid with Oracle 10g or greater version of client");
! 8: }
! 9: ?>
! 10: --FILE--
! 11: <?php
! 12:
! 13: require(dirname(__FILE__).'/connect.inc');
! 14:
! 15: // Initialization
! 16:
! 17: $stmtarray = array(
! 18: "drop table bug36403_tab",
! 19: "create table bug36403_tab (c1 number, col2 number, column3 number, col4 number)"
! 20: );
! 21:
! 22: oci8_test_sql_execute($c, $stmtarray);
! 23:
! 24: // Run Test
! 25:
! 26: echo "Test 1\n";
! 27:
! 28: $s = oci_parse($c, "select * from bug36403_tab");
! 29: oci_execute($s, OCI_DESCRIBE_ONLY);
! 30: for ($i = oci_num_fields($s); $i > 0; $i--) {
! 31: echo oci_field_name($s, $i) . "\n";
! 32: }
! 33:
! 34: echo "Test 2\n";
! 35:
! 36: // Should generate an error: ORA-24338: statement handle not executed
! 37: // since the statement handle was only described and not executed
! 38: $row = oci_fetch_array($s);
! 39:
! 40: // Clean up
! 41:
! 42: $stmtarray = array(
! 43: "drop table bug36403_tab"
! 44: );
! 45:
! 46: oci8_test_sql_execute($c, $stmtarray);
! 47:
! 48: ?>
! 49: ===DONE===
! 50: <?php exit(0); ?>
! 51: --EXPECTF--
! 52: Test 1
! 53: COL4
! 54: COLUMN3
! 55: COL2
! 56: C1
! 57: Test 2
! 58:
! 59: Warning: oci_fetch_array(): ORA-%r(24338|01002)%r: %sbug36403.php on line %d
! 60: ===DONE===
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>