8000 fix(prepared): keep a literal :as-of / :valid-at when binding slots (#603) by adityamukho · Pull Request #604 · project-minigraf/minigraf · GitHub
[go: up one dir, main page]

Skip to content

fix(prepared): keep a literal :as-of / :valid-at when binding slots (#603) - #604

Merged
adityamukho merged 1 commit into
v3from
fix/603-prepared-temporal
Oct 15, 2026
Merged

adityamukho merged 1 commit into
v3from
fix/603-prepared-temporal

Conversation

@adityamukho
Copy link
Copy Markdown
Collaborator

For issue #603 (data-integrity: it stays open until the v2.x backport is released).

prepared::substitute used query.as_of.take() / query.valid_at.take() before matching AsOf::Slot / ValidAt::Slot, so a literal :as-of (counter or timestamp), :valid-at or :any-valid-time was dropped. Every PreparedQuery::execute / query then 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_kept runs literal :as-of (counter, timestamp), :valid-at, :any-valid-time, none, and a per-fact pseudo-attribute query through execute, a prepared execute and a prepared cursor, which must agree. Before the fix it failed (:as-of a timestamp: 1 row prepared vs 0 direct).
  • prepared.rs unit test: substitute keeps non-slot as_of / valid_at.

cargo test: 1516 (1506 passed, 10 ignored). CHANGELOG Fixed entry; CLAUDE.md, README and TEST_COVERAGE counts. A backport PR to main follows.

🤖 Generated with Claude Code

https://claude.ai/code/session_01HyLscCUuJ1GQpdAeX79EdR

…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
codecov Bot commented Oct 15, 2026
Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@adityamukho
adityamukho force-pushed the fix/603-prepared-temporal branch from 94465cd to ce87063 Compare October 15, 2026 05:55
@adityamukho
adityamukho merged commit d689374 into v3 Oct 15, 2026
25 checks passed
@adityamukho
adityamukho deleted the fix/603-prepared-temporal branch October 15, 2026 06:05
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

0