Commit 4c988a01 authored by Rich Prohaska's avatar Rich Prohaska

#17 support mariadb clustering option

parent 2df023d3
...@@ -784,9 +784,21 @@ class ha_tokudb : public handler { ...@@ -784,9 +784,21 @@ class ha_tokudb : public handler {
#endif #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) { static inline bool key_is_clustering(const KEY *key) {
return key->flags & HA_CLUSTERING; return key->flags & HA_CLUSTERING;
} }
#endif
#endif #endif
...@@ -126,6 +126,13 @@ typedef struct savepoint_info { ...@@ -126,6 +126,13 @@ typedef struct savepoint_info {
bool in_sub_stmt; bool in_sub_stmt;
} *SP_INFO, SP_INFO_T; } *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))) { static uchar *tokudb_get_key(TOKUDB_SHARE * share, size_t * length, my_bool not_used __attribute__ ((unused))) {
*length = share->table_name_length; *length = share->table_name_length;
return (uchar *) share->table_name; return (uchar *) share->table_name;
...@@ -363,6 +370,11 @@ static int tokudb_init_func(void *p) { ...@@ -363,6 +370,11 @@ static int tokudb_init_func(void *p) {
#if TOKU_INCLUDE_HANDLERTON_HANDLE_FATAL_SIGNAL #if TOKU_INCLUDE_HANDLERTON_HANDLE_FATAL_SIGNAL
tokudb_hton->handle_fatal_signal = tokudb_handle_fatal_signal; tokudb_hton->handle_fatal_signal = tokudb_handle_fatal_signal;
#endif #endif
#if defined(MARIADB_BASE_VERSION)
tokudb_hton->index_options = tokudb_index_options;
#endif
if (!tokudb_home) if (!tokudb_home)
tokudb_home = mysql_real_data_home; tokudb_home = mysql_real_data_home;
DBUG_PRINT("info", ("tokudb_home: %s", tokudb_home)); DBUG_PRINT("info", ("tokudb_home: %s", tokudb_home));
......
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