summaryrefslogtreecommitdiff
path: root/storage/tokudb
diff options
context:
space:
mode:
authorRich Prohaska <prohaska@tokutek.com>2014-10-03 15:41:54 -0400
committerRich Prohaska <prohaska@tokutek.com>2014-10-03 15:41:54 -0400
commit768b13d5c1c1df29a1bbeddd7de5a95cb3b2b91e (patch)
tree20a614f2eb9a0409a4c6e1e1198c2c9e651695f3 /storage/tokudb
parentdcda78e71f5c46e4891b1f91ba060e377e3f99c7 (diff)
downloadmariadb-git-768b13d5c1c1df29a1bbeddd7de5a95cb3b2b91e.tar.gz
DB-735 use thd_killed
Diffstat (limited to 'storage/tokudb')
-rw-r--r--storage/tokudb/ha_tokudb.cc12
-rw-r--r--storage/tokudb/ha_tokudb_admin.cc6
-rw-r--r--storage/tokudb/hatoku_hton.cc12
-rw-r--r--storage/tokudb/hatoku_hton.h4
4 files changed, 17 insertions, 17 deletions
diff --git a/storage/tokudb/ha_tokudb.cc b/storage/tokudb/ha_tokudb.cc
index d472f1259e0..d9b11dbba3e 100644
--- a/storage/tokudb/ha_tokudb.cc
+++ b/storage/tokudb/ha_tokudb.cc
@@ -471,7 +471,7 @@ typedef struct index_read_info {
static int ai_poll_fun(void *extra, float progress) {
LOADER_CONTEXT context = (LOADER_CONTEXT)extra;
- if (context->thd->killed) {
+ if (thd_killed(context->thd)) {
sprintf(context->write_status_msg, "The process has been killed, aborting add index.");
return ER_ABORTING_CONNECTION;
}
@@ -486,7 +486,7 @@ static int ai_poll_fun(void *extra, float progress) {
static int loader_poll_fun(void *extra, float progress) {
LOADER_CONTEXT context = (LOADER_CONTEXT)extra;
- if (context->thd->killed) {
+ if (thd_killed(context->thd)) {
sprintf(context->write_status_msg, "The process has been killed, aborting bulk load.");
return ER_ABORTING_CONNECTION;
}
@@ -3316,7 +3316,7 @@ int ha_tokudb::end_bulk_insert(bool abort) {
ai_metadata_update_required = false;
loader_error = 0;
if (loader) {
- if (!abort_loader && !thd->killed) {
+ if (!abort_loader && !thd_killed(thd)) {
DBUG_EXECUTE_IF("tokudb_end_bulk_insert_sleep", {
const char *orig_proc_info = tokudb_thd_get_proc_info(thd);
thd_proc_info(thd, "DBUG sleep");
@@ -3326,7 +3326,7 @@ int ha_tokudb::end_bulk_insert(bool abort) {
error = loader->close(loader);
loader = NULL;
if (error) {
- if (thd->killed) {
+ if (thd_killed(thd)) {
my_error(ER_QUERY_INTERRUPTED, MYF(0));
}
goto cleanup;
@@ -3461,7 +3461,7 @@ int ha_tokudb::is_index_unique(bool* is_unique, DB_TXN* txn, DB* db, KEY* key_in
share->rows,
key_info->name);
thd_proc_info(thd, status_msg);
- if (thd->killed) {
+ if (thd_killed(thd)) {
my_error(ER_QUERY_INTERRUPTED, MYF(0));
error = ER_QUERY_INTERRUPTED;
goto cleanup;
@@ -7712,7 +7712,7 @@ int ha_tokudb::tokudb_add_index(
thd_progress_report(thd, num_processed, (long long unsigned) share->rows);
#endif
- if (thd->killed) {
+ if (thd_killed(thd)) {
error = ER_ABORTING_CONNECTION;
goto cleanup;
}
diff --git a/storage/tokudb/ha_tokudb_admin.cc b/storage/tokudb/ha_tokudb_admin.cc
index 100c88a76a8..8fe17e1dfca 100644
--- a/storage/tokudb/ha_tokudb_admin.cc
+++ b/storage/tokudb/ha_tokudb_admin.cc
@@ -102,7 +102,7 @@ struct analyze_progress_extra {
static int analyze_progress(void *v_extra, uint64_t rows) {
struct analyze_progress_extra *extra = (struct analyze_progress_extra *) v_extra;
THD *thd = extra->thd;
- if (thd->killed)
+ if (thd_killed(thd))
return ER_ABORTING_CONNECTION;
time_t t_now = time(0);
@@ -190,7 +190,7 @@ typedef struct hot_optimize_context {
static int hot_poll_fun(void *extra, float progress) {
HOT_OPTIMIZE_CONTEXT context = (HOT_OPTIMIZE_CONTEXT)extra;
- if (context->thd->killed) {
+ if (thd_killed(context->thd)) {
sprintf(context->write_status_msg, "The process has been killed, aborting hot optimize.");
return ER_ABORTING_CONNECTION;
}
@@ -271,7 +271,7 @@ struct check_context {
static int ha_tokudb_check_progress(void *extra, float progress) {
struct check_context *context = (struct check_context *) extra;
int result = 0;
- if (context->thd->killed)
+ if (thd_killed(context->thd))
result = ER_ABORTING_CONNECTION;
return result;
}
diff --git a/storage/tokudb/hatoku_hton.cc b/storage/tokudb/hatoku_hton.cc
index 3c5d7f73357..2d4653fdf4b 100644
--- a/storage/tokudb/hatoku_hton.cc
+++ b/storage/tokudb/hatoku_hton.cc
@@ -1522,7 +1522,7 @@ static int tokudb_file_map(TABLE *table, THD *thd) {
error = schema_table_store_record(thd, table);
}
- if (!error && thd->killed)
+ if (!error && thd_killed(thd))
error = ER_QUERY_INTERRUPTED;
}
if (error == DB_NOTFOUND) {
@@ -1669,7 +1669,7 @@ static int tokudb_fractal_tree_info(TABLE *table, THD *thd) {
if (!error) {
error = tokudb_report_fractal_tree_info_for_db(&curr_key, &curr_val, table, thd);
}
- if (!error && thd->killed)
+ if (!error && thd_killed(thd))
error = ER_QUERY_INTERRUPTED;
}
if (error == DB_NOTFOUND) {
@@ -1884,7 +1884,7 @@ static int tokudb_fractal_tree_block_map(TABLE *table, THD *thd) {
if (!error) {
error = tokudb_report_fractal_tree_block_map_for_db(&curr_key, &curr_val, table, thd);
}
- if (!error && thd->killed)
+ if (!error && thd_killed(thd))
error = ER_QUERY_INTERRUPTED;
}
if (error == DB_NOTFOUND) {
@@ -2054,7 +2054,7 @@ static int tokudb_trx_callback(uint64_t txn_id, uint64_t client_id, iterate_row_
table->field[0]->store(txn_id, false);
table->field[1]->store(client_id, false);
int error = schema_table_store_record(thd, table);
- if (!error && thd->killed)
+ if (!error && thd_killed(thd))
error = ER_QUERY_INTERRUPTED;
return error;
}
@@ -2140,7 +2140,7 @@ static int tokudb_lock_waits_callback(DB *db, uint64_t requesting_txnid, const D
int error = schema_table_store_record(thd, table);
- if (!error && thd->killed)
+ if (!error && thd_killed(thd))
error = ER_QUERY_INTERRUPTED;
return error;
@@ -2231,7 +2231,7 @@ static int tokudb_locks_callback(uint64_t txn_id, uint64_t client_id, iterate_ro
error = schema_table_store_record(thd, table);
- if (!error && thd->killed)
+ if (!error && thd_killed(thd))
error = ER_QUERY_INTERRUPTED;
}
return error;
diff --git a/storage/tokudb/hatoku_hton.h b/storage/tokudb/hatoku_hton.h
index 2a5d15d4700..9169e36f158 100644
--- a/storage/tokudb/hatoku_hton.h
+++ b/storage/tokudb/hatoku_hton.h
@@ -481,12 +481,12 @@ static uint64_t tokudb_get_killed_time_callback(uint64_t default_killed_time) {
static int tokudb_killed_callback(void) {
THD *thd = current_thd;
- return thd->killed;
+ return thd_killed(thd);
}
static bool tokudb_killed_thd_callback(void *extra) {
THD *thd = static_cast<THD *>(extra);
- return thd->killed != 0;
+ return thd_killed(thd) != 0;
}
enum {