Commit 41daa75c authored by Rich Prohaska's avatar Rich Prohaska Committed by Yoni Fogel

#4695 write new frm data during alter table refs[t:4695]

git-svn-id: file:///svn/mysql/tokudb-engine/tokudb-engine@41663 c7de825b-a66e-492c-adef-691d508d4ae1
parent c2a28786
...@@ -10099,17 +10099,32 @@ ha_tokudb::is_alter_table_hot() { ...@@ -10099,17 +10099,32 @@ ha_tokudb::is_alter_table_hot() {
TOKUDB_DBUG_RETURN(is_hot); TOKUDB_DBUG_RETURN(is_hot);
} }
#endif int
ha_tokudb::new_alter_table_frm_data(const uchar *frm_data, size_t frm_len) {
TOKUDB_DBUG_ENTER("new_alter_table_path");
int error = 0;
if (table->part_info == NULL) {
// write frmdata to status
DB_TXN *txn = NULL; // TODO use transaction (creatged in prepare_for_alter)
error = write_to_status(share->status_block, hatoku_frm_data, (void *)frm_data, (uint)frm_len, txn);
}
TOKUDB_DBUG_RETURN(error);
}
void void
ha_tokudb::prepare_for_alter() { ha_tokudb::prepare_for_alter() {
TOKUDB_DBUG_ENTER("prepare_for_alter"); TOKUDB_DBUG_ENTER("prepare_for_alter");
#if MYSQL_VERSION_ID >= 50521
// remove the frm data from the status dictionary during alter table. it will // create a transaction used to add indexes, drop indexes, and write the new frm data
// be created when the table is reopened with the new schema. // this transaction will be retired by mysql alter table
remove_frm_data(share->status_block, NULL); DB_TXN *txn = NULL;
#endif txn = txn; // TODO create a new transaction
DBUG_VOID_RETURN; DBUG_VOID_RETURN;
} }
#endif
...@@ -574,9 +574,10 @@ class ha_tokudb : public handler { ...@@ -574,9 +574,10 @@ class ha_tokudb : public handler {
#if MYSQL_VERSION_ID >= 50521 #if MYSQL_VERSION_ID >= 50521
bool is_alter_table_hot(); bool is_alter_table_hot();
void prepare_for_alter();
int new_alter_table_frm_data(const uchar *frm_data, size_t frm_len);
#endif #endif
void prepare_for_alter();
#if defined(HA_GENERAL_ONLINE) #if defined(HA_GENERAL_ONLINE)
void print_alter_info( void print_alter_info(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment