MySQL 5.6.14 Source Code Document
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Performance Schema Engine
Collaboration diagram for Performance Schema Engine:

Classes

class  ha_perfschema
class  PFS_check_intact
class  PFS_internal_schema_access
class  PFS_engine_table
struct  PFS_engine_table_share
class  PFS_readonly_acl
class  PFS_truncatable_acl
class  PFS_updatable_acl
class  PFS_editable_acl
class  PFS_unknown_acl
struct  PFS_simple_index
struct  PFS_double_index
struct  PFS_triple_index

Typedefs

typedef PFS_engine_table *(* pfs_open_table_t )(void)
typedef int(* pfs_write_row_t )(TABLE *table, unsigned char *buf, Field **fields)
typedef int(* pfs_delete_all_rows_t )(void)
typedef ha_rows(* pfs_get_row_count_t )(void)

Functions

void initialize_performance_schema_acl (bool bootstrap)
bool pfs_show_status (handlerton *hton, THD *thd, stat_print_fn *print, enum ha_stat_type stat)
static void PFS_engine_table_share::check_all_tables (THD *thd)
virtual void PFS_check_intact::report_error (uint code, const char *fmt,...)
void PFS_engine_table_share::check_one_table (THD *thd)
static void PFS_engine_table_share::init_all_locks (void)
static void PFS_engine_table_share::delete_all_locks (void)
ha_rows PFS_engine_table_share::get_row_count (void) const
int PFS_engine_table_share::write_row (TABLE *table, unsigned char *buf, Field **fields) const
static const
PFS_engine_table_share
PFS_engine_table::find_engine_table_share (const char *name)
int PFS_engine_table::read_row (TABLE *table, unsigned char *buf, Field **fields)
int PFS_engine_table::update_row (TABLE *table, const unsigned char *old_buf, unsigned char *new_buf, Field **fields)
int PFS_engine_table::delete_row (TABLE *table, const unsigned char *buf, Field **fields)
virtual int PFS_engine_table::delete_row_values (TABLE *table, const unsigned char *buf, Field **fields)
void PFS_engine_table::get_position (void *ref)
void PFS_engine_table::set_position (const void *ref)
void PFS_engine_table::get_normalizer (PFS_instr_class *instr_class)
static void PFS_engine_table::set_field_ulong (Field *f, ulong value)
static void PFS_engine_table::set_field_ulonglong (Field *f, ulonglong value)
static void PFS_engine_table::set_field_char_utf8 (Field *f, const char *str, uint len)
static void PFS_engine_table::set_field_varchar_utf8 (Field *f, const char *str, uint len)
static void PFS_engine_table::set_field_longtext_utf8 (Field *f, const char *str, uint len)
static void PFS_engine_table::set_field_enum (Field *f, ulonglong value)
static void PFS_engine_table::set_field_timestamp (Field *f, ulonglong value)
static ulonglong PFS_engine_table::get_field_enum (Field *f)
static StringPFS_engine_table::get_field_char_utf8 (Field *f, String *val)
static StringPFS_engine_table::get_field_varchar_utf8 (Field *f, String *val)
virtual int PFS_engine_table::update_row_values (TABLE *table, const unsigned char *old_buf, unsigned char *new_buf, Field **fields)
ACL_internal_access_result PFS_internal_schema_access::check (ulong want_access, ulong *save_priv) const
const ACL_internal_table_accessPFS_internal_schema_access::lookup (const char *name) const
virtual ACL_internal_access_result PFS_readonly_acl::check (ulong want_access, ulong *save_priv) const
ACL_internal_access_result PFS_truncatable_acl::check (ulong want_access, ulong *save_priv) const
ACL_internal_access_result PFS_updatable_acl::check (ulong want_access, ulong *save_priv) const
ACL_internal_access_result PFS_editable_acl::check (ulong want_access, ulong *save_priv) const
ACL_internal_access_result PFS_unknown_acl::check (ulong want_access, ulong *save_priv) const

Variables

const char * pfs_engine_name
PFS_internal_schema_access pfs_internal_access
PFS_readonly_acl pfs_readonly_acl
PFS_truncatable_acl pfs_truncatable_acl
PFS_updatable_acl pfs_updatable_acl
PFS_editable_acl pfs_editable_acl
PFS_unknown_acl pfs_unknown_acl
PFS_readonly_acl pfs_readonly_acl
PFS_truncatable_acl pfs_truncatable_acl
PFS_updatable_acl pfs_updatable_acl
PFS_editable_acl pfs_editable_acl
PFS_unknown_acl pfs_unknown_acl

Detailed Description

Typedef Documentation

typedef int(* pfs_delete_all_rows_t)(void)

Callback to delete all rows.

Definition at line 205 of file pfs_engine_table.h.

typedef ha_rows(* pfs_get_row_count_t)(void)

Callback to get a row count.

Definition at line 207 of file pfs_engine_table.h.

typedef PFS_engine_table*(* pfs_open_table_t)(void)

Callback to open a table.

Definition at line 200 of file pfs_engine_table.h.

typedef int(* pfs_write_row_t)(TABLE *table, unsigned char *buf, Field **fields)

Callback to write a row.

Definition at line 202 of file pfs_engine_table.h.

Function Documentation

ACL_internal_access_result PFS_readonly_acl::check ( ulong  want_access,
ulong *  save_priv 
) const
virtual

Check access to an internal table. When a privilege is granted, this method add the requested privilege to save_priv.

Parameters
want_accessthe privileges requested
[in,out]save_privthe privileges granted
Returns
Return values
ACL_INTERNAL_ACCESS_GRANTEDAll the requested privileges are granted, and saved in save_priv.
ACL_INTERNAL_ACCESS_DENIEDAt least one of the requested privileges was denied.
ACL_INTERNAL_ACCESS_CHECK_GRANTNo requested privilege was denied, and grant should be checked for at least one privilege. Requested privileges that are granted, if any, are saved in save_priv.

Implements ACL_internal_table_access.

Definition at line 631 of file pfs_engine_table.cc.

ACL_internal_access_result PFS_truncatable_acl::check ( ulong  want_access,
ulong *  save_priv 
) const
virtual

Check access to an internal table. When a privilege is granted, this method add the requested privilege to save_priv.

Parameters
want_accessthe privileges requested
[in,out]save_privthe privileges granted
Returns
Return values
ACL_INTERNAL_ACCESS_GRANTEDAll the requested privileges are granted, and saved in save_priv.
ACL_INTERNAL_ACCESS_DENIEDAt least one of the requested privileges was denied.
ACL_INTERNAL_ACCESS_CHECK_GRANTNo requested privilege was denied, and grant should be checked for at least one privilege. Requested privileges that are granted, if any, are saved in save_priv.

Implements ACL_internal_table_access.

Definition at line 646 of file pfs_engine_table.cc.

ACL_internal_access_result PFS_updatable_acl::check ( ulong  want_access,
ulong *  save_priv 
) const
virtual

Check access to an internal table. When a privilege is granted, this method add the requested privilege to save_priv.

Parameters
want_accessthe privileges requested
[in,out]save_privthe privileges granted
Returns
Return values
ACL_INTERNAL_ACCESS_GRANTEDAll the requested privileges are granted, and saved in save_priv.
ACL_INTERNAL_ACCESS_DENIEDAt least one of the requested privileges was denied.
ACL_INTERNAL_ACCESS_CHECK_GRANTNo requested privilege was denied, and grant should be checked for at least one privilege. Requested privileges that are granted, if any, are saved in save_priv.

Implements ACL_internal_table_access.

Definition at line 661 of file pfs_engine_table.cc.

ACL_internal_access_result PFS_editable_acl::check ( ulong  want_access,
ulong *  save_priv 
) const
virtual

Check access to an internal table. When a privilege is granted, this method add the requested privilege to save_priv.

