YoushouldhavereceivedacopyoftheGNUGeneralPublicLicense alongwiththisprogram;ifnot,writetotheFreeSoftwareFoundation,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */
PFS_engine_table_share
table_events_statements_current::m_share=
{
{ C_STRING_WITH_LEN("events_statements_current") },
&pfs_truncatable_acl,
table_events_statements_current::create,
NULL, /* write_row */
table_events_statements_current::delete_all_rows,
table_events_statements_current::get_row_count, sizeof(pos_events_statements_current), /* ref length */
&m_table_lock,
{ C_STRING_WITH_LEN("CREATE TABLE events_statements_current(" "THREAD_ID BIGINT unsigned not null comment 'Thread associated with the event. Together with EVENT_ID uniquely identifies the row.'," "EVENT_ID BIGINT unsigned not null comment 'Thread''s current event number at the start of the event. Together with THREAD_ID uniquely identifies the row.'," "END_EVENT_ID BIGINT unsigned comment 'NULL when the event starts, set to the thread''s current event number at the end of the event.'," "EVENT_NAME VARCHAR(128) not null comment 'Event instrument name and a NAME from the setup_instruments table'," "SOURCE VARCHAR(64) comment 'Name and line number of the source file containing the instrumented code that produced the event.'," "TIMER_START BIGINT unsigned comment 'Value in picoseconds when the event timing started or NULL if timing is not collected.'," "TIMER_END BIGINT unsigned comment 'Value in picoseconds when the event timing ended, or NULL if the event has not ended or timing is not collected.'," "TIMER_WAIT BIGINT unsigned comment 'Value in picoseconds of the event''s duration or NULL if the event has not ended or timing is not collected.'," "LOCK_TIME bigint unsigned not null comment 'Time in picoseconds spent waiting for locks. The time is calculated in microseconds but stored in picoseconds for compatibility with other timings.'," "SQL_TEXT LONGTEXT comment 'The SQL statement, or NULL if the command is not associated with an SQL statement.'," "DIGEST VARCHAR(32) comment 'Statement digest.'," "DIGEST_TEXT LONGTEXT comment 'Statement digest text.'," "CURRENT_SCHEMA VARCHAR(64) comment 'Statement''s default database for the statement, or NULL if there was none.'," "OBJECT_TYPE VARCHAR(64) comment 'NULL for top level statements. The parent statement object type for nested statements (stored programs).'," "OBJECT_SCHEMA VARCHAR(64) comment 'NULL for top level statements. The parent statement object schema for nested statements (stored programs).'," "OBJECT_NAME VARCHAR(64) comment 'NULL for top level statements. The parent statement object name for nested statements (stored programs).'," "OBJECT_INSTANCE_BEGIN BIGINT unsigned comment 'Address in memory of the statement object.'," "MYSQL_ERRNO INTEGER comment 'Error code. See MariaDB Error Codes for a full list.'," "RETURNED_SQLSTATE VARCHAR(5) comment 'The SQLSTATE value.'," "MESSAGE_TEXT VARCHAR(128) comment 'Statement error message. See MariaDB Error Codes.'," "ERRORS BIGINT unsigned not null comment '0 if SQLSTATE signifies completion (starting with 00) or warning (01), otherwise 1.'," "WARNINGS BIGINT unsigned not null comment 'Number of warnings from the diagnostics area.'," "ROWS_AFFECTED BIGINT unsigned not null comment 'Number of rows affected the statement affected.'," "ROWS_SENT BIGINT unsigned not null comment 'Number of rows returned.'," "ROWS_EXAMINED BIGINT unsigned not null comment 'Number of rows read during the statement''s execution.'," "CREATED_TMP_DISK_TABLES BIGINT unsigned not null comment 'Number of on-disk temp tables created by the statement.'," "CREATED_TMP_TABLES BIGINT unsigned not null comment 'Number of temp tables created by the statement.'," "SELECT_FULL_JOIN BIGINT unsigned not null comment 'Number of joins performed by the statement which did not use an index.'," "SELECT_FULL_RANGE_JOIN BIGINT unsigned not null comment 'Number of joins performed by the statement which used a range search of the first table.'," "SELECT_RANGE BIGINT unsigned not null comment 'Number of joins performed by the statement which used a range of the first table.'," "SELECT_RANGE_CHECK BIGINT unsigned not null comment 'Number of joins without keys performed by the statement that check for key usage after each row.'," "SELECT_SCAN BIGINT unsigned not null comment 'Number of joins performed by the statement which used a full scan of the first table.'," "SORT_MERGE_PASSES BIGINT unsigned not null comment 'Number of merge passes by the sort algorithm performed by the statement. If too high, you may need to increase the sort_buffer_size.'," "SORT_RANGE BIGINT unsigned not null comment 'Number of sorts performed by the statement which used a range.'," "SORT_ROWS BIGINT unsigned not null comment 'Number of rows sorted by the statement.'," "SORT_SCAN BIGINT unsigned not null comment 'Number of sorts performed by the statement which used a full table scan.'," "NO_INDEX_USED BIGINT unsigned not null comment '0 if the statement performed a table scan with an index, 1 if without an index.'," "NO_GOOD_INDEX_USED BIGINT unsigned not null comment '0 if a good index was found for the statement, 1 if no good index was found. See the Range checked for each record description in the EXPLAIN article.'," "NESTING_EVENT_ID BIGINT unsigned comment 'NULL for top level statements. The parent statement event id for nested statements (stored programs).'," "NESTING_EVENT_TYPE ENUM('TRANSACTION', 'STATEMENT', 'STAGE', 'WAIT') comment 'NULL for top level statements. The parent statement event type for nested statements (stored programs).'," "NESTING_EVENT_LEVEL INT comment '0 for top level statements. The parent statement level plus 1 for nested statements (stored programs).')") }, false, /* m_perpetual */ false, /* m_optional */
&m_share_state
};
PFS_engine_table_share
table_events_statements_history::m_share=
{
{ C_STRING_WITH_LEN("events_statements_history") },
&pfs_truncatable_acl,
table_events_statements_history::create,
NULL, /* write_row */
table_events_statements_history::delete_all_rows,
table_events_statements_history::get_row_count, sizeof(pos_events_statements_history), /* ref length */
&m_table_lock,
{ C_STRING_WITH_LEN("CREATE TABLE events_statements_history(" "THREAD_ID BIGINT unsigned not null comment 'Thread associated with the event. Together with EVENT_ID uniquely identifies the row.'," "EVENT_ID BIGINT unsigned not null comment 'Thread''s current event number at the start of the event. Together with THREAD_ID uniquely identifies the row.'," "END_EVENT_ID BIGINT unsigned comment 'NULL when the event starts, set to the thread''s current event number at the end of the event.'," "EVENT_NAME VARCHAR(128) not null comment 'Event instrument name and a NAME from the setup_instruments table'," "SOURCE VARCHAR(64) comment 'Name and line number of the source file containing the instrumented code that produced the event.'," "TIMER_START BIGINT unsigned comment 'Value in picoseconds when the event timing started or NULL if timing is not collected.'," "TIMER_END BIGINT unsigned comment 'Value in picoseconds when the event timing ended, or NULL if the event has not ended or timing is not collected.'," "TIMER_WAIT BIGINT unsigned comment 'Value in picoseconds of the event''s duration or NULL if the event has not ended or timing is not collected.'," "LOCK_TIME bigint unsigned not null comment 'Time in picoseconds spent waiting for locks. The time is calculated in microseconds but stored in picoseconds for compatibility with other timings.'," "SQL_TEXT LONGTEXT comment 'The SQL statement, or NULL if the command is not associated with an SQL statement.'," "DIGEST VARCHAR(32) comment 'Statement digest.'," "DIGEST_TEXT LONGTEXT comment 'Statement digest text.'," "CURRENT_SCHEMA VARCHAR(64) comment 'Statement''s default database for the statement, or NULL if there was none.'," "OBJECT_TYPE VARCHAR(64) comment 'NULL for top level statements. The parent statement object type for nested statements (stored programs).'," "OBJECT_SCHEMA VARCHAR(64) comment 'NULL for top level statements. The parent statement object schema for nested statements (stored programs).'," "OBJECT_NAME VARCHAR(64) comment 'NULL for top level statements. The parent statement object name for nested statements (stored programs).'," "OBJECT_INSTANCE_BEGIN BIGINT unsigned comment 'Address in memory of the statement object.'," "MYSQL_ERRNO INTEGER comment 'Error code. See MariaDB Error Codes for a full list.'," "RETURNED_SQLSTATE VARCHAR(5) comment 'The SQLSTATE value.'," "MESSAGE_TEXT VARCHAR(128) comment 'Statement error message. See MariaDB Error Codes.'," "ERRORS BIGINT unsigned not null comment '0 if SQLSTATE signifies completion (starting with 00) or warning (01), otherwise 1.'," "WARNINGS BIGINT unsigned not null comment 'Number of warnings from the diagnostics area.'," "ROWS_AFFECTED BIGINT unsigned not null comment 'Number of rows affected the statement affected.'," "ROWS_SENT BIGINT unsigned not null comment 'Number of rows returned.'," "ROWS_EXAMINED BIGINT unsigned not null comment 'Number of rows read during the statement''s execution.'," "CREATED_TMP_DISK_TABLES BIGINT unsigned not null comment 'Number of on-disk temp tables created by the statement.'," "CREATED_TMP_TABLES BIGINT unsigned not null comment 'Number of temp tables created by the statement.'," "SELECT_FULL_JOIN BIGINT unsigned not null comment 'Number of joins performed by the statement which did not use an index.'," "SELECT_FULL_RANGE_JOIN BIGINT unsigned not null comment 'Number of joins performed by the statement which used a range search of the first table.'," "SELECT_RANGE BIGINT unsigned not null comment 'Number of joins performed by the statement which used a range of the first table.'," "SELECT_RANGE_CHECK BIGINT unsigned not null comment 'Number of joins without keys performed by the statement that check for key usage after each row.'," "SELECT_SCAN BIGINT unsigned not null comment 'Number of joins performed by the statement which used a full scan of the first table.'," "SORT_MERGE_PASSES BIGINT unsigned not null comment 'Number of merge passes by the sort algorithm performed by the statement. If too high, you may need to increase the sort_buffer_size.'," "SORT_RANGE BIGINT unsigned not null comment 'Number of sorts performed by the statement which used a range.'," "SORT_ROWS BIGINT unsigned not null comment 'Number of rows sorted by the statement.'," "SORT_SCAN BIGINT unsigned not null comment 'Number of sorts performed by the statement which used a full table scan.'," "NO_INDEX_USED BIGINT unsigned not null comment '0 if the statement performed a table scan with an index, 1 if without an index.'," "NO_GOOD_INDEX_USED BIGINT unsigned not null comment '0 if a good index was found for the statement, 1 if no good index was found. See the Range checked for each record description in the EXPLAIN article.'," "NESTING_EVENT_ID BIGINT unsigned comment 'NULL for top level statements. The parent statement event id for nested statements (stored programs).'," "NESTING_EVENT_TYPE ENUM('TRANSACTION', 'STATEMENT', 'STAGE', 'WAIT') comment 'NULL for top level statements. The parent statement event type for nested statements (stored programs).'," "NESTING_EVENT_LEVEL INT comment '0 for top level statements. The parent statement level plus 1 for nested statements (stored programs).')") }, false, /* m_perpetual */ false, /* m_optional */
&m_share_state
};
PFS_engine_table_share
table_events_statements_history_long::m_share=
{
{ C_STRING_WITH_LEN("events_statements_history_long") },
&pfs_truncatable_acl,
table_events_statements_history_long::create,
NULL, /* write_row */
table_events_statements_history_long::delete_all_rows,
table_events_statements_history_long::get_row_count, sizeof(PFS_simple_index), /* ref length */
&m_table_lock,
{ C_STRING_WITH_LEN("CREATE TABLE events_statements_history_long(" "THREAD_ID BIGINT unsigned not null comment 'Thread associated with the event. Together with EVENT_ID uniquely identifies the row.'," "EVENT_ID BIGINT unsigned not null comment 'Thread''s current event number at the start of the event. Together with THREAD_ID uniquely identifies the row.'," "END_EVENT_ID BIGINT unsigned comment 'NULL when the event starts, set to the thread''s current event number at the end of the event.'," "EVENT_NAME VARCHAR(128) not null comment 'Event instrument name and a NAME from the setup_instruments table'," "SOURCE VARCHAR(64) comment 'Name and line number of the source file containing the instrumented code that produced the event.'," "TIMER_START BIGINT unsigned comment 'Value in picoseconds when the event timing started or NULL if timing is not collected.'," "TIMER_END BIGINT unsigned comment 'Value in picoseconds when the event timing ended, or NULL if the event has not ended or timing is not collected.'," "TIMER_WAIT BIGINT unsigned comment 'Value in picoseconds of the event''s duration or NULL if the event has not ended or timing is not collected.'," "LOCK_TIME bigint unsigned not null comment 'Time in picoseconds spent waiting for locks. The time is calculated in microseconds but stored in picoseconds for compatibility with other timings.'," "SQL_TEXT LONGTEXT comment 'The SQL statement, or NULL if the command is not associated with an SQL statement.'," "DIGEST VARCHAR(32) comment 'Statement digest.'," "DIGEST_TEXT LONGTEXT comment 'Statement digest text.'," "CURRENT_SCHEMA VARCHAR(64) comment 'Statement''s default database for the statement, or NULL if there was none.'," "OBJECT_TYPE VARCHAR(64) comment 'NULL for top level statements. The parent statement object type for nested statements (stored programs).'," "OBJECT_SCHEMA VARCHAR(64) comment 'NULL for top level statements. The parent statement object schema for nested statements (stored programs).'," "OBJECT_NAME VARCHAR(64) comment 'NULL for top level statements. The parent statement object name for nested statements (stored programs).'," "OBJECT_INSTANCE_BEGIN BIGINT unsigned comment 'Address in memory of the statement object.'," "MYSQL_ERRNO INTEGER comment 'Error code. See MariaDB Error Codes for a full list.'," "RETURNED_SQLSTATE VARCHAR(5) comment 'The SQLSTATE value.'," "MESSAGE_TEXT VARCHAR(128) comment 'Statement error message. See MariaDB Error Codes.'," "ERRORS BIGINT unsigned not null comment '0 if SQLSTATE signifies completion (starting with 00) or warning (01), otherwise 1.'," "WARNINGS BIGINT unsigned not null comment 'Number of warnings from the diagnostics area.'," "ROWS_AFFECTED BIGINT unsigned not null comment 'Number of rows affected the statement affected.'," "ROWS_SENT BIGINT unsigned not null comment 'Number of rows returned.'," "ROWS_EXAMINED BIGINT unsigned not null comment 'Number of rows read during the statement''s execution.'," "CREATED_TMP_DISK_TABLES BIGINT unsigned not null comment 'Number of on-disk temp tables created by the statement.'," "CREATED_TMP_TABLES BIGINT unsigned not null comment 'Number of temp tables created by the statement.'," "SELECT_FULL_JOIN BIGINT unsigned not null comment 'Number of joins performed by the statement which did not use an index.'," "SELECT_FULL_RANGE_JOIN BIGINT unsigned not null comment 'Number of joins performed by the statement which used a range search of the first table.'," "SELECT_RANGE BIGINT unsigned not null comment 'Number of joins performed by the statement which used a range of the first table.'," "SELECT_RANGE_CHECK BIGINT unsigned not null comment 'Number of joins without keys performed by the statement that check for key usage after each row.'," "SELECT_SCAN BIGINT unsigned not null comment 'Number of joins performed by the statement which used a full scan of the first table.'," "SORT_MERGE_PASSES BIGINT unsigned not null comment 'Number of merge passes by the sort algorithm performed by the statement. If too high, you may need to increase the sort_buffer_size.'," "SORT_RANGE BIGINT unsigned not null comment 'Number of sorts performed by the statement which used a range.'," "SORT_ROWS BIGINT unsigned not null comment 'Number of rows sorted by the statement.'," "SORT_SCAN BIGINT unsigned not null comment 'Number of sorts performed by the statement which used a full table scan.'," "NO_INDEX_USED BIGINT unsigned not null comment '0 if the statement performed a table scan with an index, 1 if without an index.'," "NO_GOOD_INDEX_USED BIGINT unsigned not null comment '0 if a good index was found for the statement, 1 if no good index was found. See the Range checked for each record description in the EXPLAIN article.'," "NESTING_EVENT_ID BIGINT unsigned comment 'NULL for top level statements. The parent statement event id for nested statements (stored programs).'," "NESTING_EVENT_TYPE ENUM('TRANSACTION', 'STATEMENT', 'STAGE', 'WAIT') comment 'NULL for top level statements. The parent statement event type for nested statements (stored programs).'," "NESTING_EVENT_LEVEL INT comment '0 for top level statements. The parent statement level plus 1 for nested statements (stored programs).')") }, false, /* m_perpetual */ false, /* m_optional */
&m_share_state
};
int table_events_statements_current::rnd_init(bool scan)
{ return0;
}
int table_events_statements_current::rnd_next(void)
{
PFS_thread *pfs_thread;
PFS_events_statements *statement; bool has_more_thread= true;
for (m_pos.set_at(&m_next_pos);
has_more_thread;
m_pos.next_thread())
{
pfs_thread= global_thread_container.get(m_pos.m_index_1, & has_more_thread); if (pfs_thread != NULL)
{
uint safe_events_statements_count= pfs_thread->m_events_statements_count;
if (safe_events_statements_count == 0)
{ /* Display the last top level statement, when completed */ if (m_pos.m_index_2 >= 1) continue;
} else
{ /* Display all pending statements, when in progress */ if (m_pos.m_index_2 >= safe_events_statements_count) continue;
}
int table_events_statements_current::rnd_pos(constvoid *pos)
{
PFS_thread *pfs_thread;
PFS_events_statements *statement;
set_position(pos);
pfs_thread= global_thread_container.get(m_pos.m_index_1); if (pfs_thread != NULL)
{
uint safe_events_statements_count= pfs_thread->m_events_statements_count;
if (safe_events_statements_count == 0)
{ /* Display the last top level statement, when completed */ if (m_pos.m_index_2 >= 1) return HA_ERR_RECORD_DELETED;
} else
{ /* Display all pending statements, when in progress */ if (m_pos.m_index_2 >= safe_events_statements_count) return HA_ERR_RECORD_DELETED;
}
digest.reset(m_token_array, MAX_DIGEST_STORAGE_SIZE); /* Protect this reader against thread termination. */
pfs_thread->m_lock.begin_optimistic_lock(&lock); /* Protect this reader against writing on statement information. */
pfs_thread->m_stmt_lock.begin_optimistic_lock(&stmt_lock);
int table_events_statements_history::rnd_init(bool scan)
{ return0;
}
int table_events_statements_history::rnd_next(void)
{
PFS_thread *pfs_thread;
PFS_events_statements *statement; bool has_more_thread= true;
if (events_statements_history_per_thread == 0) return HA_ERR_END_OF_FILE;
for (m_pos.set_at(&m_next_pos);
has_more_thread;
m_pos.next_thread())
{
pfs_thread= global_thread_container.get(m_pos.m_index_1, & has_more_thread); if (pfs_thread != NULL)
{ if (m_pos.m_index_2 >= events_statements_history_per_thread)
{ /* This thread does not have more (full) history */ continue;
}
if ( ! pfs_thread->m_statements_history_full &&
(m_pos.m_index_2 >= pfs_thread->m_statements_history_index))
{ /* This thread does not have more (not full) history */ continue;
}
if (statement->m_event.m_class)
{
make_row(pfs_thread, statement); /* Next iteration, look for the next history in this thread */
m_next_pos.set_after(&m_pos); return0;
}
}
}
return HA_ERR_END_OF_FILE;
}
int table_events_statements_history::rnd_pos(constvoid *pos)
{
PFS_thread *pfs_thread;
PFS_events_statements *statement;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.