[Groonga-mysql-commit] mroonga/mroonga at 0ef8879 [master] fix hiding data when lock tables and enable keys are used same time. refs #1778

Back to archive index

Kentoku null+****@clear*****
Wed Jun 19 02:08:40 JST 2013


Kentoku	2013-06-19 02:08:40 +0900 (Wed, 19 Jun 2013)

  New Revision: 0ef887966b7a5c3c47208f55c5818a4a4fa0f69a
  https://github.com/mroonga/mroonga/commit/0ef887966b7a5c3c47208f55c5818a4a4fa0f69a

  Message:
    fix hiding data when lock tables and enable keys are used same time. refs #1778

  Modified files:
    ha_mroonga.cpp

  Modified: ha_mroonga.cpp (+18 -2)
===================================================================
--- ha_mroonga.cpp    2013-06-16 03:38:04 +0900 (9090645)
+++ ha_mroonga.cpp    2013-06-19 02:08:40 +0900 (beb000f)
@@ -99,6 +99,10 @@ extern MYSQL_PLUGIN_IMPORT pthread_mutex_t LOCK_open;
 #  define mrn_open_mutex_unlock()
 #endif
 
+#if MYSQL_VERSION_ID >= 50600 && !defined(MRN_MARIADB_P)
+#  define MRN_NEED_M_LOCK_TYPE_CHECK_FOR_WRAPPER_EXTERNAL_LOCK
+#endif
+
 #if MYSQL_VERSION_ID >= 50603 && !defined(MRN_MARIADB_P)
 #  define MRN_ORDER_IS_ASC(order) ((order)->direction == ORDER::ORDER_ASC)
 #else
@@ -12580,10 +12584,17 @@ int ha_mroonga::wrapper_fill_indexes(THD *thd, KEY *key_info,
   int error = 0;
   KEY *p_key_info = &table->key_info[table_share->primary_key];
   KEY *tmp_key_info;
+#ifdef MRN_NEED_M_LOCK_TYPE_CHECK_FOR_WRAPPER_EXTERNAL_LOCK
+  int wrapper_lock_type_backup = wrap_handler->get_lock_type();
+#endif
   MRN_DBUG_ENTER_METHOD();
   DBUG_PRINT("info", ("mroonga: n_keys=%u", n_keys));
   if (
-    mrn_lock_type != F_UNLCK || !(error = wrapper_external_lock(thd, F_WRLCK))
+    mrn_lock_type != F_UNLCK ||
+#ifdef MRN_NEED_M_LOCK_TYPE_CHECK_FOR_WRAPPER_EXTERNAL_LOCK
+    wrapper_lock_type_backup != F_UNLCK ||
+#endif
+    !(error = wrapper_external_lock(thd, F_WRLCK))
   ) {
     if (
       !(error = wrapper_start_stmt(thd, thr_lock_data.type)) &&
@@ -12668,7 +12679,12 @@ int ha_mroonga::wrapper_fill_indexes(THD *thd, KEY *key_info,
       else
         error = wrapper_rnd_end();
     }
-    if (mrn_lock_type == F_UNLCK)
+    if (
+#ifdef MRN_NEED_M_LOCK_TYPE_CHECK_FOR_WRAPPER_EXTERNAL_LOCK
+      wrapper_lock_type_backup == F_UNLCK &&
+#endif
+      mrn_lock_type == F_UNLCK
+    )
       wrapper_external_lock(thd, F_UNLCK);
   }
   DBUG_RETURN(error);
-------------- next part --------------
HTML����������������������������...
Descargar 



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