Skip to content

Commit 997b8cb

Browse files
elianddbclaude
andcommitted
Add STRICT_ALL_TABLES query test for enum zero validation
- 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]>
1 parent 5b77261 commit 997b8cb

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

enginetest/queries/script_queries.go

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8719,6 +8719,30 @@ where
87198719
},
87208720
},
87218721
},
8722+
{
8723+
// This tests STRICT_ALL_TABLES mode specifically
8724+
Skip: false,
8725+
Name: "enums with zero strict all tables",
8726+
Dialect: "mysql",
8727+
SetUpScript: []string{
8728+
"SET sql_mode = 'STRICT_ALL_TABLES';",
8729+
"create table t (e enum('a', 'b', 'c'));",
8730+
},
8731+
Assertions: []ScriptTestAssertion{
8732+
{
8733+
Query: "insert into t values (0);",
8734+
ExpectedErrStr: "Data truncated for column 'e' at row 1",
8735+
},
8736+
{
8737+
Query: "insert into t values ('a'), (0), ('b');",
8738+
ExpectedErrStr: "Data truncated for column 'e' at row 2",
8739+
},
8740+
{
8741+
Query: "create table tt (e enum('a', 'b', 'c') default 0)",
8742+
ExpectedErr: sql.ErrInvalidColumnDefaultValue,
8743+
},
8744+
},
8745+
},
87228746
{
87238747
Name: "enums with zero non-strict mode",
87248748
Dialect: "mysql",

0 commit comments

Comments
 (0)