[Groonga-mysql-commit] mroonga/mroonga [master] change storage engine name to "mroonga" from "groonga".

Back to archive index

null+****@clear***** null+****@clear*****
2011年 12月 29日 (木) 16:35:37 JST


Kouhei Sutou	2011-12-29 16:35:37 +0900 (Thu, 29 Dec 2011)

  New Revision: cc6d2f0ff78d521d24e2a182f2c63ac9263b5a93

  Log:
    change storage engine name to "mroonga" from "groonga".
    
    We still support "gronga" for storage engine name. But it will be removed
    in the future release.

  Modified files:
    Makefile.am
    ha_mroonga.cc
    plug.in

  Modified: Makefile.am (+18 -8)
===================================================================
--- Makefile.am    2011-12-29 14:58:51 +0900 (faf0d11)
+++ Makefile.am    2011-12-29 16:35:37 +0900 (a379376)
@@ -18,16 +18,26 @@ sources =					\
 	mrn_sys.c				\
 	mrn_table.cc
 
-plugin_LTLIBRARIES     = ha_groonga.la
-ha_groonga_la_LDFLAGS  = -module $(GROONGA_LIBS)
-ha_groonga_la_CXXFLAGS = $(AM_CXXFLAGS) $(MYSQL_CFLAGS) -DMYSQL_DYNAMIC_PLUGIN
-ha_groonga_la_CFLAGS   = $(AM_CFLAGS) $(MYSQL_CFLAGS) -DMYSQL_DYNAMIC_PLUGIN
+dynamic_plugin_ldflags  = -module $(GROONGA_LIBS)
+dynamic_plugin_cxxflags = $(AM_CXXFLAGS) $(MYSQL_CFLAGS) -DMYSQL_DYNAMIC_PLUGIN
+dynamic_plugin_cflags   = $(AM_CFLAGS) $(MYSQL_CFLAGS) -DMYSQL_DYNAMIC_PLUGIN
+
+plugin_LTLIBRARIES     = ha_mroonga.la
+ha_mroonga_la_LDFLAGS  = $(dynamic_plugin_ldflags)
+ha_mroonga_la_CXXFLAGS = $(dynamic_plugin_cxxflags)
+ha_mroonga_la_CFLAGS   = $(dynamic_plugin_cflags)
+ha_mroonga_la_SOURCES  = $(sources)
+
+plugin_LTLIBRARIES    += ha_groonga.la
+ha_groonga_la_LDFLAGS  = $(dynamic_plugin_ldflags)
+ha_groonga_la_CXXFLAGS = $(dynamic_plugin_cxxflags) -DMRN_USE_DEPRECATED_NAME
+ha_groonga_la_CFLAGS   = $(dynamic_plugin_cflags) -DMRN_USE_DEPRECATED_NAME
 ha_groonga_la_SOURCES  = $(sources)
 
-plugin_LIBRARIES         = libha_groonga.a
-libha_groonga_a_CXXFLAGS = $(AM_CXXFLAGS) $(MYSQL_CFLAGS)
-libha_groonga_a_CFLAGS   = $(AM_CFLAGS) $(MYSQL_CFLAGS)
-libha_groonga_a_SOURCES  = $(sources)
+plugin_LIBRARIES         = libmroonga.a
+libmroonga_a_CXXFLAGS    = $(AM_CXXFLAGS) $(MYSQL_CFLAGS)
+libmroonga_a_CFLAGS      = $(AM_CFLAGS) $(MYSQL_CFLAGS)
+libmroonga_a_SOURCES     = $(sources)
 
 SUBDIRS =					\
 	test					\

  Modified: ha_mroonga.cc (+22 -10)
===================================================================
--- ha_mroonga.cc    2011-12-29 14:58:51 +0900 (e710881)
+++ ha_mroonga.cc    2011-12-29 16:35:37 +0900 (8bab458)
@@ -79,6 +79,16 @@ extern pthread_mutex_t LOCK_open;
 #  define MRN_ORDER_IS_ASC(order) ((order)->asc)
 #endif
 
+#define MRN_STRINGIFY(macro_or_string)  MRN_STRINGIFY_ARG(macro_or_string)
+#define MRN_STRINGIFY_ARG(contents)     #contents
+
+#ifdef MRN_USE_DEPRECATED_NAME
+#  define MRN_PLUGIN_NAME groonga
+#else
+#  define MRN_PLUGIN_NAME mroonga
+#endif
+#define MRN_PLUGIN_NAME_STRING MRN_STRINGIFY(MRN_PLUGIN_NAME)
+
 static const char *index_column_name = "index";
 
 #ifdef __cplusplus
