drcp_scope5.phpt 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. --TEST--
  2. DRCP: oci_pconnect() with scope end when oci8.old_oci_close_semantics ON
  3. --EXTENSIONS--
  4. oci8
  5. --INI--
  6. oci8.old_oci_close_semantics=1
  7. --FILE--
  8. <?php
  9. require __DIR__."/drcp_functions.inc";
  10. require __DIR__."/details.inc";
  11. // Similar to drcp_scope3.phpt but does a commit before end of
  12. // function2, allowing the table to be dropped cleanly at the end.
  13. // The test opens a connection within function1 and updates a table
  14. // (without committing). Another connection is opened from function
  15. // 2, and the table queried. When function1 ends, the connection from
  16. // function1 is not closed, so the updated value will be seen in
  17. // function2. Also the table can't be dropped because an uncommitted
  18. // transaction exists.
  19. // Create the table
  20. $c = oci_new_connect($user,$password,$dbase);
  21. @drcp_drop_table($c);
  22. drcp_create_table($c);
  23. echo "This is with a OCI_PCONNECT\n";
  24. function1($user,$password,$dbase);
  25. // Should return the OLD value
  26. function2($user,$password,$dbase);
  27. // This is the first scope for the script
  28. function function1($user,$password,$dbase)
  29. {
  30. var_dump($c = oci_pconnect($user,$password,$dbase));
  31. drcp_update_table($c);
  32. }
  33. // This is the second scope
  34. function function2($user,$password,$dbase)
  35. {
  36. var_dump($c = oci_pconnect($user,$password,$dbase));
  37. drcp_select_value($c);
  38. oci_commit($c);
  39. }
  40. drcp_drop_table($c);
  41. oci_close($c);
  42. echo "Done\n";
  43. ?>
  44. --EXPECTF--
  45. Deprecated: Directive oci8.old_oci_close_semantics is deprecated%s
  46. This is with a OCI_PCONNECT
  47. resource(%d) of type (oci8 persistent connection)
  48. Update done-- DEPT value has been set to NEWDEPT
  49. resource(%d) of type (oci8 persistent connection)
  50. The value of DEPT for id 105 is NEWDEPT
  51. Done