X7ROOT File Manager
Current Path:
/opt/alt/tests/alt-php84-pecl-pdo_oci_1.2.0-1.el8/tests
opt
/
alt
/
tests
/
alt-php84-pecl-pdo_oci_1.2.0-1.el8
/
tests
/
??
..
??
README.md
(511 B)
??
bug41996.phpt
(461 B)
??
bug44301.phpt
(767 B)
??
bug46274.phpt
(1.88 KB)
??
bug46274_2.phpt
(2.08 KB)
??
bug54379.phpt
(1.51 KB)
??
bug57702.phpt
(4.59 KB)
??
bug60994.phpt
(5.95 KB)
??
checkliveness.phpt
(1.13 KB)
??
common.phpt
(749 B)
??
oci_success_with_info.phpt
(2.62 KB)
??
pdo_oci_attr_action.phpt
(1.12 KB)
??
pdo_oci_attr_autocommit_1.phpt
(2.13 KB)
??
pdo_oci_attr_autocommit_2.phpt
(4.25 KB)
??
pdo_oci_attr_autocommit_3.phpt
(1.77 KB)
??
pdo_oci_attr_call_timeout.phpt
(1.61 KB)
??
pdo_oci_attr_case.phpt
(1.8 KB)
??
pdo_oci_attr_client.phpt
(968 B)
??
pdo_oci_attr_client_identifier.phpt
(1.33 KB)
??
pdo_oci_attr_client_info.phpt
(1.21 KB)
??
pdo_oci_attr_drivername.phpt
(363 B)
??
pdo_oci_attr_module.phpt
(1 KB)
??
pdo_oci_attr_nulls_1.phpt
(1.35 KB)
??
pdo_oci_attr_prefetch_1.phpt
(1.48 KB)
??
pdo_oci_attr_prefetch_2.phpt
(1.12 KB)
??
pdo_oci_attr_server.phpt
(807 B)
??
pdo_oci_bind_bool.phpt
(563 B)
??
pdo_oci_bind_input_output.phpt
(615 B)
??
pdo_oci_class_constants.phpt
(1.44 KB)
??
pdo_oci_debugdumpparams.phpt
(2.08 KB)
??
pdo_oci_fread_1.phpt
(5.46 KB)
??
pdo_oci_phpinfo.phpt
(510 B)
??
pdo_oci_quote1.phpt
(2.97 KB)
??
pdo_oci_stmt_getcolumnmeta.phpt
(13.06 KB)
??
pdo_oci_stream_1.phpt
(3.7 KB)
??
pdo_oci_stream_2.phpt
(3.75 KB)
??
pdo_oci_templob_1.phpt
(2.5 KB)
??
pecl_bug_11345.phpt
(674 B)
??
pecl_bug_6364.phpt
(2.03 KB)
Editing: bug57702.phpt
--TEST-- PDO OCI Bug #57702 (Multi-row BLOB fetches) --EXTENSIONS-- pdo pdo_oci --SKIPIF-- <?php require(getenv('PDO_TEST_DIR').'/pdo_test.inc'); PDOTest::skip(); ?> --FILE-- <?php require_once(getenv('PDO_TEST_DIR').'/pdo_test.inc'); $db = PDOTest::test_factory(getenv('PDO_OCI_TEST_DIR').'/common.phpt'); // Note the PDO test setup sets PDO::ATTR_STRINGIFY_FETCHES to true // (and sets PDO::ATTR_CASE to PDO::CASE_LOWER) $db->exec("begin execute immediate 'drop table test57702'; exception when others then if sqlcode <> -942 then raise; end if; end;"); $query = "create table test57702 (id number, data1 blob, data2 blob)"; $stmt = $db->prepare($query); $stmt->execute(); function do_insert($db, $id, $data1, $data2) { $db->beginTransaction(); $stmt = $db->prepare("insert into test57702 (id, data1, data2) values (:id, empty_blob(), empty_blob()) returning data1, data2 into :blob1, :blob2"); $stmt->bindParam(':id', $id); $stmt->bindParam(':blob1', $blob1, PDO::PARAM_LOB); $stmt->bindParam(':blob2', $blob2, PDO::PARAM_LOB); $blob1 = null; $blob2 = null; $stmt->execute(); fwrite($blob1, $data1); fclose($blob1); fwrite($blob2, $data2); fclose($blob2); $db->commit(); } do_insert($db, 1, "row 1 col 1", "row 1 col 2"); do_insert($db, 2, "row 2 col 1", "row 2 col 2"); //////////////////// echo "First Query\n"; // Fetch it back $stmt = $db->prepare('select data1, data2 from test57702 order by id'); $stmt->execute(); $row = $stmt->fetch(PDO::FETCH_ASSOC); var_dump($row['data1']); var_dump($row['data2']); $row = $stmt->fetch(PDO::FETCH_ASSOC); var_dump($row['data1']); var_dump($row['data2']); //////////////////// echo "\nSecond Query\n"; foreach($db->query("select data1 as d1, data2 as d2 from test57702 order by id") as $row) { var_dump($row['d1']); var_dump($row['d2']); } //////////////////// echo "\nThird Query\n"; $stmt = $db->prepare('select data1 as d3_1, data2 as d3_2 from test57702 order by id'); $rs = $stmt->execute(); $stmt->bindColumn('d3_1' , $clob1, PDO::PARAM_LOB); $stmt->bindColumn('d3_2' , $clob2, PDO::PARAM_LOB); while ($stmt->fetch(PDO::FETCH_BOUND)) { var_dump($clob1); var_dump($clob2); } //////////////////// echo "\nFourth Query\n"; $a = array(); $i = 0; foreach($db->query("select data1 as d4_1, data2 as d4_2 from test57702 order by id") as $row) { $a[$i][0] = $row['d4_1']; $a[$i][1] = $row['d4_2']; $i++; } for ($i = 0; $i < count($a); $i++) { var_dump($a[$i][0]); var_dump($a[$i][1]); } //////////////////// echo "\nFifth Query\n"; $db->setAttribute(PDO::ATTR_STRINGIFY_FETCHES, false); // Let's use streams // Since each column only has one lob descriptor, the last row is // shown twice because the lob descriptor for each column is reused in // the stream $a = array(); $i = 0; foreach($db->query("select data1 as d4_1, data2 as d4_2 from test57702 order by id") as $row) { $a[$i][0] = $row['d4_1']; $a[$i][1] = $row['d4_2']; $i++; } for ($i = 0; $i < count($a); $i++) { var_dump(stream_get_contents($a[$i][0])); var_dump(stream_get_contents($a[$i][1])); } //////////////////// echo "\nSixth Query\n"; $db->setAttribute(PDO::ATTR_STRINGIFY_FETCHES, false); // Let's use streams $a = array(); $i = 0; foreach($db->query("select data1 as d4_1, data2 as d4_2 from test57702 order by id") as $row) { $a[$i][0] = $row['d4_1']; $a[$i][1] = $row['d4_2']; var_dump(stream_get_contents($a[$i][0])); var_dump(stream_get_contents($a[$i][1])); $i++; } print "done\n"; ?> --CLEAN-- <?php require(getenv('PDO_TEST_DIR').'/pdo_test.inc'); $db = PDOTest::test_factory(getenv('PDO_OCI_TEST_DIR').'/common.phpt'); $db->exec("begin execute immediate 'drop table test57702'; exception when others then if sqlcode <> -942 then raise; end if; end;"); ?> --EXPECT-- First Query string(11) "row 1 col 1" string(11) "row 1 col 2" string(11) "row 2 col 1" string(11) "row 2 col 2" Second Query string(11) "row 1 col 1" string(11) "row 1 col 2" string(11) "row 2 col 1" string(11) "row 2 col 2" Third Query string(11) "row 1 col 1" string(11) "row 1 col 2" string(11) "row 2 col 1" string(11) "row 2 col 2" Fourth Query string(11) "row 1 col 1" string(11) "row 1 col 2" string(11) "row 2 col 1" string(11) "row 2 col 2" Fifth Query string(11) "row 2 col 1" string(11) "row 2 col 2" string(11) "row 2 col 1" string(11) "row 2 col 2" Sixth Query string(11) "row 1 col 1" string(11) "row 1 col 2" string(11) "row 2 col 1" string(11) "row 2 col 2" done
Upload File
Create Folder