Kouhei Sutou
null+****@clear*****
Mon Jul 9 18:17:46 JST 2018
Kouhei Sutou 2018-07-09 18:17:46 +0900 (Mon, 09 Jul 2018) New Revision: 8403545753c6834d875e827367ecbd81a200198d https://github.com/mroonga/mroonga/commit/8403545753c6834d875e827367ecbd81a200198d Message: Use "*thd_ha_data() = " for old MySQL Modified files: ha_mroonga.cpp mrn_mysql_compat.h Modified: ha_mroonga.cpp (+2 -2) =================================================================== --- ha_mroonga.cpp 2018-07-09 17:53:13 +0900 (123f9507) +++ ha_mroonga.cpp 2018-07-09 18:17:46 +0900 (53eba825) @@ -1535,11 +1535,11 @@ static void mrn_drop_database(handlerton *hton, char *path) static int mrn_close_connection(handlerton *hton, THD *thd) { MRN_DBUG_ENTER_FUNCTION(); - void *p = *thd_ha_data(thd, mrn_hton_ptr); + void *p = thd_get_ha_data(thd, mrn_hton_ptr); if (p) { mrn_clear_slot_data(thd); free(p); - *thd_ha_data(thd, mrn_hton_ptr) = (void *) NULL; + mrn_thd_set_ha_data(thd, mrn_hton_ptr, NULL); { mrn::Lock lock(&mrn_allocated_thds_mutex); grn_hash_delete(&mrn_ctx, mrn_allocated_thds, &thd, sizeof(thd), NULL); Modified: mrn_mysql_compat.h (+8 -0) =================================================================== --- mrn_mysql_compat.h 2018-07-09 17:53:13 +0900 (2d46d2f5) +++ mrn_mysql_compat.h 2018-07-09 18:17:46 +0900 (e065cd8a) @@ -731,3 +731,11 @@ typedef HASH mrn_table_def_cache_type; # define MRN_GET_ERR_MSG(code) ER(code) # endif #endif + +#if MYSQL_VERSION_ID < 50600 +# define mrn_thd_set_ha_data(thd, hton, ha_data) \ + *thd_ha_data(thd, hton) = ha_data +#else +# define mrn_thd_set_ha_data(thd, hton, ha_data) \ + thd_set_ha_data(thd, hton, ha_data) +#endif -------------- next part -------------- HTML����������������������������... URL: https://lists.osdn.me/mailman/archives/groonga-mysql-commit/attachments/20180709/74f9acb6/attachment-0001.htm