diff options
Diffstat (limited to 'sql/sql_parse.cc')
-rw-r--r-- | sql/sql_parse.cc | 28 |
1 files changed, 7 insertions, 21 deletions
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 5c02bf43351..4fdae7f3534 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -7305,7 +7305,6 @@ bool check_fk_parent_table_access(THD *thd, if (key->type == Key::FOREIGN_KEY) { TABLE_LIST parent_table; - bool is_qualified_table_name; Foreign_key *fk_key= (Foreign_key *)key; LEX_CSTRING db_name; LEX_CSTRING table_name= { fk_key->ref_table.str, @@ -7322,7 +7321,6 @@ bool check_fk_parent_table_access(THD *thd, if (fk_key->ref_db.str) { - is_qualified_table_name= true; if (!(db_name.str= (char *) thd->memdup(fk_key->ref_db.str, fk_key->ref_db.length+1))) return true; @@ -7344,7 +7342,6 @@ bool check_fk_parent_table_access(THD *thd, if (!(db_name.str= (char *) thd->memdup(create_db, db_name.length+1))) return true; - is_qualified_table_name= true; if (check_db_name((LEX_STRING*) &db_name)) { @@ -7356,8 +7353,6 @@ bool check_fk_parent_table_access(THD *thd, { if (thd->lex->copy_db_to(&db_name)) return true; - else - is_qualified_table_name= false; } } @@ -7383,22 +7378,11 @@ bool check_fk_parent_table_access(THD *thd, if (check_some_access(thd, privileges, &parent_table) || parent_table.grant.want_privilege) { - if (is_qualified_table_name) - { - const size_t qualified_table_name_len= NAME_LEN + 1 + NAME_LEN + 1; - char *qualified_table_name= (char *) thd->alloc(qualified_table_name_len); - - my_snprintf(qualified_table_name, qualified_table_name_len, "%s.%s", - db_name.str, table_name.str); - table_name.str= qualified_table_name; - } - my_error(ER_TABLEACCESS_DENIED_ERROR, MYF(0), - "REFERENCES", - thd->security_ctx->priv_user, - thd->security_ctx->host_or_ip, - table_name.str); - + "REFERENCES", + thd->security_ctx->priv_user, + thd->security_ctx->host_or_ip, + db_name.str, table_name.str); return true; } } @@ -7878,6 +7862,7 @@ static bool wsrep_mysql_parse(THD *thd, char *rawbuf, uint length, thd->lex->sql_command != SQLCOM_SELECT && thd->wsrep_retry_counter < thd->variables.wsrep_retry_autocommit) { +#ifdef ENABLED_DEBUG_SYNC DBUG_EXECUTE_IF("sync.wsrep_retry_autocommit", { const char act[]= @@ -7886,6 +7871,7 @@ static bool wsrep_mysql_parse(THD *thd, char *rawbuf, uint length, "WAIT_FOR wsrep_retry_autocommit_continue"; DBUG_ASSERT(!debug_sync_set_action(thd, STRING_WITH_LEN(act))); }); +#endif WSREP_DEBUG("wsrep retrying AC query: %lu %s", thd->wsrep_retry_counter, wsrep_thd_query(thd)); @@ -9206,7 +9192,7 @@ kill_one_thread(THD *thd, longlong id, killed_state kill_signal, killed_type typ tmp= find_thread_by_id(id, type == KILL_TYPE_QUERY); if (!tmp) DBUG_RETURN(error); - + DEBUG_SYNC(thd, "found_killee"); if (tmp->get_command() != COM_DAEMON) { /* |