Skip to content

Commit 7d60064

Browse files
elianddbclaude
andcommitted
Update charset validation tests to match MySQL error format
- Updated script_queries.go to expect MySQL-compatible error messages - Updated enginetests.go prepared statement tests to expect MySQL-compatible format - Changed from: "invalid string for charset utf8mb4: '[152 118 84 50 16]'" - Changed to: "Incorrect string value: '\x98' for column 'c' at row 1" - Tests now expect the correct MySQL error format as implemented in fix for #8893 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent ecfde20 commit 7d60064

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

enginetest/enginetests.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4501,14 +4501,14 @@ func TestPreparedInsert(t *testing.T, harness Harness) {
45014501
Bindings: map[string]sqlparser.Expr{
45024502
"v1": mustBuildBindVariable([]byte{0x99, 0x98, 0x97}),
45034503
},
4504-
ExpectedErrStr: "invalid string for charset utf8mb4: '[153 152 151]'",
4504+
ExpectedErrStr: "Incorrect string value: '\\x99' for column 'v1' at row 1",
45054505
},
45064506
{
45074507
Query: "INSERT INTO test VALUES (?);",
45084508
Bindings: map[string]sqlparser.Expr{
45094509
"v1": mustBuildBindVariable(string([]byte{0x99, 0x98, 0x97})),
45104510
},
4511-
ExpectedErrStr: "invalid string for charset utf8mb4: '[153 152 151]'",
4511+
ExpectedErrStr: "Incorrect string value: '\\x99' for column 'v1' at row 1",
45124512
},
45134513
{
45144514
Query: "INSERT INTO test2 VALUES (?);",

enginetest/queries/script_queries.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7140,15 +7140,15 @@ where
71407140
Assertions: []ScriptTestAssertion{
71417141
{
71427142
Query: "insert into t(c) values (X'9876543210');",
7143-
ExpectedErrStr: "invalid string for charset utf8mb4: '[152 118 84 50 16]'",
7143+
ExpectedErrStr: "Incorrect string value: '\\x98' for column 'c' at row 1",
71447144
},
71457145
{
71467146
Query: "insert into t(v) values (X'9876543210');",
7147-
ExpectedErrStr: "invalid string for charset utf8mb4: '[152 118 84 50 16]'",
7147+
ExpectedErrStr: "Incorrect string value: '\\x98' for column 'v' at row 1",
71487148
},
71497149
{
71507150
Query: "insert into t(txt) values (X'9876543210');",
7151-
ExpectedErrStr: "invalid string for charset utf8mb4: '[152 118 84 50 16]'",
7151+
ExpectedErrStr: "Incorrect string value: '\\x98' for column 'txt' at row 1",
71527152
},
71537153
{
71547154
Query: "insert into t(b) values (X'9876543210');",

0 commit comments

Comments
 (0)