summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergei Golubchik <sergii@pisem.net>2013-01-15 17:46:46 +0100
committerSergei Golubchik <sergii@pisem.net>2013-01-15 17:46:46 +0100
commit750b9147fced7202b541be946e044eb739b20a03 (patch)
treecb378c2d311993254aec75d4d81a5f32a2dcb71d
parenta87eab6061068491ec9004ae54c46630619cb531 (diff)
downloadmariadb-git-750b9147fced7202b541be946e044eb739b20a03.tar.gz
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)
-rw-r--r--include/mysql/plugin.h12
-rw-r--r--include/mysql/plugin_audit.h.pp1
-rw-r--r--include/mysql/plugin_auth.h.pp1
-rw-r--r--include/mysql/plugin_ftparser.h.pp1
-rw-r--r--sql/handler.h1
-rw-r--r--sql/sql_class.cc12
-rw-r--r--sql/sql_class.h11
-rw-r--r--storage/innobase/handler/ha_innodb.cc2
-rw-r--r--storage/xtradb/handler/ha_innodb.cc2
9 files changed, 2 insertions, 41 deletions
diff --git a/include/mysql/plugin.h b/include/mysql/plugin.h
index 7617f5968d9..d30abb190d0 100644
--- a/include/mysql/plugin.h
+++ b/include/mysql/plugin.h
@@ -642,18 +642,6 @@ int mysql_tmpfile(const char *prefix);
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
@param thd user thread connection handle
diff --git a/include/mysql/plugin_audit.h.pp b/include/mysql/plugin_audit.h.pp
index ea3447762ca..b987f690592 100644
--- a/include/mysql/plugin_audit.h.pp
+++ b/include/mysql/plugin_audit.h.pp
@@ -227,7 +227,6 @@ char *thd_security_context(void* thd, char *buffer, unsigned int length,
void thd_inc_row_count(void* thd);
int mysql_tmpfile(const char *prefix);
int thd_killed(const void* thd);
-void thd_mark_as_hard_kill(void* thd);
unsigned long thd_get_thread_id(const void* thd);
void thd_get_xid(const void* thd, MYSQL_XID *xid);
void mysql_query_cache_invalidate4(void* thd,
diff --git a/include/mysql/plugin_auth.h.pp b/include/mysql/plugin_auth.h.pp
index 45999056435..113aaf62d19 100644
--- a/include/mysql/plugin_auth.h.pp
+++ b/include/mysql/plugin_auth.h.pp
@@ -227,7 +227,6 @@ char *thd_security_context(void* thd, char *buffer, unsigned int length,
void thd_inc_row_count(void* thd);
int mysql_tmpfile(const char *prefix);
int thd_killed(const void* thd);
-void thd_mark_as_hard_kill(void* thd);
unsigned long thd_get_thread_id(const void* thd);
void thd_get_xid(const void* thd, MYSQL_XID *xid);
void mysql_query_cache_invalidate4(void* thd,
diff --git a/include/mysql/plugin_ftparser.h.pp b/include/mysql/plugin_ftparser.h.pp
index 84299c77d9b..6011e7f7519 100644
--- a/include/mysql/plugin_ftparser.h.pp
+++ b/include/mysql/plugin_ftparser.h.pp
@@ -180,7 +180,6 @@ char *thd_security_context(void* thd, char *buffer, unsigned int length,
void thd_inc_row_count(void* thd);
int mysql_tmpfile(const char *prefix);
int thd_killed(const void* thd);
-void thd_mark_as_hard_kill(void* thd);
unsigned long thd_get_thread_id(const void* thd);
void thd_get_xid(const void* thd, MYSQL_XID *xid);
void mysql_query_cache_invalidate4(void* thd,
diff --git a/sql/handler.h b/sql/handler.h
index e5da92b0d40..af5d7e6d606 100644
--- a/sql/handler.h
+++ b/sql/handler.h
@@ -868,7 +868,6 @@ struct handlerton
Tell handler that query has been killed.
hard_kill is set in case of HARD KILL (abort query even if
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);
/*
diff --git a/sql/sql_class.cc b/sql/sql_class.cc
index 312de8c74e4..616e827a552 100644
--- a/sql/sql_class.cc
+++ b/sql/sql_class.cc
@@ -3853,18 +3853,6 @@ extern "C" int thd_killed(const MYSQL_THD thd)
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
diff --git a/sql/sql_class.h b/sql/sql_class.h
index 2561effb478..f1b3652c15c 100644
--- a/sql/sql_class.h
+++ b/sql/sql_class.h
@@ -2729,17 +2729,6 @@ public:
(!transaction.stmt.modified_non_trans_table ||
(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 reset_n_backup_open_tables_state(Open_tables_backup *backup);
void restore_backup_open_tables_state(Open_tables_backup *backup);
diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc
index 826662b52c6..4553df05550 100644
--- a/storage/innobase/handler/ha_innodb.cc
+++ b/storage/innobase/handler/ha_innodb.cc
@@ -3195,7 +3195,7 @@ innobase_kill_query(
/* Cancel a pending lock request. */
if (trx && trx->wait_lock) {
- thd_mark_as_hard_kill(thd);
+ //trx->killed= 1;
lock_cancel_waiting_and_release(trx->wait_lock);
}
diff --git a/storage/xtradb/handler/ha_innodb.cc b/storage/xtradb/handler/ha_innodb.cc
index ba07b414c65..a9f754c23cf 100644
--- a/storage/xtradb/handler/ha_innodb.cc
+++ b/storage/xtradb/handler/ha_innodb.cc
@@ -3779,7 +3779,7 @@ innobase_kill_query(
/* Cancel a pending lock request. */
if (trx && trx->wait_lock) {
- thd_mark_as_hard_kill(thd);
+ //trx->killed= 1;
lock_cancel_waiting_and_release(trx->wait_lock);
}