[Groonga-mysql-commit] mroonga/mroonga [fix-for-visual-studio] Change from table level lock to row level lock for storage mode. refs #1271

Back to archive index

Kentoku null+****@clear*****
Thu Oct 4 10:37:03 JST 2012


Kentoku	2012-02-06 05:08:33 +0900 (Mon, 06 Feb 2012)

  New Revision: 11c6c8fb748562f770ac1a211c17209211a1e9a3
  https://github.com/mroonga/mroonga/commit/11c6c8fb748562f770ac1a211c17209211a1e9a3

  Log:
    Change from table level lock to row level lock for storage mode. refs #1271

  Modified files:
    ha_mroonga.cc

  Modified: ha_mroonga.cc (+10 -1)
===================================================================
--- ha_mroonga.cc    2012-02-05 15:24:16 +0900 (772ee5e)
+++ ha_mroonga.cc    2012-02-06 05:08:33 +0900 (59cb127)
@@ -3611,7 +3611,15 @@ THR_LOCK_DATA **ha_mroonga::storage_store_lock(THD *thd, THR_LOCK_DATA **to,
                                                enum thr_lock_type lock_type)
 {
   MRN_DBUG_ENTER_METHOD();
-  if (lock_type != TL_IGNORE && thr_lock_data.type == TL_UNLOCK) {
+  if (lock_type != TL_IGNORE && thr_lock_data.type == TL_UNLOCK &&
+    !thd_in_lock_tables(thd)) {
+    if (lock_type == TL_READ_NO_INSERT) {
+      lock_type = TL_READ;
+    } else if (lock_type >= TL_WRITE_CONCURRENT_INSERT &&
+               lock_type <= TL_WRITE && !thd_tablespace_op(thd)) {
+      lock_type = TL_WRITE_ALLOW_WRITE;
+    }
+
     thr_lock_data.type = lock_type;
   }
   *to++ = &thr_lock_data;
@@ -3622,6 +3630,7 @@ THR_LOCK_DATA **ha_mroonga::store_lock(THD *thd, THR_LOCK_DATA **to,
                                        enum thr_lock_type lock_type)
 {
   MRN_DBUG_ENTER_METHOD();
+  DBUG_PRINT("info", ("mroonga: lock_type=%d", lock_type));
   if (share->wrapper_mode)
     to = wrapper_store_lock(thd, to, lock_type);
   else
-------------- next part --------------
HTML����������������������������...
다운로드 



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