diff options
author | gluh@gluh.mysql.r18.ru <> | 2005-01-24 18:44:54 +0300 |
---|---|---|
committer | gluh@gluh.mysql.r18.ru <> | 2005-01-24 18:44:54 +0300 |
commit | e492c1b44e700189d1bf4e0e60c8600cf0548dd4 (patch) | |
tree | a755eede073a2582d229609db8bb9a1ab32d8860 /sql/sql_base.cc | |
parent | 0a59f6aad012a1fd95fca7f7bc007ce0e1a83b62 (diff) | |
download | mariadb-git-e492c1b44e700189d1bf4e0e60c8600cf0548dd4.tar.gz |
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.
Diffstat (limited to 'sql/sql_base.cc')
-rw-r--r-- | sql/sql_base.cc | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/sql/sql_base.cc b/sql/sql_base.cc index fc41643e8d4..709083b3dec 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -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, |