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

Fix truncated oracle fetch result #4581

Merged
merged 1 commit into from Apr 10, 2021

Conversation

amenning
Copy link
Contributor

@amenning amenning commented Apr 2, 2021

Q A
Type bug
Related issues #4553

Summary

This adds a test that demonstrates the issue where a result set
larger than the oci8 default prefetch value is queried, but a truncated
row set is returned due to the dataset being invalidated during the
fetch sequence. No php exception is thrown.

Copy link
Member

@morozov morozov left a comment

Choose a reason for hiding this comment

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

Looks good overall. Please see inline comments.

Since it's a non-breaking improvement, it could target 3.1.x instead of 4.0.x.

src/Driver/OCI8/Exception/TruncatedQueryResult.php Outdated Show resolved Hide resolved
src/Driver/OCI8/Result.php Outdated Show resolved Hide resolved
src/Driver/OCI8/Result.php Outdated Show resolved Hide resolved
src/Driver/OCI8/Result.php Outdated Show resolved Hide resolved
tests/Functional/Driver/OCI8/ResultTest.php Outdated Show resolved Hide resolved
src/Driver/OCI8/Result.php Outdated Show resolved Hide resolved
tests/Functional/Driver/OCI8/ResultTest.php Show resolved Hide resolved
@amenning amenning changed the base branch from 4.0.x to 3.1.x April 3, 2021 18:33
src/Driver/OCI8/Result.php Outdated Show resolved Hide resolved
src/Driver/OCI8/Result.php Outdated Show resolved Hide resolved
src/Driver/OCI8/Result.php Outdated Show resolved Hide resolved
@amenning amenning changed the title Add failing unit test for truncated fetch issue Fix truncated oracle fetch result Apr 5, 2021
tests/Functional/Driver/OCI8/ResultTest.php Outdated Show resolved Hide resolved
tests/Functional/Driver/OCI8/ResultTest.php Show resolved Hide resolved
tests/Functional/Driver/OCI8/ResultTest.php Outdated Show resolved Hide resolved
src/Driver/OCI8/Result.php Outdated Show resolved Hide resolved
src/Driver/OCI8/Result.php Outdated Show resolved Hide resolved
Copy link
Member

@morozov morozov left a comment

Choose a reason for hiding this comment

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

Looks good. @amenning please remove the cache file and squash commits.

ci/github/phpunit/.phpunit.result.cache Outdated Show resolved Hide resolved
@morozov morozov added this to the 3.1.0 milestone Apr 9, 2021
The error handler screens for oracle warnings from php oci8 driver
and converts them to a truncated query result exception. This also adds a test
that demonstrates the issue where a result set larger than the oci8
default prefetch value is queried, but a truncated
row set is returned due to the dataset being invalidated during the
fetch sequenece.
@amenning
Copy link
Contributor Author

I removed that file from the commit and squashed them into one commit. All checks passed.

@morozov morozov merged commit f2413c4 into doctrine:3.1.x Apr 10, 2021
@morozov
Copy link
Member

morozov commented Apr 10, 2021

Thanks, @amenning!

@amenning
Copy link
Contributor Author

Thank you for quick reviews and excellent guidance.

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
2 participants