diff options
Diffstat (limited to 'storage/perfschema/table_accounts.cc')
-rw-r--r-- | storage/perfschema/table_accounts.cc | 30 |
1 files changed, 21 insertions, 9 deletions
diff --git a/storage/perfschema/table_accounts.cc b/storage/perfschema/table_accounts.cc index 708f8269a69..eb3f6481696 100644 --- a/storage/perfschema/table_accounts.cc +++ b/storage/perfschema/table_accounts.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, @@ -21,12 +21,15 @@ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ #include "my_global.h" -#include "my_pthread.h" +#include "my_thread.h" #include "table_accounts.h" #include "pfs_instr_class.h" #include "pfs_instr.h" #include "pfs_account.h" #include "pfs_visitor.h" +#include "pfs_memory.h" +#include "pfs_status.h" +#include "field.h" THR_LOCK table_accounts::m_table_lock; @@ -35,18 +38,18 @@ table_accounts::m_share= { { C_STRING_WITH_LEN("accounts") }, &pfs_truncatable_acl, - &table_accounts::create, + table_accounts::create, NULL, /* write_row */ table_accounts::delete_all_rows, - NULL, /* get_row_count */ - 1000, /* records */ + cursor_by_account::get_row_count, sizeof(PFS_simple_index), /* ref length */ &m_table_lock, { C_STRING_WITH_LEN("CREATE TABLE accounts(" - "USER CHAR(16) collate utf8_bin default null," + "USER CHAR(" USERNAME_CHAR_LENGTH_STR ") collate utf8_bin default null," "HOST CHAR(60) collate utf8_bin default null," "CURRENT_CONNECTIONS bigint not null," - "TOTAL_CONNECTIONS bigint not null)") } + "TOTAL_CONNECTIONS bigint not null)") }, + false /* perpetual */ }; PFS_engine_table* table_accounts::create() @@ -63,6 +66,12 @@ table_accounts::delete_all_rows(void) reset_events_stages_by_account(); reset_events_statements_by_thread(); reset_events_statements_by_account(); + reset_events_transactions_by_thread(); + reset_events_transactions_by_account(); + reset_memory_by_thread(); + reset_memory_by_account(); + reset_status_by_thread(); + reset_status_by_account(); purge_all_account(); return 0; } @@ -74,7 +83,7 @@ table_accounts::table_accounts() void table_accounts::make_row(PFS_account *pfs) { - pfs_lock lock; + pfs_optimistic_state lock; m_row_exists= false; pfs->m_lock.begin_optimistic_lock(&lock); @@ -83,7 +92,10 @@ void table_accounts::make_row(PFS_account *pfs) return; PFS_connection_stat_visitor visitor; - PFS_connection_iterator::visit_account(pfs, true, & visitor); + PFS_connection_iterator::visit_account(pfs, + true, /* threads */ + false, /* THDs */ + & visitor); if (! pfs->m_lock.end_optimistic_lock(& lock)) return; |