summaryrefslogtreecommitdiff
path: root/storage/maria/ma_locking.c
diff options
context:
space:
mode:
authorunknown <guilhem@gbichot3.local>2006-11-27 22:01:29 +0100
committerunknown <guilhem@gbichot3.local>2006-11-27 22:01:29 +0100
commitde6f550ec7015fccd044a54c7628cdf8cdc2ed8c (patch)
tree106184cb5d00019bbc3e544912757a1db64b6de8 /storage/maria/ma_locking.c
parentadfba203ffd1bd89d74a63ff09de9b9a40fb64d7 (diff)
downloadmariadb-git-de6f550ec7015fccd044a54c7628cdf8cdc2ed8c.tar.gz
WL#3072 Maria Recovery. Making DDLs durable in Maria:
Sync table files after CREATE (of non-temp table), DROP, RENAME, TRUNCATE, sync directories and symlinks (for the 3 first commands). Comments for future log records. In ma_rename(), if rename of index works and then rename of data fails, try to undo the rename of the index to leave a consistent state. mysys/my_symlink.c: sync directory after creation of a symbolic link in it, if asked mysys/my_sync.c: comment. Fix for when the file's name has no directory in it. storage/maria/ma_create.c: sync files and links and dirs when creating a non-temporary table. Optimizations of the above to reduce syncs in the common cases: * if index file and data file have the exact same paths (regular and link), sync the directories (of regular and link) only once after creating the last file (the data file). * don't sync the data file if we didn't write to it (always true in our builds). storage/maria/ma_delete_all.c: sync files after truncating a table storage/maria/ma_delete_table.c: sync files and symbolic links and dirs after dropping a table storage/maria/ma_extra.c: a function which wraps the sync of the index file and the sync of the data file. storage/maria/ma_locking.c: using a wrapper function storage/maria/ma_rename.c: sync files and symbolic links and dirs after renaming a table. If rename of index works and then rename of data fails, try to undo the rename of the index to leave a consistent state. That is just a try, it may fail... storage/maria/ma_test3.c: warning to not pay attention to this test. storage/maria/maria_def.h: declaration for the function added to ma_extra.c
Diffstat (limited to 'storage/maria/ma_locking.c')
-rw-r--r--storage/maria/ma_locking.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/storage/maria/ma_locking.c b/storage/maria/ma_locking.c
index 5689d57f2a5..848fb7e9682 100644
--- a/storage/maria/ma_locking.c
+++ b/storage/maria/ma_locking.c
@@ -103,9 +103,7 @@ int maria_lock_database(MARIA_HA *info, int lock_type)
share->changed=0;
if (maria_flush)
{
- if (my_sync(share->kfile, MYF(0)))
- error= my_errno;
- if (my_sync(info->dfile, MYF(0)))
+ if (_ma_sync_table_files(info))
error= my_errno;
}
else