Repository navigation
Conversation
Stop pinning a copy of every engine default in this binding. SystemConfig fields are now Option<T>, defaulting to None meaning "use the engine default". Only explicitly set fields are forwarded: numerics via the existing sentinels, booleans via a new -1/0/1 tristate in new_database. Unset settings follow engine-side default changes automatically (e.g. LadybugDB/ladybug#1435's enable_multi_writes flip needs no binding change). Explicitly passed values behave exactly as before. Note: this also retires two stale Rust-side defaults that disagreed with the engine: max_db_size (was 4 GiB, now engine default) and throw_on_wal_replay_failure (was true, now engine default false). BREAKING CHANGE: SystemConfig fields changed from concrete types to Option<T>; the new_database FFI booleans are now i64 tristates.
…tinel The checksums test relied on the binding pinning throw_on_wal_replay_failure=true; opt into throwing explicitly since unset settings now follow the engine default (false). Also fix a latent -1u comparison bug in new_database: -1u is a 32-bit unsigned int, so comparing the uint64_t maxDBSize against it wrongly treated UINT64_MAX (the keep-engine-default sentinel) as an explicit value, failing with 'max db size should be a power of 2'. The old Rust default (u32::MAX) accidentally matched the buggy comparison.
Contributor
Author
|
Fixed the two failures: (1) checksums test now opts into throwing explicitly; (2) fixed a latent |
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.
Follow-up to #44 (which simply flipped the default): instead of pinning a copy of every engine default in this binding,
SystemConfigfields are nowOption<T>defaulting toNone= "use the engine default".database.rs:Optionfields, derivedDefault, builders wrapSome, forwarding mapsNoneto the existing sentinels (numerics) and a new-1tristate (booleans).ffi.rs/lbug_rs.h/lbug_rs.cpp: boolean params becomei64tristate (-1 keeps engine default).SYSTEM_CONFIG_FOR_TESTSruns on engine defaults except the smallmax_db_size.Unset settings follow engine-side default changes automatically (e.g. LadybugDB/ladybug#1435 needs no binding change). Explicitly passed values behave exactly as before.
cargo checkpasses.This also retires two stale Rust-side defaults that disagreed with the engine:
max_db_size(was 4 GiB, now engine default) andthrow_on_wal_replay_failure(was true, now engine default false).BREAKING CHANGE:
SystemConfigfields changed from concrete types toOption<T>.