@@ -514,8 +524,10 @@ static struct st_mysql_storage_engine storage_engine_structure =
 
 static struct st_mysql_show_var mrn_status_variables[] =
 {
-  {"groonga_count_skip", (char *) &mrn_count_skip, SHOW_LONG},
-  {"groonga_fast_order_limit", (char *) &mrn_fast_order_limit, SHOW_LONG},
+  {MRN_PLUGIN_NAME_STRING "_count_skip",
+   (char *)&mrn_count_skip, SHOW_LONG},
+  {MRN_PLUGIN_NAME_STRING "_fast_order_limit",
+   (char *)&mrn_fast_order_limit, SHOW_LONG},
   {NullS, NullS, SHOW_LONG}
 };
 
@@ -602,7 +614,7 @@ static void mrn_log_file_update(THD *thd, struct st_mysql_sys_var *var,
 
 static MYSQL_SYSVAR_STR(log_file, mrn_log_file_path,
                         PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_MEMALLOC,
-                        "log file for groonga",
+                        "log file for " MRN_PLUGIN_NAME_STRING,
                         NULL,
                         mrn_log_file_update,
                         MRN_LOG_FILE_PATH);
@@ -794,9 +806,9 @@ struct st_mysql_plugin i_s_mrn_stats =
 {
   MYSQL_INFORMATION_SCHEMA_PLUGIN,
   &i_s_info,
-  "groonga_stats",
+  MRN_PLUGIN_NAME_STRING "_stats",
   plugin_author,
-  "Statistics for groonga",
+  "Statistics for " MRN_PLUGIN_NAME_STRING,
   PLUGIN_LICENSE_GPL,
   i_s_mrn_stats_init,
   i_s_mrn_stats_deinit,
@@ -1531,11 +1543,11 @@ static int mrn_deinit(void *p)
   return 0;
 }
 
-mysql_declare_plugin(mroonga)
+mysql_declare_plugin(MRN_PLUGIN_NAME)
 {
   MYSQL_STORAGE_ENGINE_PLUGIN,
   &storage_engine_structure,
-  "groonga",
+  MRN_PLUGIN_NAME_STRING,
   "Tetsuro IKEDA",
   "CJK-ready fulltext search, column store",
   PLUGIN_LICENSE_GPL,
@@ -1553,11 +1565,11 @@ mysql_declare_plugin(mroonga)
 mysql_declare_plugin_end;
 
 #ifdef MRN_MARIADB_P
-maria_declare_plugin(groonga)
+maria_declare_plugin(MRN_PLUGIN_NAME)
 {
   MYSQL_STORAGE_ENGINE_PLUGIN,
   &storage_engine_structure,
-  "groonga",
+  MRN_PLUGIN_NAME_STRING,
   "Tetsuro IKEDA",
   "CJK-ready fulltext search, column store",
   PLUGIN_LICENSE_GPL,
@@ -1846,7 +1858,7 @@ ha_mroonga::~ha_mroonga()
 const char *ha_mroonga::table_type() const
 {
   MRN_DBUG_ENTER_METHOD();
-  DBUG_RETURN("groonga");
+  DBUG_RETURN(MRN_PLUGIN_NAME_STRING);
 }
 
 const char *ha_mroonga::index_type(uint key_nr)

  Modified: plug.in (+4 -4)
===================================================================
--- plug.in    2011-12-29 14:58:51 +0900 (226bd8c)
+++ plug.in    2011-12-29 16:35:37 +0900 (2c9c15f)
@@ -1,6 +1,6 @@
-MYSQL_STORAGE_ENGINE(groonga,,[mroonga],
+MYSQL_STORAGE_ENGINE(mroonga,,[mroonga],
 [[CJK-ready fulltext search, column store]],
 [max,max-no-ndb])
-MYSQL_PLUGIN_DIRECTORY(groonga, [storage/mroonga])
-MYSQL_PLUGIN_STATIC(groonga,  [libha_groonga.a])
-MYSQL_PLUGIN_DYNAMIC(groonga, [ha_groonga.la])
+MYSQL_PLUGIN_DIRECTORY(mroonga, [storage/mroonga])
+MYSQL_PLUGIN_STATIC(mroonga,  [libmroonga.a])
+MYSQL_PLUGIN_DYNAMIC(mroonga, [ha_mroonga.la])




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