From 4100c25d0a4a0ae039222728cc51957313e46841 Mon Sep 17 00:00:00 2001 From: jingtaoye35 <1255153887@qq.com> Date: Mon, 23 Oct 2023 03:13:59 +0000 Subject: [PATCH] set sql_mode default value has NO_AUTO_CREATE_USER --- src/share/system_variable/ob_system_variable_init.cpp | 2 +- src/share/system_variable/ob_system_variable_init.json | 2 +- src/sql/resolver/dcl/ob_grant_resolver.cpp | 6 ++---- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/share/system_variable/ob_system_variable_init.cpp b/src/share/system_variable/ob_system_variable_init.cpp index cd44083968..b19079db09 100644 --- a/src/share/system_variable/ob_system_variable_init.cpp +++ b/src/share/system_variable/ob_system_variable_init.cpp @@ -291,7 +291,7 @@ static struct VarsInit{ }(); [&] (){ - ObSysVars[15].default_value_ = "12582912" ; + ObSysVars[15].default_value_ = "281018368" ; ObSysVars[15].on_update_func_ = "ObSysVarOnUpdateFuncs::update_sql_mode" ; ObSysVars[15].name_ = "sql_mode" ; ObSysVars[15].data_type_ = ObUInt64Type ; diff --git a/src/share/system_variable/ob_system_variable_init.json b/src/share/system_variable/ob_system_variable_init.json index e83d4f6a74..5b429ee3dc 100644 --- a/src/share/system_variable/ob_system_variable_init.json +++ b/src/share/system_variable/ob_system_variable_init.json @@ -254,7 +254,7 @@ "sql_mode": { "id": 15, "name": "sql_mode", - "default_value": "12582912", + "default_value": "281018368", "base_value": "12582912", "data_type": "uint", "on_update_func": "ObSysVarOnUpdateFuncs::update_sql_mode", diff --git a/src/sql/resolver/dcl/ob_grant_resolver.cpp b/src/sql/resolver/dcl/ob_grant_resolver.cpp index b706b8b5ff..d7981f3785 100644 --- a/src/sql/resolver/dcl/ob_grant_resolver.cpp +++ b/src/sql/resolver/dcl/ob_grant_resolver.cpp @@ -1057,8 +1057,7 @@ int ObGrantResolver::resolve_grant_obj_privileges( bool is_all_role = true; CHECK_COMPATIBILITY_MODE(session_info_); if (!lib::is_oracle_mode()) { - need_create_user = (0 == (params_.session_info_->get_sql_mode() - & SMO_NO_AUTO_CREATE_USER)); + need_create_user = !is_no_auto_create_user(params_.session_info_->get_sql_mode()); } grant_stmt->set_need_create_user(need_create_user); if (users_node->num_child_ > 0) { @@ -1323,8 +1322,7 @@ int ObGrantResolver::resolve_mysql(const ParseNode &parse_tree) bool need_create_user = false; CHECK_COMPATIBILITY_MODE(session_info_); if (!lib::is_oracle_mode()) { - need_create_user = (0 == (params_.session_info_->get_sql_mode() - & SMO_NO_AUTO_CREATE_USER)); + need_create_user = !is_no_auto_create_user(params_.session_info_->get_sql_mode()); } grant_stmt->set_need_create_user(need_create_user); if (users_node->num_child_ > 0) {