diff --git a/storage/ctc/ctc_ddl_rewriter_plugin.cc b/storage/ctc/ctc_ddl_rewriter_plugin.cc index e211c5af89c9566565d3e8c76afe7f7b62674185..f15dfca082f75714b8fbb622481845cb9886d32f 100644 --- a/storage/ctc/ctc_ddl_rewriter_plugin.cc +++ b/storage/ctc/ctc_ddl_rewriter_plugin.cc @@ -662,11 +662,6 @@ static int check_system_var(set_var_base *var, string &sql_str, MYSQL_THD thd, ret |= ctc_check_set_opt_rule(setvar, name_str, val_str, need_forward); } } - if (val_str.c_str() == nullptr) { - my_printf_error(ER_DISALLOWED_OPERATION, "Set the variable '%s' failed: value is invalid", - MYF(0), name_str.c_str()); - return -1; - } if (strlen(val_str.c_str()) > CTC_MAX_VAR_VALUE_LEN) { my_printf_error(ER_DISALLOWED_OPERATION, "Set the variable '%s' failed: value is too long", MYF(0), name_str.c_str()); @@ -735,7 +730,7 @@ static int ctc_check_set_opt(string &sql_str, MYSQL_THD thd, bool &need_forward) ret = ctc_set_var_meta(thd, variables_info, &set_opt_request); if (ret != 0 && set_opt_request.err_code != 0) { string err_msg = set_opt_request.err_msg; - my_printf_error(set_opt_request.err_code, "execute set opt failed, error_message:%s", MYF(0), err_msg.c_str()); + my_printf_error(set_opt_request.err_code, "%s", MYF(0), err_msg.c_str()); return ret; } } diff --git a/storage/ctc/ctc_meta_data.cc b/storage/ctc/ctc_meta_data.cc index a76dde0ffa83bbbaac4bdf65fe5ee7557cde88fe..e61308a29b34b6991bc0dc69bb9039adb9ca64d5 100644 --- a/storage/ctc/ctc_meta_data.cc +++ b/storage/ctc/ctc_meta_data.cc @@ -776,7 +776,6 @@ int close_ctc_mdl_thd(uint32_t thd_id, uint32_t mysql_inst_id) { static void ctc_get_set_var_item(THD* new_thd, sys_var* sysvar, Item** res MY_ATTRIBUTE((unused)), const char* var_value, bool is_null_value, bool var_is_int) { - string val_str = string(var_value, strlen(var_value)); switch (sysvar->show_type()) { case SHOW_INT: case SHOW_LONG: @@ -795,7 +794,7 @@ static void ctc_get_set_var_item(THD* new_thd, sys_var* sysvar, Item** res MY_AT break; case SHOW_BOOL: case SHOW_MY_BOOL: - if(val_str == "1" || val_str == "0") { + if(strcmp(var_value, "1") == 0 || strcmp(var_value, "0") == 0) { *res = new (new_thd->mem_root) Item_int(var_value, (uint)strlen(var_value)); } else { @@ -967,7 +966,6 @@ int ctc_set_sys_var(ctc_set_opt_request *broadcast_req) { lex_end(new_thd->lex); new_thd->release_resources(); delete new_thd; - my_thread_end(); return ret;