Parameters
want_accessthe privileges requested
[in,out]save_privthe privileges granted
Returns
Return values
ACL_INTERNAL_ACCESS_GRANTEDAll the requested privileges are granted, and saved in save_priv.
ACL_INTERNAL_ACCESS_DENIEDAt least one of the requested privileges was denied.
ACL_INTERNAL_ACCESS_CHECK_GRANTNo requested privilege was denied, and grant should be checked for at least one privilege. Requested privileges that are granted, if any, are saved in save_priv.

Implements ACL_internal_table_access.

Definition at line 676 of file pfs_engine_table.cc.

ACL_internal_access_result PFS_unknown_acl::check ( ulong  want_access,
ulong *  save_priv 
) const
virtual

Check access to an internal table. When a privilege is granted, this method add the requested privilege to save_priv.

Parameters
want_accessthe privileges requested
[in,out]save_privthe privileges granted
Returns
Return values
ACL_INTERNAL_ACCESS_GRANTEDAll the requested privileges are granted, and saved in save_priv.
ACL_INTERNAL_ACCESS_DENIEDAt least one of the requested privileges was denied.
ACL_INTERNAL_ACCESS_CHECK_GRANTNo requested privilege was denied, and grant should be checked for at least one privilege. Requested privileges that are granted, if any, are saved in save_priv.

Implements ACL_internal_table_access.

Definition at line 690 of file pfs_engine_table.cc.

ACL_internal_access_result PFS_internal_schema_access::check ( ulong  want_access,
ulong *  save_priv 
) const
virtual

Check access to an internal schema.

Parameters
want_accessthe privileges requested
[in,out]save_privthe privileges granted
Returns
Return values
ACL_INTERNAL_ACCESS_GRANTEDAll the requested privileges are granted, and saved in save_priv.
ACL_INTERNAL_ACCESS_DENIEDAt least one of the requested privileges was denied.
ACL_INTERNAL_ACCESS_CHECK_GRANTNo requested privilege was denied, and grant should be checked for at least one privilege. Requested privileges that are granted, if any, are saved in save_priv.

Implements ACL_internal_schema_access.

Definition at line 578 of file pfs_engine_table.cc.

void PFS_engine_table_share::check_all_tables ( THD *  thd)
static

Check all the tables structure.

Parameters
thdcurrent thread

Definition at line 158 of file pfs_engine_table.cc.

Here is the caller graph for this function:

void PFS_engine_table_share::check_one_table ( THD *  thd)

Check integrity of the actual table schema. The actual table schema (.frm) is compared to the expected schema.

Parameters
thdcurrent thread

Definition at line 208 of file pfs_engine_table.cc.

Here is the call graph for this function:

void PFS_engine_table_share::delete_all_locks ( void  )
static

Delete all the table share locks.

Definition at line 249 of file pfs_engine_table.cc.

int PFS_engine_table::delete_row ( TABLE table,
const unsigned char *  buf,
Field **  fields 
)

Delete a row from this table.

Parameters
tableTable handle
bufthe row buffer to delete
fieldsTable fields
Returns
0 on success

Definition at line 412 of file pfs_engine_table.cc.

Here is the call graph for this function:

Here is the caller graph for this function:

int PFS_engine_table::delete_row_values ( TABLE table,
const unsigned char *  buf,
Field **  fields 
)
protectedvirtual

Delete a row.

Parameters
tableTable handle
bufRow buffer
fieldsTable fields

Reimplemented in table_setup_objects, and table_setup_actors.

Definition at line 435 of file pfs_engine_table.cc.

Here is the caller graph for this function:

const PFS_engine_table_share * PFS_engine_table::find_engine_table_share ( const char *  name)
static

Find a table share by name.

Parameters
nameThe table name
Returns
table share

Definition at line 320 of file pfs_engine_table.cc.

Here is the caller graph for this function:

String * PFS_engine_table::get_field_char_utf8 ( Field f,
String val 
)
static

Helper, read a value from a char utf8 field.

Parameters
fthe field to read
[out]valthe field value
Returns
the field value

Definition at line 536 of file pfs_engine_table.cc.

ulonglong PFS_engine_table::get_field_enum ( Field f)
static

Helper, read a value from an enum field.

Parameters
fthe field to read
Returns
the field value

Definition at line 528 of file pfs_engine_table.cc.

Here is the caller graph for this function:

String * PFS_engine_table::get_field_varchar_utf8 ( Field f,
String val 
)
static

Helper, read a value from a varchar utf8 field.

Parameters
fthe field to read
[out]valthe field value
Returns
the field value

Definition at line 545 of file pfs_engine_table.cc.

void PFS_engine_table::get_normalizer ( PFS_instr_class instr_class)

Get the normalizer and class type for the current row.

Get the timer normalizer and class type for the current row.

Parameters
[in]instr_classclass

Definition at line 464 of file pfs_engine_table.cc.

Here is the call graph for this function:

Here is the caller graph for this function:

void PFS_engine_table::get_position ( void *  ref)

Get the position of the current row.

Parameters
[out]refposition

Definition at line 446 of file pfs_engine_table.cc.

Here is the caller graph for this function:

ha_rows PFS_engine_table_share::get_row_count ( void  ) const

Get the row count.

Definition at line 257 of file pfs_engine_table.cc.

void PFS_engine_table_share::init_all_locks ( void  )
static

Initialize all the table share locks.

Definition at line 240 of file pfs_engine_table.cc.

void initialize_performance_schema_acl ( bool  bootstrap)

Initialize the performance schema ACL. ACL is strictly enforced when the server is running in normal mode, to enforce that only legal operations are allowed. When running in boostrap mode, ACL restrictions are relaxed, to allow the boostrap scripts to DROP / CREATE performance schema tables.

See Also
ACL_internal_schema_registry
Parameters
bootstrapTrue if the server is starting in bootstrap mode.

Definition at line 615 of file pfs_engine_table.cc.

Here is the call graph for this function:

const ACL_internal_table_access * PFS_internal_schema_access::lookup ( const char *  name) const
virtual

Search for per table ACL access rules by table name.

Parameters
namethe table name
Returns
per table access rules, or NULL

Implements ACL_internal_schema_access.

Definition at line 597 of file pfs_engine_table.cc.

Here is the call graph for this function:

bool pfs_show_status ( handlerton hton,
THD *  thd,
stat_print_fn *  print,
enum ha_stat_type  stat 
)

SHOW ENGINE PERFORMANCE_SCHEMA STATUS.

Parameters
htonStorage engine handler
thdCurrent thread
printPrint function
statstatus to show

Definition at line 719 of file pfs_engine_table.cc.

int PFS_engine_table::read_row ( TABLE table,
unsigned char *  buf,
Field **  fields 
)

Read a table row.

Parameters
tableTable handle
bufRow buffer
fieldsTable fields
Returns
0 on success

Definition at line 342 of file pfs_engine_table.cc.

Here is the call graph for this function:

Here is the caller graph for this function:

void PFS_engine_table::set_field_char_utf8 ( Field f,
const char *  str,
uint  len 
)
static

Helper, assign a value to a char utf8 field.

Parameters
fthe field to set
strthe string to assign
lenthe length of the string to assign

Definition at line 487 of file pfs_engine_table.cc.

Here is the caller graph for this function:

void PFS_engine_table::set_field_enum ( Field f,
ulonglong  value 
)
static

Helper, assign a value to an enum field.

Parameters
fthe field to set
valuethe value to assign

Definition at line 511 of file pfs_engine_table.cc.

Here is the caller graph for this function:

void PFS_engine_table::set_field_longtext_utf8 ( Field f,
const char *  str,
uint  len 
)
static

Helper, assign a value to a longtext utf8 field.

Parameters
fthe field to set
strthe string to assign
lenthe length of the string to assign

Definition at line 503 of file pfs_engine_table.cc.

Here is the caller graph for this function:

void PFS_engine_table::set_field_timestamp ( Field f,
ulonglong  value 
)
static

Helper, assign a value to a timestamp field.

Parameters
fthe field to set
valuethe value to assign

Definition at line 518 of file pfs_engine_table.cc.

