mariadb/mysql-test/suite/perfschema/include/table_io_setup_helper.inc
Monty 775cba4d0f MDEV-33145 Add FLUSH GLOBAL STATUS
- FLUSH GLOBAL STATUS now resets most global_status_vars.
  At this stage, this is mainly to be used for testing.
- FLUSH SESSION STATUS added as an alias for FLUSH STATUS.
- FLUSH STATUS does not require any privilege (before required RELOAD).
- FLUSH GLOBAL STATUS requires RELOAD privilege.
- All global status reset moved to FLUSH GLOBAL STATUS.
- Replication semisync status variables are now reset by
  FLUSH GLOBAL STATUS.
- In test cases, the only changes are:
  - Replace FLUSH STATUS with FLUSH GLOBAL STATUS
  - Replace FLUSH STATUS with FLUSH STATUS; FLUSH GLOBAL STATUS.
    This was only done in a few tests where the test was using SHOW STATUS
    for both local and global variables.
- Uptime_since_flush_status is now always provided, independent if
  ENABLED_PROFILING is enabled when compiling MariaDB.
- @@global.Uptime_since_flush_status is reset on FLUSH GLOBAL STATUS
  and @@session.Uptime_since_flush_status is reset on FLUSH SESSION STATUS.
- When connected, @@session.Uptime_since_flush_status is set to 0.
2024-05-27 12:39:03 +02:00

58 lines
1.8 KiB
PHP

# Performance schema test template
# How to use this script in a test case
# =====================================
#
# The general table io test template is as follows
#
# --source include/not_embedded.inc
# --source include/have_perfschema.inc
# --source ../include/table_io_setup_helper.inc
# ... more setup scripts as needed ...
# update performance_schema.setup_consumers set enabled='YES';
# ... test payload here ...
# ... optionally, add this insert between statements
# ... to make the final output more readable
# insert into test.marker set a=1;
# ... more test payload here ...
# ... optionaly, add the following line (by default, only "test" is dumped) ...
# let $schema_to_dump="db1", "db2", "db3";
# --source ../include/table_io_result_helper.inc
# Optional: Repeat several times
# update performance_schema.setup_consumers set enabled='YES';
# ... test payload here ...
# --source ../include/table_io_result_helper.inc
# ... cleanup
# --source ../include/table_io_cleanup_helper.inc
#
# (end of template)
# Setup
--disable_warnings
drop table if exists test.marker;
--enable_warnings
# To be used in the test payload,
# insert into marker makes the test output easier to read,
# to separate table io events between statements.
create table test.marker(a int);
update performance_schema.setup_consumers set enabled='NO';
update performance_schema.setup_instruments set enabled='NO';
update performance_schema.setup_instruments set enabled='YES'
where name like "wait/io/table/%";
truncate table performance_schema.events_waits_history_long;
# Reset lost counters to a known state
flush global status;
# Make sure there is room to instrument tables from this test.
flush tables;
# By default, dump table io only for test.
# A test can overide this
let $schema_to_dump="test";