From 51e2a01a096633da4d4442fad2ffa0bbcf59b0ad Mon Sep 17 00:00:00 2001 From: Rich Prohaska Date: Wed, 17 Apr 2013 00:02:05 -0400 Subject: [PATCH] #3018 build tokudb with mysql 5.5.9 refs[t:3018] git-svn-id: file:///svn/mysql/tokudb-engine/tokudb-engine@29780 c7de825b-a66e-492c-adef-691d508d4ae1 --- storage/tokudb/ha_tokudb.cc | 12 +++++++++++- storage/tokudb/ha_tokudb.h | 3 ++- storage/tokudb/hatoku_hton.cc | 7 ++++++- 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/storage/tokudb/ha_tokudb.cc b/storage/tokudb/ha_tokudb.cc index 90f3dfb5099..3f806b5acec 100644 --- a/storage/tokudb/ha_tokudb.cc +++ b/storage/tokudb/ha_tokudb.cc @@ -291,7 +291,11 @@ static inline bool do_ignore_flag_optimization(THD* thd, TABLE* table, bool opt_ ulonglong ha_tokudb::table_flags() const { return (table && do_ignore_flag_optimization(ha_thd(), table, share->replace_into_fast) ? int_table_flags | HA_BINLOG_STMT_CAPABLE : +#if defined(HA_GENERNAL_ONLINE) int_table_flags | HA_BINLOG_ROW_CAPABLE | HA_BINLOG_STMT_CAPABLE | HA_ONLINE_ALTER); +#else + int_table_flags | HA_BINLOG_ROW_CAPABLE | HA_BINLOG_STMT_CAPABLE); +#endif } // @@ -7148,9 +7152,11 @@ void ha_tokudb::print_error(int error, myf errflag) { if (error == DB_KEYEXIST) { error = HA_ERR_FOUND_DUPP_KEY; } +#if defined(HA_ALTER_ERROR) if (error == HA_ALTER_ERROR) { error = HA_ERR_UNSUPPORTED; - } + } +#endif handler::print_error(error, errflag); } @@ -7682,6 +7688,8 @@ cleanup: return retval; } +#if defined(HA_GENERAL_ONLINE) + void ha_tokudb::print_alter_info( TABLE *altered_table, HA_CREATE_INFO *create_info, @@ -9107,6 +9115,8 @@ cleanup: return error; } +#endif + struct check_context { THD *thd; }; diff --git a/storage/tokudb/ha_tokudb.h b/storage/tokudb/ha_tokudb.h index 12a0c3aa397..56ce5ec0ee3 100644 --- a/storage/tokudb/ha_tokudb.h +++ b/storage/tokudb/ha_tokudb.h @@ -529,6 +529,7 @@ public: void restore_drop_indexes(TABLE *table_arg, uint *key_num, uint num_of_keys); int final_drop_index(TABLE *table_arg); +#if defined(HA_GENERAL_ONLINE) void print_alter_info( TABLE *altered_table, HA_CREATE_INFO *create_info, @@ -557,7 +558,7 @@ public: { return 0; } - +#endif // delete all rows from the table // effect: all dictionaries, including the main and indexes, should be empty diff --git a/storage/tokudb/hatoku_hton.cc b/storage/tokudb/hatoku_hton.cc index 539eb0b9d68..44a221a87f3 100644 --- a/storage/tokudb/hatoku_hton.cc +++ b/storage/tokudb/hatoku_hton.cc @@ -167,7 +167,9 @@ static bool tokudb_show_status(handlerton * hton, THD * thd, stat_print_fn * pri static int tokudb_close_connection(handlerton * hton, THD * thd); static int tokudb_commit(handlerton * hton, THD * thd, bool all); static int tokudb_rollback(handlerton * hton, THD * thd, bool all); +#if defined(HA_GENERAL_ONLINE) static uint tokudb_alter_table_flags(uint flags); +#endif static int tokudb_rollback_to_savepoint(handlerton * hton, THD * thd, void *savepoint); static int tokudb_savepoint(handlerton * hton, THD * thd, void *savepoint); static int tokudb_release_savepoint(handlerton * hton, THD * thd, void *savepoint); @@ -262,7 +264,9 @@ static int tokudb_init_func(void *p) { tokudb_hton->panic = tokudb_end; tokudb_hton->flush_logs = tokudb_flush_logs; tokudb_hton->show_status = tokudb_show_status; +#if defined(HA_GENERAL_ONLINE) tokudb_hton->alter_table_flags = tokudb_alter_table_flags; +#endif if (!tokudb_home) tokudb_home = mysql_real_data_home; DBUG_PRINT("info", ("tokudb_home: %s", tokudb_home)); @@ -1393,6 +1397,7 @@ void tokudb_cleanup_log_files(void) { DBUG_VOID_RETURN; } +#if defined(HA_GENERAL_ONLINE) // // *******NOTE***** // If the flags HA_ONLINE_DROP_INDEX and HA_ONLINE_DROP_UNIQUE_INDEX @@ -1405,7 +1410,7 @@ static uint tokudb_alter_table_flags(uint flags) HA_ONLINE_ADD_UNIQUE_INDEX_NO_WRITES| HA_ONLINE_DROP_UNIQUE_INDEX_NO_WRITES|HA_GENERAL_ONLINE); } - +#endif // options flags