1
0
mirror of https://github.com/MariaDB/server.git synced 2026-10-23 18:49:29 +03:00

fixes for test failures

and small collateral changes

mysql-test/lib/My/Test.pm:
  somehow with "print" we get truncated writes sometimes
mysql-test/suite/perfschema/r/digest_table_full.result:
  md5 hashes of statement digests differ, because yacc token codes are different in mariadb
mysql-test/suite/perfschema/r/dml_handler.result:
  host table is not ported over yet
mysql-test/suite/perfschema/r/information_schema.result:
  host table is not ported over yet
mysql-test/suite/perfschema/r/nesting.result:
  this differs, because we don't rewrite general log queries, and multi-statement
  packets are logged as a one entry. this result file is identical to what mysql-5.6.5
  produces with the --log-raw option.
mysql-test/suite/perfschema/r/relaylog.result:
  MariaDB modifies the binlog index file directly, while MySQL 5.6 has a feature "crash-safe binlog index" and modifies a special "crash-safe" shadow copy of the index file and then moves it over. That's why this test shows "NONE" index file writes in MySQL and "MANY" in MariaDB.
mysql-test/suite/perfschema/r/server_init.result:
  MariaDB initializes the "manager" resources from the "manager" thread, and starts this thread only when --flush-time is not 0. MySQL 5.6 initializes "manager" resources unconditionally on server startup.
mysql-test/suite/perfschema/r/stage_mdl_global.result:
  this differs, because MariaDB disables query cache when query_cache_size=0. MySQL does not
  do that, and this causes useless mutex locks and waits.
mysql-test/suite/perfschema/r/statement_digest.result:
  md5 hashes of statement digests differ, because yacc token codes are different in mariadb
mysql-test/suite/perfschema/r/statement_digest_consumers.result:
  md5 hashes of statement digests differ, because yacc token codes are different in mariadb
mysql-test/suite/perfschema/r/statement_digest_long_query.result:
  md5 hashes of statement digests differ, because yacc token codes are different in mariadb
mysql-test/suite/rpl/r/rpl_mixed_drop_create_temp_table.result:
  will be updated to match 5.6 when alfranio.correia@oracle.com-20110512172919-c1b5kmum4h52g0ni and anders.song@greatopensource.com-20110105052107-zoab0bsf5a6xxk2y are merged
mysql-test/suite/rpl/r/rpl_non_direct_mixed_mixing_engines.result:
  will be updated to match 5.6 when anders.song@greatopensource.com-20110105052107-zoab0bsf5a6xxk2y is merged
This commit is contained in:
Sergei Golubchik
2012-09-27 20:09:46 +02:00
parent cd9f773020
commit 474fe6d9d9
477 changed files with 33813 additions and 9082 deletions

View File

@@ -1 +1,2 @@
--log=test.log
--general-log
--general-log-file=test.log

View File

@@ -1,2 +1,3 @@
--log=mysql-test.log
--general-log
--general-log-file=mysql-test.log

View File

@@ -0,0 +1,75 @@
################## mysql-test/t/innodb_adaptive_max_sleep_delay.test ##########
# #
# Variable Name: innodb_adaptive_max_sleep_delay #
# Scope: Global #
# Access Type: Dynamic #
# Data Type: numeric #
# #
# Note: This variable is only defined if innodb_have_atomic_builtins=ON #
# #
# Creation Date: 2011-08-17 #
# Author : Sunny Bains #
# #
# #
# Description: Dynamic config global variable innodb_adaptive_max_sleep_delay #
# * Value check #
# * Scope check #
# #
###############################################################################
--source include/have_innodb.inc
# Check if builtins are enabled
if (`SELECT LOWER(VARIABLE_VALUE)='off' FROM INFORMATION_SCHEMA.GLOBAL_STATUS
WHERE LOWER(variable_name) = 'innodb_have_atomic_builtins'`) {
--skip Test requires InnoDB atomic builtins
}
# Display default value
SELECT @@GLOBAL.innodb_adaptive_max_sleep_delay;
--echo 150000 Expected
# Check if value can be set
SET @@GLOBAL.innodb_adaptive_max_sleep_delay=100;
# Check for out of bounds
SET @@GLOBAL.innodb_adaptive_max_sleep_delay=1000001;
SELECT @@GLOBAL.innodb_adaptive_max_sleep_delay;
--echo 1000000 Expected
SET @@GLOBAL.innodb_adaptive_max_sleep_delay=-1;
SELECT @@GLOBAL.innodb_adaptive_max_sleep_delay;
--echo 0 Expected
SELECT COUNT(@@GLOBAL.innodb_adaptive_max_sleep_delay);
--echo 1 Expected
# Check if the value in GLOBAL table matches value in variable
SELECT VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='innodb_adaptive_max_sleep_delay';
--echo 100 Expected
# Check if accessing variable with and without GLOBAL point to same
# variable
SELECT @@innodb_adaptive_max_sleep_delay = @@GLOBAL.innodb_adaptive_max_sleep_delay;
--echo 1000000 Expected
# Check if innodb_adaptive_max_sleep_delay can be accessed with and
# without @@ sign.
SELECT COUNT(@@innodb_adaptive_max_sleep_delay);
--echo 1 Expected
--Error ER_INCORRECT_GLOBAL_LOCAL_VAR
SELECT COUNT(@@local.innodb_adaptive_max_sleep_delay);
--echo Expected error 'Variable is a GLOBAL variable'
--Error ER_INCORRECT_GLOBAL_LOCAL_VAR
SELECT COUNT(@@SESSION.innodb_adaptive_max_sleep_delay);
--echo Expected error 'Variable is a GLOBAL variable'
--Error ER_BAD_FIELD_ERROR
SELECT innodb_adaptive_max_sleep_delay = @@SESSION.innodb_adaptive_max_sleep_delay;
# Reset the default
SET @@GLOBAL.innodb_adaptive_max_sleep_delay=150000;

View File

@@ -0,0 +1,81 @@
# 2010-01-25 - Added
#
--source include/have_innodb.inc
SET @start_global_value = @@global.innodb_analyze_is_persistent;
SELECT @start_global_value;
#
# exists as global only
#
--echo Valid values are 'ON' and 'OFF'
SELECT @@global.innodb_analyze_is_persistent in (0, 1);
SELECT @@global.innodb_analyze_is_persistent;
#--error ER_INCORRECT_GLOBAL_LOCAL_VAR
SELECT @@session.innodb_analyze_is_persistent;
SHOW global variables LIKE 'innodb_analyze_is_persistent';
SHOW session variables LIKE 'innodb_analyze_is_persistent';
SELECT * FROM information_schema.global_variables
WHERE variable_name='innodb_analyze_is_persistent';
SELECT * FROM information_schema.session_variables
WHERE variable_name='innodb_analyze_is_persistent';
#
# SHOW that it's writable
#
SET global innodb_analyze_is_persistent='OFF';
SELECT @@global.innodb_analyze_is_persistent;
SELECT * FROM information_schema.global_variables
WHERE variable_name='innodb_analyze_is_persistent';
SELECT * FROM information_schema.session_variables
WHERE variable_name='innodb_analyze_is_persistent';
SET @@global.innodb_analyze_is_persistent=1;
SELECT @@global.innodb_analyze_is_persistent;
SELECT * FROM information_schema.global_variables
WHERE variable_name='innodb_analyze_is_persistent';
SELECT * FROM information_schema.session_variables
WHERE variable_name='innodb_analyze_is_persistent';
SET global innodb_analyze_is_persistent=0;
SELECT @@global.innodb_analyze_is_persistent;
SELECT * FROM information_schema.global_variables
WHERE variable_name='innodb_analyze_is_persistent';
SELECT * FROM information_schema.session_variables
WHERE variable_name='innodb_analyze_is_persistent';
SET @@global.innodb_analyze_is_persistent='ON';
SELECT @@global.innodb_analyze_is_persistent;
SELECT * FROM information_schema.global_variables
WHERE variable_name='innodb_analyze_is_persistent';
SELECT * FROM information_schema.session_variables
WHERE variable_name='innodb_analyze_is_persistent';
#--error ER_GLOBAL_VARIABLE
SET session innodb_analyze_is_persistent='OFF';
#--error ER_GLOBAL_VARIABLE
SET @@session.innodb_analyze_is_persistent='ON';
#
# incorrect types
#
--error ER_WRONG_TYPE_FOR_VAR
SET global innodb_analyze_is_persistent=1.1;
--error ER_WRONG_TYPE_FOR_VAR
SET global innodb_analyze_is_persistent=1e1;
--error ER_WRONG_VALUE_FOR_VAR
SET global innodb_analyze_is_persistent=2;
--error ER_WRONG_VALUE_FOR_VAR
SET global innodb_analyze_is_persistent=-3;
SELECT @@global.innodb_analyze_is_persistent;
SELECT * FROM information_schema.global_variables
WHERE variable_name='innodb_analyze_is_persistent';
SELECT * FROM information_schema.session_variables
WHERE variable_name='innodb_analyze_is_persistent';
--error ER_WRONG_VALUE_FOR_VAR
SET global innodb_analyze_is_persistent='AUTO';
#
# Cleanup
#
SET @@global.innodb_analyze_is_persistent = @start_global_value;
SELECT @@global.innodb_analyze_is_persistent;

View File

@@ -0,0 +1,42 @@
#
# Basic test for innodb_buffer_pool_dump_at_shutdown
#
-- source include/have_innodb.inc
# include/restart_mysqld.inc does not work in embedded mode
-- source include/not_embedded.inc
# Check the default value
SET @orig = @@global.innodb_buffer_pool_dump_at_shutdown;
SELECT @orig;
# Confirm that we can change the value
SET GLOBAL innodb_buffer_pool_dump_at_shutdown = OFF;
SELECT @@global.innodb_buffer_pool_dump_at_shutdown;
SET GLOBAL innodb_buffer_pool_dump_at_shutdown = ON;
SELECT @@global.innodb_buffer_pool_dump_at_shutdown;
# Check the type
-- error ER_WRONG_TYPE_FOR_VAR, ER_WRONG_VALUE_FOR_VAR
SET GLOBAL innodb_buffer_pool_dump_at_shutdown = 12.34;
-- error ER_WRONG_TYPE_FOR_VAR, ER_WRONG_VALUE_FOR_VAR
SET GLOBAL innodb_buffer_pool_dump_at_shutdown = "string";
-- error ER_WRONG_TYPE_FOR_VAR, ER_WRONG_VALUE_FOR_VAR
SET GLOBAL innodb_buffer_pool_dump_at_shutdown = 5;
# Confirm that the dump file is created at shutdown
-- let $file = `SELECT CONCAT(@@datadir, @@global.innodb_buffer_pool_filename)`
-- error 0,1
-- remove_file $file
-- error 1
-- file_exists $file
-- source include/restart_mysqld.inc
-- file_exists $file

View File

@@ -0,0 +1,25 @@
#
# Basic test for innodb_buffer_pool_dump_now
#
-- source include/have_innodb.inc
# Check the default value
SET @orig = @@global.innodb_buffer_pool_dump_now;
SELECT @orig;
# Do the dump
SET GLOBAL innodb_buffer_pool_dump_now = ON;
# Should always be OFF
SELECT @@global.innodb_buffer_pool_dump_now;
# Wait for the dump to complete
let $wait_condition =
SELECT SUBSTR(variable_value, 1, 33) = 'Buffer pool(s) dump completed at '
FROM information_schema.global_status
WHERE LOWER(variable_name) = 'innodb_buffer_pool_dump_status';
-- source include/wait_condition.inc
# Confirm that the dump file has been created
-- let $file = `SELECT CONCAT(@@datadir, @@global.innodb_buffer_pool_filename)`
-- file_exists $file

View File

@@ -0,0 +1,40 @@
#
# Basic test for innodb_buffer_pool_filename
#
-- source include/have_innodb.inc
# Check the default value and save for later restoration
SET @orig = @@global.innodb_buffer_pool_filename;
SELECT @orig;
# Make sure that --force-restart in the .opt file has worked and that
# the value of this status variable is not something like
# 'Buffer pool(s) dump completed at ' left from previous runs because if
# it is then the following wait condition may be satisfied without the
# dump actually being complete and file_exists may fail.
let $status_var = innodb_buffer_pool_dump_status;
let $status_var_value = not started;
-- source include/wait_for_status_var.inc
SELECT variable_value
FROM information_schema.global_status
WHERE LOWER(variable_name) = 'innodb_buffer_pool_dump_status';
# Try with a non-default filename
SET GLOBAL innodb_buffer_pool_filename = 'innodb_foobar_dump';
SET GLOBAL innodb_buffer_pool_dump_now = ON;
-- let $file = `SELECT CONCAT(@@datadir, @@global.innodb_buffer_pool_filename)`
# Wait for the dump to complete
let $wait_condition =
SELECT SUBSTR(variable_value, 1, 33) = 'Buffer pool(s) dump completed at '
FROM information_schema.global_status
WHERE LOWER(variable_name) = 'innodb_buffer_pool_dump_status';
-- source include/wait_condition.inc
-- file_exists $file
# Restore the env
SET GLOBAL innodb_buffer_pool_filename = @orig;

View File

@@ -0,0 +1,15 @@
#
# Basic test for innodb_buffer_pool_load_abort
#
-- source include/have_innodb.inc
# Check the default value
SET @orig = @@global.innodb_buffer_pool_load_abort;
SELECT @orig;
# Confirm that the value remains OFF after being set to ON
SET GLOBAL innodb_buffer_pool_load_abort = ON;
SELECT @@global.innodb_buffer_pool_load_abort;

View File

@@ -0,0 +1,15 @@
#
# Basic test for innodb_buffer_pool_load_at_startup
#
-- source include/have_innodb.inc
# Check the default value
SET @orig = @@global.innodb_buffer_pool_load_at_startup;
SELECT @orig;
# Confirm that we can not change the value
-- error ER_INCORRECT_GLOBAL_LOCAL_VAR
SET GLOBAL innodb_buffer_pool_load_at_startup = OFF;
-- error ER_INCORRECT_GLOBAL_LOCAL_VAR
SET GLOBAL innodb_buffer_pool_load_at_startup = ON;

View File

@@ -0,0 +1,39 @@
#
# Basic test for innodb_buffer_pool_load_now
#
-- source include/have_innodb.inc
# Check the default value
SET @orig = @@global.innodb_buffer_pool_load_now;
SELECT @orig;
# Do the dump
SET GLOBAL innodb_buffer_pool_dump_now = ON;
# Wait for the dump to complete
let $wait_condition =
SELECT SUBSTR(variable_value, 1, 33) = 'Buffer pool(s) dump completed at '
FROM information_schema.global_status
WHERE LOWER(variable_name) = 'innodb_buffer_pool_dump_status';
-- source include/wait_condition.inc
# Confirm the file is really created
-- let $file = `SELECT CONCAT(@@datadir, @@global.innodb_buffer_pool_filename)`
-- file_exists $file
# Load the dump
SET GLOBAL innodb_buffer_pool_load_now = ON;
# Wait for the load to complete
let $wait_condition =
SELECT SUBSTR(variable_value, 1, 33) = 'Buffer pool(s) load completed at '
FROM information_schema.global_status
WHERE LOWER(variable_name) = 'innodb_buffer_pool_load_status';
-- source include/wait_condition.inc
# Show the status, interesting if the above timed out
-- replace_regex /[0-9]{6}[[:space:]]+[0-9]{1,2}:[0-9]{2}:[0-9]{2}/TIMESTAMP_NOW/
SELECT variable_value
FROM information_schema.global_status
WHERE LOWER(variable_name) = 'innodb_buffer_pool_load_status';

View File

@@ -0,0 +1,63 @@
# 2011-02-09 - Added
#
--source include/have_innodb.inc
SET @start_global_value = @@global.innodb_change_buffer_max_size;
SELECT @start_global_value;
#
# exists as global only
#
--echo Valid values are between 0 and 50
select @@global.innodb_change_buffer_max_size between 0 and 50;
select @@global.innodb_change_buffer_max_size;
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
select @@session.innodb_change_buffer_max_size;
show global variables like 'innodb_change_buffer_max_size';
show session variables like 'innodb_change_buffer_max_size';
select * from information_schema.global_variables where variable_name='innodb_change_buffer_max_size';
select * from information_schema.session_variables where variable_name='innodb_change_buffer_max_size';
#
# show that it's writable
#
set global innodb_change_buffer_max_size=10;
select @@global.innodb_change_buffer_max_size;
select * from information_schema.global_variables where variable_name='innodb_change_buffer_max_size';
select * from information_schema.session_variables where variable_name='innodb_change_buffer_max_size';
--error ER_GLOBAL_VARIABLE
set session innodb_change_buffer_max_size=1;
#
# incorrect types
#
--error ER_WRONG_TYPE_FOR_VAR
set global innodb_change_buffer_max_size=1.1;
--error ER_WRONG_TYPE_FOR_VAR
set global innodb_change_buffer_max_size=1e1;
--error ER_WRONG_TYPE_FOR_VAR
set global innodb_change_buffer_max_size="foo";
set global innodb_change_buffer_max_size=-7;
select @@global.innodb_change_buffer_max_size;
select * from information_schema.global_variables where variable_name='innodb_change_buffer_max_size';
set global innodb_change_buffer_max_size=56;
select @@global.innodb_change_buffer_max_size;
select * from information_schema.global_variables where variable_name='innodb_change_buffer_max_size';
#
# min/max/DEFAULT values
#
set global innodb_change_buffer_max_size=0;
select @@global.innodb_change_buffer_max_size;
set global innodb_change_buffer_max_size=50;
select @@global.innodb_change_buffer_max_size;
set global innodb_change_buffer_max_size=DEFAULT;
select @@global.innodb_change_buffer_max_size;
SET @@global.innodb_change_buffer_max_size = @start_global_value;
SELECT @@global.innodb_change_buffer_max_size;

View File

@@ -0,0 +1,38 @@
--source include/have_innodb.inc
# Check the default value
SET @orig = @@global.innodb_checksum_algorithm;
SELECT @orig;
SET GLOBAL innodb_checksum_algorithm = 'crc32';
SELECT @@global.innodb_checksum_algorithm;
SET GLOBAL innodb_checksum_algorithm = 'strict_crc32';
SELECT @@global.innodb_checksum_algorithm;
SET GLOBAL innodb_checksum_algorithm = 'innodb';
SELECT @@global.innodb_checksum_algorithm;
SET GLOBAL innodb_checksum_algorithm = 'strict_innodb';
SELECT @@global.innodb_checksum_algorithm;
SET GLOBAL innodb_checksum_algorithm = 'none';
SELECT @@global.innodb_checksum_algorithm;
SET GLOBAL innodb_checksum_algorithm = 'strict_none';
SELECT @@global.innodb_checksum_algorithm;
-- error ER_WRONG_VALUE_FOR_VAR
SET GLOBAL innodb_checksum_algorithm = '';
SELECT @@global.innodb_checksum_algorithm;
-- error ER_WRONG_VALUE_FOR_VAR
SET GLOBAL innodb_checksum_algorithm = 'foobar';
SELECT @@global.innodb_checksum_algorithm;
-- error ER_WRONG_VALUE_FOR_VAR
SET GLOBAL innodb_checksum_algorithm = 123;
SELECT @@global.innodb_checksum_algorithm;
SET GLOBAL innodb_checksum_algorithm = @orig;
SELECT @@global.innodb_checksum_algorithm;

View File

@@ -0,0 +1,70 @@
# 2011-11-15 - Added
#
--source include/have_innodb.inc
SET @start_global_value = @@global.innodb_disable_sort_file_cache;
SELECT @start_global_value;
#
# exists as global only
#
--echo Valid values are 'ON' and 'OFF'
select @@global.innodb_disable_sort_file_cache in (0, 1);
select @@global.innodb_disable_sort_file_cache;
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
select @@session.innodb_disable_sort_file_cache;
show global variables like 'innodb_disable_sort_file_cache';
show session variables like 'innodb_disable_sort_file_cache';
select * from information_schema.global_variables where variable_name='innodb_disable_sort_file_cache';
select * from information_schema.session_variables where variable_name='innodb_disable_sort_file_cache';
#
# show that it's writable
#
set global innodb_disable_sort_file_cache='OFF';
select @@global.innodb_disable_sort_file_cache;
select * from information_schema.global_variables where variable_name='innodb_disable_sort_file_cache';
select * from information_schema.session_variables where variable_name='innodb_disable_sort_file_cache';
set @@global.innodb_disable_sort_file_cache=1;
select @@global.innodb_disable_sort_file_cache;
select * from information_schema.global_variables where variable_name='innodb_disable_sort_file_cache';
select * from information_schema.session_variables where variable_name='innodb_disable_sort_file_cache';
set global innodb_disable_sort_file_cache=0;
select @@global.innodb_disable_sort_file_cache;
select * from information_schema.global_variables where variable_name='innodb_disable_sort_file_cache';
select * from information_schema.session_variables where variable_name='innodb_disable_sort_file_cache';
set @@global.innodb_disable_sort_file_cache='ON';
select @@global.innodb_disable_sort_file_cache;
select * from information_schema.global_variables where variable_name='innodb_disable_sort_file_cache';
select * from information_schema.session_variables where variable_name='innodb_disable_sort_file_cache';
--error ER_GLOBAL_VARIABLE
set session innodb_disable_sort_file_cache='OFF';
--error ER_GLOBAL_VARIABLE
set @@session.innodb_disable_sort_file_cache='ON';
#
# incorrect types
#
--error ER_WRONG_TYPE_FOR_VAR
set global innodb_disable_sort_file_cache=1.1;
--error ER_WRONG_TYPE_FOR_VAR
set global innodb_disable_sort_file_cache=1e1;
--error ER_WRONG_VALUE_FOR_VAR
set global innodb_disable_sort_file_cache=2;
--error ER_WRONG_VALUE_FOR_VAR
set global innodb_disable_sort_file_cache=-3;
select @@global.innodb_disable_sort_file_cache;
select * from information_schema.global_variables where variable_name='innodb_disable_sort_file_cache';
select * from information_schema.session_variables where variable_name='innodb_disable_sort_file_cache';
--error ER_WRONG_VALUE_FOR_VAR
set global innodb_disable_sort_file_cache='AUTO';
#
# Cleanup
#
SET @@global.innodb_disable_sort_file_cache = @start_global_value;
SELECT @@global.innodb_disable_sort_file_cache;

View File

@@ -0,0 +1,22 @@
--source include/have_innodb.inc
--source include/have_debug.inc
#
# exists as global only
#
select @@global.innodb_doublewrite_batch_size between 1 and 127;
select @@global.innodb_doublewrite_batch_size;
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
select @@session.innodb_doublewrite_batch_size;
show global variables like 'innodb_doublewrite_batch_size';
show session variables like 'innodb_doublewrite_batch_size';
select * from information_schema.global_variables where variable_name='innodb_doublewrite_batch_size';
select * from information_schema.session_variables where variable_name='innodb_doublewrite_batch_size';
#
# show that it's read-only
#
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
set global innodb_doublewrite_batch_size=1;
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
set @@session.innodb_doublewrite_batch_size='some';

View File

@@ -0,0 +1,70 @@
# 2011-02-23 - Added
#
--source include/have_innodb.inc
SET @start_global_value = @@global.innodb_flush_neighbors;
SELECT @start_global_value;
#
# exists as global only
#
--echo Valid values are 'ON' and 'OFF'
select @@global.innodb_flush_neighbors in (0, 1);
select @@global.innodb_flush_neighbors;
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
select @@session.innodb_flush_neighbors;
show global variables like 'innodb_flush_neighbors';
show session variables like 'innodb_flush_neighbors';
select * from information_schema.global_variables where variable_name='innodb_flush_neighbors';
select * from information_schema.session_variables where variable_name='innodb_flush_neighbors';
#
# show that it's writable
#
set global innodb_flush_neighbors='OFF';
select @@global.innodb_flush_neighbors;
select * from information_schema.global_variables where variable_name='innodb_flush_neighbors';
select * from information_schema.session_variables where variable_name='innodb_flush_neighbors';
set @@global.innodb_flush_neighbors=1;
select @@global.innodb_flush_neighbors;
select * from information_schema.global_variables where variable_name='innodb_flush_neighbors';
select * from information_schema.session_variables where variable_name='innodb_flush_neighbors';
set global innodb_flush_neighbors=0;
select @@global.innodb_flush_neighbors;
select * from information_schema.global_variables where variable_name='innodb_flush_neighbors';
select * from information_schema.session_variables where variable_name='innodb_flush_neighbors';
set @@global.innodb_flush_neighbors='ON';
select @@global.innodb_flush_neighbors;
select * from information_schema.global_variables where variable_name='innodb_flush_neighbors';
select * from information_schema.session_variables where variable_name='innodb_flush_neighbors';
--error ER_GLOBAL_VARIABLE
set session innodb_flush_neighbors='OFF';
--error ER_GLOBAL_VARIABLE
set @@session.innodb_flush_neighbors='ON';
#
# incorrect types
#
--error ER_WRONG_TYPE_FOR_VAR
set global innodb_flush_neighbors=1.1;
--error ER_WRONG_TYPE_FOR_VAR
set global innodb_flush_neighbors=1e1;
--error ER_WRONG_VALUE_FOR_VAR
set global innodb_flush_neighbors=2;
--error ER_WRONG_VALUE_FOR_VAR
set global innodb_flush_neighbors=-3;
select @@global.innodb_flush_neighbors;
select * from information_schema.global_variables where variable_name='innodb_flush_neighbors';
select * from information_schema.session_variables where variable_name='innodb_flush_neighbors';
--error ER_WRONG_VALUE_FOR_VAR
set global innodb_flush_neighbors='AUTO';
#
# Cleanup
#
SET @@global.innodb_flush_neighbors = @start_global_value;
SELECT @@global.innodb_flush_neighbors;

View File

@@ -0,0 +1,41 @@
# 2011-11-15 - Added
#
--source include/have_innodb.inc
SET @start_global_value = @@global.innodb_ft_aux_table;
SELECT @start_global_value;
#
# exists as global only
#
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
select @@session.innodb_ft_aux_table;
show global variables like 'innodb_ft_aux_table';
show session variables like 'innodb_ft_aux_table';
select * from information_schema.global_variables where variable_name='innodb_ft_aux_table';
select * from information_schema.session_variables where variable_name='innodb_ft_aux_table';
--error ER_GLOBAL_VARIABLE
set session innodb_ft_aux_table='Salmon';
--error ER_GLOBAL_VARIABLE
set @@session.innodb_ft_aux_table='Salmon';
#
# incorrect types
#
--error ER_WRONG_TYPE_FOR_VAR
set global innodb_ft_aux_table=1.1;
--error ER_WRONG_TYPE_FOR_VAR
set global innodb_ft_aux_table=1e1;
--error ER_WRONG_VALUE_FOR_VAR
set global innodb_ft_aux_table='Salmon';
#
# Cleanup
#
SET @@global.innodb_ft_aux_table = @start_global_value;
SELECT @@global.innodb_ft_aux_table;

View File

@@ -0,0 +1,26 @@
#
# 2011-11-17 - Added
#
--source include/have_innodb.inc
#
# show the global and session values;
#
select @@global.innodb_ft_cache_size;
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
select @@session.innodb_ft_cache_size;
show global variables like 'innodb_ft_cache_size';
show session variables like 'innodb_ft_cache_size';
select * from information_schema.global_variables where variable_name='innodb_ft_cache_size';
select * from information_schema.session_variables where variable_name='innodb_ft_cache_size';
#
# show that it's read-only
#
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
set global innodb_ft_cache_size=1;
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
set session innodb_ft_cache_size=1;

View File

@@ -0,0 +1,70 @@
# 2011-11-15 - Added
#
--source include/have_innodb.inc
SET @start_global_value = @@global.innodb_ft_enable_diag_print;
SELECT @start_global_value;
#
# exists as global only
#
--echo Valid values are 'ON' and 'OFF'
select @@global.innodb_ft_enable_diag_print in (0, 1);
select @@global.innodb_ft_enable_diag_print;
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
select @@session.innodb_ft_enable_diag_print;
show global variables like 'innodb_ft_enable_diag_print';
show session variables like 'innodb_ft_enable_diag_print';
select * from information_schema.global_variables where variable_name='innodb_ft_enable_diag_print';
select * from information_schema.session_variables where variable_name='innodb_ft_enable_diag_print';
#
# show that it's writable
#
set global innodb_ft_enable_diag_print='OFF';
select @@global.innodb_ft_enable_diag_print;
select * from information_schema.global_variables where variable_name='innodb_ft_enable_diag_print';
select * from information_schema.session_variables where variable_name='innodb_ft_enable_diag_print';
set @@global.innodb_ft_enable_diag_print=1;
select @@global.innodb_ft_enable_diag_print;
select * from information_schema.global_variables where variable_name='innodb_ft_enable_diag_print';
select * from information_schema.session_variables where variable_name='innodb_ft_enable_diag_print';
set global innodb_ft_enable_diag_print=0;
select @@global.innodb_ft_enable_diag_print;
select * from information_schema.global_variables where variable_name='innodb_ft_enable_diag_print';
select * from information_schema.session_variables where variable_name='innodb_ft_enable_diag_print';
set @@global.innodb_ft_enable_diag_print='ON';
select @@global.innodb_ft_enable_diag_print;
select * from information_schema.global_variables where variable_name='innodb_ft_enable_diag_print';
select * from information_schema.session_variables where variable_name='innodb_ft_enable_diag_print';
--error ER_GLOBAL_VARIABLE
set session innodb_ft_enable_diag_print='OFF';
--error ER_GLOBAL_VARIABLE
set @@session.innodb_ft_enable_diag_print='ON';
#
# incorrect types
#
--error ER_WRONG_TYPE_FOR_VAR
set global innodb_ft_enable_diag_print=1.1;
--error ER_WRONG_TYPE_FOR_VAR
set global innodb_ft_enable_diag_print=1e1;
--error ER_WRONG_VALUE_FOR_VAR
set global innodb_ft_enable_diag_print=2;
--error ER_WRONG_VALUE_FOR_VAR
set global innodb_ft_enable_diag_print=-3;
select @@global.innodb_ft_enable_diag_print;
select * from information_schema.global_variables where variable_name='innodb_ft_enable_diag_print';
select * from information_schema.session_variables where variable_name='innodb_ft_enable_diag_print';
--error ER_WRONG_VALUE_FOR_VAR
set global innodb_ft_enable_diag_print='AUTO';
#
# Cleanup
#
SET @@global.innodb_ft_enable_diag_print = @start_global_value;
SELECT @@global.innodb_ft_enable_diag_print;

View File

