Skip to content

Commit 33d7e60

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 bb88881 commit 33d7e60

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
@@ -7532,15 +7532,15 @@ where
75327532
Assertions: []ScriptTestAssertion{
75337533
{
75347534
Query: "insert into t(c) values (X'9876543210');",
7535-
ExpectedErrStr: "invalid string for charset utf8mb4: '[152 118 84 50 16]'",
7535+
ExpectedErrStr: "Incorrect string value: '\\x98' for column 'c' at row 1",
75367536
},
75377537
{
75387538
Query: "insert into t(v) values (X'9876543210');",
7539-
ExpectedErrStr: "invalid string for charset utf8mb4: '[152 118 84 50 16]'",
7539+
ExpectedErrStr: "Incorrect string value: '\\x98' for column 'v' at row 1",
75407540
},
75417541
{
75427542
Query: "insert into t(txt) values (X'9876543210');",
7543-
ExpectedErrStr: "invalid string for charset utf8mb4: '[152 118 84 50 16]'",
7543+
ExpectedErrStr: "Incorrect string value: '\\x98' for column 'txt' at row 1",
75447544
},
75457545
{
75467546
Query: "insert into t(b) values (X'9876543210');",

0 commit comments

Comments
 (0)