mirror of
https://github.com/MariaDB/server.git
synced 2025-01-29 02:05:57 +01:00
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.
This commit is contained in:
parent
1a6f470464
commit
e5d71e0b3d
11 changed files with 40 additions and 240 deletions
|
@ -2,9 +2,8 @@
|
|||
|
||||
[mysqld]
|
||||
secure-file-priv = ""
|
||||
innodb_file_format ='Barracuda'
|
||||
innodb_file_per_table = ON
|
||||
innodb_stats_persistent=ON
|
||||
innodb_stats_auto_recalc=ON
|
||||
innodb_stats_persistent_sample_pages=20
|
||||
innodb_stats_sample_pages=8
|
||||
innodb_stats_transient_sample_pages=8
|
||||
|
|
|
@ -1,2 +1,4 @@
|
|||
Warnings:
|
||||
Warning 1292 Truncated incorrect innodb_stats_transient_sample_pa value: '0'
|
||||
Variable_name Value
|
||||
innodb_stats_sample_pages 1
|
||||
innodb_stats_transient_sample_pages 1
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
Warnings:
|
||||
Warning 1292 Truncated incorrect innodb_stats_transient_sample_pa value: '0'
|
||||
Variable_name Value
|
||||
innodb_stats_sample_pages 1
|
||||
innodb_stats_transient_sample_pages 1
|
||||
Variable_name Value
|
||||
innodb_stats_traditional OFF
|
||||
|
|
|
@ -1,21 +1,17 @@
|
|||
--source include/have_innodb.inc
|
||||
#
|
||||
# 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
|
||||
# and do not crash the server
|
||||
-- disable_query_log
|
||||
-- disable_result_log
|
||||
-- enable_warnings
|
||||
|
||||
let $sample_pages=`select @@innodb_stats_sample_pages`;
|
||||
SET GLOBAL innodb_stats_sample_pages=0;
|
||||
|
||||
# check that the value has been adjusted to 1
|
||||
-- enable_result_log
|
||||
SHOW VARIABLES LIKE 'innodb_stats_sample_pages';
|
||||
SET @save_sample_pages = @@GLOBAL.innodb_stats_transient_sample_pages;
|
||||
SET GLOBAL innodb_stats_transient_sample_pages=0;
|
||||
SHOW VARIABLES LIKE 'innodb_stats_transient_sample_pages';
|
||||
-- disable_result_log
|
||||
|
||||
CREATE TABLE innodb_analyze (
|
||||
|
@ -29,36 +25,36 @@ CREATE 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;
|
||||
|
||||
SET GLOBAL innodb_stats_sample_pages=4;
|
||||
SET GLOBAL innodb_stats_transient_sample_pages=4;
|
||||
ANALYZE TABLE innodb_analyze;
|
||||
|
||||
SET GLOBAL innodb_stats_sample_pages=8;
|
||||
SET GLOBAL innodb_stats_transient_sample_pages=8;
|
||||
ANALYZE TABLE innodb_analyze;
|
||||
|
||||
SET GLOBAL innodb_stats_sample_pages=16;
|
||||
SET GLOBAL innodb_stats_transient_sample_pages=16;
|
||||
ANALYZE TABLE innodb_analyze;
|
||||
|
||||
INSERT INTO innodb_analyze VALUES
|
||||
(1,1), (1,1), (1,2), (1,3), (1,4), (1,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;
|
||||
|
||||
SET GLOBAL innodb_stats_sample_pages=2;
|
||||
SET GLOBAL innodb_stats_transient_sample_pages=2;
|
||||
ANALYZE TABLE innodb_analyze;
|
||||
|
||||
SET GLOBAL innodb_stats_sample_pages=4;
|
||||
SET GLOBAL innodb_stats_transient_sample_pages=4;
|
||||
ANALYZE TABLE innodb_analyze;
|
||||
|
||||
SET GLOBAL innodb_stats_sample_pages=8;
|
||||
SET GLOBAL innodb_stats_transient_sample_pages=8;
|
||||
ANALYZE TABLE innodb_analyze;
|
||||
|
||||
SET GLOBAL innodb_stats_sample_pages=16;
|
||||
SET GLOBAL innodb_stats_transient_sample_pages=16;
|
||||
ANALYZE 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;
|
||||
|
|
|
@ -1,24 +1,20 @@
|
|||
--source include/have_innodb.inc
|
||||
#
|
||||
# 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
|
||||
# and do not crash the server
|
||||
-- disable_query_log
|
||||
-- disable_result_log
|
||||
-- enable_warnings
|
||||
|
||||
let $sample_pages=`select @@innodb_stats_sample_pages`;
|
||||
let $traditional=`select @@innodb_stats_traditional`;
|
||||
SET GLOBAL innodb_stats_sample_pages=0;
|
||||
SET @save_sample_pages = @@GLOBAL.innodb_stats_transient_sample_pages;
|
||||
SET @save_traditional = @@GLOBAL.innodb_stats_traditional;
|
||||
SET GLOBAL innodb_stats_transient_sample_pages=0;
|
||||
#use new method to calculate statistics
|
||||
SET GLOBAL innodb_stats_traditional=0;
|
||||
|
||||
# check that the value has been adjusted to 1
|
||||
-- enable_result_log
|
||||
SHOW VARIABLES LIKE 'innodb_stats_sample_pages';
|
||||
SHOW VARIABLES LIKE 'innodb_stats_transient_sample_pages';
|
||||
SHOW VARIABLES LIKE 'innodb_stats_traditional';
|
||||
-- disable_result_log
|
||||
|
||||
|
@ -33,13 +29,13 @@ CREATE TABLE innodb_analyze (
|
|||
# test with empty table
|
||||
ANALYZE TABLE innodb_analyze;
|
||||
|
||||
SET GLOBAL innodb_stats_sample_pages=2;
|
||||
SET GLOBAL innodb_stats_transient_sample_pages=2;
|
||||
ANALYZE TABLE innodb_analyze;
|
||||
|
||||
SET GLOBAL innodb_stats_sample_pages=1;
|
||||
SET GLOBAL innodb_stats_transient_sample_pages=1;
|
||||
ANALYZE TABLE innodb_analyze;
|
||||
|
||||
SET GLOBAL innodb_stats_sample_pages=8000;
|
||||
SET GLOBAL innodb_stats_transient_sample_pages=8000;
|
||||
ANALYZE TABLE innodb_analyze;
|
||||
|
||||
delimiter //;
|
||||
|
@ -60,19 +56,19 @@ call innodb_insert_proc(7000);
|
|||
commit;
|
||||
set autocommit=1;
|
||||
|
||||
SET GLOBAL innodb_stats_sample_pages=1;
|
||||
SET GLOBAL innodb_stats_transient_sample_pages=1;
|
||||
ANALYZE TABLE innodb_analyze;
|
||||
|
||||
SET GLOBAL innodb_stats_sample_pages=8;
|
||||
SET GLOBAL innodb_stats_transient_sample_pages=8;
|
||||
ANALYZE TABLE innodb_analyze;
|
||||
|
||||
SET GLOBAL innodb_stats_sample_pages=16;
|
||||
SET GLOBAL innodb_stats_transient_sample_pages=16;
|
||||
ANALYZE TABLE innodb_analyze;
|
||||
|
||||
SET GLOBAL innodb_stats_sample_pages=8000;
|
||||
SET GLOBAL innodb_stats_transient_sample_pages=8000;
|
||||
ANALYZE TABLE innodb_analyze;
|
||||
|
||||
DROP PROCEDURE innodb_insert_proc;
|
||||
DROP TABLE innodb_analyze;
|
||||
EVAL SET GLOBAL innodb_stats_sample_pages=$sample_pages;
|
||||
EVAL SET GLOBAL innodb_stats_traditional=$traditional;
|
||||
SET GLOBAL innodb_stats_transient_sample_pages = @save_sample_pages;
|
||||
SET GLOBAL innodb_stats_traditional = @save_traditional;
|
||||
|
|
|
@ -1,77 +0,0 @@
|
|||
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;
|
|||
SELECT @start_global_value;
|
||||
@start_global_value
|
||||
8
|
||||
Valid values are zero or above
|
||||
SELECT @@global.innodb_stats_transient_sample_pages >=0;
|
||||
@@global.innodb_stats_transient_sample_pages >=0
|
||||
Valid values are one or above
|
||||
SELECT @@global.innodb_stats_transient_sample_pages >=1;
|
||||
@@global.innodb_stats_transient_sample_pages >=1
|
||||
1
|
||||
SELECT @@global.innodb_stats_transient_sample_pages;
|
||||
@@global.innodb_stats_transient_sample_pages
|
||||
|
|
|
@ -2122,20 +2122,6 @@ NUMERIC_BLOCK_SIZE 0
|
|||
ENUM_VALUE_LIST NULL
|
||||
READ_ONLY NO
|
||||
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
|
||||
SESSION_VALUE NULL
|
||||
GLOBAL_VALUE ON
|
||||
|
|
|
@ -1,72 +0,0 @@
|
|||
|
||||
#
|
||||
# 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;
|
|||
#
|
||||
# exists as global only
|
||||
#
|
||||
--echo Valid values are zero or above
|
||||
SELECT @@global.innodb_stats_transient_sample_pages >=0;
|
||||
--echo Valid values are one or above
|
||||
SELECT @@global.innodb_stats_transient_sample_pages >=1;
|
||||
SELECT @@global.innodb_stats_transient_sample_pages;
|
||||
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
|
||||
SELECT @@session.innodb_stats_transient_sample_pages;
|
||||
|
|
|
@ -17467,32 +17467,6 @@ innodb_make_page_dirty(THD*, st_mysql_sys_var*, void*, const void* save)
|
|||
space->release();
|
||||
}
|
||||
#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
|
||||
|
@ -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)",
|
||||
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,
|
||||
srv_stats_transient_sample_pages,
|
||||
PLUGIN_VAR_RQCMDARG,
|
||||
|
@ -19963,7 +19932,6 @@ static struct st_mysql_sys_var* innobase_system_variables[]= {
|
|||
MYSQL_SYSVAR(ft_user_stopword_table),
|
||||
MYSQL_SYSVAR(disable_sort_file_cache),
|
||||
MYSQL_SYSVAR(stats_on_metadata),
|
||||
MYSQL_SYSVAR(stats_sample_pages),
|
||||
MYSQL_SYSVAR(stats_transient_sample_pages),
|
||||
MYSQL_SYSVAR(stats_persistent),
|
||||
MYSQL_SYSVAR(stats_persistent_sample_pages),
|
||||
|
|
Loading…
Add table
Reference in a new issue