cvs: php-src /ext/oci8/tests .cvsignore bug26133.phpt bug27303.phpt bug27303_2.phpt bug27303_3.phpt bug27303_4.phpt bug32325.phpt close.phpt
coll_001.phpt coll_002.phpt coll_002_func.phpt coll_003.phpt coll_003_func.phpt coll_004.phpt coll_004_func.phpt coll_005.phpt coll_006.phpt
coll_006_func.phpt coll_007.phpt coll_008.phpt coll_009.phpt coll_009_func.phpt coll_010.phpt coll_010_func.phpt coll_011.phpt coll_011_func.phpt
coll_012.phpt coll_012_func.phpt coll_013.phpt coll_013_func.phpt coll_014.phpt coll_014_func.phpt coll_015.phpt coll_015_func.phpt coll_016.phpt
coll_016_func.phpt coll_017.phpt coll_017_func.phpt commit.phpt commit_old.phpt connect.inc connect.phpt connect_1.phpt connect_1_old.phpt
connect_old.phpt connect_without_oracle_home.phpt connect_without_oracle_home_old.phpt create_table.inc create_type.inc cursor_bind_err.phpt
cursors.phpt cursors_old.phpt debug.phpt default_prefetch.phpt default_prefetch1.phpt default_prefetch2.phpt define.phpt define_old.phpt
drop_table.inc drop_type.inc error.phpt error_old.phpt exec_fetch.phpt fetch.phpt fetch_all.phpt fetch_array.phpt fetch_assoc.phpt fetch_into.phpt
fetch_into1.phpt fetch_into2.phpt fetch_object.phpt fetch_row.phpt field_funcs.phpt field_funcs_old.phpt lob_001.phpt lob_002.phpt lob_003.phpt
lob_004.phpt lob_005.phpt lob_006.phpt lob_007.phpt lob_008.phpt lob_009.phpt lob_009.txt lob_010.phpt lob_011.phpt lob_012.phpt lob_013.phpt
lob_014.phpt lob_015.phpt lob_016.phpt lob_017.phpt lob_018.phpt lob_temp.phpt lob_temp1.phpt num.phpt oci_execute_segfault.phpt old_oci_close.phpt
old_oci_close1.phpt password.phpt password_new.phpt password_old.phpt persistent.phpt prefetch.phpt prefetch_old.phpt privileged_connect.phpt
privileged_connect1.phpt serverversion.phpt statement_cache.phpt statement_type.phpt statement_type_old.phpt uncommitted.phpt

From: Date: Tue, 06 Sep 2005 19:33:19 +0000
Subject: cvs: php-src /ext/oci8/tests .cvsignore bug26133.phpt bug27303.phpt bug27303_2.phpt bug27303_3.phpt bug27303_4.phpt bug32325.phpt close.phpt
coll_001.phpt coll_002.phpt coll_002_func.phpt coll_003.phpt coll_003_func.phpt coll_004.phpt coll_004_func.phpt coll_005.phpt coll_006.phpt
coll_006_func.phpt coll_007.phpt coll_008.phpt coll_009.phpt coll_009_func.phpt coll_010.phpt coll_010_func.phpt coll_011.phpt coll_011_func.phpt
coll_012.phpt coll_012_func.phpt coll_013.phpt coll_013_func.phpt coll_014.phpt coll_014_func.phpt coll_015.phpt coll_015_func.phpt coll_016.phpt
coll_016_func.phpt coll_017.phpt coll_017_func.phpt commit.phpt commit_old.phpt connect.inc connect.phpt connect_1.phpt connect_1_old.phpt
connect_old.phpt connect_without_oracle_home.phpt connect_without_oracle_home_old.phpt create_table.inc create_type.inc cursor_bind_err.phpt
cursors.phpt cursors_old.phpt debug.phpt default_prefetch.phpt default_prefetch1.phpt default_prefetch2.phpt define.phpt define_old.phpt
drop_table.inc drop_type.inc error.phpt error_old.phpt exec_fetch.phpt fetch.phpt fetch_all.phpt fetch_array.phpt fetch_assoc.phpt fetch_into.phpt
fetch_into1.phpt fetch_into2.phpt fetch_object.phpt fetch_row.phpt field_funcs.phpt field_funcs_old.phpt lob_001.phpt lob_002.phpt lob_003.phpt
lob_004.phpt lob_005.phpt lob_006.phpt lob_007.phpt lob_008.phpt lob_009.phpt lob_009.txt lob_010.phpt lob_011.phpt lob_012.phpt lob_013.phpt
lob_014.phpt lob_015.phpt lob_016.phpt lob_017.phpt lob_018.phpt lob_temp.phpt lob_temp1.phpt num.phpt oci_execute_segfault.phpt old_oci_close.phpt
old_oci_close1.phpt password.phpt password_new.phpt password_old.phpt persistent.phpt prefetch.phpt prefetch_old.phpt privileged_connect.phpt
privileged_connect1.phpt serverversion.phpt statement_cache.phpt statement_type.phpt statement_type_old.phpt uncommitted.phpt
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-33825@lists.php.net to get a copy of this message
tony2001 Tue Sep 6 15:33:19 2005 EDT Added files: /php-src/ext/oci8/tests bug27303.phpt bug27303_2.phpt bug27303_3.phpt bug27303_4.phpt bug32325.phpt close.phpt coll_001.phpt coll_002.phpt coll_002_func.phpt coll_003.phpt coll_003_func.phpt coll_004.phpt coll_004_func.phpt coll_005.phpt coll_006.phpt coll_006_func.phpt coll_007.phpt coll_008.phpt coll_009.phpt coll_009_func.phpt coll_010.phpt coll_010_func.phpt coll_011.phpt coll_011_func.phpt coll_012.phpt coll_012_func.phpt coll_013.phpt coll_013_func.phpt coll_014.phpt coll_014_func.phpt coll_015.phpt coll_015_func.phpt coll_016.phpt coll_016_func.phpt coll_017.phpt coll_017_func.phpt commit.phpt commit_old.phpt connect.phpt connect_1.phpt connect_1_old.phpt connect_old.phpt connect_without_oracle_home.phpt connect_without_oracle_home_old.phpt create_type.inc cursor_bind_err.phpt cursors.phpt cursors_old.phpt debug.phpt default_prefetch.phpt default_prefetch1.phpt default_prefetch2.phpt define.phpt define_old.phpt drop_type.inc error.phpt error_old.phpt exec_fetch.phpt fetch.phpt fetch_all.phpt fetch_array.phpt fetch_assoc.phpt fetch_into.phpt fetch_into1.phpt fetch_into2.phpt fetch_object.phpt fetch_row.phpt field_funcs.phpt field_funcs_old.phpt lob_001.phpt lob_002.phpt lob_003.phpt lob_004.phpt lob_005.phpt lob_006.phpt lob_007.phpt lob_008.phpt lob_009.phpt lob_009.txt lob_010.phpt lob_011.phpt lob_012.phpt lob_013.phpt lob_014.phpt lob_015.phpt lob_016.phpt lob_017.phpt lob_018.phpt lob_temp.phpt lob_temp1.phpt num.phpt oci_execute_segfault.phpt old_oci_close.phpt old_oci_close1.phpt password.phpt password_new.phpt password_old.phpt persistent.phpt prefetch.phpt prefetch_old.phpt privileged_connect.phpt privileged_connect1.phpt serverversion.phpt statement_cache.phpt statement_type.phpt statement_type_old.phpt uncommitted.phpt Modified files: /php-src/ext/oci8/tests .cvsignore bug26133.phpt connect.inc create_table.inc drop_table.inc Log: new tests

