summaryrefslogtreecommitdiff
path: root/mysql-test/t/symlink.test
diff options
context:
space:
mode:
authorDyre Tjeldvoll <Dyre.Tjeldvoll@oracle.com>2017-02-22 20:12:25 +0100
committerDyre Tjeldvoll <Dyre.Tjeldvoll@oracle.com>2017-02-23 14:48:25 +0100
commit7849a27cfb1f175888878704d8f6708a23714538 (patch)
tree02bdc32608f0f600e48ea04bd8075a0a4d770438 /mysql-test/t/symlink.test
parentb21a0212e41f876cbc9714ceaa7c7154cfcad69e (diff)
downloadmariadb-git-7849a27cfb1f175888878704d8f6708a23714538.tar.gz
Bug#25514146: DB_NAME IS IGNORED WHEN CREATING TABLE WITH DATA DIRECTORY
Problem: CREATE TABLE using a fully qualified name with INDEX DIR/DATA DIR option reports an error when the current database is not SET. check_access() was incorrectly called with NULL as the database argument in a situation where the database name was not needed for the particular privilege being checked. This will cause the current database to be used, or an error to be reported if there is no current database. Fix: Call check_access() with any_db as the database argument in this situation.
Diffstat (limited to 'mysql-test/t/symlink.test')
-rw-r--r--mysql-test/t/symlink.test16
1 files changed, 16 insertions, 0 deletions
diff --git a/mysql-test/t/symlink.test b/mysql-test/t/symlink.test
index 5109137e564..5916d04875b 100644
--- a/mysql-test/t/symlink.test
+++ b/mysql-test/t/symlink.test
@@ -298,3 +298,19 @@ show create table t1;
create table t2 like t1;
show create table t2;
drop tables t1, t2;
+
+--echo #
+--echo # Test for bug #25514146 DB_NAME IS IGNORED WHEN CREATING TABLE
+--echo # WITH DATA DIRECTORY
+--echo #
+
+--echo # Make sure we have no current database
+CREATE DATABASE x;
+USE x;
+DROP DATABASE x;
+
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+eval CREATE TABLE test.t1(id INT(11)) ENGINE MYISAM
+DATA DIRECTORY "$MYSQLTEST_VARDIR/tmp";
+
+DROP TABLE test.t1;