Below is the list of changes that have just been committed into a local
5.1 repository of svoj. When svoj does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet@stripped, 2007-12-07 17:40:42+04:00, svoj@stripped +4 -0
BUG#25677 - With --skip-symbolic-links option on, DATA DIRECTORY
clause is silently ignored
When symbolic links are disabled by command line option or
NO_DIR_IN_CREATE sql mode, CREATE TABLE silently ignores
DATA/INDEX DIRECTORY options.
With this fix a warning is issued when symbolic links are disabled.
mysql-test/r/symlink.result@stripped, 2007-12-07 17:40:39+04:00, svoj@stripped +8 -0
A test case for BUG#25677.
mysql-test/t/symlink.test@stripped, 2007-12-07 17:40:39+04:00, svoj@stripped +12 -0
A test case for BUG#25677.
sql/sql_parse.cc@stripped, 2007-12-07 17:40:40+04:00, svoj@stripped +1 -9
Moved handling of situation when mysqld is compiled without
HAVE_READLINK to mysql_create_table_no_lock().
sql/sql_table.cc@stripped, 2007-12-07 17:40:40+04:00, svoj@stripped +11 -1
Issue a warning in case DATA/INDEX DIRECTORY is specified and:
- server is compiled without HAVE_READLINK;
- using symbolic links is disabled by command line option;
- using symbolic links is disabled by NO_DIR_IN_CREATE sql mode.
diff -Nrup a/mysql-test/r/symlink.result b/mysql-test/r/symlink.result
--- a/mysql-test/r/symlink.result 2007-11-12 21:55:50 +04:00
+++ b/mysql-test/r/symlink.result 2007-12-07 17:40:39 +04:00
@@ -162,3 +162,11 @@ DROP DATABASE db1;
DROP DATABASE db2;
USE test;
End of 5.0 tests
+SET @OLD_SQL_MODE=@@SQL_MODE, @@SQL_MODE='NO_DIR_IN_CREATE';
+CREATE TABLE t1(a INT) DATA DIRECTORY='MYSQLTEST_VARDIR/tmp' INDEX DIRECTORY='MYSQLTEST_VARDIR/tmp';
+Warnings:
+Warning 0 DATA DIRECTORY option ignored
+Warning 0 INDEX DIRECTORY option ignored
+DROP TABLE t1;
+SET @@SQL_MODE=@OLD_SQL_MODE;
+End of 5.1 tests
diff -Nrup a/mysql-test/t/symlink.test b/mysql-test/t/symlink.test
--- a/mysql-test/t/symlink.test 2007-11-12 21:55:50 +04:00
+++ b/mysql-test/t/symlink.test 2007-12-07 17:40:39 +04:00
@@ -226,3 +226,15 @@ USE test;
--echo End of 5.0 tests
+
+#
+# BUG#25677 - With --skip-symbolic-links option on, DATA DIRECTORY clause is
+# silently ignored
+#
+SET @OLD_SQL_MODE=@@SQL_MODE, @@SQL_MODE='NO_DIR_IN_CREATE';
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+eval CREATE TABLE t1(a INT) DATA DIRECTORY='$MYSQLTEST_VARDIR/tmp' INDEX DIRECTORY='$MYSQLTEST_VARDIR/tmp';
+DROP TABLE t1;
+SET @@SQL_MODE=@OLD_SQL_MODE;
+
+--echo End of 5.1 tests
diff -Nrup a/sql/sql_parse.cc b/sql/sql_parse.cc
--- a/sql/sql_parse.cc 2007-11-27 22:20:08 +04:00
+++ b/sql/sql_parse.cc 2007-12-07 17:40:40 +04:00
@@ -2237,15 +2237,7 @@ mysql_execute_command(THD *thd)
/* Might have been updated in create_table_precheck */
create_info.alias= create_table->alias;
-#ifndef HAVE_READLINK
- if (create_info.data_file_name)
- push_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN, 0,
- "DATA DIRECTORY option ignored");
- if (create_info.index_file_name)
- push_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN, 0,
- "INDEX DIRECTORY option ignored");
- create_info.data_file_name= create_info.index_file_name= NULL;
-#else
+#ifdef HAVE_READLINK
/* Fix names if symlinked tables */
if (append_file_to_dir(thd, &create_info.data_file_name,
create_table->table_name) ||
diff -Nrup a/sql/sql_table.cc b/sql/sql_table.cc
--- a/sql/sql_table.cc 2007-11-27 22:20:09 +04:00
+++ b/sql/sql_table.cc 2007-12-07 17:40:40 +04:00
@@ -3437,8 +3437,18 @@ bool mysql_create_table_no_lock(THD *thd
thd->proc_info="creating table";
create_info->table_existed= 0; // Mark that table is created
- if (thd->variables.sql_mode & MODE_NO_DIR_IN_CREATE)
+#ifdef HAVE_READLINK
+ if (!my_use_symdir || (thd->variables.sql_mode & MODE_NO_DIR_IN_CREATE))
+#endif
+ {
+ if (create_info->data_file_name)
+ push_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN, 0,
+ "DATA DIRECTORY option ignored");
+ if (create_info->index_file_name)
+ push_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN, 0,
+ "INDEX DIRECTORY option ignored");
create_info->data_file_name= create_info->index_file_name= 0;
+ }
create_info->table_options=db_options;
path[path_length - reg_ext_length]= '\0'; // Remove .frm extension