http://cvs.php.net/diff.php/php-src/ext/oci8/tests/.cvsignore?r1=1.3&r2=1.4&ty=u Index: php-src/ext/oci8/tests/.cvsignore diff -u php-src/ext/oci8/tests/.cvsignore:1.3 php-src/ext/oci8/tests/.cvsignore:1.4 --- php-src/ext/oci8/tests/.cvsignore:1.3 Sun Oct 10 12:09:59 2004 +++ php-src/ext/oci8/tests/.cvsignore Tue Sep 6 15:33:18 2005 @@ -3,5 +3,7 @@ *.tmp *.diff *.exp -*.log*.gcda +*.log +*.gcda *.gcno +*.vglog http://cvs.php.net/diff.php/php-src/ext/oci8/tests/bug26133.phpt?r1=1.2&r2=1.3&ty=u Index: php-src/ext/oci8/tests/bug26133.phpt diff -u php-src/ext/oci8/tests/bug26133.phpt:1.2 php-src/ext/oci8/tests/bug26133.phpt:1.3 --- php-src/ext/oci8/tests/bug26133.phpt:1.2 Fri Dec 19 12:03:12 2003 +++ php-src/ext/oci8/tests/bug26133.phpt Tue Sep 6 15:33:18 2005 @@ -1,36 +1,39 @@ --TEST-- Bug #26133 (ocifreedesc() segfault) --SKIPIF-- -<?php - require 'skipif.inc'; -?> +<?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> +--ENV-- +return " +ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." +NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." +"; --FILE-- <?php - require 'connect.inc'; - require 'create_table.inc'; - - if ($connection) { + + require dirname(__FILE__).'/connect.inc'; + require dirname(__FILE__).'/create_table.inc'; + + if ($c) { $ora_sql = "INSERT INTO - ".$schema."php_test_table (id, value) + ".$schema.$table_name." (id, value) VALUES ('1','1') RETURNING ROWID INTO :v_rowid "; - $statement = OCIParse($connection,$ora_sql); - $rowid = OCINewDescriptor($connection,OCI_D_ROWID); + $statement = OCIParse($c,$ora_sql); + $rowid = OCINewDescriptor($c,OCI_D_ROWID); OCIBindByName($statement,":v_rowid", $rowid,-1,OCI_B_ROWID); if (OCIExecute($statement)) { - OCICommit($connection); + OCICommit($c); } OCIFreeStatement($statement); $rowid->free(); } - require 'drop_table.inc'; + require dirname(__FILE__).'/drop_table.inc'; echo "Done\n"; ?> ---EXPECTF-- +--EXPECT-- Done - http://cvs.php.net/diff.php/php-src/ext/oci8/tests/connect.inc?r1=1.2&r2=1.3&ty=u Index: php-src/ext/oci8/tests/connect.inc diff -u php-src/ext/oci8/tests/connect.inc:1.2 php-src/ext/oci8/tests/connect.inc:1.3 --- php-src/ext/oci8/tests/connect.inc:1.2 Fri Dec 19 12:03:12 2003 +++ php-src/ext/oci8/tests/connect.inc Tue Sep 6 15:33:18 2005 @@ -4,29 +4,27 @@ * Please, change user, password and dbase to match your configuration. * * */ - -$user = "user"; -$password = "pass"; -$dbase = "base"; + +$user = "system"; +$password = "system"; +$dbase = "oracle"; /* * You should have privileges to create tables in this schema * * */ - -$schema = "system"; - /* - * Remove the last line in skipif.inc to run tests - * - * */ - +$schema = "system"; +*/ +$table_name = "tb".substr(str_replace(Array(".", "-"), "_", php_uname("n")), 0, 5); +$type_name = strtoupper("tp".substr(str_replace(Array(".", "-"), "_", php_uname("n")), 0, 5)); + if (!empty($dbase)) { - $connection = ocilogon($user,$password,$dbase); + $c = ocilogon($user,$password,$dbase); } else { - $connection = ocilogon($user,$password); + $c = ocilogon($user,$password); } if (!empty($schema)) { http://cvs.php.net/diff.php/php-src/ext/oci8/tests/create_table.inc?r1=1.2&r2=1.3&ty=u Index: php-src/ext/oci8/tests/create_table.inc diff -u php-src/ext/oci8/tests/create_table.inc:1.2 php-src/ext/oci8/tests/create_table.inc:1.3 --- php-src/ext/oci8/tests/create_table.inc:1.2 Fri Dec 19 12:03:12 2003 +++ php-src/ext/oci8/tests/create_table.inc Tue Sep 6 15:33:18 2005 @@ -1,11 +1,18 @@ <?php - if ($connection) { + if ($c) { + $ora_sql = "DROP TABLE + ".$schema.$table_name." + "; + + $statement = OCIParse($c, $ora_sql); + @OCIExecute($statement); + $ora_sql = "CREATE TABLE - ".$schema."php_test_table (id NUMBER, value NUMBER) + ".$schema.$table_name." (id NUMBER, value NUMBER, blob BLOB, clob CLOB, string VARCHAR(10)) "; - $statement = OCIParse($connection,$ora_sql); + $statement = OCIParse($c,$ora_sql); OCIExecute($statement); } http://cvs.php.net/diff.php/php-src/ext/oci8/tests/drop_table.inc?r1=1.2&r2=1.3&ty=u Index: php-src/ext/oci8/tests/drop_table.inc diff -u php-src/ext/oci8/tests/drop_table.inc:1.2 php-src/ext/oci8/tests/drop_table.inc:1.3 --- php-src/ext/oci8/tests/drop_table.inc:1.2 Fri Dec 19 12:03:12 2003 +++ php-src/ext/oci8/tests/drop_table.inc Tue Sep 6 15:33:18 2005 @@ -1,11 +1,11 @@ <?php - if ($connection) { + if ($c) { $ora_sql = "DROP TABLE - ".$schema."php_test_table + ".$schema.$table_name." "; - $statement = OCIParse($connection,$ora_sql); + $statement = OCIParse($c,$ora_sql); OCIExecute($statement); } http://cvs.php.net/co.php/php-src/ext/oci8/tests/bug27303.phpt?r=1.1&p=1 Index: php-src/ext/oci8/tests/bug27303.phpt +++ php-src/ext/oci8/tests/bug27303.phpt --TEST-- bug #27303 (OCIBindByName binds numeric PHP values as characters) --SKIPIF-- <?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> --ENV-- return " ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." "; --FILE-- <?php require dirname(__FILE__).'/connect.inc'; $create_st = array(); $create_st[] = "drop sequence myseq"; $create_st[] = "drop table mytab"; $create_st[] = "create sequence myseq"; $create_st[] = "create table mytab (mydata varchar2(20), seqcol number)"; foreach ($create_st as $statement) { $stmt = oci_parse($c, $statement); oci_execute($stmt); } define('MYLIMIT', 200); define('INITMYBV', 11); $stmt = "insert into mytab (mydata, seqcol) values ('Some data', myseq.nextval) returning seqcol into :mybv"; $stid = OCIParse($c, $stmt); if (!$stid) { echo "Parse error"; die; } //$mybv = INITMYBV; // Uncomment this for the 2nd test only $r = OCIBindByName($stid, ':MYBV', $mybv /*, 5 */); // Uncomment this for the 3rd test only if (!$r) { echo "Bind error"; die; } for ($i = 1; $i < MYLIMIT; $i++) { $r = OCIExecute($stid, OCI_DEFAULT); if (!$r) { echo "Execute error"; die; } var_dump($mybv); } OCICommit($c); $drop_st = array(); $drop_st[] = "drop sequence myseq"; $drop_st[] = "drop table mytab"; foreach ($create_st as $statement) { $stmt = oci_parse($c, $statement); oci_execute($stmt); } echo "Done\n"; ?> --EXPECTF-- string(1) "1" string(1) "2" string(1) "3" string(1) "4" string(1) "5" string(1) "6" string(1) "7" string(1) "8" string(1) "9" string(2) "10" string(2) "11" string(2) "12" string(2) "13" string(2) "14" string(2) "15" string(2) "16" string(2) "17" string(2) "18" string(2) "19" string(2) "20" string(2) "21" string(2) "22" string(2) "23" string(2) "24" string(2) "25" string(2) "26" string(2) "27" string(2) "28" string(2) "29" string(2) "30" string(2) "31" string(2) "32" string(2) "33" string(2) "34" string(2) "35" string(2) "36" string(2) "37" string(2) "38" string(2) "39" string(2) "40" string(2) "41" string(2) "42" string(2) "43" string(2) "44" string(2) "45" string(2) "46" string(2) "47" string(2) "48" string(2) "49" string(2) "50" string(2) "51" string(2) "52" string(2) "53" string(2) "54" string(2) "55" string(2) "56" string(2) "57" string(2) "58" string(2) "59" string(2) "60" string(2) "61" string(2) "62" string(2) "63" string(2) "64" string(2) "65" string(2) "66" string(2) "67" string(2) "68" string(2) "69" string(2) "70" string(2) "71" string(2) "72" string(2) "73" string(2) "74" string(2) "75" string(2) "76" string(2) "77" string(2) "78" string(2) "79" string(2) "80" string(2) "81" string(2) "82" string(2) "83" string(2) "84" string(2) "85" string(2) "86" string(2) "87" string(2) "88" string(2) "89" string(2) "90" string(2) "91" string(2) "92" string(2) "93" string(2) "94" string(2) "95" string(2) "96" string(2) "97" string(2) "98" string(2) "99" string(3) "100" string(3) "101" string(3) "102" string(3) "103" string(3) "104" string(3) "105" string(3) "106" string(3) "107" string(3) "108" string(3) "109" string(3) "110" string(3) "111" string(3) "112" string(3) "113" string(3) "114" string(3) "115" string(3) "116" string(3) "117" string(3) "118" string(3) "119" string(3) "120" string(3) "121" string(3) "122" string(3) "123" string(3) "124" string(3) "125" string(3) "126" string(3) "127" string(3) "128" string(3) "129" string(3) "130" string(3) "131" string(3) "132" string(3) "133" string(3) "134" string(3) "135" string(3) "136" string(3) "137" string(3) "138" string(3) "139" string(3) "140" string(3) "141" string(3) "142" string(3) "143" string(3) "144" string(3) "145" string(3) "146" string(3) "147" string(3) "148" string(3) "149" string(3) "150" string(3) "151" string(3) "152" string(3) "153" string(3) "154" string(3) "155" string(3) "156" string(3) "157" string(3) "158" string(3) "159" string(3) "160" string(3) "161" string(3) "162" string(3) "163" string(3) "164" string(3) "165" string(3) "166" string(3) "167" string(3) "168" string(3) "169" string(3) "170" string(3) "171" string(3) "172" string(3) "173" string(3) "174" string(3) "175" string(3) "176" string(3) "177" string(3) "178" string(3) "179" string(3) "180" string(3) "181" string(3) "182" string(3) "183" string(3) "184" string(3) "185" string(3) "186" string(3) "187" string(3) "188" string(3) "189" string(3) "190" string(3) "191" string(3) "192" string(3) "193" string(3) "194" string(3) "195" string(3) "196" string(3) "197" string(3) "198" string(3) "199" Done http://cvs.php.net/co.php/php-src/ext/oci8/tests/bug27303_2.phpt?r=1.1&p=1 Index: php-src/ext/oci8/tests/bug27303_2.phpt +++ php-src/ext/oci8/tests/bug27303_2.phpt --TEST-- bug #27303 (OCIBindByName binds numeric PHP values as characters) --SKIPIF-- <?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> --ENV-- return " ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." "; --FILE-- <?php require dirname(__FILE__).'/connect.inc'; $create_st = array(); $create_st[] = "drop sequence myseq"; $create_st[] = "drop table mytab"; $create_st[] = "create sequence myseq"; $create_st[] = "create table mytab (mydata varchar2(20), seqcol number)"; foreach ($create_st as $statement) { $stmt = oci_parse($c, $statement); oci_execute($stmt); } define('MYLIMIT', 200); define('INITMYBV', 11); $stmt = "insert into mytab (mydata, seqcol) values ('Some data', myseq.nextval) returning seqcol into :mybv"; $stid = OCIParse($c, $stmt); if (!$stid) { echo "Parse error"; die; } $mybv = INITMYBV; // Uncomment this for the 2nd test only $r = OCIBindByName($stid, ':MYBV', $mybv /*, 5 */); // Uncomment this for the 3rd test only if (!$r) { echo "Bind error"; die; } for ($i = 1; $i < MYLIMIT; $i++) { $r = OCIExecute($stid, OCI_DEFAULT); if (!$r) { echo "Execute error"; die; } var_dump($mybv); } OCICommit($c); $drop_st = array(); $drop_st[] = "drop sequence myseq"; $drop_st[] = "drop table mytab"; foreach ($create_st as $statement) { $stmt = oci_parse($c, $statement); oci_execute($stmt); } echo "Done\n"; ?> --EXPECTF-- string(1) "1" string(1) "2" string(1) "3" string(1) "4" string(1) "5" string(1) "6" string(1) "7" string(1) "8" string(1) "9" string(2) "10" string(2) "11" string(2) "12" string(2) "13" string(2) "14" string(2) "15" string(2) "16" string(2) "17" string(2) "18" string(2) "19" string(2) "20" string(2) "21" string(2) "22" string(2) "23" string(2) "24" string(2) "25" string(2) "26" string(2) "27" string(2) "28" string(2) "29" string(2) "30" string(2) "31" string(2) "32" string(2) "33" string(2) "34" string(2) "35" string(2) "36" string(2) "37" string(2) "38" string(2) "39" string(2) "40" string(2) "41" string(2) "42" string(2) "43" string(2) "44" string(2) "45" string(2) "46" string(2) "47" string(2) "48" string(2) "49" string(2) "50" string(2) "51" string(2) "52" string(2) "53" string(2) "54" string(2) "55" string(2) "56" string(2) "57" string(2) "58" string(2) "59" string(2) "60" string(2) "61" string(2) "62" string(2) "63" string(2) "64" string(2) "65" string(2) "66" string(2) "67" string(2) "68" string(2) "69" string(2) "70" string(2) "71" string(2) "72" string(2) "73" string(2) "74" string(2) "75" string(2) "76" string(2) "77" string(2) "78" string(2) "79" string(2) "80" string(2) "81" string(2) "82" string(2) "83" string(2) "84" string(2) "85" string(2) "86" string(2) "87" string(2) "88" string(2) "89" string(2) "90" string(2) "91" string(2) "92" string(2) "93" string(2) "94" string(2) "95" string(2) "96" string(2) "97" string(2) "98" string(2) "99" string(3) "100" string(3) "101" string(3) "102" string(3) "103" string(3) "104" string(3) "105" string(3) "106" string(3) "107" string(3) "108" string(3) "109" string(3) "110" string(3) "111" string(3) "112" string(3) "113" string(3) "114" string(3) "115" string(3) "116" string(3) "117" string(3) "118" string(3) "119" string(3) "120" string(3) "121" string(3) "122" string(3) "123" string(3) "124" string(3) "125" string(3) "126" string(3) "127" string(3) "128" string(3) "129" string(3) "130" string(3) "131" string(3) "132" string(3) "133" string(3) "134" string(3) "135" string(3) "136" string(3) "137" string(3) "138" string(3) "139" string(3) "140" string(3) "141" string(3) "142" string(3) "143" string(3) "144" string(3) "145" string(3) "146" string(3) "147" string(3) "148" string(3) "149" string(3) "150" string(3) "151" string(3) "152" string(3) "153" string(3) "154" string(3) "155" string(3) "156" string(3) "157" string(3) "158" string(3) "159" string(3) "160" string(3) "161" string(3) "162" string(3) "163" string(3) "164" string(3) "165" string(3) "166" string(3) "167" string(3) "168" string(3) "169" string(3) "170" string(3) "171" string(3) "172" string(3) "173" string(3) "174" string(3) "175" string(3) "176" string(3) "177" string(3) "178" string(3) "179" string(3) "180" string(3) "181" string(3) "182" string(3) "183" string(3) "184" string(3) "185" string(3) "186" string(3) "187" string(3) "188" string(3) "189" string(3) "190" string(3) "191" string(3) "192" string(3) "193" string(3) "194" string(3) "195" string(3) "196" string(3) "197" string(3) "198" string(3) "199" Done http://cvs.php.net/co.php/php-src/ext/oci8/tests/bug27303_3.phpt?r=1.1&p=1 Index: php-src/ext/oci8/tests/bug27303_3.phpt +++ php-src/ext/oci8/tests/bug27303_3.phpt --TEST-- bug #27303 (OCIBindByName binds numeric PHP values as characters) --SKIPIF-- <?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> --ENV-- return " ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." "; --FILE-- <?php require dirname(__FILE__).'/connect.inc'; $create_st = array(); $create_st[] = "drop sequence myseq"; $create_st[] = "drop table mytab"; $create_st[] = "create sequence myseq"; $create_st[] = "create table mytab (mydata varchar2(20), seqcol number)"; foreach ($create_st as $statement) { $stmt = oci_parse($c, $statement); oci_execute($stmt); } define('MYLIMIT', 200); define('INITMYBV', 11); $stmt = "insert into mytab (mydata, seqcol) values ('Some data', myseq.nextval) returning seqcol into :mybv"; $stid = OCIParse($c, $stmt); if (!$stid) { echo "Parse error"; die; } $mybv = INITMYBV; // Uncomment this for the 2nd test only $r = OCIBindByName($stid, ':MYBV', $mybv, 5, SQLT_INT); // Uncomment this for the 3rd test only if (!$r) { echo "Bind error"; die; } for ($i = 1; $i < MYLIMIT; $i++) { $r = OCIExecute($stid, OCI_DEFAULT); if (!$r) { echo "Execute error"; die; } var_dump($mybv); } OCICommit($c); $drop_st = array(); $drop_st[] = "drop sequence myseq"; $drop_st[] = "drop table mytab"; foreach ($create_st as $statement) { $stmt = oci_parse($c, $statement); oci_execute($stmt); } echo "Done\n"; ?> --EXPECTF-- int(1) int(2) int(3) int(4) int(5) int(6) int(7) int(8) int(9) int(10) int(11) int(12) int(13) int(14) int(15) int(16) int(17) int(18) int(19) int(20) int(21) int(22) int(23) int(24) int(25) int(26) int(27) int(28) int(29) int(30) int(31) int(32) int(33) int(34) int(35) int(36) int(37) int(38) int(39) int(40) int(41) int(42) int(43) int(44) int(45) int(46) int(47) int(48) int(49) int(50) int(51) int(52) int(53) int(54) int(55) int(56) int(57) int(58) int(59) int(60) int(61) int(62) int(63) int(64) int(65) int(66) int(67) int(68) int(69) int(70) int(71) int(72) int(73) int(74) int(75) int(76) int(77) int(78) int(79) int(80) int(81) int(82) int(83) int(84) int(85) int(86) int(87) int(88) int(89) int(90) int(91) int(92) int(93) int(94) int(95) int(96) int(97) int(98) int(99) int(100) int(101) int(102) int(103) int(104) int(105) int(106) int(107) int(108) int(109) int(110) int(111) int(112) int(113) int(114) int(115) int(116) int(117) int(118) int(119) int(120) int(121) int(122) int(123) int(124) int(125) int(126) int(127) int(128) int(129) int(130) int(131) int(132) int(133) int(134) int(135) int(136) int(137) int(138) int(139) int(140) int(141) int(142) int(143) int(144) int(145) int(146) int(147) int(148) int(149) int(150) int(151) int(152) int(153) int(154) int(155) int(156) int(157) int(158) int(159) int(160) int(161) int(162) int(163) int(164) int(165) int(166) int(167) int(168) int(169) int(170) int(171) int(172) int(173) int(174) int(175) int(176) int(177) int(178) int(179) int(180) int(181) int(182) int(183) int(184) int(185) int(186) int(187) int(188) int(189) int(190) int(191) int(192) int(193) int(194) int(195) int(196) int(197) int(198) int(199) Done http://cvs.php.net/co.php/php-src/ext/oci8/tests/bug27303_4.phpt?r=1.1&p=1 Index: php-src/ext/oci8/tests/bug27303_4.phpt +++ php-src/ext/oci8/tests/bug27303_4.phpt --TEST-- bug #27303 (OCIBindByName binds numeric PHP values as characters) --SKIPIF-- <?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> --ENV-- return " ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." "; --FILE-- <?php require dirname(__FILE__).'/connect.inc'; $create_st = array(); $create_st[] = "drop sequence myseq"; $create_st[] = "drop table mytab"; $create_st[] = "create sequence myseq"; $create_st[] = "create table mytab (mydata varchar2(20), seqcol number)"; foreach ($create_st as $statement) { $stmt = oci_parse($c, $statement); oci_execute($stmt); } define('MYLIMIT', 200); define('INITMYBV', 11); $stmt = "insert into mytab (mydata, seqcol) values ('Some data', myseq.nextval) returning seqcol into :mybv"; $stid = OCIParse($c, $stmt); if (!$stid) { echo "Parse error"; die; } //$mybv = INITMYBV; // Uncomment this for the 2nd test only $r = OCIBindByName($stid, ':MYBV', $mybv, 0 ); // Uncomment this for the 3rd test only if (!$r) { echo "Bind error"; die; } for ($i = 1; $i < MYLIMIT; $i++) { $r = OCIExecute($stid, OCI_DEFAULT); if (!$r) { echo "Execute error"; die; } var_dump($mybv); } OCICommit($c); $drop_st = array(); $drop_st[] = "drop sequence myseq"; $drop_st[] = "drop table mytab"; foreach ($create_st as $statement) { $stmt = oci_parse($c, $statement); oci_execute($stmt); } echo "Done\n"; ?> --EXPECTF-- string(1) "1" string(1) "2" string(1) "3" string(1) "4" string(1) "5" string(1) "6" string(1) "7" string(1) "8" string(1) "9" string(2) "10" string(2) "11" string(2) "12" string(2) "13" string(2) "14" string(2) "15" string(2) "16" string(2) "17" string(2) "18" string(2) "19" string(2) "20" string(2) "21" string(2) "22" string(2) "23" string(2) "24" string(2) "25" string(2) "26" string(2) "27" string(2) "28" string(2) "29" string(2) "30" string(2) "31" string(2) "32" string(2) "33" string(2) "34" string(2) "35" string(2) "36" string(2) "37" string(2) "38" string(2) "39" string(2) "40" string(2) "41" string(2) "42" string(2) "43" string(2) "44" string(2) "45" string(2) "46" string(2) "47" string(2) "48" string(2) "49" string(2) "50" string(2) "51" string(2) "52" string(2) "53" string(2) "54" string(2) "55" string(2) "56" string(2) "57" string(2) "58" string(2) "59" string(2) "60" string(2) "61" string(2) "62" string(2) "63" string(2) "64" string(2) "65" string(2) "66" string(2) "67" string(2) "68" string(2) "69" string(2) "70" string(2) "71" string(2) "72" string(2) "73" string(2) "74" string(2) "75" string(2) "76" string(2) "77" string(2) "78" string(2) "79" string(2) "80" string(2) "81" string(2) "82" string(2) "83" string(2) "84" string(2) "85" string(2) "86" string(2) "87" string(2) "88" string(2) "89" string(2) "90" string(2) "91" string(2) "92" string(2) "93" string(2) "94" string(2) "95" string(2) "96" string(2) "97" string(2) "98" string(2) "99" string(3) "100" string(3) "101" string(3) "102" string(3) "103" string(3) "104" string(3) "105" string(3) "106" string(3) "107" string(3) "108" string(3) "109" string(3) "110" string(3) "111" string(3) "112" string(3) "113" string(3) "114" string(3) "115" string(3) "116" string(3) "117" string(3) "118" string(3) "119" string(3) "120" string(3) "121" string(3) "122" string(3) "123" string(3) "124" string(3) "125" string(3) "126" string(3) "127" string(3) "128" string(3) "129" string(3) "130" string(3) "131" string(3) "132" string(3) "133" string(3) "134" string(3) "135" string(3) "136" string(3) "137" string(3) "138" string(3) "139" string(3) "140" string(3) "141" string(3) "142" string(3) "143" string(3) "144" string(3) "145" string(3) "146" string(3) "147" string(3) "148" string(3) "149" string(3) "150" string(3) "151" string(3) "152" string(3) "153" string(3) "154" string(3) "155" string(3) "156" string(3) "157" string(3) "158" string(3) "159" string(3) "160" string(3) "161" string(3) "162" string(3) "163" string(3) "164" string(3) "165" string(3) "166" string(3) "167" string(3) "168" string(3) "169" string(3) "170" string(3) "171" string(3) "172" string(3) "173" string(3) "174" string(3) "175" string(3) "176" string(3) "177" string(3) "178" string(3) "179" string(3) "180" string(3) "181" string(3) "182" string(3) "183" string(3) "184" string(3) "185" string(3) "186" string(3) "187" string(3) "188" string(3) "189" string(3) "190" string(3) "191" string(3) "192" string(3) "193" string(3) "194" string(3) "195" string(3) "196" string(3) "197" string(3) "198" string(3) "199" Done http://cvs.php.net/co.php/php-src/ext/oci8/tests/bug32325.phpt?r=1.1&p=1 Index: php-src/ext/oci8/tests/bug32325.phpt +++ php-src/ext/oci8/tests/bug32325.phpt --TEST-- bug #32325 (Can't retrieve collection using OCI8) --SKIPIF-- <?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> --ENV-- return " ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." "; --FILE-- <?php require dirname(__FILE__).'/connect.inc'; require dirname(__FILE__).'/create_table.inc'; $create_stmt = oci_parse($c, "create or replace type ut_num_list_t as table of number"); oci_execute($create_stmt); $collection = oci_new_collection($c, "UT_NUM_LIST_T"); $sql = " begin select ut_num_list_t(1,2,3,4) into :list from dual; end;"; $stmt = oci_parse($c, $sql); oci_bind_by_name($stmt, ":list", $collection, -1, OCI_B_NTY); oci_execute($stmt); var_dump($collection->size()); var_dump($collection->getelem(1)); var_dump($collection->getelem(2)); $drop_stmt = oci_parse($c, "drop type ut_num_list_t"); oci_execute($drop_stmt); echo "Done\n"; ?> --EXPECTF-- int(4) float(2) float(3) Done http://cvs.php.net/co.php/php-src/ext/oci8/tests/close.phpt?r=1.1&p=1 Index: php-src/ext/oci8/tests/close.phpt +++ php-src/ext/oci8/tests/close.phpt --TEST-- connect/close/connect --SKIPIF-- <?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> --ENV-- return " ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." "; --FILE-- <?php require dirname(__FILE__).'/connect.inc'; oci_close($c); oci_connect($user, $password, $dbase); echo "Done\n"; ?> --EXPECTF-- Done http://cvs.php.net/co.php/php-src/ext/oci8/tests/coll_001.phpt?r=1.1&p=1 Index: php-src/ext/oci8/tests/coll_001.phpt +++ php-src/ext/oci8/tests/coll_001.phpt --TEST-- oci_new_collection() --SKIPIF-- <?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> --ENV-- return " ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." TNS_ADMIN=".(isset($_ENV['TNS_ADMIN']) ? $_ENV['TNS_ADMIN'] : '')." "; --FILE-- <?php require dirname(__FILE__)."/connect.inc"; require dirname(__FILE__)."/create_type.inc"; var_dump(oci_new_collection($c, $type_name)); var_dump(oci_new_collection($c, "NONEXISTENT")); echo "Done\n"; require dirname(__FILE__)."/drop_type.inc"; ?> --EXPECTF-- object(OCI-Collection)#%d (1) { ["collection"]=> resource(%d) of type (oci8 collection) } Warning: oci_new_collection(): OCI-22303: type ""."NONEXISTENT" not found in %s on line %d bool(false) Done http://cvs.php.net/co.php/php-src/ext/oci8/tests/coll_002.phpt?r=1.1&p=1 Index: php-src/ext/oci8/tests/coll_002.phpt +++ php-src/ext/oci8/tests/coll_002.phpt --TEST-- oci_new_collection() + free() --SKIPIF-- <?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> --ENV-- return " ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." TNS_ADMIN=".(isset($_ENV['TNS_ADMIN']) ? $_ENV['TNS_ADMIN'] : '')." "; --FILE-- <?php require dirname(__FILE__)."/connect.inc"; require dirname(__FILE__)."/create_type.inc"; var_dump($coll1 = oci_new_collection($c, $type_name)); var_dump($coll1->free()); var_dump($coll1->size()); echo "Done\n"; require dirname(__FILE__)."/drop_type.inc"; ?> --EXPECTF-- object(OCI-Collection)#%d (1) { ["collection"]=> resource(%d) of type (oci8 collection) } bool(true) Warning: OCI-Collection::size(): %d is not a valid oci8 collection resource in %s on line %d bool(false) Done http://cvs.php.net/co.php/php-src/ext/oci8/tests/coll_002_func.phpt?r=1.1&p=1 Index: php-src/ext/oci8/tests/coll_002_func.phpt +++ php-src/ext/oci8/tests/coll_002_func.phpt --TEST-- oci_new_collection() + free() --SKIPIF-- <?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> --ENV-- return " ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." TNS_ADMIN=".(isset($_ENV['TNS_ADMIN']) ? $_ENV['TNS_ADMIN'] : '')." "; --FILE-- <?php require dirname(__FILE__)."/connect.inc"; require dirname(__FILE__)."/create_type.inc"; var_dump($coll1 = oci_new_collection($c, $type_name)); var_dump(oci_free_collection($coll1)); var_dump(oci_collection_size($coll1)); echo "Done\n"; require dirname(__FILE__)."/drop_type.inc"; ?> --EXPECTF-- object(OCI-Collection)#%d (1) { ["collection"]=> resource(%d) of type (oci8 collection) } bool(true) Warning: oci_collection_size(): %d is not a valid oci8 collection resource in %s on line %d bool(false) Done http://cvs.php.net/co.php/php-src/ext/oci8/tests/coll_003.phpt?r=1.1&p=1 Index: php-src/ext/oci8/tests/coll_003.phpt +++ php-src/ext/oci8/tests/coll_003.phpt --TEST-- collection methods --SKIPIF-- <?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> --ENV-- return " ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." TNS_ADMIN=".(isset($_ENV['TNS_ADMIN']) ? $_ENV['TNS_ADMIN'] : '')." "; --FILE-- <?php require dirname(__FILE__)."/connect.inc"; require dirname(__FILE__)."/create_type.inc"; $coll1 = oci_new_collection($c, $type_name); var_dump($coll1->size()); var_dump($coll1->max()); var_dump($coll1->trim(3)); var_dump($coll1->append(1)); var_dump($coll1->getElem(0)); var_dump($coll1->assignElem(0,2)); echo "Done\n"; require dirname(__FILE__)."/drop_type.inc"; ?> --EXPECTF-- int(0) int(0) Warning: OCI-Collection::trim(): OCI-22167: given trim size [3] must be less than or equal to [0] in %s on line %d bool(false) bool(true) float(1) bool(true) Done http://cvs.php.net/co.php/php-src/ext/oci8/tests/coll_003_func.phpt?r=1.1&p=1 Index: php-src/ext/oci8/tests/coll_003_func.phpt +++ php-src/ext/oci8/tests/coll_003_func.phpt --TEST-- collection methods --SKIPIF-- <?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> --ENV-- return " ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." TNS_ADMIN=".(isset($_ENV['TNS_ADMIN']) ? $_ENV['TNS_ADMIN'] : '')." "; --FILE-- <?php require dirname(__FILE__)."/connect.inc"; require dirname(__FILE__)."/create_type.inc"; $coll1 = oci_new_collection($c, $type_name); var_dump(oci_collection_size($coll1)); var_dump(oci_collection_max($coll1)); var_dump(oci_collection_trim($coll1, 3)); var_dump(oci_collection_append($coll1, 1)); var_dump(oci_collection_element_get($coll1, 0)); var_dump(oci_collection_element_assign($coll1, 0, 2)); echo "Done\n"; require dirname(__FILE__)."/drop_type.inc"; ?> --EXPECTF-- int(0) int(0) Warning: oci_collection_trim(): OCI-22167: given trim size [3] must be less than or equal to [0] in %s on line %d bool(false) bool(true) float(1) bool(true) Done http://cvs.php.net/co.php/php-src/ext/oci8/tests/coll_004.phpt?r=1.1&p=1 Index: php-src/ext/oci8/tests/coll_004.phpt +++ php-src/ext/oci8/tests/coll_004.phpt --TEST-- oci_collection_assign() --SKIPIF-- <?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> --ENV-- return " ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." TNS_ADMIN=".(isset($_ENV['TNS_ADMIN']) ? $_ENV['TNS_ADMIN'] : '')." "; --FILE-- <?php require dirname(__FILE__)."/connect.inc"; require dirname(__FILE__)."/create_type.inc"; $coll1 = oci_new_collection($c, $type_name); $coll2 = oci_new_collection($c, $type_name); var_dump($coll1->append(1)); var_dump($coll2->assign($coll1)); var_dump($coll2->getElem(0)); echo "Done\n"; require dirname(__FILE__)."/drop_type.inc"; ?> --EXPECT-- bool(true) bool(true) float(1) Done http://cvs.php.net/co.php/php-src/ext/oci8/tests/coll_004_func.phpt?r=1.1&p=1 Index: php-src/ext/oci8/tests/coll_004_func.phpt +++ php-src/ext/oci8/tests/coll_004_func.phpt --TEST-- oci_collection_assign() --SKIPIF-- <?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> --ENV-- return " ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." TNS_ADMIN=".(isset($_ENV['TNS_ADMIN']) ? $_ENV['TNS_ADMIN'] : '')." "; --FILE-- <?php require dirname(__FILE__)."/connect.inc"; require dirname(__FILE__)."/create_type.inc"; $coll1 = oci_new_collection($c, $type_name); $coll2 = oci_new_collection($c, $type_name); var_dump(oci_collection_append($coll1, 1)); var_dump(oci_collection_assign($coll2, $coll1)); var_dump(oci_collection_element_get($coll2, 0)); echo "Done\n"; require dirname(__FILE__)."/drop_type.inc"; ?> --EXPECT-- bool(true) bool(true) float(1) Done http://cvs.php.net/co.php/php-src/ext/oci8/tests/coll_005.phpt?r=1.1&p=1 Index: php-src/ext/oci8/tests/coll_005.phpt +++ php-src/ext/oci8/tests/coll_005.phpt --TEST-- ocinewcollection() --SKIPIF-- <?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> --ENV-- return " ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." TNS_ADMIN=".(isset($_ENV['TNS_ADMIN']) ? $_ENV['TNS_ADMIN'] : '')." "; --FILE-- <?php require dirname(__FILE__)."/connect.inc"; require dirname(__FILE__)."/create_type.inc"; var_dump(ocinewcollection($c, $type_name)); var_dump(ocinewcollection($c, "NONEXISTENT")); echo "Done\n"; require dirname(__FILE__)."/drop_type.inc"; ?> --EXPECTF-- object(OCI-Collection)#%d (1) { ["collection"]=> resource(%d) of type (oci8 collection) } Warning: ocinewcollection(): OCI-22303: type ""."NONEXISTENT" not found in %s on line %d bool(false) Done http://cvs.php.net/co.php/php-src/ext/oci8/tests/coll_006.phpt?r=1.1&p=1 Index: php-src/ext/oci8/tests/coll_006.phpt +++ php-src/ext/oci8/tests/coll_006.phpt --TEST-- ocinewcollection() + free() --SKIPIF-- <?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> --ENV-- return " ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." TNS_ADMIN=".(isset($_ENV['TNS_ADMIN']) ? $_ENV['TNS_ADMIN'] : '')." "; --FILE-- <?php require dirname(__FILE__)."/connect.inc"; require dirname(__FILE__)."/create_type.inc"; var_dump($coll1 = ocinewcollection($c, $type_name)); var_dump($coll1->free()); var_dump($coll1->size()); echo "Done\n"; require dirname(__FILE__)."/drop_type.inc"; ?> --EXPECTF-- object(OCI-Collection)#%d (1) { ["collection"]=> resource(%d) of type (oci8 collection) } bool(true) Warning: OCI-Collection::size(): %d is not a valid oci8 collection resource in %s on line %d bool(false) Done http://cvs.php.net/co.php/php-src/ext/oci8/tests/coll_006_func.phpt?r=1.1&p=1 Index: php-src/ext/oci8/tests/coll_006_func.phpt +++ php-src/ext/oci8/tests/coll_006_func.phpt --TEST-- ocinewcollection() + free() --SKIPIF-- <?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> --ENV-- return " ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." TNS_ADMIN=".(isset($_ENV['TNS_ADMIN']) ? $_ENV['TNS_ADMIN'] : '')." "; --FILE-- <?php require dirname(__FILE__)."/connect.inc"; require dirname(__FILE__)."/create_type.inc"; var_dump($coll1 = ocinewcollection($c, $type_name)); var_dump(oci_free_collection($coll1)); var_dump(oci_collection_size($coll1)); echo "Done\n"; require dirname(__FILE__)."/drop_type.inc"; ?> --EXPECTF-- object(OCI-Collection)#%d (1) { ["collection"]=> resource(%d) of type (oci8 collection) } bool(true) Warning: oci_collection_size(): %d is not a valid oci8 collection resource in %s on line %d bool(false) Done http://cvs.php.net/co.php/php-src/ext/oci8/tests/coll_007.phpt?r=1.1&p=1 Index: php-src/ext/oci8/tests/coll_007.phpt +++ php-src/ext/oci8/tests/coll_007.phpt --TEST-- collection methods --SKIPIF-- <?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> --ENV-- return " ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." TNS_ADMIN=".(isset($_ENV['TNS_ADMIN']) ? $_ENV['TNS_ADMIN'] : '')." "; --FILE-- <?php require dirname(__FILE__)."/connect.inc"; require dirname(__FILE__)."/create_type.inc"; $coll1 = ocinewcollection($c, $type_name); var_dump($coll1->size()); var_dump($coll1->max()); var_dump($coll1->trim(3)); var_dump($coll1->append(1)); var_dump($coll1->getElem(0)); var_dump($coll1->assignElem(0,2)); echo "Done\n"; require dirname(__FILE__)."/drop_type.inc"; ?> --EXPECTF-- int(0) int(0) Warning: OCI-Collection::trim(): OCI-22167: given trim size [3] must be less than or equal to [0] in %s on line %d bool(false) bool(true) float(1) bool(true) Done http://cvs.php.net/co.php/php-src/ext/oci8/tests/coll_008.phpt?r=1.1&p=1 Index: php-src/ext/oci8/tests/coll_008.phpt +++ php-src/ext/oci8/tests/coll_008.phpt --TEST-- ocicollassign() --SKIPIF-- <?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> --ENV-- return " ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." TNS_ADMIN=".(isset($_ENV['TNS_ADMIN']) ? $_ENV['TNS_ADMIN'] : '')." "; --FILE-- <?php require dirname(__FILE__)."/connect.inc"; require dirname(__FILE__)."/create_type.inc"; $coll1 = ocinewcollection($c, $type_name); $coll2 = ocinewcollection($c, $type_name); var_dump($coll1->append(1)); var_dump($coll2->assign($coll1)); var_dump($coll2->getElem(0)); echo "Done\n"; require dirname(__FILE__)."/drop_type.inc"; ?> --EXPECT-- bool(true) bool(true) float(1) Done http://cvs.php.net/co.php/php-src/ext/oci8/tests/coll_009.phpt?r=1.1&p=1 Index: php-src/ext/oci8/tests/coll_009.phpt +++ php-src/ext/oci8/tests/coll_009.phpt --TEST-- collections and wrong dates --SKIPIF-- <?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> --ENV-- return " ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." TNS_ADMIN=".(isset($_ENV['TNS_ADMIN']) ? $_ENV['TNS_ADMIN'] : '')." "; --FILE-- <?php require dirname(__FILE__)."/connect.inc"; $ora_sql = "DROP TYPE ".$type_name." "; $statement = OCIParse($c,$ora_sql); @OCIExecute($statement); $ora_sql = "CREATE TYPE ".$type_name." AS TABLE OF DATE"; $statement = OCIParse($c,$ora_sql); OCIExecute($statement); $coll1 = ocinewcollection($c, $type_name); $coll2 = ocinewcollection($c, $type_name); var_dump($coll1->append("2005-07-28")); var_dump($coll2->assign($coll1)); var_dump($coll2->getElem(0)); echo "Done\n"; require dirname(__FILE__)."/drop_type.inc"; ?> --EXPECTF-- Warning: OCI-Collection::append(): OCI-01861: literal does not match format string in %s on line %d bool(false) bool(true) bool(false) Done http://cvs.php.net/co.php/php-src/ext/oci8/tests/coll_009_func.phpt?r=1.1&p=1 Index: php-src/ext/oci8/tests/coll_009_func.phpt +++ php-src/ext/oci8/tests/coll_009_func.phpt --TEST-- collections and wrong dates --SKIPIF-- <?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> --ENV-- return " ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." TNS_ADMIN=".(isset($_ENV['TNS_ADMIN']) ? $_ENV['TNS_ADMIN'] : '')." "; --FILE-- <?php require dirname(__FILE__)."/connect.inc"; $ora_sql = "DROP TYPE ".$type_name." "; $statement = OCIParse($c,$ora_sql); @OCIExecute($statement); $ora_sql = "CREATE TYPE ".$type_name." AS TABLE OF DATE"; $statement = OCIParse($c,$ora_sql); OCIExecute($statement); $coll1 = ocinewcollection($c, $type_name); $coll2 = ocinewcollection($c, $type_name); var_dump(oci_collection_append($coll1, "2005-07-28")); var_dump(oci_collection_assign($coll2, $coll1)); var_dump(oci_collection_element_get($coll2, 0)); echo "Done\n"; require dirname(__FILE__)."/drop_type.inc"; ?> --EXPECTF-- Warning: oci_collection_append(): OCI-01861: literal does not match format string in %s on line %d bool(false) bool(true) bool(false) Done http://cvs.php.net/co.php/php-src/ext/oci8/tests/coll_010.phpt?r=1.1&p=1 Index: php-src/ext/oci8/tests/coll_010.phpt +++ php-src/ext/oci8/tests/coll_010.phpt --TEST-- collections and nulls --SKIPIF-- <?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> --ENV-- return " ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." TNS_ADMIN=".(isset($_ENV['TNS_ADMIN']) ? $_ENV['TNS_ADMIN'] : '')." "; --FILE-- <?php require dirname(__FILE__)."/connect.inc"; $ora_sql = "DROP TYPE ".$type_name." "; $statement = OCIParse($c,$ora_sql); @OCIExecute($statement); $ora_sql = "CREATE TYPE ".$type_name." AS TABLE OF VARCHAR(10)"; $statement = OCIParse($c,$ora_sql); OCIExecute($statement); $coll1 = ocinewcollection($c, $type_name); $coll2 = ocinewcollection($c, $type_name); var_dump($coll1->append(null)); var_dump($coll2->assign($coll1)); var_dump($coll2->getElem(0)); echo "Done\n"; require dirname(__FILE__)."/drop_type.inc"; ?> --EXPECT-- bool(true) bool(true) NULL Done http://cvs.php.net/co.php/php-src/ext/oci8/tests/coll_010_func.phpt?r=1.1&p=1 Index: php-src/ext/oci8/tests/coll_010_func.phpt +++ php-src/ext/oci8/tests/coll_010_func.phpt --TEST-- collections and nulls --SKIPIF-- <?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> --ENV-- return " ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." TNS_ADMIN=".(isset($_ENV['TNS_ADMIN']) ? $_ENV['TNS_ADMIN'] : '')." "; --FILE-- <?php require dirname(__FILE__)."/connect.inc"; $ora_sql = "DROP TYPE ".$type_name." "; $statement = OCIParse($c,$ora_sql); @OCIExecute($statement); $ora_sql = "CREATE TYPE ".$type_name." AS TABLE OF VARCHAR(10)"; $statement = OCIParse($c,$ora_sql); OCIExecute($statement); $coll1 = ocinewcollection($c, $type_name); $coll2 = ocinewcollection($c, $type_name); var_dump(oci_collection_append($coll1, null)); var_dump(oci_collection_assign($coll2, $coll1)); var_dump(oci_collection_element_get($coll2, 0)); echo "Done\n"; require dirname(__FILE__)."/drop_type.inc"; ?> --EXPECT-- bool(true) bool(true) NULL Done http://cvs.php.net/co.php/php-src/ext/oci8/tests/coll_011.phpt?r=1.1&p=1 Index: php-src/ext/oci8/tests/coll_011.phpt +++ php-src/ext/oci8/tests/coll_011.phpt --TEST-- collections and strings --SKIPIF-- <?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> --ENV-- return " ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." TNS_ADMIN=".(isset($_ENV['TNS_ADMIN']) ? $_ENV['TNS_ADMIN'] : '')." "; --FILE-- <?php require dirname(__FILE__)."/connect.inc"; $ora_sql = "DROP TYPE ".$type_name." "; $statement = OCIParse($c,$ora_sql); @OCIExecute($statement); $ora_sql = "CREATE TYPE ".$type_name." AS TABLE OF VARCHAR(10)"; $statement = OCIParse($c,$ora_sql); OCIExecute($statement); $coll1 = ocinewcollection($c, $type_name); $coll2 = ocinewcollection($c, $type_name); var_dump($coll1->append("string")); var_dump($coll1->append("string")); var_dump($coll2->assign($coll1)); var_dump($coll2->getElem(0)); echo "Done\n"; require dirname(__FILE__)."/drop_type.inc"; ?> --EXPECT-- bool(true) bool(true) bool(true) string(6) "string" Done http://cvs.php.net/co.php/php-src/ext/oci8/tests/coll_011_func.phpt?r=1.1&p=1 Index: php-src/ext/oci8/tests/coll_011_func.phpt +++ php-src/ext/oci8/tests/coll_011_func.phpt --TEST-- collections and strings --SKIPIF-- <?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> --ENV-- return " ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." TNS_ADMIN=".(isset($_ENV['TNS_ADMIN']) ? $_ENV['TNS_ADMIN'] : '')." "; --FILE-- <?php require dirname(__FILE__)."/connect.inc"; $ora_sql = "DROP TYPE ".$type_name." "; $statement = OCIParse($c,$ora_sql); @OCIExecute($statement); $ora_sql = "CREATE TYPE ".$type_name." AS TABLE OF VARCHAR(10)"; $statement = OCIParse($c,$ora_sql); OCIExecute($statement); $coll1 = ocinewcollection($c, $type_name); $coll2 = ocinewcollection($c, $type_name); var_dump(oci_collection_append($coll1, "string")); var_dump(oci_collection_append($coll1, "string")); var_dump(oci_collection_assign($coll2, $coll1)); var_dump(oci_collection_element_get($coll2, 0)); echo "Done\n"; require dirname(__FILE__)."/drop_type.inc"; ?> --EXPECT-- bool(true) bool(true) bool(true) string(6) "string" Done http://cvs.php.net/co.php/php-src/ext/oci8/tests/coll_012.phpt?r=1.1&p=1 Index: php-src/ext/oci8/tests/coll_012.phpt +++ php-src/ext/oci8/tests/coll_012.phpt --TEST-- collections and correct dates --SKIPIF-- <?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> --ENV-- return " ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." TNS_ADMIN=".(isset($_ENV['TNS_ADMIN']) ? $_ENV['TNS_ADMIN'] : '')." "; --FILE-- <?php require dirname(__FILE__)."/connect.inc"; $ora_sql = "DROP TYPE ".$type_name." "; $statement = OCIParse($c,$ora_sql); @OCIExecute($statement); $ora_sql = "CREATE TYPE ".$type_name." AS TABLE OF DATE"; $statement = OCIParse($c,$ora_sql); OCIExecute($statement); $coll1 = ocinewcollection($c, $type_name); $coll2 = ocinewcollection($c, $type_name); var_dump($coll1->append("28-JUL-05")); var_dump($coll2->assign($coll1)); var_dump($coll2->getElem(0)); echo "Done\n"; require dirname(__FILE__)."/drop_type.inc"; ?> --EXPECT-- bool(true) bool(true) string(9) "28-JUL-05" Done http://cvs.php.net/co.php/php-src/ext/oci8/tests/coll_012_func.phpt?r=1.1&p=1 Index: php-src/ext/oci8/tests/coll_012_func.phpt +++ php-src/ext/oci8/tests/coll_012_func.phpt --TEST-- collections and correct dates --SKIPIF-- <?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> --ENV-- return " ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." TNS_ADMIN=".(isset($_ENV['TNS_ADMIN']) ? $_ENV['TNS_ADMIN'] : '')." "; --FILE-- <?php require dirname(__FILE__)."/connect.inc"; $ora_sql = "DROP TYPE ".$type_name." "; $statement = OCIParse($c,$ora_sql); @OCIExecute($statement); $ora_sql = "CREATE TYPE ".$type_name." AS TABLE OF DATE"; $statement = OCIParse($c,$ora_sql); OCIExecute($statement); $coll1 = ocinewcollection($c, $type_name); $coll2 = ocinewcollection($c, $type_name); var_dump(oci_collection_append($coll1, "28-JUL-05")); var_dump(oci_collection_assign($coll2, $coll1)); var_dump(oci_collection_element_get($coll2, 0)); echo "Done\n"; require dirname(__FILE__)."/drop_type.inc"; ?> --EXPECT-- bool(true) bool(true) string(9) "28-JUL-05" Done http://cvs.php.net/co.php/php-src/ext/oci8/tests/coll_013.phpt?r=1.1&p=1 Index: php-src/ext/oci8/tests/coll_013.phpt +++ php-src/ext/oci8/tests/coll_013.phpt --TEST-- collections and correct dates (2) --SKIPIF-- <?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> --ENV-- return " ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." TNS_ADMIN=".(isset($_ENV['TNS_ADMIN']) ? $_ENV['TNS_ADMIN'] : '')." "; --FILE-- <?php require dirname(__FILE__)."/connect.inc"; $ora_sql = "DROP TYPE ".$type_name." "; $statement = OCIParse($c,$ora_sql); @OCIExecute($statement); $ora_sql = "CREATE TYPE ".$type_name." AS TABLE OF DATE"; $statement = OCIParse($c,$ora_sql); OCIExecute($statement); $coll1 = ocinewcollection($c, $type_name); var_dump($coll1->append("28-JUL-05")); var_dump($coll1->assignElem(0,"01-JAN-05")); var_dump($coll1->getElem(0)); echo "Done\n"; require dirname(__FILE__)."/drop_type.inc"; ?> --EXPECT-- bool(true) bool(true) string(9) "01-JAN-05" Done http://cvs.php.net/co.php/php-src/ext/oci8/tests/coll_013_func.phpt?r=1.1&p=1 Index: php-src/ext/oci8/tests/coll_013_func.phpt +++ php-src/ext/oci8/tests/coll_013_func.phpt --TEST-- collections and correct dates (2) --SKIPIF-- <?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> --ENV-- return " ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." TNS_ADMIN=".(isset($_ENV['TNS_ADMIN']) ? $_ENV['TNS_ADMIN'] : '')." "; --FILE-- <?php require dirname(__FILE__)."/connect.inc"; $ora_sql = "DROP TYPE ".$type_name." "; $statement = OCIParse($c,$ora_sql); @OCIExecute($statement); $ora_sql = "CREATE TYPE ".$type_name." AS TABLE OF DATE"; $statement = OCIParse($c,$ora_sql); OCIExecute($statement); $coll1 = ocinewcollection($c, $type_name); var_dump(oci_collection_append($coll1, "28-JUL-05")); var_dump(oci_collection_element_assign($coll1, 0, "01-JAN-05")); var_dump(oci_collection_element_get($coll1, 0)); echo "Done\n"; require dirname(__FILE__)."/drop_type.inc"; ?> --EXPECT-- bool(true) bool(true) string(9) "01-JAN-05" Done http://cvs.php.net/co.php/php-src/ext/oci8/tests/coll_014.phpt?r=1.1&p=1 Index: php-src/ext/oci8/tests/coll_014.phpt +++ php-src/ext/oci8/tests/coll_014.phpt --TEST-- collections and strings (2) --SKIPIF-- <?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> --ENV-- return " ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." TNS_ADMIN=".(isset($_ENV['TNS_ADMIN']) ? $_ENV['TNS_ADMIN'] : '')." "; --FILE-- <?php require dirname(__FILE__)."/connect.inc"; $ora_sql = "DROP TYPE ".$type_name." "; $statement = OCIParse($c,$ora_sql); @OCIExecute($statement); $ora_sql = "CREATE TYPE ".$type_name." AS TABLE OF VARCHAR(10)"; $statement = OCIParse($c,$ora_sql); OCIExecute($statement); $coll1 = ocinewcollection($c, $type_name); var_dump($coll1->append("striing")); var_dump($coll1->assignElem(0,"blah")); var_dump($coll1->getElem(0)); echo "Done\n"; require dirname(__FILE__)."/drop_type.inc"; ?> --EXPECT-- bool(true) bool(true) string(4) "blah" Done http://cvs.php.net/co.php/php-src/ext/oci8/tests/coll_014_func.phpt?r=1.1&p=1 Index: php-src/ext/oci8/tests/coll_014_func.phpt +++ php-src/ext/oci8/tests/coll_014_func.phpt --TEST-- collections and strings (2) --SKIPIF-- <?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> --ENV-- return " ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." TNS_ADMIN=".(isset($_ENV['TNS_ADMIN']) ? $_ENV['TNS_ADMIN'] : '')." "; --FILE-- <?php require dirname(__FILE__)."/connect.inc"; $ora_sql = "DROP TYPE ".$type_name." "; $statement = OCIParse($c,$ora_sql); @OCIExecute($statement); $ora_sql = "CREATE TYPE ".$type_name." AS TABLE OF VARCHAR(10)"; $statement = OCIParse($c,$ora_sql); OCIExecute($statement); $coll1 = ocinewcollection($c, $type_name); var_dump(oci_collection_append($coll1, "striing")); var_dump(oci_collection_element_assign($coll1, 0,"blah")); var_dump(oci_collection_element_get($coll1, 0)); echo "Done\n"; require dirname(__FILE__)."/drop_type.inc"; ?> --EXPECT-- bool(true) bool(true) string(4) "blah" Done http://cvs.php.net/co.php/php-src/ext/oci8/tests/coll_015.phpt?r=1.1&p=1 Index: php-src/ext/oci8/tests/coll_015.phpt +++ php-src/ext/oci8/tests/coll_015.phpt --TEST-- collections and numbers (2) --SKIPIF-- <?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> --ENV-- return " ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." TNS_ADMIN=".(isset($_ENV['TNS_ADMIN']) ? $_ENV['TNS_ADMIN'] : '')." "; --FILE-- <?php require dirname(__FILE__)."/connect.inc"; $ora_sql = "DROP TYPE ".$type_name." "; $statement = OCIParse($c,$ora_sql); @OCIExecute($statement); $ora_sql = "CREATE TYPE ".$type_name." AS TABLE OF NUMBER"; $statement = OCIParse($c,$ora_sql); OCIExecute($statement); $coll1 = ocinewcollection($c, $type_name); var_dump($coll1->append(1)); var_dump($coll1->assignElem(0,2345)); var_dump($coll1->getElem(0)); echo "Done\n"; require dirname(__FILE__)."/drop_type.inc"; ?> --EXPECT-- bool(true) bool(true) float(2345) Done http://cvs.php.net/co.php/php-src/ext/oci8/tests/coll_015_func.phpt?r=1.1&p=1 Index: php-src/ext/oci8/tests/coll_015_func.phpt +++ php-src/ext/oci8/tests/coll_015_func.phpt --TEST-- collections and numbers (2) --SKIPIF-- <?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> --ENV-- return " ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." TNS_ADMIN=".(isset($_ENV['TNS_ADMIN']) ? $_ENV['TNS_ADMIN'] : '')." "; --FILE-- <?php require dirname(__FILE__)."/connect.inc"; $ora_sql = "DROP TYPE ".$type_name." "; $statement = OCIParse($c,$ora_sql); @OCIExecute($statement); $ora_sql = "CREATE TYPE ".$type_name." AS TABLE OF NUMBER"; $statement = OCIParse($c,$ora_sql); OCIExecute($statement); $coll1 = ocinewcollection($c, $type_name); var_dump(oci_collection_append($coll1, 1)); var_dump(oci_collection_element_assign($coll1,0,2345)); var_dump(oci_collection_element_get($coll1, 0)); echo "Done\n"; require dirname(__FILE__)."/drop_type.inc"; ?> --EXPECT-- bool(true) bool(true) float(2345) Done http://cvs.php.net/co.php/php-src/ext/oci8/tests/coll_016.phpt?r=1.1&p=1 Index: php-src/ext/oci8/tests/coll_016.phpt +++ php-src/ext/oci8/tests/coll_016.phpt --TEST-- collections and negative/too big element indexes --SKIPIF-- <?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> --ENV-- return " ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." TNS_ADMIN=".(isset($_ENV['TNS_ADMIN']) ? $_ENV['TNS_ADMIN'] : '')." "; --FILE-- <?php require dirname(__FILE__)."/connect.inc"; $ora_sql = "DROP TYPE ".$type_name." "; $statement = OCIParse($c,$ora_sql); @OCIExecute($statement); $ora_sql = "CREATE TYPE ".$type_name." AS TABLE OF NUMBER"; $statement = OCIParse($c,$ora_sql); OCIExecute($statement); $coll1 = ocinewcollection($c, $type_name); var_dump($coll1->append(1)); var_dump($coll1->assignElem(-1,2345)); var_dump($coll1->assignElem(5000,2345)); var_dump($coll1->getElem(-1)); var_dump($coll1->getElem(-100)); var_dump($coll1->getElem(500)); echo "Done\n"; require dirname(__FILE__)."/drop_type.inc"; ?> --EXPECTF-- bool(true) Warning: OCI-Collection::assignelem(): OCI-22165: given index [4294967295] must be in the range of 0 to [0] in %s on line %d bool(false) Warning: OCI-Collection::assignelem(): OCI-22165: given index [5000] must be in the range of 0 to [0] in %s on line %d bool(false) bool(false) bool(false) bool(false) Done http://cvs.php.net/co.php/php-src/ext/oci8/tests/coll_016_func.phpt?r=1.1&p=1 Index: php-src/ext/oci8/tests/coll_016_func.phpt +++ php-src/ext/oci8/tests/coll_016_func.phpt --TEST-- collections and negative/too big element indexes --SKIPIF-- <?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> --ENV-- return " ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." TNS_ADMIN=".(isset($_ENV['TNS_ADMIN']) ? $_ENV['TNS_ADMIN'] : '')." "; --FILE-- <?php require dirname(__FILE__)."/connect.inc"; $ora_sql = "DROP TYPE ".$type_name." "; $statement = OCIParse($c,$ora_sql); @OCIExecute($statement); $ora_sql = "CREATE TYPE ".$type_name." AS TABLE OF NUMBER"; $statement = OCIParse($c,$ora_sql); OCIExecute($statement); $coll1 = ocinewcollection($c, $type_name); var_dump(oci_collection_append($coll1, 1)); var_dump(oci_collection_element_assign($coll1,-1,2345)); var_dump(oci_collection_element_assign($coll1,5000,2345)); var_dump(oci_collection_element_get($coll1, -1)); var_dump(oci_collection_element_get($coll1, -100)); var_dump(oci_collection_element_get($coll1, 500)); echo "Done\n"; require dirname(__FILE__)."/drop_type.inc"; ?> --EXPECTF-- bool(true) Warning: oci_collection_element_assign(): OCI-22165: given index [4294967295] must be in the range of 0 to [0] in %s on line %d bool(false) Warning: oci_collection_element_assign(): OCI-22165: given index [5000] must be in the range of 0 to [0] in %s on line %d bool(false) bool(false) bool(false) bool(false) Done http://cvs.php.net/co.php/php-src/ext/oci8/tests/coll_017.phpt?r=1.1&p=1 Index: php-src/ext/oci8/tests/coll_017.phpt +++ php-src/ext/oci8/tests/coll_017.phpt --TEST-- collections and nulls (2) --SKIPIF-- <?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> --ENV-- return " ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." TNS_ADMIN=".(isset($_ENV['TNS_ADMIN']) ? $_ENV['TNS_ADMIN'] : '')." "; --FILE-- <?php require dirname(__FILE__)."/connect.inc"; $ora_sql = "DROP TYPE ".$type_name." "; $statement = OCIParse($c,$ora_sql); @OCIExecute($statement); $ora_sql = "CREATE TYPE ".$type_name." AS TABLE OF VARCHAR(10)"; $statement = OCIParse($c,$ora_sql); OCIExecute($statement); $coll1 = ocinewcollection($c, $type_name); var_dump($coll1->append("string")); var_dump($coll1->assignElem(0, null)); var_dump($coll1->getElem(0)); echo "Done\n"; require dirname(__FILE__)."/drop_type.inc"; ?> --EXPECT-- bool(true) bool(true) NULL Done http://cvs.php.net/co.php/php-src/ext/oci8/tests/coll_017_func.phpt?r=1.1&p=1 Index: php-src/ext/oci8/tests/coll_017_func.phpt +++ php-src/ext/oci8/tests/coll_017_func.phpt --TEST-- collections and nulls (2) --SKIPIF-- <?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> --ENV-- return " ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." TNS_ADMIN=".(isset($_ENV['TNS_ADMIN']) ? $_ENV['TNS_ADMIN'] : '')." "; --FILE-- <?php require dirname(__FILE__)."/connect.inc"; $ora_sql = "DROP TYPE ".$type_name." "; $statement = OCIParse($c,$ora_sql); @OCIExecute($statement); $ora_sql = "CREATE TYPE ".$type_name." AS TABLE OF VARCHAR(10)"; $statement = OCIParse($c,$ora_sql); OCIExecute($statement); $coll1 = ocinewcollection($c, $type_name); var_dump(oci_collection_append($coll1, "string")); var_dump(oci_collection_element_assign($coll1, 0, null)); var_dump(oci_collection_element_get($coll1, 0)); echo "Done\n"; require dirname(__FILE__)."/drop_type.inc"; ?> --EXPECT-- bool(true) bool(true) NULL Done http://cvs.php.net/co.php/php-src/ext/oci8/tests/commit.phpt?r=1.1&p=1 Index: php-src/ext/oci8/tests/commit.phpt +++ php-src/ext/oci8/tests/commit.phpt --TEST-- oci_commit()/oci_rollback() --SKIPIF-- <?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> --ENV-- return " ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." "; --FILE-- <?php require dirname(__FILE__)."/connect.inc"; require dirname(__FILE__).'/create_table.inc'; $insert_sql = "INSERT INTO ".$schema.$table_name." (id, value) VALUES (1,1)"; if (!($s = oci_parse($c, $insert_sql))) { die("oci_parse(insert) failed!\n"); } for ($i = 0; $i<3; $i++) { if (!oci_execute($s, OCI_DEFAULT)) { die("oci_execute(insert) failed!\n"); } } var_dump(oci_rollback($c)); $select_sql = "SELECT * FROM ".$schema.$table_name.""; if (!($select = oci_parse($c, $select_sql))) { die("oci_parse(select) failed!\n"); } /* oci_fetch_all */ if (!oci_execute($select)) { die("oci_execute(select) failed!\n"); } var_dump(oci_fetch_all($select, $all)); var_dump($all); /* ocifetchstatement */ if (!oci_execute($s)) { die("oci_execute(select) failed!\n"); } $insert_sql = "INSERT INTO ".$schema.$table_name." (id, value) VALUES (1,1)"; if (!($s = oci_parse($c, $insert_sql))) { die("oci_parse(insert) failed!\n"); } for ($i = 0; $i<3; $i++) { if (!oci_execute($s, OCI_DEFAULT)) { die("oci_execute(insert) failed!\n"); } } var_dump(oci_commit($c)); /* oci_fetch_all */ if (!oci_execute($select)) { die("oci_execute(select) failed!\n"); } var_dump(oci_fetch_all($select, $all)); var_dump($all); require dirname(__FILE__).'/drop_table.inc'; echo "Done\n"; ?> --EXPECT-- bool(true) int(0) array(5) { ["ID"]=> array(0) { } ["VALUE"]=> array(0) { } ["BLOB"]=> array(0) { } ["CLOB"]=> array(0) { } ["STRING"]=> array(0) { } } bool(true) int(4) array(5) { ["ID"]=> array(4) { [0]=> string(1) "1" [1]=> string(1) "1" [2]=> string(1) "1" [3]=> string(1) "1" } ["VALUE"]=> array(4) { [0]=> string(1) "1" [1]=> string(1) "1" [2]=> string(1) "1" [3]=> string(1) "1" } ["BLOB"]=> array(4) { [0]=> NULL [1]=> NULL [2]=> NULL [3]=> NULL } ["CLOB"]=> array(4) { [0]=> NULL [1]=> NULL [2]=> NULL [3]=> NULL } ["STRING"]=> array(4) { [0]=> NULL [1]=> NULL [2]=> NULL [3]=> NULL } } Done http://cvs.php.net/co.php/php-src/ext/oci8/tests/commit_old.phpt?r=1.1&p=1 Index: php-src/ext/oci8/tests/commit_old.phpt +++ php-src/ext/oci8/tests/commit_old.phpt --TEST-- ocicommit()/ocirollback() --SKIPIF-- <?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> --ENV-- return " ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." "; --FILE-- <?php require dirname(__FILE__)."/connect.inc"; require dirname(__FILE__).'/create_table.inc'; $insert_sql = "INSERT INTO ".$schema.$table_name." (id, value) VALUES (1,1)"; if (!($s = ociparse($c, $insert_sql))) { die("ociparse(insert) failed!\n"); } for ($i = 0; $i<3; $i++) { if (!ociexecute($s, OCI_DEFAULT)) { die("ociexecute(insert) failed!\n"); } } var_dump(ocirollback($c)); $select_sql = "SELECT * FROM ".$schema.$table_name.""; if (!($select = ociparse($c, $select_sql))) { die("ociparse(select) failed!\n"); } if (!oci_execute($select)) { die("ociexecute(select) failed!\n"); } var_dump(ocifetchstatement($select, $all)); var_dump($all); /* ocifetchstatement */ if (!ociexecute($s)) { die("ociexecute(select) failed!\n"); } $insert_sql = "INSERT INTO ".$schema.$table_name." (id, value) VALUES (1,1)"; if (!($s = ociparse($c, $insert_sql))) { die("ociparse(insert) failed!\n"); } for ($i = 0; $i<3; $i++) { if (!ociexecute($s, OCI_DEFAULT)) { die("ociexecute(insert) failed!\n"); } } var_dump(ocicommit($c)); if (!ociexecute($select)) { die("ociexecute(select) failed!\n"); } var_dump(ocifetchstatement($select, $all)); var_dump($all); require dirname(__FILE__).'/drop_table.inc'; echo "Done\n"; ?> --EXPECT-- bool(true) int(0) array(5) { ["ID"]=> array(0) { } ["VALUE"]=> array(0) { } ["BLOB"]=> array(0) { } ["CLOB"]=> array(0) { } ["STRING"]=> array(0) { } } bool(true) int(4) array(5) { ["ID"]=> array(4) { [0]=> string(1) "1" [1]=> string(1) "1" [2]=> string(1) "1" [3]=> string(1) "1" } ["VALUE"]=> array(4) { [0]=> string(1) "1" [1]=> string(1) "1" [2]=> string(1) "1" [3]=> string(1) "1" } ["BLOB"]=> array(4) { [0]=> NULL [1]=> NULL [2]=> NULL [3]=> NULL } ["CLOB"]=> array(4) { [0]=> NULL [1]=> NULL [2]=> NULL [3]=> NULL } ["STRING"]=> array(4) { [0]=> NULL [1]=> NULL [2]=> NULL [3]=> NULL } } Done http://cvs.php.net/co.php/php-src/ext/oci8/tests/connect.phpt?r=1.1&p=1 Index: php-src/ext/oci8/tests/connect.phpt +++ php-src/ext/oci8/tests/connect.phpt --TEST-- oci_connect() --SKIPIF-- <?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> --ENV-- return " ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." "; --FILE-- <?php require dirname(__FILE__)."/connect.inc"; if (!empty($dbase)) { var_dump(oci_connect($user, $password, $dbase)); } else { var_dump(oci_connect($user, $password)); } echo "Done\n"; ?> --EXPECTF-- resource(%d) of type (oci8 connection) Done http://cvs.php.net/co.php/php-src/ext/oci8/tests/connect_1.phpt?r=1.1&p=1 Index: php-src/ext/oci8/tests/connect_1.phpt +++ php-src/ext/oci8/tests/connect_1.phpt --TEST-- oci_pconnect() & oci_new_connect() --SKIPIF-- <?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> --ENV-- return " ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." "; --FILE-- <?php require dirname(__FILE__)."/connect.inc"; if (!empty($dbase)) { var_dump($c1 = oci_pconnect($user, $password, $dbase)); } else { var_dump($c1 = oci_pconnect($user, $password)); } if (!empty($dbase)) { var_dump($c2 = oci_new_connect($user, $password, $dbase)); } else { var_dump($c2 = oci_new_connect($user, $password)); } var_dump(oci_close($c1)); var_dump(ocilogoff($c2)); echo "Done\n"; ?> --EXPECTF-- resource(%d) of type (oci8 persistent connection) resource(%d) of type (oci8 connection) bool(true) bool(true) Done http://cvs.php.net/co.php/php-src/ext/oci8/tests/connect_1_old.phpt?r=1.1&p=1 Index: php-src/ext/oci8/tests/connect_1_old.phpt +++ php-src/ext/oci8/tests/connect_1_old.phpt --TEST-- ociplogon() & ocinlogon() --SKIPIF-- <?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> --ENV-- return " ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." "; --FILE-- <?php require dirname(__FILE__)."/connect.inc"; if (!empty($dbase)) { var_dump($c1 = ociplogon($user, $password, $dbase)); } else { var_dump($c1 = ociplogon($user, $password)); } if (!empty($dbase)) { var_dump($c2 = ocinlogon($user, $password, $dbase)); } else { var_dump($c2 = ocinlogon($user, $password)); } var_dump(ocilogoff($c1)); var_dump(ocilogoff($c2)); echo "Done\n"; ?> --EXPECTF-- resource(%d) of type (oci8 persistent connection) resource(%d) of type (oci8 connection) bool(true) bool(true) Done http://cvs.php.net/co.php/php-src/ext/oci8/tests/connect_old.phpt?r=1.1&p=1 Index: php-src/ext/oci8/tests/connect_old.phpt +++ php-src/ext/oci8/tests/connect_old.phpt --TEST-- ocilogon() --SKIPIF-- <?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> --ENV-- return " ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." "; --FILE-- <?php require dirname(__FILE__)."/connect.inc"; if (!empty($dbase)) { var_dump(ocilogon($user, $password, $dbase)); } else { var_dump(ocilogon($user, $password)); } echo "Done\n"; ?> --EXPECTF-- resource(%d) of type (oci8 connection) Done http://cvs.php.net/co.php/php-src/ext/oci8/tests/connect_without_oracle_home.phpt?r=1.1&p=1 Index: php-src/ext/oci8/tests/connect_without_oracle_home.phpt +++ php-src/ext/oci8/tests/connect_without_oracle_home.phpt --TEST-- oci_connect() without ORACLE_HOME set (OCIServerAttach() segfaults) --SKIPIF-- <?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> --FILE-- <?php require dirname(__FILE__)."/connect.inc"; if (!empty($dbase)) { var_dump(oci_connect($user, $password, $dbase)); } else { var_dump(oci_connect($user, $password)); } echo "Done\n"; ?> --EXPECTF-- Warning: ocilogon(): _oci_open_server failed, check ORACLE_HOME and NLS_LANG variables: ORA-12514: TNS:listener does not currently know of service requested in connect descriptor in %sconnect.inc on line %d Warning: oci_connect(): _oci_open_server failed, check ORACLE_HOME and NLS_LANG variables: ORA-12514: TNS:listener does not currently know of service requested in connect descriptor in %sconnect_without_oracle_home.php on line %d bool(false) Done http://cvs.php.net/co.php/php-src/ext/oci8/tests/connect_without_oracle_home_old.phpt?r=1.1&p=1 Index: php-src/ext/oci8/tests/connect_without_oracle_home_old.phpt +++ php-src/ext/oci8/tests/connect_without_oracle_home_old.phpt --TEST-- ocilogon() without ORACLE_HOME set (OCIServerAttach() segfaults) --SKIPIF-- <?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> --FILE-- <?php require dirname(__FILE__)."/connect.inc"; if (!empty($dbase)) { var_dump(ocilogon($user, $password, $dbase)); } else { var_dump(ocilogon($user, $password)); } echo "Done\n"; ?> --EXPECTF-- Warning: ocilogon(): _oci_open_server failed, check ORACLE_HOME and NLS_LANG variables: ORA-12514: TNS:listener does not currently know of service requested in connect descriptor in %sconnect.inc on line %d Warning: oci_connect(): _oci_open_server failed, check ORACLE_HOME and NLS_LANG variables: ORA-12514: TNS:listener does not currently know of service requested in connect descriptor in %sconnect_without_oracle_home.php on line %d bool(false) Done http://cvs.php.net/co.php/php-src/ext/oci8/tests/create_type.inc?r=1.1&p=1 Index: php-src/ext/oci8/tests/create_type.inc +++ php-src/ext/oci8/tests/create_type.inc <?php if ($c) { $ora_sql = "DROP TYPE ".$type_name." "; $statement = OCIParse($c,$ora_sql); @OCIExecute($statement); $ora_sql = "CREATE TYPE ".$type_name." AS TABLE OF NUMBER(11)"; $statement = OCIParse($c,$ora_sql); OCIExecute($statement); } ?> http://cvs.php.net/co.php/php-src/ext/oci8/tests/cursor_bind_err.phpt?r=1.1&p=1 Index: php-src/ext/oci8/tests/cursor_bind_err.phpt +++ php-src/ext/oci8/tests/cursor_bind_err.phpt --TEST-- binding a cursor (with errors) --SKIPIF-- <?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> --ENV-- return " ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." "; --FILE-- <?php require dirname(__FILE__)."/connect.inc"; require dirname(__FILE__)."/create_table.inc"; $insert_sql = "INSERT INTO ".$schema.$table_name." (id, value) VALUES (1,1)"; if (!($s = oci_parse($c, $insert_sql))) { die("oci_parse(insert) failed!\n"); } for ($i = 0; $i<3; $i++) { if (!oci_execute($s)) { die("oci_execute(insert) failed!\n"); } } if (!oci_commit($c)) { die("oci_commit() failed!\n"); } $sql = "select CURSOR(select * from ".$schema.$table_name.") into :cursor from dual"; $stmt = oci_parse($c, $sql); $cursor = oci_new_cursor($c); oci_bind_by_name($stmt, ":cursor", $cursor, -1, OCI_B_CURSOR); oci_execute($stmt); oci_execute($cursor); var_dump(oci_fetch_assoc($cursor)); require dirname(__FILE__)."/drop_table.inc"; echo "Done\n"; ?> --EXPECTF-- Warning: oci_bind_by_name(): ORA-01036: illegal variable name/number in %s on line %d Warning: oci_fetch_assoc(): ORA-24338: statement handle not executed in %s on line %d bool(false) Done http://cvs.php.net/co.php/php-src/ext/oci8/tests/cursors.phpt?r=1.1&p=1 Index: php-src/ext/oci8/tests/cursors.phpt +++ php-src/ext/oci8/tests/cursors.phpt --TEST-- fetching cursor from a statement --SKIPIF-- <?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> --ENV-- return " ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." "; --FILE-- <?php require dirname(__FILE__)."/connect.inc"; require dirname(__FILE__)."/create_table.inc"; $insert_sql = "INSERT INTO ".$schema.$table_name." (id, value) VALUES (1,1)"; if (!($s = oci_parse($c, $insert_sql))) { die("oci_parse(insert) failed!\n"); } for ($i = 0; $i<3; $i++) { if (!oci_execute($s)) { die("oci_execute(insert) failed!\n"); } } if (!oci_commit($c)) { die("oci_commit() failed!\n"); } $sql = "select CURSOR(select * from ".$schema.$table_name.") as curs FROM dual"; $stmt = oci_parse($c, $sql); oci_execute($stmt); while ($data = oci_fetch_assoc($stmt)) { oci_execute($data["CURS"]); $subdata = oci_fetch_assoc($data["CURS"]); var_dump($subdata); var_dump(oci_cancel($data["CURS"])); $subdata = oci_fetch_assoc($data["CURS"]); var_dump($subdata); var_dump(oci_cancel($data["CURS"])); } require dirname(__FILE__)."/drop_table.inc"; echo "Done\n"; ?> --EXPECTF-- array(2) { ["ID"]=> string(1) "1" ["VALUE"]=> string(1) "1" } bool(true) Warning: oci_fetch_assoc()%sORA-01002: fetch out of sequence in %scursors.php on line %d bool(false) bool(true) Done http://cvs.php.net/co.php/php-src/ext/oci8/tests/cursors_old.phpt?r=1.1&p=1 Index: php-src/ext/oci8/tests/cursors_old.phpt +++ php-src/ext/oci8/tests/cursors_old.phpt --TEST-- fetching cursor from a statement --SKIPIF-- <?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> --ENV-- return " ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." "; --FILE-- <?php require dirname(__FILE__)."/connect.inc"; require dirname(__FILE__)."/create_table.inc"; $insert_sql = "INSERT INTO ".$schema.$table_name." (id, value) VALUES (1,1)"; if (!($s = ociparse($c, $insert_sql))) { die("ociparse(insert) failed!\n"); } for ($i = 0; $i<3; $i++) { if (!ociexecute($s)) { die("ociexecute(insert) failed!\n"); } } if (!ocicommit($c)) { die("ocicommit() failed!\n"); } $sql = "select CURSOR(select * from ".$schema.$table_name.") as curs FROM dual"; $stmt = ociparse($c, $sql); ociexecute($stmt); while ($result = ocifetchinto($stmt, $data, OCI_ASSOC)) { ociexecute($data["CURS"]); ocifetchinto($data["CURS"], $subdata, OCI_ASSOC); var_dump($subdata); var_dump(ocicancel($data["CURS"])); ocifetchinto($data["CURS"], $subdata, OCI_ASSOC); var_dump($subdata); var_dump(ocicancel($data["CURS"])); } require dirname(__FILE__)."/drop_table.inc"; echo "Done\n"; ?> --EXPECTF-- array(2) { ["ID"]=> string(1) "1" ["VALUE"]=> string(1) "1" } bool(true) Warning: ocifetchinto():%sORA-01002: fetch out of sequence in %scursors_old.php on line %d array(2) { ["ID"]=> string(1) "1" ["VALUE"]=> string(1) "1" } bool(true) Done http://cvs.php.net/co.php/php-src/ext/oci8/tests/debug.phpt?r=1.1&p=1 Index: php-src/ext/oci8/tests/debug.phpt +++ php-src/ext/oci8/tests/debug.phpt --TEST-- oci_internal_debug() --SKIPIF-- <?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> --ENV-- return " ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." "; --FILE-- <?php require dirname(__FILE__)."/connect.inc"; oci_internal_debug(true); if (!empty($dbase)) { oci_connect($user, $password, $dbase); } else { oci_connect($user, $password); } echo "Done\n"; ?> --EXPECTF-- OCI8 DEBUG: OCINlsEnvironmentVariableGet in php_oci_do_connect_ex() (%s/oci8.c:%d) Done OCI8 DEBUG: OCISessionEnd in php_oci_connection_close() (%s/oci8.c:%d) OCI8 DEBUG: OCIHandleFree in php_oci_connection_close() (%s/oci8.c:%d) OCI8 DEBUG: OCIServerDetach in php_oci_connection_close() (%s/oci8.c:%d) OCI8 DEBUG: OCIHandleFree in php_oci_connection_close() (%s/oci8.c:%d) OCI8 DEBUG: OCIHandleFree in php_oci_connection_close() (%s/oci8.c:%d) OCI8 DEBUG: OCIHandleFree in php_oci_connection_close() (%s/oci8.c:%d) OCI8 DEBUG: OCIHandleFree in php_oci_connection_close() (%s/oci8.c:%d) http://cvs.php.net/co.php/php-src/ext/oci8/tests/default_prefetch.phpt?r=1.1&p=1 Index: php-src/ext/oci8/tests/default_prefetch.phpt +++ php-src/ext/oci8/tests/default_prefetch.phpt --TEST-- oci8.default_prefetch ini option --SKIPIF-- <?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> --ENV-- return " ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." "; --INI-- oci8.default_prefetch=20 --FILE-- <?php require dirname(__FILE__)."/connect.inc"; require dirname(__FILE__).'/create_table.inc'; $insert_sql = "INSERT INTO ".$schema.$table_name." (id, value) VALUES (1,1)"; if (!($s = oci_parse($c, $insert_sql))) { die("oci_parse(insert) failed!\n"); } for ($i = 0; $i<3; $i++) { if (!oci_execute($s)) { die("oci_execute(insert) failed!\n"); } } if (!oci_commit($c)) { die("oci_commit() failed!\n"); } $select_sql = "SELECT * FROM ".$schema.$table_name.""; if (!($s = oci_parse($c, $select_sql))) { die("oci_parse(select) failed!\n"); } if (!oci_execute($s)) { die("oci_execute(select) failed!\n"); } var_dump(oci_fetch($s)); var_dump(oci_num_rows($s)); require dirname(__FILE__).'/drop_table.inc'; echo "Done\n"; ?> --EXPECT-- bool(true) int(1) Done http://cvs.php.net/co.php/php-src/ext/oci8/tests/default_prefetch1.phpt?r=1.1&p=1 Index: php-src/ext/oci8/tests/default_prefetch1.phpt +++ php-src/ext/oci8/tests/default_prefetch1.phpt --TEST-- oci8.default_prefetch ini option --SKIPIF-- <?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> --ENV-- return " ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." "; --INI-- oci8.default_prefetch=100 --FILE-- <?php require dirname(__FILE__)."/connect.inc"; require dirname(__FILE__).'/create_table.inc'; $insert_sql = "INSERT INTO ".$schema.$table_name." (id, value) VALUES (1,1)"; if (!($s = oci_parse($c, $insert_sql))) { die("oci_parse(insert) failed!\n"); } for ($i = 0; $i<3; $i++) { if (!oci_execute($s)) { die("oci_execute(insert) failed!\n"); } } if (!oci_commit($c)) { die("oci_commit() failed!\n"); } $select_sql = "SELECT * FROM ".$schema.$table_name.""; if (!($s = oci_parse($c, $select_sql))) { die("oci_parse(select) failed!\n"); } if (!oci_execute($s)) { die("oci_execute(select) failed!\n"); } var_dump(oci_fetch($s)); var_dump(oci_num_rows($s)); require dirname(__FILE__).'/drop_table.inc'; echo "Done\n"; ?> --EXPECT-- bool(true) int(1) Done http://cvs.php.net/co.php/php-src/ext/oci8/tests/default_prefetch2.phpt?r=1.1&p=1 Index: php-src/ext/oci8/tests/default_prefetch2.phpt +++ php-src/ext/oci8/tests/default_prefetch2.phpt --TEST-- oci8.default_prefetch ini option --SKIPIF-- <?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> --ENV-- return " ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." "; --INI-- oci8.default_prefetch=100 --FILE-- <?php require dirname(__FILE__)."/connect.inc"; require dirname(__FILE__).'/create_table.inc'; $insert_sql = "INSERT INTO ".$schema.$table_name." (id, value) VALUES (1,1)"; if (!($s = oci_parse($c, $insert_sql))) { die("oci_parse(insert) failed!\n"); } for ($i = 0; $i<3; $i++) { if (!oci_execute($s)) { die("oci_execute(insert) failed!\n"); } } if (!oci_commit($c)) { die("oci_commit() failed!\n"); } $select_sql = "SELECT * FROM ".$schema.$table_name.""; if (!($s = oci_parse($c, $select_sql))) { die("oci_parse(select) failed!\n"); } var_dump(oci_set_prefetch($s, 10)); if (!oci_execute($s)) { die("oci_execute(select) failed!\n"); } var_dump(oci_fetch($s)); var_dump(oci_num_rows($s)); require dirname(__FILE__).'/drop_table.inc'; echo "Done\n"; ?> --EXPECT-- bool(true) bool(true) int(1) Done http://cvs.php.net/co.php/php-src/ext/oci8/tests/define.phpt?r=1.1&p=1 Index: php-src/ext/oci8/tests/define.phpt +++ php-src/ext/oci8/tests/define.phpt --TEST-- oci_define_by_name() --SKIPIF-- <?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> --ENV-- return " ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." "; --FILE-- <?php require dirname(__FILE__)."/connect.inc"; require dirname(__FILE__)."/create_table.inc"; $insert_sql = "INSERT INTO ".$schema.$table_name." (string) VALUES ('some')"; if (!($s = oci_parse($c, $insert_sql))) { die("oci_parse(insert) failed!\n"); } if (!oci_execute($s)) { die("oci_execute(insert) failed!\n"); } $stmt = oci_parse($c, "SELECT string FROM ".$table_name.""); /* the define MUST be done BEFORE ociexecute! */ $strong = ''; oci_define_by_name($stmt, "STRING", $string, 20); oci_execute($stmt); while (oci_fetch($stmt)) { var_dump($string); } require dirname(__FILE__)."/drop_table.inc"; echo "Done\n"; ?> --EXPECT-- string(4) "some" Done http://cvs.php.net/co.php/php-src/ext/oci8/tests/define_old.phpt?r=1.1&p=1 Index: php-src/ext/oci8/tests/define_old.phpt +++ php-src/ext/oci8/tests/define_old.phpt --TEST-- ocidefinebyname() --SKIPIF-- <?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> --ENV-- return " ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." "; --FILE-- <?php require dirname(__FILE__)."/connect.inc"; require dirname(__FILE__)."/create_table.inc"; $insert_sql = "INSERT INTO ".$schema.$table_name." (string) VALUES ('some')"; if (!($s = ociparse($c, $insert_sql))) { die("oci_parse(insert) failed!\n"); } if (!ociexecute($s)) { die("oci_execute(insert) failed!\n"); } $stmt = ociparse($c, "SELECT string FROM ".$table_name.""); /* the define MUST be done BEFORE ociexecute! */ $strong = ''; ocidefinebyname($stmt, "STRING", $string, 20); ociexecute($stmt); while (ocifetch($stmt)) { var_dump($string); } require dirname(__FILE__)."/drop_table.inc"; echo "Done\n"; ?> --EXPECT-- string(4) "some" Done http://cvs.php.net/co.php/php-src/ext/oci8/tests/drop_type.inc?r=1.1&p=1 Index: php-src/ext/oci8/tests/drop_type.inc +++ php-src/ext/oci8/tests/drop_type.inc <?php if ($c) { $ora_sql = "DROP TYPE ".$type_name." "; $statement = OCIParse($c,$ora_sql); OCIExecute($statement); } ?> http://cvs.php.net/co.php/php-src/ext/oci8/tests/error.phpt?r=1.1&p=1 Index: php-src/ext/oci8/tests/error.phpt +++ php-src/ext/oci8/tests/error.phpt --TEST-- oci_error() --SKIPIF-- <?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> --ENV-- return " ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." "; --FILE-- <?php require dirname(__FILE__)."/connect.inc"; if (!empty($dbase)) { var_dump(oci_connect($user, $password, $dbase)); } else { var_dump(oci_connect($user, $password)); } var_dump($s = oci_parse($c, "WRONG SYNTAX")); var_dump(oci_execute($s)); var_dump(oci_error($s)); echo "Done\n"; ?> --EXPECTF-- resource(%s) of type (oci8 connection) resource(%s) of type (oci8 statement) Warning: oci_execute(): ORA-00900: invalid SQL statement in %s on line %d bool(false) array(4) { ["code"]=> int(900) ["message"]=> string(32) "ORA-00900: invalid SQL statement" ["offset"]=> int(0) ["sqltext"]=> string(12) "WRONG SYNTAX" } Done http://cvs.php.net/co.php/php-src/ext/oci8/tests/error_old.phpt?r=1.1&p=1 Index: php-src/ext/oci8/tests/error_old.phpt +++ php-src/ext/oci8/tests/error_old.phpt --TEST-- ocierror() --SKIPIF-- <?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> --ENV-- return " ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." "; --FILE-- <?php require dirname(__FILE__)."/connect.inc"; if (!empty($dbase)) { var_dump(ocilogon($user, $password, $dbase)); } else { var_dump(ocilogon($user, $password)); } var_dump($s = ociparse($c, "WRONG SYNTAX")); var_dump(ociexecute($s)); var_dump(ocierror($s)); echo "Done\n"; ?> --EXPECTF-- resource(%s) of type (oci8 connection) resource(%s) of type (oci8 statement) Warning: ociexecute(): ORA-00900: invalid SQL statement in %s on line %d bool(false) array(4) { ["code"]=> int(900) ["message"]=> string(32) "ORA-00900: invalid SQL statement" ["offset"]=> int(0) ["sqltext"]=> string(12) "WRONG SYNTAX" } Done http://cvs.php.net/co.php/php-src/ext/oci8/tests/exec_fetch.phpt?r=1.1&p=1 Index: php-src/ext/oci8/tests/exec_fetch.phpt +++ php-src/ext/oci8/tests/exec_fetch.phpt --TEST-- fetch after failed oci_execute() --SKIPIF-- <?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> --ENV-- return " ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." "; --FILE-- <?php require dirname(__FILE__).'/connect.inc'; $sql = "select 2 from nonex_dual"; $stmt = oci_parse($c, $sql); var_dump(oci_execute($stmt)); var_dump(oci_fetch_array($stmt)); echo "Done\n"; ?> --EXPECTF-- Done http://cvs.php.net/co.php/php-src/ext/oci8/tests/fetch.phpt?r=1.1&p=1 Index: php-src/ext/oci8/tests/fetch.phpt +++ php-src/ext/oci8/tests/fetch.phpt --TEST-- ocifetch() & ociresult() --SKIPIF-- <?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> --ENV-- return " ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." "; --FILE-- <?php require dirname(__FILE__)."/connect.inc"; require dirname(__FILE__).'/create_table.inc'; $insert_sql = "INSERT INTO ".$schema.$table_name." (id, value) VALUES (1,1)"; if (!($s = oci_parse($c, $insert_sql))) { die("oci_parse(insert) failed!\n"); } for ($i = 0; $i<3; $i++) { if (!oci_execute($s)) { die("oci_execute(insert) failed!\n"); } } if (!oci_commit($c)) { die("oci_commit() failed!\n"); } $select_sql = "SELECT * FROM ".$schema.$table_name.""; if (!($s = oci_parse($c, $select_sql))) { die("oci_parse(select) failed!\n"); } if (!oci_execute($s)) { die("oci_execute(select) failed!\n"); } while(ocifetch($s)) { $i = 1; while ($row = ociresult($s, $i)) { $i++; var_dump($row); } } require dirname(__FILE__).'/drop_table.inc'; echo "Done\n"; ?> --EXPECT-- string(1) "1" string(1) "1" string(1) "1" string(1) "1" string(1) "1" string(1) "1" Done http://cvs.php.net/co.php/php-src/ext/oci8/tests/fetch_all.phpt?r=1.1&p=1 Index: php-src/ext/oci8/tests/fetch_all.phpt +++ php-src/ext/oci8/tests/fetch_all.phpt --TEST-- oci_fetch_all() --SKIPIF-- <?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> --ENV-- return " ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." "; --FILE-- <?php require dirname(__FILE__)."/connect.inc"; require dirname(__FILE__).'/create_table.inc'; $insert_sql = "INSERT INTO ".$schema."".$table_name." (id, value) VALUES (1,1)"; if (!($s = oci_parse($c, $insert_sql))) { die("oci_parse(insert) failed!\n"); } for ($i = 0; $i<3; $i++) { if (!oci_execute($s)) { die("oci_execute(insert) failed!\n"); } } if (!oci_commit($c)) { die("oci_commit() failed!\n"); } $select_sql = "SELECT * FROM ".$schema."".$table_name.""; if (!($s = oci_parse($c, $select_sql))) { die("oci_parse(select) failed!\n"); } /* oci_fetch_all */ if (!oci_execute($s)) { die("oci_execute(select) failed!\n"); } var_dump(oci_fetch_all($s, $all)); var_dump($all); /* ocifetchstatement */ if (!oci_execute($s)) { die("oci_execute(select) failed!\n"); } var_dump(ocifetchstatement($s, $all)); var_dump($all); require dirname(__FILE__).'/drop_table.inc'; echo "Done\n"; ?> --EXPECT-- int(3) array(5) { ["ID"]=> array(3) { [0]=> string(1) "1" [1]=> string(1) "1" [2]=> string(1) "1" } ["VALUE"]=> array(3) { [0]=> string(1) "1" [1]=> string(1) "1" [2]=> string(1) "1" } ["BLOB"]=> array(3) { [0]=> NULL [1]=> NULL [2]=> NULL } ["CLOB"]=> array(3) { [0]=> NULL [1]=> NULL [2]=> NULL } ["STRING"]=> array(3) { [0]=> NULL [1]=> NULL [2]=> NULL } } int(3) array(5) { ["ID"]=> array(3) { [0]=> string(1) "1" [1]=> string(1) "1" [2]=> string(1) "1" } ["VALUE"]=> array(3) { [0]=> string(1) "1" [1]=> string(1) "1" [2]=> string(1) "1" } ["BLOB"]=> array(3) { [0]=> NULL [1]=> NULL [2]=> NULL } ["CLOB"]=> array(3) { [0]=> NULL [1]=> NULL [2]=> NULL } ["STRING"]=> array(3) { [0]=> NULL [1]=> NULL [2]=> NULL } } Done http://cvs.php.net/co.php/php-src/ext/oci8/tests/fetch_array.phpt?r=1.1&p=1 Index: php-src/ext/oci8/tests/fetch_array.phpt +++ php-src/ext/oci8/tests/fetch_array.phpt --TEST-- oci_fetch_array() --SKIPIF-- <?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> --ENV-- return " ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." "; --FILE-- <?php require dirname(__FILE__)."/connect.inc"; require dirname(__FILE__).'/create_table.inc'; $insert_sql = "INSERT INTO ".$schema."".$table_name." (id, value) VALUES (1,1)"; if (!($s = oci_parse($c, $insert_sql))) { die("oci_parse(insert) failed!\n"); } for ($i = 0; $i<3; $i++) { if (!oci_execute($s)) { die("oci_execute(insert) failed!\n"); } } if (!oci_commit($c)) { die("oci_commit() failed!\n"); } $select_sql = "SELECT * FROM ".$schema."".$table_name.""; if (!($s = oci_parse($c, $select_sql))) { die("oci_parse(select) failed!\n"); } if (!oci_execute($s)) { die("oci_execute(select) failed!\n"); } while ($row = oci_fetch_array($s)) { var_dump($row); } if (!oci_execute($s)) { die("oci_execute(select) failed!\n"); } while ($row = oci_fetch_array($s, OCI_NUM)) { var_dump($row); } if (!oci_execute($s)) { die("oci_execute(select) failed!\n"); } while ($row = oci_fetch_array($s, OCI_ASSOC)) { var_dump($row); } if (!oci_execute($s)) { die("oci_execute(select) failed!\n"); } while ($row = oci_fetch_array($s, OCI_BOTH)) { var_dump($row); } if (!oci_execute($s)) { die("oci_execute(select) failed!\n"); } while ($row = oci_fetch_array($s, OCI_RETURN_LOBS)) { var_dump($row); } if (!oci_execute($s)) { die("oci_execute(select) failed!\n"); } while ($row = oci_fetch_array($s, OCI_RETURN_NULLS)) { var_dump($row); } require dirname(__FILE__).'/drop_table.inc'; echo "Done\n"; ?> --EXPECT-- array(4) { [0]=> string(1) "1" ["ID"]=> string(1) "1" [1]=> string(1) "1" ["VALUE"]=> string(1) "1" } array(4) { [0]=> string(1) "1" ["ID"]=> string(1) "1" [1]=> string(1) "1" ["VALUE"]=> string(1) "1" } array(4) { [0]=> string(1) "1" ["ID"]=> string(1) "1" [1]=> string(1) "1" ["VALUE"]=> string(1) "1" } array(2) { [0]=> string(1) "1" [1]=> string(1) "1" } array(2) { [0]=> string(1) "1" [1]=> string(1) "1" } array(2) { [0]=> string(1) "1" [1]=> string(1) "1" } array(2) { ["ID"]=> string(1) "1" ["VALUE"]=> string(1) "1" } array(2) { ["ID"]=> string(1) "1" ["VALUE"]=> string(1) "1" } array(2) { ["ID"]=> string(1) "1" ["VALUE"]=> string(1) "1" } array(4) { [0]=> string(1) "1" ["ID"]=> string(1) "1" [1]=> string(1) "1" ["VALUE"]=> string(1) "1" } array(4) { [0]=> string(1) "1" ["ID"]=> string(1) "1" [1]=> string(1) "1" ["VALUE"]=> string(1) "1" } array(4) { [0]=> string(1) "1" ["ID"]=> string(1) "1" [1]=> string(1) "1" ["VALUE"]=> string(1) "1" } array(2) { [0]=> string(1) "1" [1]=> string(1) "1" } array(2) { [0]=> string(1) "1" [1]=> string(1) "1" } array(2) { [0]=> string(1) "1" [1]=> string(1) "1" } array(5) { [0]=> string(1) "1" [1]=> string(1) "1" [2]=> NULL [3]=> NULL [4]=> NULL } array(5) { [0]=> string(1) "1" [1]=> string(1) "1" [2]=> NULL [3]=> NULL [4]=> NULL } array(5) { [0]=> string(1) "1" [1]=> string(1) "1" [2]=> NULL [3]=> NULL [4]=> NULL } Done http://cvs.php.net/co.php/php-src/ext/oci8/tests/fetch_assoc.phpt?r=1.1&p=1 Index: php-src/ext/oci8/tests/fetch_assoc.phpt +++ php-src/ext/oci8/tests/fetch_assoc.phpt --TEST-- oci_fetch_assoc() --SKIPIF-- <?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> --ENV-- return " ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." "; --FILE-- <?php require dirname(__FILE__)."/connect.inc"; require dirname(__FILE__).'/create_table.inc'; $insert_sql = "INSERT INTO ".$schema."".$table_name." (id, value) VALUES (1,1)"; if (!($s = oci_parse($c, $insert_sql))) { die("oci_parse(insert) failed!\n"); } for ($i = 0; $i<3; $i++) { if (!oci_execute($s)) { die("oci_execute(insert) failed!\n"); } } if (!oci_commit($c)) { die("oci_commit() failed!\n"); } $select_sql = "SELECT * FROM ".$schema."".$table_name.""; if (!($s = oci_parse($c, $select_sql))) { die("oci_parse(select) failed!\n"); } if (!oci_execute($s)) { die("oci_execute(select) failed!\n"); } while ($row = oci_fetch_assoc($s)) { var_dump($row); } require dirname(__FILE__).'/drop_table.inc'; echo "Done\n"; ?> --EXPECT-- array(2) { ["ID"]=> string(1) "1" ["VALUE"]=> string(1) "1" } array(2) { ["ID"]=> string(1) "1" ["VALUE"]=> string(1) "1" } array(2) { ["ID"]=> string(1) "1" ["VALUE"]=> string(1) "1" } Done http://cvs.php.net/co.php/php-src/ext/oci8/tests/fetch_into.phpt?r=1.1&p=1 Index: php-src/ext/oci8/tests/fetch_into.phpt +++ php-src/ext/oci8/tests/fetch_into.phpt --TEST-- ocifetchinto() --SKIPIF-- <?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> --ENV-- return " ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." "; --FILE-- <?php require dirname(__FILE__)."/connect.inc"; require dirname(__FILE__).'/create_table.inc'; $insert_sql = "INSERT INTO ".$schema."".$table_name." (id, value) VALUES (1,1)"; if (!($s = oci_parse($c, $insert_sql))) { die("oci_parse(insert) failed!\n"); } for ($i = 0; $i<3; $i++) { if (!oci_execute($s)) { die("oci_execute(insert) failed!\n"); } } if (!oci_commit($c)) { die("oci_commit() failed!\n"); } $select_sql = "SELECT * FROM ".$schema."".$table_name.""; if (!($s = oci_parse($c, $select_sql))) { die("oci_parse(select) failed!\n"); } /* oci_fetch_all */ if (!oci_execute($s)) { die("oci_execute(select) failed!\n"); } var_dump(ocifetchinto($s, $all)); var_dump($all); /* oci_fetch_all */ if (!oci_execute($s)) { die("oci_execute(select) failed!\n"); } var_dump(ocifetchinto($s, $all, OCI_NUM+OCI_ASSOC+OCI_RETURN_NULLS+OCI_RETURN_LOBS)); var_dump($all); require dirname(__FILE__).'/drop_table.inc'; echo "Done\n"; ?> --EXPECT-- int(5) array(2) { [0]=> string(1) "1" [1]=> string(1) "1" } int(5) array(10) { [0]=> string(1) "1" ["ID"]=> string(1) "1" [1]=> string(1) "1" ["VALUE"]=> string(1) "1" [2]=> NULL ["BLOB"]=> NULL [3]=> NULL ["CLOB"]=> NULL [4]=> NULL ["STRING"]=> NULL } Done http://cvs.php.net/co.php/php-src/ext/oci8/tests/fetch_into1.phpt?r=1.1&p=1 Index: php-src/ext/oci8/tests/fetch_into1.phpt +++ php-src/ext/oci8/tests/fetch_into1.phpt --TEST-- various ocifetchinto() tests --SKIPIF-- <?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> --ENV-- return " ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." "; --FILE-- <?php require dirname(__FILE__)."/connect.inc"; require dirname(__FILE__).'/create_table.inc'; $insert_sql = "INSERT INTO ".$schema."".$table_name." (id, value, string) VALUES (1, 1, NULL)"; if (!($s = oci_parse($c, $insert_sql))) { die("oci_parse(insert) failed!\n"); } for ($i = 0; $i<20; $i++) { if (!oci_execute($s)) { die("oci_execute(insert) failed!\n"); } } if (!oci_commit($c)) { die("oci_commit() failed!\n"); } $select_sql = "SELECT * FROM ".$schema."".$table_name.""; if (!($s = oci_parse($c, $select_sql))) { die("oci_parse(select) failed!\n"); } if (!oci_execute($s)) { die("oci_execute(select) failed!\n"); } var_dump(ocifetchinto($s, $all, OCI_NUM)); var_dump($all); var_dump(ocifetchinto($s, $all, OCI_ASSOC)); var_dump($all); var_dump(ocifetchinto($s, $all, OCI_RETURN_NULLS)); var_dump($all); var_dump(ocifetchinto($s, $all, OCI_RETURN_LOBS)); var_dump($all); var_dump(ocifetchinto($s, $all, OCI_NUM+OCI_ASSOC)); var_dump($all); var_dump(ocifetchinto($s, $all, OCI_NUM+OCI_ASSOC+OCI_RETURN_NULLS)); var_dump($all); var_dump(ocifetchinto($s, $all, OCI_NUM+OCI_ASSOC+OCI_RETURN_NULLS+OCI_RETURN_LOBS)); var_dump($all); var_dump(ocifetchinto($s, $all, OCI_RETURN_NULLS+OCI_RETURN_LOBS)); var_dump($all); var_dump(ocifetchinto($s, $all, OCI_ASSOC+OCI_RETURN_NULLS+OCI_RETURN_LOBS)); var_dump($all); var_dump(ocifetchinto($s, $all, OCI_NUM+OCI_RETURN_NULLS+OCI_RETURN_LOBS)); var_dump($all); require dirname(__FILE__).'/drop_table.inc'; echo "Done\n"; ?> --EXPECT-- int(5) array(2) { [0]=> string(1) "1" [1]=> string(1) "1" } int(5) array(2) { ["ID"]=> string(1) "1" ["VALUE"]=> string(1) "1" } int(5) array(5) { [0]=> string(1) "1" [1]=> string(1) "1" [2]=> NULL [3]=> NULL [4]=> NULL } int(5) array(2) { [0]=> string(1) "1" [1]=> string(1) "1" } int(5) array(4) { [0]=> string(1) "1" ["ID"]=> string(1) "1" [1]=> string(1) "1" ["VALUE"]=> string(1) "1" } int(5) array(10) { [0]=> string(1) "1" ["ID"]=> string(1) "1" [1]=> string(1) "1" ["VALUE"]=> string(1) "1" [2]=> NULL ["BLOB"]=> NULL [3]=> NULL ["CLOB"]=> NULL [4]=> NULL ["STRING"]=> NULL } int(5) array(10) { [0]=> string(1) "1" ["ID"]=> string(1) "1" [1]=> string(1) "1" ["VALUE"]=> string(1) "1" [2]=> NULL ["BLOB"]=> NULL [3]=> NULL ["CLOB"]=> NULL [4]=> NULL ["STRING"]=> NULL } int(5) array(5) { [0]=> string(1) "1" [1]=> string(1) "1" [2]=> NULL [3]=> NULL [4]=> NULL } int(5) array(5) { ["ID"]=> string(1) "1" ["VALUE"]=> string(1) "1" ["BLOB"]=> NULL ["CLOB"]=> NULL ["STRING"]=> NULL } int(5) array(5) { [0]=> string(1) "1" [1]=> string(1) "1" [2]=> NULL [3]=> NULL [4]=> NULL } Done http://cvs.php.net/co.php/php-src/ext/oci8/tests/fetch_into2.phpt?r=1.1&p=1 Index: php-src/ext/oci8/tests/fetch_into2.phpt +++ php-src/ext/oci8/tests/fetch_into2.phpt --TEST-- ocifetchinto() & wrong number of params --SKIPIF-- <?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> --ENV-- return " ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." "; --FILE-- <?php require dirname(__FILE__)."/connect.inc"; require dirname(__FILE__).'/create_table.inc'; $insert_sql = "INSERT INTO ".$schema."".$table_name." (id, value, string) VALUES (1, 1, NULL)"; if (!($s = oci_parse($c, $insert_sql))) { die("oci_parse(insert) failed!\n"); } for ($i = 0; $i<20; $i++) { if (!oci_execute($s)) { die("oci_execute(insert) failed!\n"); } } if (!oci_commit($c)) { die("oci_commit() failed!\n"); } $select_sql = "SELECT * FROM ".$schema."".$table_name.""; if (!($s = oci_parse($c, $select_sql))) { die("oci_parse(select) failed!\n"); } if (!oci_execute($s)) { die("oci_execute(select) failed!\n"); } var_dump(ocifetchinto($s)); var_dump($all); var_dump(ocifetchinto($s, $all, OCI_ASSOC, 5)); var_dump($all); var_dump(ocifetchinto($c, $all, OCI_RETURN_LOBS)); var_dump($all); var_dump(ocifetchinto($s, $all, 1000000)); var_dump($all); require dirname(__FILE__).'/drop_table.inc'; echo "Done\n"; ?> --EXPECTF-- Warning: ocifetchinto() expects at least 2 parameters, 1 given in %s on line %d NULL Notice: Undefined variable: all in %s on line %d NULL Warning: ocifetchinto() expects at most 3 parameters, 4 given in %s on line %d NULL NULL Warning: ocifetchinto(): supplied resource is not a valid oci8 statement resource in %s on line %d bool(false) NULL int(5) array(2) { [0]=> string(1) "1" [1]=> string(1) "1" } Done http://cvs.php.net/co.php/php-src/ext/oci8/tests/fetch_object.phpt?r=1.1&p=1 Index: php-src/ext/oci8/tests/fetch_object.phpt +++ php-src/ext/oci8/tests/fetch_object.phpt --TEST-- oci_fetch_object() --SKIPIF-- <?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> --ENV-- return " ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." "; --FILE-- <?php require dirname(__FILE__)."/connect.inc"; require dirname(__FILE__).'/create_table.inc'; $insert_sql = "INSERT INTO ".$schema."".$table_name." (id, value) VALUES (1,1)"; if (!($s = oci_parse($c, $insert_sql))) { die("oci_parse(insert) failed!\n"); } for ($i = 0; $i<3; $i++) { if (!oci_execute($s)) { die("oci_execute(insert) failed!\n"); } } if (!oci_commit($c)) { die("oci_commit() failed!\n"); } $select_sql = "SELECT * FROM ".$schema."".$table_name.""; if (!($s = oci_parse($c, $select_sql))) { die("oci_parse(select) failed!\n"); } if (!oci_execute($s)) { die("oci_execute(select) failed!\n"); } while ($row = oci_fetch_object($s)) { var_dump($row); } require dirname(__FILE__).'/drop_table.inc'; echo "Done\n"; ?> --EXPECT-- object(stdClass)#1 (2) { ["ID"]=> string(1) "1" ["VALUE"]=> string(1) "1" } object(stdClass)#2 (2) { ["ID"]=> string(1) "1" ["VALUE"]=> string(1) "1" } object(stdClass)#1 (2) { ["ID"]=> string(1) "1" ["VALUE"]=> string(1) "1" } Done http://cvs.php.net/co.php/php-src/ext/oci8/tests/fetch_row.phpt?r=1.1&p=1 Index: php-src/ext/oci8/tests/fetch_row.phpt +++ php-src/ext/oci8/tests/fetch_row.phpt --TEST-- oci_fetch_row() --SKIPIF-- <?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> --ENV-- return " ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." "; --FILE-- <?php require dirname(__FILE__)."/connect.inc"; require dirname(__FILE__).'/create_table.inc'; $insert_sql = "INSERT INTO ".$schema."".$table_name." (id, value) VALUES (1,1)"; if (!($s = oci_parse($c, $insert_sql))) { die("oci_parse(insert) failed!\n"); } for ($i = 0; $i<3; $i++) { if (!oci_execute($s)) { die("oci_execute(insert) failed!\n"); } } if (!oci_commit($c)) { die("oci_commit() failed!\n"); } $select_sql = "SELECT * FROM ".$schema."".$table_name.""; if (!($s = oci_parse($c, $select_sql))) { die("oci_parse(select) failed!\n"); } if (!oci_execute($s)) { die("oci_execute(select) failed!\n"); } while ($row = oci_fetch_row($s)) { var_dump($row); } require dirname(__FILE__).'/drop_table.inc'; echo "Done\n"; ?> --EXPECT-- array(2) { [0]=> string(1) "1" [1]=> string(1) "1" } array(2) { [0]=> string(1) "1" [1]=> string(1) "1" } array(2) { [0]=> string(1) "1" [1]=> string(1) "1" } Done http://cvs.php.net/co.php/php-src/ext/oci8/tests/field_funcs.phpt?r=1.1&p=1 Index: php-src/ext/oci8/tests/field_funcs.phpt +++ php-src/ext/oci8/tests/field_funcs.phpt --TEST-- oci_field_*() family --SKIPIF-- <?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> --ENV-- return " ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." "; --FILE-- <?php require dirname(__FILE__)."/connect.inc"; require dirname(__FILE__).'/create_table.inc'; $insert_sql = "INSERT INTO ".$schema."".$table_name." (id, value) VALUES (1,1)"; if (!($s = oci_parse($c, $insert_sql))) { die("oci_parse(insert) failed!\n"); } for ($i = 0; $i<3; $i++) { if (!oci_execute($s)) { die("oci_execute(insert) failed!\n"); } } if (!oci_commit($c)) { die("oci_commit() failed!\n"); } $select_sql = "SELECT * FROM ".$schema."".$table_name.""; if (!($s = oci_parse($c, $select_sql))) { die("oci_parse(select) failed!\n"); } if (!oci_execute($s)) { die("oci_execute(select) failed!\n"); } $row = oci_fetch_array($s, OCI_RETURN_NULLS + OCI_RETURN_LOBS); var_dump($row); foreach ($row as $num => $field) { $num++; var_dump(oci_field_is_null($s, $num)); var_dump(oci_field_name($s, $num)); var_dump(oci_field_type($s, $num)); var_dump(oci_field_type_raw($s, $num)); var_dump(oci_field_scale($s, $num)); var_dump(oci_field_precision($s, $num)); var_dump(oci_field_size($s, $num)); } require dirname(__FILE__).'/drop_table.inc'; echo "Done\n"; ?> --EXPECT-- array(5) { [0]=> string(1) "1" [1]=> string(1) "1" [2]=> NULL [3]=> NULL [4]=> NULL } bool(false) string(2) "ID" string(6) "NUMBER" int(2) int(0) int(0) int(22) bool(false) string(5) "VALUE" string(6) "NUMBER" int(2) int(0) int(0) int(22) bool(true) string(4) "BLOB" string(4) "BLOB" int(113) int(0) int(0) int(4000) bool(true) string(4) "CLOB" string(4) "CLOB" int(112) int(0) int(0) int(4000) bool(true) string(6) "STRING" string(7) "VARCHAR" int(1) int(0) int(0) int(10) Done http://cvs.php.net/co.php/php-src/ext/oci8/tests/field_funcs_old.phpt?r=1.1&p=1 Index: php-src/ext/oci8/tests/field_funcs_old.phpt +++ php-src/ext/oci8/tests/field_funcs_old.phpt --TEST-- ocicolumn*() family --SKIPIF-- <?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> --ENV-- return " ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." "; --FILE-- <?php require dirname(__FILE__)."/connect.inc"; require dirname(__FILE__).'/create_table.inc'; $insert_sql = "INSERT INTO ".$schema."".$table_name." (id, value) VALUES (1,1)"; if (!($s = ociparse($c, $insert_sql))) { die("ociparse(insert) failed!\n"); } for ($i = 0; $i<3; $i++) { if (!ociexecute($s)) { die("ociexecute(insert) failed!\n"); } } if (!ocicommit($c)) { die("ocicommit() failed!\n"); } $select_sql = "SELECT * FROM ".$schema."".$table_name.""; if (!($s = ociparse($c, $select_sql))) { die("ociparse(select) failed!\n"); } if (!ociexecute($s)) { die("ociexecute(select) failed!\n"); } ocifetchinto($s, $row, OCI_NUM + OCI_RETURN_NULLS + OCI_RETURN_LOBS); var_dump($row); foreach ($row as $num => $field) { $num++; var_dump(ocicolumnisnull($s, $num)); var_dump(ocicolumnname($s, $num)); var_dump(ocicolumntype($s, $num)); var_dump(ocicolumntyperaw($s, $num)); var_dump(ocicolumnscale($s, $num)); var_dump(ocicolumnprecision($s, $num)); var_dump(ocicolumnsize($s, $num)); } require dirname(__FILE__).'/drop_table.inc'; echo "Done\n"; ?> --EXPECT-- array(5) { [0]=> string(1) "1" [1]=> string(1) "1" [2]=> NULL [3]=> NULL [4]=> NULL } bool(false) string(2) "ID" string(6) "NUMBER" int(2) int(0) int(0) int(22) bool(false) string(5) "VALUE" string(6) "NUMBER" int(2) int(0) int(0) int(22) bool(true) string(4) "BLOB" string(4) "BLOB" int(113) int(0) int(0) int(4000) bool(true) string(4) "CLOB" string(4) "CLOB" int(112) int(0) int(0) int(4000) bool(true) string(6) "STRING" string(7) "VARCHAR" int(1) int(0) int(0) int(10) Done http://cvs.php.net/co.php/php-src/ext/oci8/tests/lob_001.phpt?r=1.1&p=1 Index: php-src/ext/oci8/tests/lob_001.phpt +++ php-src/ext/oci8/tests/lob_001.phpt --TEST-- oci_lob_write() and friends --SKIPIF-- <?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> --ENV-- return " ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." "; --FILE-- <?php require dirname(__FILE__).'/connect.inc'; require dirname(__FILE__).'/create_table.inc'; $ora_sql = "INSERT INTO ".$schema.$table_name." (blob) VALUES (empty_blob()) RETURNING blob INTO :v_blob "; $statement = oci_parse($c,$ora_sql); $blob = oci_new_descriptor($c,OCI_D_LOB); oci_bind_by_name($statement,":v_blob", $blob,-1,OCI_B_BLOB); oci_execute($statement, OCI_DEFAULT); var_dump($blob); var_dump($blob->write("test")); var_dump($blob->tell()); var_dump($blob->seek(10, OCI_SEEK_CUR)); var_dump($blob->write("string")); var_dump($blob->flush()); oci_commit($c); $select_sql = "SELECT blob FROM ".$schema.$table_name.""; $s = oci_parse($c, $select_sql); oci_execute($s); var_dump(oci_fetch_array($s, OCI_RETURN_LOBS)); require dirname(__FILE__).'/drop_table.inc'; echo "Done\n"; ?> --EXPECTF-- object(OCI-Lob)#%d (1) { ["descriptor"]=> resource(%d) of type (oci8 descriptor) } int(4) int(4) bool(true) int(6) bool(false) array(1) { [0]=> string(20) "teststring" } Done http://cvs.php.net/co.php/php-src/ext/oci8/tests/lob_002.phpt?r=1.1&p=1 Index: php-src/ext/oci8/tests/lob_002.phpt +++ php-src/ext/oci8/tests/lob_002.phpt --TEST-- oci_lob_write() and friends (with errors) --SKIPIF-- <?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> --ENV-- return " ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." "; --FILE-- <?php require dirname(__FILE__).'/connect.inc'; require dirname(__FILE__).'/create_table.inc'; $ora_sql = "INSERT INTO ".$schema.$table_name." (blob) VALUES (empty_blob()) RETURNING blob INTO :v_blob "; $statement = oci_parse($c,$ora_sql); $blob = oci_new_descriptor($c,OCI_D_LOB); oci_bind_by_name($statement,":v_blob", $blob,-1,OCI_B_BLOB); oci_execute($statement, OCI_DEFAULT); var_dump($blob); var_dump($blob->write("test", -1)); var_dump($blob->write("test", "str")); var_dump($blob->write("test", 1000000)); var_dump($blob->write(str_repeat("test", 10000), 1000000)); var_dump($blob->tell()); var_dump($blob->seek("str", -5)); var_dump($blob->flush()); oci_commit($c); $select_sql = "SELECT blob FROM ".$schema.$table_name.""; $s = oci_parse($c, $select_sql); oci_execute($s); $row = oci_fetch_array($s, OCI_RETURN_LOBS); var_dump(strlen($row[0])); require dirname(__FILE__).'/drop_table.inc'; echo "Done\n"; ?> --EXPECTF-- object(OCI-Lob)#%d (1) { ["descriptor"]=> resource(%d) of type (oci8 descriptor) } int(0) Warning: OCI-Lob::write() expects parameter 2 to be long, string given in %slob_002.php on line %d NULL int(4) int(40000) int(40004) Warning: OCI-Lob::seek() expects parameter 1 to be long, string given in %slob_002.php on line %d NULL bool(false) int(40004) Done http://cvs.php.net/co.php/php-src/ext/oci8/tests/lob_003.phpt?r=1.1&p=1 Index: php-src/ext/oci8/tests/lob_003.phpt +++ php-src/ext/oci8/tests/lob_003.phpt --TEST-- oci_lob_read() and friends --SKIPIF-- <?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> --ENV-- return " ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." "; --FILE-- <?php require dirname(__FILE__).'/connect.inc'; require dirname(__FILE__).'/create_table.inc'; $ora_sql = "INSERT INTO ".$schema.$table_name." (blob) VALUES (empty_blob()) RETURNING blob INTO :v_blob "; $statement = oci_parse($c,$ora_sql); $blob = oci_new_descriptor($c,OCI_D_LOB); oci_bind_by_name($statement,":v_blob", $blob,-1,OCI_B_BLOB); oci_execute($statement, OCI_DEFAULT); var_dump($blob); var_dump($blob->write("test")); var_dump($blob->tell()); var_dump($blob->seek(10, OCI_SEEK_CUR)); var_dump($blob->write("string")); var_dump($blob->flush()); oci_commit($c); $select_sql = "SELECT blob FROM ".$schema.$table_name." FOR UPDATE"; $s = oci_parse($c, $select_sql); oci_execute($s, OCI_DEFAULT); var_dump($row = oci_fetch_array($s)); var_dump($row[0]->read(-1)); var_dump($row[0]->read(10000)); require dirname(__FILE__).'/drop_table.inc'; echo "Done\n"; ?> --EXPECTF-- object(OCI-Lob)#%d (1) { ["descriptor"]=> resource(%d) of type (oci8 descriptor) } int(4) int(4) bool(true) int(6) bool(false) array(2) { [0]=> object(OCI-Lob)#%d (1) { ["descriptor"]=> resource(%d) of type (oci8 descriptor) } ["BLOB"]=> object(OCI-Lob)#%d (1) { ["descriptor"]=> resource(%d) of type (oci8 descriptor) } } Warning: OCI-Lob::read(): Length parameter must be greater than 0 in %s on line %d bool(false) string(20) "teststring" Done http://cvs.php.net/co.php/php-src/ext/oci8/tests/lob_004.phpt?r=1.1&p=1 Index: php-src/ext/oci8/tests/lob_004.phpt +++ php-src/ext/oci8/tests/lob_004.phpt --TEST-- oci_lob_seek()/rewind()/append() --SKIPIF-- <?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> --ENV-- return " ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." "; --FILE-- <?php require dirname(__FILE__).'/connect.inc'; require dirname(__FILE__).'/create_table.inc'; $ora_sql = "INSERT INTO ".$schema.$table_name." (blob) VALUES (empty_blob()) RETURNING blob INTO :v_blob "; $statement = oci_parse($c,$ora_sql); $blob = oci_new_descriptor($c,OCI_D_LOB); oci_bind_by_name($statement,":v_blob", $blob,-1,OCI_B_BLOB); oci_execute($statement, OCI_DEFAULT); var_dump($blob); var_dump($blob->write("test")); var_dump($blob->rewind()); var_dump($blob->write("str")); var_dump($blob->seek(10, OCI_SEEK_SET)); oci_commit($c); $select_sql = "SELECT blob FROM ".$schema.$table_name." FOR UPDATE"; $s = oci_parse($c, $select_sql); oci_execute($s, OCI_DEFAULT); var_dump($row = oci_fetch_array($s)); var_dump($row[0]->append($blob)); var_dump($row[0]->read(10000)); oci_commit($c); $select_sql = "SELECT blob FROM ".$schema.$table_name." FOR UPDATE"; $s = oci_parse($c, $select_sql); oci_execute($s, OCI_DEFAULT); $row = oci_fetch_array($s); var_dump($row[0]->read(10000)); require dirname(__FILE__).'/drop_table.inc'; echo "Done\n"; ?> --EXPECTF-- object(OCI-Lob)#%d (1) { ["descriptor"]=> resource(%d) of type (oci8 descriptor) } int(4) bool(true) int(3) bool(true) array(2) { [0]=> object(OCI-Lob)#%d (1) { ["descriptor"]=> resource(%d) of type (oci8 descriptor) } ["BLOB"]=> object(OCI-Lob)#%d (1) { ["descriptor"]=> resource(%d) of type (oci8 descriptor) } } bool(true) string(4) "strt" string(8) "strtstrt" Done http://cvs.php.net/co.php/php-src/ext/oci8/tests/lob_005.phpt?r=1.1&p=1 Index: php-src/ext/oci8/tests/lob_005.phpt +++ php-src/ext/oci8/tests/lob_005.phpt --TEST-- oci_lob_is_equal() --SKIPIF-- <?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> --ENV-- return " ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." "; --FILE-- <?php require dirname(__FILE__).'/connect.inc'; require dirname(__FILE__).'/create_table.inc'; $ora_sql = "INSERT INTO ".$schema.$table_name." (blob) VALUES (empty_blob()) RETURNING blob INTO :v_blob "; $statement = oci_parse($c,$ora_sql); $blob = oci_new_descriptor($c,OCI_D_LOB); oci_bind_by_name($statement,":v_blob", $blob,-1,OCI_B_BLOB); oci_execute($statement, OCI_DEFAULT); oci_commit($c); $select_sql = "SELECT blob FROM ".$schema.$table_name." FOR UPDATE"; $s = oci_parse($c, $select_sql); oci_execute($s, OCI_DEFAULT); var_dump($row = oci_fetch_array($s)); var_dump(oci_lob_is_equal($row[0], $row['BLOB'])); require dirname(__FILE__).'/drop_table.inc'; echo "Done\n"; ?> --EXPECTF-- array(2) { [0]=> object(OCI-Lob)#%d (1) { ["descriptor"]=> resource(%d) of type (oci8 descriptor) } ["BLOB"]=> object(OCI-Lob)#%d (1) { ["descriptor"]=> resource(%d) of type (oci8 descriptor) } } bool(true) Done http://cvs.php.net/co.php/php-src/ext/oci8/tests/lob_006.phpt?r=1.1&p=1 Index: php-src/ext/oci8/tests/lob_006.phpt +++ php-src/ext/oci8/tests/lob_006.phpt --TEST-- oci_lob_write()/truncate()/erase() --SKIPIF-- <?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> --ENV-- return " ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." "; --FILE-- <?php require dirname(__FILE__).'/connect.inc'; require dirname(__FILE__).'/create_table.inc'; $ora_sql = "INSERT INTO ".$schema.$table_name." (blob) VALUES (empty_blob()) RETURNING blob INTO :v_blob "; $statement = oci_parse($c,$ora_sql); $blob = oci_new_descriptor($c,OCI_D_LOB); oci_bind_by_name($statement,":v_blob", $blob,-1,OCI_B_BLOB); oci_execute($statement, OCI_DEFAULT); var_dump($blob); $str = "this is a biiiig faaat test string. why are you reading it, I wonder? =)"; var_dump($blob->write($str)); var_dump($blob->truncate()); var_dump($blob->seek(0, OCI_SEEK_SET)); var_dump($blob->write("string was here. tick-tack-tick-tack.")); var_dump($blob->erase(10, 10)); var_dump($blob->write("some")); oci_commit($c); $select_sql = "SELECT blob FROM ".$schema.$table_name." FOR UPDATE"; $s = oci_parse($c, $select_sql); oci_execute($s, OCI_DEFAULT); var_dump($row = oci_fetch_array($s)); var_dump($row[0]->read(10000)); require dirname(__FILE__).'/drop_table.inc'; echo "Done\n"; ?> --EXPECTF-- object(OCI-Lob)#%d (1) { ["descriptor"]=> resource(%d) of type (oci8 descriptor) } int(72) bool(true) bool(true) int(37) int(10) int(4) array(2) { [0]=> object(OCI-Lob)#%d (1) { ["descriptor"]=> resource(%d) of type (oci8 descriptor) } ["BLOB"]=> object(OCI-Lob)#%d (1) { ["descriptor"]=> resource(%d) of type (oci8 descriptor) } } string(41) "string wask-tack-tick-tack.some" Done http://cvs.php.net/co.php/php-src/ext/oci8/tests/lob_007.phpt?r=1.1&p=1 Index: php-src/ext/oci8/tests/lob_007.phpt +++ php-src/ext/oci8/tests/lob_007.phpt --TEST-- oci_lob_write()/size()/load() --SKIPIF-- <?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> --ENV-- return " ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." "; --FILE-- <?php require dirname(__FILE__).'/connect.inc'; require dirname(__FILE__).'/create_table.inc'; $ora_sql = "INSERT INTO ".$schema.$table_name." (blob) VALUES (empty_blob()) RETURNING blob INTO :v_blob "; $statement = oci_parse($c,$ora_sql); $blob = oci_new_descriptor($c,OCI_D_LOB); oci_bind_by_name($statement,":v_blob", $blob,-1,OCI_B_BLOB); oci_execute($statement, OCI_DEFAULT); var_dump($blob); var_dump($blob->size()); var_dump($blob->write(str_repeat("string.", 1000))); var_dump($blob->size()); oci_commit($c); $select_sql = "SELECT blob FROM ".$schema.$table_name." FOR UPDATE"; $s = oci_parse($c, $select_sql); oci_execute($s, OCI_DEFAULT); var_dump($row = oci_fetch_array($s)); var_dump($row[0]->size()); var_dump(strlen($row[0]->load())); require dirname(__FILE__).'/drop_table.inc'; echo "Done\n"; ?> --EXPECTF-- object(OCI-Lob)#%d (1) { ["descriptor"]=> resource(%d) of type (oci8 descriptor) } int(0) int(7000) int(7000) array(2) { [0]=> object(OCI-Lob)#%d (1) { ["descriptor"]=> resource(%d) of type (oci8 descriptor) } ["BLOB"]=> object(OCI-Lob)#%d (1) { ["descriptor"]=> resource(%d) of type (oci8 descriptor) } } int(7000) int(7000) Done http://cvs.php.net/co.php/php-src/ext/oci8/tests/lob_008.phpt?r=1.1&p=1 Index: php-src/ext/oci8/tests/lob_008.phpt +++ php-src/ext/oci8/tests/lob_008.phpt --TEST-- oci_lob_write()/read()/eof() --SKIPIF-- <?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> --ENV-- return " ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." "; --FILE-- <?php require dirname(__FILE__).'/connect.inc'; require dirname(__FILE__).'/create_table.inc'; $ora_sql = "INSERT INTO ".$schema.$table_name." (blob) VALUES (empty_blob()) RETURNING blob INTO :v_blob "; $statement = oci_parse($c,$ora_sql); $blob = oci_new_descriptor($c,OCI_D_LOB); oci_bind_by_name($statement,":v_blob", $blob,-1,OCI_B_BLOB); oci_execute($statement, OCI_DEFAULT); var_dump($blob); var_dump($blob->write(str_repeat("string.", 1000))); oci_commit($c); $select_sql = "SELECT blob FROM ".$schema.$table_name." FOR UPDATE"; $s = oci_parse($c, $select_sql); oci_execute($s, OCI_DEFAULT); var_dump($row = oci_fetch_array($s)); $len = 0; while (!$row[0]->eof()) { $len += strlen($row[0]->read(1024)); } var_dump($len); require dirname(__FILE__).'/drop_table.inc'; echo "Done\n"; ?> --EXPECTF-- object(OCI-Lob)#%d (1) { ["descriptor"]=> resource(%d) of type (oci8 descriptor) } int(7000) array(2) { [0]=> object(OCI-Lob)#%d (1) { ["descriptor"]=> resource(%d) of type (oci8 descriptor) } ["BLOB"]=> object(OCI-Lob)#%d (1) { ["descriptor"]=> resource(%d) of type (oci8 descriptor) } } int(7000) Done http://cvs.php.net/co.php/php-src/ext/oci8/tests/lob_009.phpt?r=1.1&p=1 Index: php-src/ext/oci8/tests/lob_009.phpt +++ php-src/ext/oci8/tests/lob_009.phpt --TEST-- oci_lob_import()/read() --SKIPIF-- <?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> --ENV-- return " ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." "; --FILE-- <?php require dirname(__FILE__).'/connect.inc'; require dirname(__FILE__).'/create_table.inc'; $ora_sql = "INSERT INTO ".$schema.$table_name." (blob) VALUES (empty_blob()) RETURNING blob INTO :v_blob "; $statement = oci_parse($c,$ora_sql); $blob = oci_new_descriptor($c,OCI_D_LOB); oci_bind_by_name($statement,":v_blob", $blob,-1,OCI_B_BLOB); oci_execute($statement, OCI_DEFAULT); var_dump($blob); var_dump($blob->seek(10, OCI_SEEK_CUR)); var_dump($blob->import(dirname(__FILE__)."/lob_009.txt")); oci_commit($c); $select_sql = "SELECT blob FROM ".$schema.$table_name." FOR UPDATE"; $s = oci_parse($c, $select_sql); oci_execute($s, OCI_DEFAULT); var_dump($row = oci_fetch_array($s)); while (!$row[0]->eof()) { var_dump($row[0]->read(1024)); } require dirname(__FILE__).'/drop_table.inc'; echo "Done\n"; ?> --EXPECTF-- object(OCI-Lob)#%d (1) { ["descriptor"]=> resource(%d) of type (oci8 descriptor) } bool(true) bool(true) array(2) { [0]=> object(OCI-Lob)#%d (1) { ["descriptor"]=> resource(%d) of type (oci8 descriptor) } ["BLOB"]=> object(OCI-Lob)#%d (1) { ["descriptor"]=> resource(%d) of type (oci8 descriptor) } } string(43) "this is a test file for test lob_009.phpt " Done http://cvs.php.net/co.php/php-src/ext/oci8/tests/lob_009.txt?r=1.1&p=1 Index: php-src/ext/oci8/tests/lob_009.txt +++ php-src/ext/oci8/tests/lob_009.txt this is a test file for test lob_009.phpt http://cvs.php.net/co.php/php-src/ext/oci8/tests/lob_010.phpt?r=1.1&p=1 Index: php-src/ext/oci8/tests/lob_010.phpt +++ php-src/ext/oci8/tests/lob_010.phpt --TEST-- oci_lob_save() --SKIPIF-- <?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> --ENV-- return " ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." "; --FILE-- <?php require dirname(__FILE__).'/connect.inc'; require dirname(__FILE__).'/create_table.inc'; $ora_sql = "INSERT INTO ".$schema.$table_name." (blob) VALUES (empty_blob()) RETURNING blob INTO :v_blob "; $statement = oci_parse($c,$ora_sql); $blob = oci_new_descriptor($c,OCI_D_LOB); oci_bind_by_name($statement,":v_blob", $blob,-1,OCI_B_BLOB); oci_execute($statement, OCI_DEFAULT); var_dump($blob->save("string")); var_dump($blob->save("string", 3)); oci_commit($c); $select_sql = "SELECT blob FROM ".$schema.$table_name." FOR UPDATE"; $s = oci_parse($c, $select_sql); oci_execute($s, OCI_DEFAULT); $row = oci_fetch_array($s); while (!$row[0]->eof()) { var_dump($row[0]->read(1024)); } require dirname(__FILE__).'/drop_table.inc'; echo "Done\n"; ?> --EXPECT-- bool(true) bool(true) string(9) "strstring" Done http://cvs.php.net/co.php/php-src/ext/oci8/tests/lob_011.phpt?r=1.1&p=1 Index: php-src/ext/oci8/tests/lob_011.phpt +++ php-src/ext/oci8/tests/lob_011.phpt --TEST-- oci_lob_copy() --SKIPIF-- <?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> --ENV-- return " ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." "; --FILE-- <?php require dirname(__FILE__).'/connect.inc'; require dirname(__FILE__).'/create_table.inc'; $ora_sql = "INSERT INTO ".$schema.$table_name." (id, blob) VALUES (1, empty_blob()) RETURNING blob INTO :v_blob "; $statement = oci_parse($c,$ora_sql); $blob = oci_new_descriptor($c,OCI_D_LOB); oci_bind_by_name($statement,":v_blob", $blob,-1,OCI_B_BLOB); oci_execute($statement, OCI_DEFAULT); var_dump($blob->write("some string here. string, I said")); oci_commit($c); $ora_sql = "INSERT INTO ".$schema.$table_name." (id, blob) VALUES (2, empty_blob()) RETURNING blob INTO :v_blob "; $statement = oci_parse($c,$ora_sql); $blob = oci_new_descriptor($c,OCI_D_LOB); oci_bind_by_name($statement,":v_blob", $blob,-1,OCI_B_BLOB); oci_execute($statement, OCI_DEFAULT); oci_commit($c); $select_sql = "SELECT blob FROM ".$schema.$table_name." WHERE id = 1"; $s = oci_parse($c, $select_sql); oci_execute($s); $row1 = oci_fetch_array($s); $select_sql = "SELECT blob FROM ".$schema.$table_name." WHERE id = 2 FOR UPDATE"; $s = oci_parse($c, $select_sql); oci_execute($s, OCI_DEFAULT); $row2 = oci_fetch_array($s); var_dump(oci_lob_copy($row2[0], $row1[0])); var_dump($row1[0]->read(100)); oci_commit($c); $select_sql = "SELECT blob FROM ".$schema.$table_name." WHERE id = 2 FOR UPDATE"; $s = oci_parse($c, $select_sql); oci_execute($s, OCI_DEFAULT); var_dump($row2 = oci_fetch_array($s, OCI_RETURN_LOBS)); require dirname(__FILE__).'/drop_table.inc'; echo "Done\n"; ?> --EXPECT-- int(32) bool(true) string(32) "some string here. string, I said" array(1) { [0]=> string(32) "some string here. string, I said" } Done http://cvs.php.net/co.php/php-src/ext/oci8/tests/lob_012.phpt?r=1.1&p=1 Index: php-src/ext/oci8/tests/lob_012.phpt +++ php-src/ext/oci8/tests/lob_012.phpt --TEST-- oci_lob_export() --SKIPIF-- <?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> --ENV-- return " ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." "; --FILE-- <?php require dirname(__FILE__).'/connect.inc'; require dirname(__FILE__).'/create_table.inc'; $ora_sql = "INSERT INTO ".$schema.$table_name." (blob) VALUES (empty_blob()) RETURNING blob INTO :v_blob "; $statement = oci_parse($c,$ora_sql); $blob = oci_new_descriptor($c,OCI_D_LOB); oci_bind_by_name($statement,":v_blob", $blob,-1,OCI_B_BLOB); oci_execute($statement, OCI_DEFAULT); $blob; var_dump($blob->write("test string is here\nnew string")); oci_commit($c); $select_sql = "SELECT blob FROM ".$schema.$table_name." FOR UPDATE"; $s = oci_parse($c, $select_sql); oci_execute($s, OCI_DEFAULT); $row = oci_fetch_array($s); var_dump($row[0]->export(dirname(__FILE__)."/lob_012.tmp", 3, 10)); var_dump(file_get_contents(dirname(__FILE__)."/lob_012.tmp")); @unlink(dirname(__FILE__)."/lob_012.tmp"); require dirname(__FILE__).'/drop_table.inc'; echo "Done\n"; ?> --EXPECT-- int(30) bool(true) string(10) "t string i" Done http://cvs.php.net/co.php/php-src/ext/oci8/tests/lob_013.phpt?r=1.1&p=1 Index: php-src/ext/oci8/tests/lob_013.phpt +++ php-src/ext/oci8/tests/lob_013.phpt --TEST-- lob buffering --SKIPIF-- <?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> --ENV-- return " ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." "; --FILE-- <?php require dirname(__FILE__).'/connect.inc'; require dirname(__FILE__).'/create_table.inc'; $ora_sql = "INSERT INTO ".$schema.$table_name." (blob) VALUES (empty_blob()) RETURNING blob INTO :v_blob "; $statement = oci_parse($c,$ora_sql); $blob = oci_new_descriptor($c,OCI_D_LOB); oci_bind_by_name($statement,":v_blob", $blob,-1,OCI_B_BLOB); oci_execute($statement, OCI_DEFAULT); var_dump($blob->write("test")); var_dump($blob->getBuffering()); var_dump($blob->setBuffering(true)); var_dump($blob->write("test")); var_dump($blob->getBuffering()); var_dump($blob->flush()); oci_commit($c); $select_sql = "SELECT blob FROM ".$schema.$table_name.""; $s = oci_parse($c, $select_sql); oci_execute($s); $row = oci_fetch_array($s, OCI_RETURN_LOBS); var_dump($row[0]); require dirname(__FILE__).'/drop_table.inc'; echo "Done\n"; ?> --EXPECT-- int(4) bool(false) bool(true) int(4) bool(true) bool(true) string(8) "testtest" Done http://cvs.php.net/co.php/php-src/ext/oci8/tests/lob_014.phpt?r=1.1&p=1 Index: php-src/ext/oci8/tests/lob_014.phpt +++ php-src/ext/oci8/tests/lob_014.phpt --TEST-- oci_lob_free()/close() --SKIPIF-- <?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> --ENV-- return " ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." "; --FILE-- <?php require dirname(__FILE__).'/connect.inc'; require dirname(__FILE__).'/create_table.inc'; $ora_sql = "INSERT INTO ".$schema.$table_name." (blob) VALUES (empty_blob()) RETURNING blob INTO :v_blob "; $statement = oci_parse($c,$ora_sql); $blob = oci_new_descriptor($c,OCI_D_LOB); oci_bind_by_name($statement,":v_blob", $blob,-1,OCI_B_BLOB); oci_execute($statement, OCI_DEFAULT); $blob; var_dump($blob->write("test")); var_dump($blob->close()); var_dump($blob->write("test")); var_dump($blob->free()); var_dump($blob->write("test")); oci_commit($c); $select_sql = "SELECT blob FROM ".$schema.$table_name.""; $s = oci_parse($c, $select_sql); oci_execute($s); var_dump(oci_fetch_array($s, OCI_NUM + OCI_RETURN_LOBS)); require dirname(__FILE__).'/drop_table.inc'; echo "Done\n"; ?> --EXPECTF-- int(4) Warning: OCI-Lob::close(): ORA-22289: cannot perform operation on an unopened file or LOB in %slob_014.php on line %d bool(false) int(4) bool(true) Warning: OCI-Lob::write(): %d is not a valid oci8 descriptor resource in %slob_014.php on line %d bool(false) array(1) { [0]=> string(8) "testtest" } Done http://cvs.php.net/co.php/php-src/ext/oci8/tests/lob_015.phpt?r=1.1&p=1 Index: php-src/ext/oci8/tests/lob_015.phpt +++ php-src/ext/oci8/tests/lob_015.phpt --TEST-- various tests with wrong param count --SKIPIF-- <?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> --ENV-- return " ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." "; --FILE-- <?php require dirname(__FILE__).'/connect.inc'; require dirname(__FILE__).'/create_table.inc'; $ora_sql = "INSERT INTO ".$schema.$table_name." (blob) VALUES (empty_blob()) RETURNING blob INTO :v_blob "; $statement = oci_parse($c,$ora_sql); $blob = oci_new_descriptor($c,OCI_D_LOB,1,2,3); $blob = oci_new_descriptor($c); oci_bind_by_name($statement,":v_blob", $blob,-1,OCI_B_BLOB,4); oci_bind_by_name($statement,":v_blob", $blob,-1,OCI_B_BLOB,4,5); oci_bind_by_name($statement,":v_blob", $blob,-1); oci_bind_by_name($statement,":v_blob", $blob); oci_bind_by_name($statement,":v_blob"); oci_bind_by_name($statement); oci_execute($statement, OCI_DEFAULT); var_dump($blob); require dirname(__FILE__).'/drop_table.inc'; echo "Done\n"; ?> --EXPECTF-- Warning: oci_new_descriptor() expects at most 2 parameters, 5 given in %slob_015.php on line %d Warning: oci_bind_by_name() expects at most 5 parameters, 6 given in %slob_015.php on line %d Warning: oci_bind_by_name() expects at most 5 parameters, 7 given in %slob_015.php on line %d Notice: Object of class OCI-Lob to string conversion in %slob_015.php on line %d Warning: oci_bind_by_name() expects at least 3 parameters, 2 given in %slob_015.php on line %d Warning: oci_bind_by_name() expects at least 3 parameters, 1 given in %slob_015.php on line %d Warning: oci_execute(): ORA-00932: inconsistent datatypes: expected NUMBER got BLOB in %slob_015.php on line %d string(6) "Object" Done http://cvs.php.net/co.php/php-src/ext/oci8/tests/lob_016.phpt?r=1.1&p=1 Index: php-src/ext/oci8/tests/lob_016.phpt +++ php-src/ext/oci8/tests/lob_016.phpt --TEST-- returning multiple lobs --SKIPIF-- <?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> --ENV-- return " ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." "; --FILE-- <?php require dirname(__FILE__).'/connect.inc'; $drop = "DROP table lob_test"; $statement = oci_parse($c, $drop); @oci_execute($statement); $create = "CREATE table lob_test(lob_1 BLOB, lob_2 BLOB)"; $statement = oci_parse($c, $create); oci_execute($statement); $init = "INSERT INTO lob_test VALUES(EMPTY_BLOB(), EMPTY_BLOB())"; $statement = oci_parse($c, $init); oci_execute($statement); $select = "SELECT * FROM lob_test FOR UPDATE"; $statement = oci_parse($c, $select); oci_execute($statement, OCI_DEFAULT); $row = oci_fetch_assoc($statement); $row['LOB_1']->write("first"); $row['LOB_2']->write("second"); unset($row); oci_commit($c); $select = "SELECT * FROM lob_test FOR UPDATE"; $statement = oci_parse($c, $select); oci_execute($statement, OCI_DEFAULT); $row = oci_fetch_assoc($statement); var_dump($row); var_dump($row['LOB_1']->load()); var_dump($row['LOB_2']->load()); $drop = "DROP table lob_test"; $statement = oci_parse($c, $drop); @oci_execute($statement); echo "Done\n"; ?> --EXPECTF-- array(2) { ["LOB_1"]=> object(OCI-Lob)#%d (1) { ["descriptor"]=> resource(%d) of type (oci8 descriptor) } ["LOB_2"]=> object(OCI-Lob)#%d (1) { ["descriptor"]=> resource(%d) of type (oci8 descriptor) } } string(5) "first" string(6) "second" Done http://cvs.php.net/co.php/php-src/ext/oci8/tests/lob_017.phpt?r=1.1&p=1 Index: php-src/ext/oci8/tests/lob_017.phpt +++ php-src/ext/oci8/tests/lob_017.phpt --TEST-- returning multiple lobs (using persistent connection) --SKIPIF-- <?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> --ENV-- return " ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." "; --FILE-- <?php require dirname(__FILE__).'/connect.inc'; $c = oci_pconnect($user, $password, $dbase); $drop = "DROP table lob_test"; $statement = oci_parse($c, $drop); @oci_execute($statement); $create = "CREATE table lob_test(lob_1 BLOB, lob_2 BLOB)"; $statement = oci_parse($c, $create); oci_execute($statement); $init = "INSERT INTO lob_test VALUES(EMPTY_BLOB(), EMPTY_BLOB())"; $statement = oci_parse($c, $init); oci_execute($statement); $select = "SELECT * FROM lob_test FOR UPDATE"; $statement = oci_parse($c, $select); oci_execute($statement, OCI_DEFAULT); $row = oci_fetch_assoc($statement); $row['LOB_1']->write("first"); $row['LOB_2']->write("second"); unset($row); oci_commit($c); $select = "SELECT * FROM lob_test FOR UPDATE"; $statement = oci_parse($c, $select); oci_execute($statement, OCI_DEFAULT); $row = oci_fetch_assoc($statement); var_dump($row); var_dump($row['LOB_1']->load()); var_dump($row['LOB_2']->load()); $drop = "DROP table lob_test"; $statement = oci_parse($c, $drop); @oci_execute($statement); echo "Done\n"; ?> --EXPECTF-- array(2) { ["LOB_1"]=> object(OCI-Lob)#%d (1) { ["descriptor"]=> resource(%d) of type (oci8 descriptor) } ["LOB_2"]=> object(OCI-Lob)#%d (1) { ["descriptor"]=> resource(%d) of type (oci8 descriptor) } } string(5) "first" string(6) "second" Done http://cvs.php.net/co.php/php-src/ext/oci8/tests/lob_018.phpt?r=1.1&p=1 Index: php-src/ext/oci8/tests/lob_018.phpt +++ php-src/ext/oci8/tests/lob_018.phpt --TEST-- fetching the same lob several times --SKIPIF-- <?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> --ENV-- return " ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." "; --FILE-- <?php require dirname(__FILE__).'/connect.inc'; $drop = "DROP table lob_test"; $statement = oci_parse($c, $drop); @oci_execute($statement); $create = "CREATE table lob_test(mykey NUMBER, lob_1 CLOB)"; $statement = oci_parse($c, $create); oci_execute($statement); $init = "INSERT INTO lob_test (mykey, lob_1) VALUES(1, EMPTY_CLOB()) RETURNING lob_1 INTO :mylob"; $statement = oci_parse($c, $init); $clob = oci_new_descriptor($c, OCI_D_LOB); oci_bind_by_name($statement, ":mylob", $clob, -1, OCI_B_CLOB); oci_execute($statement, OCI_DEFAULT); $clob->save("data"); oci_commit($c); $init = "INSERT INTO lob_test (mykey, lob_1) VALUES(2, EMPTY_CLOB()) RETURNING lob_1 INTO :mylob"; $statement = oci_parse($c, $init); $clob = oci_new_descriptor($c, OCI_D_LOB); oci_bind_by_name($statement, ":mylob", $clob, -1, OCI_B_CLOB); oci_execute($statement, OCI_DEFAULT); $clob->save("long data"); oci_commit($c); $query = 'SELECT * FROM lob_test ORDER BY mykey ASC'; $statement = oci_parse ($c, $query); oci_execute($statement, OCI_DEFAULT); while ($row = oci_fetch_array($statement, OCI_ASSOC)) { $result = $row['LOB_1']->load(); var_dump($result); } $query = 'SELECT * FROM lob_test ORDER BY mykey DESC'; $statement = oci_parse ($c, $query); oci_execute($statement, OCI_DEFAULT); while ($row = oci_fetch_array($statement, OCI_ASSOC)) { $result = $row['LOB_1']->load(); var_dump($result); } $drop = "DROP table lob_test"; $statement = oci_parse($c, $drop); @oci_execute($statement); echo "Done\n"; ?> --EXPECTF-- string(4) "data" string(9) "long data" string(9) "long data" string(4) "data" Done http://cvs.php.net/co.php/php-src/ext/oci8/tests/lob_temp.phpt?r=1.1&p=1 Index: php-src/ext/oci8/tests/lob_temp.phpt +++ php-src/ext/oci8/tests/lob_temp.phpt --TEST-- temporary lobs --SKIPIF-- <?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> --ENV-- return " ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." "; --FILE-- <?php require dirname(__FILE__).'/connect.inc'; $blob = oci_new_descriptor($c,OCI_D_LOB); var_dump($blob->writeTemporary("test")); var_dump($blob->load()); var_dump($blob->seek(0, SEEK_SET)); var_dump($blob->read(2)); $c = oci_pconnect($user, $password, $dbase); $blob = oci_new_descriptor($c,OCI_D_LOB); var_dump($blob->writeTemporary("test")); var_dump($blob->load()); var_dump($blob->seek(0, SEEK_SET)); var_dump($blob->read(2)); echo "Done\n"; ?> --EXPECTF-- bool(true) string(4) "test" bool(true) string(2) "te" bool(true) string(4) "test" bool(true) string(2) "te" Done http://cvs.php.net/co.php/php-src/ext/oci8/tests/lob_temp1.phpt?r=1.1&p=1 Index: php-src/ext/oci8/tests/lob_temp1.phpt +++ php-src/ext/oci8/tests/lob_temp1.phpt --TEST-- closing temporary lobs --SKIPIF-- <?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> --ENV-- return " ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." "; --FILE-- <?php require dirname(__FILE__).'/connect.inc'; $blob = oci_new_descriptor($c,OCI_D_LOB); var_dump($blob->writeTemporary("test")); var_dump($blob->load()); var_dump($blob->close()); $c = oci_pconnect($user, $password, $dbase); $blob = oci_new_descriptor($c,OCI_D_LOB); var_dump($blob->writeTemporary("test")); var_dump($blob->load()); var_dump($blob->close()); echo "Done\n"; ?> --EXPECTF-- bool(true) string(4) "test" bool(true) bool(true) string(4) "test" bool(true) Done http://cvs.php.net/co.php/php-src/ext/oci8/tests/num.phpt?r=1.1&p=1 Index: php-src/ext/oci8/tests/num.phpt +++ php-src/ext/oci8/tests/num.phpt --TEST-- oci_num_*() family --SKIPIF-- <?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> --ENV-- return " ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." "; --FILE-- <?php require dirname(__FILE__)."/connect.inc"; require dirname(__FILE__).'/create_table.inc'; $insert_sql = "INSERT INTO ".$schema.$table_name." (id, value) VALUES (1,1)"; if (!($s = oci_parse($c, $insert_sql))) { die("oci_parse(insert) failed!\n"); } for ($i = 0; $i<3; $i++) { if (!oci_execute($s)) { die("oci_execute(insert) failed!\n"); } } if (!oci_commit($c)) { die("oci_commit() failed!\n"); } $select_sql = "SELECT * FROM ".$schema.$table_name.""; if (!($s = oci_parse($c, $select_sql))) { die("oci_parse(select) failed!\n"); } if (!oci_execute($s)) { die("oci_execute(select) failed!\n"); } var_dump(ocirowcount($s)); var_dump(oci_num_rows($s)); var_dump(ocinumcols($s)); var_dump(oci_num_fields($s)); $delete_sql = "DELETE FROM ".$schema.$table_name.""; if (!($s = oci_parse($c, $delete_sql))) { die("oci_parse(delete) failed!\n"); } if (!oci_execute($s)) { die("oci_execute(delete) failed!\n"); } oci_commit($c); var_dump(oci_num_rows($s)); require dirname(__FILE__).'/drop_table.inc'; echo "Done\n"; ?> --EXPECT-- int(0) int(0) int(5) int(5) int(3) Done http://cvs.php.net/co.php/php-src/ext/oci8/tests/oci_execute_segfault.phpt?r=1.1&p=1 Index: php-src/ext/oci8/tests/oci_execute_segfault.phpt +++ php-src/ext/oci8/tests/oci_execute_segfault.phpt --TEST-- oci_execute() segfault after repeated bind --SKIPIF-- <?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> --ENV-- return " ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." "; --FILE-- <?php require dirname(__FILE__).'/connect.inc'; require dirname(__FILE__).'/create_table.inc'; $ora_sql = "INSERT INTO ".$table_name." (blob, clob) VALUES (empty_blob(), empty_clob()) RETURNING blob INTO :v_blob "; $s = oci_parse($c,$ora_sql); $blob = oci_new_descriptor($c,OCI_D_LOB); oci_bind_by_name($s,":v_blob", $blob,-1,OCI_B_BLOB); oci_execute($s); oci_bind_by_name($s,":v_blob", $blob,-1,OCI_B_BLOB); oci_execute($s); echo "Done\n"; ?> --EXPECT-- Done http://cvs.php.net/co.php/php-src/ext/oci8/tests/old_oci_close.phpt?r=1.1&p=1 Index: php-src/ext/oci8/tests/old_oci_close.phpt +++ php-src/ext/oci8/tests/old_oci_close.phpt --TEST-- oci8.old_oci_close_semantics On --SKIPIF-- <?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> --INI-- oci8.old_oci_close_semantics=1 --ENV-- return " ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." "; --FILE-- <?php require dirname(__FILE__)."/connect.inc"; var_dump($c); var_dump(oci_close($c)); var_dump(oci_parse($c, "select 1 from dual")); echo "Done\n"; ?> --EXPECTF-- resource(%d) of type (oci8 connection) NULL resource(%d) of type (oci8 statement) Done http://cvs.php.net/co.php/php-src/ext/oci8/tests/old_oci_close1.phpt?r=1.1&p=1 Index: php-src/ext/oci8/tests/old_oci_close1.phpt +++ php-src/ext/oci8/tests/old_oci_close1.phpt --TEST-- oci8.old_oci_close_semantics Off --SKIPIF-- <?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> --INI-- oci8.old_oci_close_semantics=0 --ENV-- return " ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." "; --FILE-- <?php require dirname(__FILE__)."/connect.inc"; var_dump($c); var_dump(oci_close($c)); var_dump(oci_parse($c, "select 1 from dual")); echo "Done\n"; ?> --EXPECTF-- resource(%d) of type (oci8 connection) bool(true) Warning: oci_parse() expects parameter 1 to be resource, null given in %s on line %d NULL Done http://cvs.php.net/co.php/php-src/ext/oci8/tests/password.phpt?r=1.1&p=1 Index: php-src/ext/oci8/tests/password.phpt +++ php-src/ext/oci8/tests/password.phpt --TEST-- oci_password_change() --SKIPIF-- <?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> --ENV-- return " ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." "; --FILE-- <?php require dirname(__FILE__)."/connect.inc"; $new_password = "test"; var_dump(oci_password_change($dbase, $user, $password, $new_password)); if (!empty($dbase)) { var_dump($new_c = ocilogon($user,$new_password,$dbase)); } else { var_dump($new_c = ocilogon($user,$new_password)); } var_dump(oci_password_change($dbase, $user, $new_password, $password)); echo "Done\n"; ?> --EXPECTF-- resource(%d) of type (oci8 connection) resource(%d) of type (oci8 connection) resource(%d) of type (oci8 connection) Done http://cvs.php.net/co.php/php-src/ext/oci8/tests/password_new.phpt?r=1.1&p=1 Index: php-src/ext/oci8/tests/password_new.phpt +++ php-src/ext/oci8/tests/password_new.phpt --TEST-- oci_password_change() --SKIPIF-- <?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> --ENV-- return " ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." "; --FILE-- <?php require dirname(__FILE__)."/connect.inc"; $new_password = "test"; var_dump(oci_password_change($dbase, $user, $password, $new_password)); if (!empty($dbase)) { var_dump($new_c = ocilogon($user,$new_password,$dbase)); } else { var_dump($new_c = ocilogon($user,$new_password)); } var_dump(oci_password_change($dbase, $user, $new_password, $password)); echo "Done\n"; ?> --EXPECTF-- resource(%d) of type (oci8 connection) resource(%d) of type (oci8 connection) resource(%d) of type (oci8 connection) Done http://cvs.php.net/co.php/php-src/ext/oci8/tests/password_old.phpt?r=1.1&p=1 Index: php-src/ext/oci8/tests/password_old.phpt +++ php-src/ext/oci8/tests/password_old.phpt --TEST-- ocipasswordchange() --SKIPIF-- <?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> --ENV-- return " ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." "; --FILE-- <?php require dirname(__FILE__)."/connect.inc"; $new_password = "test"; var_dump(ocipasswordchange($c, $user, $password, $new_password)); if (!empty($dbase)) { var_dump($new_c = ocilogon($user,$new_password,$dbase)); } else { var_dump($new_c = ocilogon($user,$new_password)); } var_dump(ocipasswordchange($new_c, $user, $new_password, $password)); echo "Done\n"; ?> --EXPECTF-- bool(true) resource(%d) of type (oci8 connection) bool(true) Done http://cvs.php.net/co.php/php-src/ext/oci8/tests/persistent.phpt?r=1.1&p=1 Index: php-src/ext/oci8/tests/persistent.phpt +++ php-src/ext/oci8/tests/persistent.phpt --TEST-- reusing persistent connections --SKIPIF-- <?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> --ENV-- return " ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." TNS_ADMIN=".(isset($_ENV['TNS_ADMIN']) ? $_ENV['TNS_ADMIN'] : '')." "; --FILE-- <?php require dirname(__FILE__)."/connect.inc"; var_dump(oci_pconnect($user, $password, $dbase)); var_dump(oci_pconnect($user, $password, $dbase)); var_dump(oci_pconnect($user, $password, $dbase)); var_dump(oci_connect($user, $password, $dbase)); var_dump(oci_connect($user, $password, $dbase)); var_dump(oci_connect($user, $password, $dbase)); echo "Done\n"; ?> --EXPECTF-- resource(%d) of type (oci8 persistent connection) resource(%d) of type (oci8 persistent connection) resource(%d) of type (oci8 persistent connection) resource(%d) of type (oci8 connection) resource(%d) of type (oci8 connection) resource(%d) of type (oci8 connection) Done http://cvs.php.net/co.php/php-src/ext/oci8/tests/prefetch.phpt?r=1.1&p=1 Index: php-src/ext/oci8/tests/prefetch.phpt +++ php-src/ext/oci8/tests/prefetch.phpt --TEST-- oci_set_prefetch() --SKIPIF-- <?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> --ENV-- return " ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." "; --FILE-- <?php require dirname(__FILE__)."/connect.inc"; require dirname(__FILE__).'/create_table.inc'; $insert_sql = "INSERT INTO ".$schema.$table_name." (id, value) VALUES (1,1)"; if (!($s = oci_parse($c, $insert_sql))) { die("oci_parse(insert) failed!\n"); } for ($i = 0; $i<3; $i++) { if (!oci_execute($s)) { die("oci_execute(insert) failed!\n"); } } if (!oci_commit($c)) { die("oci_commit() failed!\n"); } $select_sql = "SELECT * FROM ".$schema.$table_name.""; if (!($s = oci_parse($c, $select_sql))) { die("oci_parse(select) failed!\n"); } var_dump(oci_set_prefetch($s, 10)); if (!oci_execute($s)) { die("oci_execute(select) failed!\n"); } var_dump(oci_fetch($s)); var_dump(oci_num_rows($s)); require dirname(__FILE__).'/drop_table.inc'; echo "Done\n"; ?> --EXPECT-- bool(true) bool(true) int(1) Done http://cvs.php.net/co.php/php-src/ext/oci8/tests/prefetch_old.phpt?r=1.1&p=1 Index: php-src/ext/oci8/tests/prefetch_old.phpt +++ php-src/ext/oci8/tests/prefetch_old.phpt --TEST-- ocisetprefetch() --SKIPIF-- <?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> --ENV-- return " ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." "; --FILE-- <?php require dirname(__FILE__)."/connect.inc"; require dirname(__FILE__).'/create_table.inc'; $insert_sql = "INSERT INTO ".$schema.$table_name." (id, value) VALUES (1,1)"; if (!($s = ociparse($c, $insert_sql))) { die("ociparse(insert) failed!\n"); } for ($i = 0; $i<3; $i++) { if (!ociexecute($s)) { die("ociexecute(insert) failed!\n"); } } if (!ocicommit($c)) { die("ocicommit() failed!\n"); } $select_sql = "SELECT * FROM ".$schema.$table_name.""; if (!($s = ociparse($c, $select_sql))) { die("ociparse(select) failed!\n"); } var_dump(ocisetprefetch($s, 10)); if (!ociexecute($s)) { die("ociexecute(select) failed!\n"); } var_dump(ocifetch($s)); var_dump(ocirowcount($s)); require dirname(__FILE__).'/drop_table.inc'; echo "Done\n"; ?> --EXPECT-- bool(true) bool(true) int(1) Done http://cvs.php.net/co.php/php-src/ext/oci8/tests/privileged_connect.phpt?r=1.1&p=1 Index: php-src/ext/oci8/tests/privileged_connect.phpt +++ php-src/ext/oci8/tests/privileged_connect.phpt --TEST-- privileged connect tests --SKIPIF-- <?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> --ENV-- return " ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." TNS_ADMIN=".(isset($_ENV['TNS_ADMIN']) ? $_ENV['TNS_ADMIN'] : '')." "; --FILE-- <?php require dirname(__FILE__)."/connect.inc"; oci_connect("", "", "", false, OCI_SYSOPER); oci_connect("", "", "", false, OCI_SYSDBA); oci_connect("", "", "", false, -1); oci_connect("", "", "", false, "qwe"); echo "Done\n"; ?> --EXPECTF-- Warning: oci_connect(): Privileged connect is disabled. Enable oci8.privileged_connect to be able to connect as SYSOPER or SYSDBA in %s on line %d Warning: oci_connect(): Privileged connect is disabled. Enable oci8.privileged_connect to be able to connect as SYSOPER or SYSDBA in %s on line %d Warning: oci_connect(): Invalid session mode specified (-1) in %s on line %d Warning: oci_connect() expects parameter 5 to be long, string given in %s on line %d Done http://cvs.php.net/co.php/php-src/ext/oci8/tests/privileged_connect1.phpt?r=1.1&p=1 Index: php-src/ext/oci8/tests/privileged_connect1.phpt +++ php-src/ext/oci8/tests/privileged_connect1.phpt --TEST-- privileged connect tests --INI-- oci8.privileged_connect=1 --SKIPIF-- <?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> --ENV-- return " ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." TNS_ADMIN=".(isset($_ENV['TNS_ADMIN']) ? $_ENV['TNS_ADMIN'] : '')." "; --FILE-- <?php require dirname(__FILE__)."/connect.inc"; oci_connect("", "", "", false, OCI_SYSOPER); oci_connect("", "", "", false, OCI_SYSDBA); oci_connect("", "", "", false, -1); oci_connect("", "", "", false, "qwe"); echo "Done\n"; ?> --EXPECTF-- Warning: oci_connect(): ORA-01031: insufficient privileges in %s on line %d Warning: oci_connect(): ORA-01031: insufficient privileges in %s on line %d Warning: oci_connect(): Invalid session mode specified (-1) in %s on line %d Warning: oci_connect() expects parameter 5 to be long, string given in %s on line %d Done http://cvs.php.net/co.php/php-src/ext/oci8/tests/serverversion.phpt?r=1.1&p=1 Index: php-src/ext/oci8/tests/serverversion.phpt +++ php-src/ext/oci8/tests/serverversion.phpt --TEST-- oci_server_version() --SKIPIF-- <?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> --ENV-- return " ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." "; --FILE-- <?php require dirname(__FILE__)."/connect.inc"; if (!empty($dbase)) { var_dump($c = oci_connect($user, $password, $dbase)); } else { var_dump($c = oci_connect($user, $password)); } $v = oci_server_version($c); var_dump(str_replace("\n", "", $v)); $v = ociserverversion($c); var_dump(str_replace("\n", "", $v)); echo "Done\n"; ?> --EXPECTF-- resource(%d) of type (oci8 connection) string(%d) "%s" string(%d) "%s" Done http://cvs.php.net/co.php/php-src/ext/oci8/tests/statement_cache.phpt?r=1.1&p=1 Index: php-src/ext/oci8/tests/statement_cache.phpt +++ php-src/ext/oci8/tests/statement_cache.phpt --TEST-- statement cache --SKIPIF-- <?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> --ENV-- return " ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." "; --FILE-- <?php require dirname(__FILE__)."/connect.inc"; $pc = oci_pconnect($user, $password, $dbase); $stmt = oci_parse($pc, "select 1+3 from dual", true); oci_execute($stmt); var_dump(oci_fetch_array($stmt)); $stmt = oci_parse($pc, "select 1+3 from dual", true); oci_execute($stmt); var_dump(oci_fetch_array($stmt)); echo "Done\n"; ?> --EXPECTF-- array(2) { [0]=> string(1) "4" ["1+3"]=> string(1) "4" } array(2) { [0]=> string(1) "4" ["1+3"]=> string(1) "4" } Done http://cvs.php.net/co.php/php-src/ext/oci8/tests/statement_type.phpt?r=1.1&p=1 Index: php-src/ext/oci8/tests/statement_type.phpt +++ php-src/ext/oci8/tests/statement_type.phpt --TEST-- oci_statement_type() --SKIPIF-- <?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> --ENV-- return " ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." "; --FILE-- <?php require dirname(__FILE__)."/connect.inc"; if (!empty($dbase)) { var_dump($c = oci_connect($user, $password, $dbase)); } else { var_dump($c = oci_connect($user, $password)); } $sqls = Array( "SELECT * FROM table", "DELETE FROM table WHERE id = 1", "INSERT INTO table VALUES(1)", "UPDATE table SET id = 1", "DROP TABLE table", "CREATE TABLE table (id NUMBER)", "WRONG SYNTAX", "" ); foreach ($sqls as $sql) { $s = oci_parse($c, $sql); var_dump(oci_statement_type($s)); } echo "Done\n"; ?> --EXPECTF-- resource(%d) of type (oci8 connection) string(6) "SELECT" string(6) "DELETE" string(6) "INSERT" string(6) "UPDATE" string(4) "DROP" string(6) "CREATE" string(7) "UNKNOWN" string(7) "UNKNOWN" Done http://cvs.php.net/co.php/php-src/ext/oci8/tests/statement_type_old.phpt?r=1.1&p=1 Index: php-src/ext/oci8/tests/statement_type_old.phpt +++ php-src/ext/oci8/tests/statement_type_old.phpt --TEST-- ocistatementtype() --SKIPIF-- <?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> --ENV-- return " ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." "; --FILE-- <?php require dirname(__FILE__)."/connect.inc"; if (!empty($dbase)) { var_dump($c = ocilogon($user, $password, $dbase)); } else { var_dump($c = ocilogon($user, $password)); } $sqls = Array( "SELECT * FROM table", "DELETE FROM table WHERE id = 1", "INSERT INTO table VALUES(1)", "UPDATE table SET id = 1", "DROP TABLE table", "CREATE TABLE table (id NUMBER)", "WRONG SYNTAX", "" ); foreach ($sqls as $sql) { $s = ociparse($c, $sql); var_dump(ocistatementtype($s)); } echo "Done\n"; ?> --EXPECTF-- resource(%d) of type (oci8 connection) string(6) "SELECT" string(6) "DELETE" string(6) "INSERT" string(6) "UPDATE" string(4) "DROP" string(6) "CREATE" string(7) "UNKNOWN" string(7) "UNKNOWN" Done http://cvs.php.net/co.php/php-src/ext/oci8/tests/uncommitted.phpt?r=1.1&p=1 Index: php-src/ext/oci8/tests/uncommitted.phpt +++ php-src/ext/oci8/tests/uncommitted.phpt --TEST-- uncommitted connection --SKIPIF-- <?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?> --ENV-- return " ORACLE_HOME=".(isset($_ENV['ORACLE_HOME']) ? $_ENV['ORACLE_HOME'] : '')." NLS_LANG=".(isset($_ENV['NLS_LANG']) ? $_ENV['NLS_LANG'] : '')." TNS_ADMIN=".(isset($_ENV['TNS_ADMIN']) ? $_ENV['TNS_ADMIN'] : '')." "; --FILE-- <?php require dirname(__FILE__)."/connect.inc"; $stmt = oci_parse($c, "select 1 from dual"); oci_execute($stmt, OCI_DEFAULT); echo "Done\n"; ?> --EXPECTF-- Done
« previous php.cvs (#33825) next »