drcp_scope3.phpt 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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. // The test opens a connection within function1 and updates a table
  12. // (without committing). Another connection is opened from function
  13. // 2, and the table queried. When function1 ends, the connection from
  14. // function1 is not closed, so the updated value will be seen in
  15. // function2. Also the table can't be dropped because an uncommitted
  16. // transaction exists.
  17. // Create the table
  18. $c = oci_new_connect($user,$password,$dbase);
  19. @drcp_drop_table($c);
  20. drcp_create_table($c);
  21. echo "This is with a OCI_PCONNECT\n";
  22. function1($user,$password,$dbase);
  23. // Should return the OLD value
  24. function2($user,$password,$dbase);
  25. // This is the first scope for the script
  26. function function1($user,$password,$dbase)
  27. {
  28. var_dump($c = oci_pconnect($user,$password,$dbase));
  29. drcp_update_table($c);
  30. }
  31. // This is the second scope
  32. function function2($user,$password,$dbase)
  33. {
  34. var_dump($c = oci_pconnect($user,$password,$dbase));
  35. drcp_select_value($c);
  36. }
  37. drcp_drop_table($c);
  38. oci_close($c);
  39. echo "Done\n";
  40. ?>
  41. --EXPECTF--
  42. Deprecated: Directive oci8.old_oci_close_semantics is deprecated%s
  43. This is with a OCI_PCONNECT
  44. resource(%d) of type (oci8 persistent connection)
  45. Update done-- DEPT value has been set to NEWDEPT
  46. resource(%d) of type (oci8 persistent connection)
  47. The value of DEPT for id 105 is NEWDEPT
  48. Warning: oci_execute(): ORA-00054: %s
  49. Done