summaryrefslogtreecommitdiff
path: root/sql/sql_parse.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/sql_parse.cc')
-rw-r--r--sql/sql_parse.cc18
1 files changed, 9 insertions, 9 deletions
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index ae5a6b4cd35..515990c879f 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -2206,15 +2206,15 @@ mysql_execute_command(THD *thd)
lex->exchange != NULL implies SELECT .. INTO OUTFILE and this
requires FILE_ACL access.
*/
- ulong privileges_requested= lex->exchange ? SELECT_ACL | FILE_ACL :
- SELECT_ACL;
-
- if (all_tables)
- res= check_table_access(thd,
- privileges_requested,
- all_tables, FALSE, UINT_MAX, FALSE);
- else
- res= check_access(thd, privileges_requested, any_db, NULL, NULL, 0, 0);
+ if (lex->exchange)
+ res= check_access(thd, FILE_ACL, any_db, NULL, NULL, 0, 0);
+ if (!res)
+ {
+ if (all_tables)
+ res= check_table_access(thd, SELECT_ACL, all_tables, FALSE, UINT_MAX, FALSE);
+ else
+ res= check_access(thd, SELECT_ACL, any_db, NULL, NULL, 0, 0);
+ }
if (res)
break;