summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mysql-test/r/information_schema.result90
-rw-r--r--mysql-test/r/ps_1general.result12
-rw-r--r--mysql-test/t/information_schema.test27
-rw-r--r--mysql-test/t/ps_1general.test8
-rw-r--r--sql/sql_base.cc22
-rw-r--r--sql/sql_parse.cc1
-rw-r--r--sql/sql_show.cc42
-rw-r--r--sql/sql_yacc.yy59
-rw-r--r--sql/table.h1
9 files changed, 130 insertions, 132 deletions
diff --git a/mysql-test/r/information_schema.result b/mysql-test/r/information_schema.result
index eed3132c195..2532eed8abc 100644
--- a/mysql-test/r/information_schema.result
+++ b/mysql-test/r/information_schema.result
@@ -1,6 +1,6 @@
-show variables variable_name where variable_name like "skip_show_database";
-variable_name
-skip_show_database
+show variables where variable_name like "skip_show_database";
+Variable_name Value
+skip_show_database OFF
grant all privileges on test.* to mysqltest_1@localhost;
select * from information_schema.SCHEMATA where schema_name > 'm';
CATALOG_NAME SCHEMA_NAME DEFAULT_CHARACTER_SET_NAME SQL_PATH
@@ -11,11 +11,6 @@ schema_name
information_schema
mysql
test
-show databases *;
-CATALOG_NAME SCHEMA_NAME DEFAULT_CHARACTER_SET_NAME SQL_PATH
-NULL information_schema utf8 NULL
-NULL mysql latin1 NULL
-NULL test latin1 NULL
show databases like 't%';
Database (t%)
test
@@ -24,11 +19,8 @@ Database
information_schema
mysql
test
-show databases * where schema_name like 't%';
-CATALOG_NAME SCHEMA_NAME DEFAULT_CHARACTER_SET_NAME SQL_PATH
-NULL test latin1 NULL
-show databases * where schema_name = 't%';
-CATALOG_NAME SCHEMA_NAME DEFAULT_CHARACTER_SET_NAME SQL_PATH
+show databases where `database` = 't%';
+Database
create database testtets;
create table testtets.t1(a int, b VARCHAR(30), KEY string_data (b));
create table test.t2(a int);
@@ -116,20 +108,13 @@ t4
select * from information_schema.STATISTICS where TABLE_SCHEMA = "testtets";
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME NON_UNIQUE INDEX_SCHEMA INDEX_NAME SEQ_IN_INDEX COLUMN_NAME COLLATION CARDINALITY SUB_PART PACKED NULLABLE INDEX_TYPE COMMENT
NULL testtets t1 1 testtets string_data 1 b A NULL NULL NULL YES BTREE
-show keys * from t3 where TABLE_SCHEMA Like "test%";
-TABLE_CATALOG TABLE_SCHEMA TABLE_NAME NON_UNIQUE INDEX_SCHEMA INDEX_NAME SEQ_IN_INDEX COLUMN_NAME COLLATION CARDINALITY SUB_PART PACKED NULLABLE INDEX_TYPE COMMENT
-NULL test t3 1 test a_data 1 a A NULL NULL NULL YES BTREE
-show keys from t3 where INDEX_NAME = "a_data";
+show keys from t3 where Key_name = "a_data";
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
t3 1 a_data 1 a A NULL NULL NULL YES BTREE
show tables like 't%';
Tables_in_test (t%)
t2
t3
-show tables * from test where table_name like 't%';
-TABLE_CATALOG TABLE_SCHEMA TABLE_NAME TABLE_TYPE
-NULL test t2
-NULL test t3
show table status;
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
t2 MyISAM 9 Fixed 0 0 0 21474836479 1024 0 NULL # # NULL latin1_swedish_ci NULL
@@ -148,10 +133,9 @@ select * from information_schema.COLUMNS where table_name="t1"
and column_name= "a";
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME ORDINAL_POSITION COLUMN_DEFAULT IS_NULLABLE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE COLUMN_KEY EXTRA PRIVILEGES COLUMN_COMMENT
NULL testtets t1 a 1 NULL YES int 11 11 11 0 NULL NULL int(11) select,insert,update,references
-show columns * from testtets.t1 where table_name = "t1";
-TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME ORDINAL_POSITION COLUMN_DEFAULT IS_NULLABLE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE COLUMN_KEY EXTRA PRIVILEGES COLUMN_COMMENT
-NULL testtets t1 a 1 NULL YES int 11 11 11 0 NULL NULL int(11) select,insert,update,references
-NULL testtets t1 b 2 NULL YES varchar 30 30 NULL NULL latin1 latin1_swedish_ci varchar(30) MUL select,insert,update,references
+show columns from testtets.t1 where field like "%a%";
+Field Type Null Key Default Extra
+a int(11) YES NULL
drop view v1;
drop tables testtets.t4, testtets.t1, t2, t3;
drop database testtets;
@@ -162,18 +146,9 @@ latin1 latin1_swedish_ci ISO 8859-1 West European 1
SHOW CHARACTER SET LIKE 'latin1%';
Charset Description Default collation Maxlen
latin1 ISO 8859-1 West European latin1_swedish_ci 1
-SHOW CHARACTER SET * LIKE 'latin1%';
-CHARACTER_SET_NAME DEFAULT_COLLATE_NAME DESCRIPTION MAXLEN
-latin1 latin1_swedish_ci ISO 8859-1 West European 1
-SHOW CHARACTER SET WHERE CHARACTER_SET_NAME like 'latin1%';
+SHOW CHARACTER SET WHERE charset like 'latin1%';
Charset Description Default collation Maxlen
latin1 ISO 8859-1 West European latin1_swedish_ci 1
-SHOW CHARACTER SET CHARACTER_SET_NAME WHERE CHARACTER_SET_NAME like 'latin1%';
-CHARACTER_SET_NAME
-latin1
-SHOW CHARACTER SET * WHERE CHARACTER_SET_NAME like 'latin1%';
-CHARACTER_SET_NAME DEFAULT_COLLATE_NAME DESCRIPTION MAXLEN
-latin1 latin1_swedish_ci ISO 8859-1 West European 1
select * from information_schema.COLLATIONS
where COLLATION_NAME like 'latin1%';
COLLATION_NAME CHARACTER_SET_NAME ID IS_DEFAULT IS_COMPILED SORTLEN
@@ -195,17 +170,7 @@ latin1_bin latin1 47 Yes 1
latin1_general_ci latin1 48 0
latin1_general_cs latin1 49 0
latin1_spanish_ci latin1 94 0
-SHOW COLLATION * LIKE 'latin1%';
-COLLATION_NAME CHARACTER_SET_NAME ID IS_DEFAULT IS_COMPILED SORTLEN
-latin1_german1_ci latin1 5 0
-latin1_swedish_ci latin1 8 Yes Yes 1
-latin1_danish_ci latin1 15 0
-latin1_german2_ci latin1 31 Yes 2
-latin1_bin latin1 47 Yes 1
-latin1_general_ci latin1 48 0
-latin1_general_cs latin1 49 0
-latin1_spanish_ci latin1 94 0
-SHOW COLLATION WHERE COLLATION_NAME like 'latin1%';
+SHOW COLLATION WHERE collation like 'latin1%';
Collation Charset Id Default Compiled Sortlen
latin1_german1_ci latin1 5 0
latin1_swedish_ci latin1 8 Yes Yes 1
@@ -215,26 +180,6 @@ latin1_bin latin1 47 Yes 1
latin1_general_ci latin1 48 0
latin1_general_cs latin1 49 0
latin1_spanish_ci latin1 94 0
-SHOW COLLATION COLLATION_NAME WHERE COLLATION_NAME like 'latin1%';
-COLLATION_NAME
-latin1_german1_ci
-latin1_swedish_ci
-latin1_danish_ci
-latin1_german2_ci
-latin1_bin
-latin1_general_ci
-latin1_general_cs
-latin1_spanish_ci
-SHOW COLLATION * WHERE COLLATION_NAME like 'latin1%';
-COLLATION_NAME CHARACTER_SET_NAME ID IS_DEFAULT IS_COMPILED SORTLEN
-latin1_german1_ci latin1 5 0
-latin1_swedish_ci latin1 8 Yes Yes 1
-latin1_danish_ci latin1 15 0
-latin1_german2_ci latin1 31 Yes 2
-latin1_bin latin1 47 Yes 1
-latin1_general_ci latin1 48 0
-latin1_general_cs latin1 49 0
-latin1_spanish_ci latin1 94 0
select * from information_schema.COLLATION_CHARACTER_SET_APPLICABILITY
where COLLATION_NAME like 'latin1%';
COLLATION_NAME CHARACTER_SET_NAME
@@ -671,14 +616,11 @@ BASE TABLE
show open tables where `table` like "user";
Database Table In_use Name_locked
mysql user 0 0
-show status variable_name where variable_name like "%database%";
-variable_name
-Com_show_databases
-show variables variable_name where variable_name like "%database%";
-variable_name
-character_set_database
-collation_database
-skip_show_database
+show status where variable_name like "%database%";
+Variable_name Value
+Com_show_databases 0
+show variables where variable_name like "skip_show_databas";
+Variable_name Value
show global status like "Threads_running";
Variable_name Value
Threads_running 1
diff --git a/mysql-test/r/ps_1general.result b/mysql-test/r/ps_1general.result
index c65d11330ea..f5c71d3ed23 100644
--- a/mysql-test/r/ps_1general.result
+++ b/mysql-test/r/ps_1general.result
@@ -264,6 +264,18 @@ prepare stmt4 from ' show tables from test like ''t2%'' ';
execute stmt4;
Tables_in_test (t2%)
t2
+prepare stmt4 from ' show columns from t2 where field in (select ?) ';
+SET @arg00="a";
+execute stmt4 using @arg00;
+Field Type Null Key Default Extra
+a int(11) NO PRI
+SET @arg00="b";
+execute stmt4 using @arg00;
+Field Type Null Key Default Extra
+b char(10) YES NULL
+SET @arg00=1;
+execute stmt4 using @arg00;
+Field Type Null Key Default Extra
prepare stmt4 from ' show columns from t2 from test like ''a%'' ';
execute stmt4;
Field Type Null Key Default Extra
diff --git a/mysql-test/t/information_schema.test b/mysql-test/t/information_schema.test
index 177867f5205..20e2a319375 100644
--- a/mysql-test/t/information_schema.test
+++ b/mysql-test/t/information_schema.test
@@ -2,16 +2,14 @@
# Test for information_schema.schemata &
# show databases
-show variables variable_name where variable_name like "skip_show_database";
+show variables where variable_name like "skip_show_database";
grant all privileges on test.* to mysqltest_1@localhost;
select * from information_schema.SCHEMATA where schema_name > 'm';
select schema_name from information_schema.schemata;
-show databases *;
show databases like 't%';
show databases;
-show databases * where schema_name like 't%';
-show databases * where schema_name = 't%';
+show databases where `database` = 't%';
# Test for information_schema.tables &
# show tables
@@ -35,12 +33,9 @@ select table_name from information_schema.TABLES
where table_schema = "testtets" and table_name like "t%";
select * from information_schema.STATISTICS where TABLE_SCHEMA = "testtets";
-show keys * from t3 where TABLE_SCHEMA Like "test%";
-show keys from t3 where INDEX_NAME = "a_data";
+show keys from t3 where Key_name = "a_data";
show tables like 't%';
---replace_column 15 # 16 #
-show tables * from test where table_name like 't%';
--replace_column 12 # 13 #
--replace_result "2147483647 " "21474836479 "
show table status;
@@ -49,7 +44,7 @@ show full columns from mysql.db like "Insert%";
show full columns from v1;
select * from information_schema.COLUMNS where table_name="t1"
and column_name= "a";
-show columns * from testtets.t1 where table_name = "t1";
+show columns from testtets.t1 where field like "%a%";
drop view v1;
drop tables testtets.t4, testtets.t1, t2, t3;
@@ -61,10 +56,7 @@ drop database testtets;
select * from information_schema.CHARACTER_SETS
where CHARACTER_SET_NAME like 'latin1%';
SHOW CHARACTER SET LIKE 'latin1%';
-SHOW CHARACTER SET * LIKE 'latin1%';
-SHOW CHARACTER SET WHERE CHARACTER_SET_NAME like 'latin1%';
-SHOW CHARACTER SET CHARACTER_SET_NAME WHERE CHARACTER_SET_NAME like 'latin1%';
-SHOW CHARACTER SET * WHERE CHARACTER_SET_NAME like 'latin1%';
+SHOW CHARACTER SET WHERE charset like 'latin1%';
# Test for information_schema.COLLATIONS &
# SHOW COLLATION
@@ -72,10 +64,7 @@ SHOW CHARACTER SET * WHERE CHARACTER_SET_NAME like 'latin1%';
select * from information_schema.COLLATIONS
where COLLATION_NAME like 'latin1%';
SHOW COLLATION LIKE 'latin1%';
-SHOW COLLATION * LIKE 'latin1%';
-SHOW COLLATION WHERE COLLATION_NAME like 'latin1%';
-SHOW COLLATION COLLATION_NAME WHERE COLLATION_NAME like 'latin1%';
-SHOW COLLATION * WHERE COLLATION_NAME like 'latin1%';
+SHOW COLLATION WHERE collation like 'latin1%';
select * from information_schema.COLLATION_CHARACTER_SET_APPLICABILITY
where COLLATION_NAME like 'latin1%';
@@ -351,9 +340,9 @@ where table_schema="mysql" and table_name="user";
# test for 'show open tables ... where'
show open tables where `table` like "user";
# test for 'show status ... where'
-show status variable_name where variable_name like "%database%";
+show status where variable_name like "%database%";
# test for 'show variables ... where'
-show variables variable_name where variable_name like "%database%";
+show variables where variable_name like "skip_show_databas";
#
# Bug #7981:SHOW GLOBAL STATUS crashes server
diff --git a/mysql-test/t/ps_1general.test b/mysql-test/t/ps_1general.test
index 4b55593fde5..ed51b820652 100644
--- a/mysql-test/t/ps_1general.test
+++ b/mysql-test/t/ps_1general.test
@@ -290,6 +290,14 @@ prepare stmt4 from ' show databases ';
execute stmt4;
prepare stmt4 from ' show tables from test like ''t2%'' ';
execute stmt4;
+prepare stmt4 from ' show columns from t2 where field in (select ?) ';
+SET @arg00="a";
+execute stmt4 using @arg00;
+SET @arg00="b";
+execute stmt4 using @arg00;
+SET @arg00=1;
+execute stmt4 using @arg00;
+
prepare stmt4 from ' show columns from t2 from test like ''a%'' ';
execute stmt4;
create index t2_idx on t2(b);
diff --git a/sql/sql_base.cc b/sql/sql_base.cc
index 5f9f743932d..0a57c0f6bc9 100644
--- a/sql/sql_base.cc
+++ b/sql/sql_base.cc
@@ -2119,13 +2119,31 @@ find_field_in_table(THD *thd, TABLE_LIST *table_list,
table_list->alias, name, item_name, (ulong) ref));
if (table_list->field_translation)
{
- DBUG_ASSERT(ref != 0 && table_list->view != 0);
- uint num= table_list->view->select_lex.item_list.elements;
+ uint num;
+ if (table_list->schema_table_reformed)
+ {
+ num= thd->lex->current_select->item_list.elements;
+ }
+ else
+ {
+ DBUG_ASSERT(ref != 0 && table_list->view != 0);
+ num= table_list->view->select_lex.item_list.elements;
+ }
Field_translator *trans= table_list->field_translation;
for (uint i= 0; i < num; i ++)
{
if (!my_strcasecmp(system_charset_info, trans[i].name, name))
{
+ if (table_list->schema_table_reformed)
+ {
+ /*
+ Translation table items are always Item_fields
+ and fixed already('mysql_schema_table' function).
+ So we can return ->field. It is used only for
+ 'show & where' commands.
+ */
+ DBUG_RETURN(((Item_field*) (trans[i].item))->field);
+ }
#ifndef NO_EMBEDDED_ACCESS_CHECKS
if (check_grants_view &&
check_grant_column(thd, &table_list->grant,
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index 2fb90502863..5981a8b2d4d 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -2156,6 +2156,7 @@ int prepare_schema_table(THD *thd, LEX *lex, Table_ident *table_ident,
}
TABLE_LIST *table_list= (TABLE_LIST*) select_lex->table_list.first;
table_list->schema_select_lex= sel;
+ table_list->schema_table_reformed= 1;
DBUG_RETURN(0);
}
diff --git a/sql/sql_show.cc b/sql/sql_show.cc
index 9c544142b14..5abfe44f51b 100644
--- a/sql/sql_show.cc
+++ b/sql/sql_show.cc
@@ -3202,6 +3202,45 @@ int mysql_schema_table(THD *thd, LEX *lex, TABLE_LIST *table_list)
thd->derived_tables= table;
table_list->select_lex->options |= OPTION_SCHEMA_TABLE;
lex->safe_to_cache_query= 0;
+
+ if (table_list->schema_table_reformed) // show command
+ {
+ SELECT_LEX *sel= lex->current_select;
+ uint i= 0;
+ Item *item;
+ Field_translator *transl;
+
+ if (table_list->field_translation)
+ {
+ Field_translator *end= table_list->field_translation +
+ sel->item_list.elements;
+ for (transl= table_list->field_translation; transl < end; transl++)
+ {
+ if (!transl->item->fixed &&
+ transl->item->fix_fields(thd, table_list, &transl->item))
+ DBUG_RETURN(1);
+ }
+ DBUG_RETURN(0);
+ }
+ List_iterator_fast<Item> it(sel->item_list);
+ if (!(transl=
+ (Field_translator*)(thd->current_arena->
+ alloc(sel->item_list.elements *
+ sizeof(Field_translator)))))
+ {
+ DBUG_RETURN(1);
+ }
+ while ((item= it++))
+ {
+ char *name= item->name;
+ transl[i].item= item;
+ if (!item->fixed && item->fix_fields(thd, table_list, &transl[i].item))
+ DBUG_RETURN(1);
+ transl[i++].name= name;
+ }
+ table_list->field_translation= transl;
+ }
+
DBUG_RETURN(0);
}
@@ -3234,8 +3273,7 @@ int make_schema_select(THD *thd, SELECT_LEX *sel,
information_schema_name.length, 0);
make_lex_string(thd, &table, schema_table->table_name,
strlen(schema_table->table_name), 0);
- if (!sel->item_list.elements && /* Handle old syntax */
- schema_table->old_format(thd, schema_table) ||
+ if (schema_table->old_format(thd, schema_table) || /* Handle old syntax */
!sel->add_table_to_list(thd, new Table_ident(thd, db, table, 0),
0, 0, TL_READ, (List<String> *) 0,
(List<String> *) 0))
diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy
index 2ec49a76f45..1402a85229b 100644
--- a/sql/sql_yacc.yy
+++ b/sql/sql_yacc.yy
@@ -5880,6 +5880,9 @@ show: SHOW
{
LEX *lex=Lex;
lex->wild=0;
+ lex->lock_option= TL_READ;
+ mysql_init_select(lex);
+ lex->current_select->parsing_place= SELECT_LIST;
bzero((char*) &lex->create_info,sizeof(lex->create_info));
}
show_param
@@ -5887,7 +5890,7 @@ show: SHOW
;
show_param:
- DATABASES ext_select_item_list wild_and_where
+ DATABASES wild_and_where
{
LEX *lex= Lex;
lex->sql_command= SQLCOM_SELECT;
@@ -5895,44 +5898,44 @@ show_param:
if (prepare_schema_table(YYTHD, lex, 0, SCH_SCHEMATA))
YYABORT;
}
- | opt_full TABLES ext_select_item_list opt_db wild_and_where
+ | opt_full TABLES opt_db wild_and_where
{
LEX *lex= Lex;
lex->sql_command= SQLCOM_SELECT;
lex->orig_sql_command= SQLCOM_SHOW_TABLES;
- lex->select_lex.db= $4;
+ lex->select_lex.db= $3;
if (prepare_schema_table(YYTHD, lex, 0, SCH_TABLE_NAMES))
YYABORT;
}
- | TABLE_SYM STATUS_SYM ext_select_item_list opt_db wild_and_where
+ | TABLE_SYM STATUS_SYM opt_db wild_and_where
{
LEX *lex= Lex;
lex->sql_command= SQLCOM_SELECT;
lex->orig_sql_command= SQLCOM_SHOW_TABLE_STATUS;
- lex->select_lex.db= $4;
+ lex->select_lex.db= $3;
if (prepare_schema_table(YYTHD, lex, 0, SCH_TABLES))
YYABORT;
}
- | OPEN_SYM TABLES ext_select_item_list opt_db wild_and_where
+ | OPEN_SYM TABLES opt_db wild_and_where
{
LEX *lex= Lex;
lex->sql_command= SQLCOM_SELECT;
lex->orig_sql_command= SQLCOM_SHOW_OPEN_TABLES;
- lex->select_lex.db= $4;
+ lex->select_lex.db= $3;
if (prepare_schema_table(YYTHD, lex, 0, SCH_OPEN_TABLES))
YYABORT;
}
| ENGINE_SYM storage_engines
{ Lex->create_info.db_type= $2; }
show_engine_param
- | opt_full COLUMNS ext_select_item_list from_or_in table_ident opt_db wild_and_where
+ | opt_full COLUMNS from_or_in table_ident opt_db wild_and_where
{
LEX *lex= Lex;
lex->sql_command= SQLCOM_SELECT;
lex->orig_sql_command= SQLCOM_SHOW_FIELDS;
- if ($6)
- $5->change_db($6);
- if (prepare_schema_table(YYTHD, lex, $5, SCH_COLUMNS))
+ if ($5)
+ $4->change_db($5);
+ if (prepare_schema_table(YYTHD, lex, $4, SCH_COLUMNS))
YYABORT;
}
| NEW_SYM MASTER_SYM FOR_SYM SLAVE WITH MASTER_LOG_FILE_SYM EQ
@@ -5958,14 +5961,14 @@ show_param:
LEX *lex= Lex;
lex->sql_command= SQLCOM_SHOW_BINLOG_EVENTS;
} opt_limit_clause_init
- | keys_or_index ext_select_item_list from_or_in table_ident opt_db where_clause
+ | keys_or_index from_or_in table_ident opt_db where_clause
{
LEX *lex= Lex;
lex->sql_command= SQLCOM_SELECT;
lex->orig_sql_command= SQLCOM_SHOW_KEYS;
- if ($5)
- $4->change_db($5);
- if (prepare_schema_table(YYTHD, lex, $4, SCH_STATISTICS))
+ if ($4)
+ $3->change_db($4);
+ if (prepare_schema_table(YYTHD, lex, $3, SCH_STATISTICS))
YYABORT;
}
| COLUMN_SYM TYPES_SYM
@@ -5997,7 +6000,7 @@ show_param:
{ Lex->sql_command = SQLCOM_SHOW_WARNS;}
| ERRORS opt_limit_clause_init
{ Lex->sql_command = SQLCOM_SHOW_ERRORS;}
- | opt_var_type STATUS_SYM ext_select_item_list wild_and_where
+ | opt_var_type STATUS_SYM wild_and_where
{
LEX *lex= Lex;
lex->sql_command= SQLCOM_SELECT;
@@ -6012,7 +6015,7 @@ show_param:
{ Lex->sql_command = SQLCOM_SHOW_MUTEX_STATUS; }
| opt_full PROCESSLIST_SYM
{ Lex->sql_command= SQLCOM_SHOW_PROCESSLIST;}
- | opt_var_type VARIABLES ext_select_item_list wild_and_where
+ | opt_var_type VARIABLES wild_and_where
{
LEX *lex= Lex;
lex->sql_command= SQLCOM_SELECT;
@@ -6021,7 +6024,7 @@ show_param:
if (prepare_schema_table(YYTHD, lex, 0, SCH_VARIABLES))
YYABORT;
}
- | charset ext_select_item_list wild_and_where
+ | charset wild_and_where
{
LEX *lex= Lex;
lex->sql_command= SQLCOM_SELECT;
@@ -6029,7 +6032,7 @@ show_param:
if (prepare_schema_table(YYTHD, lex, 0, SCH_CHARSETS))
YYABORT;
}
- | COLLATION_SYM ext_select_item_list wild_and_where
+ | COLLATION_SYM wild_and_where
{
LEX *lex= Lex;
lex->sql_command= SQLCOM_SELECT;
@@ -6115,7 +6118,7 @@ show_param:
lex->sql_command = SQLCOM_SHOW_CREATE_FUNC;
lex->spname= $3;
}
- | PROCEDURE STATUS_SYM ext_select_item_list wild_and_where
+ | PROCEDURE STATUS_SYM wild_and_where
{
LEX *lex= Lex;
lex->sql_command= SQLCOM_SELECT;
@@ -6123,7 +6126,7 @@ show_param:
if (prepare_schema_table(YYTHD, lex, 0, SCH_PROCEDURES))
YYABORT;
}
- | FUNCTION_SYM STATUS_SYM ext_select_item_list wild_and_where
+ | FUNCTION_SYM STATUS_SYM wild_and_where
{
LEX *lex= Lex;
lex->sql_command= SQLCOM_SELECT;
@@ -6197,20 +6200,6 @@ wild_and_where:
}
;
-ext_select_item_list:
- {
- LEX *lex=Lex;
- SELECT_LEX *sel= lex->current_select;
- lex->lock_option= TL_READ;
- mysql_init_select(lex);
- lex->current_select->parsing_place= SELECT_LIST;
- }
- ext_select_item_list2;
-
-ext_select_item_list2:
- /* empty */ {}
- | select_item_list {};
-
/* A Oracle compatible synonym for show */
describe:
diff --git a/sql/table.h b/sql/table.h
index 8dcd4e658db..5ab1f900195 100644
--- a/sql/table.h
+++ b/sql/table.h
@@ -360,6 +360,7 @@ typedef struct st_table_list
st_select_lex_unit *derived; /* SELECT_LEX_UNIT of derived table */
ST_SCHEMA_TABLE *schema_table; /* Information_schema table */
st_select_lex *schema_select_lex;
+ bool schema_table_reformed;
/* link to select_lex where this table was used */
st_select_lex *select_lex;
st_lex *view; /* link on VIEW lex for merging */