summaryrefslogtreecommitdiff
path: root/include/mysql
diff options
context:
space:
mode:
authorMichael Widenius <monty@askmonty.org>2013-01-11 00:22:14 +0200
committerMichael Widenius <monty@askmonty.org>2013-01-11 00:22:14 +0200
commit6e9a48b67fceab17089ca4cd1406e302386a601b (patch)
tree41cca1d2f6ee3439b6b70e60608430164a8a8843 /include/mysql
parent396f4d62c69335b8f7aefd43bbe099e8bb9e6905 (diff)
downloadmariadb-git-6e9a48b67fceab17089ca4cd1406e302386a601b.tar.gz
Fixed some race conditons and bugs related to killed queries
KILL now breaks locks inside InnoDB Fixed possible deadlock when running INNODB STATUS Added ha_kill_query() and kill_query() to send kill signal to all storage engines Added reset_killed() to ensure we don't reset killed state while awake() is getting called include/mysql/plugin.h: Added thd_mark_as_hard_kill() include/mysql/plugin_audit.h.pp: Added thd_mark_as_hard_kill() include/mysql/plugin_auth.h.pp: Added thd_mark_as_hard_kill() include/mysql/plugin_ftparser.h.pp: Added thd_mark_as_hard_kill() sql/handler.cc: Added ha_kill_query() to send kill signal to all storage engines sql/handler.h: Added ha_kill_query() and kill_query() to send kill signal to all storage engines sql/log_event.cc: Use reset_killed() sql/mdl.cc: use thd->killed instead of thd_killed() to abort on soft kill sql/sp_rcontext.cc: Use reset_killed() sql/sql_class.cc: Fixed possible deadlock in INNODB STATUS by not getting thd->LOCK_thd_data if it's locked. Use reset_killed() Tell storge engines that KILL has been sent sql/sql_class.h: Added reset_killed() to ensure we don't reset killed state while awake() is getting called. Added mark_as_hard_kill() sql/sql_insert.cc: Use reset_killed() sql/sql_parse.cc: Simplify detection of killed queries. Use reset_killed() sql/sql_select.cc: Use reset_killed() sql/sql_union.cc: Use reset_killed() storage/innobase/handler/ha_innodb.cc: Added innobase_kill_query() Fixed error reporting for interrupted queries. storage/xtradb/handler/ha_innodb.cc: Added innobase_kill_query() Fixed error reporting for interrupted queries.
Diffstat (limited to 'include/mysql')
-rw-r--r--include/mysql/plugin.h11
-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
4 files changed, 14 insertions, 0 deletions
diff --git a/include/mysql/plugin.h b/include/mysql/plugin.h
index b73f2d75193..7617f5968d9 100644
--- a/include/mysql/plugin.h
+++ b/include/mysql/plugin.h
@@ -641,6 +641,17 @@ 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
diff --git a/include/mysql/plugin_audit.h.pp b/include/mysql/plugin_audit.h.pp
index b987f690592..ea3447762ca 100644
--- a/include/mysql/plugin_audit.h.pp
+++ b/include/mysql/plugin_audit.h.pp
@@ -227,6 +227,7 @@ 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 113aaf62d19..45999056435 100644
--- a/include/mysql/plugin_auth.h.pp
+++ b/include/mysql/plugin_auth.h.pp
@@ -227,6 +227,7 @@ 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 6011e7f7519..84299c77d9b 100644
--- a/include/mysql/plugin_ftparser.h.pp
+++ b/include/mysql/plugin_ftparser.h.pp
@@ -180,6 +180,7 @@ 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,