-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Fixed GH-17383 - pdo_firebird: PDOException has wrong code and message since PHP 8.4 #18072
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
Closed
Changes from 8 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
6558bda
Added NULL check for `H->db` in `firebird_handle_closer`
SakiTakamachi 22cfe1c
Fixed "H->db != NULL" to "H->db".
SakiTakamachi 740322a
Added a test
SakiTakamachi 2d6fb0c
Merge branch 'PHP-8.4' into fix/gh17383
SakiTakamachi 5d180f0
debug
SakiTakamachi 0d44b4c
rm debug code
SakiTakamachi a1f34c0
Added a host name string to the DB specification to disable trusted auth
SakiTakamachi eb8d99e
Added sql to create user
SakiTakamachi 08c5f0f
[skip ci] Added parentheses
SakiTakamachi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
--TEST-- | ||
GH-17383 PDOException has wrong code and message since PHP 8.4 | ||
--EXTENSIONS-- | ||
pdo_firebird | ||
--SKIPIF-- | ||
<?php require('skipif.inc'); ?> | ||
--XLEAK-- | ||
A bug in firebird causes a memory leak when calling `isc_attach_database()`. | ||
See https://github.com/FirebirdSQL/firebird/issues/7849 | ||
--FILE-- | ||
<?php | ||
|
||
require("testdb.inc"); | ||
unset($dbh); | ||
|
||
foreach ([ | ||
['firebird:dbname=invalid_host:db', PDO_FIREBIRD_TEST_USER, PDO_FIREBIRD_TEST_PASS], | ||
[PDO_FIREBIRD_TEST_DSN, 'invalid_user', PDO_FIREBIRD_TEST_PASS], | ||
[PDO_FIREBIRD_TEST_DSN, PDO_FIREBIRD_TEST_USER, 'invalid_pass'], | ||
] as [$dsn, $user, $pass]) { | ||
try { | ||
$dbh = new PDO($dsn, $user, $pass); | ||
} catch (PDOException $e) { | ||
echo 'PDOException code: ' . $e->getCode() . "\n"; | ||
echo 'PDOException message: ' . $e->getMessage() . "\n"; | ||
echo "\n"; | ||
} | ||
} | ||
?> | ||
--EXPECT-- | ||
PDOException code: 335544721 | ||
PDOException message: SQLSTATE[HY000] [335544721] Unable to complete network request to host "invalid_host". | ||
|
||
PDOException code: 335544472 | ||
PDOException message: SQLSTATE[HY000] [335544472] Your user name and password are not defined. Ask your database administrator to set up a Firebird login. | ||
|
||
PDOException code: 335544472 | ||
PDOException message: SQLSTATE[HY000] [335544472] Your user name and password are not defined. Ask your database administrator to set up a Firebird login. |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.