mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
System Versioning 1.0pre2
Merge branch '10.3' into trunk
This commit is contained in:
@ -441,6 +441,13 @@ uint check_n_cut_mysql50_prefix(const char *from, char *to, uint to_length)
|
||||
}
|
||||
|
||||
|
||||
static bool check_if_frm_exists(char *path, const char *db, const char *table)
|
||||
{
|
||||
fn_format(path, table, db, reg_ext, MYF(0));
|
||||
return !access(path, F_OK);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
Translate a table name to a file name (WL #1324).
|
||||
|
||||
@ -531,13 +538,18 @@ uint build_table_filename(char *buff, size_t bufflen, const char *db,
|
||||
DBUG_PRINT("enter", ("db: '%s' table_name: '%s' ext: '%s' flags: %x",
|
||||
db, table_name, ext, flags));
|
||||
|
||||
(void) tablename_to_filename(db, dbbuff, sizeof(dbbuff));
|
||||
|
||||
/* Check if this is a temporary table name. Allow it if a corresponding .frm file exists */
|
||||
if (is_prefix(table_name, tmp_file_prefix) && strlen(table_name) < NAME_CHAR_LEN &&
|
||||
check_if_frm_exists(tbbuff, dbbuff, table_name))
|
||||
flags|= FN_IS_TMP;
|
||||
|
||||
if (flags & FN_IS_TMP) // FN_FROM_IS_TMP | FN_TO_IS_TMP
|
||||
strmake(tbbuff, table_name, sizeof(tbbuff)-1);
|
||||
else
|
||||
(void) tablename_to_filename(table_name, tbbuff, sizeof(tbbuff));
|
||||
|
||||
(void) tablename_to_filename(db, dbbuff, sizeof(dbbuff));
|
||||
|
||||
char *end = buff + bufflen;
|
||||
/* Don't add FN_ROOTDIR if mysql_data_home already includes it */
|
||||
char *pos = strnmov(buff, mysql_data_home, bufflen);
|
||||
@ -9964,7 +9976,7 @@ copy_data_between_tables(THD *thd, TABLE *from, TABLE *to,
|
||||
if (mysql_trans_prepare_alter_copy_data(thd))
|
||||
DBUG_RETURN(-1);
|
||||
|
||||
if (!(copy= new Copy_field[to->s->fields]))
|
||||
if (!(copy= new (thd->mem_root) Copy_field[to->s->fields]))
|
||||
DBUG_RETURN(-1); /* purecov: inspected */
|
||||
|
||||
/* We need external lock before we can disable/enable keys */
|
||||
|
Reference in New Issue
Block a user