Commit 750b9147 authored by Sergei Golubchik's avatar Sergei Golubchik

remove thd_mark_as_hard_kill()

(because it's conceptually wrong. only the user can decide whether the kill is
allowed to leave tables in the inconsistent state, storage engine has no say in that)
parent a87eab60
...@@ -641,18 +641,6 @@ int mysql_tmpfile(const char *prefix); ...@@ -641,18 +641,6 @@ int mysql_tmpfile(const char *prefix);
*/ */
int thd_killed(const MYSQL_THD thd); int thd_killed(const MYSQL_THD thd);
/**
Increase level of kill ; Ensures that thd_killed() returns true.
@param thd Thread connection handle
@details
Needed if storage engine wants to abort things because of a 'soft' (ie,
safe) kill but still uses thd_killed() to check if it's killed.
**/
void thd_mark_as_hard_kill(MYSQL_THD thd);
/** /**
Return the thread id of a user thread Return the thread id of a user thread
......
...@@ -227,7 +227,6 @@ char *thd_security_context(void* thd, char *buffer, unsigned int length, ...@@ -227,7 +227,6 @@ char *thd_security_context(void* thd, char *buffer, unsigned int length,
void thd_inc_row_count(void* thd); void thd_inc_row_count(void* thd);
int mysql_tmpfile(const char *prefix); int mysql_tmpfile(const char *prefix);
int thd_killed(const void* thd); int thd_killed(const void* thd);
void thd_mark_as_hard_kill(void* thd);
unsigned long thd_get_thread_id(const void* thd); unsigned long thd_get_thread_id(const void* thd);
void thd_get_xid(const void* thd, MYSQL_XID *xid); void thd_get_xid(const void* thd, MYSQL_XID *xid);
void mysql_query_cache_invalidate4(void* thd, void mysql_query_cache_invalidate4(void* thd,
......
...@@ -227,7 +227,6 @@ char *thd_security_context(void* thd, char *buffer, unsigned int length, ...@@ -227,7 +227,6 @@ char *thd_security_context(void* thd, char *buffer, unsigned int length,
void thd_inc_row_count(void* thd); void thd_inc_row_count(void* thd);
int mysql_tmpfile(const char *prefix); int mysql_tmpfile(const char *prefix);
int thd_killed(const void* thd); int thd_killed(const void* thd);
void thd_mark_as_hard_kill(void* thd);
unsigned long thd_get_thread_id(const void* thd); unsigned long thd_get_thread_id(const void* thd);
void thd_get_xid(const void* thd, MYSQL_XID *xid); void thd_get_xid(const void* thd, MYSQL_XID *xid);
void mysql_query_cache_invalidate4(void* thd, void mysql_query_cache_invalidate4(void* thd,
......
...@@ -180,7 +180,6 @@ char *thd_security_context(void* thd, char *buffer, unsigned int length, ...@@ -180,7 +180,6 @@ char *thd_security_context(void* thd, char *buffer, unsigned int length,
void thd_inc_row_count(void* thd); void thd_inc_row_count(void* thd);
int mysql_tmpfile(const char *prefix); int mysql_tmpfile(const char *prefix);
int thd_killed(const void* thd); int thd_killed(const void* thd);
void thd_mark_as_hard_kill(void* thd);
unsigned long thd_get_thread_id(const void* thd); unsigned long thd_get_thread_id(const void* thd);
void thd_get_xid(const void* thd, MYSQL_XID *xid); void thd_get_xid(const void* thd, MYSQL_XID *xid);
void mysql_query_cache_invalidate4(void* thd, void mysql_query_cache_invalidate4(void* thd,
......
...@@ -868,7 +868,6 @@ struct handlerton ...@@ -868,7 +868,6 @@ struct handlerton
Tell handler that query has been killed. Tell handler that query has been killed.
hard_kill is set in case of HARD KILL (abort query even if hard_kill is set in case of HARD KILL (abort query even if
it may corrupt table). it may corrupt table).
Return 1 if the handler wants to upgrade the kill to a hard kill
*/ */
void (*kill_query)(handlerton *hton, THD *thd, my_bool hard_kill); void (*kill_query)(handlerton *hton, THD *thd, my_bool hard_kill);
/* /*
......
...@@ -3853,18 +3853,6 @@ extern "C" int thd_killed(const MYSQL_THD thd) ...@@ -3853,18 +3853,6 @@ extern "C" int thd_killed(const MYSQL_THD thd)
return thd->killed; return thd->killed;
} }
/**
Change kill level to hard.
This ensures that thd_killed() will return true.
This is important for storage engines that uses thd_killed() to
verify if thread is killed.
*/
extern "C" void thd_mark_as_hard_kill(MYSQL_THD thd)
{
thd->mark_as_hard_kill();
}
/** /**
Send an out-of-band progress report to the client Send an out-of-band progress report to the client
......
...@@ -2729,17 +2729,6 @@ public: ...@@ -2729,17 +2729,6 @@ public:
(!transaction.stmt.modified_non_trans_table || (!transaction.stmt.modified_non_trans_table ||
(variables.sql_mode & MODE_STRICT_ALL_TABLES))); (variables.sql_mode & MODE_STRICT_ALL_TABLES)));
} }
/*
Increase level of kill ; Ensures that thd_killed() returns true.
Needed if storage engine wants to abort things because of a 'soft' (ie,
safe) kill but still uses thd_killed() to check if it's killed.
*/
inline void mark_as_hard_kill()
{
DBUG_ASSERT(killed != NOT_KILLED);
killed= (killed_state) (killed | KILL_HARD_BIT);
}
void set_status_var_init(); void set_status_var_init();
void reset_n_backup_open_tables_state(Open_tables_backup *backup); void reset_n_backup_open_tables_state(Open_tables_backup *backup);
void restore_backup_open_tables_state(Open_tables_backup *backup); void restore_backup_open_tables_state(Open_tables_backup *backup);
......
...@@ -3195,7 +3195,7 @@ innobase_kill_query( ...@@ -3195,7 +3195,7 @@ innobase_kill_query(
/* Cancel a pending lock request. */ /* Cancel a pending lock request. */
if (trx && trx->wait_lock) { if (trx && trx->wait_lock) {
thd_mark_as_hard_kill(thd); //trx->killed= 1;
lock_cancel_waiting_and_release(trx->wait_lock); lock_cancel_waiting_and_release(trx->wait_lock);
} }
......
...@@ -3779,7 +3779,7 @@ innobase_kill_query( ...@@ -3779,7 +3779,7 @@ innobase_kill_query(
/* Cancel a pending lock request. */ /* Cancel a pending lock request. */
if (trx && trx->wait_lock) { if (trx && trx->wait_lock) {
thd_mark_as_hard_kill(thd); //trx->killed= 1;
lock_cancel_waiting_and_release(trx->wait_lock); lock_cancel_waiting_and_release(trx->wait_lock);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment