diff options
author | unknown <guilhem@gbichot3.local> | 2006-11-22 23:38:10 +0100 |
---|---|---|
committer | unknown <guilhem@gbichot3.local> | 2006-11-22 23:38:10 +0100 |
commit | adfba203ffd1bd89d74a63ff09de9b9a40fb64d7 (patch) | |
tree | d5d39cc2b29dd80e4a72a2396c69060fd658d4ce /sql/unireg.cc | |
parent | 331952660c7ab170cb55320aa97e0e04dfd29470 (diff) | |
download | mariadb-git-adfba203ffd1bd89d74a63ff09de9b9a40fb64d7.tar.gz |
Maria - post-review fixes about my_sync_dir():
make it return an error (except if certain errno), test this error in
callers. Do a single my_sync_dir() in my_rename() if possible.
include/my_global.h:
better have a symbol name talking about the feature, use it in the
code of the feature, and define the symbol once depending on the
platform, rather than have the platform "tested" in the code
of the feature several times.
include/my_sys.h:
my_sync_dir() now can return error
mysys/my_create.c:
my_sync_dir() can now return an error
mysys/my_delete.c:
my_sync_dir() can now return an error
mysys/my_rename.c:
my_sync_dir() can now return an error.
Do a single sync if "from" and "to" are the same directory.
#ifdef here to not even compile dirname_part() if useless.
mysys/my_sync.c:
more comments.
A compilation error if no way to make my_sync() work (I guess
we don't want to ship a binary which cannot do any sync at all;
users of strange OSes compile from source and can remove
the #error).
my_sync_dir() now returns an error (except for certain errno values
considered ok; EIO "input/output error" is not ok).
sql/unireg.cc:
my_sync_dir() now returns an error which must be tested
Diffstat (limited to 'sql/unireg.cc')
-rw-r--r-- | sql/unireg.cc | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/sql/unireg.cc b/sql/unireg.cc index 5c2997c1483..b1d0e75723e 100644 --- a/sql/unireg.cc +++ b/sql/unireg.cc @@ -285,12 +285,11 @@ bool mysql_create_frm(THD *thd, const char *file_name, my_free((gptr) screen_buff,MYF(0)); my_free((gptr) keybuff, MYF(0)); - if (opt_sync_frm && !(create_info->options & HA_LEX_CREATE_TMP_TABLE)) - { - if (my_sync(file, MYF(MY_WME))) + if (opt_sync_frm && !(create_info->options & HA_LEX_CREATE_TMP_TABLE) && + (my_sync(file, MYF(MY_WME)) || + my_sync_dir_by_file(file_name, MYF(MY_WME)))) goto err2; - my_sync_dir_by_file(file_name, MYF(0)); - } + if (my_close(file,MYF(MY_WME))) goto err3; |