Skip to content

Commit

Permalink
add TRADITIONAL to sql_mode set (#967)
Browse files Browse the repository at this point in the history
  • Loading branch information
jennifersp authored Apr 22, 2022
1 parent c52a7c7 commit 37bb60e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
10 changes: 10 additions & 0 deletions enginetest/variable_queries.go
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,16 @@ var VariableQueries = []ScriptTest{
{"ALLOW_INVALID_DATES"},
},
},
{
Name: "set sql_mode variable from mysqldump",
SetUpScript: []string{
`SET sql_mode = 'STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_ENGINE_SUBSTITUTION'`,
},
Query: "SELECT @@sql_mode",
Expected: []sql.Row{
{"ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION,NO_ZERO_DATE,NO_ZERO_IN_DATE,STRICT_ALL_TABLES,STRICT_TRANS_TABLES,TRADITIONAL"},
},
},
// User variables
{
Name: "set user var",
Expand Down
2 changes: 1 addition & 1 deletion sql/system_variables.go
Original file line number Diff line number Diff line change
Expand Up @@ -2282,7 +2282,7 @@ var systemVars = map[string]SystemVariable{
Scope: SystemVariableScope_Both,
Dynamic: true,
SetVarHintApplies: true,
Type: NewSystemSetType("sql_mode", "ALLOW_INVALID_DATES", "ANSI_QUOTES", "ERROR_FOR_DIVISION_BY_ZERO", "HIGH_NOT_PRECEDENCE", "IGNORE_SPACE", "NO_AUTO_VALUE_ON_ZERO", "NO_BACKSLASH_ESCAPES", "NO_DIR_IN_CREATE", "NO_ENGINE_SUBSTITUTION", "NO_UNSIGNED_SUBTRACTION", "NO_ZERO_DATE", "NO_ZERO_IN_DATE", "ONLY_FULL_GROUP_BY", "PAD_CHAR_TO_FULL_LENGTH", "PIPES_AS_CONCAT", "REAL_AS_FLOAT", "STRICT_ALL_TABLES", "STRICT_TRANS_TABLES", "TIME_TRUNCATE_FRACTIONAL"),
Type: NewSystemSetType("sql_mode", "ALLOW_INVALID_DATES", "ANSI_QUOTES", "ERROR_FOR_DIVISION_BY_ZERO", "HIGH_NOT_PRECEDENCE", "IGNORE_SPACE", "NO_AUTO_VALUE_ON_ZERO", "NO_BACKSLASH_ESCAPES", "NO_DIR_IN_CREATE", "NO_ENGINE_SUBSTITUTION", "NO_UNSIGNED_SUBTRACTION", "NO_ZERO_DATE", "NO_ZERO_IN_DATE", "ONLY_FULL_GROUP_BY", "PAD_CHAR_TO_FULL_LENGTH", "PIPES_AS_CONCAT", "REAL_AS_FLOAT", "STRICT_ALL_TABLES", "STRICT_TRANS_TABLES", "TIME_TRUNCATE_FRACTIONAL", "TRADITIONAL"),
Default: "STRICT_TRANS_TABLES,NO_ENGINE_SUBSTITUTION",
},
"sql_notes": {
Expand Down

0 comments on commit 37bb60e

Please sign in to comment.