[Groonga-mysql-commit] mroonga/mroonga [master] [mysql5.5.19][mysql5.6.4] don't free a malloced string plugin variable.

Back to archive index

null+****@clear***** null+****@clear*****
2011年 12月 21日 (水) 14:36:05 JST


Kouhei Sutou	2011-12-21 05:36:05 +0000 (Wed, 21 Dec 2011)

  New Revision: 626d5c4651d5600593b373c4b56e1e4bddd2bdc3

  Log:
    [mysql5.5.19][mysql5.6.4] don't free a malloced string plugin variable.

  Modified files:
    ha_mroonga.cc
    ha_mroonga.h

  Modified: ha_mroonga.cc (+2 -0)
===================================================================
--- ha_mroonga.cc    2011-12-21 03:58:04 +0000 (9494885)
+++ ha_mroonga.cc    2011-12-21 05:36:05 +0000 (b4a6e5b)
@@ -273,7 +273,9 @@ static void mrn_default_parser_update(THD *thd, struct st_mysql_sys_var *var,
             "default fulltext parser is changed: <%s> -> <%s>",
             *old_value_ptr, new_value);
 
+#ifdef MRN_NEED_FREE_STRING_MEMALLOC_PLUGIN_VAR
     my_free(*old_value_ptr, MYF(0));
+#endif
     *old_value_ptr = my_strdup(new_value, MYF(MY_WME));
   }
   grn_ctx_fin(&ctx);

  Modified: ha_mroonga.h (+5 -0)
===================================================================
--- ha_mroonga.h    2011-12-21 03:58:04 +0000 (2d3b8fd)
+++ ha_mroonga.h    2011-12-21 05:36:05 +0000 (d0457fd)
@@ -91,6 +91,11 @@ extern "C" {
 #  define MRN_HAVE_MYSQL_TYPE_TIME2
 #endif
 
+#if (MYSQL_VERSION_ID < 50519) || \
+    (50600 <= MYSQL_VERSION_ID && MYSQL_VERSION_ID < 50604)
+#  define MRN_NEED_FREE_STRING_MEMALLOC_PLUGIN_VAR
+#endif
+
 class ha_mroonga;
 
 /* structs */




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