Here is the call graph for this function:

Here is the caller graph for this function:

void PFS_engine_table::set_field_ulong ( Field f,
ulong  value 
)
static

Helper, assign a value to a ulong field.

Parameters
fthe field to set
valuethe value to assign

Definition at line 473 of file pfs_engine_table.cc.

Here is the caller graph for this function:

void PFS_engine_table::set_field_ulonglong ( Field f,
ulonglong  value 
)
static

Helper, assign a value to a ulonglong field.

Parameters
fthe field to set
valuethe value to assign

Definition at line 480 of file pfs_engine_table.cc.

Here is the caller graph for this function:

void PFS_engine_table::set_field_varchar_utf8 ( Field f,
const char *  str,
uint  len 
)
static

Helper, assign a value to a varchar utf8 field.

Parameters
fthe field to set
strthe string to assign
lenthe length of the string to assign

Definition at line 495 of file pfs_engine_table.cc.

Here is the caller graph for this function:

void PFS_engine_table::set_position ( const void *  ref)

Set the table cursor at a given position.

Parameters
[in]refposition

Definition at line 455 of file pfs_engine_table.cc.

int PFS_engine_table::update_row ( TABLE table,
const unsigned char *  old_buf,
unsigned char *  new_buf,
Field **  fields 
)

Update a table row.

Parameters
tableTable handle
old_bufold row buffer
new_bufnew row buffer
fieldsTable fields
Returns
0 on success

Definition at line 388 of file pfs_engine_table.cc.

Here is the call graph for this function:

Here is the caller graph for this function:

int PFS_engine_table::update_row_values ( TABLE table,
const unsigned char *  old_buf,
unsigned char *  new_buf,
Field **  fields 
)
protectedvirtual

Update the current row values.

Parameters
tableTable handle
old_bufold row buffer
new_bufnew row buffer
fieldsTable fields

Reimplemented in table_setup_instruments, table_threads, table_setup_objects, table_setup_actors, table_setup_consumers, and table_setup_timers.

Definition at line 553 of file pfs_engine_table.cc.

Here is the caller graph for this function:

int PFS_engine_table_share::write_row ( TABLE table,
unsigned char *  buf,
Field **  fields 
) const

Write a row.

Definition at line 266 of file pfs_engine_table.cc.

Here is the caller graph for this function:

Variable Documentation

PFS_editable_acl pfs_editable_acl

Singleton instance of PFS_editable_acl.

Definition at line 673 of file pfs_engine_table.cc.

PFS_editable_acl pfs_editable_acl

Singleton instance of PFS_editable_acl.

Definition at line 673 of file pfs_engine_table.cc.

const char* pfs_engine_name

Name of the performance schema engine.

Definition at line 177 of file ha_perfschema.cc.

PFS_readonly_acl pfs_readonly_acl

Singleton instance of PFS_readonly_acl.

Definition at line 628 of file pfs_engine_table.cc.

PFS_readonly_acl pfs_readonly_acl

Singleton instance of PFS_readonly_acl.

Definition at line 628 of file pfs_engine_table.cc.

PFS_truncatable_acl pfs_truncatable_acl

Singleton instance of PFS_truncatable_acl.

Definition at line 643 of file pfs_engine_table.cc.

PFS_truncatable_acl pfs_truncatable_acl

Singleton instance of PFS_truncatable_acl.

Definition at line 643 of file pfs_engine_table.cc.

PFS_unknown_acl pfs_unknown_acl

Singleton instance of PFS_unknown_acl.

Definition at line 687 of file pfs_engine_table.cc.

PFS_unknown_acl pfs_unknown_acl

Singleton instance of PFS_unknown_acl.

Definition at line 687 of file pfs_engine_table.cc.

PFS_updatable_acl pfs_updatable_acl

Singleton instance of PFS_updatable_acl.

Definition at line 658 of file pfs_engine_table.cc.

PFS_updatable_acl pfs_updatable_acl

Singleton instance of PFS_updatable_acl.

Definition at line 658 of file pfs_engine_table.cc.