Skip to content

Fix enum DEFAULT NULL validation in analyzer#3085

Merged
elianddb merged 5 commits intomainfrom
elianddb/9425-enum-zero-strict-mode
Jul 10, 2025
Merged

Fix enum DEFAULT NULL validation in analyzer#3085
elianddb merged 5 commits intomainfrom
elianddb/9425-enum-zero-strict-mode

Conversation

@elianddb
Copy link
Copy Markdown
Contributor

@elianddb elianddb commented Jul 10, 2025

Fixes dolthub/dolt#9491
Fix enum DEFAULT NULL validation

@elianddb elianddb force-pushed the elianddb/9425-enum-zero-strict-mode branch from ccc8fc8 to 60f43a5 Compare July 10, 2025 22:07
@elianddb elianddb requested a review from jycor July 10, 2025 22:55
Copy link
Copy Markdown
Contributor

@jycor jycor left a comment

Choose a reason for hiding this comment

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

LGTM, add an enginetest for this case

elianddb and others added 2 commits July 10, 2025 23:05
- Add missing case for NULL values in validateEnumLiteralDefault function
- MySQL allows DEFAULT NULL for enum columns, but analyzer was rejecting it
- This fixes CREATE TABLE statements with enum columns that have DEFAULT NULL
- Resolves "incompatible type for default value" error for valid enum defaults

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Added 'enum import error message validation' test to verify proper error format
- Added 'enum default null validation' test to verify DEFAULT NULL works for enums
- These tests correspond to the failing bats tests in auto-bump PR #9491
- Both tests pass and validate the enum fixes are working correctly

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@elianddb elianddb force-pushed the elianddb/9425-enum-zero-strict-mode branch from 01ae336 to 3d587cb Compare July 10, 2025 23:06
@elianddb elianddb force-pushed the elianddb/9425-enum-zero-strict-mode branch 3 times, most recently from 86d4e7a to fb1f8d6 Compare July 10, 2025 23:16
elianddb and others added 2 commits July 10, 2025 23:17
Need to fix error type to match MySQL exactly - should return
ErrInvalidColumnDefaultValue instead of ErrIncompatibleDefaultType.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@elianddb elianddb merged commit af68faa into main Jul 10, 2025
8 checks passed
@Hydrocharged Hydrocharged deleted the elianddb/9425-enum-zero-strict-mode branch December 17, 2025 07:32
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