mirror of
https://github.com/MariaDB/server.git
synced 2026-05-14 19:07:15 +02:00
WL 2826: First step in error handling of ALTER TABLE for partitioning
BUILD/SETUP.sh: Add possibility for BUILD scripts to add error inject flag BUILD/compile-pentium-debug-max: Add error inject flag to this script configure.in: Add handling of --with-error-inject in configure script sql/ha_ndbcluster.cc: Add possibility to rename handler file sql/ha_ndbcluster.h: Add possibility to rename handler file sql/ha_partition.cc: Add possibility to rename handler file sql/ha_partition.h: Add possibility to rename handler file sql/handler.h: Add possibility to rename handler file sql/mysql_priv.h: Add error inject macros sql/mysqld.cc: Add error inject system variables sql/set_var.cc: Add error inject system variables sql/sql_class.h: Add error inject system variables sql/sql_table.cc: Start modifying code for introducing table log, Step 1 sql/unireg.cc: Add rename flag to handler file call sql/sql_partition.cc: Changes to ADD/DROP/CHANGE partitions
This commit is contained in:
parent
3a2b70f841
commit
520dffb520
15 changed files with 307 additions and 138 deletions
|
|
@ -563,7 +563,9 @@ int ha_partition::rename_table(const char *from, const char *to)
|
|||
and types of engines in the partitions.
|
||||
*/
|
||||
|
||||
int ha_partition::create_handler_files(const char *name)
|
||||
int ha_partition::create_handler_files(const char *path,
|
||||
const char *old_path,
|
||||
bool rename_flag)
|
||||
{
|
||||
DBUG_ENTER("ha_partition::create_handler_files()");
|
||||
|
||||
|
|
@ -571,10 +573,27 @@ int ha_partition::create_handler_files(const char *name)
|
|||
We need to update total number of parts since we might write the handler
|
||||
file as part of a partition management command
|
||||
*/
|
||||
if (create_handler_file(name))
|
||||
if (rename_flag)
|
||||
{
|
||||
my_error(ER_CANT_CREATE_HANDLER_FILE, MYF(0));
|
||||
DBUG_RETURN(1);
|
||||
char name[FN_REFLEN];
|
||||
char old_name[FN_REFLEN];
|
||||
char *par_str= ".par";
|
||||
|
||||
strxmov(name, path, par_str, NullS);
|
||||
strxmov(old_name, old_path, par_str, NullS);
|
||||
if (my_delete(name, MYF(MY_WME)) ||
|
||||
my_rename(old_name, name, MYF(MY_WME)))
|
||||
{
|
||||
DBUG_RETURN(TRUE);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (create_handler_file(path))
|
||||
{
|
||||
my_error(ER_CANT_CREATE_HANDLER_FILE, MYF(0));
|
||||
DBUG_RETURN(1);
|
||||
}
|
||||
}
|
||||
DBUG_RETURN(0);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue