1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

WL 2826: Error handling of ALTER TABLE for partitioning

Make lots of fixes to handle the most complex case of reorganising
of partitions where two-phased processes are needed in some cases.


sql/ha_partition.cc:
  Rewrote the rename partitions and drop partitions to align with how
  the table log handles things.
sql/handler.h:
  Added new entry to partition_element to keep track of log entry for
  a partition during ALTER TABLE that reorganises existing partitions.
sql/mysql_priv.h:
  Converted 'd', 'e' and so forth to constants with somewhat more
  descriptive names
  Added method to inactivate log entries
sql/sql_partition.cc:
  Fix change of partitions
sql/sql_table.cc:
  More constants with somewhat descriptive names
  Moved around some methods between internal part and external part
  Added new method to handle inactivation of log entries
This commit is contained in:
unknown
2006-02-10 22:36:01 +01:00
parent 8ae7ef4616
commit c6d1dee7e3
5 changed files with 327 additions and 139 deletions

View File

@ -1177,6 +1177,8 @@ typedef struct st_table_log_entry
uint next_entry;
char action_type;
char entry_type;
char phase;
char not_used;
} TABLE_LOG_ENTRY;
typedef struct st_table_log_memory_entry
@ -1187,11 +1189,22 @@ typedef struct st_table_log_memory_entry
struct st_table_log_memory_entry *next_active_log_entry;
} TABLE_LOG_MEMORY_ENTRY;
#define TLOG_EXECUTE_CODE 'e'
#define TLOG_LOG_ENTRY_CODE 'l'
#define TLOG_IGNORE_LOG_ENTRY_CODE 'i'
#define TLOG_DELETE_ACTION_CODE 'd'
#define TLOG_RENAME_ACTION_CODE 'r'
#define TLOG_REPLACE_ACTION_CODE 's'
#define TLOG_HANDLER_TYPE_LEN 32
bool write_table_log_entry(TABLE_LOG_ENTRY *table_log_entry,
TABLE_LOG_MEMORY_ENTRY **active_entry);
bool write_execute_table_log_entry(uint first_entry,
bool complete,
TABLE_LOG_MEMORY_ENTRY **active_entry);
bool inactivate_table_log_entry(uint entry_no);
void release_table_log_memory_entry(TABLE_LOG_MEMORY_ENTRY *log_entry);
void release_table_log();
void execute_table_log_recovery();