Commit 8a28428c authored by monty@mashka.mysql.fi's avatar monty@mashka.mysql.fi

Better grant test for SELECT *

parent 71ce598f
...@@ -1877,14 +1877,14 @@ insert_fields(THD *thd,TABLE_LIST *tables, const char *db_name, ...@@ -1877,14 +1877,14 @@ insert_fields(THD *thd,TABLE_LIST *tables, const char *db_name,
for (; tables ; tables=tables->next) for (; tables ; tables=tables->next)
{ {
TABLE *table=tables->table; TABLE *table=tables->table;
if (grant_option && !(table->grant.privilege &
table->grant.want_privilege) &&
check_grant_all_columns(thd,SELECT_ACL,table))
DBUG_RETURN(-1);
if (!table_name || (!strcmp(table_name,tables->alias) && if (!table_name || (!strcmp(table_name,tables->alias) &&
(!db_name || !tables->db || (!db_name || !tables->db ||
!strcmp(tables->db,db_name)))) !strcmp(tables->db,db_name))))
{ {
if (!(table->grant.privilege & SELECT_ACL) &&
check_grant_all_columns(thd,SELECT_ACL,table))
DBUG_RETURN(-1);
Field **ptr=table->field,*field; Field **ptr=table->field,*field;
thd->used_tables|=table->map; thd->used_tables|=table->map;
while ((field = *ptr++)) while ((field = *ptr++))
......
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