[Groonga-mysql-commit] mroonga/mroonga [master] reduce duplicated codes.

Back to archive index

null+****@clear***** null+****@clear*****
2012年 2月 15日 (水) 17:49:47 JST


Kouhei Sutou	2012-02-15 17:49:47 +0900 (Wed, 15 Feb 2012)

  New Revision: 00b2fca976ebd43a79bec6b400aabf25eefd7020

  Log:
    reduce duplicated codes.

  Modified files:
    ha_mroonga.cc
    ha_mroonga.h

  Modified: ha_mroonga.cc (+9 -1)
===================================================================
--- ha_mroonga.cc    2012-02-15 17:33:27 +0900 (813900f)
+++ ha_mroonga.cc    2012-02-15 17:49:47 +0900 (f5506f4)
@@ -3569,7 +3569,7 @@ int ha_mroonga::delete_table(const char *name)
   mrn_open_mutex_lock();
   mrn_free_tmp_table_share(tmp_table_share);
   mrn_open_mutex_unlock();
-  if (name[0] != '.') {
+  if (is_temporary_table_name(name)) {
     /* temporary table */
     mrn_drop_db(mrn_hton_ptr, (char *) name);
   }
@@ -6957,6 +6957,14 @@ bool ha_mroonga::is_need_normalize(Field *field) const
   DBUG_RETURN(need_normalize_p);
 }
 
+bool ha_mroonga::is_temporary_table_name(const char *name) const
+{
+  MRN_DBUG_ENTER_METHOD();
+  DBUG_PRINT("info", ("mroonga: table name = %s", name));
+  bool temporary_table_name_p = (name[0] != '.');
+  DBUG_RETURN(temporary_table_name_p);
+}
+
 void ha_mroonga::check_count_skip(key_part_map start_key_part_map,
                                   key_part_map end_key_part_map, bool fulltext)
 {

  Modified: ha_mroonga.h (+1 -0)
===================================================================
--- ha_mroonga.h    2012-02-15 17:33:27 +0900 (4167d37)
+++ ha_mroonga.h    2012-02-15 17:49:47 +0900 (0d4825e)
@@ -418,6 +418,7 @@ private:
   bool is_dry_write();
   bool is_enable_optimization();
   bool is_need_normalize(Field *field) const;
+  bool is_temporary_table_name(const char *name) const;
   void check_count_skip(key_part_map start_key_part_map,
                         key_part_map end_key_part_map, bool fulltext);
   bool is_groonga_layer_condition(const Item *item,




Groonga-mysql-commit メーリングリストの案内
Back to archive index