Kentaro Hayashi 2018-11-19 18:08:40 +0900 (Mon, 19 Nov 2018) Revision: 8f327ea34dd71c13edbeaadc45f5af1688c21091 https://github.com/mroonga/mroonga/commit/8f327ea34dd71c13edbeaadc45f5af1688c21091 Message: Simplify Modified files: ha_mroonga.cpp mrn_mysql_compat.h Modified: ha_mroonga.cpp (+1 -5) =================================================================== --- ha_mroonga.cpp 2018-11-19 17:52:14 +0900 (f786611e) +++ ha_mroonga.cpp 2018-11-19 18:08:40 +0900 (75fad818) @@ -4153,11 +4153,7 @@ bool ha_mroonga::storage_create_foreign_key(TABLE *table, "reference column [%s.%s.%s] is not used for primary key", table->s->db.str, normalized_ref_table_name, -#ifdef MRN_KEY_PART_SPEC_FIELD_NAME_USE_ACCESSSOR_FUNCTION - ref_field_name); -#else - ref_field_name->str); -#endif + MRN_KEY_PART_SPEC_FIELD_NAME_CSTR(ref_field_name)); my_message(error, err_msg, MYF(0)); DBUG_RETURN(false); } Modified: mrn_mysql_compat.h (+4 -0) =================================================================== --- mrn_mysql_compat.h 2018-11-19 17:52:14 +0900 (0a8d3e6e) +++ mrn_mysql_compat.h 2018-11-19 18:08:40 +0900 (aae777b0) @@ -171,12 +171,16 @@ (key_part_spec) # define MRN_FIELD_NAME_EQUAL_KEY_PART_SPEC_FIELD_NAME(field, name) \ (strcmp((field)->field_name, name) == 0) +# define MRN_KEY_PART_SPEC_FIELD_NAME_CSTR(key_part_spec) \ + (key_part_spec) #else # define MRN_KEY_PART_SPEC_FIELD_NAME(key_part_spec) \ &(key_part_spec)->field_name # define MRN_KEY_PART_SPEC_FIELD_NAME_FORMAT "%.*s" # define MRN_KEY_PART_SPEC_FIELD_NAME_VALUE(key_part_spec) \ static_cast<int>((key_part_spec)->length), (key_part_spec)->str +# define MRN_KEY_PART_SPEC_FIELD_NAME_CSTR(key_part_spec) \ + (key_part_spec)->str) # ifdef MRN_FIELD_FIELD_NAME_IS_LEX_STRING # define MRN_FIELD_NAME_EQUAL_KEY_PART_SPEC_FIELD_NAME(field, string) \ FIELD_NAME_EQUAL_STRING(field, string) -------------- next part -------------- An HTML attachment was scrubbed... URL: <https://lists.osdn.me/mailman/archives/groonga-mysql-commit/attachments/20181119/0bc04543/attachment-0001.html>