@@ -0,0 +1,85 @@
# 2011-11-15 - Added
#
--source include/have_innodb.inc
SET @start_global_value = @@global.innodb_ft_enable_stopword;
SELECT @start_global_value;
#
# exists as global and session
#
--echo Valid values are 'ON' and 'OFF'
select @@global.innodb_ft_enable_stopword in (0, 1);
select @@global.innodb_ft_enable_stopword;
select @@session.innodb_ft_enable_stopword in (0, 1);
select @@session.innodb_ft_enable_stopword;
show global variables like 'innodb_ft_enable_stopword';
show session variables like 'innodb_ft_enable_stopword';
select * from information_schema.global_variables where variable_name='innodb_ft_enable_stopword';
select * from information_schema.session_variables where variable_name='innodb_ft_enable_stopword';
#
# show that it's writable
#
set global innodb_ft_enable_stopword='OFF';
set session innodb_ft_enable_stopword='OFF';
select @@global.innodb_ft_enable_stopword;
select @@session.innodb_ft_enable_stopword;
select * from information_schema.global_variables where variable_name='innodb_ft_enable_stopword';
select * from information_schema.session_variables where variable_name='innodb_ft_enable_stopword';
set @@global.innodb_ft_enable_stopword=1;
set @@session.innodb_ft_enable_stopword=1;
select @@global.innodb_ft_enable_stopword;
select @@session.innodb_ft_enable_stopword;
select * from information_schema.global_variables where variable_name='innodb_ft_enable_stopword';
select * from information_schema.session_variables where variable_name='innodb_ft_enable_stopword';
set global innodb_ft_enable_stopword=0;
set session innodb_ft_enable_stopword=0;
select @@global.innodb_ft_enable_stopword;
select @@session.innodb_ft_enable_stopword;
select * from information_schema.global_variables where variable_name='innodb_ft_enable_stopword';
select * from information_schema.session_variables where variable_name='innodb_ft_enable_stopword';
set @@global.innodb_ft_enable_stopword='ON';
set @@session.innodb_ft_enable_stopword='ON';
select @@global.innodb_ft_enable_stopword;
select @@session.innodb_ft_enable_stopword;
select * from information_schema.global_variables where variable_name='innodb_ft_enable_stopword';
select * from information_schema.session_variables where variable_name='innodb_ft_enable_stopword';
#
# incorrect types
#
--error ER_WRONG_TYPE_FOR_VAR
set global innodb_ft_enable_stopword=1.1;
--error ER_WRONG_TYPE_FOR_VAR
set session innodb_ft_enable_stopword=1.1;
--error ER_WRONG_TYPE_FOR_VAR
set global innodb_ft_enable_stopword=1e1;
--error ER_WRONG_TYPE_FOR_VAR
set session innodb_ft_enable_stopword=1e1;
--error ER_WRONG_VALUE_FOR_VAR
set global innodb_ft_enable_stopword=2;
--error ER_WRONG_VALUE_FOR_VAR
set session innodb_ft_enable_stopword=2;
--error ER_WRONG_VALUE_FOR_VAR
set global innodb_ft_enable_stopword='AUTO';
--error ER_WRONG_VALUE_FOR_VAR
set session innodb_ft_enable_stopword='AUTO';
--error ER_WRONG_VALUE_FOR_VAR
set global innodb_ft_enable_stopword=-3;
--error ER_WRONG_VALUE_FOR_VAR
set session innodb_ft_enable_stopword=-7;
select @@global.innodb_ft_enable_stopword;
select @@session.innodb_ft_enable_stopword;
select * from information_schema.global_variables where variable_name='innodb_ft_enable_stopword';
select * from information_schema.session_variables where variable_name='innodb_ft_enable_stopword';
#
# Cleanup
#
SET @@global.innodb_ft_enable_stopword = @start_global_value;
SELECT @@global.innodb_ft_enable_stopword;

View File

@@ -0,0 +1,26 @@
#
# 2011-11-17 - Added
#
--source include/have_innodb.inc
#
# show the global and session values;
#
select @@global.innodb_ft_max_token_size;
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
select @@session.innodb_ft_max_token_size;
show global variables like 'innodb_ft_max_token_size';
show session variables like 'innodb_ft_max_token_size';
select * from information_schema.global_variables where variable_name='innodb_ft_max_token_size';
select * from information_schema.session_variables where variable_name='innodb_ft_max_token_size';
#
# show that it's read-only
#
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
set global innodb_ft_max_token_size=1;
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
set session innodb_ft_max_token_size=1;

View File

@@ -0,0 +1,26 @@
#
# 2011-11-17 - Added
#
--source include/have_innodb.inc
#
# show the global and session values;
#
select @@global.innodb_ft_min_token_size;
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
select @@session.innodb_ft_min_token_size;
show global variables like 'innodb_ft_min_token_size';
show session variables like 'innodb_ft_min_token_size';
select * from information_schema.global_variables where variable_name='innodb_ft_min_token_size';
select * from information_schema.session_variables where variable_name='innodb_ft_min_token_size';
#
# show that it's read-only
#
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
set global innodb_ft_min_token_size=1;
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
set session innodb_ft_min_token_size=1;

View File

@@ -0,0 +1,52 @@
#
# 2011-11-17 - Added
#
--source include/have_innodb.inc
SET @start_global_value = @@global.innodb_ft_num_word_optimize;
SELECT @start_global_value;
#
# exists as global only
#
--echo Valid values are zero or above
select @@global.innodb_ft_num_word_optimize >=1000;
select @@global.innodb_ft_num_word_optimize;
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
select @@session.innodb_ft_num_word_optimize;
show global variables like 'innodb_ft_num_word_optimize';
show session variables like 'innodb_ft_num_word_optimize';
select * from information_schema.global_variables where variable_name='innodb_ft_num_word_optimize';
select * from information_schema.session_variables where variable_name='innodb_ft_num_word_optimize';
#
# show that it's writable
#
set global innodb_ft_num_word_optimize=1000;
select @@global.innodb_ft_num_word_optimize;
select * from information_schema.global_variables where variable_name='innodb_ft_num_word_optimize';
select * from information_schema.session_variables where variable_name='innodb_ft_num_word_optimize';
--error ER_GLOBAL_VARIABLE
set session innodb_ft_num_word_optimize=1000;
#
# incorrect types
#
--error ER_WRONG_TYPE_FOR_VAR
set global innodb_ft_num_word_optimize=1.1;
--error ER_WRONG_TYPE_FOR_VAR
set global innodb_ft_num_word_optimize=1e1;
--error ER_WRONG_TYPE_FOR_VAR
set global innodb_ft_num_word_optimize="foo";
set global innodb_ft_num_word_optimize=-7;
select @@global.innodb_ft_num_word_optimize;
select * from information_schema.global_variables where variable_name='innodb_ft_num_word_optimize';
#
# cleanup
#
SET @@global.innodb_ft_num_word_optimize = @start_global_value;
SELECT @@global.innodb_ft_num_word_optimize;

View File

@@ -0,0 +1,41 @@
# 2011-11-15 - Added
#
--source include/have_innodb.inc
SET @start_global_value = @@global.innodb_ft_server_stopword_table;
SELECT @start_global_value;
#
# exists as global only
#
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
select @@session.innodb_ft_server_stopword_table;
show global variables like 'innodb_ft_server_stopword_table';
show session variables like 'innodb_ft_server_stopword_table';
select * from information_schema.global_variables where variable_name='innodb_ft_server_stopword_table';
select * from information_schema.session_variables where variable_name='innodb_ft_server_stopword_table';
--error ER_GLOBAL_VARIABLE
set session innodb_ft_server_stopword_table='Salmon';
--error ER_GLOBAL_VARIABLE
set @@session.innodb_ft_server_stopword_table='Salmon';
#
# incorrect types
#
--error ER_WRONG_TYPE_FOR_VAR
set global innodb_ft_server_stopword_table=1.1;
--error ER_WRONG_TYPE_FOR_VAR
set global innodb_ft_server_stopword_table=1e1;
--error ER_WRONG_VALUE_FOR_VAR
set global innodb_ft_server_stopword_table='Salmon';
#
# Cleanup
#
SET @@global.innodb_ft_server_stopword_table = @start_global_value;
SELECT @@global.innodb_ft_server_stopword_table;

View File

@@ -0,0 +1,26 @@
#
# 2011-11-17 - Added
#
--source include/have_innodb.inc
#
# show the global and session values;
#
select @@global.innodb_ft_sort_pll_degree;
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
select @@session.innodb_ft_sort_pll_degree;
show global variables like 'innodb_ft_sort_pll_degree';
show session variables like 'innodb_ft_sort_pll_degree';
select * from information_schema.global_variables where variable_name='innodb_ft_sort_pll_degree';
select * from information_schema.session_variables where variable_name='innodb_ft_sort_pll_degree';
#
# show that it's read-only
#
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
set global innodb_ft_sort_pll_degree=1;
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
set session innodb_ft_sort_pll_degree=1;

View File

@@ -0,0 +1,37 @@
# 2011-11-15 - Added
#
--source include/have_innodb.inc
SET @start_global_value = @@global.innodb_ft_user_stopword_table;
SELECT @start_global_value;
#
# exists as session as well
#
select @@session.innodb_ft_user_stopword_table;
show global variables like 'innodb_ft_user_stopword_table';
show session variables like 'innodb_ft_user_stopword_table';
select * from information_schema.global_variables where variable_name='innodb_ft_user_stopword_table';
select * from information_schema.session_variables where variable_name='innodb_ft_user_stopword_table';
--error ER_WRONG_VALUE_FOR_VAR
set session innodb_ft_user_stopword_table='Salmon';
--error ER_WRONG_VALUE_FOR_VAR
set @@session.innodb_ft_user_stopword_table='Salmon';
#
# incorrect types
#
--error ER_WRONG_TYPE_FOR_VAR
set global innodb_ft_user_stopword_table=1.1;
--error ER_WRONG_TYPE_FOR_VAR
set global innodb_ft_user_stopword_table=1e1;
--error ER_WRONG_VALUE_FOR_VAR
set global innodb_ft_user_stopword_table='Salmon';

View File

@@ -0,0 +1,58 @@
# 2011-02-23 - Added
#
--source include/have_innodb.inc
SET @start_global_value = @@global.innodb_lru_scan_depth;
SELECT @start_global_value;
#
# exists as global only
#
--echo Valid value 100 or more
select @@global.innodb_lru_scan_depth >= 100;
select @@global.innodb_lru_scan_depth;
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
select @@session.innodb_lru_scan_depth;
show global variables like 'innodb_lru_scan_depth';
show session variables like 'innodb_lru_scan_depth';
select * from information_schema.global_variables where variable_name='innodb_lru_scan_depth';
select * from information_schema.session_variables where variable_name='innodb_lru_scan_depth';
#
# show that it's writable
#
set global innodb_lru_scan_depth=325;
select @@global.innodb_lru_scan_depth;
select * from information_schema.global_variables where variable_name='innodb_lru_scan_depth';
select * from information_schema.session_variables where variable_name='innodb_lru_scan_depth';
--error ER_GLOBAL_VARIABLE
set session innodb_lru_scan_depth=444;
#
# incorrect types
#
--error ER_WRONG_TYPE_FOR_VAR
set global innodb_lru_scan_depth=1.1;
--error ER_WRONG_TYPE_FOR_VAR
set global innodb_lru_scan_depth=1e1;
--error ER_WRONG_TYPE_FOR_VAR
set global innodb_lru_scan_depth="foo";
set global innodb_lru_scan_depth=7;
select @@global.innodb_lru_scan_depth;
select * from information_schema.global_variables where variable_name='innodb_lru_scan_depth';
set global innodb_lru_scan_depth=-7;
select @@global.innodb_lru_scan_depth;
select * from information_schema.global_variables where variable_name='innodb_lru_scan_depth';
#
# min/max values
#
set global innodb_lru_scan_depth=100;
select @@global.innodb_lru_scan_depth;
SET @@global.innodb_lru_scan_depth = @start_global_value;
SELECT @@global.innodb_lru_scan_depth;

View File

@@ -0,0 +1,43 @@
# Variable Name: innodb_max_purge_lag_delay
# Scope: Global #
# Access Type: Static #
# Data Type: numeric #
--source include/have_innodb.inc
SELECT @@GLOBAL.innodb_max_purge_lag_delay;
--echo 0 Expected
SET @@GLOBAL.innodb_max_purge_lag_delay=1;
SELECT COUNT(@@GLOBAL.innodb_max_purge_lag_delay);
--echo 1 Expected
SELECT VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='innodb_max_purge_lag_delay';
--echo 1 Expected
SELECT @@innodb_max_purge_lag_delay = @@GLOBAL.innodb_max_purge_lag_delay;
--echo 1 Expected
SELECT COUNT(@@innodb_max_purge_lag_delay);
--echo 1 Expected
--Error ER_INCORRECT_GLOBAL_LOCAL_VAR
SELECT COUNT(@@local.innodb_max_purge_lag_delay);
--echo Expected error 'Variable is a GLOBAL variable'
--Error ER_INCORRECT_GLOBAL_LOCAL_VAR
SELECT COUNT(@@SESSION.innodb_max_purge_lag_delay);
--echo Expected error 'Variable is a GLOBAL variable'
--Error ER_BAD_FIELD_ERROR
SELECT innodb_max_purge_lag_delay = @@SESSION.innodb_max_purge_lag_delay;
set global innodb_max_purge_lag_delay = -1;
set global innodb_max_purge_lag_delay = 1000000;
set global innodb_max_purge_lag_delay = 10000000;
set global innodb_max_purge_lag_delay = 100000000;
set global innodb_max_purge_lag_delay = 100000001;
set global innodb_max_purge_lag_delay = 0;

View File

@@ -0,0 +1,375 @@
# This is the test for Metrics Monitor Table feature.
# Test the metrics monitor system's control system
# and counter accuracy.
--source include/have_innodb.inc
set global innodb_monitor_disable = All;
# Test turn on/off the monitor counter with "all" option
# By default, they will be off
select name, status from information_schema.innodb_metrics;
# Turn on all monitor counters
set global innodb_monitor_enable = all;
# status should all change to "started"
select name, status from information_schema.innodb_metrics;
# Test wrong argument to the global configure option
--error ER_WRONG_VALUE_FOR_VAR
set global innodb_monitor_enable = aaa;
# We require a valid monitor counter/module name. There is no default
# counter name or module. A warning will be printed asking user to
# specify a valid counter name.
#--disable_warnings
#set global innodb_monitor_enable = default;
#--enable_warnings
# Turn off all monitor counters, option name should be case
# insensitive
set global innodb_monitor_disable = All;
# status should all change to "stopped"
select name, status from information_schema.innodb_metrics;
# Reset all counter values
set global innodb_monitor_reset_all = all;
# count should all change to 0
select name, count, status from information_schema.innodb_metrics;
# Test wildcard match, turn on all counters contain string "lock"
set global innodb_monitor_enable = "%lock%";
# All lock related counter should be enabled
select name, status from information_schema.innodb_metrics
where name like "%lock%";
# Disable them
set global innodb_monitor_disable = "%lock%";
# All lock related counter should be disabled
select name, status from information_schema.innodb_metrics
where name like "%lock%";
# No match for "%lock*"
--error ER_WRONG_VALUE_FOR_VAR
set global innodb_monitor_enable = "%lock*";
# All counters will be turned on with wildcard match string with all "%"
set global innodb_monitor_enable="%%%%%%%%%%%%%%%%%%%%%%%%%%%";
select name, status from information_schema.innodb_metrics;
# Turn off all counters
set global innodb_monitor_disable="%%%%%";
select name, status from information_schema.innodb_metrics;
# One more round testing. All counters will be turned on with
# single wildcard character "%"
set global innodb_monitor_enable="%";
select name, status from information_schema.innodb_metrics;
# Turn off all the counters with "%_%"
set global innodb_monitor_disable="%_%";
select name, status from information_schema.innodb_metrics;
# Turn on all counters start with "log"
set global innodb_monitor_enable="log%%%%";
select name, status from information_schema.innodb_metrics;
# Turn on counters "os_data_fsync" with wildcard match "os_%a_fs_ncs", "_"
# is single character wildcard match word
set global innodb_monitor_enable="os_%a_fs_ncs";
# Turn on counters whose name contains "os" and "pending" with
# wildcard match "os%pending%"
set global innodb_monitor_enable="os%pending%";
select name, status from information_schema.innodb_metrics
where name like "os%";
# Empty string is an invalid option
--error ER_WRONG_VALUE_FOR_VAR
set global innodb_monitor_enable="";
--error ER_WRONG_VALUE_FOR_VAR
set global innodb_monitor_enable="_";
SET global innodb_monitor_disable = module_metadata;
SET global innodb_monitor_reset_all = module_metadata;
# Only turn on "table_open" counter
set global innodb_monitor_enable = metadata_table_handles_opened;
# Create a new table to test "metadata_table_handles_opened" counter
create table monitor_test(col int) engine = innodb;
# This will open the monitor_test table
select * from monitor_test;
# "metadata_table_handles_opened" should increment by 1
select name, max_count, min_count, count,
max_count_reset, min_count_reset, count_reset, status
from information_schema.innodb_metrics
where name = "metadata_table_handles_opened";
# Reset the counter value while counter is still on (started)
# This will reset value "count_reset" but not
# "count"
set global innodb_monitor_reset = metadata_table_handles_opened;
select name, max_count, min_count, count,
max_count_reset, min_count_reset, count_reset, status
from information_schema.innodb_metrics
where name = "metadata_table_handles_opened";
# re-create table again to increment "metadata_table_handles_opened" again
drop table monitor_test;
# Create a new table to test "metadata_table_handles_opened" counter
create table monitor_test(col int) engine = innodb;
select * from monitor_test;
# "metadata_table_handles_opened" should increment
select name, max_count, min_count, count,
max_count_reset, min_count_reset, count_reset, status
from information_schema.innodb_metrics
where name = "metadata_table_handles_opened";
# Cannot reset all monitor value while the counter is on
set global innodb_monitor_reset_all = metadata_table_handles_opened;
select name, max_count, min_count, count,
max_count_reset, min_count_reset, count_reset, status
from information_schema.innodb_metrics
where name = "metadata_table_handles_opened";
# Turn off the counter "metadata_table_handles_opened"
set global innodb_monitor_disable = metadata_table_handles_opened;
# Reset the counter value while counter is off (stopped)
set global innodb_monitor_reset = metadata_table_handles_opened;
select name, max_count, min_count, count,
max_count_reset, min_count_reset, count_reset, status
from information_schema.innodb_metrics
where name = "metadata_table_handles_opened";
# re-create table again. Since monitor is off, "metadata_table_handles_opened"
# should not be incremented
drop table monitor_test;
# Create a new table to test "metadata_table_handles_opened" counter
create table monitor_test(col int) engine = innodb;
# "metadata_table_handles_opened" should increment
select * from monitor_test;
select name, max_count, min_count, count,
max_count_reset, min_count_reset, count_reset, status
from information_schema.innodb_metrics
where name = "metadata_table_handles_opened";
# Reset all the counters, include those counter *_since_start
set global innodb_monitor_reset_all = metadata_table_handles_opened;
select name, max_count, min_count, count,
max_count_reset, min_count_reset, count_reset, status
from information_schema.innodb_metrics
where name = "metadata_table_handles_opened";
# Turn on "table_open" counter again
set global innodb_monitor_enable = metadata_table_handles_opened;
# Test metadata_table_handles_opened again to see if it is working correctly
# after above round of turning on/off/reset
drop table monitor_test;
# Create a new table to test "metadata_table_handles_opened" counter
create table monitor_test(col int) engine = innodb;
select * from monitor_test;
# "metadata_table_handles_opened" should increment
select name, max_count, min_count, count,
max_count_reset, min_count_reset, count_reset, status
from information_schema.innodb_metrics
where name = "metadata_table_handles_opened";
# Test counter "metadata_table_handles_closed",
# create index will close the old handle
set global innodb_monitor_enable = metadata_table_handles_closed;
create index idx on monitor_test(col);
select name, max_count, min_count, count,
max_count_reset, min_count_reset, count_reset, status
from information_schema.innodb_metrics
where name = "metadata_table_handles_closed";
select name, max_count, min_count, count,
max_count_reset, min_count_reset, count_reset, status
from information_schema.innodb_metrics
where name like "metadata%";
# Reset counters only in "module_metadata" module
set global innodb_monitor_disable = module_metadata;
set global innodb_monitor_reset = module_metadata;
select name, max_count, min_count, count,
max_count_reset, min_count_reset, count_reset, status
from information_schema.innodb_metrics
where name like "metadata%";
set global innodb_monitor_reset_all = module_metadata;
select name, max_count, min_count, count,
max_count_reset, min_count_reset, count_reset, status
from information_schema.innodb_metrics
where name like "metadata%";
# Test Transaction Module
set global innodb_monitor_enable = module_trx;
begin;
insert into monitor_test values(9);
commit;
begin;
insert into monitor_test values(9);
rollback;
select name, max_count, min_count, count,
max_count_reset, min_count_reset, count_reset, status
from information_schema.innodb_metrics
where name like "trx_rollbacks" or name like "trx_active_transactions";
set global innodb_monitor_disable = module_trx;
# Test DML Module
set global innodb_monitor_enable = module_dml;
insert into monitor_test values(9);
update monitor_test set col = 10 where col = 9;
select name, max_count, min_count, count,
max_count_reset, min_count_reset, count_reset, status
from information_schema.innodb_metrics
where name like "dml%";
delete from monitor_test;
select name, max_count, min_count, count,
max_count_reset, min_count_reset, count_reset, status
from information_schema.innodb_metrics
where name like "dml%";
# test reset counter while the counter is on
set global innodb_monitor_reset = module_dml;
select name, max_count, min_count, count,
max_count_reset, min_count_reset, count_reset, status
from information_schema.innodb_metrics
where name like "dml%";
# insert/delete some rows after the reset
insert into monitor_test values(9);
insert into monitor_test values(1);
delete from monitor_test;
select name, max_count, min_count, count,
max_count_reset, min_count_reset, count_reset, status
from information_schema.innodb_metrics
where name like "dml%";
# We do not allow reset_all while the counter is on, nothing
# should be reset here
set global innodb_monitor_reset_all = module_dml;
select name, max_count, min_count, count,
max_count_reset, min_count_reset, count_reset, status
from information_schema.innodb_metrics
where name like "dml%";
# Turn off the counter
set global innodb_monitor_disable = module_dml;
select name, max_count, min_count, count,
max_count_reset, min_count_reset, count_reset, status
from information_schema.innodb_metrics
where name like "dml%";
# Reset all counter values
set global innodb_monitor_reset_all = module_dml;
select name, max_count, min_count, count,
max_count_reset, min_count_reset, count_reset, status
from information_schema.innodb_metrics
where name like "dml%";
# Open individual counter "dml_inserts"
set global innodb_monitor_enable = dml_inserts;
insert into monitor_test values(9);
insert into monitor_test values(1);
delete from monitor_test;
# Only counter "dml_inserts" should be updated
select name, max_count, min_count, count,
max_count_reset, min_count_reset, count_reset, status
from information_schema.innodb_metrics
where name like "dml%";
set global innodb_monitor_disable = module_dml;
drop table monitor_test;
set global innodb_monitor_enable = file_num_open_files;
select name, max_count, min_count, count,
max_count_reset, min_count_reset, count_reset, status
from information_schema.innodb_metrics
where name like "file_num_open_files";
set global innodb_monitor_disable = file_num_open_files;
# Test ICP module counters
set global innodb_monitor_enable = "icp%";
create table monitor_test(a char(3), b int, c char(2),
primary key (a(1), c(1)), key(b)) engine = innodb;
insert into monitor_test values("13", 2, "aa");
select a from monitor_test where b < 1 for update;
# should have icp_attempts = 1 and icp_out_of_range = 1
select name, count from information_schema.innodb_metrics
where name like "icp%";
# should have icp_attempts = 2 and icp_match = 1
select a from monitor_test where b < 3 for update;
select name, count from information_schema.innodb_metrics
where name like "icp%";
drop table monitor_test;
set global innodb_monitor_disable = All;
set global innodb_monitor_reset_all = all;
-- disable_warnings
set global innodb_monitor_enable = default;
set global innodb_monitor_disable = default;
set global innodb_monitor_reset = default;
set global innodb_monitor_reset_all = default;
-- enable_warnings

View File

@@ -0,0 +1,375 @@
# This is the test for Metrics Monitor Table feature.
# Test the metrics monitor system's control system
# and counter accuracy.
--source include/have_innodb.inc
set global innodb_monitor_disable = All;
# Test turn on/off the monitor counter with "all" option
# By default, they will be off
select name, status from information_schema.innodb_metrics;
# Turn on all monitor counters
set global innodb_monitor_enable = all;
# status should all change to "started"
select name, status from information_schema.innodb_metrics;
# Test wrong argument to the global configure option
--error ER_WRONG_VALUE_FOR_VAR
set global innodb_monitor_enable = aaa;
# We require a valid monitor counter/module name. There is no default
# counter name or module. A warning will be printed asking user to
# specify a valid counter name.
#--disable_warnings
#set global innodb_monitor_enable = default;
#--enable_warnings
# Turn off all monitor counters, option name should be case
# insensitive
set global innodb_monitor_disable = All;
# status should all change to "stopped"
select name, status from information_schema.innodb_metrics;
# Reset all counter values
set global innodb_monitor_reset_all = all;
# count should all change to 0
select name, count, status from information_schema.innodb_metrics;
# Test wildcard match, turn on all counters contain string "lock"
set global innodb_monitor_enable = "%lock%";
# All lock related counter should be enabled
select name, status from information_schema.innodb_metrics
where name like "%lock%";
# Disable them
set global innodb_monitor_disable = "%lock%";
# All lock related counter should be disabled
select name, status from information_schema.innodb_metrics
where name like "%lock%";
# No match for "%lock*"
--error ER_WRONG_VALUE_FOR_VAR
set global innodb_monitor_enable = "%lock*";
# All counters will be turned on with wildcard match string with all "%"
set global innodb_monitor_enable="%%%%%%%%%%%%%%%%%%%%%%%%%%%";
select name, status from information_schema.innodb_metrics;
# Turn off all counters
set global innodb_monitor_disable="%%%%%";
select name, status from information_schema.innodb_metrics;
# One more round testing. All counters will be turned on with
# single wildcard character "%"
set global innodb_monitor_enable="%";
select name, status from information_schema.innodb_metrics;
# Turn off all the counters with "%_%"
set global innodb_monitor_disable="%_%";
select name, status from information_schema.innodb_metrics;
# Turn on all counters start with "log"
set global innodb_monitor_enable="log%%%%";
select name, status from information_schema.innodb_metrics;
# Turn on counters "os_data_fsync" with wildcard match "os_%a_fs_ncs", "_"
# is single character wildcard match word
set global innodb_monitor_enable="os_%a_fs_ncs";
# Turn on counters whose name contains "os" and "pending" with
# wildcard match "os%pending%"
set global innodb_monitor_enable="os%pending%";
select name, status from information_schema.innodb_metrics
where name like "os%";
# Empty string is an invalid option
--error ER_WRONG_VALUE_FOR_VAR
set global innodb_monitor_enable="";
--error ER_WRONG_VALUE_FOR_VAR
set global innodb_monitor_enable="_";
SET global innodb_monitor_disable = module_metadata;
SET global innodb_monitor_reset_all = module_metadata;
# Only turn on "table_open" counter
set global innodb_monitor_enable = metadata_table_handles_opened;
# Create a new table to test "metadata_table_handles_opened" counter
create table monitor_test(col int) engine = innodb;
# This will open the monitor_test table
select * from monitor_test;
# "metadata_table_handles_opened" should increment by 1
select name, max_count, min_count, count,
max_count_reset, min_count_reset, count_reset, status
from information_schema.innodb_metrics
where name = "metadata_table_handles_opened";
# Reset the counter value while counter is still on (started)
# This will reset value "count_reset" but not
# "count"
set global innodb_monitor_reset = metadata_table_handles_opened;
select name, max_count, min_count, count,
max_count_reset, min_count_reset, count_reset, status
from information_schema.innodb_metrics
where name = "metadata_table_handles_opened";
# re-create table again to increment "metadata_table_handles_opened" again
drop table monitor_test;
# Create a new table to test "metadata_table_handles_opened" counter
create table monitor_test(col int) engine = innodb;
select * from monitor_test;
# "metadata_table_handles_opened" should increment
select name, max_count, min_count, count,
max_count_reset, min_count_reset, count_reset, status
from information_schema.innodb_metrics
where name = "metadata_table_handles_opened";
# Cannot reset all monitor value while the counter is on
set global innodb_monitor_reset_all = metadata_table_handles_opened;
select name, max_count, min_count, count,
max_count_reset, min_count_reset, count_reset, status
from information_schema.innodb_metrics
where name = "metadata_table_handles_opened";
# Turn off the counter "metadata_table_handles_opened"
set global innodb_monitor_disable = metadata_table_handles_opened;
# Reset the counter value while counter is off (stopped)
set global innodb_monitor_reset = metadata_table_handles_opened;
select name, max_count, min_count, count,
max_count_reset, min_count_reset, count_reset, status
from information_schema.innodb_metrics
where name = "metadata_table_handles_opened";
# re-create table again. Since monitor is off, "metadata_table_handles_opened"
# should not be incremented
drop table monitor_test;
# Create a new table to test "metadata_table_handles_opened" counter
create table monitor_test(col int) engine = innodb;
# "metadata_table_handles_opened" should increment
select * from monitor_test;
select name, max_count, min_count, count,
max_count_reset, min_count_reset, count_reset, status
from information_schema.innodb_metrics
where name = "metadata_table_handles_opened";
# Reset all the counters, include those counter *_since_start
set global innodb_monitor_reset_all = metadata_table_handles_opened;
select name, max_count, min_count, count,
max_count_reset, min_count_reset, count_reset, status
from information_schema.innodb_metrics
where name = "metadata_table_handles_opened";
# Turn on "table_open" counter again
set global innodb_monitor_enable = metadata_table_handles_opened;
# Test metadata_table_handles_opened again to see if it is working correctly
# after above round of turning on/off/reset
drop table monitor_test;
# Create a new table to test "metadata_table_handles_opened" counter
create table monitor_test(col int) engine = innodb;
select * from monitor_test;
# "metadata_table_handles_opened" should increment
select name, max_count, min_count, count,
max_count_reset, min_count_reset, count_reset, status
from information_schema.innodb_metrics
where name = "metadata_table_handles_opened";
# Test counter "metadata_table_handles_closed",
# create index will close the old handle
set global innodb_monitor_enable = metadata_table_handles_closed;
create index idx on monitor_test(col);
select name, max_count, min_count, count,
max_count_reset, min_count_reset, count_reset, status
from information_schema.innodb_metrics
where name = "metadata_table_handles_closed";
select name, max_count, min_count, count,
max_count_reset, min_count_reset, count_reset, status
from information_schema.innodb_metrics
where name like "metadata%";
# Reset counters only in "module_metadata" module
set global innodb_monitor_disable = module_metadata;
set global innodb_monitor_reset = module_metadata;
select name, max_count, min_count, count,
max_count_reset, min_count_reset, count_reset, status
from information_schema.innodb_metrics
where name like "metadata%";
set global innodb_monitor_reset_all = module_metadata;
select name, max_count, min_count, count,
max_count_reset, min_count_reset, count_reset, status
from information_schema.innodb_metrics
where name like "metadata%";
# Test Transaction Module
set global innodb_monitor_enable = module_trx;
begin;
insert into monitor_test values(9);
commit;
begin;
insert into monitor_test values(9);
rollback;
select name, max_count, min_count, count,
max_count_reset, min_count_reset, count_reset, status
from information_schema.innodb_metrics
where name like "trx_rollbacks" or name like "trx_active_transactions";
set global innodb_monitor_disable = module_trx;
# Test DML Module
set global innodb_monitor_enable = module_dml;
insert into monitor_test values(9);
update monitor_test set col = 10 where col = 9;
select name, max_count, min_count, count,
max_count_reset, min_count_reset, count_reset, status
from information_schema.innodb_metrics
where name like "dml%";
delete from monitor_test;
select name, max_count, min_count, count,
max_count_reset, min_count_reset, count_reset, status
from information_schema.innodb_metrics
where name like "dml%";
# test reset counter while the counter is on
set global innodb_monitor_reset = module_dml;
select name, max_count, min_count, count,
max_count_reset, min_count_reset, count_reset, status
from information_schema.innodb_metrics
where name like "dml%";
# insert/delete some rows after the reset
insert into monitor_test values(9);
insert into monitor_test values(1);
delete from monitor_test;
select name, max_count, min_count, count,
max_count_reset, min_count_reset, count_reset, status
from information_schema.innodb_metrics
where name like "dml%";
# We do not allow reset_all while the counter is on, nothing
# should be reset here
set global innodb_monitor_reset_all = module_dml;
select name, max_count, min_count, count,
max_count_reset, min_count_reset, count_reset, status
from information_schema.innodb_metrics
where name like "dml%";
# Turn off the counter
set global innodb_monitor_disable = module_dml;
select name, max_count, min_count, count,
max_count_reset, min_count_reset, count_reset, status
from information_schema.innodb_metrics
where name like "dml%";
# Reset all counter values
set global innodb_monitor_reset_all = module_dml;
select name, max_count, min_count, count,
max_count_reset, min_count_reset, count_reset, status
from information_schema.innodb_metrics
where name like "dml%";
# Open individual counter "dml_inserts"
set global innodb_monitor_enable = dml_inserts;
insert into monitor_test values(9);
insert into monitor_test values(1);
delete from monitor_test;
# Only counter "dml_inserts" should be updated
select name, max_count, min_count, count,
max_count_reset, min_count_reset, count_reset, status
from information_schema.innodb_metrics
where name like "dml%";
set global innodb_monitor_disable = module_dml;
drop table monitor_test;
set global innodb_monitor_enable = file_num_open_files;
select name, max_count, min_count, count,
max_count_reset, min_count_reset, count_reset, status
from information_schema.innodb_metrics
where name like "file_num_open_files";
set global innodb_monitor_disable = file_num_open_files;
# Test ICP module counters
set global innodb_monitor_enable = "icp%";
create table monitor_test(a char(3), b int, c char(2),
primary key (a(1), c(1)), key(b)) engine = innodb;
insert into monitor_test values("13", 2, "aa");
select a from monitor_test where b < 1 for update;
# should have icp_attempts = 1 and icp_out_of_range = 1
select name, count from information_schema.innodb_metrics
where name like "icp%";
# should have icp_attempts = 2 and icp_match = 1
select a from monitor_test where b < 3 for update;
select name, count from information_schema.innodb_metrics
where name like "icp%";
drop table monitor_test;
set global innodb_monitor_disable = All;
set global innodb_monitor_reset_all = all;
-- disable_warnings
set global innodb_monitor_enable = default;
set global innodb_monitor_disable = default;
set global innodb_monitor_reset = default;
set global innodb_monitor_reset_all = default;
-- enable_warnings

