From dab35566440637ee4bac538736ef5f6250a7e331 Mon Sep 17 00:00:00 2001 From: James Cor Date: Mon, 25 Nov 2024 16:21:41 -0800 Subject: [PATCH] support no_auto_create_user sql_mode --- enginetest/queries/variable_queries.go | 10 ++++++++++ sql/variables/system_variables.go | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/enginetest/queries/variable_queries.go b/enginetest/queries/variable_queries.go index bbf3a2251c..056771d00b 100644 --- a/enginetest/queries/variable_queries.go +++ b/enginetest/queries/variable_queries.go @@ -328,6 +328,16 @@ var VariableQueries = []ScriptTest{ {"ALLOW_INVALID_DATES"}, }, }, + { + Name: "set system variable to no_auto_create_user, which has been deprecated", + SetUpScript: []string{ + `set sql_mode = NO_AUTO_CREATE_USER`, + }, + Query: "SELECT @@sql_mode", + Expected: []sql.Row{ + {"NO_AUTO_CREATE_USER"}, + }, + }, { Name: "set sql_mode variable from mysqldump", SetUpScript: []string{ diff --git a/sql/variables/system_variables.go b/sql/variables/system_variables.go index 7bd73bf053..724ea39260 100644 --- a/sql/variables/system_variables.go +++ b/sql/variables/system_variables.go @@ -2438,7 +2438,7 @@ var systemVars = map[string]sql.SystemVariable{ Scope: sql.GetMysqlScope(sql.SystemVariableScope_Both), Dynamic: true, SetVarHintApplies: true, - Type: types.NewSystemSetType("sql_mode", sql.Collation_utf8mb4_0900_ai_ci, "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", "ANSI"), + Type: types.NewSystemSetType("sql_mode", sql.Collation_utf8mb4_0900_ai_ci, "ALLOW_INVALID_DATES", "ANSI_QUOTES", "ERROR_FOR_DIVISION_BY_ZERO", "HIGH_NOT_PRECEDENCE", "IGNORE_SPACE", "NO_AUTO_VALUE_ON_ZERO", "NO_AUTO_CREATE_USER", "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", "ANSI"), Default: sql.DefaultSqlMode, }, "sql_notes": &sql.MysqlSystemVariable{