diff options
Diffstat (limited to 'sql/sql_test.cc')
-rw-r--r-- | sql/sql_test.cc | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/sql/sql_test.cc b/sql/sql_test.cc index 1a241521fd7..151ceed4006 100644 --- a/sql/sql_test.cc +++ b/sql/sql_test.cc @@ -92,21 +92,23 @@ static void print_cached_tables(void) mysql_mutex_lock(&LOCK_open); while ((share= tdc_it.next())) { - TABLE_SHARE::TABLE_list::Iterator it(share->tdc.used_tables); + TABLE_SHARE::All_share_tables_list::Iterator it(share->tdc.all_tables); while ((entry= it++)) { - printf("%-14.14s %-32s%6ld%8ld%6d %s\n", - entry->s->db.str, entry->s->table_name.str, entry->s->version, - entry->in_use->thread_id, entry->db_stat ? 1 : 0, - lock_descriptions[(int)entry->reginfo.lock_type]); - } - it.init(share->tdc.free_tables); - while ((entry= it++)) - { - unused++; - printf("%-14.14s %-32s%6ld%8ld%6d %s\n", - entry->s->db.str, entry->s->table_name.str, entry->s->version, - 0L, entry->db_stat ? 1 : 0, "Not in use"); + if (entry->in_use) + { + printf("%-14.14s %-32s%6ld%8ld%6d %s\n", + entry->s->db.str, entry->s->table_name.str, entry->s->version, + entry->in_use->thread_id, entry->db_stat ? 1 : 0, + lock_descriptions[(int)entry->reginfo.lock_type]); + } + else + { + unused++; + printf("%-14.14s %-32s%6ld%8ld%6d %s\n", + entry->s->db.str, entry->s->table_name.str, entry->s->version, + 0L, entry->db_stat ? 1 : 0, "Not in use"); + } } } tdc_it.deinit(); |