Skip to content

Fix pdo_oci tests for PHP 8.0 #9048

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions ext/pdo/tests/bug_73234.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ $dir = getenv('REDIR_TEST_DIR');
if (false == $dir) die('skip no driver');
require_once $dir . 'pdo_test.inc';
PDOTest::skip();

$db = PDOTest::factory();
if ($db->getAttribute(PDO::ATTR_DRIVER_NAME) == 'oci') {
die("xfail PDO::PARAM_NULL is not honored by OCI driver, related with bug #81586");
}
?>
--FILE--
<?php
Expand Down
5 changes: 5 additions & 0 deletions ext/pdo/tests/gh8626.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ $dir = getenv('REDIR_TEST_DIR');
if (false == $dir) die('skip no driver');
require_once $dir . 'pdo_test.inc';
PDOTest::skip();

$db = PDOTest::factory();
if ($db->getAttribute(PDO::ATTR_DRIVER_NAME) == 'oci') {
die("xfail OCI driver errorInfo is inconsistent with other PDO drivers");
}
?>
--FILE--
<?php
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
--TEST--
PDO OCI: Inserts 1K with 1 number and 2 LOB columns (stress test)
PDO OCI: Insert and fetch 1K records from a table that contains 1 number and 2 LOB columns (stress test)
--SKIPIF--
<?php
if (!extension_loaded('pdo') || !extension_loaded('pdo_oci')) die('skip not loaded');
Expand Down Expand Up @@ -69,6 +69,57 @@ printf("Done\n");
/* Cleanup is done in pdo_oci_stream_2b.phpt */
//$db->exec("drop table pdo_oci_stream_2");

$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

$i = 0;
$j = 9;
$a_val = ord('a');
foreach($db->query("select data1 as d4_1, data2 as d4_2 from pdo_oci_stream_2 order by id") as $row) {
$a = $row['d4_1'];
$a1 = $row['d4_2'];

$str1 = stream_get_contents($a);
$str2 = stream_get_contents($a1);

$str1len = strlen($str1);
$str2len = strlen($str2);

$b = ord($str1[0]);
$b1 = ord($str2[0]);

if (($b != ($a_val + $i)) && ($str1len != (4086 + $i)) &&
($b1 != ($a_val + $j)) && ($str2len != (4086 + $j))) {
printf("There is a bug!\n");
printf("Col1:\n");
printf("a_val = %d\n", $a_val);
printf("b = %d\n", $b);
printf("i = %d\n", $i);
printf("str1len = %d\n", $str1len);

printf("Col2:\n");
printf("a_val = %d\n", $a_val);
printf("b1 = %d\n", $b1);
printf("j = %d\n", $j);
printf("str2len = %d\n", $str1len);

}
$i++;
if ($i>9)
$i = 0;
$j--;
if ($j<0)
$j = 9;
}
echo "Fetch operation done!\n";

/* Cleanup */
$db->exec("drop table pdo_oci_stream_2");

?>
--EXPECT--
Inserting 1000 Records ... Done
Fetch operation done!
70 changes: 0 additions & 70 deletions ext/pdo_oci/tests/pdo_oci_stream_2b.phpt

This file was deleted.