diff options
author | unknown <marko@hundin.mysql.fi> | 2005-04-20 17:39:05 +0300 |
---|---|---|
committer | unknown <marko@hundin.mysql.fi> | 2005-04-20 17:39:05 +0300 |
commit | ea5c2a148a6b704265324a2adcd7ae779a0df0b0 (patch) | |
tree | 385dcdcccffb58642b6b6a5b9d7a9415e6622429 /innobase/row | |
parent | dfa485b47dd768304a5324f619af3da374c6165d (diff) | |
download | mariadb-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 'innobase/row')
-rw-r--r-- | innobase/row/row0mysql.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/innobase/row/row0mysql.c b/innobase/row/row0mysql.c index 7f78a5b723b..a201368f3d5 100644 --- a/innobase/row/row0mysql.c +++ b/innobase/row/row0mysql.c @@ -3880,6 +3880,7 @@ row_scan_and_check_index( int cmp; ibool contains_null; ulint i; + ulint cnt; mem_heap_t* heap = NULL; ulint offsets_[REC_OFFS_NORMAL_SIZE]; ulint* offsets = offsets_; @@ -3902,11 +3903,19 @@ row_scan_and_check_index( dtuple_set_n_fields(prebuilt->search_tuple, 0); prebuilt->select_lock_type = LOCK_NONE; + cnt = 1000; ret = row_search_for_mysql(buf, PAGE_CUR_G, prebuilt, 0, 0); loop: + /* Check thd->killed every 1,000 scanned rows */ + if (--cnt == 0) { + if (trx_is_interrupted(prebuilt->trx)) { + goto func_exit; + } + cnt = 1000; + } if (ret != DB_SUCCESS) { - + func_exit: mem_free(buf); mem_heap_free(heap); @@ -4033,7 +4042,7 @@ row_check_table_for_mysql( ut_print_name(stderr, index->name); putc('\n', stderr); */ - if (!btr_validate_tree(index->tree)) { + if (!btr_validate_tree(index->tree, prebuilt->trx)) { ret = DB_ERROR; } else { if (!row_scan_and_check_index(prebuilt, @@ -4041,6 +4050,10 @@ row_check_table_for_mysql( ret = DB_ERROR; } + if (trx_is_interrupted(prebuilt->trx)) { + break; + } + /* fprintf(stderr, "%lu entries in index %s\n", n_rows, index->name); */ |