#At file:///home/satya/WORK/46591/mysql-5.1-bugtea-46591/ based on revid:joro@stripped
3105 Satya B 2009-09-03 [merge]
merge mysql-5.0-bugteam to mysql-5.1-bugteam
modified:
include/my_sys.h
mysys/my_copy.c
sql/sql_table.cc
=== modified file 'include/my_sys.h'
--- a/include/my_sys.h 2009-08-11 13:05:25 +0000
+++ b/include/my_sys.h 2009-09-03 12:29:25 +0000
@@ -67,6 +67,7 @@ extern int NEAR my_errno; /* Last error
#define MY_HOLD_ON_ERROR 256 /* my_realloc() ; Return old ptr on error */
#define MY_DONT_OVERWRITE_FILE 1024 /* my_copy: Don't overwrite file */
#define MY_THREADSAFE 2048 /* my_seek(): lock fd mutex */
+#define MY_SYNC 4096 /* my_copy(): sync dst file */
#define MY_CHECK_ERROR 1 /* Params to my_end; Check open-close */
#define MY_GIVE_INFO 2 /* Give time info about process*/
=== modified file 'mysys/my_copy.c'
--- a/mysys/my_copy.c 2009-08-28 16:21:54 +0000
+++ b/mysys/my_copy.c 2009-09-03 12:29:25 +0000
@@ -88,6 +88,13 @@ int my_copy(const char *from, const char
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 */
=== modified file 'sql/sql_table.cc'
--- a/sql/sql_table.cc 2009-09-02 10:22:47 +0000
+++ b/sql/sql_table.cc 2009-09-03 12:29:25 +0000
@@ -5217,6 +5217,7 @@ bool mysql_create_like_table(THD* thd, T
char tmp_path[FN_REFLEN];
#endif
char ts_name[FN_LEN + 1];
+ myf flags= MY_DONT_OVERWRITE_FILE;
DBUG_ENTER("mysql_create_like_table");
@@ -5273,8 +5274,12 @@ bool mysql_create_like_table(THD* thd, T
DBUG_EXECUTE_IF("sleep_create_like_before_copy", my_sleep(6000000););
+ if (opt_sync_frm && !(create_info->options & HA_LEX_CREATE_TMP_TABLE))
+ flags|= MY_SYNC;
+
/*
Create a new table by copying from source table
+ and sync the new table if the flag MY_SYNC is set
Altough exclusive name-lock on target table protects us from concurrent
DML and DDL operations on it we still want to wrap .FRM creation and call
@@ -5295,7 +5300,7 @@ bool mysql_create_like_table(THD* thd, T
goto err;
}
}
- else if (my_copy(src_path, dst_path, MYF(MY_DONT_OVERWRITE_FILE)))
+ else if (my_copy(src_path, dst_path, flags))
{
if (my_errno == ENOENT)
my_error(ER_BAD_DB_ERROR,MYF(0),db);
Attachment: [text/bzr-bundle] bzr/satya.bn@sun.com-20090903122925-ko3pprilmm8hygwq.bundle
| Thread |
|---|
| • bzr commit into mysql-5.1-bugteam branch (satya.bn:3105) | Satya B | 3 Sep |