summaryrefslogtreecommitdiff
path: root/sql/ha_innodb.cc
diff options
context:
space:
mode:
authorunknown <marko@hundin.mysql.fi>2005-04-20 17:39:05 +0300
committerunknown <marko@hundin.mysql.fi>2005-04-20 17:39:05 +0300
commitea5c2a148a6b704265324a2adcd7ae779a0df0b0 (patch)
tree385dcdcccffb58642b6b6a5b9d7a9415e6622429 /sql/ha_innodb.cc
parentdfa485b47dd768304a5324f619af3da374c6165d (diff)
downloadmariadb-git-ea5c2a148a6b704265324a2adcd7ae779a0df0b0.tar.gz
InnoDB: Make CHECK TABLE killable. (Bug #9730)
innobase/btr/btr0btr.c: Enclose btr_print_size() and btr_print_tree() in #ifdef UNIV_BTR_PRINT Add trx_t* parameter to btr_validate_tree() and btr_validate_level(). btr_validate_level(): Call trx_is_interrupted() on each page. innobase/ibuf/ibuf0ibuf.c: Add trx_t* parameter to btr_validate_tree(). innobase/include/btr0btr.h: Enclose btr_print_size() and btr_print_tree() in #ifdef UNIV_BTR_PRINT Add trx_t* parameter to btr_validate_tree(). innobase/include/trx0trx.h: Declare trx_is_interrupted(). innobase/row/row0mysql.c: row_scan_and_check_index(): Check trx_is_interrupted() every 1,000 scanned rows. row_check_table_for_mysql(): Check trx_is_interrupted() for each index after btr_validate_tree(). sql/ha_innodb.cc: Define trx_is_interrupted().
Diffstat (limited to 'sql/ha_innodb.cc')
-rw-r--r--sql/ha_innodb.cc17
1 files changed, 17 insertions, 0 deletions
diff --git a/sql/ha_innodb.cc b/sql/ha_innodb.cc
index a26c706bb08..4834dd24fa8 100644
--- a/sql/ha_innodb.cc
+++ b/sql/ha_innodb.cc
@@ -997,6 +997,23 @@ mysql_get_identifier_quote_char(
}
/**************************************************************************
+Determines if the currently running transaction has been interrupted. */
+extern "C"
+ibool
+trx_is_interrupted(
+/*===============*/
+ /* out: TRUE if interrupted */
+ trx_t* trx) /* in: transaction */
+{
+ fprintf(stderr,
+ "trx_is_interrupted: %p %p %d\n",
+ trx, trx ? trx->mysql_thd : 0,
+ trx && trx->mysql_thd ? ((THD*) trx->mysql_thd)->killed : -1);
+
+ return(trx && trx->mysql_thd && ((THD*) trx->mysql_thd)->killed);
+}
+
+/**************************************************************************
Obtain a pointer to the MySQL THD object, as in current_thd(). This
definition must match the one in sql/ha_innodb.cc! */
extern "C"