Loading mysql-test/r/ps_1general.result +12 −0 Original line number Diff line number Diff line Loading @@ -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 Loading mysql-test/t/ps_1general.test +8 −0 Original line number Diff line number Diff line Loading @@ -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); Loading sql/sql_base.cc +11 −1 Original line number Diff line number Diff line Loading @@ -2135,8 +2135,18 @@ find_field_in_table(THD *thd, TABLE_LIST *table_list, { 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 && !table_list->schema_table_reformed && if (check_grants_view && check_grant_column(thd, &table_list->grant, table_list->view_db.str, table_list->view_name.str, Loading sql/sql_show.cc +0 −14 Original line number Diff line number Diff line Loading @@ -3207,22 +3207,10 @@ int mysql_schema_table(THD *thd, LEX *lex, TABLE_LIST *table_list) { if (!transl->item->fixed && transl->item->fix_fields(thd, table_list, &transl->item)) { DBUG_RETURN(1); } } if (sel->where && !sel->where->fixed && sel->where->fix_fields(thd, table_list, &sel->where)) { DBUG_RETURN(1); } for (transl= table_list->field_translation; transl < end; transl++) { transl->item->rename((char *)transl->name); } DBUG_RETURN(0); } List_iterator_fast<Item> it(sel->item_list); if (!(transl= (Field_translator*)(thd->current_arena-> Loading @@ -3236,9 +3224,7 @@ int mysql_schema_table(THD *thd, LEX *lex, TABLE_LIST *table_list) 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; Loading Loading
mysql-test/r/ps_1general.result +12 −0 Original line number Diff line number Diff line Loading @@ -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 Loading
mysql-test/t/ps_1general.test +8 −0 Original line number Diff line number Diff line Loading @@ -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); Loading
sql/sql_base.cc +11 −1 Original line number Diff line number Diff line Loading @@ -2135,8 +2135,18 @@ find_field_in_table(THD *thd, TABLE_LIST *table_list, { 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 && !table_list->schema_table_reformed && if (check_grants_view && check_grant_column(thd, &table_list->grant, table_list->view_db.str, table_list->view_name.str, Loading
sql/sql_show.cc +0 −14 Original line number Diff line number Diff line Loading @@ -3207,22 +3207,10 @@ int mysql_schema_table(THD *thd, LEX *lex, TABLE_LIST *table_list) { if (!transl->item->fixed && transl->item->fix_fields(thd, table_list, &transl->item)) { DBUG_RETURN(1); } } if (sel->where && !sel->where->fixed && sel->where->fix_fields(thd, table_list, &sel->where)) { DBUG_RETURN(1); } for (transl= table_list->field_translation; transl < end; transl++) { transl->item->rename((char *)transl->name); } DBUG_RETURN(0); } List_iterator_fast<Item> it(sel->item_list); if (!(transl= (Field_translator*)(thd->current_arena-> Loading @@ -3236,9 +3224,7 @@ int mysql_schema_table(THD *thd, LEX *lex, TABLE_LIST *table_list) 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; Loading