1
0
mirror of https://github.com/MariaDB/server.git synced 2026-01-06 05:22:24 +03:00

Additional fix for WL#1629: SHOW with WHERE(discussed with PeterG)

- Do not allow a column list as part of SHOW WITH WHERE task.
 - The WHERE clause must accept field names which are
   valid in SHOW, not INFORMATION_SCHEMA names.
This commit is contained in:
gluh@gluh.mysql.r18.ru
2005-01-24 18:44:54 +03:00
parent 0a59f6aad0
commit e492c1b44e
7 changed files with 115 additions and 133 deletions

View File

@@ -2115,15 +2115,23 @@ 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))
{
#ifndef NO_EMBEDDED_ACCESS_CHECKS
if (check_grants_view &&
if (check_grants_view && !table_list->schema_table_reformed &&
check_grant_column(thd, &table_list->grant,
table_list->view_db.str,
table_list->view_name.str,