summaryrefslogtreecommitdiff
path: root/storage
diff options
context:
space:
mode:
authorRich Prohaska <prohaska@tokutek.com>2014-08-28 06:19:32 -0400
committerRich Prohaska <prohaska@tokutek.com>2014-08-28 06:19:32 -0400
commit08eb88eec4ab42a714ac49c510cfb23fdb2a8343 (patch)
tree67025d4c65e71c83e6c2751d56c5bc1b64094692 /storage
parent8c5cd26053b92f32761300ac1f24a79e8057a8ac (diff)
downloadmariadb-git-08eb88eec4ab42a714ac49c510cfb23fdb2a8343.tar.gz
DB-712 split locks and lock_waits dname into schema, table, and dictionary
Diffstat (limited to 'storage')
-rw-r--r--storage/tokudb/hatoku_hton.cc19
1 files changed, 19 insertions, 0 deletions
diff --git a/storage/tokudb/hatoku_hton.cc b/storage/tokudb/hatoku_hton.cc
index ed7caf37003..2f659f8571e 100644
--- a/storage/tokudb/hatoku_hton.cc
+++ b/storage/tokudb/hatoku_hton.cc
@@ -2074,6 +2074,9 @@ static ST_FIELD_INFO tokudb_lock_waits_field_info[] = {
{"lock_waits_key_left", 256, MYSQL_TYPE_STRING, 0, 0, NULL, SKIP_OPEN_TABLE },
{"lock_waits_key_right", 256, MYSQL_TYPE_STRING, 0, 0, NULL, SKIP_OPEN_TABLE },
{"lock_waits_start_time", 0, MYSQL_TYPE_LONGLONG, 0, 0, NULL, SKIP_OPEN_TABLE },
+ {"lock_waits_table_schema", 256, MYSQL_TYPE_STRING, 0, 0, NULL, SKIP_OPEN_TABLE },
+ {"lock_waits_table_name", 256, MYSQL_TYPE_STRING, 0, 0, NULL, SKIP_OPEN_TABLE },
+ {"lock_waits_table_dictionary_name", 256, MYSQL_TYPE_STRING, 0, 0, NULL, SKIP_OPEN_TABLE },
{NULL, 0, MYSQL_TYPE_NULL, 0, 0, NULL, SKIP_OPEN_TABLE}
};
@@ -2099,6 +2102,13 @@ static int tokudb_lock_waits_callback(DB *db, uint64_t requesting_txnid, const D
tokudb_pretty_right_key(db, right_key, &right_str);
table->field[4]->store(right_str.ptr(), right_str.length(), system_charset_info);
table->field[5]->store(start_time, false);
+
+ String database_name, table_name, dictionary_name;
+ tokudb_split_dname(dname, database_name, table_name, dictionary_name);
+ table->field[6]->store(database_name.c_ptr(), database_name.length(), system_charset_info);
+ table->field[7]->store(table_name.c_ptr(), table_name.length(), system_charset_info);
+ table->field[8]->store(dictionary_name.c_ptr(), dictionary_name.length(), system_charset_info);
+
int error = schema_table_store_record(thd, table);
return error;
}
@@ -2144,6 +2154,9 @@ static ST_FIELD_INFO tokudb_locks_field_info[] = {
{"locks_dname", 256, MYSQL_TYPE_STRING, 0, 0, NULL, SKIP_OPEN_TABLE },
{"locks_key_left", 256, MYSQL_TYPE_STRING, 0, 0, NULL, SKIP_OPEN_TABLE },
{"locks_key_right", 256, MYSQL_TYPE_STRING, 0, 0, NULL, SKIP_OPEN_TABLE },
+ {"locks_table_schema", 256, MYSQL_TYPE_STRING, 0, 0, NULL, SKIP_OPEN_TABLE },
+ {"locks_table_name", 256, MYSQL_TYPE_STRING, 0, 0, NULL, SKIP_OPEN_TABLE },
+ {"locks_table_dictionary_name", 256, MYSQL_TYPE_STRING, 0, 0, NULL, SKIP_OPEN_TABLE },
{NULL, 0, MYSQL_TYPE_NULL, 0, 0, NULL, SKIP_OPEN_TABLE}
};
@@ -2175,6 +2188,12 @@ static int tokudb_locks_callback(uint64_t txn_id, uint64_t client_id, iterate_ro
tokudb_pretty_right_key(db, &right_key, &right_str);
table->field[4]->store(right_str.ptr(), right_str.length(), system_charset_info);
+ String database_name, table_name, dictionary_name;
+ tokudb_split_dname(dname, database_name, table_name, dictionary_name);
+ table->field[5]->store(database_name.c_ptr(), database_name.length(), system_charset_info);
+ table->field[6]->store(table_name.c_ptr(), table_name.length(), system_charset_info);
+ table->field[7]->store(dictionary_name.c_ptr(), dictionary_name.length(), system_charset_info);
+
error = schema_table_store_record(thd, table);
}
return error;