Navigation Menu

Skip to content

Commit

Permalink
mysql57: support PSI_memory_key for init_alloc_root()
Browse files Browse the repository at this point in the history
  • Loading branch information
kou committed Mar 16, 2015
1 parent faeb121 commit f16fc12
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
4 changes: 2 additions & 2 deletions ha_mroonga.cpp
Expand Up @@ -2683,7 +2683,7 @@ int ha_mroonga::create_share_for_create() const
}
}
}
init_alloc_root(&mem_root_for_create, 1024, 0, MYF(0));
mrn_init_alloc_root(&mem_root_for_create, 1024, 0, MYF(0));
analyzed_for_create = true;
if (table_list) {
share_for_create.table_name = table_list->table_name;
Expand Down Expand Up @@ -3854,7 +3854,7 @@ int ha_mroonga::wrapper_open(const char *name, int mode, uint test_if_locked)
}
}

init_alloc_root(&mem_root, 1024, 0, MYF(0));
mrn_init_alloc_root(&mem_root, 1024, 0, MYF(0));
wrap_key_info = mrn_create_key_info_for_table(share, table, &error);
if (error)
DBUG_RETURN(error);
Expand Down
11 changes: 9 additions & 2 deletions mrn_mysql_compat.h
Expand Up @@ -61,8 +61,15 @@
# define KEY_N_KEY_PARTS(key) (key)->key_parts
#endif

#if MYSQL_VERSION_ID < 100000 || !defined(MRN_MARIADB_P)
# define init_alloc_root(PTR, SZ1, SZ2, FLAG) init_alloc_root(PTR, SZ1, SZ2)
#ifdef MRN_MARIADB_P
# define mrn_init_alloc_root(PTR, SZ1, SZ2, FLAG) \
init_alloc_root(PTR, SZ1, SZ2, FLAG)
#elif MYSQL_VERSION_ID >= 50706
# define mrn_init_alloc_root(PTR, SZ1, SZ2, FLAG) \
init_alloc_root(mrn_memory_key, PTR, SZ1, SZ2)
#else
# define mrn_init_alloc_root(PTR, SZ1, SZ2, FLAG) \
init_alloc_root(PTR, SZ1, SZ2, FLAG)
#endif

#if MYSQL_VERSION_ID < 100002 || !defined(MRN_MARIADB_P)
Expand Down

0 comments on commit f16fc12

Please sign in to comment.