View File

@@ -0,0 +1,375 @@
# This is the test for Metrics Monitor Table feature.
# Test the metrics monitor system's control system
# and counter accuracy.
--source include/have_innodb.inc
set global innodb_monitor_disable = All;
# Test turn on/off the monitor counter with "all" option
# By default, they will be off
select name, status from information_schema.innodb_metrics;
# Turn on all monitor counters
set global innodb_monitor_enable = all;
# status should all change to "started"
select name, status from information_schema.innodb_metrics;
# Test wrong argument to the global configure option
--error ER_WRONG_VALUE_FOR_VAR
set global innodb_monitor_enable = aaa;
# We require a valid monitor counter/module name. There is no default
# counter name or module. A warning will be printed asking user to
# specify a valid counter name.
#--disable_warnings
#set global innodb_monitor_enable = default;
#--enable_warnings
# Turn off all monitor counters, option name should be case
# insensitive
set global innodb_monitor_disable = All;
# status should all change to "stopped"
select name, status from information_schema.innodb_metrics;
# Reset all counter values
set global innodb_monitor_reset_all = all;
# count should all change to 0
select name, count, status from information_schema.innodb_metrics;
# Test wildcard match, turn on all counters contain string "lock"
set global innodb_monitor_enable = "%lock%";
# All lock related counter should be enabled
select name, status from information_schema.innodb_metrics
where name like "%lock%";
# Disable them
set global innodb_monitor_disable = "%lock%";
# All lock related counter should be disabled
select name, status from information_schema.innodb_metrics
where name like "%lock%";
# No match for "%lock*"
--error ER_WRONG_VALUE_FOR_VAR
set global innodb_monitor_enable = "%lock*";
# All counters will be turned on with wildcard match string with all "%"
set global innodb_monitor_enable="%%%%%%%%%%%%%%%%%%%%%%%%%%%";
select name, status from information_schema.innodb_metrics;
# Turn off all counters
set global innodb_monitor_disable="%%%%%";
select name, status from information_schema.innodb_metrics;
# One more round testing. All counters will be turned on with
# single wildcard character "%"
set global innodb_monitor_enable="%";
select name, status from information_schema.innodb_metrics;
# Turn off all the counters with "%_%"
set global innodb_monitor_disable="%_%";
select name, status from information_schema.innodb_metrics;
# Turn on all counters start with "log"
set global innodb_monitor_enable="log%%%%";
select name, status from information_schema.innodb_metrics;
# Turn on counters "os_data_fsync" with wildcard match "os_%a_fs_ncs", "_"
# is single character wildcard match word
set global innodb_monitor_enable="os_%a_fs_ncs";
# Turn on counters whose name contains "os" and "pending" with
# wildcard match "os%pending%"
set global innodb_monitor_enable="os%pending%";
select name, status from information_schema.innodb_metrics
where name like "os%";
# Empty string is an invalid option
--error ER_WRONG_VALUE_FOR_VAR
set global innodb_monitor_enable="";
--error ER_WRONG_VALUE_FOR_VAR
set global innodb_monitor_enable="_";
SET global innodb_monitor_disable = module_metadata;
SET global innodb_monitor_reset_all = module_metadata;
# Only turn on "table_open" counter
set global innodb_monitor_enable = metadata_table_handles_opened;
# Create a new table to test "metadata_table_handles_opened" counter
create table monitor_test(col int) engine = innodb;
# This will open the monitor_test table
select * from monitor_test;
# "metadata_table_handles_opened" should increment by 1
select name, max_count, min_count, count,
max_count_reset, min_count_reset, count_reset, status
from information_schema.innodb_metrics
where name = "metadata_table_handles_opened";
# Reset the counter value while counter is still on (started)
# This will reset value "count_reset" but not
# "count"
set global innodb_monitor_reset = metadata_table_handles_opened;
select name, max_count, min_count, count,
max_count_reset, min_count_reset, count_reset, status
from information_schema.innodb_metrics
where name = "metadata_table_handles_opened";
# re-create table again to increment "metadata_table_handles_opened" again
drop table monitor_test;
# Create a new table to test "metadata_table_handles_opened" counter
create table monitor_test(col int) engine = innodb;
select * from monitor_test;
# "metadata_table_handles_opened" should increment
select name, max_count, min_count, count,
max_count_reset, min_count_reset, count_reset, status
from information_schema.innodb_metrics
where name = "metadata_table_handles_opened";
# Cannot reset all monitor value while the counter is on
set global innodb_monitor_reset_all = metadata_table_handles_opened;
select name, max_count, min_count, count,
max_count_reset, min_count_reset, count_reset, status
from information_schema.innodb_metrics
where name = "metadata_table_handles_opened";
# Turn off the counter "metadata_table_handles_opened"
set global innodb_monitor_disable = metadata_table_handles_opened;
# Reset the counter value while counter is off (stopped)
set global innodb_monitor_reset = metadata_table_handles_opened;
select name, max_count, min_count, count,
max_count_reset, min_count_reset, count_reset, status
from information_schema.innodb_metrics
where name = "metadata_table_handles_opened";
# re-create table again. Since monitor is off, "metadata_table_handles_opened"
# should not be incremented
drop table monitor_test;
# Create a new table to test "metadata_table_handles_opened" counter
create table monitor_test(col int) engine = innodb;
# "metadata_table_handles_opened" should increment
select * from monitor_test;
select name, max_count, min_count, count,
max_count_reset, min_count_reset, count_reset, status
from information_schema.innodb_metrics
where name = "metadata_table_handles_opened";
# Reset all the counters, include those counter *_since_start
set global innodb_monitor_reset_all = metadata_table_handles_opened;
select name, max_count, min_count, count,
max_count_reset, min_count_reset, count_reset, status
from information_schema.innodb_metrics
where name = "metadata_table_handles_opened";
# Turn on "table_open" counter again
set global innodb_monitor_enable = metadata_table_handles_opened;
# Test metadata_table_handles_opened again to see if it is working correctly
# after above round of turning on/off/reset
drop table monitor_test;
# Create a new table to test "metadata_table_handles_opened" counter
create table monitor_test(col int) engine = innodb;
select * from monitor_test;
# "metadata_table_handles_opened" should increment
select name, max_count, min_count, count,
max_count_reset, min_count_reset, count_reset, status
from information_schema.innodb_metrics
where name = "metadata_table_handles_opened";
# Test counter "metadata_table_handles_closed",
# create index will close the old handle
set global innodb_monitor_enable = metadata_table_handles_closed;
create index idx on monitor_test(col);
select name, max_count, min_count, count,
max_count_reset, min_count_reset, count_reset, status
from information_schema.innodb_metrics
where name = "metadata_table_handles_closed";
select name, max_count, min_count, count,
max_count_reset, min_count_reset, count_reset, status
from information_schema.innodb_metrics
where name like "metadata%";
# Reset counters only in "module_metadata" module
set global innodb_monitor_disable = module_metadata;
set global innodb_monitor_reset = module_metadata;
select name, max_count, min_count, count,
max_count_reset, min_count_reset, count_reset, status
from information_schema.innodb_metrics
where name like "metadata%";
set global innodb_monitor_reset_all = module_metadata;
select name, max_count, min_count, count,
max_count_reset, min_count_reset, count_reset, status
from information_schema.innodb_metrics
where name like "metadata%";
# Test Transaction Module
set global innodb_monitor_enable = module_trx;
begin;
insert into monitor_test values(9);
commit;
begin;
insert into monitor_test values(9);
rollback;
select name, max_count, min_count, count,
max_count_reset, min_count_reset, count_reset, status
from information_schema.innodb_metrics
where name like "trx_rollbacks" or name like "trx_active_transactions";
set global innodb_monitor_disable = module_trx;
# Test DML Module
set global innodb_monitor_enable = module_dml;
insert into monitor_test values(9);
update monitor_test set col = 10 where col = 9;
select name, max_count, min_count, count,
max_count_reset, min_count_reset, count_reset, status
from information_schema.innodb_metrics
where name like "dml%";
delete from monitor_test;
select name, max_count, min_count, count,
max_count_reset, min_count_reset, count_reset, status
from information_schema.innodb_metrics
where name like "dml%";
# test reset counter while the counter is on
set global innodb_monitor_reset = module_dml;
select name, max_count, min_count, count,
max_count_reset, min_count_reset, count_reset, status
from information_schema.innodb_metrics
where name like "dml%";
# insert/delete some rows after the reset
insert into monitor_test values(9);
insert into monitor_test values(1);
delete from monitor_test;
select name, max_count, min_count, count,
max_count_reset, min_count_reset, count_reset, status
from information_schema.innodb_metrics
where name like "dml%";
# We do not allow reset_all while the counter is on, nothing
# should be reset here
set global innodb_monitor_reset_all = module_dml;
select name, max_count, min_count, count,
max_count_reset, min_count_reset, count_reset, status
from information_schema.innodb_metrics
where name like "dml%";
# Turn off the counter
set global innodb_monitor_disable = module_dml;
select name, max_count, min_count, count,
max_count_reset, min_count_reset, count_reset, status
from information_schema.innodb_metrics
where name like "dml%";
# Reset all counter values
set global innodb_monitor_reset_all = module_dml;
select name, max_count, min_count, count,
max_count_reset, min_count_reset, count_reset, status
from information_schema.innodb_metrics
where name like "dml%";
# Open individual counter "dml_inserts"
set global innodb_monitor_enable = dml_inserts;
insert into monitor_test values(9);
insert into monitor_test values(1);
delete from monitor_test;
# Only counter "dml_inserts" should be updated
select name, max_count, min_count, count,
max_count_reset, min_count_reset, count_reset, status
from information_schema.innodb_metrics
where name like "dml%";
set global innodb_monitor_disable = module_dml;
drop table monitor_test;
set global innodb_monitor_enable = file_num_open_files;
select name, max_count, min_count, count,
max_count_reset, min_count_reset, count_reset, status
from information_schema.innodb_metrics
where name like "file_num_open_files";
set global innodb_monitor_disable = file_num_open_files;
# Test ICP module counters
set global innodb_monitor_enable = "icp%";
create table monitor_test(a char(3), b int, c char(2),
primary key (a(1), c(1)), key(b)) engine = innodb;
insert into monitor_test values("13", 2, "aa");
select a from monitor_test where b < 1 for update;
# should have icp_attempts = 1 and icp_out_of_range = 1
select name, count from information_schema.innodb_metrics
where name like "icp%";
# should have icp_attempts = 2 and icp_match = 1
select a from monitor_test where b < 3 for update;
select name, count from information_schema.innodb_metrics
where name like "icp%";
drop table monitor_test;
set global innodb_monitor_disable = All;
set global innodb_monitor_reset_all = all;
-- disable_warnings
set global innodb_monitor_enable = default;
set global innodb_monitor_disable = default;
set global innodb_monitor_reset = default;
set global innodb_monitor_reset_all = default;
-- enable_warnings

View File

@@ -0,0 +1,375 @@
# This is the test for Metrics Monitor Table feature.
# Test the metrics monitor system's control system
# and counter accuracy.
--source include/have_innodb.inc
set global innodb_monitor_disable = All;
# Test turn on/off the monitor counter with "all" option
# By default, they will be off
select name, status from information_schema.innodb_metrics;
# Turn on all monitor counters
set global innodb_monitor_enable = all;
# status should all change to "started"
select name, status from information_schema.innodb_metrics;
# Test wrong argument to the global configure option
--error ER_WRONG_VALUE_FOR_VAR
set global innodb_monitor_enable = aaa;
# We require a valid monitor counter/module name. There is no default
# counter name or module. A warning will be printed asking user to
# specify a valid counter name.
#--disable_warnings
#set global innodb_monitor_enable = default;
#--enable_warnings
# Turn off all monitor counters, option name should be case
# insensitive
set global innodb_monitor_disable = All;
# status should all change to "stopped"
select name, status from information_schema.innodb_metrics;
# Reset all counter values
set global innodb_monitor_reset_all = all;
# count should all change to 0
select name, count, status from information_schema.innodb_metrics;
# Test wildcard match, turn on all counters contain string "lock"
set global innodb_monitor_enable = "%lock%";
# All lock related counter should be enabled
select name, status from information_schema.innodb_metrics
where name like "%lock%";
# Disable them
set global innodb_monitor_disable = "%lock%";
# All lock related counter should be disabled
select name, status from information_schema.innodb_metrics
where name like "%lock%";
# No match for "%lock*"
--error ER_WRONG_VALUE_FOR_VAR
set global innodb_monitor_enable = "%lock*";
# All counters will be turned on with wildcard match string with all "%"
set global innodb_monitor_enable="%%%%%%%%%%%%%%%%%%%%%%%%%%%";
select name, status from information_schema.innodb_metrics;
# Turn off all counters
set global innodb_monitor_disable="%%%%%";
select name, status from information_schema.innodb_metrics;
# One more round testing. All counters will be turned on with
# single wildcard character "%"
set global innodb_monitor_enable="%";
select name, status from information_schema.innodb_metrics;
# Turn off all the counters with "%_%"
set global innodb_monitor_disable="%_%";
select name, status from information_schema.innodb_metrics;
# Turn on all counters start with "log"
set global innodb_monitor_enable="log%%%%";
select name, status from information_schema.innodb_metrics;
# Turn on counters "os_data_fsync" with wildcard match "os_%a_fs_ncs", "_"
# is single character wildcard match word
set global innodb_monitor_enable="os_%a_fs_ncs";
# Turn on counters whose name contains "os" and "pending" with
# wildcard match "os%pending%"
set global innodb_monitor_enable="os%pending%";
select name, status from information_schema.innodb_metrics
where name like "os%";
# Empty string is an invalid option
--error ER_WRONG_VALUE_FOR_VAR
set global innodb_monitor_enable="";
--error ER_WRONG_VALUE_FOR_VAR
set global innodb_monitor_enable="_";
SET global innodb_monitor_disable = module_metadata;
SET global innodb_monitor_reset_all = module_metadata;
# Only turn on "table_open" counter
set global innodb_monitor_enable = metadata_table_handles_opened;
# Create a new table to test "metadata_table_handles_opened" counter
create table monitor_test(col int) engine = innodb;
# This will open the monitor_test table
select * from monitor_test;
# "metadata_table_handles_opened" should increment by 1
select name, max_count, min_count, count,
max_count_reset, min_count_reset, count_reset, status
from information_schema.innodb_metrics
where name = "metadata_table_handles_opened";
# Reset the counter value while counter is still on (started)
# This will reset value "count_reset" but not
# "count"
set global innodb_monitor_reset = metadata_table_handles_opened;
select name, max_count, min_count, count,
max_count_reset, min_count_reset, count_reset, status
from information_schema.innodb_metrics
where name = "metadata_table_handles_opened";
# re-create table again to increment "metadata_table_handles_opened" again
drop table monitor_test;
# Create a new table to test "metadata_table_handles_opened" counter
create table monitor_test(col int) engine = innodb;
select * from monitor_test;
# "metadata_table_handles_opened" should increment
select name, max_count, min_count, count,
max_count_reset, min_count_reset, count_reset, status
from information_schema.innodb_metrics
where name = "metadata_table_handles_opened";
# Cannot reset all monitor value while the counter is on
set global innodb_monitor_reset_all = metadata_table_handles_opened;
select name, max_count, min_count, count,
max_count_reset, min_count_reset, count_reset, status
from information_schema.innodb_metrics
where name = "metadata_table_handles_opened";
# Turn off the counter "metadata_table_handles_opened"
set global innodb_monitor_disable = metadata_table_handles_opened;
# Reset the counter value while counter is off (stopped)
set global innodb_monitor_reset = metadata_table_handles_opened;
select name, max_count, min_count, count,
max_count_reset, min_count_reset, count_reset, status
from information_schema.innodb_metrics
where name = "metadata_table_handles_opened";
# re-create table again. Since monitor is off, "metadata_table_handles_opened"
# should not be incremented
drop table monitor_test;
# Create a new table to test "metadata_table_handles_opened" counter
create table monitor_test(col int) engine = innodb;
# "metadata_table_handles_opened" should increment
select * from monitor_test;
select name, max_count, min_count, count,
max_count_reset, min_count_reset, count_reset, status
from information_schema.innodb_metrics
where name = "metadata_table_handles_opened";
# Reset all the counters, include those counter *_since_start
set global innodb_monitor_reset_all = metadata_table_handles_opened;
select name, max_count, min_count, count,
max_count_reset, min_count_reset, count_reset, status
from information_schema.innodb_metrics
where name = "metadata_table_handles_opened";
# Turn on "table_open" counter again
set global innodb_monitor_enable = metadata_table_handles_opened;
# Test metadata_table_handles_opened again to see if it is working correctly
# after above round of turning on/off/reset
drop table monitor_test;
# Create a new table to test "metadata_table_handles_opened" counter
create table monitor_test(col int) engine = innodb;
select * from monitor_test;
# "metadata_table_handles_opened" should increment
select name, max_count, min_count, count,
max_count_reset, min_count_reset, count_reset, status
from information_schema.innodb_metrics
where name = "metadata_table_handles_opened";
# Test counter "metadata_table_handles_closed",
# create index will close the old handle
set global innodb_monitor_enable = metadata_table_handles_closed;
create index idx on monitor_test(col);
select name, max_count, min_count, count,
max_count_reset, min_count_reset, count_reset, status
from information_schema.innodb_metrics
where name = "metadata_table_handles_closed";
select name, max_count, min_count, count,
max_count_reset, min_count_reset, count_reset, status
from information_schema.innodb_metrics
where name like "metadata%";
# Reset counters only in "module_metadata" module
set global innodb_monitor_disable = module_metadata;
set global innodb_monitor_reset = module_metadata;
select name, max_count, min_count, count,
max_count_reset, min_count_reset, count_reset, status
from information_schema.innodb_metrics
where name like "metadata%";
set global innodb_monitor_reset_all = module_metadata;
select name, max_count, min_count, count,
max_count_reset, min_count_reset, count_reset, status
from information_schema.innodb_metrics
where name like "metadata%";
# Test Transaction Module
set global innodb_monitor_enable = module_trx;
begin;
insert into monitor_test values(9);
commit;
begin;
insert into monitor_test values(9);
rollback;
select name, max_count, min_count, count,
max_count_reset, min_count_reset, count_reset, status
from information_schema.innodb_metrics
where name like "trx_rollbacks" or name like "trx_active_transactions";
set global innodb_monitor_disable = module_trx;
# Test DML Module
set global innodb_monitor_enable = module_dml;
insert into monitor_test values(9);
update monitor_test set col = 10 where col = 9;
select name, max_count, min_count, count,
max_count_reset, min_count_reset, count_reset, status
from information_schema.innodb_metrics
where name like "dml%";
delete from monitor_test;
select name, max_count, min_count, count,
max_count_reset, min_count_reset, count_reset, status
from information_schema.innodb_metrics
where name like "dml%";
# test reset counter while the counter is on
set global innodb_monitor_reset = module_dml;
select name, max_count, min_count, count,
max_count_reset, min_count_reset, count_reset, status
from information_schema.innodb_metrics
where name like "dml%";
# insert/delete some rows after the reset
insert into monitor_test values(9);
insert into monitor_test values(1);
delete from monitor_test;
select name, max_count, min_count, count,
max_count_reset, min_count_reset, count_reset, status
from information_schema.innodb_metrics
where name like "dml%";
# We do not allow reset_all while the counter is on, nothing
# should be reset here
set global innodb_monitor_reset_all = module_dml;
select name, max_count, min_count, count,
max_count_reset, min_count_reset, count_reset, status
from information_schema.innodb_metrics
where name like "dml%";
# Turn off the counter
set global innodb_monitor_disable = module_dml;
select name, max_count, min_count, count,
max_count_reset, min_count_reset, count_reset, status
from information_schema.innodb_metrics
where name like "dml%";
# Reset all counter values
set global innodb_monitor_reset_all = module_dml;
select name, max_count, min_count, count,
max_count_reset, min_count_reset, count_reset, status
from information_schema.innodb_metrics
where name like "dml%";
# Open individual counter "dml_inserts"
set global innodb_monitor_enable = dml_inserts;
insert into monitor_test values(9);
insert into monitor_test values(1);
delete from monitor_test;
# Only counter "dml_inserts" should be updated
select name, max_count, min_count, count,
max_count_reset, min_count_reset, count_reset, status
from information_schema.innodb_metrics
where name like "dml%";
set global innodb_monitor_disable = module_dml;
drop table monitor_test;
set global innodb_monitor_enable = file_num_open_files;
select name, max_count, min_count, count,
max_count_reset, min_count_reset, count_reset, status
from information_schema.innodb_metrics
where name like "file_num_open_files";
set global innodb_monitor_disable = file_num_open_files;
# Test ICP module counters
set global innodb_monitor_enable = "icp%";
create table monitor_test(a char(3), b int, c char(2),
primary key (a(1), c(1)), key(b)) engine = innodb;
insert into monitor_test values("13", 2, "aa");
select a from monitor_test where b < 1 for update;
# should have icp_attempts = 1 and icp_out_of_range = 1
select name, count from information_schema.innodb_metrics
where name like "icp%";
# should have icp_attempts = 2 and icp_match = 1
select a from monitor_test where b < 3 for update;
select name, count from information_schema.innodb_metrics
where name like "icp%";
drop table monitor_test;
set global innodb_monitor_disable = All;
set global innodb_monitor_reset_all = all;
-- disable_warnings
set global innodb_monitor_enable = default;
set global innodb_monitor_disable = default;
set global innodb_monitor_reset = default;
set global innodb_monitor_reset_all = default;
-- enable_warnings

View File

@@ -0,0 +1,70 @@
# 2011-11-16 - Added
#
--source include/have_innodb.inc
SET @start_global_value = @@global.innodb_optimize_fulltext_only;
SELECT @start_global_value;
#
# exists as global only
#
--echo Valid values are 'ON' and 'OFF'
select @@global.innodb_optimize_fulltext_only in (0, 1);
select @@global.innodb_optimize_fulltext_only;
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
select @@session.innodb_optimize_fulltext_only;
show global variables like 'innodb_optimize_fulltext_only';
show session variables like 'innodb_optimize_fulltext_only';
select * from information_schema.global_variables where variable_name='innodb_optimize_fulltext_only';
select * from information_schema.session_variables where variable_name='innodb_optimize_fulltext_only';
#
# show that it's writable
#
set global innodb_optimize_fulltext_only='ON';
select @@global.innodb_optimize_fulltext_only;
select * from information_schema.global_variables where variable_name='innodb_optimize_fulltext_only';
select * from information_schema.session_variables where variable_name='innodb_optimize_fulltext_only';
set @@global.innodb_optimize_fulltext_only=0;
select @@global.innodb_optimize_fulltext_only;
select * from information_schema.global_variables where variable_name='innodb_optimize_fulltext_only';
select * from information_schema.session_variables where variable_name='innodb_optimize_fulltext_only';
set global innodb_optimize_fulltext_only=1;
select @@global.innodb_optimize_fulltext_only;
select * from information_schema.global_variables where variable_name='innodb_optimize_fulltext_only';
select * from information_schema.session_variables where variable_name='innodb_optimize_fulltext_only';
set @@global.innodb_optimize_fulltext_only='OFF';
select @@global.innodb_optimize_fulltext_only;
select * from information_schema.global_variables where variable_name='innodb_optimize_fulltext_only';
select * from information_schema.session_variables where variable_name='innodb_optimize_fulltext_only';
--error ER_GLOBAL_VARIABLE
set session innodb_optimize_fulltext_only='OFF';
--error ER_GLOBAL_VARIABLE
set @@session.innodb_optimize_fulltext_only='ON';
#
# incorrect types
#
--error ER_WRONG_TYPE_FOR_VAR
set global innodb_optimize_fulltext_only=1.1;
--error ER_WRONG_TYPE_FOR_VAR
set global innodb_optimize_fulltext_only=1e1;
--error ER_WRONG_VALUE_FOR_VAR
set global innodb_optimize_fulltext_only=2;
--error ER_WRONG_VALUE_FOR_VAR
set global innodb_optimize_fulltext_only=-3;
select @@global.innodb_optimize_fulltext_only;
select * from information_schema.global_variables where variable_name='innodb_optimize_fulltext_only';
select * from information_schema.session_variables where variable_name='innodb_optimize_fulltext_only';
--error ER_WRONG_VALUE_FOR_VAR
set global innodb_optimize_fulltext_only='AUTO';
#
# Cleanup
#
SET @@global.innodb_optimize_fulltext_only = @start_global_value;
SELECT @@global.innodb_optimize_fulltext_only;

View File

@@ -0,0 +1,22 @@
--source include/have_innodb.inc
--source include/have_debug.inc
#
# exists as global only
#
select @@global.innodb_page_hash_locks between 1 and 1024;
select @@global.innodb_page_hash_locks;
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
select @@session.innodb_page_hash_locks;
show global variables like 'innodb_page_hash_locks';
show session variables like 'innodb_page_hash_locks';
select * from information_schema.global_variables where variable_name='innodb_page_hash_locks';
select * from information_schema.session_variables where variable_name='innodb_page_hash_locks';
#
# show that it's read-only
#
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
set global innodb_page_hash_locks=1;
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
set @@session.innodb_page_hash_locks='some';

View File

@@ -0,0 +1,81 @@
# 2010-01-25 - Added
#
--source include/have_innodb.inc
SET @start_global_value = @@global.innodb_print_all_deadlocks;
SELECT @start_global_value;
#
# exists as global only
#
--echo Valid values are 'ON' and 'OFF'
SELECT @@global.innodb_print_all_deadlocks in (0, 1);
SELECT @@global.innodb_print_all_deadlocks;
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
SELECT @@session.innodb_print_all_deadlocks;
SHOW global variables LIKE 'innodb_print_all_deadlocks';
SHOW session variables LIKE 'innodb_print_all_deadlocks';
SELECT * FROM information_schema.global_variables
WHERE variable_name='innodb_print_all_deadlocks';
SELECT * FROM information_schema.session_variables
WHERE variable_name='innodb_print_all_deadlocks';
#
# SHOW that it's writable
#
SET global innodb_print_all_deadlocks='OFF';
SELECT @@global.innodb_print_all_deadlocks;
SELECT * FROM information_schema.global_variables
WHERE variable_name='innodb_print_all_deadlocks';
SELECT * FROM information_schema.session_variables
WHERE variable_name='innodb_print_all_deadlocks';
SET @@global.innodb_print_all_deadlocks=1;
SELECT @@global.innodb_print_all_deadlocks;
SELECT * FROM information_schema.global_variables
WHERE variable_name='innodb_print_all_deadlocks';
SELECT * FROM information_schema.session_variables
WHERE variable_name='innodb_print_all_deadlocks';
SET global innodb_print_all_deadlocks=0;
SELECT @@global.innodb_print_all_deadlocks;
SELECT * FROM information_schema.global_variables
WHERE variable_name='innodb_print_all_deadlocks';
SELECT * FROM information_schema.session_variables
WHERE variable_name='innodb_print_all_deadlocks';
SET @@global.innodb_print_all_deadlocks='ON';
SELECT @@global.innodb_print_all_deadlocks;
SELECT * FROM information_schema.global_variables
WHERE variable_name='innodb_print_all_deadlocks';
SELECT * FROM information_schema.session_variables
WHERE variable_name='innodb_print_all_deadlocks';
--error ER_GLOBAL_VARIABLE
SET session innodb_print_all_deadlocks='OFF';
--error ER_GLOBAL_VARIABLE
SET @@session.innodb_print_all_deadlocks='ON';
#
# incorrect types
#
--error ER_WRONG_TYPE_FOR_VAR
SET global innodb_print_all_deadlocks=1.1;
--error ER_WRONG_TYPE_FOR_VAR
SET global innodb_print_all_deadlocks=1e1;
--error ER_WRONG_VALUE_FOR_VAR
SET global innodb_print_all_deadlocks=2;
--error ER_WRONG_VALUE_FOR_VAR
SET global innodb_print_all_deadlocks=-3;
SELECT @@global.innodb_print_all_deadlocks;
SELECT * FROM information_schema.global_variables
WHERE variable_name='innodb_print_all_deadlocks';
SELECT * FROM information_schema.session_variables
WHERE variable_name='innodb_print_all_deadlocks';
--error ER_WRONG_VALUE_FOR_VAR
SET global innodb_print_all_deadlocks='AUTO';
#
# Cleanup
#
SET @@global.innodb_print_all_deadlocks = @start_global_value;
SELECT @@global.innodb_print_all_deadlocks;

View File

@@ -0,0 +1,26 @@
#
# 2011-11-17 - Added
#
--source include/have_innodb.inc
#
# show the global and session values;
#
select @@global.innodb_sort_buffer_size;
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
select @@session.innodb_sort_buffer_size;
show global variables like 'innodb_sort_buffer_size';
show session variables like 'innodb_sort_buffer_size';
select * from information_schema.global_variables where variable_name='innodb_sort_buffer_size';
select * from information_schema.session_variables where variable_name='innodb_sort_buffer_size';
#
# show that it's read-only
#
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
set global innodb_sort_buffer_size=1;
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
set session innodb_sort_buffer_size=1;

View File

@@ -0,0 +1,57 @@
#
# 2010-01-25 - Added
#
--source include/have_innodb.inc
SET @start_global_value = @@global.innodb_stats_persistent_sample_pages;
SELECT @start_global_value;
#
# exists as global only
#
--echo Valid values are zero or above
SELECT @@global.innodb_stats_persistent_sample_pages >=0;
SELECT @@global.innodb_stats_persistent_sample_pages;
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
SELECT @@session.innodb_stats_persistent_sample_pages;
SHOW global variables LIKE 'innodb_stats_persistent_sample_pages';
SHOW session variables LIKE 'innodb_stats_persistent_sample_pages';
SELECT * FROM information_schema.global_variables
WHERE variable_name='innodb_stats_persistent_sample_pages';
SELECT * FROM information_schema.session_variables
WHERE variable_name='innodb_stats_persistent_sample_pages';
#
# SHOW that it's writable
#
SET global innodb_stats_persistent_sample_pages=10;
SELECT @@global.innodb_stats_persistent_sample_pages;
SELECT * FROM information_schema.global_variables
WHERE variable_name='innodb_stats_persistent_sample_pages';
SELECT * FROM information_schema.session_variables
WHERE variable_name='innodb_stats_persistent_sample_pages';
--error ER_GLOBAL_VARIABLE
SET session innodb_stats_persistent_sample_pages=1;
#
# incorrect types
#
--error ER_WRONG_TYPE_FOR_VAR
SET global innodb_stats_persistent_sample_pages=1.1;
--error ER_WRONG_TYPE_FOR_VAR
SET global innodb_stats_persistent_sample_pages=1e1;
--error ER_WRONG_TYPE_FOR_VAR
SET global innodb_stats_persistent_sample_pages="foo";
SET global innodb_stats_persistent_sample_pages=-7;
SELECT @@global.innodb_stats_persistent_sample_pages;
SELECT * FROM information_schema.global_variables
WHERE variable_name='innodb_stats_persistent_sample_pages';
#
# cleanup
#
SET @@global.innodb_stats_persistent_sample_pages = @start_global_value;
SELECT @@global.innodb_stats_persistent_sample_pages;

View File

@@ -0,0 +1,57 @@
#
# 2010-01-25 - Added
#
--source include/have_innodb.inc
SET @start_global_value = @@global.innodb_stats_transient_sample_pages;
SELECT @start_global_value;
#
# exists as global only
#
--echo Valid values are zero or above
SELECT @@global.innodb_stats_transient_sample_pages >=0;
SELECT @@global.innodb_stats_transient_sample_pages;
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
SELECT @@session.innodb_stats_transient_sample_pages;
SHOW global variables LIKE 'innodb_stats_transient_sample_pages';
SHOW session variables LIKE 'innodb_stats_transient_sample_pages';
SELECT * FROM information_schema.global_variables
WHERE variable_name='innodb_stats_transient_sample_pages';
SELECT * FROM information_schema.session_variables
WHERE variable_name='innodb_stats_transient_sample_pages';
#
# SHOW that it's writable
#
SET global innodb_stats_transient_sample_pages=10;
SELECT @@global.innodb_stats_transient_sample_pages;
SELECT * FROM information_schema.global_variables
WHERE variable_name='innodb_stats_transient_sample_pages';
SELECT * FROM information_schema.session_variables
WHERE variable_name='innodb_stats_transient_sample_pages';
--error ER_GLOBAL_VARIABLE
SET session innodb_stats_transient_sample_pages=1;
#
# incorrect types
#
--error ER_WRONG_TYPE_FOR_VAR
SET global innodb_stats_transient_sample_pages=1.1;
--error ER_WRONG_TYPE_FOR_VAR
SET global innodb_stats_transient_sample_pages=1e1;
--error ER_WRONG_TYPE_FOR_VAR
SET global innodb_stats_transient_sample_pages="foo";
SET global innodb_stats_transient_sample_pages=-7;
SELECT @@global.innodb_stats_transient_sample_pages;
SELECT * FROM information_schema.global_variables
WHERE variable_name='innodb_stats_transient_sample_pages';
#
# cleanup
#
SET @@global.innodb_stats_transient_sample_pages = @start_global_value;
SELECT @@global.innodb_stats_transient_sample_pages;

View File

@@ -0,0 +1,66 @@
# 2010-01-27 - Added
#
--source include/have_innodb.inc
SET @start_global_value = @@global.innodb_sync_array_size;
SELECT @start_global_value;
#
# exists as global only
#
--echo Valid values are between 0 and 1024
SELECT @@global.innodb_sync_array_size between 0 and 1024;
SELECT @@global.innodb_sync_array_size;
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
SELECT @@session.innodb_sync_array_size;
SHOW global variables LIKE 'innodb_sync_array_size';
SHOW session variables LIKE 'innodb_sync_array_size';
SELECT * FROM information_schema.global_variables
where variable_name='innodb_sync_array_size';
SELECT * FROM information_schema.session_variables
where variable_name='innodb_sync_array_size';
#
# SHOW that it's writable
#
SET global innodb_sync_array_size=10;
SELECT @@global.innodb_sync_array_size;
SELECT * FROM information_schema.global_variables
where variable_name='innodb_sync_array_size';
SELECT * FROM information_schema.session_variables
where variable_name='innodb_sync_array_size';
--error ER_GLOBAL_VARIABLE
SET session innodb_sync_array_size=1;
#
# incorrect types
#
--error ER_WRONG_TYPE_FOR_VAR
SET global innodb_sync_array_size=1.1;
--error ER_WRONG_TYPE_FOR_VAR
SET global innodb_sync_array_size=1e1;
--error ER_WRONG_TYPE_FOR_VAR
SET global innodb_sync_array_size="foo";
SET global innodb_sync_array_size=-7;
SELECT @@global.innodb_sync_array_size;
SELECT * FROM information_schema.global_variables
where variable_name='innodb_sync_array_size';
SET global innodb_sync_array_size=96;
SELECT @@global.innodb_sync_array_size;
SELECT * FROM information_schema.global_variables
where variable_name='innodb_sync_array_size';
#
# min/max values
#
SET global innodb_sync_array_size=0;
SELECT @@global.innodb_sync_array_size;
SET global innodb_sync_array_size=64;
SELECT @@global.innodb_sync_array_size;
SET @@global.innodb_sync_array_size = @start_global_value;
SELECT @@global.innodb_sync_array_size;

View File

@@ -0,0 +1,85 @@
################## mysql-test/t/innodb_undo_directory_basic.test ##############
# #
# Variable Name: innodb_undo_directory #
# Scope: Global #
# Access Type: Static #
# Data Type: string #
# #
# #
# Creation Date: 2011-07-05 #
# Author : Sunny Bains #
# #
# #
# Description: Read-only config global variable innodb_undo_directory #
# * Value check #
# * Scope check #
# #
###############################################################################
--source include/have_innodb.inc
####################################################################
# Display the default value #
####################################################################
SELECT @@GLOBAL.innodb_undo_directory;
--echo . Expected
####################################################################
# Check if Value can set #
####################################################################
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
SET @@GLOBAL.innodb_undo_directory="/tmp";
--echo Expected error 'Read only variable'
SELECT COUNT(@@GLOBAL.innodb_undo_directory);
--echo 1 Expected
################################################################################
# Check if the value in GLOBAL table matches value in variable #
################################################################################
SELECT VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='innodb_undo_directory';
--echo . Expected
SELECT COUNT(@@GLOBAL.innodb_undo_directory);
--echo 1 Expected
SELECT COUNT(VARIABLE_VALUE)
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='innodb_undo_directory';
--echo 1 Expected
################################################################################
# Check if accessing variable with and without GLOBAL point to same variable #
################################################################################
SELECT @@innodb_undo_directory = @@GLOBAL.innodb_undo_directory;
--echo 1 Expected
################################################################################
# Check if innodb_undo_directory can be accessed with and without @@ sign #
################################################################################
SELECT COUNT(@@innodb_undo_directory);
--echo 1 Expected
--Error ER_INCORRECT_GLOBAL_LOCAL_VAR
SELECT COUNT(@@local.innodb_undo_directory);
--echo Expected error 'Variable is a GLOBAL variable'
--Error ER_INCORRECT_GLOBAL_LOCAL_VAR
SELECT COUNT(@@SESSION.innodb_undo_directory);
--echo Expected error 'Variable is a GLOBAL variable'
SELECT COUNT(@@GLOBAL.innodb_undo_directory);
--echo 1 Expected
--Error ER_BAD_FIELD_ERROR
SELECT innodb_undo_directory = @@SESSION.innodb_undo_directory;
--echo Expected error 'Readonly variable'

View File

@@ -0,0 +1,95 @@
################## mysql-test/t/innodb_undo_logs_basic.test ############
# #
# Variable Name: innodb_undo_logs #
# Scope: Global #
# Access Type: Static #
# Data Type: numeric #
# #
# #
# Creation Date: 2011-07-05 #
# Author : Sunny Bains #
# #
# #
# Description: Read-only config global variable innodb_undo_logs #
# * Value check #
# * Scope check #
# #
###############################################################################
--source include/have_innodb.inc
####################################################################
# Display default value #
####################################################################
SELECT @@GLOBAL.innodb_undo_logs;
--echo 128 Expected
####################################################################
# Check if value can be set #
####################################################################
SET @@GLOBAL.innodb_undo_logs=128;
SELECT COUNT(@@GLOBAL.innodb_undo_logs);
--echo 1 Expected
################################################################################
# Check if the value in GLOBAL table matches value in variable #
################################################################################
SELECT VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='innodb_undo_logs';
--echo 128 Expected
################################################################################
# Check if accessing variable with and without GLOBAL point to same variable #
################################################################################
SELECT @@innodb_undo_logs = @@GLOBAL.innodb_undo_logs;
--echo 1 Expected
################################################################################
# Check if innodb_undo_logs can be accessed with and without @@ sign #
################################################################################
SELECT COUNT(@@innodb_undo_logs);
--echo 1 Expected
--Error ER_INCORRECT_GLOBAL_LOCAL_VAR
SELECT COUNT(@@local.innodb_undo_logs);
--echo Expected error 'Variable is a GLOBAL variable'
--Error ER_INCORRECT_GLOBAL_LOCAL_VAR
SELECT COUNT(@@SESSION.innodb_undo_logs);
--echo Expected error 'Variable is a GLOBAL variable'
--Error ER_BAD_FIELD_ERROR
SELECT innodb_undo_logs = @@SESSION.innodb_undo_logs;
# Begin Bug 13604034
# SET GLOBAL INNODB_UNDO_LOGS=0 SUCCEEDS BUT LEADS TO AN ASSERT
# MAX_UNDO_LOGS > 0
--echo Begin bug 13604034
select @@innodb_undo_logs;
--echo 128 Expected
set global innodb_undo_logs = 129;
select @@innodb_undo_logs;
--echo 128 Expected
set global innodb_undo_logs = 0;
select @@innodb_undo_logs;
--echo 1 Expected
set global innodb_undo_logs = -1;
select @@innodb_undo_logs;
--echo 1 Expected
set global innodb_undo_logs = 50;
select @@innodb_undo_logs;
--echo 50 Expected
set global innodb_undo_logs = default;
select @@innodb_undo_logs;
--echo 128 Expected
--echo End bug 13604034
# End Bug 13604034

View File

@@ -0,0 +1,77 @@
################## mysql-test/t/innodb_undo_tablespaces_basic.test ############
# #
# Variable Name: innodb_undo_tablespaces #
# Scope: Global #
# Access Type: Static #
# Data Type: string #
# #
# #
# Creation Date: 2011-07-05 #
# Author : Sunny Bains #
# #
# #
# Description: Read-only config global variable innodb_undo_tablespaces #
# * Value check #
# * Scope check #
# #
###############################################################################
--source include/have_innodb.inc
####################################################################
# Display default value #
####################################################################
SELECT @@GLOBAL.innodb_undo_tablespaces;
--echo 0 Expected
####################################################################
# Check if value can be set #
####################################################################
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
SET @@GLOBAL.innodb_undo_tablespaces=128;
--echo Expected error 'Read only variable'
SELECT COUNT(@@GLOBAL.innodb_undo_tablespaces);
--echo 1 Expected
################################################################################
# Check if the value in GLOBAL table matches value in variable #
################################################################################
SELECT VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='innodb_undo_tablespaces';
--echo 0 Expected
################################################################################
# Check if accessing variable with and without GLOBAL point to same variable #
################################################################################
SELECT @@innodb_undo_tablespaces = @@GLOBAL.innodb_undo_tablespaces;
--echo 1 Expected
################################################################################
# Check if innodb_undo_tablespaces can be accessed with and without @@ sign #
################################################################################
SELECT COUNT(@@innodb_undo_tablespaces);
--echo 1 Expected
--Error ER_INCORRECT_GLOBAL_LOCAL_VAR
SELECT COUNT(@@local.innodb_undo_tablespaces);
--echo Expected error 'Variable is a GLOBAL variable'
--Error ER_INCORRECT_GLOBAL_LOCAL_VAR
SELECT COUNT(@@SESSION.innodb_undo_tablespaces);
--echo Expected error 'Variable is a GLOBAL variable'
SELECT COUNT(@@GLOBAL.innodb_undo_tablespaces);
--echo 1 Expected
--Error ER_BAD_FIELD_ERROR
SELECT innodb_undo_tablespaces = @@SESSION.innodb_undo_tablespaces;
--echo Expected error 'Readonly variable'

View File

@@ -0,0 +1,2 @@
--loose-enable-performance-schema
--loose-performance-schema-accounts-size=123

View File

@@ -0,0 +1,32 @@
--source include/not_embedded.inc
--source include/have_perfschema.inc
#
# Only global
#
select @@global.performance_schema_accounts_size;
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
select @@session.performance_schema_accounts_size;
show global variables like 'performance_schema_accounts_size';
show session variables like 'performance_schema_accounts_size';
select * from information_schema.global_variables
where variable_name='performance_schema_accounts_size';
select * from information_schema.session_variables
where variable_name='performance_schema_accounts_size';
#
# Read-only
#
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
set global performance_schema_accounts_size=1;
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
set session performance_schema_accounts_size=1;

View File

@@ -0,0 +1,2 @@
--loose-enable-performance-schema
--loose-performance-schema-digests-size=200

View File

@@ -0,0 +1,47 @@
# Copyright (C) 2010 Sun Microsystems, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
--source include/not_embedded.inc
--source include/have_perfschema.inc
#
# Only global
#
select @@global.performance_schema_digests_size;
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
select @@session.performance_schema_digests_size;
show global variables like 'performance_schema_digests_size';
show session variables like 'performance_schema_digests_size';
select * from information_schema.global_variables
where variable_name='performance_schema_digests_size';
select * from information_schema.session_variables
where variable_name='performance_schema_digests_size';
#
# Read-only
#
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
set global performance_schema_digests_size=1;
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
set session performance_schema_digests_size=1;

View File

@@ -0,0 +1,2 @@
--loose-enable-performance-schema
--loose-performance-schema-events-stages-history-long-size=15000

View File

@@ -0,0 +1,32 @@
--source include/not_embedded.inc
--source include/have_perfschema.inc
#
# Only global
#
select @@global.performance_schema_events_stages_history_long_size;
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
select @@session.performance_schema_events_stages_history_long_size;
show global variables like 'performance_schema_events_stages_history_long_size';
show session variables like 'performance_schema_events_stages_history_long_size';
select * from information_schema.global_variables
where variable_name='performance_schema_events_stages_history_long_size';
select * from information_schema.session_variables
where variable_name='performance_schema_events_stages_history_long_size';
#
# Read-only
#
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
set global performance_schema_events_stages_history_long_size=1;
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
set session performance_schema_events_stages_history_long_size=1;

View File

@@ -0,0 +1,2 @@
--loose-enable-performance-schema
--loose-performance-schema-events-stages-history-size=15

View File

@@ -0,0 +1,32 @@
--source include/not_embedded.inc
--source include/have_perfschema.inc
#
# Only global
#
select @@global.performance_schema_events_stages_history_size;
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
select @@session.performance_schema_events_stages_history_size;
show global variables like 'performance_schema_events_stages_history_size';
show session variables like 'performance_schema_events_stages_history_size';
select * from information_schema.global_variables
where variable_name='performance_schema_events_stages_history_size';
select * from information_schema.session_variables
where variable_name='performance_schema_events_stages_history_size';
#
# Read-only
#
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
set global performance_schema_events_stages_history_size=1;
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
set session performance_schema_events_stages_history_size=1;

View File

@@ -0,0 +1,2 @@
--loose-enable-performance-schema
--loose-performance-schema-events-statements-history-long-size=15000

View File

@@ -0,0 +1,32 @@
--source include/not_embedded.inc
--source include/have_perfschema.inc
#
# Only global
#
select @@global.performance_schema_events_statements_history_long_size;
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
select @@session.performance_schema_events_statements_history_long_size;
show global variables like 'performance_schema_events_statements_history_long_size';
show session variables like 'performance_schema_events_statements_history_long_size';
select * from information_schema.global_variables
where variable_name='performance_schema_events_statements_history_long_size';
select * from information_schema.session_variables
where variable_name='performance_schema_events_statements_history_long_size';
#
# Read-only
#
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
set global performance_schema_events_statements_history_long_size=1;
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
set session performance_schema_events_statements_history_long_size=1;

View File

@@ -0,0 +1,2 @@
--loose-enable-performance-schema
--loose-performance-schema-events-statements-history-size=15

View File

@@ -0,0 +1,32 @@
--source include/not_embedded.inc
--source include/have_perfschema.inc
#
# Only global
#
select @@global.performance_schema_events_statements_history_size;
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
select @@session.performance_schema_events_statements_history_size;
show global variables like 'performance_schema_events_statements_history_size';
show session variables like 'performance_schema_events_statements_history_size';
select * from information_schema.global_variables
where variable_name='performance_schema_events_statements_history_size';
select * from information_schema.session_variables
where variable_name='performance_schema_events_statements_history_size';
#
# Read-only
#
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
set global performance_schema_events_statements_history_size=1;
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
set session performance_schema_events_statements_history_size=1;

View File

@@ -0,0 +1,2 @@
--loose-enable-performance-schema
--loose-performance-schema-hosts-size=123

View File

@@ -0,0 +1,32 @@
--source include/not_embedded.inc
--source include/have_perfschema.inc
#
# Only global
#
select @@global.performance_schema_hosts_size;
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
select @@session.performance_schema_hosts_size;
show global variables like 'performance_schema_hosts_size';
show session variables like 'performance_schema_hosts_size';
select * from information_schema.global_variables
where variable_name='performance_schema_hosts_size';
select * from information_schema.session_variables
where variable_name='performance_schema_hosts_size';
#
# Read-only
#
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
set global performance_schema_hosts_size=1;
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
set session performance_schema_hosts_size=1;

View File

@@ -0,0 +1 @@
--loose-enable-performance-schema --loose-performance-schema-max-socket-classes=123

View File

@@ -0,0 +1,32 @@
--source include/not_embedded.inc
--source include/have_perfschema.inc
#
# Only global
#
select @@global.performance_schema_max_socket_classes;
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
select @@session.performance_schema_max_socket_classes;
show global variables like 'performance_schema_max_socket_classes';
show session variables like 'performance_schema_max_socket_classes';
select * from information_schema.global_variables
where variable_name='performance_schema_max_socket_classes';
select * from information_schema.session_variables
where variable_name='performance_schema_max_socket_classes';
#
# Read-only
#
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
set global performance_schema_max_socket_classes=1;
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
set session performance_schema_max_socket_classes=1;

View File

@@ -0,0 +1 @@
--loose-enable-performance-schema --loose-performance-schema-max-socket-instances=123

View File

@@ -0,0 +1,32 @@
--source include/not_embedded.inc
--source include/have_perfschema.inc
#
# Only global
#
select @@global.performance_schema_max_socket_instances;
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
select @@session.performance_schema_max_socket_instances;
show global variables like 'performance_schema_max_socket_instances';
show session variables like 'performance_schema_max_socket_instances';
select * from information_schema.global_variables
where variable_name='performance_schema_max_socket_instances';
select * from information_schema.session_variables
where variable_name='performance_schema_max_socket_instances';
#
# Read-only
#
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
set global performance_schema_max_socket_instances=1;
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
set session performance_schema_max_socket_instances=1;

View File

@@ -0,0 +1,2 @@
--loose-enable-performance-schema
--loose-performance-schema-max-stage_classes=123

View File

@@ -0,0 +1,32 @@
--source include/not_embedded.inc
--source include/have_perfschema.inc
#
# Only global
#
select @@global.performance_schema_max_stage_classes;
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
select @@session.performance_schema_max_stage_classes;
show global variables like 'performance_schema_max_stage_classes';
show session variables like 'performance_schema_max_stage_classes';
select * from information_schema.global_variables
where variable_name='performance_schema_max_stage_classes';
select * from information_schema.session_variables
where variable_name='performance_schema_max_stage_classes';
#
# Read-only
#
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
set global performance_schema_max_stage_classes=1;
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
set session performance_schema_max_stage_classes=1;

View File

@@ -0,0 +1,2 @@
--loose-enable-performance-schema
--loose-performance-schema-max-statement_classes=123

View File

@@ -0,0 +1,32 @@
--source include/not_embedded.inc
--source include/have_perfschema.inc
#
# Only global
#
select @@global.performance_schema_max_statement_classes;
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
select @@session.performance_schema_max_statement_classes;
show global variables like 'performance_schema_max_statement_classes';
show session variables like 'performance_schema_max_statement_classes';
select * from information_schema.global_variables
where variable_name='performance_schema_max_statement_classes';
select * from information_schema.session_variables
where variable_name='performance_schema_max_statement_classes';
#
# Read-only
#
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
set global performance_schema_max_statement_classes=1;
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
set session performance_schema_max_statement_classes=1;

View File

@@ -0,0 +1,2 @@
--loose-enable-performance-schema
--loose-performance-schema-setup-actors-size=123

View File

@@ -0,0 +1,32 @@
--source include/not_embedded.inc
--source include/have_perfschema.inc
#
# Only global
#
select @@global.performance_schema_setup_actors_size;
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
select @@session.performance_schema_setup_actors_size;
show global variables like 'performance_schema_setup_actors_size';
show session variables like 'performance_schema_setup_actors_size';
select * from information_schema.global_variables
where variable_name='performance_schema_setup_actors_size';
select * from information_schema.session_variables
where variable_name='performance_schema_setup_actors_size';
#
# Read-only
#
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
set global performance_schema_setup_actors_size=1;
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
set session performance_schema_setup_actors_size=1;

View File

@@ -0,0 +1,2 @@
--loose-enable-performance-schema
--loose-performance-schema-setup-objects-size=123

View File

@@ -0,0 +1,32 @@
--source include/not_embedded.inc
--source include/have_perfschema.inc
#
# Only global
#
select @@global.performance_schema_setup_objects_size;
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
select @@session.performance_schema_setup_objects_size;
show global variables like 'performance_schema_setup_objects_size';
show session variables like 'performance_schema_setup_objects_size';
select * from information_schema.global_variables
where variable_name='performance_schema_setup_objects_size';
select * from information_schema.session_variables
where variable_name='performance_schema_setup_objects_size';
#
# Read-only
#
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
set global performance_schema_setup_objects_size=1;
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
set session performance_schema_setup_objects_size=1;

View File

@@ -0,0 +1,2 @@
--loose-enable-performance-schema
--loose-performance-schema-users-size=123

View File

@@ -0,0 +1,32 @@
--source include/not_embedded.inc
--source include/have_perfschema.inc
#
# Only global
#
select @@global.performance_schema_users_size;
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
select @@session.performance_schema_users_size;
show global variables like 'performance_schema_users_size';
show session variables like 'performance_schema_users_size';
select * from information_schema.global_variables
where variable_name='performance_schema_users_size';
select * from information_schema.session_variables
where variable_name='performance_schema_users_size';
#
# Read-only
#
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
set global performance_schema_users_size=1;
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
set session performance_schema_users_size=1;

View File

@@ -1,2 +1,3 @@
--log --log-bin=mylog.log
--general-log
--log-bin=mylog.log

View File

@@ -0,0 +1,3 @@
--echo # a simplified test to keep the suite happy.
--echo # the real test is in main.
select @@ssl_crl;

View File

@@ -0,0 +1,3 @@
--echo # a simplified test to keep the suite happy.
--echo # the real test is in main.
select @@ssl_crlpath;

View File

@@ -0,0 +1,199 @@
############## mysql-test\t\tx_read_only_basic.test ###########################
# #
# Variable Name: tx_read_only #
# Scope: GLOBAL & SESSION #
# Access Type: Dynamic #
# Data Type: boolean #
# Default Value: OFF #
# Range: #
# #
# #
# Creation Date: 2012-01-12 #
# Author: joh #
# #
# Description: Test Cases of Dynamic System Variable tx_read_only #
# that checks the behavior of this variable in the following ways#
# * Default Value #
# * Valid & Invalid values #
# * Scope & Access method #
# * Data Integrity #
# #
# Reference: http://dev.mysql.com/doc/refman/5.6/en/ #
# server-system-variables.html #
# #
###############################################################################
--source include/load_sysvars.inc
--echo ####################################################################
--echo # START OF tx_read_only TESTS #
--echo ####################################################################
--echo #############################################################
--echo # Save initial value #
--echo #############################################################
SET @start_global_value = @@global.tx_read_only;
SELECT @start_global_value;
SET @start_session_value = @@session.tx_read_only;
SELECT @start_session_value;
--echo ########################################################################
--echo # Display the DEFAULT value of tx_read_only #
--echo ########################################################################
SET @@global.tx_read_only = ON;
SET @@global.tx_read_only = DEFAULT;
SELECT @@global.tx_read_only;
SET @@session.tx_read_only = ON;
SET @@session.tx_read_only = DEFAULT;
SELECT @@session.tx_read_only;
--echo ##############################################################################
--echo # Change the value of tx_read_only to a valid value for GLOBAL Scope #
--echo ##############################################################################
SET @@global.tx_read_only = ON;
SELECT @@global.tx_read_only;
SET @@global.tx_read_only = OFF;
SELECT @@global.tx_read_only;
SET @@global.tx_read_only = 0;
SELECT @@global.tx_read_only;
SET @@global.tx_read_only = 1;
SELECT @@global.tx_read_only;
SET @@global.tx_read_only = TRUE;
SELECT @@global.tx_read_only;
SET @@global.tx_read_only = FALSE;
SELECT @@global.tx_read_only;
--echo ###############################################################################
--echo # Change the value of tx_read_only to a valid value for SESSION Scope #
--echo ###############################################################################
SET @@session.tx_read_only = ON;
SELECT @@session.tx_read_only;
SET @@session.tx_read_only = OFF;
SELECT @@session.tx_read_only;
SET @@session.tx_read_only = 0;
SELECT @@session.tx_read_only;
SET @@session.tx_read_only = 1;
SELECT @@session.tx_read_only;
SET @@session.tx_read_only = TRUE;
SELECT @@session.tx_read_only;
SET @@session.tx_read_only = FALSE;
SELECT @@session.tx_read_only;
--echo ################################################################
--echo # Change the value of tx_read_only to an invalid value #
--echo ################################################################
--Error ER_WRONG_VALUE_FOR_VAR
SET @@global.tx_read_only = 'ONN';
--Error ER_WRONG_VALUE_FOR_VAR
SET @@global.tx_read_only = "OFFF";
--Error ER_WRONG_VALUE_FOR_VAR
SET @@global.tx_read_only = TTRUE;
--Error ER_WRONG_VALUE_FOR_VAR
SET @@global.tx_read_only = FELSE;
--Error ER_WRONG_VALUE_FOR_VAR
SET @@global.tx_read_only = -1024;
--Error ER_WRONG_VALUE_FOR_VAR
SET @@global.tx_read_only = 65536;
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.tx_read_only = 65530.34;
--Error ER_WRONG_VALUE_FOR_VAR
SET @@global.tx_read_only = test;
--Error ER_WRONG_VALUE_FOR_VAR
SET @@session.tx_read_only = ONN;
--Error ER_WRONG_VALUE_FOR_VAR
SET @@session.tx_read_only = ONF;
--Error ER_WRONG_VALUE_FOR_VAR
SET @@session.tx_read_only = OF;
--Error ER_WRONG_VALUE_FOR_VAR
SET @@session.tx_read_only = 'OFN';
--Error ER_WRONG_VALUE_FOR_VAR
SET @@session.tx_read_only = -2;
--Error ER_WRONG_TYPE_FOR_VAR
SET @@session.tx_read_only = 65530.34;
--Error ER_WRONG_VALUE_FOR_VAR
SET @@session.tx_read_only = 65550;
--Error ER_WRONG_VALUE_FOR_VAR
SET @@session.tx_read_only = test;
SELECT @@session.tx_read_only;
--echo ####################################################################
--echo # Check if the value in GLOBAL Table matches value in variable #
--echo ####################################################################
SELECT IF(@@global.tx_read_only, "ON", "OFF") = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='tx_read_only';
--echo ####################################################################
--echo # Check if the value in SESSION Table matches value in variable #
--echo ####################################################################
SELECT IF(@@session.tx_read_only, "ON", "OFF") = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.SESSION_VARIABLES
WHERE VARIABLE_NAME='tx_read_only';
--echo ###############################################################################
--echo # Check if accessing variable with and without GLOBAL point to same variable #
--echo ###############################################################################
SET @@tx_read_only = OFF;
SET @@global.tx_read_only = ON;
SELECT @@tx_read_only = @@global.tx_read_only;
--echo ##############################################################################
--echo # Check if accessing variable with SESSION,LOCAL and without SCOPE points #
--echo # to same session variable #
--echo ##############################################################################
SET @@tx_read_only = ON;
SELECT @@tx_read_only = @@local.tx_read_only;
SELECT @@local.tx_read_only = @@session.tx_read_only;
--echo ###############################################################################
--echo # Check if tx_read_only can be accessed with and without @@ sign #
--echo ###############################################################################
--echo # @@session is synonym for SESSION
SET @@session.tx_read_only= 0;
--echo # Without modifier, SET changes session variable
SET tx_read_only = 1;
SELECT @@tx_read_only;
--echo # name1.name2 refers to database_name.table_name
--Error ER_UNKNOWN_TABLE
SELECT session.tx_read_only;
--echo ####################################
--echo # Restore initial value #
--echo ####################################
SET @@global.tx_read_only = @start_global_value;
SELECT @@global.tx_read_only;
SET @@session.tx_read_only = @start_session_value;
SELECT @@session.tx_read_only;
--echo #########################################################
--echo # END OF tx_read_only TESTS #
--echo #########################################################