Skip to content

Commit 796983d

Browse files
Dyre TjeldvollDyre Tjeldvoll
authored andcommitted
Merge branch 'mysql-5.5' into mysql-5.6
2 parents 744ab98 + 7849a27 commit 796983d

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
@@ -213,3 +213,14 @@ t2 CREATE TABLE `t2` (
213213
PRIMARY KEY (`a`)
214214
) ENGINE=MyISAM DEFAULT CHARSET=latin1
215215
drop tables t1, t2;
216+
#
217+
# Test for bug #25514146 DB_NAME IS IGNORED WHEN CREATING TABLE
218+
# WITH DATA DIRECTORY
219+
#
220+
# Make sure we have no current database
221+
CREATE DATABASE x;
222+
USE x;
223+
DROP DATABASE x;
224+
CREATE TABLE test.t1(id INT(11)) ENGINE MYISAM
225+
DATA DIRECTORY "MYSQLTEST_VARDIR/tmp";
226+
DROP TABLE test.t1;

mysql-test/t/symlink.test

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

29082908
if (((lex->create_info.used_fields & HA_CREATE_USED_DATADIR) != 0 ||
29092909
(lex->create_info.used_fields & HA_CREATE_USED_INDEXDIR) != 0) &&
2910-
check_access(thd, FILE_ACL, NULL, NULL, NULL, FALSE, FALSE))
2910+
check_access(thd, FILE_ACL, any_db, NULL, NULL, FALSE, FALSE))
29112911
{
29122912
res= 1;
29132913
my_error(ER_SPECIFIC_ACCESS_DENIED_ERROR, MYF(0), "FILE");
@@ -2952,7 +2952,7 @@ case SQLCOM_PREPARE:
29522952
{
29532953
partition_info *part_info= thd->lex->part_info;
29542954
if (part_info != NULL && has_external_data_or_index_dir(*part_info) &&
2955-
check_access(thd, FILE_ACL, NULL, NULL, NULL, FALSE, FALSE))
2955+
check_access(thd, FILE_ACL, any_db, NULL, NULL, FALSE, FALSE))
29562956
{
29572957
res= -1;
29582958
goto end_with_restore_list;

0 commit comments

Comments
 (0)