summaryrefslogtreecommitdiff
path: root/sql/unireg.cc
diff options
context:
space:
mode:
authorunknown <monty@mysql.com>2003-11-02 15:55:02 +0200
committerunknown <monty@mysql.com>2003-11-02 15:55:02 +0200
commitc97a38c4d3b2afd4c93771fca61eede965fe71cf (patch)
treecb9bb7181d68f8c4f3d892367e08536d2f609a19 /sql/unireg.cc
parent116cf0102464ce330a758fa3bec2239bfc5872d5 (diff)
downloadmariadb-git-c97a38c4d3b2afd4c93771fca61eede965fe71cf.tar.gz
Call my_sync() after all data is written to .frm file
Added my_sync() to mysys which will do fsync/fdatasync/_commit() on a file. VC++Files/mysys/mysys.dsp: Added my_sync.c configure.in: Added testing of fsync and fdatasync include/my_sys.h: Added my_sync() include/mysys_err.h: Added my_sync() isam/extra.c: Added my_sync() myisam/mi_extra.c: Added my_sync() myisam/mi_locking.c: Added my_sync() mysql-test/mysql-test-run.sh: Added option --valgrind-all mysys/Makefile.am: Added my_sync.c mysys/errors.c: Added my_sync() mysys/my_symlink.c: Removed compiler warning mysys/thr_alarm.c: Fix for link error on windows sql/unireg.cc: Call my_sync() after all data is written to .frm file BitKeeper/etc/logging_ok: Logging to logging@openlogging.org accepted
Diffstat (limited to 'sql/unireg.cc')
-rw-r--r--sql/unireg.cc9
1 files changed, 6 insertions, 3 deletions
diff --git a/sql/unireg.cc b/sql/unireg.cc
index 5183f471fa2..ff42bfae0f0 100644
--- a/sql/unireg.cc
+++ b/sql/unireg.cc
@@ -150,16 +150,19 @@ int rea_create_table(my_string file_name,
my_free((gptr) screen_buff,MYF(0));
my_afree((gptr) keybuff);
- VOID(my_close(file,MYF(MY_WME)));
- if (ha_create_table(file_name,create_info,0))
+ if (my_sync(file, MYF(MY_WME)))
goto err2;
+ if (my_close(file,MYF(MY_WME)) ||
+ ha_create_table(file_name,create_info,0))
+ goto err3;
DBUG_RETURN(0);
err:
my_free((gptr) screen_buff,MYF(0));
my_afree((gptr) keybuff);
+err2:
VOID(my_close(file,MYF(MY_WME)));
- err2:
+err3:
my_delete(file_name,MYF(0));
DBUG_RETURN(1);
} /* rea_create_table */