Commit 8f15bf9d authored by Sergei Golubchik's avatar Sergei Golubchik

cleanup: remove hidden I_S.VARIABLES and I_S.STATUS tables

their only purpose was to distinguish between
SHOW and SELECT and there are cleaner ways of doing  it.
parent 2fae1b57
......@@ -100,20 +100,20 @@ drop table t1;
-- after Bug#29394 is implemented.
show variables like "wait_timeout%";
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
def information_schema VARIABLES VARIABLES VARIABLE_NAME Variable_name 253 64 12 N 1 0 8
def information_schema VARIABLES VARIABLES VARIABLE_VALUE Value 253 1024 5 Y 0 0 8
def information_schema SESSION_VARIABLES SESSION_VARIABLES VARIABLE_NAME Variable_name 253 64 12 N 1 0 8
def information_schema SESSION_VARIABLES SESSION_VARIABLES VARIABLE_VALUE Value 253 1024 5 Y 0 0 8
Variable_name Value
wait_timeout 28800
show variables like "WAIT_timeout%";
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
def information_schema VARIABLES VARIABLES VARIABLE_NAME Variable_name 253 64 12 N 1 0 8
def information_schema VARIABLES VARIABLES VARIABLE_VALUE Value 253 1024 5 Y 0 0 8
def information_schema SESSION_VARIABLES SESSION_VARIABLES VARIABLE_NAME Variable_name 253 64 12 N 1 0 8
def information_schema SESSION_VARIABLES SESSION_VARIABLES VARIABLE_VALUE Value 253 1024 5 Y 0 0 8
Variable_name Value
wait_timeout 28800
show variables like "this_doesn't_exists%";
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
def information_schema VARIABLES VARIABLES VARIABLE_NAME Variable_name 253 64 0 N 1 0 8
def information_schema VARIABLES VARIABLES VARIABLE_VALUE Value 253 1024 0 Y 0 0 8
def information_schema SESSION_VARIABLES SESSION_VARIABLES VARIABLE_NAME Variable_name 253 64 0 N 1 0 8
def information_schema SESSION_VARIABLES SESSION_VARIABLES VARIABLE_VALUE Value 253 1024 0 Y 0 0 8
Variable_name Value
show table status from test like "this_doesn't_exists%";
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
......
......@@ -748,7 +748,6 @@ enum enum_schema_tables
SCH_SESSION_STATUS,
SCH_SESSION_VARIABLES,
SCH_STATISTICS,
SCH_STATUS,
SCH_TABLES,
SCH_TABLESPACES,
SCH_TABLE_CONSTRAINTS,
......@@ -758,7 +757,6 @@ enum enum_schema_tables
SCH_TRIGGERS,
SCH_USER_PRIVILEGES,
SCH_USER_STATS,
SCH_VARIABLES,
SCH_VIEWS
};
......
......@@ -2125,8 +2125,6 @@ int prepare_schema_table(THD *thd, LEX *lex, Table_ident *table_ident,
case SCH_TABLE_STATS:
case SCH_INDEX_STATS:
case SCH_OPEN_TABLES:
case SCH_VARIABLES:
case SCH_STATUS:
case SCH_PROCEDURES:
case SCH_CHARSETS:
case SCH_ENGINES:
......
......@@ -7237,8 +7237,8 @@ int fill_variables(THD *thd, TABLE_LIST *tables, COND *cond)
enum enum_schema_tables schema_table_idx=
get_schema_table_idx(tables->schema_table);
enum enum_var_type option_type= OPT_SESSION;
bool upper_case_names= (schema_table_idx != SCH_VARIABLES);
bool sorted_vars= (schema_table_idx == SCH_VARIABLES);
bool upper_case_names= lex->sql_command != SQLCOM_SHOW_VARIABLES;
bool sorted_vars= lex->sql_command == SQLCOM_SHOW_VARIABLES;
if (lex->option_type == OPT_GLOBAL ||
schema_table_idx == SCH_GLOBAL_VARIABLES)
......@@ -7265,9 +7265,9 @@ int fill_status(THD *thd, TABLE_LIST *tables, COND *cond)
enum enum_schema_tables schema_table_idx=
get_schema_table_idx(tables->schema_table);
enum enum_var_type option_type;
bool upper_case_names= (schema_table_idx != SCH_STATUS);
bool upper_case_names= lex->sql_command != SQLCOM_SHOW_STATUS;
if (schema_table_idx == SCH_STATUS)
if (lex->sql_command == SQLCOM_SHOW_STATUS)
{
option_type= lex->option_type;
if (option_type == OPT_GLOBAL)
......@@ -9186,8 +9186,6 @@ ST_SCHEMA_TABLE schema_tables[]=
{"STATISTICS", stat_fields_info, create_schema_table,
get_all_tables, make_old_format, get_schema_stat_record, 1, 2, 0,
OPEN_TABLE_ONLY|OPTIMIZE_I_S_TABLE},
{"STATUS", variables_fields_info, create_schema_table, fill_status,
make_old_format, 0, 0, -1, 1, 0},
{"TABLES", tables_fields_info, create_schema_table,
get_all_tables, make_old_format, get_schema_tables_record, 1, 2, 0,
OPTIMIZE_I_S_TABLE},
......@@ -9209,8 +9207,6 @@ ST_SCHEMA_TABLE schema_tables[]=
fill_schema_user_privileges, 0, 0, -1, -1, 0, 0},
{"USER_STATISTICS", user_stats_fields_info, create_schema_table,
fill_schema_user_stats, make_old_format, 0, -1, -1, 0, 0},
{"VARIABLES", variables_fields_info, create_schema_table, fill_variables,
make_old_format, 0, 0, -1, 1, 0},
{"VIEWS", view_fields_info, create_schema_table,
get_all_tables, 0, get_schema_views_record, 1, 2, 0,
OPEN_VIEW_ONLY|OPTIMIZE_I_S_TABLE},
......
......@@ -12471,7 +12471,7 @@ show_param:
LEX *lex= Lex;
lex->sql_command= SQLCOM_SHOW_STATUS;
lex->option_type= $1;
if (prepare_schema_table(thd, lex, 0, SCH_STATUS))
if (prepare_schema_table(thd, lex, 0, SCH_SESSION_STATUS))
MYSQL_YYABORT;
}
| opt_full PROCESSLIST_SYM
......@@ -12481,7 +12481,7 @@ show_param:
LEX *lex= Lex;
lex->sql_command= SQLCOM_SHOW_VARIABLES;
lex->option_type= $1;
if (prepare_schema_table(thd, lex, 0, SCH_VARIABLES))
if (prepare_schema_table(thd, lex, 0, SCH_SESSION_VARIABLES))
MYSQL_YYABORT;
}
| charset wild_and_where
......
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