Commit 2a1afc29 authored by Igor Babaev's avatar Igor Babaev

Inverted the option --skip-stat-tables for --stat-tables.

Set it to 0 by default.
Now only the tests that use persistent statistics tables require
starting the server with --stat-tables set on.
parent 906c9a93
if (`select count(*) < 3 from information_schema.tables
where table_schema = 'mysql' and table_name in ('table_stat','column_stat','index_stat')`)
{
--skip Needs stat tables
}
...@@ -720,9 +720,6 @@ The following options may be given as the first argument: ...@@ -720,9 +720,6 @@ The following options may be given as the first argument:
--skip-show-database --skip-show-database
Don't allow 'SHOW DATABASE' commands Don't allow 'SHOW DATABASE' commands
--skip-slave-start If set, slave is not autostarted. --skip-slave-start If set, slave is not autostarted.
--skip-stat-tables Start without statistical tables. Statistical data on
table cardinalities, columns and indexes from these
tables become unavailable
--skip-thread-priority --skip-thread-priority
Don't give threads different priorities. This option is Don't give threads different priorities. This option is
deprecated because it has no effect; the implied behavior deprecated because it has no effect; the implied behavior
...@@ -781,6 +778,9 @@ The following options may be given as the first argument: ...@@ -781,6 +778,9 @@ The following options may be given as the first argument:
for the complete list of valid sql modes for the complete list of valid sql modes
--stack-trace Print a symbolic stack trace on failure --stack-trace Print a symbolic stack trace on failure
(Defaults to on; use --skip-stack-trace to disable.) (Defaults to on; use --skip-stack-trace to disable.)
--stat-tables Start with statistical tables. Statistical data on table
cardinalities, columns and indexes from these tables
become available
--stored-program-cache=# --stored-program-cache=#
The soft upper limit for number of cached stored routines The soft upper limit for number of cached stored routines
for one connection. for one connection.
...@@ -1057,7 +1057,6 @@ skip-name-resolve FALSE ...@@ -1057,7 +1057,6 @@ skip-name-resolve FALSE
skip-networking FALSE skip-networking FALSE
skip-show-database FALSE skip-show-database FALSE
skip-slave-start FALSE skip-slave-start FALSE
skip-stat-tables TRUE
slave-compressed-protocol FALSE slave-compressed-protocol FALSE
slave-exec-mode STRICT slave-exec-mode STRICT
slave-net-timeout 3600 slave-net-timeout 3600
...@@ -1070,6 +1069,7 @@ slow-query-log FALSE ...@@ -1070,6 +1069,7 @@ slow-query-log FALSE
sort-buffer-size 2097152 sort-buffer-size 2097152
sql-mode sql-mode
stack-trace TRUE stack-trace TRUE
stat-tables FALSE
stored-program-cache 256 stored-program-cache 256
symbolic-links FALSE symbolic-links FALSE
sync-binlog 0 sync-binlog 0
......
--source include/have_stat_tables.inc
set @save_optimizer_use_stat_tables=@@optimizer_use_stat_tables; set @save_optimizer_use_stat_tables=@@optimizer_use_stat_tables;
......
--source include/have_stat_tables.inc
--source include/have_innodb.inc --source include/have_innodb.inc
--disable_warnings --disable_warnings
drop table if exists t1,t2; drop table if exists t1,t2;
......
...@@ -446,7 +446,7 @@ ulong opt_replicate_events_marked_for_skip; ...@@ -446,7 +446,7 @@ ulong opt_replicate_events_marked_for_skip;
*/ */
volatile bool mqh_used = 0; volatile bool mqh_used = 0;
my_bool opt_noacl; my_bool opt_noacl;
my_bool opt_no_stat_tables; my_bool opt_with_stat_tables;
my_bool sp_automatic_privileges= 1; my_bool sp_automatic_privileges= 1;
ulong opt_binlog_rows_event_max_size; ulong opt_binlog_rows_event_max_size;
...@@ -6384,10 +6384,10 @@ struct my_option my_long_options[]= ...@@ -6384,10 +6384,10 @@ struct my_option my_long_options[]=
&opt_noacl, &opt_noacl, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, &opt_noacl, &opt_noacl, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0,
0}, 0},
#endif #endif
{"skip-stat-tables", OPT_SKIP_STAT_TABLES, {"stat-tables", OPT_WITH_STAT_TABLES,
"Start without statistical tables. Statistical data on table cardinalities, " "Start with statistical tables. Statistical data on table cardinalities, "
"columns and indexes from these tables become unavailable", "columns and indexes from these tables become available",
&opt_no_stat_tables, &opt_no_stat_tables, 0, GET_BOOL, NO_ARG, &opt_with_stat_tables, &opt_with_stat_tables, 0, GET_BOOL, NO_ARG,
0, 0, 0, 0, 0, 0}, 0, 0, 0, 0, 0, 0},
{"skip-host-cache", OPT_SKIP_HOST_CACHE, "Don't cache host names.", 0, 0, 0, {"skip-host-cache", OPT_SKIP_HOST_CACHE, "Don't cache host names.", 0, 0, 0,
GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
...@@ -7656,7 +7656,7 @@ mysqld_get_one_option(int optid, ...@@ -7656,7 +7656,7 @@ mysqld_get_one_option(int optid,
break; break;
case OPT_BOOTSTRAP: case OPT_BOOTSTRAP:
opt_noacl=opt_bootstrap=1; opt_noacl=opt_bootstrap=1;
opt_no_stat_tables= 1; opt_with_stat_tables= 0;
break; break;
case OPT_SERVER_ID: case OPT_SERVER_ID:
server_id_supplied = 1; server_id_supplied = 1;
......
...@@ -105,7 +105,7 @@ extern char* opt_secure_backup_file_priv; ...@@ -105,7 +105,7 @@ extern char* opt_secure_backup_file_priv;
extern size_t opt_secure_backup_file_priv_len; extern size_t opt_secure_backup_file_priv_len;
extern my_bool opt_log_slow_admin_statements, opt_log_slow_slave_statements; extern my_bool opt_log_slow_admin_statements, opt_log_slow_slave_statements;
extern my_bool sp_automatic_privileges, opt_noacl; extern my_bool sp_automatic_privileges, opt_noacl;
extern my_bool opt_no_stat_tables; extern my_bool opt_with_stat_tables;
extern my_bool opt_old_style_user_limits, trust_function_creators; extern my_bool opt_old_style_user_limits, trust_function_creators;
extern uint opt_crash_binlog_innodb; extern uint opt_crash_binlog_innodb;
extern char *shared_memory_base_name, *mysqld_unix_port; extern char *shared_memory_base_name, *mysqld_unix_port;
...@@ -396,7 +396,7 @@ enum options_mysqld ...@@ -396,7 +396,7 @@ enum options_mysqld
OPT_SKIP_PRIOR, OPT_SKIP_PRIOR,
OPT_SKIP_RESOLVE, OPT_SKIP_RESOLVE,
OPT_SKIP_STACK_TRACE, OPT_SKIP_STACK_TRACE,
OPT_SKIP_STAT_TABLES, OPT_WITH_STAT_TABLES,
OPT_SKIP_SYMLINKS, OPT_SKIP_SYMLINKS,
OPT_SLOW_QUERY_LOG, OPT_SLOW_QUERY_LOG,
OPT_SSL_CA, OPT_SSL_CA,
......
...@@ -637,7 +637,7 @@ static bool mysql_admin_table(THD* thd, TABLE_LIST* tables, ...@@ -637,7 +637,7 @@ static bool mysql_admin_table(THD* thd, TABLE_LIST* tables,
DBUG_PRINT("admin", ("operator_func returned: %d", result_code)); DBUG_PRINT("admin", ("operator_func returned: %d", result_code));
} }
if (operator_func == &handler::ha_analyze && !opt_no_stat_tables && if (operator_func == &handler::ha_analyze && opt_with_stat_tables &&
thd->variables.optimizer_use_stat_tables > 0) thd->variables.optimizer_use_stat_tables > 0)
{ {
if (!(compl_result_code= if (!(compl_result_code=
......
...@@ -4625,7 +4625,7 @@ open_and_process_table(THD *thd, LEX *lex, TABLE_LIST *tables, ...@@ -4625,7 +4625,7 @@ open_and_process_table(THD *thd, LEX *lex, TABLE_LIST *tables,
goto end; goto end;
} }
if (!opt_no_stat_tables && thd->variables.optimizer_use_stat_tables > 0) if (opt_with_stat_tables && thd->variables.optimizer_use_stat_tables > 0)
{ {
if (tables->table && tables->table->s && if (tables->table && tables->table->s &&
tables->table->s->table_category != TABLE_CATEGORY_SYSTEM) tables->table->s->table_category != TABLE_CATEGORY_SYSTEM)
......
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