Skip to content

Commit 2db2cab

Browse files
mvorisekkocsismate
authored andcommitted
Fix pdo_oci tests for PHP 8.1
Closes GH-9051
1 parent 95befc7 commit 2db2cab

File tree

2 files changed

+13
-12
lines changed

2 files changed

+13
-12
lines changed

ext/pdo/tests/pdo_039.phpt

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,19 +28,29 @@ if ($pass === false) $pass = NULL;
2828

2929
$conn = new PDO($dsn, $user, $pass, $attr);
3030

31-
$query = 'SELECT 1';
31+
var_dump($conn->errorCode());
3232

33+
$query = 'SELECT 1';
34+
if ($conn->getAttribute(PDO::ATTR_DRIVER_NAME) === 'oci') {
35+
$query .= ' FROM DUAL';
36+
}
3337
var_dump($conn->errorCode());
34-
$stmt = $conn->prepare($query);
3538
var_dump($conn->errorCode());
3639

40+
$stmt = $conn->prepare($query);
41+
var_dump($conn->errorCode());
3742
var_dump($stmt->errorCode());
43+
3844
$stmt->execute();
3945
var_dump($stmt->errorCode());
46+
var_dump($stmt->errorCode());
4047

4148
?>
4249
--EXPECT--
4350
NULL
4451
string(5) "00000"
52+
string(5) "00000"
53+
string(5) "00000"
4554
NULL
4655
string(5) "00000"
56+
string(5) "00000"

ext/pdo_oci/tests/pdo_oci_quote1.phpt

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ $stmt = $db->prepare('select * from poq_tab');
2121
// The intent is that the fetched data be identical to the unquoted string.
2222
// Remember!: use bind variables instead of PDO->quote()
2323

24-
$a = array(null, "", "a", "ab", "abc", "ab'cd", "a\b\n", "'", "''", "a'", "'z", "a''b", '"');
24+
$a = array("", "a", "ab", "abc", "ab'cd", "a\b\n", "'", "''", "a'", "'z", "a''b", '"');
2525
foreach ($a as $u) {
2626
$q = $db->quote($u);
2727
echo "Unquoted : ";
@@ -42,15 +42,6 @@ echo "Done\n";
4242

4343
?>
4444
--EXPECT--
45-
Unquoted : NULL
46-
Quoted : string(2) "''"
47-
array(1) {
48-
[0]=>
49-
array(1) {
50-
["t"]=>
51-
NULL
52-
}
53-
}
5445
Unquoted : string(0) ""
5546
Quoted : string(2) "''"
5647
array(1) {

0 commit comments

Comments
 (0)