summaryrefslogtreecommitdiff
path: root/mysys
diff options
context:
space:
mode:
authorSatya B <satya.bn@sun.com>2009-09-03 16:02:03 +0530
committerSatya B <satya.bn@sun.com>2009-09-03 16:02:03 +0530
commit4a9e7e8e25192fda25a71bbb4d7f9b5b6088e0c6 (patch)
treebc7f9709d4619c3b3db77c9ad3c177844a34ce4b /mysys
parentdb8471aa857e911bd7f20b5c67161cd3274f6974 (diff)
downloadmariadb-git-4a9e7e8e25192fda25a71bbb4d7f9b5b6088e0c6.tar.gz
Fix for BUG#46591 - .frm file isn't sync'd with sync_frm enabled for
CREATE TABLE...LIKE... The mysql server option 'sync_frm' is ignored when table is created with syntax CREATE TABLE .. LIKE.. Fixed by adding the MY_SYNC flag and calling my_sync() from my_copy() when the flag is set. In mysql_create_table(), when the 'sync_frm' is set, MY_SYNC flag is passed to my_copy(). Note: TestCase is not attached and can be tested manually using debugger.
Diffstat (limited to 'mysys')
-rw-r--r--mysys/my_copy.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/mysys/my_copy.c b/mysys/my_copy.c
index b6bb925e898..f44a497fbc8 100644
--- a/mysys/my_copy.c
+++ b/mysys/my_copy.c
@@ -87,6 +87,13 @@ int my_copy(const char *from, const char *to, myf MyFlags)
my_write(to_file,buff,Count,MYF(MyFlags | MY_NABP)))
goto err;
+ /* sync the destination file */
+ if (MyFlags & MY_SYNC)
+ {
+ if (my_sync(to_file, MyFlags))
+ goto err;
+ }
+
if (my_close(from_file,MyFlags) | my_close(to_file,MyFlags))
DBUG_RETURN(-1); /* Error on close */