Conversation
chands10
marked this pull request as draft
September 10, 2026 20:12
roborivers
suggested changes
Sep 10, 2026
roborivers
left a comment
There was a problem hiding this comment.
Cbuild submission: Error ⚠.
Regression testing: Success ✓.
The first 10 failing tests are:
analyze_partial_index_off_generated [failed with core dumped] **quarantined**
analyze [failed with core dumped] **quarantined**
reco-ddlk-sql **quarantined**
tsa
consumer_non_atomic_default_consumer_generated **quarantined**
tunables
sc_downgrade [timeout] **quarantined**
skipscan [timeout] **quarantined**
Mem.flags is 32 bits wide in this build, but OP_Eq..OP_Ge save the
original flags of both operands in u16 locals and write them back after
the comparison. That drops everything above bit 15 - MEM_Zero,
MEM_Subtype, MEM_Xor, MEM_OpFunc and MEM_Master.
An insert into a table with an autoinc column and a partial index whose
"where" compares that column trips it. nextsequence() leaves the
register as MEM_Master, the predicate compares it, and the restore
clears the register to no type at all. The MakeRecord that forms the
index key then asserts in sqlite3VdbeSerialType(), or without assertions
writes a zero length blob where the master resolve marker should be:
create table t { schema { int a longlong b dbstore=nextsequence }
keys { "b" = b { where b > 50 } } }$$
insert into t(a) values(1)
OP_SeekRowid saves and restores flags the same way; widen it too.
Signed-off-by: Salil Chandra <schandra107@bloomberg.net>
The value of an autoinc column is only assigned on the master, by set_master_columns(). The replicant that works out which keys a record belongs in evaluates the "where" clause of every partial index before that happens, so a predicate referencing such a column is compared against an unresolved placeholder. The bitmap it ships is wrong in both directions: keys are added for rows that do not satisfy the predicate, and rows that do satisfy it get no key at all. Recompute ins_keys in add_record() once the sequence has been assigned, for tables that have both a partial index and an autoinc column. It has to run before fixup_ireq_index_expressions(), which consults ins_keys to decide which indexes to skip. Tables with no autoinc column keep the existing timing. verify() reports the missing keys but not the spurious ones, so the test uses a unique partial index to catch those: neither row satisfies the predicate, so neither belongs in the index and the second insert must not collide with the first. Signed-off-by: Salil Chandra <schandra107@bloomberg.net>
chands10
force-pushed
the
autoincpidx
branch
from
September 16, 2026 19:25
90145cb to
e5a234b
Compare
chands10
marked this pull request as ready for review
September 16, 2026 19:25
roborivers
approved these changes
Sep 16, 2026
roborivers
left a comment
There was a problem hiding this comment.
Cbuild submission: Success ✓.
Regression testing: Success ✓.
The first 10 failing tests are:
consumer_non_atomic_default_consumer_generated **quarantined**
bind_query_plan
manual_partition
sc_downgrade [timeout] **quarantined**
sc_redo [timeout]
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.
Fix this crash