-
-
Notifications
You must be signed in to change notification settings - Fork 237
pull from main #3090
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
pull from main #3090
Conversation
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
fix NewServer call
…ouble-quotes Key write now uses same recursive call to writeMarshalledValue() as value under json_encode.go Fixes: dolthub/dolt#7998
…atements-info-schema Fix 9347 panic case statements info schema
Distinguish nils in firstBuffer
Generalize types in `CASE`, `IF`, and `IFNULL`
Adding skipped tests for `UPDATE ... JOIN` bugs
…oin node, need to implement joinUpdater
… into updatejoin
Modified columndefault.go to detect enum data truncation errors and return ErrInvalidColumnDefaultValue instead of ErrIncompatibleDefaultType to match MySQL behavior exactly. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
- Add early validation in tableSpecToSchema to catch enum default 0 before conversion - Prevents columndefault.go from returning "(unknown)" in error messages - Enhanced validateDefaultExprs to handle enum defaults with proper column context - Now matches MySQL behavior exactly: "Invalid default value for 'column_name'" Resolves the remaining column name issue for CREATE TABLE statements while maintaining all existing INSERT validation functionality. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
Use ctx.GetSessionVariable() instead of ctx.Session.GetSessionVariable() to properly access session variables in the enum conversion context.
Allow uint16 enum indices to be converted without strict mode validation. This fixes INSERT IGNORE behavior where stored uint16(0) values should display as empty strings, matching MySQL behavior exactly. Resolves the (unknown) error during SELECT after INSERT IGNORE.
Previously used fragile string matching to detect enum data truncation errors: - if types.IsEnum(col.Type) && strings.Contains(cErr.Error(), "Data truncated for column") Now enum Convert method returns ErrConvertingToEnum directly for invalid 0 values in strict mode, which gets properly enhanced with column name and row number via existing error handling pattern: - else if types.ErrConvertingToEnum.Is(cErr) This eliminates the fragile string-parsing approach while maintaining exact same functionality and MySQL-compatible error messages with proper column names and row numbers. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
- Remove unused isInsertContext function from enum.go - Fix import cycle by removing unnecessary types import from columndefault.go - Restore necessary DDL validation for proper column name error reporting - Maintain all functionality while eliminating fragile string matching patterns All tests pass and MySQL comparison server behavior matches exactly. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
- Add comprehensive test case "enums with zero strict all tables" - Tests single row insert, multi-row insert, and CREATE TABLE default scenarios - Ensures both STRICT_TRANS_TABLES and STRICT_ALL_TABLES modes are covered - Complements existing STRICT_TRANS_TABLES test for complete coverage 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
- Use SqlMode struct instead of manual string parsing in isStrictMode - Leverage LoadSqlMode() and ModeEnabled() methods for proper SQL mode detection - Unskip enum default validation tests that now work with our implementation - Update expected error types to ErrInvalidColumnDefaultValue for enum defaults 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
- Add validateEnumLiteralDefault method for stricter enum default validation
- Reject numeric index references ('1', 1) for literal enum defaults
- Allow only exact enum value matches for literal defaults
- Preserve original ErrInvalidType format in enum expression
- Fixes enums_with_default_values test failures
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <[email protected]>
- Move validateEnumLiteralDefault to resolve_column_defaults.go - Pass actual column name instead of '(unknown)' to match MySQL - MySQL returns 'Invalid default value for 'column_name'' format - Remove enum validation from CheckType to avoid duplicate logic - Verified behavior matches MySQL exactly for both invalid cases 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
…mode dolthub/dolt#9425 - Fix enum zero validation in strict mode
…rver into zachmu/split-queries
Split function-specific engine test queries into their own file
- 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 <[email protected]>
- 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 <[email protected]>
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 <[email protected]>
…mode Fixes dolthub/dolt#9491 Fix enum DEFAULT NULL validation
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.
No description provided.