bug36403.phpt 965 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. --TEST--
  2. Bug #36403 (oci_execute no longer supports OCI_DESCRIBE_ONLY)
  3. --EXTENSIONS--
  4. oci8
  5. --FILE--
  6. <?php
  7. require(__DIR__.'/connect.inc');
  8. // Initialization
  9. $stmtarray = array(
  10. "drop table bug36403_tab",
  11. "create table bug36403_tab (c1 number, col2 number, column3 number, col4 number)"
  12. );
  13. oci8_test_sql_execute($c, $stmtarray);
  14. // Run Test
  15. echo "Test 1\n";
  16. $s = oci_parse($c, "select * from bug36403_tab");
  17. oci_execute($s, OCI_DESCRIBE_ONLY);
  18. for ($i = oci_num_fields($s); $i > 0; $i--) {
  19. echo oci_field_name($s, $i) . "\n";
  20. }
  21. echo "Test 2\n";
  22. // Should generate an error: ORA-24338: statement handle not executed
  23. // since the statement handle was only described and not executed
  24. $row = oci_fetch_array($s);
  25. // Clean up
  26. $stmtarray = array(
  27. "drop table bug36403_tab"
  28. );
  29. oci8_test_sql_execute($c, $stmtarray);
  30. ?>
  31. --EXPECTF--
  32. Test 1
  33. COL4
  34. COLUMN3
  35. COL2
  36. C1
  37. Test 2
  38. Warning: oci_fetch_array(): ORA-%r(24338|01002)%r: %sbug36403.php on line %d