Commit 73033e5e authored by Sergei Golubchik's avatar Sergei Golubchik

fix mroonga to compile w/o performance schema

parent a227cf80
...@@ -160,15 +160,6 @@ static mysql_mutex_t *mrn_LOCK_open; ...@@ -160,15 +160,6 @@ static mysql_mutex_t *mrn_LOCK_open;
# define MRN_ABORT_ON_WARNING(thd) thd->abort_on_warning # define MRN_ABORT_ON_WARNING(thd) thd->abort_on_warning
#endif #endif
#ifdef WIN32
# ifdef MRN_TABLE_SHARE_HAVE_LOCK_SHARE
PSI_mutex_key *mrn_table_share_lock_share;
# endif
# ifdef MRN_TABLE_SHARE_HAVE_LOCK_HA_DATA
PSI_mutex_key *mrn_table_share_lock_ha_data;
# endif
#endif
#if MYSQL_VERSION_ID >= 100007 && defined(MRN_MARIADB_P) #if MYSQL_VERSION_ID >= 100007 && defined(MRN_MARIADB_P)
# define MRN_THD_GET_AUTOINC(thd, off, inc) thd_get_autoinc(thd, off, inc) # define MRN_THD_GET_AUTOINC(thd, off, inc) thd_get_autoinc(thd, off, inc)
# define MRN_GET_ERR_MSG(code) my_get_err_msg(code) # define MRN_GET_ERR_MSG(code) my_get_err_msg(code)
...@@ -202,28 +193,28 @@ uint grn_atoui(const char *nptr, const char *end, const char **rest); ...@@ -202,28 +193,28 @@ uint grn_atoui(const char *nptr, const char *end, const char **rest);
handlerton *mrn_hton_ptr; handlerton *mrn_hton_ptr;
HASH mrn_open_tables; HASH mrn_open_tables;
mysql_mutex_t mrn_open_tables_mutex; mysql_mutex_t mrn_open_tables_mutex;
static PSI_mutex_key mrn_open_tables_mutex_key;
HASH mrn_long_term_share; HASH mrn_long_term_share;
mysql_mutex_t mrn_long_term_share_mutex; mysql_mutex_t mrn_long_term_share_mutex;
static PSI_mutex_key mrn_long_term_share_mutex_key;
HASH mrn_allocated_thds; HASH mrn_allocated_thds;
mysql_mutex_t mrn_allocated_thds_mutex; mysql_mutex_t mrn_allocated_thds_mutex;
PSI_mutex_key mrn_allocated_thds_mutex_key;
PSI_mutex_key mrn_share_mutex_key;
PSI_mutex_key mrn_long_term_share_auto_inc_mutex_key;
/* internal variables */ /* internal variables */
static grn_ctx mrn_ctx; static grn_ctx mrn_ctx;
static mysql_mutex_t mrn_log_mutex; static mysql_mutex_t mrn_log_mutex;
static PSI_mutex_key mrn_log_mutex_key;
static grn_obj *mrn_db; static grn_obj *mrn_db;
static grn_ctx mrn_db_manager_ctx; static grn_ctx mrn_db_manager_ctx;
static mysql_mutex_t mrn_db_manager_mutex; static mysql_mutex_t mrn_db_manager_mutex;
static PSI_mutex_key mrn_db_manager_mutex_key;
mrn::DatabaseManager *mrn_db_manager = NULL; mrn::DatabaseManager *mrn_db_manager = NULL;
#ifdef HAVE_PSI_INTERFACE
PSI_mutex_key mrn_allocated_thds_mutex_key;
static PSI_mutex_key mrn_open_tables_mutex_key;
static PSI_mutex_key mrn_long_term_share_mutex_key;
PSI_mutex_key mrn_share_mutex_key;
PSI_mutex_key mrn_long_term_share_auto_inc_mutex_key;
static PSI_mutex_key mrn_db_manager_mutex_key;
static PSI_mutex_key mrn_log_mutex_key;
static PSI_mutex_info mrn_mutexes[] = static PSI_mutex_info mrn_mutexes[] =
{ {
{&mrn_open_tables_mutex_key, "open_tables", PSI_FLAG_GLOBAL}, {&mrn_open_tables_mutex_key, "open_tables", PSI_FLAG_GLOBAL},
...@@ -236,6 +227,20 @@ static PSI_mutex_info mrn_mutexes[] = ...@@ -236,6 +227,20 @@ static PSI_mutex_info mrn_mutexes[] =
{&mrn_db_manager_mutex_key, "DatabaseManager", PSI_FLAG_GLOBAL} {&mrn_db_manager_mutex_key, "DatabaseManager", PSI_FLAG_GLOBAL}
}; };
#ifdef WIN32
# ifdef MRN_TABLE_SHARE_HAVE_LOCK_SHARE
PSI_mutex_key *mrn_table_share_lock_share;
# endif
# ifdef MRN_TABLE_SHARE_HAVE_LOCK_HA_DATA
PSI_mutex_key *mrn_table_share_lock_ha_data;
# endif
#endif
#else
#undef MRN_TABLE_SHARE_HAVE_LOCK_SHARE
#undef MRN_TABLE_SHARE_HAVE_LOCK_HA_DATA
#endif
#ifdef WIN32 #ifdef WIN32
static inline double round(double x) static inline double round(double x)
...@@ -1476,11 +1481,13 @@ static int mrn_init(void *p) ...@@ -1476,11 +1481,13 @@ static int mrn_init(void *p)
# endif # endif
#endif #endif
#ifdef HAVE_PSI_INTERFACE
if (PSI_server) { if (PSI_server) {
const char *category = "mroonga"; const char *category = "mroonga";
int n_mutexes = array_elements(mrn_mutexes); int n_mutexes = array_elements(mrn_mutexes);
PSI_server->register_mutex(category, mrn_mutexes, n_mutexes); PSI_server->register_mutex(category, mrn_mutexes, n_mutexes);
} }
#endif
if (grn_init() != GRN_SUCCESS) { if (grn_init() != GRN_SUCCESS) {
goto err_grn_init; goto err_grn_init;
......
...@@ -47,6 +47,7 @@ ...@@ -47,6 +47,7 @@
extern HASH *mrn_table_def_cache; extern HASH *mrn_table_def_cache;
#endif #endif
#ifdef HAVE_PSI_INTERFACE
#ifdef WIN32 #ifdef WIN32
# ifdef MRN_TABLE_SHARE_HAVE_LOCK_SHARE # ifdef MRN_TABLE_SHARE_HAVE_LOCK_SHARE
extern PSI_mutex_key *mrn_table_share_lock_share; extern PSI_mutex_key *mrn_table_share_lock_share;
...@@ -55,6 +56,9 @@ extern PSI_mutex_key *mrn_table_share_lock_share; ...@@ -55,6 +56,9 @@ extern PSI_mutex_key *mrn_table_share_lock_share;
extern PSI_mutex_key *mrn_table_share_lock_ha_data; extern PSI_mutex_key *mrn_table_share_lock_ha_data;
# endif # endif
#endif #endif
extern PSI_mutex_key mrn_share_mutex_key;
extern PSI_mutex_key mrn_long_term_share_auto_inc_mutex_key;
#endif
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
...@@ -69,8 +73,6 @@ extern char *mrn_default_wrapper_engine; ...@@ -69,8 +73,6 @@ extern char *mrn_default_wrapper_engine;
extern handlerton *mrn_hton_ptr; extern handlerton *mrn_hton_ptr;
extern HASH mrn_allocated_thds; extern HASH mrn_allocated_thds;
extern mysql_mutex_t mrn_allocated_thds_mutex; extern mysql_mutex_t mrn_allocated_thds_mutex;
extern PSI_mutex_key mrn_share_mutex_key;
extern PSI_mutex_key mrn_long_term_share_auto_inc_mutex_key;
static char *mrn_get_string_between_quote(const char *ptr) static char *mrn_get_string_between_quote(const char *ptr)
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment