summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2016-02-17 13:43:26 +0100
committerSergei Golubchik <serg@mariadb.org>2016-02-17 13:43:26 +0100
commitbcc1f2c7895da53ac9f9a1cc9fe764fd8d0ef4d5 (patch)
tree9006755076a4ebd5105dbf7fd92fab07f98b4af2
parent6d26b6b6bcceedcfd4cee5f2c2d7dcbaee0b7896 (diff)
downloadmariadb-git-10.0-tokudb-merge.tar.gz
TokuDB fixes to compile in MariaDB10.0-tokudb-merge
-rw-r--r--storage/tokudb/ha_tokudb.cc4
-rw-r--r--storage/tokudb/ha_tokudb.h20
-rw-r--r--storage/tokudb/hatoku_hton.cc16
-rw-r--r--storage/tokudb/tokudb_information_schema.cc6
-rw-r--r--storage/tokudb/tokudb_information_schema.h4
-rw-r--r--storage/tokudb/tokudb_memory.h2
-rw-r--r--storage/tokudb/tokudb_sysvars.cc14
-rw-r--r--storage/tokudb/tokudb_sysvars.h25
8 files changed, 52 insertions, 39 deletions
diff --git a/storage/tokudb/ha_tokudb.cc b/storage/tokudb/ha_tokudb.cc
index 3eb6b221f73..c97be11310a 100644
--- a/storage/tokudb/ha_tokudb.cc
+++ b/storage/tokudb/ha_tokudb.cc
@@ -7093,7 +7093,7 @@ int ha_tokudb::create(
#endif
#if TOKU_INCLUDE_OPTION_STRUCTS
- const tokudb::sysvars::format_t row_format =
+ const tokudb::sysvars::row_format_t row_format =
(tokudb::sysvars::row_format_t)form->s->option_struct->row_format;
#else
const tokudb::sysvars::row_format_t row_format =
@@ -8198,7 +8198,7 @@ int ha_tokudb::tokudb_add_index(
thd_progress_report(
thd,
num_processed,
- (long long unsigned)share->rows);
+ (long long unsigned)share->row_count());
#endif
if (thd_killed(thd)) {
diff --git a/storage/tokudb/ha_tokudb.h b/storage/tokudb/ha_tokudb.h
index 93658643c9a..1132b99741d 100644
--- a/storage/tokudb/ha_tokudb.h
+++ b/storage/tokudb/ha_tokudb.h
@@ -1031,25 +1031,5 @@ private:
bool in_rpl_update_rows;
};
-#if TOKU_INCLUDE_OPTION_STRUCTS
-struct ha_table_option_struct {
- uint row_format;
-};
-
-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 // _HA_TOKUDB_H
diff --git a/storage/tokudb/hatoku_hton.cc b/storage/tokudb/hatoku_hton.cc
index f1f81fa48df..2fef0b81ee7 100644
--- a/storage/tokudb/hatoku_hton.cc
+++ b/storage/tokudb/hatoku_hton.cc
@@ -34,18 +34,6 @@ typedef struct savepoint_info {
bool in_sub_stmt;
} *SP_INFO, SP_INFO_T;
-#if TOKU_INCLUDE_OPTION_STRUCTS
-ha_create_table_option tokudb_table_options[] = {
- HA_TOPTION_SYSVAR("compression", row_format, row_format),
- HA_TOPTION_END
-};
-
-ha_create_table_option tokudb_index_options[] = {
- HA_IOPTION_BOOL("clustering", clustering, 0),
- HA_IOPTION_END
-};
-#endif
-
static handler* tokudb_create_handler(
handlerton* hton,
TABLE_SHARE* table,
@@ -377,8 +365,8 @@ static int tokudb_init_func(void *p) {
#endif
#if TOKU_INCLUDE_OPTION_STRUCTS
- tokudb_hton->table_options = tokudb_table_options;
- tokudb_hton->index_options = tokudb_index_options;
+ tokudb_hton->table_options = tokudb::sysvars::tokudb_table_options;
+ tokudb_hton->index_options = tokudb::sysvars::tokudb_index_options;
#endif
if (!tokudb_home)
diff --git a/storage/tokudb/tokudb_information_schema.cc b/storage/tokudb/tokudb_information_schema.cc
index 7ea3b8abbdd..90755834eef 100644
--- a/storage/tokudb/tokudb_information_schema.cc
+++ b/storage/tokudb/tokudb_information_schema.cc
@@ -41,11 +41,13 @@ static void field_store_time_t(Field* field, time_t time) {
localtime_r(&time, &tm_time);
localtime_to_TIME(&my_time, &tm_time);
my_time.time_type = MYSQL_TIMESTAMP_DATETIME;
+#ifdef MARIA_PLUGIN_INTERFACE_VERSION
+ field->store_time(&my_time);
+#else
field->store_time(&my_time, MYSQL_TIMESTAMP_DATETIME);
+#endif
field->set_notnull();
} else {
- memset(&my_time, 0, sizeof(my_time));
- field->store_time(&my_time, MYSQL_TIMESTAMP_DATETIME);
field->set_null();
}
}
diff --git a/storage/tokudb/tokudb_information_schema.h b/storage/tokudb/tokudb_information_schema.h
index 7f42d68ef59..b80e3f074ec 100644
--- a/storage/tokudb/tokudb_information_schema.h
+++ b/storage/tokudb/tokudb_information_schema.h
@@ -32,6 +32,10 @@ Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved.
namespace tokudb {
namespace information_schema {
+#ifdef MARIA_PLUGIN_INTERFACE_VERSION
+#define st_mysql_plugin st_maria_plugin
+#endif
+
extern st_mysql_plugin trx;
extern st_mysql_plugin lock_waits;
extern st_mysql_plugin locks;
diff --git a/storage/tokudb/tokudb_memory.h b/storage/tokudb/tokudb_memory.h
index 26587de6062..2687c1cda8e 100644
--- a/storage/tokudb/tokudb_memory.h
+++ b/storage/tokudb/tokudb_memory.h
@@ -52,7 +52,7 @@ inline void* realloc(void* p, size_t s, myf flags) {
#if 50700 <= MYSQL_VERSION_ID && MYSQL_VERSION_ID <= 50799
return ::my_realloc(0, p, s, flags);
#else
- return ::my_realloc(p, s, flags);
+ return ::my_realloc(p, s, flags | MY_ALLOW_ZERO_PTR);
#endif
}
inline void free(void* ptr) {
diff --git a/storage/tokudb/tokudb_sysvars.cc b/storage/tokudb/tokudb_sysvars.cc
index 168fb0cc647..728b9505219 100644
--- a/storage/tokudb/tokudb_sysvars.cc
+++ b/storage/tokudb/tokudb_sysvars.cc
@@ -1016,12 +1016,14 @@ my_bool disable_prefetching(THD* thd) {
my_bool disable_slow_alter(THD* thd) {
return (THDVAR(thd, disable_slow_alter) != 0);
}
+#if TOKU_INCLUDE_UPSERT
my_bool disable_slow_update(THD* thd) {
return (THDVAR(thd, disable_slow_update) != 0);
}
my_bool disable_slow_upsert(THD* thd) {
return (THDVAR(thd, disable_slow_upsert) != 0);
}
+#endif
empty_scan_mode_t empty_scan(THD* thd) {
return (empty_scan_mode_t)THDVAR(thd, empty_scan);
}
@@ -1095,5 +1097,17 @@ my_bool support_xa(THD* thd) {
return (THDVAR(thd, support_xa) != 0);
}
+#if TOKU_INCLUDE_OPTION_STRUCTS
+ha_create_table_option tokudb_table_options[] = {
+ HA_TOPTION_SYSVAR("compression", row_format, row_format),
+ HA_TOPTION_END
+};
+
+ha_create_table_option tokudb_index_options[] = {
+ HA_IOPTION_BOOL("clustering", clustering, 0),
+ HA_IOPTION_END
+};
+#endif
+
} // namespace sysvars
} // namespace tokudb
diff --git a/storage/tokudb/tokudb_sysvars.h b/storage/tokudb/tokudb_sysvars.h
index a7490c7b473..30aac151ac0 100644
--- a/storage/tokudb/tokudb_sysvars.h
+++ b/storage/tokudb/tokudb_sysvars.h
@@ -26,6 +26,26 @@ Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved.
#ifndef _TOKUDB_SYSVARS_H
#define _TOKUDB_SYSVARS_H
+#if TOKU_INCLUDE_OPTION_STRUCTS
+struct ha_table_option_struct {
+ uint row_format;
+};
+
+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
+
namespace tokudb {
namespace sysvars {
@@ -141,6 +161,11 @@ my_bool support_xa(THD* thd);
extern st_mysql_sys_var* system_variables[];
+#if TOKU_INCLUDE_OPTION_STRUCTS
+extern ha_create_table_option tokudb_table_options[];
+extern ha_create_table_option tokudb_index_options[];
+#endif
+
} // namespace sysvars
} // namespace tokudb