Skip to content
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

[GH-4553] Simplify error handling in the OCI8 driver #4599

Merged
merged 1 commit into from Apr 14, 2021

Conversation

morozov
Copy link
Member

@morozov morozov commented Apr 10, 2021

Q A
Type improvement
BC Break no

See #4553.

While reviewing #4581, I had an impression that the oci8 extension only reports fetching errors via the PHP error mechanism and doesn't set the error status available via oci_error(). I did some debugging of the extension and it turned out the error handling works both ways: via the PHP errors and the error status on the statement.

This patch simplifies the original approach:

  1. No longer need to set and reset the error handler.
  2. No longer need to parse error messages.
  3. No additional exception class.
  4. I didn't check that yet but the resulting exception message should be closer to the one that PDO would produce.

@morozov
Copy link
Member Author

morozov commented Apr 10, 2021

@amenning I did some digging into the extension and simplified your patch a bit. Could you take a look?

@morozov morozov marked this pull request as ready for review April 10, 2021 18:34
Copy link
Contributor

@amenning amenning left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a great improvement. Code looks good and I see no issues. This covers the original example and will be far better for properly catching and reporting a wider set of related errors.

@morozov morozov requested a review from greg0ire April 11, 2021 03:05
Copy link
Member

@greg0ire greg0ire left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice simplification !

@morozov morozov merged commit fb9ba59 into doctrine:3.1.x Apr 14, 2021
@morozov morozov deleted the issues/4553 branch April 14, 2021 19:27
@morozov morozov added this to the 3.1.0 milestone Jun 4, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 5, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DBAL FETCH silently returns truncated results when database emits an error after initial prefetch
3 participants