mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
merge of 5.1-main into mysql-trunk.
Changes to ha_innodb.cc are not propagated to plugin, they will come back via Oracle/Innobase if needed.
This commit is contained in:
@ -63,7 +63,9 @@ static const LEX_STRING sys_table_aliases[]=
|
||||
};
|
||||
|
||||
const char *ha_row_type[] = {
|
||||
"", "FIXED", "DYNAMIC", "COMPRESSED", "REDUNDANT", "COMPACT", "PAGE", "?","?","?"
|
||||
"", "FIXED", "DYNAMIC", "COMPRESSED", "REDUNDANT", "COMPACT",
|
||||
/* Reserved to be "PAGE" in future versions */ "?",
|
||||
"?","?","?"
|
||||
};
|
||||
|
||||
const char *tx_isolation_names[] =
|
||||
@ -343,6 +345,7 @@ int ha_init_errors(void)
|
||||
SETMSG(HA_ERR_TABLE_READONLY, ER(ER_OPEN_AS_READONLY));
|
||||
SETMSG(HA_ERR_AUTOINC_READ_FAILED, ER(ER_AUTOINC_READ_FAILED));
|
||||
SETMSG(HA_ERR_AUTOINC_ERANGE, ER(ER_WARN_DATA_OUT_OF_RANGE));
|
||||
SETMSG(HA_ERR_TOO_MANY_CONCURRENT_TRXS, ER(ER_TOO_MANY_CONCURRENT_TRXS));
|
||||
|
||||
/* Register the error messages for use with my_error(). */
|
||||
return my_error_register(errmsgs, HA_ERR_FIRST, HA_ERR_LAST);
|
||||
@ -2748,6 +2751,9 @@ void handler::print_error(int error, myf errflag)
|
||||
case HA_ERR_AUTOINC_ERANGE:
|
||||
textno= ER_WARN_DATA_OUT_OF_RANGE;
|
||||
break;
|
||||
case HA_ERR_TOO_MANY_CONCURRENT_TRXS:
|
||||
textno= ER_TOO_MANY_CONCURRENT_TRXS;
|
||||
break;
|
||||
default:
|
||||
{
|
||||
/* The error was "unknown" to this function.
|
||||
@ -2974,6 +2980,7 @@ uint handler::get_dup_key(int error)
|
||||
*/
|
||||
int handler::delete_table(const char *name)
|
||||
{
|
||||
int saved_error= 0;
|
||||
int error= 0;
|
||||
int enoent_or_zero= ENOENT; // Error if no file was deleted
|
||||
char buff[FN_REFLEN];
|
||||
@ -2983,21 +2990,31 @@ int handler::delete_table(const char *name)
|
||||
fn_format(buff, name, "", *ext, MY_UNPACK_FILENAME|MY_APPEND_EXT);
|
||||
if (my_delete_with_symlink(buff, MYF(0)))
|
||||
{
|
||||
if ((error= my_errno) != ENOENT)
|
||||
break;
|
||||
if (my_errno != ENOENT)
|
||||
{
|
||||
/*
|
||||
If error on the first existing file, return the error.
|
||||
Otherwise delete as much as possible.
|
||||
*/
|
||||
if (enoent_or_zero)
|
||||
return my_errno;
|
||||
saved_error= my_errno;
|
||||
}
|
||||
}
|
||||
else
|
||||
enoent_or_zero= 0; // No error for ENOENT
|
||||
error= enoent_or_zero;
|
||||
}
|
||||
return error;
|
||||
return saved_error ? saved_error : error;
|
||||
}
|
||||
|
||||
|
||||
int handler::rename_table(const char * from, const char * to)
|
||||
{
|
||||
int error= 0;
|
||||
for (const char **ext= bas_ext(); *ext ; ext++)
|
||||
const char **ext, **start_ext;
|
||||
start_ext= bas_ext();
|
||||
for (ext= start_ext; *ext ; ext++)
|
||||
{
|
||||
if (rename_file_ext(from, to, *ext))
|
||||
{
|
||||
@ -3006,6 +3023,12 @@ int handler::rename_table(const char * from, const char * to)
|
||||
error= 0;
|
||||
}
|
||||
}
|
||||
if (error)
|
||||
{
|
||||
/* Try to revert the rename. Ignore errors. */
|
||||
for (; ext >= start_ext; ext--)
|
||||
rename_file_ext(to, from, *ext);
|
||||
}
|
||||
return error;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user