Skip to content

connection: keep reader options set before ConnectionInit - #154

Merged
singhpratech merged 1 commit into
mainfrom
fix/pre-init-connection-options
Oct 4, 2026
Merged

singhpratech merged 1 commit into
mainfrom
fix/pre-init-connection-options

Conversation

@singhpratech

Copy link
Copy Markdown
Owner

Fixes the roadmap item: connection-level reader options (adbc.odbc.batch_size, adbc.odbc.prefetch, adbc.odbc.sqllen_32bit) set before AdbcConnectionInit were discarded, because init copied the database's options over them.

Change. OdbcConnectionSetOptionOdbc notes when batch_size or prefetch is set on a not-yet-connected connection; OdbcConnectionInit copies the database's options as before, then re-applies those two and a forced sqllen_32bit (which already carried its own flag). Options set after init are unchanged. The crate's bundled C sources are synced.

Test. TestPreInitConnectionOptions in tests/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 with 1024 != 777, 0 != 7, 0 != 1; with the change the driver tests pass (5316 checks, 0 failures) and ctest 10/10, Linux, sqliteodbc.

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.
@singhpratech
singhpratech merged commit 52afdd8 into main Oct 4, 2026
6 checks passed
@singhpratech
singhpratech deleted the fix/pre-init-connection-options branch October 4, 2026 01:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant