diff options
author | unknown <monty@mysql.com> | 2003-11-21 14:41:57 +0200 |
---|---|---|
committer | unknown <monty@mysql.com> | 2003-11-21 14:41:57 +0200 |
commit | 52521cc8c76f99d2046a72a09440e616797e672a (patch) | |
tree | 1dae851e03d54c7a8de1e73a27a50426cef61563 /sql/sql_db.cc | |
parent | eaae71470800fd12db6f4c0583a70e6f6eb722ae (diff) | |
download | mariadb-git-52521cc8c76f99d2046a72a09440e616797e672a.tar.gz |
Fixed memory leak with RAID tables
Fixed tests for RAID tables
Detect uninitialized mutexes on lock and destroy
mysql-test/r/raid.result:
Updated results
mysql-test/r/rpl_change_master.result:
Update results missing from last patch
mysql-test/t/raid.test:
Clean up test
mysys/mf_iocache.c:
Comments
Small safety fix
mysys/thr_mutex.c:
Detect uninitialized mutexes on lock and destroy
sql/sql_db.cc:
Fixed memory leak with RAID tables
Diffstat (limited to 'sql/sql_db.cc')
-rw-r--r-- | sql/sql_db.cc | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/sql/sql_db.cc b/sql/sql_db.cc index 5481b1b266f..c61e6800cfa 100644 --- a/sql/sql_db.cc +++ b/sql/sql_db.cc @@ -440,7 +440,6 @@ static long mysql_rm_known_files(THD *thd, MY_DIR *dirp, const char *db, 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)); @@ -516,17 +515,24 @@ static long mysql_rm_known_files(THD *thd, MY_DIR *dirp, const char *db, deleted++; } } + List_iterator<String> it(raid_dirs); + String *dir; + if (thd->killed || (tot_list && mysql_rm_table_part2_with_lock(thd, tot_list, 1, 0, 1))) { + /* Free memory for allocated raid dirs */ + while ((dir= it++)) + delete dir; 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++; + delete dir; + } my_dirend(dirp); /* |