List:Commits« Previous MessageNext Message »
From:Magne Mahre Date:November 25 2008 11:40am
Subject:bzr commit into mysql-6.0-runtime branch (magne.mahre:2753) Bug#36897
View as plain text  
#At file:///export/home/tmp/z/mysql-6.0-runtime-fix36897/ based on revid:staale.smedseng@stripped

 2753 Magne Mahre	2008-11-25
      Bug #36897  	Falcon: "use tablespace" is possible
      
      The problem is that the code only checks for the
      existence of the target filename when entering a
      database. Added a check to verify that the target is 
      indeed a directory, and not a tablespace file.
modified:
  sql/sql_db.cc

=== modified file 'sql/sql_db.cc'

=== modified file 'sql/sql_db.cc'
--- a/sql/sql_db.cc	2008-09-30 13:31:41 +0000
+++ b/sql/sql_db.cc	2008-11-25 11:39:58 +0000
@@ -2001,6 +2001,7 @@
 {
   char db_dir_path[FN_REFLEN];
   uint db_dir_path_len;
+  MY_STAT my_stat_result;
 
   db_dir_path_len= build_table_filename(db_dir_path, sizeof(db_dir_path),
                                         db_name, "", "", 0);
@@ -2008,6 +2009,15 @@
   if (db_dir_path_len && db_dir_path[db_dir_path_len - 1] == FN_LIBCHAR)
     db_dir_path[db_dir_path_len - 1]= 0;
 
+  /* Verify that db_name is a directory */
+
+  if (! my_stat(db_dir_path, &my_stat_result, MYF(0)))
+    return TRUE;
+
+  if (! MY_S_ISDIR(my_stat_result.st_mode))
+    return TRUE;
+
+
   /* Check access. */
 
   return my_access(db_dir_path, F_OK);

Thread
bzr commit into mysql-6.0-runtime branch (magne.mahre:2753) Bug#36897Magne Mahre25 Nov