Fix for bug#13202 SELECT * INTO OUTFILE ... FROM information_schema.schemata now fails

  allow select into outfile from I_S tables
  it is enough to add FILE_ACL for I_S tables only to 'check_table_access' function
  as we use 'any_db' for 'check_access' function in places where FILE_ACL is required
parent 140dea14
......@@ -65,3 +65,21 @@ EXPLAIN
DROP TABLE t1;
# End of 4.1 tests
#
# Bug#13202 SELECT * INTO OUTFILE ... FROM information_schema.schemata now fails
#
disable_query_log;
eval SELECT * INTO OUTFILE "$MYSQL_TEST_DIR/var/tmp/outfile-test.4"
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
FROM information_schema.schemata LIMIT 0, 5;
# enable_query_log;
--exec rm $MYSQL_TEST_DIR/var/tmp/outfile-test.4
use information_schema;
# disable_query_log;
eval SELECT * INTO OUTFILE "$MYSQL_TEST_DIR/var/tmp/outfile-test.4"
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
FROM schemata LIMIT 0, 5;
enable_query_log;
--exec rm $MYSQL_TEST_DIR/var/tmp/outfile-test.4
......@@ -5002,7 +5002,7 @@ check_table_access(THD *thd, ulong want_access,TABLE_LIST *tables,
for (; tables; tables= tables->next_global)
{
if (tables->schema_table &&
(want_access & ~(SELECT_ACL | EXTRA_ACL)))
(want_access & ~(SELECT_ACL | EXTRA_ACL | FILE_ACL)))
{
if (!no_errors)
my_error(ER_DBACCESS_DENIED_ERROR, MYF(0),
......
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