[Groonga-mysql-commit] mroonga/mroonga at eba0f26 [master] Fix build error with MSVC

Back to archive index

Kouhei Sutou null+****@clear*****
Sun Dec 24 13:21:09 JST 2017


Kouhei Sutou	2017-12-24 13:21:09 +0900 (Sun, 24 Dec 2017)

  New Revision: eba0f269b7eff4ea0a5ca450c069d7bc1cfb2acf
  https://github.com/mroonga/mroonga/commit/eba0f269b7eff4ea0a5ca450c069d7bc1cfb2acf

  Message:
    Fix build error with MSVC

  Modified files:
    ha_mroonga.cpp
    mrn_mysql_compat.h

  Modified: ha_mroonga.cpp (+1 -11)
===================================================================
--- ha_mroonga.cpp    2017-12-24 13:13:14 +0900 (a0447439)
+++ ha_mroonga.cpp    2017-12-24 13:21:09 +0900 (d4d813e9)
@@ -17121,17 +17121,7 @@ int ha_mroonga::storage_get_foreign_key_list(THD *thd,
     uint ref_pkey_nr = tmp_ref_table_share->primary_key;
     KEY *ref_key_info = &tmp_ref_table_share->key_info[ref_pkey_nr];
     Field *ref_field = &ref_key_info->key_part->field[0];
-    mrn_thd_lex_string *ref_col_name =
-      thd_make_lex_string(thd,
-                          NULL,
-#ifdef MRN_FIELD_FIELD_NAME_IS_LEX_STRING
-                          ref_field->field_name.str,
-                          ref_field->field_name.length,
-#else
-                          ref_field->field_name,
-                          strlen(ref_field->field_name),
-#endif
-                          TRUE);
+    mrn_thd_lex_string *ref_col_name = FIELD_NAME_TO_LEX_STRING(thd, ref_field);
     f_key_info.referenced_fields.push_back(ref_col_name);
     mrn_open_mutex_lock(table_share);
     mrn_free_tmp_table_share(tmp_ref_table_share);

  Modified: mrn_mysql_compat.h (+12 -0)
===================================================================
--- mrn_mysql_compat.h    2017-12-24 13:13:14 +0900 (86305e83)
+++ mrn_mysql_compat.h    2017-12-24 13:21:09 +0900 (970e0078)
@@ -115,6 +115,12 @@
    strncmp((field1)->field_name.str,                                    \
            (field2)->field_name.str,                                    \
            (field1)->field_name.length) == 0)
+#  define FIELD_NAME_TO_LEX_STRING(thd, field)                          \
+  thd_make_lex_string((thd),                                            \
+                      NULL,                                             \
+                      (field)->field_name.str,                          \
+                      (field)->field_name.length,                       \
+                      TRUE);
 #  define FIELD_NAME_FORMAT "%.*s"
 #  define FIELD_NAME_FORMAT_VALUE(field)                                \
   static_cast<int>((field)->field_name.length), (field)->field_name.str
@@ -128,6 +134,12 @@
    strncmp((field)->field_name, string->str, string->length) == 0)
 #  define FIELD_NAME_EQUAL_FIELD(field1, field2)                        \
   (strcmp((field1)->field_name, (field2)->field_name) == 0)
+#  define FIELD_NAME_TO_LEX_STRING(thd, field)          \
+   thd_make_lex_string((thd),                           \
+                       NULL,                            \
+                       (field)->field_name,             \
+                       strlen((field)->field_name),     \
+                       TRUE);
 #  define FIELD_NAME_FORMAT "%s"
 #  define FIELD_NAME_FORMAT_VALUE(field) (field)->field_name
 #endif
-------------- next part --------------
HTML����������������������������...
URL: https://lists.osdn.me/mailman/archives/groonga-mysql-commit/attachments/20171224/ac64994d/attachment-0001.htm 



More information about the Groonga-mysql-commit mailing list
Back to archive index