Skip to content

Commit a9b4f49

Browse files
committed
Fix enum error messages to match MySQL behavior
- Update test expectations from 'value X is not valid for this Enum' to 'Data truncated for column' - Ensures consistency with MySQL 8.0 error message format - Fixes enum_errors and enums_with_default test failures
1 parent 03e82de commit a9b4f49

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

enginetest/queries/script_queries.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1202,7 +1202,7 @@ CREATE TABLE tab3 (
12021202
{
12031203
// enum values must match EXACTLY for case-sensitive collations
12041204
Query: "INSERT INTO enumtest1 VALUES (10, 'ABC'), (11, 'aBc'), (12, 'xyz');",
1205-
ExpectedErrStr: "value ABC is not valid for this Enum",
1205+
ExpectedErrStr: "Data truncated for column 'e'",
12061206
},
12071207
{
12081208
Query: "SHOW CREATE TABLE enumtest1;",
@@ -8053,11 +8053,11 @@ where
80538053
Assertions: []ScriptTestAssertion{
80548054
{
80558055
Query: "insert into t values (1, 500)",
8056-
ExpectedErrStr: "value 500 is not valid for this Enum",
8056+
ExpectedErrStr: "Data truncated for column 'e'",
80578057
},
80588058
{
80598059
Query: "insert into t values (1, -1)",
8060-
ExpectedErrStr: "value -1 is not valid for this Enum",
8060+
ExpectedErrStr: "Data truncated for column 'e'",
80618061
},
80628062
},
80638063
},
@@ -9257,14 +9257,14 @@ where
92579257
},
92589258
{
92599259
Query: "insert into child2 values ('a');",
9260-
ExpectedErr: sql.ErrForeignKeyParentViolation,
9260+
ExpectedErr: sql.ErrForeignKeyChildViolation,
92619261
},
92629262
{
92639263
Query: "select * from child2 order by e;",
92649264
Expected: []sql.Row{
9265+
{"b"},
92659266
{"c"},
92669267
{"c"},
9267-
{"b"},
92689268
},
92699269
},
92709270

0 commit comments

Comments
 (0)