diff options
author | Sergey Vojtovich <svoj@mariadb.org> | 2016-06-23 12:16:20 +0400 |
---|---|---|
committer | Sergey Vojtovich <svoj@mariadb.org> | 2016-06-23 12:16:20 +0400 |
commit | f289f3ee9c330bfa47f20c1016541cdd9dc8e354 (patch) | |
tree | d730f9e265349e40049aba2b8f43730c4bdd41d6 /plugin | |
parent | 4abeebeed78a962e5dd10ff53b53ffd4e8699700 (diff) | |
download | mariadb-git-f289f3ee9c330bfa47f20c1016541cdd9dc8e354.tar.gz |
MDEV-9728 - Hard crash in metadata_lock_info
Disable output of MDL lock duration since there is no facility to retreive
it properly.
Diffstat (limited to 'plugin')
5 files changed, 8 insertions, 15 deletions
diff --git a/plugin/metadata_lock_info/metadata_lock_info.cc b/plugin/metadata_lock_info/metadata_lock_info.cc index fcfdb59da30..d434ed9a693 100644 --- a/plugin/metadata_lock_info/metadata_lock_info.cc +++ b/plugin/metadata_lock_info/metadata_lock_info.cc @@ -81,25 +81,17 @@ int i_s_metadata_lock_info_fill_row( THD *thd = param->thd; TABLE *table = param->table; DBUG_ENTER("i_s_metadata_lock_info_fill_row"); - MDL_request mdl_request; - enum_mdl_duration mdl_duration; MDL_context *mdl_ctx = mdl_ticket->get_ctx(); enum_mdl_type mdl_ticket_type = mdl_ticket->get_type(); MDL_key *mdl_key = mdl_ticket->get_key(); MDL_key::enum_mdl_namespace mdl_namespace = mdl_key->mdl_namespace(); - mdl_request.init(mdl_key, mdl_ticket_type, MDL_STATEMENT); - mdl_ctx->find_ticket(&mdl_request, &mdl_duration); table->field[0]->store((longlong) mdl_ctx->get_thread_id(), TRUE); table->field[1]->set_notnull(); table->field[1]->store( metadata_lock_info_lock_mode[(int) mdl_ticket_type].str, metadata_lock_info_lock_mode[(int) mdl_ticket_type].length, system_charset_info); - table->field[2]->set_notnull(); - table->field[2]->store( - metadata_lock_info_duration[(int) mdl_duration].str, - metadata_lock_info_duration[(int) mdl_duration].length, - system_charset_info); + table->field[2]->set_null(); table->field[3]->set_notnull(); table->field[3]->store( metadata_lock_info_lock_name[(int) mdl_namespace].str, diff --git a/plugin/metadata_lock_info/mysql-test/metadata_lock_info/r/global_read_lock.result b/plugin/metadata_lock_info/mysql-test/metadata_lock_info/r/global_read_lock.result index 61b0a913ca4..5803d7d1290 100644 --- a/plugin/metadata_lock_info/mysql-test/metadata_lock_info/r/global_read_lock.result +++ b/plugin/metadata_lock_info/mysql-test/metadata_lock_info/r/global_read_lock.result @@ -1,10 +1,10 @@ SELECT lock_mode, lock_duration, lock_type, table_schema, table_name FROM information_schema.metadata_lock_info; lock_mode lock_duration lock_type table_schema table_name FLUSH TABLES WITH READ LOCK; -SELECT lock_mode, lock_duration, lock_type, table_schema, table_name FROM information_schema.metadata_lock_info ORDER BY lock_type DESC; +SELECT lock_mode, lock_duration, lock_type, table_schema, table_name FROM information_schema.metadata_lock_info; lock_mode lock_duration lock_type table_schema table_name -MDL_SHARED MDL_EXPLICIT Global read lock -MDL_SHARED MDL_EXPLICIT Commit lock +MDL_SHARED NULL Commit lock +MDL_SHARED NULL Global read lock UNLOCK TABLES; SELECT lock_mode, lock_duration, lock_type, table_schema, table_name FROM information_schema.metadata_lock_info; lock_mode lock_duration lock_type table_schema table_name diff --git a/plugin/metadata_lock_info/mysql-test/metadata_lock_info/r/table_metadata_lock.result b/plugin/metadata_lock_info/mysql-test/metadata_lock_info/r/table_metadata_lock.result index 280c8284c54..1b76b9e8222 100644 --- a/plugin/metadata_lock_info/mysql-test/metadata_lock_info/r/table_metadata_lock.result +++ b/plugin/metadata_lock_info/mysql-test/metadata_lock_info/r/table_metadata_lock.result @@ -6,7 +6,7 @@ SELECT * FROM t1; a SELECT lock_mode, lock_duration, lock_type, table_schema, table_name FROM information_schema.metadata_lock_info; lock_mode lock_duration lock_type table_schema table_name -MDL_SHARED_READ MDL_TRANSACTION Table metadata lock test t1 +MDL_SHARED_READ NULL Table metadata lock test t1 ROLLBACK; SELECT lock_mode, lock_duration, lock_type, table_schema, table_name FROM information_schema.metadata_lock_info; lock_mode lock_duration lock_type table_schema table_name diff --git a/plugin/metadata_lock_info/mysql-test/metadata_lock_info/r/user_lock.result b/plugin/metadata_lock_info/mysql-test/metadata_lock_info/r/user_lock.result index e1d690b566c..34d238cb43b 100644 --- a/plugin/metadata_lock_info/mysql-test/metadata_lock_info/r/user_lock.result +++ b/plugin/metadata_lock_info/mysql-test/metadata_lock_info/r/user_lock.result @@ -5,7 +5,7 @@ GET_LOCK('LOCK1',0) 1 SELECT lock_mode, lock_duration, lock_type, table_schema, table_name FROM information_schema.metadata_lock_info; lock_mode lock_duration lock_type table_schema table_name -MDL_SHARED_NO_WRITE MDL_EXPLICIT User lock LOCK1 +MDL_SHARED_NO_WRITE NULL User lock LOCK1 SELECT RELEASE_LOCK('LOCK1'); RELEASE_LOCK('LOCK1') 1 diff --git a/plugin/metadata_lock_info/mysql-test/metadata_lock_info/t/global_read_lock.test b/plugin/metadata_lock_info/mysql-test/metadata_lock_info/t/global_read_lock.test index 74fa5e3e1fd..103050e3fb8 100644 --- a/plugin/metadata_lock_info/mysql-test/metadata_lock_info/t/global_read_lock.test +++ b/plugin/metadata_lock_info/mysql-test/metadata_lock_info/t/global_read_lock.test @@ -1,5 +1,6 @@ SELECT lock_mode, lock_duration, lock_type, table_schema, table_name FROM information_schema.metadata_lock_info; FLUSH TABLES WITH READ LOCK; -SELECT lock_mode, lock_duration, lock_type, table_schema, table_name FROM information_schema.metadata_lock_info ORDER BY lock_type DESC; +--sorted_result +SELECT lock_mode, lock_duration, lock_type, table_schema, table_name FROM information_schema.metadata_lock_info; UNLOCK TABLES; SELECT lock_mode, lock_duration, lock_type, table_schema, table_name FROM information_schema.metadata_lock_info; |