diff --git a/storage/tokudb/ha_tokudb.h b/storage/tokudb/ha_tokudb.h index 4b3813affb2..f28048e279e 100644 --- a/storage/tokudb/ha_tokudb.h +++ b/storage/tokudb/ha_tokudb.h @@ -784,9 +784,21 @@ private: #endif }; +#if defined(MARIADB_BASE_VERSION) +struct ha_index_option_struct { + bool clustering; +}; + +static inline bool key_is_clustering(const KEY *key) { + return (key->flags & HA_CLUSTERING) || (key->option_struct && key->option_struct->clustering); +} + +#else + static inline bool key_is_clustering(const KEY *key) { return key->flags & HA_CLUSTERING; } +#endif #endif diff --git a/storage/tokudb/hatoku_hton.cc b/storage/tokudb/hatoku_hton.cc index 12149212505..c8bf3a45ee9 100644 --- a/storage/tokudb/hatoku_hton.cc +++ b/storage/tokudb/hatoku_hton.cc @@ -126,6 +126,13 @@ typedef struct savepoint_info { bool in_sub_stmt; } *SP_INFO, SP_INFO_T; +#if defined(MARIADB_BASE_VERSION) +ha_create_table_option tokudb_index_options[] = { + HA_IOPTION_BOOL("clustering", clustering, 0), + HA_IOPTION_END +}; +#endif + static uchar *tokudb_get_key(TOKUDB_SHARE * share, size_t * length, my_bool not_used __attribute__ ((unused))) { *length = share->table_name_length; return (uchar *) share->table_name; @@ -363,6 +370,11 @@ static int tokudb_init_func(void *p) { #if TOKU_INCLUDE_HANDLERTON_HANDLE_FATAL_SIGNAL tokudb_hton->handle_fatal_signal = tokudb_handle_fatal_signal; #endif + +#if defined(MARIADB_BASE_VERSION) + tokudb_hton->index_options = tokudb_index_options; +#endif + if (!tokudb_home) tokudb_home = mysql_real_data_home; DBUG_PRINT("info", ("tokudb_home: %s", tokudb_home));