forked from facebook/mysql-5.6
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enable performance_schema.events_errors_summary_global_by_error
Summary: Create a new variable performance_schema_ees_by_object_by_error that enables/disables all 4 detailed ees tables. Reviewed By: george-reynya Differential Revision: D39971029 ------------------------------------------------------------------------------------- Fix sys_vars for pfs_ee_by_object_by_error Summary: The sysvars test was named incorrectly, so it got picked up by the all_vars test. Reviewed By: george-reynya Differential Revision: D42588561
- Loading branch information
Showing
14 changed files
with
129 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
mysql-test/suite/perfschema/r/performance_schema_ees.result
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
show global variables like 'performance_schema_ees_by_object_by_error'; | ||
Variable_name Value | ||
performance_schema_ees_by_object_by_error OFF | ||
truncate table performance_schema.events_errors_summary_global_by_error; | ||
select * from foo; | ||
ERROR 42S02: Table 'test.foo' doesn't exist | ||
select ERROR_NAME, SQL_STATE, SUM_ERROR_RAISED from performance_schema.events_errors_summary_global_by_error where | ||
SUM_ERROR_RAISED != 0 AND | ||
SQL_STATE='42S02' AND | ||
ERROR_NAME='ER_NO_SUCH_TABLE'; | ||
ERROR_NAME SQL_STATE SUM_ERROR_RAISED | ||
ER_NO_SUCH_TABLE 42S02 1 | ||
select * from performance_schema.events_errors_summary_by_thread_by_error where SUM_ERROR_RAISED != 0; | ||
THREAD_ID ERROR_NUMBER ERROR_NAME SQL_STATE SUM_ERROR_RAISED SUM_ERROR_HANDLED FIRST_SEEN LAST_SEEN | ||
select * from performance_schema.events_errors_summary_by_account_by_error where SUM_ERROR_RAISED != 0; | ||
USER HOST ERROR_NUMBER ERROR_NAME SQL_STATE SUM_ERROR_RAISED SUM_ERROR_HANDLED FIRST_SEEN LAST_SEEN | ||
select * from performance_schema.events_errors_summary_by_user_by_error where SUM_ERROR_RAISED != 0; | ||
USER ERROR_NUMBER ERROR_NAME SQL_STATE SUM_ERROR_RAISED SUM_ERROR_HANDLED FIRST_SEEN LAST_SEEN | ||
select * from performance_schema.events_errors_summary_by_host_by_error where SUM_ERROR_RAISED != 0; | ||
HOST ERROR_NUMBER ERROR_NAME SQL_STATE SUM_ERROR_RAISED SUM_ERROR_HANDLED FIRST_SEEN LAST_SEEN |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Tests for PERFORMANCE_SCHEMA | ||
# Check server start options, read from a .cnf file | ||
|
||
# Use default setting for mysqld processes | ||
!include include/default_mysqld.cnf | ||
|
||
[mysqld.1] | ||
loose-performance_schema_ees_by_object_by_error=OFF |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Tests for PERFORMANCE_SCHEMA | ||
# Check server start options, read from a .cnf file | ||
|
||
show global variables like 'performance_schema_ees_by_object_by_error'; | ||
|
||
# Reset stats before the test | ||
truncate table performance_schema.events_errors_summary_global_by_error; | ||
|
||
# Generate an arbitrary error | ||
--error ER_NO_SUCH_TABLE | ||
select * from foo; | ||
|
||
# Check that error exists in events_errors_summary_global_by_error table | ||
select ERROR_NAME, SQL_STATE, SUM_ERROR_RAISED from performance_schema.events_errors_summary_global_by_error where | ||
SUM_ERROR_RAISED != 0 AND | ||
SQL_STATE='42S02' AND | ||
ERROR_NAME='ER_NO_SUCH_TABLE'; | ||
|
||
# Check that granular ees tables do not exist | ||
select * from performance_schema.events_errors_summary_by_thread_by_error where SUM_ERROR_RAISED != 0; | ||
select * from performance_schema.events_errors_summary_by_account_by_error where SUM_ERROR_RAISED != 0; | ||
select * from performance_schema.events_errors_summary_by_user_by_error where SUM_ERROR_RAISED != 0; | ||
select * from performance_schema.events_errors_summary_by_host_by_error where SUM_ERROR_RAISED != 0; |
23 changes: 23 additions & 0 deletions
23
mysql-test/suite/sys_vars/r/pfs_ees_by_object_by_error_basic.result
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
select @@global.performance_schema_ees_by_object_by_error; | ||
@@global.performance_schema_ees_by_object_by_error | ||
1 | ||
select @@session.performance_schema_ees_by_object_by_error; | ||
ERROR HY000: Variable 'performance_schema_ees_by_object_by_error' is a GLOBAL variable | ||
show global variables like 'performance_schema_ees_by_object_by_error'; | ||
Variable_name Value | ||
performance_schema_ees_by_object_by_error ON | ||
show session variables like 'performance_schema_ees_by_object_by_error'; | ||
Variable_name Value | ||
performance_schema_ees_by_object_by_error ON | ||
select * from performance_schema.global_variables | ||
where variable_name='performance_schema_ees_by_object_by_error'; | ||
VARIABLE_NAME VARIABLE_VALUE | ||
performance_schema_ees_by_object_by_error ON | ||
select * from performance_schema.session_variables | ||
where variable_name='performance_schema_ees_by_object_by_error'; | ||
VARIABLE_NAME VARIABLE_VALUE | ||
performance_schema_ees_by_object_by_error ON | ||
set global performance_schema_ees_by_object_by_error = 1; | ||
ERROR HY000: Variable 'performance_schema_ees_by_object_by_error' is a read only variable | ||
set session performance_schema_ees_by_object_by_error = 1; | ||
ERROR HY000: Variable 'performance_schema_ees_by_object_by_error' is a read only variable |
30 changes: 30 additions & 0 deletions
30
mysql-test/suite/sys_vars/t/pfs_ees_by_object_by_error_basic.test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# | ||
# Only global | ||
# | ||
|
||
select @@global.performance_schema_ees_by_object_by_error; | ||
|
||
--error ER_INCORRECT_GLOBAL_LOCAL_VAR | ||
select @@session.performance_schema_ees_by_object_by_error; | ||
|
||
show global variables like 'performance_schema_ees_by_object_by_error'; | ||
|
||
show session variables like 'performance_schema_ees_by_object_by_error'; | ||
|
||
--disable_warnings | ||
select * from performance_schema.global_variables | ||
where variable_name='performance_schema_ees_by_object_by_error'; | ||
|
||
select * from performance_schema.session_variables | ||
where variable_name='performance_schema_ees_by_object_by_error'; | ||
--enable_warnings | ||
|
||
# | ||
# Read-only | ||
# | ||
|
||
--error ER_INCORRECT_GLOBAL_LOCAL_VAR | ||
set global performance_schema_ees_by_object_by_error = 1; | ||
|
||
--error ER_INCORRECT_GLOBAL_LOCAL_VAR | ||
set session performance_schema_ees_by_object_by_error = 1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters