Navigation Menu

Skip to content

Commit

Permalink
[mysql5.5.19][mysql5.6.4] don't free a malloced string plugin variable.
Browse files Browse the repository at this point in the history
  • Loading branch information
kou committed Dec 21, 2011
1 parent 44d86a9 commit 626d5c4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions ha_mroonga.cc
Expand Up @@ -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);
Expand Down
5 changes: 5 additions & 0 deletions ha_mroonga.h
Expand Up @@ -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 */
Expand Down

0 comments on commit 626d5c4

Please sign in to comment.