[Groonga-mysql-commit] mroonga/mroonga at b9db729 [master] mariadb10.2: follow tdc_acquire_share() API change

Back to archive index

Kouhei Sutou null+****@clear*****
Tue Apr 19 17:34:11 JST 2016


Kouhei Sutou	2016-04-19 17:34:11 +0900 (Tue, 19 Apr 2016)

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

  Message:
    mariadb10.2: follow tdc_acquire_share() API change

  Modified files:
    mrn_mysql_compat.h
    mrn_table.cpp

  Modified: mrn_mysql_compat.h (+3 -0)
===================================================================
--- mrn_mysql_compat.h    2016-04-19 17:22:07 +0900 (92ec946)
+++ mrn_mysql_compat.h    2016-04-19 17:34:11 +0900 (3c8041a)
@@ -103,6 +103,9 @@
 
 #if defined(MRN_MARIADB_P) && MYSQL_VERSION_ID >= 100009
 #  define MRN_HAVE_TDC_ACQUIRE_SHARE
+#  if MYSQL_VERSION_ID < 100200
+#    define MRN_TDC_ACQUIRE_SHARE_REQUIRE_KEY
+#  endif
 #endif
 
 #if MYSQL_VERSION_ID >= 50613

  Modified: mrn_table.cpp (+12 -7)
===================================================================
--- mrn_table.cpp    2016-04-19 17:22:07 +0900 (f77e101)
+++ mrn_table.cpp    2016-04-19 17:34:11 +0900 (7778113)
@@ -1003,29 +1003,34 @@ int mrn_free_share(MRN_SHARE *share)
 
 TABLE_SHARE *mrn_get_table_share(TABLE_LIST *table_list, int *error)
 {
-  uint key_length;
   TABLE_SHARE *share;
   THD *thd = current_thd;
   MRN_DBUG_ENTER_FUNCTION();
-#ifdef MRN_HAVE_GET_TABLE_DEF_KEY
+#if defined(MRN_HAVE_TDC_ACQUIRE_SHARE) &&      \
+  !defined(MRN_TDC_ACQUIRE_SHARE_REQUIRE_KEY)
+  share = tdc_acquire_share(thd, table_list, GTS_TABLE);
+#else
+  uint key_length;
+#  ifdef MRN_HAVE_GET_TABLE_DEF_KEY
   const char *key;
   key_length = get_table_def_key(table_list, &key);
-#else
+#  else
   char key[MAX_DBKEY_LENGTH];
   key_length = create_table_def_key(thd, key, table_list, FALSE);
-#endif
-#ifdef MRN_HAVE_TABLE_DEF_CACHE
+#  endif
+#  ifdef MRN_HAVE_TABLE_DEF_CACHE
   my_hash_value_type hash_value;
   hash_value = my_calc_hash(mrn_table_def_cache, (uchar*) key, key_length);
   share = get_table_share(thd, table_list, key, key_length, 0, error,
                           hash_value);
-#elif defined(MRN_HAVE_TDC_ACQUIRE_SHARE)
+#  elif defined(MRN_HAVE_TDC_ACQUIRE_SHARE)
   share = tdc_acquire_share(thd, table_list->db, table_list->table_name, key,
                             key_length,
                             table_list->mdl_request.key.tc_hash_value(),
                             GTS_TABLE, NULL);
-#else
+#  else
   share = get_table_share(thd, table_list, key, key_length, 0, error);
+#  endif
 #endif
   DBUG_RETURN(share);
 }
-------------- next part --------------
HTML����������������������������...
Download 



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