Commit d298c22
Eliminate fragile string-matching enum error enhancement
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]>1 parent 4c748ec commit d298c22
2 files changed
+1
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
21 | 20 | | |
22 | 21 | | |
23 | 22 | | |
| |||
118 | 117 | | |
119 | 118 | | |
120 | 119 | | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | 120 | | |
126 | 121 | | |
127 | 122 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
168 | 168 | | |
169 | 169 | | |
170 | 170 | | |
171 | | - | |
| 171 | + | |
172 | 172 | | |
173 | 173 | | |
174 | 174 | | |
| |||
0 commit comments