Skip to content

Comments

store: Fix iterator bug in fields_exist_in_dest for multi-column indexes#6341

Merged
lutter merged 2 commits intomasterfrom
lutter/indexdef
Feb 20, 2026
Merged

store: Fix iterator bug in fields_exist_in_dest for multi-column indexes#6341
lutter merged 2 commits intomasterfrom
lutter/indexdef

Conversation

@lutter
Copy link
Collaborator

@lutter lutter commented Feb 9, 2026

fields_exist_in_dest used a single consuming iterator over table columns and checked each index column with .any(), which advances the iterator. When index columns appeared in a different order than the table columns, later lookups would miss columns the iterator had already passed, causing valid multi-column indexes to be silently dropped during subgraph copy/graft.

Replace the consuming iterator with direct lookups on dest_table.columns for each column check, so column order no longer matters.

@lutter lutter requested a review from dwerner February 10, 2026 16:33
@lutter lutter requested a review from isum February 19, 2026 00:55
fields_exist_in_dest used a single consuming iterator over table columns
and checked each index column with .any(), which advances the iterator.
When index columns appeared in a different order than the table columns,
later lookups would miss columns the iterator had already passed, causing
valid multi-column indexes to be silently dropped during subgraph copy/graft.

Replace the consuming iterator with direct lookups on dest_table.columns
for each column check, so column order no longer matters.
@lutter lutter merged commit a9b3cf0 into master Feb 20, 2026
6 checks passed
@lutter lutter deleted the lutter/indexdef branch February 20, 2026 19:31
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.

2 participants