Skip to content

core: Fix various gencol affinity test failures#6596

Open
LeMikaelF wants to merge 3 commits intomainfrom
virtual-column-affinity
Open

core: Fix various gencol affinity test failures#6596
LeMikaelF wants to merge 3 commits intomainfrom
virtual-column-affinity

Conversation

@LeMikaelF
Copy link
Copy Markdown
Collaborator

@LeMikaelF LeMikaelF commented Apr 28, 2026

Description

Correctly handle missing affinity cases

  • moved the self_table machinery from ProgramBuilder to Resolver
  • introduced a SelfTableScope type to group self_table things
  • removed an old self_table_column_affinities since it was now unused

Description of AI Usage

Codex

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented Apr 28, 2026

Merging this PR will not alter performance

✅ 323 untouched benchmarks
⏩ 105 skipped benchmarks1


Comparing virtual-column-affinity (2221a90) with main (f8ad674)

Open in CodSpeed

Footnotes

  1. 105 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@github-actions github-actions Bot added the vdbe label Apr 28, 2026
})?;
if column.affinity() != Affinity::Blob {
program.emit_column_affinity(target_reg, column.affinity());
resolver.with_self_table_context(program, Some(&ctx), |program, _| {
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I moved with_self_table_context out of the loop to do the work only once.

} expect {
}

@requires custom_types "uses custom types"
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this fixes a related panic that I found while working on this

@LeMikaelF LeMikaelF force-pushed the virtual-column-affinity branch from cab4f97 to 4681222 Compare April 29, 2026 14:39
@LeMikaelF LeMikaelF marked this pull request as ready for review April 29, 2026 14:41
SELF_TABLE type lookup only handled DML scopes, so selecting a virtual generated column that called union_tag emitted an empty tag-name table and panicked. Resolve the declared type through SelfTableScope for both DML and SELECT scopes.
@LeMikaelF LeMikaelF force-pushed the virtual-column-affinity branch from 4681222 to 2221a90 Compare April 29, 2026 14:44
column.affinity_with_strict(table.is_strict)
};
if !column.is_rowid_alias() {
continue;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why?

}

if let Some(&rowid_register) = registers.last() {
resolver
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we assert that this is rowid?

@penberg penberg changed the title make remaining gencol affinity tests pass core: Fix various gencol affinity test failures May 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants