diff options
Diffstat (limited to 'sql/sql_acl.cc')
-rw-r--r-- | sql/sql_acl.cc | 27 |
1 files changed, 23 insertions, 4 deletions
diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc index 1b3d8cc914a..12eb7a5d84b 100644 --- a/sql/sql_acl.cc +++ b/sql/sql_acl.cc @@ -2638,10 +2638,11 @@ bool mysql_table_grant(THD *thd, TABLE_LIST *table_list, while ((column = column_iter++)) { uint unused_field_idx= NO_CACHED_FIELD_INDEX; - Field *f=find_field_in_table(thd, table_list, column->column.ptr(), - column->column.ptr(), - column->column.length(), 0, 1, 1, 0, - &unused_field_idx, FALSE); + TABLE_LIST *dummy; + Field *f=find_field_in_table_ref(thd, table_list, column->column.ptr(), + column->column.ptr(), NULL, NULL, + column->column.length(), 0, 1, 1, 0, + &unused_field_idx, FALSE, &dummy); if (f == (Field*)0) { my_error(ER_BAD_FIELD_ERROR, MYF(0), @@ -3695,6 +3696,24 @@ ulong get_table_grant(THD *thd, TABLE_LIST *table) } +/* + Determine the access priviliges for a field. + + SYNOPSIS + get_column_grant() + thd thread handler + grant grants table descriptor + db_name name of database that the field belongs to + table_name name of table that the field belongs to + field_name name of field + + DESCRIPTION + The procedure may also modify: grant->grant_table and grant->version. + + RETURN + The access priviliges for the field db_name.table_name.field_name +*/ + ulong get_column_grant(THD *thd, GRANT_INFO *grant, const char *db_name, const char *table_name, const char *field_name) |