summaryrefslogtreecommitdiff
path: root/sql/sql_table.cc
diff options
context:
space:
mode:
authorSatya B <satya.bn@sun.com>2009-09-03 17:59:25 +0530
committerSatya B <satya.bn@sun.com>2009-09-03 17:59:25 +0530
commit33f9066e390ba220fa79c98a1eabed169bfc82d2 (patch)
tree57ec873f6a6da89c00bdbfdf8eb6f54472c80cba /sql/sql_table.cc
parent9d82084d20b172c68fc84f2f1d0bc3a7b2ee2c2e (diff)
parent2fc9c5d19993f4af526b97153ee7363ac108831b (diff)
downloadmariadb-git-33f9066e390ba220fa79c98a1eabed169bfc82d2.tar.gz
merge mysql-5.0-bugteam to mysql-5.1-bugteam
Diffstat (limited to 'sql/sql_table.cc')
-rw-r--r--sql/sql_table.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/sql/sql_table.cc b/sql/sql_table.cc
index 4ec104aedc3..89a84ebc1fe 100644
--- a/sql/sql_table.cc
+++ b/sql/sql_table.cc
@@ -5217,6 +5217,7 @@ bool mysql_create_like_table(THD* thd, TABLE_LIST* table, TABLE_LIST* src_table,
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, TABLE_LIST* table, TABLE_LIST* src_table,
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, TABLE_LIST* table, TABLE_LIST* src_table,
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);