summaryrefslogtreecommitdiff
path: root/storage/tokudb
diff options
context:
space:
mode:
authorRik Prohaska <prohaska7@gmail.com>2015-04-06 16:17:09 -0400
committerRik Prohaska <prohaska7@gmail.com>2015-04-06 16:17:09 -0400
commitc2bfc5b2d9d05114852a79a7764bd4e09d9c238b (patch)
tree706ac6c096b2ad4d879bc10b0a69dd79fedb8afe /storage/tokudb
parente1dc36248c4caaf7980240f22207deed5acae320 (diff)
downloadmariadb-git-c2bfc5b2d9d05114852a79a7764bd4e09d9c238b.tar.gz
DB-832 add start time to tokudb_trx information schema table
Diffstat (limited to 'storage/tokudb')
-rw-r--r--storage/tokudb/hatoku_hton.cc16
1 files changed, 13 insertions, 3 deletions
diff --git a/storage/tokudb/hatoku_hton.cc b/storage/tokudb/hatoku_hton.cc
index b8d48b47e58..740074bdf2f 100644
--- a/storage/tokudb/hatoku_hton.cc
+++ b/storage/tokudb/hatoku_hton.cc
@@ -1991,7 +1991,9 @@ struct tokudb_search_txn_extra {
uint64_t match_client_id;
};
-static int tokudb_search_txn_callback(uint64_t txn_id, uint64_t client_id, iterate_row_locks_callback iterate_locks, void *locks_extra, void *extra) {
+static int tokudb_search_txn_callback(DB_TXN *txn, iterate_row_locks_callback iterate_locks, void *locks_extra, void *extra) {
+ uint64_t txn_id = txn->id64(txn);
+ uint64_t client_id = txn->get_client_id(txn);
struct tokudb_search_txn_extra *e = reinterpret_cast<struct tokudb_search_txn_extra *>(extra);
if (e->match_txn_id == txn_id) {
e->match_found = true;
@@ -2123,6 +2125,7 @@ static struct st_mysql_information_schema tokudb_trx_information_schema = { MYSQ
static ST_FIELD_INFO tokudb_trx_field_info[] = {
{"trx_id", 0, MYSQL_TYPE_LONGLONG, 0, 0, NULL, SKIP_OPEN_TABLE },
{"trx_mysql_thread_id", 0, MYSQL_TYPE_LONGLONG, 0, 0, NULL, SKIP_OPEN_TABLE },
+ {"trx_time", 0, MYSQL_TYPE_LONGLONG, 0, 0, NULL, SKIP_OPEN_TABLE },
{NULL, 0, MYSQL_TYPE_NULL, 0, 0, NULL, SKIP_OPEN_TABLE}
};
@@ -2131,12 +2134,17 @@ struct tokudb_trx_extra {
TABLE *table;
};
-static int tokudb_trx_callback(uint64_t txn_id, uint64_t client_id, iterate_row_locks_callback iterate_locks, void *locks_extra, void *extra) {
+static int tokudb_trx_callback(DB_TXN *txn, iterate_row_locks_callback iterate_locks, void *locks_extra, void *extra) {
+ uint64_t txn_id = txn->id64(txn);
+ uint64_t client_id = txn->get_client_id(txn);
+ uint64_t start_time = txn->get_start_time(txn);
struct tokudb_trx_extra *e = reinterpret_cast<struct tokudb_trx_extra *>(extra);
THD *thd = e->thd;
TABLE *table = e->table;
table->field[0]->store(txn_id, false);
table->field[1]->store(client_id, false);
+ uint64_t tnow = (uint64_t) time(NULL);
+ table->field[2]->store(tnow >= start_time ? tnow - start_time : 0, false);
int error = schema_table_store_record(thd, table);
if (!error && thd_killed(thd))
error = ER_QUERY_INTERRUPTED;
@@ -2284,7 +2292,9 @@ struct tokudb_locks_extra {
TABLE *table;
};
-static int tokudb_locks_callback(uint64_t txn_id, uint64_t client_id, iterate_row_locks_callback iterate_locks, void *locks_extra, void *extra) {
+static int tokudb_locks_callback(DB_TXN *txn, iterate_row_locks_callback iterate_locks, void *locks_extra, void *extra) {
+ uint64_t txn_id = txn->id64(txn);
+ uint64_t client_id = txn->get_client_id(txn);
struct tokudb_locks_extra *e = reinterpret_cast<struct tokudb_locks_extra *>(extra);
THD *thd = e->thd;
TABLE *table = e->table;