null+****@clear*****
null+****@clear*****
2012年 2月 10日 (金) 11:04:35 JST
Kouhei Sutou 2012-02-10 11:04:35 +0900 (Fri, 10 Feb 2012)
New Revision: fd9fb56a4e49b4b5657b8f9a371e16530bc441f6
Log:
change dry_write prdicate to method from function.
Modified files:
ha_mroonga.cc
ha_mroonga.h
Modified: ha_mroonga.cc (+15 -15)
===================================================================
--- ha_mroonga.cc 2012-02-10 11:04:01 +0900 (770467e)
+++ ha_mroonga.cc 2012-02-10 11:04:35 +0900 (68ef215)
@@ -755,13 +755,6 @@ static MYSQL_THDVAR_BOOL(
FALSE /* default */
);
-static bool mrn_dry_write(THD *thd)
-{
- DBUG_ENTER("mrn_dry_write");
- bool dry_write_p = THDVAR(thd, dry_write);
- DBUG_RETURN(dry_write_p);
-}
-
static MYSQL_THDVAR_BOOL(
enable_optimization, /* name */
PLUGIN_VAR_OPCMDARG, /* options */
@@ -4056,7 +4049,7 @@ int ha_mroonga::wrapper_write_row_index(uchar *buf)
int error = 0;
- if (mrn_dry_write(ha_thd())) {
+ if (is_dry_write()) {
DBUG_PRINT("info", ("mroonga: dry write: ha_mroonga::%s", __FUNCTION__));
DBUG_RETURN(error);
}
@@ -4144,7 +4137,7 @@ int ha_mroonga::storage_write_row(uchar *buf)
MRN_DBUG_ENTER_METHOD();
int error = 0;
- if (mrn_dry_write(ha_thd())) {
+ if (is_dry_write()) {
DBUG_PRINT("info", ("mroonga: dry write: ha_mroonga::%s", __FUNCTION__));
DBUG_RETURN(error);
}
@@ -4452,7 +4445,7 @@ int ha_mroonga::wrapper_update_row_index(const uchar *old_data, uchar *new_data)
int error = 0;
- if (mrn_dry_write(ha_thd())) {
+ if (is_dry_write()) {
DBUG_PRINT("info", ("mroonga: dry write: ha_mroonga::%s", __FUNCTION__));
DBUG_RETURN(error);
}
@@ -4564,7 +4557,7 @@ int ha_mroonga::storage_update_row(const uchar *old_data, uchar *new_data)
MRN_DBUG_ENTER_METHOD();
int error = 0;
- if (mrn_dry_write(ha_thd())) {
+ if (is_dry_write()) {
DBUG_PRINT("info", ("mroonga: dry write: ha_mroonga::%s", __FUNCTION__));
DBUG_RETURN(error);
}
@@ -4805,7 +4798,7 @@ int ha_mroonga::wrapper_delete_row_index(const uchar *buf)
int error = 0;
- if (mrn_dry_write(ha_thd())) {
+ if (is_dry_write()) {
DBUG_PRINT("info", ("mroonga: dry write: ha_mroonga::%s", __FUNCTION__));
DBUG_RETURN(error);
}
@@ -4870,7 +4863,7 @@ int ha_mroonga::storage_delete_row(const uchar *buf)
MRN_DBUG_ENTER_METHOD();
int error = 0;
- if (mrn_dry_write(ha_thd())) {
+ if (is_dry_write()) {
DBUG_PRINT("info", ("mroonga: dry write: ha_mroonga::%s", __FUNCTION__));
DBUG_RETURN(error);
}
@@ -6876,6 +6869,13 @@ int ha_mroonga::generic_geo_open_cursor(const uchar *key,
DBUG_RETURN(error);
}
+bool ha_mroonga::is_dry_write()
+{
+ MRN_DBUG_ENTER_METHOD();
+ bool dry_write_p = THDVAR(ha_thd(), dry_write);
+ DBUG_RETURN(dry_write_p);
+}
+
bool ha_mroonga::is_enable_optimization()
{
MRN_DBUG_ENTER_METHOD();
@@ -8775,7 +8775,7 @@ int ha_mroonga::wrapper_truncate_index()
int error = 0;
- if (mrn_dry_write(ha_thd())) {
+ if (is_dry_write()) {
DBUG_PRINT("info", ("mroonga: dry write: ha_mroonga::%s", __FUNCTION__));
DBUG_RETURN(error);
}
@@ -8812,7 +8812,7 @@ int ha_mroonga::storage_truncate()
MRN_DBUG_ENTER_METHOD();
int error = 0;
- if (mrn_dry_write(ha_thd())) {
+ if (is_dry_write()) {
DBUG_PRINT("info", ("mroonga: dry write: ha_mroonga::%s", __FUNCTION__));
DBUG_RETURN(error);
}
Modified: ha_mroonga.h (+1 -0)
===================================================================
--- ha_mroonga.h 2012-02-10 11:04:01 +0900 (9e512c3)
+++ ha_mroonga.h 2012-02-10 11:04:35 +0900 (c6d7e9b)
@@ -410,6 +410,7 @@ private:
#ifdef MRN_HANDLER_HAVE_HA_CLOSE
int close();
#endif
+ bool is_dry_write();
bool is_enable_optimization();
void check_count_skip(key_part_map start_key_part_map,
key_part_map end_key_part_map, bool fulltext);