mirror of
https://github.com/MariaDB/server.git
synced 2026-05-15 19:37:16 +02:00
BUG#12232: Add a server option to treat NULL values as equal when calculating MyISAM index
statistics (like 4.0 did) (patch #3, with review #1 & #2 feedback addressed) include/myisam.h: BUG#12232: Add a server option to treat NULL values as equal when calculating MyISAM index statistics myisam/mi_check.c: BUG#12232: Add a server option to treat NULL values as equal when calculating MyISAM index statistics myisam/myisamchk.c: BUG#12232: Add a server option to treat NULL values as equal when calculating MyISAM index statistics mysql-test/r/myisam.result: BUG#12232: Add a server option to treat NULL values as equal when calculating MyISAM index statistics mysql-test/t/myisam.test: BUG#12232: Add a server option to treat NULL values as equal when calculating MyISAM index statistics sql/ha_myisam.cc: BUG#12232: Add a server option to treat NULL values as equal when calculating MyISAM index statistics sql/handler.h: BUG#12232: Add a server option to treat NULL values as equal when calculating MyISAM index statistics sql/mysqld.cc: BUG#12232: Add a server option to treat NULL values as equal when calculating MyISAM index statistics sql/set_var.cc: BUG#12232: Add a server option to treat NULL values as equal when calculating MyISAM index statistics sql/sql_class.h: BUG#12232: Add a server option to treat NULL values as equal when calculating MyISAM index statistics
This commit is contained in:
parent
1ac26b4a6c
commit
a2a8216b20
10 changed files with 215 additions and 14 deletions
|
|
@ -39,6 +39,12 @@ const char *myisam_recover_names[] =
|
|||
TYPELIB myisam_recover_typelib= {array_elements(myisam_recover_names)-1,"",
|
||||
myisam_recover_names, NULL};
|
||||
|
||||
const char *myisam_stats_method_names[] = {"nulls_inequal", "nulls_equal",
|
||||
NullS};
|
||||
TYPELIB myisam_stats_method_typelib= {
|
||||
array_elements(myisam_stats_method_names) - 1, "",
|
||||
myisam_stats_method_names, NULL};
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
** MyISAM tables
|
||||
|
|
@ -278,6 +284,7 @@ int ha_myisam::check(THD* thd, HA_CHECK_OPT* check_opt)
|
|||
param.db_name = table->table_cache_key;
|
||||
param.table_name = table->table_name;
|
||||
param.testflag = check_opt->flags | T_CHECK | T_SILENT;
|
||||
param.stats_method= (enum_mi_stats_method)thd->variables.myisam_stats_method;
|
||||
|
||||
if (!(table->db_stat & HA_READ_ONLY))
|
||||
param.testflag|= T_STATISTICS;
|
||||
|
|
@ -367,6 +374,7 @@ int ha_myisam::analyze(THD *thd, HA_CHECK_OPT* check_opt)
|
|||
param.testflag=(T_FAST | T_CHECK | T_SILENT | T_STATISTICS |
|
||||
T_DONT_CHECK_CHECKSUM);
|
||||
param.using_global_keycache = 1;
|
||||
param.stats_method= (enum_mi_stats_method)thd->variables.myisam_stats_method;
|
||||
|
||||
if (!(share->state.changed & STATE_NOT_ANALYZED))
|
||||
return HA_ADMIN_ALREADY_DONE;
|
||||
|
|
@ -920,6 +928,7 @@ int ha_myisam::enable_indexes(uint mode)
|
|||
T_CREATE_MISSING_KEYS);
|
||||
param.myf_rw&= ~MY_WAIT_IF_FULL;
|
||||
param.sort_buffer_length= thd->variables.myisam_sort_buff_size;
|
||||
param.stats_method= (enum_mi_stats_method)thd->variables.myisam_stats_method;
|
||||
param.tmpdir=&mysql_tmpdir_list;
|
||||
if ((error= (repair(thd,param,0) != HA_ADMIN_OK)) && param.retry_repair)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue