summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mysql-test/r/raid.result3
-rw-r--r--mysql-test/t/raid.test3
-rw-r--r--sql/mysqld.cc6
-rw-r--r--sql/set_var.cc2
-rw-r--r--sql/sql_db.cc21
5 files changed, 27 insertions, 8 deletions
diff --git a/mysql-test/r/raid.result b/mysql-test/r/raid.result
index 41af50851e9..fd47a9451f6 100644
--- a/mysql-test/r/raid.result
+++ b/mysql-test/r/raid.result
@@ -1,3 +1,6 @@
+create database test_raid;
+create table test_raid.r1 (i int) raid_type=1;
+drop database test_raid;
DROP TABLE IF EXISTS t1,t2;
CREATE TABLE t1 (
id int unsigned not null auto_increment primary key,
diff --git a/mysql-test/t/raid.test b/mysql-test/t/raid.test
index 8b608c1069f..4dbaf84a836 100644
--- a/mysql-test/t/raid.test
+++ b/mysql-test/t/raid.test
@@ -5,6 +5,9 @@ show variables like "have_raid";
# Test of raided tables
#
+create database test_raid;
+create table test_raid.r1 (i int) raid_type=1;
+drop database test_raid;
DROP TABLE IF EXISTS t1,t2;
CREATE TABLE t1 (
id int unsigned not null auto_increment primary key,
diff --git a/sql/mysqld.cc b/sql/mysqld.cc
index 731298266dc..0211c471ed7 100644
--- a/sql/mysqld.cc
+++ b/sql/mysqld.cc
@@ -4722,11 +4722,9 @@ static void get_options(int argc,char **argv)
my_disable_locking= myisam_single_user= test(opt_external_locking == 0);
my_default_record_cache_size=global_system_variables.read_buff_size;
myisam_max_temp_length=
- (my_off_t) min(global_system_variables.myisam_max_sort_file_size,
- (ulonglong) MAX_FILE_SIZE);
+ (my_off_t) global_system_variables.myisam_max_sort_file_size;
myisam_max_extra_temp_length=
- (my_off_t) min(global_system_variables.myisam_max_extra_sort_file_size,
- (ulonglong) MAX_FILE_SIZE);
+ (my_off_t) global_system_variables.myisam_max_extra_sort_file_size;
/* Set global variables based on startup options */
myisam_block_size=(uint) 1 << my_bit_log2(opt_myisam_block_size);
diff --git a/sql/set_var.cc b/sql/set_var.cc
index 12ce37c5bc8..a45a923ef90 100644
--- a/sql/set_var.cc
+++ b/sql/set_var.cc
@@ -592,7 +592,7 @@ static void
fix_myisam_max_extra_sort_file_size(THD *thd, enum_var_type type)
{
myisam_max_extra_temp_length=
- (my_off_t) global_system_variables.myisam_max_sort_file_size;
+ (my_off_t) global_system_variables.myisam_max_extra_sort_file_size;
}
diff --git a/sql/sql_db.cc b/sql/sql_db.cc
index 7e58b5d4582..6251b1ec624 100644
--- a/sql/sql_db.cc
+++ b/sql/sql_db.cc
@@ -211,6 +211,8 @@ static long mysql_rm_known_files(THD *thd, MY_DIR *dirp, const char *db,
ulong found_other_files=0;
char filePath[FN_REFLEN];
TABLE_LIST *tot_list=0, **tot_list_next;
+ List<String> raid_dirs;
+
DBUG_ENTER("mysql_rm_known_files");
DBUG_PRINT("enter",("path: %s", org_path));
@@ -229,6 +231,8 @@ static long mysql_rm_known_files(THD *thd, MY_DIR *dirp, const char *db,
{
char newpath[FN_REFLEN];
MY_DIR *new_dirp;
+ String *dir;
+
strxmov(newpath,org_path,"/",file->name,NullS);
unpack_filename(newpath,newpath);
if ((new_dirp = my_dir(newpath,MYF(MY_DONT_SORT))))
@@ -239,7 +243,11 @@ static long mysql_rm_known_files(THD *thd, MY_DIR *dirp, const char *db,
my_dirend(dirp);
DBUG_RETURN(-1);
}
+ raid_dirs.push_back(dir=new String(newpath));
+ dir->copy();
+ continue;
}
+ found_other_files++;
continue;
}
if (find_type(fn_ext(file->name),&deletable_extentions,1+2) <= 0)
@@ -278,12 +286,19 @@ static long mysql_rm_known_files(THD *thd, MY_DIR *dirp, const char *db,
deleted++;
}
}
- my_dirend(dirp);
-
if (thd->killed ||
(tot_list && mysql_rm_table_part2_with_lock(thd, tot_list, 1, 1)))
+ {
+ my_dirend(dirp);
DBUG_RETURN(-1);
-
+ }
+ List_iterator<String> it(raid_dirs);
+ String *dir;
+ while ((dir= it++))
+ if (rmdir(dir->c_ptr()) < 0)
+ found_other_files++;
+ my_dirend(dirp);
+
/*
If the directory is a symbolic link, remove the link first, then
remove the directory the symbolic link pointed at