Repository navigation
connection: keep reader options set before ConnectionInit - #154
Merged
Merged
Conversation
ConnectionInit started from the database's reader options, which overwrote a batch_size, prefetch or sqllen_32bit set on the connection before init with the database's values. Record which of them were set pre-init and re-apply them over the copy; sqllen_32bit already carried its own forced flag. New C test fails on the old code (1024 != 777, 0 != 7, 0 != 1) and passes now. Bundled crate sources synced.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes the roadmap item: connection-level reader options (
adbc.odbc.batch_size,adbc.odbc.prefetch,adbc.odbc.sqllen_32bit) set beforeAdbcConnectionInitwere discarded, because init copied the database's options over them.Change.
OdbcConnectionSetOptionOdbcnotes whenbatch_sizeorprefetchis set on a not-yet-connected connection;OdbcConnectionInitcopies the database's options as before, then re-applies those two and a forcedsqllen_32bit(which already carried its own flag). Options set after init are unchanged. The crate's bundled C sources are synced.Test.
TestPreInitConnectionOptionsintests/c/test_driver.c: sets the three options on a fresh connection before init and reads them back after; a second connection confirms the database default is untouched and post-init setting still works. On the old code it fails with1024 != 777,0 != 7,0 != 1; with the change the driver tests pass (5316 checks, 0 failures) and ctest 10/10, Linux, sqliteodbc.