summaryrefslogtreecommitdiff
path: root/innobase/row
diff options
context:
space:
mode:
authormarko@hundin.mysql.fi <>2005-04-20 17:39:05 +0300
committermarko@hundin.mysql.fi <>2005-04-20 17:39:05 +0300
commitdf780de61448a4af22abcf4e1c6ddcf9f2d93c41 (patch)
tree385dcdcccffb58642b6b6a5b9d7a9415e6622429 /innobase/row
parente360eaed5e5f0163238ba1473b304c633ea112fc (diff)
downloadmariadb-git-df780de61448a4af22abcf4e1c6ddcf9f2d93c41.tar.gz
InnoDB: Make CHECK TABLE killable. (Bug #9730)
Diffstat (limited to 'innobase/row')
-rw-r--r--innobase/row/row0mysql.c17
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); */