Repository navigation
fix(prepared): keep a literal :as-of / :valid-at when binding slots (#603) - #604
Merged
Merged
Conversation
This was referenced Oct 15, 2026
…603) substitute() took query.as_of and query.valid_at out before matching a slot, so a literal :as-of, :valid-at or :any-valid-time in a prepared query was dropped and the query ran at the current transaction time, valid now. Only a slot is replaced now. Regression tests compare execute, a prepared execute and a prepared cursor for each literal form. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HyLscCUuJ1GQpdAeX79EdR
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
adityamukho
force-pushed
the
fix/603-prepared-temporal
branch
from
October 15, 2026 05:55
94465cd to
ce87063
Compare
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.
For issue #603 (data-integrity: it stays open until the v2.x backport is released).
prepared::substituteusedquery.as_of.take()/query.valid_at.take()before matchingAsOf::Slot/ValidAt::Slot, so a literal:as-of(counter or timestamp),:valid-ator:any-valid-timewas dropped. EveryPreparedQuery::execute/querythen ran at the current transaction time and valid now. The fix borrows the field and replaces it only when it is a slot.Tests
tests/prepared_statements_test.rs:prepared_literal_as_of_and_valid_at_are_keptruns literal:as-of(counter, timestamp),:valid-at,:any-valid-time, none, and a per-fact pseudo-attribute query throughexecute, a preparedexecuteand a prepared cursor, which must agree. Before the fix it failed (:as-ofa timestamp: 1 row prepared vs 0 direct).prepared.rsunit test:substitutekeeps non-slotas_of/valid_at.cargo test: 1516 (1506 passed, 10 ignored). CHANGELOG Fixed entry; CLAUDE.md, README and TEST_COVERAGE counts. A backport PR tomainfollows.🤖 Generated with Claude Code
https://claude.ai/code/session_01HyLscCUuJ1GQpdAeX79EdR