Skip to content

workload/schemachange: expect DatatypeMismatch errors for NULL defaults#153039

Merged
craig[bot] merged 1 commit intocockroachdb:masterfrom
spilchen:gh-152957/250905/1015/schemachanger-null-datatype-mismatch/pr-ready
Sep 8, 2025
Merged

workload/schemachange: expect DatatypeMismatch errors for NULL defaults#153039
craig[bot] merged 1 commit intocockroachdb:masterfrom
spilchen:gh-152957/250905/1015/schemachanger-null-datatype-mismatch/pr-ready

Conversation

@spilchen
Copy link
Copy Markdown
Contributor

@spilchen spilchen commented Sep 5, 2025

Previously, the workload only expected DatatypeMismatch errors when setting default values that were non-NULL. However, after fixing the type casting syntax in SET DEFAULT operations, NULL values with explicit type casts (e.g., NULL::enum_type) now properly reach the type checker and correctly produce DatatypeMismatch errors when the cast type doesn't match the column type.

Fixes #152957

Release note: none

Epic: None

Previously, the workload only expected DatatypeMismatch errors when
setting default values that were non-NULL. However, after fixing the
type casting syntax in SET DEFAULT operations, NULL values with
explicit type casts (e.g., NULL::enum_type) now properly reach the
type checker and correctly produce DatatypeMismatch errors when the
cast type doesn't match the column type.

Fixes cockroachdb#152957

Release note: none

Epic: None
@spilchen spilchen requested a review from a team September 5, 2025 13:17
@spilchen spilchen self-assigned this Sep 5, 2025
@spilchen spilchen requested a review from a team as a code owner September 5, 2025 13:17
@spilchen spilchen requested review from golgeek and herkolategan and removed request for a team September 5, 2025 13:17
@cockroach-teamcity
Copy link
Copy Markdown
Member

This change is Reviewable

Copy link
Copy Markdown
Collaborator

@fqazi fqazi left a comment

Choose a reason for hiding this comment

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

:lgtm:

@fqazi reviewed 1 of 1 files at r1, all commit messages.
Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @golgeek and @herkolategan)

@spilchen
Copy link
Copy Markdown
Contributor Author

spilchen commented Sep 8, 2025

TFTR!

bors r+

@craig
Copy link
Copy Markdown
Contributor

craig bot commented Sep 8, 2025

@craig craig bot merged commit 5fcadbd into cockroachdb:master Sep 8, 2025
23 checks passed
msbutler pushed a commit to msbutler/cockroach that referenced this pull request Sep 12, 2025
153039: workload/schemachange: expect DatatypeMismatch errors for NULL defaults r=spilchen a=spilchen

Previously, the workload only expected DatatypeMismatch errors when setting default values that were non-NULL. However, after fixing the type casting syntax in SET DEFAULT operations, NULL values with explicit type casts (e.g., NULL::enum_type) now properly reach the type checker and correctly produce DatatypeMismatch errors when the cast type doesn't match the column type.

Fixes cockroachdb#152957

Release note: none

Epic: None

Co-authored-by: Matt Spilchen <matt.spilchen@cockroachlabs.com>
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.

roachtest: schemachange/mixed-versions failed

3 participants