Skip to content

Commit 702898f

Browse files
Dyre TjeldvollDyre Tjeldvoll
Dyre Tjeldvoll
authored and
Dyre Tjeldvoll
committed
Merge branch 'mysql-5.6' into mysql-5.7
2 parents 221e1ce + 796983d commit 702898f

File tree

3 files changed

+30
-3
lines changed

3 files changed

+30
-3
lines changed

mysql-test/r/symlink.result

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,3 +217,14 @@ t2 CREATE TABLE `t2` (
217217
PRIMARY KEY (`a`)
218218
) ENGINE=MyISAM DEFAULT CHARSET=latin1
219219
drop tables t1, t2;
220+
#
221+
# Test for bug #25514146 DB_NAME IS IGNORED WHEN CREATING TABLE
222+
# WITH DATA DIRECTORY
223+
#
224+
# Make sure we have no current database
225+
CREATE DATABASE x;
226+
USE x;
227+
DROP DATABASE x;
228+
CREATE TABLE test.t1(id INT(11)) ENGINE MYISAM
229+
DATA DIRECTORY "MYSQLTEST_VARDIR/tmp";
230+
DROP TABLE test.t1;

mysql-test/t/symlink.test

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -299,3 +299,19 @@ show create table t1;
299299
create table t2 like t1;
300300
show create table t2;
301301
drop tables t1, t2;
302+
303+
--echo #
304+
--echo # Test for bug #25514146 DB_NAME IS IGNORED WHEN CREATING TABLE
305+
--echo # WITH DATA DIRECTORY
306+
--echo #
307+
308+
--echo # Make sure we have no current database
309+
CREATE DATABASE x;
310+
USE x;
311+
DROP DATABASE x;
312+
313+
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
314+
eval CREATE TABLE test.t1(id INT(11)) ENGINE MYISAM
315+
DATA DIRECTORY "$MYSQLTEST_VARDIR/tmp";
316+
317+
DROP TABLE test.t1;

sql/sql_parse.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
1+
/* Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
22
33
This program is free software; you can redistribute it and/or modify
44
it under the terms of the GNU General Public License as published by
@@ -3010,7 +3010,7 @@ case SQLCOM_PREPARE:
30103010

30113011
if (((lex->create_info.used_fields & HA_CREATE_USED_DATADIR) != 0 ||
30123012
(lex->create_info.used_fields & HA_CREATE_USED_INDEXDIR) != 0) &&
3013-
check_access(thd, FILE_ACL, NULL, NULL, NULL, FALSE, FALSE))
3013+
check_access(thd, FILE_ACL, any_db, NULL, NULL, FALSE, FALSE))
30143014
{
30153015
res= 1;
30163016
my_error(ER_SPECIFIC_ACCESS_DENIED_ERROR, MYF(0), "FILE");
@@ -3076,7 +3076,7 @@ case SQLCOM_PREPARE:
30763076
{
30773077
partition_info *part_info= thd->lex->part_info;
30783078
if (part_info != NULL && has_external_data_or_index_dir(*part_info) &&
3079-
check_access(thd, FILE_ACL, NULL, NULL, NULL, FALSE, FALSE))
3079+
check_access(thd, FILE_ACL, any_db, NULL, NULL, FALSE, FALSE))
30803080
{
30813081
res= -1;
30823082
goto end_with_restore_list;

0 commit comments

Comments
 (0)