Conversation
`cargo clippy --profile ci -p nodedb --all-targets --all-features -- -D warnings`
aborts on this expression at `vector_primary.rs:161`:
error: this boolean expression can be simplified
= help: ... #nonminimal_bool
so the lint job is red on `main` for every branch, and the first thing it
reports is a file no branch has touched. Clippy's own suggested rewrite is this
one, and it is the negation identity `is_none_or(f) == !is_some_and(!f)`:
`!get(k).is_some_and(|v| !matches!(v, SqlValue::Null))` becomes
`get(k).is_none_or(|v| matches!(v, SqlValue::Null))`.
All three cases agree, including the one a reader might expect to differ — an
absent key inserts the key-column value under both spellings:
present non-null -> false / false
present Null -> true / true
absent -> true / true
Verified: `main` exits 101 on this file, this branch exits 0.
EnRaiha
force-pushed
the
fix/planner-nonminimal-bool
branch
3 times, most recently
from
September 29, 2026 00:50
5a19092 to
67b24a7
Compare
The fill guard decides whether a synthesised identity is written back under the key column. Its condition must mirror the identity extractor: fill on an absent or NULL key, leave every present value alone. Four cases pin that split. Two bind the fill direction: a missing key column and an explicit NULL both end with the identity under the key. Two cover the "left alone" direction: a present key keeps its bytes, and an empty key stays empty. The empty case binds the identity extractor's classification of `""` rather than the guard, because the guard writes `doc_id` and `doc_id` already equals `""` there. No case is red on `main`. The guard is behaviour-identical there, because `!is_some_and(!p)` and `is_none_or(p)` agree on every input, so the previous commit changes the form only. A mutation that disables the guard fails the two fill cases (exit 100). The two "left alone" cases do not discriminate that mutation, and they cannot discriminate an always-fill mutation either: for a present String the identity the fill writes is that value's own string form.
EnRaiha
force-pushed
the
fix/planner-nonminimal-bool
branch
from
September 29, 2026 02:05
67b24a7 to
77cb538
Compare
This branch has not been deployed
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.
planner: write the vector-primary key guard as is_none_or
Why
cargo clippy -p nodedb --lib --all-features -- -D warningsfails onmainatnodedb/src/control/planner/sql_plan_convert/dml/vector_primary.rs:164:No in-flight branch touches that line, so the lint gate blocks every unrelated review. This
change applies clippy's own rewrite.
What changed
One file, +109/-2 against
main:nodedb/src/control/planner/sql_plan_convert/dml/vector_primary.rs— the key-column guardwritten in clippy's suggested form, plus four tests in its
mod teststhat pin thekey-column fill rule.
The new spelling is the negation identity
is_none_or(f) == !is_some_and(!f), so the guardselects the same rows: a row gets a minted identity exactly when the key column is absent or
NULL.
Effect
No user-visible change. The planner builds the same plan for the same statement: no wire,
SQL, error-code, metric, config or on-disk change.
is_none_orneeds Rust 1.82 and theworkspace sets
rust-version = "1.94", so the toolchain floor does not move either.Steps to test
The first command is the CI gate verbatim. The failing state reproduces at
main: the sameclippy command exits 101 with the diagnostic quoted in Why.
Checks
cargo clippy -p nodedb --lib --all-features -- -D warningsmain(f18b31edf)cargo clippy -p nodedb --lib --all-features -- -D warnings77cb53893cargo nextest run -p nodedb --lib -E 'test(~key_column)'77cb53893cargo clippy --workspace --all-targets --all-features --profile ci -- -D warnings77cb53893cargo nextest run -p nodedb --lib -E 'test(~key_column)', guard removed77cb53893plus the guard removedThe last row is what makes the tests evidence: with the guard removed, the two fill cases
fail, so they cover the guard's behaviour and not only that the file compiles. The base
predicate passes the same five tests, so no case is red on
main.