Commit c1f9a9d9 authored by Marc Alff's avatar Marc Alff

Bug#58621 perfschema.dml_ews_by_thread_by_event_name test failure

This fix affects the test suite only.

Before this fix, performance schema tests dml_*.test could
fail with spurious failure, depending on the table content.

This fix simplifies the SELECT tests in the dml_*.test scripts,
to only verify that the SELECT operation passed the security checks
and succeeded, which was the original intent of the test.

Usage of 
  --replace_column 1 # 2 # 3 # 4 # ...
to discard the test output was replaced by a simpler and more maintainable 
  --disable_result_log
which also work for empty tables.
parent 59f56444
select * from performance_schema.cond_instances limit 1;
NAME OBJECT_INSTANCE_BEGIN
# #
select * from performance_schema.cond_instances
where name='FOO';
NAME OBJECT_INSTANCE_BEGIN
insert into performance_schema.cond_instances
set name='FOO', object_instance_begin=12;
ERROR 42000: INSERT command denied to user 'root'@'localhost' for table 'cond_instances'
......
select * from performance_schema.events_waits_current
where event_name like 'Wait/Synch/%' limit 1;
THREAD_ID EVENT_ID EVENT_NAME SOURCE TIMER_START TIMER_END TIMER_WAIT SPINS OBJECT_SCHEMA OBJECT_NAME OBJECT_TYPE OBJECT_INSTANCE_BEGIN NESTING_EVENT_ID OPERATION NUMBER_OF_BYTES FLAGS
# # # # # # # # NULL NULL NULL # NULL # NULL 0
select * from performance_schema.events_waits_current
where event_name='FOO';
THREAD_ID EVENT_ID EVENT_NAME SOURCE TIMER_START TIMER_END TIMER_WAIT SPINS OBJECT_SCHEMA OBJECT_NAME OBJECT_TYPE OBJECT_INSTANCE_BEGIN NESTING_EVENT_ID OPERATION NUMBER_OF_BYTES FLAGS
insert into performance_schema.events_waits_current
set thread_id='1', event_id=1,
event_name='FOO', timer_start=1, timer_end=2, timer_wait=3;
......
select * from performance_schema.events_waits_history
where event_name like 'Wait/Synch/%' limit 1;
THREAD_ID EVENT_ID EVENT_NAME SOURCE TIMER_START TIMER_END TIMER_WAIT SPINS OBJECT_SCHEMA OBJECT_NAME OBJECT_TYPE OBJECT_INSTANCE_BEGIN NESTING_EVENT_ID OPERATION NUMBER_OF_BYTES FLAGS
# # # # # # # # NULL NULL NULL # NULL # NULL 0
select * from performance_schema.events_waits_history
where event_name='FOO';
THREAD_ID EVENT_ID EVENT_NAME SOURCE TIMER_START TIMER_END TIMER_WAIT SPINS OBJECT_SCHEMA OBJECT_NAME OBJECT_TYPE OBJECT_INSTANCE_BEGIN NESTING_EVENT_ID OPERATION NUMBER_OF_BYTES FLAGS
select * from performance_schema.events_waits_history
where event_name like 'Wait/Synch/%' order by timer_wait limit 1;
THREAD_ID EVENT_ID EVENT_NAME SOURCE TIMER_START TIMER_END TIMER_WAIT SPINS OBJECT_SCHEMA OBJECT_NAME OBJECT_TYPE OBJECT_INSTANCE_BEGIN NESTING_EVENT_ID OPERATION NUMBER_OF_BYTES FLAGS
# # # # # # # # NULL NULL NULL # NULL # NULL 0
select * from performance_schema.events_waits_history
where event_name like 'Wait/Synch/%' order by timer_wait desc limit 1;
THREAD_ID EVENT_ID EVENT_NAME SOURCE TIMER_START TIMER_END TIMER_WAIT SPINS OBJECT_SCHEMA OBJECT_NAME OBJECT_TYPE OBJECT_INSTANCE_BEGIN NESTING_EVENT_ID OPERATION NUMBER_OF_BYTES FLAGS
# # # # # # # # NULL NULL NULL # NULL # NULL 0
insert into performance_schema.events_waits_history
set thread_id='1', event_id=1,
event_name='FOO', timer_start=1, timer_end=2, timer_wait=3;
......
select * from performance_schema.events_waits_history_long
where event_name like 'Wait/Synch/%' limit 1;
THREAD_ID EVENT_ID EVENT_NAME SOURCE TIMER_START TIMER_END TIMER_WAIT SPINS OBJECT_SCHEMA OBJECT_NAME OBJECT_TYPE OBJECT_INSTANCE_BEGIN NESTING_EVENT_ID OPERATION NUMBER_OF_BYTES FLAGS
# # # # # # # # NULL NULL NULL # NULL # NULL 0
select * from performance_schema.events_waits_history_long
where event_name='FOO';
THREAD_ID EVENT_ID EVENT_NAME SOURCE TIMER_START TIMER_END TIMER_WAIT SPINS OBJECT_SCHEMA OBJECT_NAME OBJECT_TYPE OBJECT_INSTANCE_BEGIN NESTING_EVENT_ID OPERATION NUMBER_OF_BYTES FLAGS
select * from performance_schema.events_waits_history_long
where event_name like 'Wait/Synch/%' order by timer_wait limit 1;
THREAD_ID EVENT_ID EVENT_NAME SOURCE TIMER_START TIMER_END TIMER_WAIT SPINS OBJECT_SCHEMA OBJECT_NAME OBJECT_TYPE OBJECT_INSTANCE_BEGIN NESTING_EVENT_ID OPERATION NUMBER_OF_BYTES FLAGS
# # # # # # # # NULL NULL NULL # NULL # NULL 0
select * from performance_schema.events_waits_history_long
where event_name like 'Wait/Synch/%' order by timer_wait desc limit 1;
THREAD_ID EVENT_ID EVENT_NAME SOURCE TIMER_START TIMER_END TIMER_WAIT SPINS OBJECT_SCHEMA OBJECT_NAME OBJECT_TYPE OBJECT_INSTANCE_BEGIN NESTING_EVENT_ID OPERATION NUMBER_OF_BYTES FLAGS
# # # # # # # # NULL NULL NULL # NULL # NULL 0
insert into performance_schema.events_waits_history_long
set thread_id='1', event_id=1,
event_name='FOO', timer_start=1, timer_end=2, timer_wait=3;
......
select * from performance_schema.events_waits_summary_by_instance
where event_name like 'Wait/Synch/%' limit 1;
EVENT_NAME OBJECT_INSTANCE_BEGIN COUNT_STAR SUM_TIMER_WAIT MIN_TIMER_WAIT AVG_TIMER_WAIT MAX_TIMER_WAIT
# # # # # # #
select * from performance_schema.events_waits_summary_by_instance
where event_name='FOO';
EVENT_NAME OBJECT_INSTANCE_BEGIN COUNT_STAR SUM_TIMER_WAIT MIN_TIMER_WAIT AVG_TIMER_WAIT MAX_TIMER_WAIT
select * from performance_schema.events_waits_summary_by_instance
order by count_star limit 1;
EVENT_NAME OBJECT_INSTANCE_BEGIN COUNT_STAR SUM_TIMER_WAIT MIN_TIMER_WAIT AVG_TIMER_WAIT MAX_TIMER_WAIT
# # # # # # #
select * from performance_schema.events_waits_summary_by_instance
order by count_star desc limit 1;
EVENT_NAME OBJECT_INSTANCE_BEGIN COUNT_STAR SUM_TIMER_WAIT MIN_TIMER_WAIT AVG_TIMER_WAIT MAX_TIMER_WAIT
# # # # # # #
select * from performance_schema.events_waits_summary_by_instance
where min_timer_wait > 0 order by count_star limit 1;
EVENT_NAME OBJECT_INSTANCE_BEGIN COUNT_STAR SUM_TIMER_WAIT MIN_TIMER_WAIT AVG_TIMER_WAIT MAX_TIMER_WAIT
# # # # # # #
select * from performance_schema.events_waits_summary_by_instance
where min_timer_wait > 0 order by count_star desc limit 1;
EVENT_NAME OBJECT_INSTANCE_BEGIN COUNT_STAR SUM_TIMER_WAIT MIN_TIMER_WAIT AVG_TIMER_WAIT MAX_TIMER_WAIT
# # # # # # #
insert into performance_schema.events_waits_summary_by_instance
set event_name='FOO', object_instance_begin=0,
count_star=1, sum_timer_wait=2, min_timer_wait=3,
......
select * from performance_schema.events_waits_summary_by_thread_by_event_name
where event_name like 'Wait/Synch/%' limit 1;
THREAD_ID EVENT_NAME COUNT_STAR SUM_TIMER_WAIT MIN_TIMER_WAIT AVG_TIMER_WAIT MAX_TIMER_WAIT
# # # # # # #
select * from performance_schema.events_waits_summary_by_thread_by_event_name
where event_name='FOO';
THREAD_ID EVENT_NAME COUNT_STAR SUM_TIMER_WAIT MIN_TIMER_WAIT AVG_TIMER_WAIT MAX_TIMER_WAIT
insert into performance_schema.events_waits_summary_by_thread_by_event_name
set event_name='FOO', thread_id=1,
count_star=1, sum_timer_wait=2, min_timer_wait=3,
......
select * from performance_schema.events_waits_summary_global_by_event_name
where event_name like 'Wait/Synch/%' limit 1;
EVENT_NAME COUNT_STAR SUM_TIMER_WAIT MIN_TIMER_WAIT AVG_TIMER_WAIT MAX_TIMER_WAIT
# # # # # #
select * from performance_schema.events_waits_summary_global_by_event_name
where event_name='FOO';
EVENT_NAME COUNT_STAR SUM_TIMER_WAIT MIN_TIMER_WAIT AVG_TIMER_WAIT MAX_TIMER_WAIT
insert into performance_schema.events_waits_summary_global_by_event_name
set event_name='FOO', count_star=1, sum_timer_wait=2, min_timer_wait=3,
avg_timer_wait=4, max_timer_wait=5;
......
select * from performance_schema.file_instances limit 1;
FILE_NAME EVENT_NAME OPEN_COUNT
# # #
select * from performance_schema.file_instances
where file_name='FOO';
FILE_NAME EVENT_NAME OPEN_COUNT
insert into performance_schema.file_instances
set file_name='FOO', event_name='BAR', open_count=12;
ERROR 42000: INSERT command denied to user 'root'@'localhost' for table 'file_instances'
......
select * from performance_schema.file_summary_by_event_name
where event_name like 'Wait/io/%' limit 1;
EVENT_NAME COUNT_READ COUNT_WRITE SUM_NUMBER_OF_BYTES_READ SUM_NUMBER_OF_BYTES_WRITE
# # # # #
select * from performance_schema.file_summary_by_event_name
where event_name='FOO';
EVENT_NAME COUNT_READ COUNT_WRITE SUM_NUMBER_OF_BYTES_READ SUM_NUMBER_OF_BYTES_WRITE
insert into performance_schema.file_summary_by_event_name
set event_name='FOO', count_read=1, count_write=2,
sum_number_of_bytes_read=4, sum_number_of_bytes_write=5;
......
select * from performance_schema.file_summary_by_instance
where event_name like 'Wait/io/%' limit 1;
FILE_NAME EVENT_NAME COUNT_READ COUNT_WRITE SUM_NUMBER_OF_BYTES_READ SUM_NUMBER_OF_BYTES_WRITE
# # # # # #
select * from performance_schema.file_summary_by_instance
where event_name='FOO';
FILE_NAME EVENT_NAME COUNT_READ COUNT_WRITE SUM_NUMBER_OF_BYTES_READ SUM_NUMBER_OF_BYTES_WRITE
insert into performance_schema.file_summary_by_instance
set event_name='FOO', count_read=1, count_write=2,
sum_number_of_bytes_read=4, sum_number_of_bytes_write=5;
......
select * from performance_schema.mutex_instances limit 1;
NAME OBJECT_INSTANCE_BEGIN LOCKED_BY_THREAD_ID
# # #
select * from performance_schema.mutex_instances
where name='FOO';
NAME OBJECT_INSTANCE_BEGIN LOCKED_BY_THREAD_ID
insert into performance_schema.mutex_instances
set name='FOO', object_instance_begin=12;
ERROR 42000: INSERT command denied to user 'root'@'localhost' for table 'mutex_instances'
......
select * from performance_schema.rwlock_instances limit 1;
NAME OBJECT_INSTANCE_BEGIN WRITE_LOCKED_BY_THREAD_ID READ_LOCKED_BY_COUNT
# # # #
select * from performance_schema.rwlock_instances
where name='FOO';
NAME OBJECT_INSTANCE_BEGIN WRITE_LOCKED_BY_THREAD_ID READ_LOCKED_BY_COUNT
insert into performance_schema.rwlock_instances
set name='FOO', object_instance_begin=12;
ERROR 42000: INSERT command denied to user 'root'@'localhost' for table 'rwlock_instances'
......
select * from performance_schema.threads
where name like 'Thread/%' limit 1;
THREAD_ID PROCESSLIST_ID NAME
# # #
select * from performance_schema.threads
where name='FOO';
THREAD_ID PROCESSLIST_ID NAME
insert into performance_schema.threads
set name='FOO', thread_id=1, processlist_id=2;
ERROR 42000: INSERT command denied to user 'root'@'localhost' for table 'threads'
......
......@@ -18,11 +18,12 @@
--source include/not_embedded.inc
--source include/have_perfschema.inc
--replace_column 1 # 2 #
--disable_result_log
select * from performance_schema.cond_instances limit 1;
select * from performance_schema.cond_instances
where name='FOO';
--enable_result_log
--error ER_TABLEACCESS_DENIED_ERROR
insert into performance_schema.cond_instances
......
......@@ -18,12 +18,13 @@
--source include/not_embedded.inc
--source include/have_perfschema.inc
--replace_column 1 # 2 # 3 # 4 # 5 # 6 # 7 # 8 # 12 # 14 #
--disable_result_log
select * from performance_schema.events_waits_current
where event_name like 'Wait/Synch/%' limit 1;
select * from performance_schema.events_waits_current
where event_name='FOO';
--enable_result_log
--error ER_TABLEACCESS_DENIED_ERROR
insert into performance_schema.events_waits_current
......
......@@ -18,20 +18,19 @@
--source include/not_embedded.inc
--source include/have_perfschema.inc
--replace_column 1 # 2 # 3 # 4 # 5 # 6 # 7 # 8 # 12 # 14 #
--disable_result_log
select * from performance_schema.events_waits_history
where event_name like 'Wait/Synch/%' limit 1;
select * from performance_schema.events_waits_history
where event_name='FOO';
--replace_column 1 # 2 # 3 # 4 # 5 # 6 # 7 # 8 # 12 # 14 #
select * from performance_schema.events_waits_history
where event_name like 'Wait/Synch/%' order by timer_wait limit 1;
--replace_column 1 # 2 # 3 # 4 # 5 # 6 # 7 # 8 # 12 # 14 #
select * from performance_schema.events_waits_history
where event_name like 'Wait/Synch/%' order by timer_wait desc limit 1;
--enable_result_log
--error ER_TABLEACCESS_DENIED_ERROR
insert into performance_schema.events_waits_history
......
......@@ -18,20 +18,19 @@
--source include/not_embedded.inc
--source include/have_perfschema.inc
--replace_column 1 # 2 # 3 # 4 # 5 # 6 # 7 # 8 # 12 # 14 #
--disable_result_log
select * from performance_schema.events_waits_history_long
where event_name like 'Wait/Synch/%' limit 1;
select * from performance_schema.events_waits_history_long
where event_name='FOO';
--replace_column 1 # 2 # 3 # 4 # 5 # 6 # 7 # 8 # 12 # 14 #
select * from performance_schema.events_waits_history_long
where event_name like 'Wait/Synch/%' order by timer_wait limit 1;
--replace_column 1 # 2 # 3 # 4 # 5 # 6 # 7 # 8 # 12 # 14 #
select * from performance_schema.events_waits_history_long
where event_name like 'Wait/Synch/%' order by timer_wait desc limit 1;
--enable_result_log
--error ER_TABLEACCESS_DENIED_ERROR
insert into performance_schema.events_waits_history_long
......
......@@ -18,28 +18,25 @@
--source include/not_embedded.inc
--source include/have_perfschema.inc
--replace_column 1 # 2 # 3 # 4 # 5 # 6 # 7 #
--disable_result_log
select * from performance_schema.events_waits_summary_by_instance
where event_name like 'Wait/Synch/%' limit 1;
select * from performance_schema.events_waits_summary_by_instance
where event_name='FOO';
--replace_column 1 # 2 # 3 # 4 # 5 # 6 # 7 #
select * from performance_schema.events_waits_summary_by_instance
order by count_star limit 1;
--replace_column 1 # 2 # 3 # 4 # 5 # 6 # 7 #
select * from performance_schema.events_waits_summary_by_instance
order by count_star desc limit 1;
--replace_column 1 # 2 # 3 # 4 # 5 # 6 # 7 #
select * from performance_schema.events_waits_summary_by_instance
where min_timer_wait > 0 order by count_star limit 1;
--replace_column 1 # 2 # 3 # 4 # 5 # 6 # 7 #
select * from performance_schema.events_waits_summary_by_instance
where min_timer_wait > 0 order by count_star desc limit 1;
--enable_result_log
--error ER_TABLEACCESS_DENIED_ERROR
insert into performance_schema.events_waits_summary_by_instance
......
......@@ -18,12 +18,13 @@
--source include/not_embedded.inc
--source include/have_perfschema.inc
--replace_column 1 # 2 # 3 # 4 # 5 # 6 # 7 #
--disable_result_log
select * from performance_schema.events_waits_summary_by_thread_by_event_name
where event_name like 'Wait/Synch/%' limit 1;
select * from performance_schema.events_waits_summary_by_thread_by_event_name
where event_name='FOO';
--enable_result_log
--error ER_TABLEACCESS_DENIED_ERROR
insert into performance_schema.events_waits_summary_by_thread_by_event_name
......
......@@ -18,12 +18,13 @@
--source include/not_embedded.inc
--source include/have_perfschema.inc
--replace_column 1 # 2 # 3 # 4 # 5 # 6 #
--disable_result_log
select * from performance_schema.events_waits_summary_global_by_event_name
where event_name like 'Wait/Synch/%' limit 1;
select * from performance_schema.events_waits_summary_global_by_event_name
where event_name='FOO';
--enable_result_log
--error ER_TABLEACCESS_DENIED_ERROR
insert into performance_schema.events_waits_summary_global_by_event_name
......
......@@ -18,11 +18,12 @@
--source include/not_embedded.inc
--source include/have_perfschema.inc
--replace_column 1 # 2 # 3 #
--disable_result_log
select * from performance_schema.file_instances limit 1;
select * from performance_schema.file_instances
where file_name='FOO';
--enable_result_log
--error ER_TABLEACCESS_DENIED_ERROR
insert into performance_schema.file_instances
......
......@@ -18,12 +18,13 @@
--source include/not_embedded.inc
--source include/have_perfschema.inc
--replace_column 1 # 2 # 3 # 4 # 5 #
--disable_result_log
select * from performance_schema.file_summary_by_event_name
where event_name like 'Wait/io/%' limit 1;
select * from performance_schema.file_summary_by_event_name
where event_name='FOO';
--enable_result_log
--error ER_TABLEACCESS_DENIED_ERROR
insert into performance_schema.file_summary_by_event_name
......
......@@ -18,12 +18,13 @@
--source include/not_embedded.inc
--source include/have_perfschema.inc
--replace_column 1 # 2 # 3 # 4 # 5 # 6 #
--disable_result_log
select * from performance_schema.file_summary_by_instance
where event_name like 'Wait/io/%' limit 1;
select * from performance_schema.file_summary_by_instance
where event_name='FOO';
--enable_result_log
--error ER_TABLEACCESS_DENIED_ERROR
insert into performance_schema.file_summary_by_instance
......
......@@ -18,11 +18,12 @@
--source include/not_embedded.inc
--source include/have_perfschema.inc
--replace_column 1 # 2 # 3 #
--disable_result_log
select * from performance_schema.mutex_instances limit 1;
select * from performance_schema.mutex_instances
where name='FOO';
--enable_result_log
--error ER_TABLEACCESS_DENIED_ERROR
insert into performance_schema.mutex_instances
......
......@@ -18,11 +18,12 @@
--source include/not_embedded.inc
--source include/have_perfschema.inc
--replace_column 1 # 2 # 3 # 4 #
--disable_result_log
select * from performance_schema.rwlock_instances limit 1;
select * from performance_schema.rwlock_instances
where name='FOO';
--enable_result_log
--error ER_TABLEACCESS_DENIED_ERROR
insert into performance_schema.rwlock_instances
......
......@@ -18,12 +18,13 @@
--source include/not_embedded.inc
--source include/have_perfschema.inc
--replace_column 1 # 2 # 3 #
--disable_result_log
select * from performance_schema.threads
where name like 'Thread/%' limit 1;
select * from performance_schema.threads
where name='FOO';
--enable_result_log
--error ER_TABLEACCESS_DENIED_ERROR
insert into performance_schema.threads
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment