????JFIF??x?x????'
Server IP : 79.136.114.73 / Your IP : 3.140.250.157 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-- SELECT oci_bind_by_name with SQLT_AFC aka CHAR and dates --SKIPIF-- <?php if (!extension_loaded('oci8')) die ("skip no oci8 extension"); require(dirname(__FILE__)."/connect.inc"); // The bind buffer size edge cases seem to change each DB version. preg_match('/.*Release ([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)\.([[:digit:]]+)*/', oci_server_version($c), $matches); if (!(isset($matches[0]) && $matches[1] < 12)) { die("skip expected output only valid when using pre-Oracle 12c database"); } ?> --ENV-- NLS_LANG= --FILE-- <?php require(dirname(__FILE__).'/connect.inc'); // Initialization $stmtarray = array( "alter session set nls_date_format='YYYY-MM-DD'", "drop table bind_char_tab", "create table bind_char_tab (id number, c1 date)", "insert into bind_char_tab values (1, '2008-04-20')", ); oci8_test_sql_execute($c, $stmtarray); // Run Test $bv1 = '2008-04-20'; echo "Test 1.1: Type: default. Length: default\n"; $s = oci_parse($c, "select * from bind_char_tab where c1 = :bv"); $r = oci_bind_by_name($s, ":bv", $bv1); if ($r) do_e_q($s); echo "Test 1.2: Type: AFC. Length: default\n"; $r = oci_bind_by_name($s, ":bv", $bv1, -1, SQLT_AFC); if ($r) do_e_q($s); echo "Test 1.3: Type: AFC: Length: 0\n"; $r = oci_bind_by_name($s, ":bv", $bv1, 0, SQLT_AFC); if ($r) do_e_q($s); echo "Test 1.4: Type: AFC: Length: strlen\n"; $r = oci_bind_by_name($s, ":bv", $bv1, strlen($bv1), SQLT_AFC); if ($r) do_e_q($s); echo "Test 1.5: Type: AFC. Length: strlen-1\n"; $r = oci_bind_by_name($s, ":bv", $bv1, strlen($bv1)-1, SQLT_AFC); if ($r) do_e_q($s); echo "Test 1.6: Type: AFC. Length: strlen+1\n"; $r = oci_bind_by_name($s, ":bv", $bv1, strlen($bv1)+1, SQLT_AFC); if ($r) do_e_q($s); function do_e_q($s) { echo " Querying:\n"; $r = @oci_execute($s); if (!$r) { $m = oci_error($s); echo " Oci_execute error ORA-".$m['code']." Exiting Query\n"; return; } while ($row = oci_fetch_array($s, OCI_ASSOC+OCI_RETURN_NULLS)) { foreach ($row as $item) { echo " :" . $item . ":\n"; } } } // Cleanup $stmtarray = array( "drop table bind_char_tab" ); oci8_test_sql_execute($c, $stmtarray); echo "Done\n"; ?> --EXPECT-- Test 1.1: Type: default. Length: default Querying: :1: :2008-04-20: Test 1.2: Type: AFC. Length: default Querying: :1: :2008-04-20: Test 1.3: Type: AFC: Length: 0 Querying: Oci_execute error ORA-1460 Exiting Query Test 1.4: Type: AFC: Length: strlen Querying: :1: :2008-04-20: Test 1.5: Type: AFC. Length: strlen-1 Querying: Oci_execute error ORA-1460 Exiting Query Test 1.6: Type: AFC. Length: strlen+1 Querying: :1: :2008-04-20: Done