Commit e5d71e0b authored by Marko Mäkelä's avatar Marko Mäkelä

MDEV-19551 Remove alias innodb_stats_sample_pages

The parameter innodb_stats_sample_pages became an alias for
innodb_stats_transient_sample_pages and was deprecated in
MariaDB Server 10.0. Let us finally remove that alias.
parent 1a6f4704
...@@ -2,9 +2,8 @@ ...@@ -2,9 +2,8 @@
[mysqld] [mysqld]
secure-file-priv = "" secure-file-priv = ""
innodb_file_format ='Barracuda'
innodb_file_per_table = ON innodb_file_per_table = ON
innodb_stats_persistent=ON innodb_stats_persistent=ON
innodb_stats_auto_recalc=ON innodb_stats_auto_recalc=ON
innodb_stats_persistent_sample_pages=20 innodb_stats_persistent_sample_pages=20
innodb_stats_sample_pages=8 innodb_stats_transient_sample_pages=8
Warnings:
Warning 1292 Truncated incorrect innodb_stats_transient_sample_pa value: '0'
Variable_name Value Variable_name Value
innodb_stats_sample_pages 1 innodb_stats_transient_sample_pages 1
Warnings:
Warning 1292 Truncated incorrect innodb_stats_transient_sample_pa value: '0'
Variable_name Value Variable_name Value
innodb_stats_sample_pages 1 innodb_stats_transient_sample_pages 1
Variable_name Value Variable_name Value
innodb_stats_traditional OFF innodb_stats_traditional OFF
--source include/have_innodb.inc --source include/have_innodb.inc
# #
# Test that mysqld does not crash when running ANALYZE TABLE with # Test that mysqld does not crash when running ANALYZE TABLE with
# different values of the parameter innodb_stats_sample_pages. # different values of the parameter innodb_stats_transient_sample_pages.
# #
# we care only that the following SQL commands do not produce errors # we care only that the following SQL commands do not produce errors
# and do not crash the server # and do not crash the server
-- disable_query_log -- disable_query_log
-- disable_result_log
-- enable_warnings -- enable_warnings
let $sample_pages=`select @@innodb_stats_sample_pages`; SET @save_sample_pages = @@GLOBAL.innodb_stats_transient_sample_pages;
SET GLOBAL innodb_stats_sample_pages=0; SET GLOBAL innodb_stats_transient_sample_pages=0;
SHOW VARIABLES LIKE 'innodb_stats_transient_sample_pages';
# check that the value has been adjusted to 1
-- enable_result_log
SHOW VARIABLES LIKE 'innodb_stats_sample_pages';
-- disable_result_log -- disable_result_log
CREATE TABLE innodb_analyze ( CREATE TABLE innodb_analyze (
...@@ -29,36 +25,36 @@ CREATE TABLE innodb_analyze ( ...@@ -29,36 +25,36 @@ CREATE TABLE innodb_analyze (
ANALYZE TABLE innodb_analyze; ANALYZE TABLE innodb_analyze;
SET GLOBAL innodb_stats_sample_pages=2; SET GLOBAL innodb_stats_transient_sample_pages=2;
ANALYZE TABLE innodb_analyze; ANALYZE TABLE innodb_analyze;
SET GLOBAL innodb_stats_sample_pages=4; SET GLOBAL innodb_stats_transient_sample_pages=4;
ANALYZE TABLE innodb_analyze; ANALYZE TABLE innodb_analyze;
SET GLOBAL innodb_stats_sample_pages=8; SET GLOBAL innodb_stats_transient_sample_pages=8;
ANALYZE TABLE innodb_analyze; ANALYZE TABLE innodb_analyze;
SET GLOBAL innodb_stats_sample_pages=16; SET GLOBAL innodb_stats_transient_sample_pages=16;
ANALYZE TABLE innodb_analyze; ANALYZE TABLE innodb_analyze;
INSERT INTO innodb_analyze VALUES INSERT INTO innodb_analyze VALUES
(1,1), (1,1), (1,2), (1,3), (1,4), (1,5), (1,1), (1,1), (1,2), (1,3), (1,4), (1,5),
(8,1), (8,8), (8,2), (7,1), (1,4), (3,5); (8,1), (8,8), (8,2), (7,1), (1,4), (3,5);
SET GLOBAL innodb_stats_sample_pages=1; SET GLOBAL innodb_stats_transient_sample_pages=1;
ANALYZE TABLE innodb_analyze; ANALYZE TABLE innodb_analyze;
SET GLOBAL innodb_stats_sample_pages=2; SET GLOBAL innodb_stats_transient_sample_pages=2;
ANALYZE TABLE innodb_analyze; ANALYZE TABLE innodb_analyze;
SET GLOBAL innodb_stats_sample_pages=4; SET GLOBAL innodb_stats_transient_sample_pages=4;
ANALYZE TABLE innodb_analyze; ANALYZE TABLE innodb_analyze;
SET GLOBAL innodb_stats_sample_pages=8; SET GLOBAL innodb_stats_transient_sample_pages=8;
ANALYZE TABLE innodb_analyze; ANALYZE TABLE innodb_analyze;
SET GLOBAL innodb_stats_sample_pages=16; SET GLOBAL innodb_stats_transient_sample_pages=16;
ANALYZE TABLE innodb_analyze; ANALYZE TABLE innodb_analyze;
DROP TABLE innodb_analyze; DROP TABLE innodb_analyze;
EVAL SET GLOBAL innodb_stats_sample_pages=$sample_pages; SET GLOBAL innodb_stats_transient_sample_pages = @save_sample_pages;
--source include/have_innodb.inc --source include/have_innodb.inc
# #
# Test that mysqld does not crash when running ANALYZE TABLE with # Test that mysqld does not crash when running ANALYZE TABLE with
# different values of the parameter innodb_stats_sample_pages. # different values of the parameter innodb_stats_transient_sample_pages.
# #
# we care only that the following SQL commands do not produce errors # we care only that the following SQL commands do not produce errors
# and do not crash the server # and do not crash the server
-- disable_query_log -- disable_query_log
-- disable_result_log
-- enable_warnings -- enable_warnings
let $sample_pages=`select @@innodb_stats_sample_pages`; SET @save_sample_pages = @@GLOBAL.innodb_stats_transient_sample_pages;
let $traditional=`select @@innodb_stats_traditional`; SET @save_traditional = @@GLOBAL.innodb_stats_traditional;
SET GLOBAL innodb_stats_sample_pages=0; SET GLOBAL innodb_stats_transient_sample_pages=0;
#use new method to calculate statistics #use new method to calculate statistics
SET GLOBAL innodb_stats_traditional=0; SET GLOBAL innodb_stats_traditional=0;
SHOW VARIABLES LIKE 'innodb_stats_transient_sample_pages';
# check that the value has been adjusted to 1
-- enable_result_log
SHOW VARIABLES LIKE 'innodb_stats_sample_pages';
SHOW VARIABLES LIKE 'innodb_stats_traditional'; SHOW VARIABLES LIKE 'innodb_stats_traditional';
-- disable_result_log -- disable_result_log
...@@ -33,13 +29,13 @@ CREATE TABLE innodb_analyze ( ...@@ -33,13 +29,13 @@ CREATE TABLE innodb_analyze (
# test with empty table # test with empty table
ANALYZE TABLE innodb_analyze; ANALYZE TABLE innodb_analyze;
SET GLOBAL innodb_stats_sample_pages=2; SET GLOBAL innodb_stats_transient_sample_pages=2;
ANALYZE TABLE innodb_analyze; ANALYZE TABLE innodb_analyze;
SET GLOBAL innodb_stats_sample_pages=1; SET GLOBAL innodb_stats_transient_sample_pages=1;
ANALYZE TABLE innodb_analyze; ANALYZE TABLE innodb_analyze;
SET GLOBAL innodb_stats_sample_pages=8000; SET GLOBAL innodb_stats_transient_sample_pages=8000;
ANALYZE TABLE innodb_analyze; ANALYZE TABLE innodb_analyze;
delimiter //; delimiter //;
...@@ -60,19 +56,19 @@ call innodb_insert_proc(7000); ...@@ -60,19 +56,19 @@ call innodb_insert_proc(7000);
commit; commit;
set autocommit=1; set autocommit=1;
SET GLOBAL innodb_stats_sample_pages=1; SET GLOBAL innodb_stats_transient_sample_pages=1;
ANALYZE TABLE innodb_analyze; ANALYZE TABLE innodb_analyze;
SET GLOBAL innodb_stats_sample_pages=8; SET GLOBAL innodb_stats_transient_sample_pages=8;
ANALYZE TABLE innodb_analyze; ANALYZE TABLE innodb_analyze;
SET GLOBAL innodb_stats_sample_pages=16; SET GLOBAL innodb_stats_transient_sample_pages=16;
ANALYZE TABLE innodb_analyze; ANALYZE TABLE innodb_analyze;
SET GLOBAL innodb_stats_sample_pages=8000; SET GLOBAL innodb_stats_transient_sample_pages=8000;
ANALYZE TABLE innodb_analyze; ANALYZE TABLE innodb_analyze;
DROP PROCEDURE innodb_insert_proc; DROP PROCEDURE innodb_insert_proc;
DROP TABLE innodb_analyze; DROP TABLE innodb_analyze;
EVAL SET GLOBAL innodb_stats_sample_pages=$sample_pages; SET GLOBAL innodb_stats_transient_sample_pages = @save_sample_pages;
EVAL SET GLOBAL innodb_stats_traditional=$traditional; SET GLOBAL innodb_stats_traditional = @save_traditional;
\ No newline at end of file
SET @start_global_value = @@global.innodb_stats_sample_pages;
SELECT @start_global_value;
@start_global_value
8
Valid values are one or above
select @@global.innodb_stats_sample_pages >=1;
@@global.innodb_stats_sample_pages >=1
1
select @@global.innodb_stats_sample_pages;
@@global.innodb_stats_sample_pages
8
select @@session.innodb_stats_sample_pages;
ERROR HY000: Variable 'innodb_stats_sample_pages' is a GLOBAL variable
show global variables like 'innodb_stats_sample_pages';
Variable_name Value
innodb_stats_sample_pages 8
show session variables like 'innodb_stats_sample_pages';
Variable_name Value
innodb_stats_sample_pages 8
select * from information_schema.global_variables where variable_name='innodb_stats_sample_pages';
VARIABLE_NAME VARIABLE_VALUE
INNODB_STATS_SAMPLE_PAGES 8
select * from information_schema.session_variables where variable_name='innodb_stats_sample_pages';
VARIABLE_NAME VARIABLE_VALUE
INNODB_STATS_SAMPLE_PAGES 8
set global innodb_stats_sample_pages=10;
Warnings:
Warning 131 Using innodb_stats_sample_pages is deprecated and the variable may be removed in future releases. Please use innodb_stats_transient_sample_pages instead.
select @@global.innodb_stats_sample_pages;
@@global.innodb_stats_sample_pages
10
select * from information_schema.global_variables where variable_name='innodb_stats_sample_pages';
VARIABLE_NAME VARIABLE_VALUE
INNODB_STATS_SAMPLE_PAGES 10
select * from information_schema.session_variables where variable_name='innodb_stats_sample_pages';
VARIABLE_NAME VARIABLE_VALUE
INNODB_STATS_SAMPLE_PAGES 10
set session innodb_stats_sample_pages=1;
ERROR HY000: Variable 'innodb_stats_sample_pages' is a GLOBAL variable and should be set with SET GLOBAL
set global innodb_stats_sample_pages=DEFAULT;
Warnings:
Warning 131 Using innodb_stats_sample_pages is deprecated and the variable may be removed in future releases. Please use innodb_stats_transient_sample_pages instead.
select @@global.innodb_stats_sample_pages;
@@global.innodb_stats_sample_pages
8
set global innodb_stats_sample_pages = 1.1;
ERROR 42000: Incorrect argument type to variable 'innodb_stats_sample_pages'
set global innodb_stats_sample_pages = 1e1;
ERROR 42000: Incorrect argument type to variable 'innodb_stats_sample_pages'
set global innodb_stats_sample_pages = "foo";
ERROR 42000: Incorrect argument type to variable 'innodb_stats_sample_pages'
set global innodb_stats_sample_pages=' ';
ERROR 42000: Incorrect argument type to variable 'innodb_stats_sample_pages'
select @@global.innodb_stats_sample_pages;
@@global.innodb_stats_sample_pages
8
set global innodb_stats_sample_pages=" ";
ERROR 42000: Incorrect argument type to variable 'innodb_stats_sample_pages'
select @@global.innodb_stats_sample_pages;
@@global.innodb_stats_sample_pages
8
set global innodb_stats_sample_pages=-7;
Warnings:
Warning 1292 Truncated incorrect innodb_stats_sample_pages value: '-7'
Warning 131 Using innodb_stats_sample_pages is deprecated and the variable may be removed in future releases. Please use innodb_stats_transient_sample_pages instead.
select @@global.innodb_stats_sample_pages;
@@global.innodb_stats_sample_pages
1
select * from information_schema.global_variables where variable_name='innodb_stats_sample_pages';
VARIABLE_NAME VARIABLE_VALUE
INNODB_STATS_SAMPLE_PAGES 1
SET @@global.innodb_stats_sample_pages = @start_global_value;
Warnings:
Warning 131 Using innodb_stats_sample_pages is deprecated and the variable may be removed in future releases. Please use innodb_stats_transient_sample_pages instead.
SELECT @@global.innodb_stats_sample_pages;
@@global.innodb_stats_sample_pages
8
...@@ -2,9 +2,9 @@ SET @start_global_value = @@global.innodb_stats_transient_sample_pages; ...@@ -2,9 +2,9 @@ SET @start_global_value = @@global.innodb_stats_transient_sample_pages;
SELECT @start_global_value; SELECT @start_global_value;
@start_global_value @start_global_value
8 8
Valid values are zero or above Valid values are one or above
SELECT @@global.innodb_stats_transient_sample_pages >=0; SELECT @@global.innodb_stats_transient_sample_pages >=1;
@@global.innodb_stats_transient_sample_pages >=0 @@global.innodb_stats_transient_sample_pages >=1
1 1
SELECT @@global.innodb_stats_transient_sample_pages; SELECT @@global.innodb_stats_transient_sample_pages;
@@global.innodb_stats_transient_sample_pages @@global.innodb_stats_transient_sample_pages
......
...@@ -2122,20 +2122,6 @@ NUMERIC_BLOCK_SIZE 0 ...@@ -2122,20 +2122,6 @@ NUMERIC_BLOCK_SIZE 0
ENUM_VALUE_LIST NULL ENUM_VALUE_LIST NULL
READ_ONLY NO READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME INNODB_STATS_SAMPLE_PAGES
SESSION_VALUE NULL
GLOBAL_VALUE 8
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 8
VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE BIGINT UNSIGNED
VARIABLE_COMMENT Deprecated, use innodb_stats_transient_sample_pages instead
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 18446744073709551615
NUMERIC_BLOCK_SIZE 0
ENUM_VALUE_LIST NULL
READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME INNODB_STATS_TRADITIONAL VARIABLE_NAME INNODB_STATS_TRADITIONAL
SESSION_VALUE NULL SESSION_VALUE NULL
GLOBAL_VALUE ON GLOBAL_VALUE ON
......
#
# 2010-01-27 - Added
#
--source include/have_innodb.inc
SET @start_global_value = @@global.innodb_stats_sample_pages;
SELECT @start_global_value;
#
# exists as global only
#
--echo Valid values are one or above
select @@global.innodb_stats_sample_pages >=1;
select @@global.innodb_stats_sample_pages;
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
select @@session.innodb_stats_sample_pages;
show global variables like 'innodb_stats_sample_pages';
show session variables like 'innodb_stats_sample_pages';
--disable_warnings
select * from information_schema.global_variables where variable_name='innodb_stats_sample_pages';
select * from information_schema.session_variables where variable_name='innodb_stats_sample_pages';
--enable_warnings
#
# show that it's writable
#
set global innodb_stats_sample_pages=10;
select @@global.innodb_stats_sample_pages;
--disable_warnings
select * from information_schema.global_variables where variable_name='innodb_stats_sample_pages';
select * from information_schema.session_variables where variable_name='innodb_stats_sample_pages';
--enable_warnings
--error ER_GLOBAL_VARIABLE
set session innodb_stats_sample_pages=1;
#
# show the default value
#
set global innodb_stats_sample_pages=DEFAULT;
select @@global.innodb_stats_sample_pages;
#
# invalid values
#
--error ER_WRONG_TYPE_FOR_VAR
set global innodb_stats_sample_pages = 1.1;
--error ER_WRONG_TYPE_FOR_VAR
set global innodb_stats_sample_pages = 1e1;
--error ER_WRONG_TYPE_FOR_VAR
set global innodb_stats_sample_pages = "foo";
--error ER_WRONG_TYPE_FOR_VAR
set global innodb_stats_sample_pages=' ';
select @@global.innodb_stats_sample_pages;
--error ER_WRONG_TYPE_FOR_VAR
set global innodb_stats_sample_pages=" ";
select @@global.innodb_stats_sample_pages;
set global innodb_stats_sample_pages=-7;
select @@global.innodb_stats_sample_pages;
--disable_warnings
select * from information_schema.global_variables where variable_name='innodb_stats_sample_pages';
--enable_warnings
#
# cleanup
#
SET @@global.innodb_stats_sample_pages = @start_global_value;
SELECT @@global.innodb_stats_sample_pages;
...@@ -11,8 +11,8 @@ SELECT @start_global_value; ...@@ -11,8 +11,8 @@ SELECT @start_global_value;
# #
# exists as global only # exists as global only
# #
--echo Valid values are zero or above --echo Valid values are one or above
SELECT @@global.innodb_stats_transient_sample_pages >=0; SELECT @@global.innodb_stats_transient_sample_pages >=1;
SELECT @@global.innodb_stats_transient_sample_pages; SELECT @@global.innodb_stats_transient_sample_pages;
--error ER_INCORRECT_GLOBAL_LOCAL_VAR --error ER_INCORRECT_GLOBAL_LOCAL_VAR
SELECT @@session.innodb_stats_transient_sample_pages; SELECT @@session.innodb_stats_transient_sample_pages;
......
...@@ -17467,32 +17467,6 @@ innodb_make_page_dirty(THD*, st_mysql_sys_var*, void*, const void* save) ...@@ -17467,32 +17467,6 @@ innodb_make_page_dirty(THD*, st_mysql_sys_var*, void*, const void* save)
space->release(); space->release();
} }
#endif // UNIV_DEBUG #endif // UNIV_DEBUG
/*************************************************************//**
Just emit a warning that the usage of the variable is deprecated.
@return 0 */
static
void
innodb_stats_sample_pages_update(
/*=============================*/
THD* thd, /*!< in: thread handle */
st_mysql_sys_var*, void*,
const void* save) /*!< in: immediate result
from check function */
{
const char* STATS_SAMPLE_PAGES_DEPRECATED_MSG =
"Using innodb_stats_sample_pages is deprecated and"
" the variable may be removed in future releases."
" Please use innodb_stats_transient_sample_pages instead.";
push_warning(thd, Sql_condition::WARN_LEVEL_WARN,
HA_ERR_WRONG_COMMAND, STATS_SAMPLE_PAGES_DEPRECATED_MSG);
ib::warn() << STATS_SAMPLE_PAGES_DEPRECATED_MSG;
srv_stats_transient_sample_pages =
*static_cast<const unsigned long long*>(save);
}
/****************************************************************//** /****************************************************************//**
Update the monitor counter according to the "set_option", turn Update the monitor counter according to the "set_option", turn
...@@ -18967,11 +18941,6 @@ static MYSQL_SYSVAR_BOOL(stats_on_metadata, innobase_stats_on_metadata, ...@@ -18967,11 +18941,6 @@ static MYSQL_SYSVAR_BOOL(stats_on_metadata, innobase_stats_on_metadata,
" SHOW TABLE STATUS for tables that use transient statistics (off by default)", " SHOW TABLE STATUS for tables that use transient statistics (off by default)",
NULL, NULL, FALSE); NULL, NULL, FALSE);
static MYSQL_SYSVAR_ULONGLONG(stats_sample_pages, srv_stats_transient_sample_pages,
PLUGIN_VAR_RQCMDARG,
"Deprecated, use innodb_stats_transient_sample_pages instead",
NULL, innodb_stats_sample_pages_update, 8, 1, ~0ULL, 0);
static MYSQL_SYSVAR_ULONGLONG(stats_transient_sample_pages, static MYSQL_SYSVAR_ULONGLONG(stats_transient_sample_pages,
srv_stats_transient_sample_pages, srv_stats_transient_sample_pages,
PLUGIN_VAR_RQCMDARG, PLUGIN_VAR_RQCMDARG,
...@@ -19963,7 +19932,6 @@ static struct st_mysql_sys_var* innobase_system_variables[]= { ...@@ -19963,7 +19932,6 @@ static struct st_mysql_sys_var* innobase_system_variables[]= {
MYSQL_SYSVAR(ft_user_stopword_table), MYSQL_SYSVAR(ft_user_stopword_table),
MYSQL_SYSVAR(disable_sort_file_cache), MYSQL_SYSVAR(disable_sort_file_cache),
MYSQL_SYSVAR(stats_on_metadata), MYSQL_SYSVAR(stats_on_metadata),
MYSQL_SYSVAR(stats_sample_pages),
MYSQL_SYSVAR(stats_transient_sample_pages), MYSQL_SYSVAR(stats_transient_sample_pages),
MYSQL_SYSVAR(stats_persistent), MYSQL_SYSVAR(stats_persistent),
MYSQL_SYSVAR(stats_persistent_sample_pages), MYSQL_SYSVAR(stats_persistent_sample_pages),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment