null+****@clear*****
null+****@clear*****
2011年 8月 12日 (金) 10:27:25 JST
Kouhei Sutou 2011-08-12 01:27:25 +0000 (Fri, 12 Aug 2011)
New Revision: aee1054749c5dccf641474ab1de78c556b6813bb
Log:
[mysql-5.6] check handler::ha_*() exist. refs #1046
Modified files:
ha_mroonga.cc
ha_mroonga.h
Modified: ha_mroonga.cc (+9 -9)
===================================================================
--- ha_mroonga.cc 2011-08-12 01:19:42 +0000 (27b7950)
+++ ha_mroonga.cc 2011-08-12 01:27:25 +0000 (3bca2cf)
@@ -2070,10 +2070,10 @@ int ha_mroonga::wrapper_close()
MRN_DBUG_ENTER_METHOD();
MRN_SET_WRAP_SHARE_KEY(share, table->s);
MRN_SET_WRAP_TABLE_KEY(this, table);
-#ifdef MRN_HANDLER_CLOSE_IS_PUBLIC
- error = wrap_handler->close();
-#else
+#ifdef MRN_HANDLER_HAVE_HA_CLOSE
error = wrap_handler->ha_close();
+#else
+ error = wrap_handler->close();
#endif
MRN_SET_BASE_SHARE_KEY(share, table->s);
MRN_SET_BASE_TABLE_KEY(this, table);
@@ -2526,10 +2526,10 @@ int ha_mroonga::wrapper_rnd_next(uchar *buf)
MRN_SET_WRAP_TABLE_KEY(this, table);
if (fulltext_searching)
set_pk_bitmap();
-#ifdef MRN_HANDLER_RND_NEXT_IS_PUBLIC
- error = wrap_handler->rnd_next(buf);
-#else
+#ifdef MRN_HANDLER_HAVE_HA_RND_NEXT
error = wrap_handler->ha_rnd_next(buf);
+#else
+ error = wrap_handler->rnd_next(buf);
#endif
MRN_SET_BASE_SHARE_KEY(share, table->s);
MRN_SET_BASE_TABLE_KEY(this, table);
@@ -2577,10 +2577,10 @@ int ha_mroonga::wrapper_rnd_pos(uchar *buf, uchar *pos)
MRN_DBUG_ENTER_METHOD();
MRN_SET_WRAP_SHARE_KEY(share, table->s);
MRN_SET_WRAP_TABLE_KEY(this, table);
-#ifdef MRN_HANDLER_RND_POS_IS_PUBLIC
- error = wrap_handler->rnd_pos(buf, pos);
-#else
+#ifdef MRN_HANDLER_HAVE_HA_RND_POS
error = wrap_handler->ha_rnd_pos(buf, pos);
+#else
+ error = wrap_handler->rnd_pos(buf, pos);
#endif
MRN_SET_BASE_SHARE_KEY(share, table->s);
MRN_SET_BASE_TABLE_KEY(this, table);
Modified: ha_mroonga.h (+10 -16)
===================================================================
--- ha_mroonga.h 2011-08-12 01:19:42 +0000 (1534b37)
+++ ha_mroonga.h 2011-08-12 01:27:25 +0000 (84386ca)
@@ -37,16 +37,10 @@ extern "C" {
# define MRN_HANDLER_CLONE_NEED_NAME 1
#endif
-#if MYSQL_VERSION_ID < 50600
-# define MRN_HANDLER_CLOSE_IS_PUBLIC 1
-#endif
-
-#if MYSQL_VERSION_ID < 50600
-# define MRN_HANDLER_RND_NEXT_IS_PUBLIC 1
-#endif
-
-#if MYSQL_VERSION_ID < 50600
-# define MRN_HANDLER_RND_POS_IS_PUBLIC 1
+#if MYSQL_VERSION_ID >= 50600
+# define MRN_HANDLER_HAVE_HA_CLOSE 1
+# define MRN_HANDLER_HAVE_HA_RND_NEXT 1
+# define MRN_HANDLER_HAVE_HA_RND_POS 1
#endif
#if MYSQL_VERSION_ID < 50600
@@ -148,7 +142,7 @@ public:
int create(const char *name, TABLE *form, HA_CREATE_INFO *info); // required
int open(const char *name, int mode, uint test_if_locked); // required
-#ifdef MRN_HANDLER_CLOSE_IS_PUBLIC
+#ifndef MRN_HANDLER_HAVE_HA_CLOSE
int close(); // required
#endif
int info(uint flag); // required
@@ -161,10 +155,10 @@ public:
int rnd_init(bool scan); // required
int rnd_end();
-#ifdef MRN_HANDLER_RND_NEXT_IS_PUBLIC
+#ifndef MRN_HANDLER_HAVE_HA_RND_NEXT
int rnd_next(uchar *buf); // required
#endif
-#ifdef MRN_HANDLER_RND_POS_IS_PUBLIC
+#ifndef MRN_HANDLER_HAVE_HA_RND_POS
int rnd_pos(uchar *buf, uchar *pos); // required
#endif
void position(const uchar *record); // required
@@ -248,15 +242,15 @@ public:
bool is_fatal_error(int error_num, uint flags);
protected:
-#ifndef MRN_HANDLER_RND_NEXT_IS_PUBLIC
+#ifdef MRN_HANDLER_HAVE_HA_RND_NEXT
int rnd_next(uchar *buf);
#endif
-#ifndef MRN_HANDLER_RND_POS_IS_PUBLIC
+#ifdef MRN_HANDLER_HAVE_HA_RND_POS
int rnd_pos(uchar *buf, uchar *pos);
#endif
private:
-#ifndef MRN_HANDLER_CLOSE_IS_PUBLIC
+#ifdef MRN_HANDLER_HAVE_HA_CLOSE
int close();
#endif
void check_count_skip(key_part_map start_key_part_map,