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

Fetching rows from FB 3 Beta 1 results in NullPointerException [JDBC376] #418

Closed
firebird-automations opened this issue Dec 7, 2014 · 5 comments

Comments

@firebird-automations
Copy link

Submitted by: @mrotteveel

Fetching rows from a Firebird 3 Beta 1 (or higher) results - potentially - in a NullPointerException. The reason is that Firebird 3 no longer returns the number of requested rows, but can make an optimization decision to return less rows. Jaybird 2.2 however always expects the requested number of rows, unless it is the last batch of rows (fetch returns status 100).

On Firebird-devel Dmitry has indicated that for protocol 10 this change in behavior will be reverted, however it would be good to change the code in Jaybird to not assume the requested number of rows is returned always.

The affected code was already changed in Jaybird 3, so only Jaybird 2.2.5 and earlier are affected.

Commits: 8c51b88 FirebirdSQL/fbt-repository@16d1f1e

@firebird-automations
Copy link
Author

Commented by: @mrotteveel

Although the change is going to be (has been) reverted for protocol 10 (see discussion https://sourceforge.net/p/firebird/mailman/firebird-devel/thread/5481DF3B.2020906%40lawinegevaar.nl/ ) I will fix this in 2.2.6.

@firebird-automations
Copy link
Author

Modified by: @mrotteveel

Fix Version: Jaybird 2.2.6 [ 10588 ]

@firebird-automations
Copy link
Author

Commented by: @mrotteveel

In FBCachedFetcher, if the rows allocated array is larger than what was fetched, it will copy to the fetched size. This prevents the NPE. The other fetchers were not affected. In theory users of the lower level GDS API are still affected, but I leave that as is.

@firebird-automations
Copy link
Author

Modified by: @mrotteveel

status: Open [ 1 ] => Resolved [ 5 ]

resolution: Fixed [ 1 ]

@firebird-automations
Copy link
Author

Modified by: @mrotteveel

status: Resolved [ 5 ] => Closed [ 6 ]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment