From 83e0438f628450dc88af59425da3ece5dfa746a0 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Tue, 29 Apr 2025 11:34:35 +0200 Subject: [PATCH] MDEV-36536 post-review changes that were apparently partially lost in a rebase --- mysql-test/main/mysqld--help.result | 6 +++--- mysql-test/suite/sys_vars/r/sysvars_server_embedded.result | 4 ++-- .../suite/sys_vars/r/sysvars_server_notembedded.result | 4 ++-- sql/sql_class.h | 2 +- sql/sys_vars.cc | 7 +++---- 5 files changed, 11 insertions(+), 12 deletions(-) diff --git a/mysql-test/main/mysqld--help.result b/mysql-test/main/mysqld--help.result index f4aa81e0d66..abe7c10952b 100644 --- a/mysql-test/main/mysqld--help.result +++ b/mysql-test/main/mysqld--help.result @@ -16,9 +16,9 @@ The following specify which files/extra groups are read (specified before remain Specify the alter table algorithm. One of: DEFAULT, COPY, INPLACE, NOCOPY, INSTANT --analyze-max-length=# - Fields that require more storage than analyze_max_length - and are not listed in ANALYZE ... FOR COLUMNS () will - automatically be skipped by ANALYZE TABLE PERSISTENT + Fields which length in bytes more than this are skipped + by ANALYZE TABLE PERSISTENT unless explicitly listed in + the FOR COLUMNS () clause --analyze-sample-percentage=# Percentage of rows from the table ANALYZE TABLE will sample to collect table statistics. Set to 0 to let diff --git a/mysql-test/suite/sys_vars/r/sysvars_server_embedded.result b/mysql-test/suite/sys_vars/r/sysvars_server_embedded.result index 9eb4e5687d1..977afb94f0d 100644 --- a/mysql-test/suite/sys_vars/r/sysvars_server_embedded.result +++ b/mysql-test/suite/sys_vars/r/sysvars_server_embedded.result @@ -24,8 +24,8 @@ READ_ONLY NO COMMAND_LINE_ARGUMENT OPTIONAL VARIABLE_NAME ANALYZE_MAX_LENGTH VARIABLE_SCOPE SESSION -VARIABLE_TYPE BIGINT UNSIGNED -VARIABLE_COMMENT Fields which length in bytes are more than analyze_max_length are skipped by ANALYZE TABLE PERSISTENT unless explicitly listed in the FOR COLUMNS () clause +VARIABLE_TYPE INT UNSIGNED +VARIABLE_COMMENT Fields which length in bytes more than this are skipped by ANALYZE TABLE PERSISTENT unless explicitly listed in the FOR COLUMNS () clause NUMERIC_MIN_VALUE 32 NUMERIC_MAX_VALUE 4294967295 NUMERIC_BLOCK_SIZE 1 diff --git a/mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result b/mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result index 7f08e1bbfc2..c5781705847 100644 --- a/mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result +++ b/mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result @@ -24,8 +24,8 @@ READ_ONLY NO COMMAND_LINE_ARGUMENT OPTIONAL VARIABLE_NAME ANALYZE_MAX_LENGTH VARIABLE_SCOPE SESSION -VARIABLE_TYPE BIGINT UNSIGNED -VARIABLE_COMMENT Fields that require more storage than analyze_max_length and are not listed in ANALYZE ... FOR COLUMNS () will automatically be skipped by ANALYZE TABLE PERSISTENT +VARIABLE_TYPE INT UNSIGNED +VARIABLE_COMMENT Fields which length in bytes more than this are skipped by ANALYZE TABLE PERSISTENT unless explicitly listed in the FOR COLUMNS () clause NUMERIC_MIN_VALUE 32 NUMERIC_MAX_VALUE 4294967295 NUMERIC_BLOCK_SIZE 1 diff --git a/sql/sql_class.h b/sql/sql_class.h index aac433181a4..f544c2e3fd1 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -731,7 +731,7 @@ typedef struct system_variables ha_rows select_limit; ha_rows max_join_size; ha_rows expensive_subquery_limit; - ulong analyze_max_length; + uint analyze_max_length; ulong auto_increment_increment, auto_increment_offset; #ifdef WITH_WSREP /* diff --git a/sql/sys_vars.cc b/sql/sys_vars.cc index 4ae14a58feb..9477a26beec 100644 --- a/sql/sys_vars.cc +++ b/sql/sys_vars.cc @@ -450,11 +450,10 @@ static Sys_var_double Sys_analyze_sample_percentage( from analyze. */ -static Sys_var_ulong Sys_analyze_max_length( +static Sys_var_uint Sys_analyze_max_length( "analyze_max_length", - "Fields that require more storage than analyze_max_length and are not " - "listed in ANALYZE ... FOR COLUMNS () will automatically be skipped by " - "ANALYZE TABLE PERSISTENT", + "Fields which length in bytes more than this are skipped by ANALYZE " + "TABLE PERSISTENT unless explicitly listed in the FOR COLUMNS () clause", SESSION_VAR(analyze_max_length), CMD_LINE(REQUIRED_ARG), VALID_RANGE(32, UINT_MAX32), DEFAULT(UINT_MAX32), BLOCK_SIZE(1));