Skip to content

Commit eee6d47

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 2d4c196 commit eee6d47

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
@@ -9061,6 +9061,30 @@ where
90619061
},
90629062
},
90639063
},
9064+
{
9065+
// This tests STRICT_ALL_TABLES mode specifically
9066+
Skip: false,
9067+
Name: "enums with zero strict all tables",
9068+
Dialect: "mysql",
9069+
SetUpScript: []string{
9070+
"SET sql_mode = 'STRICT_ALL_TABLES';",
9071+
"create table t (e enum('a', 'b', 'c'));",
9072+
},
9073+
Assertions: []ScriptTestAssertion{
9074+
{
9075+
Query: "insert into t values (0);",
9076+
ExpectedErrStr: "Data truncated for column 'e' at row 1",
9077+
},
9078+
{
9079+
Query: "insert into t values ('a'), (0), ('b');",
9080+
ExpectedErrStr: "Data truncated for column 'e' at row 2",
9081+
},
9082+
{
9083+
Query: "create table tt (e enum('a', 'b', 'c') default 0)",
9084+
ExpectedErr: sql.ErrInvalidColumnDefaultValue,
9085+
},
9086+
},
9087+
},
90649088
{
90659089
Name: "enums with zero non-strict mode",
90669090
Dialect: "mysql",

0 commit comments

Comments
 (0)