[Groonga-mysql-commit] mroonga/mroonga at 0ae95c2 [master] Fix a crash bug when no active index

Back to archive index

Kouhei Sutou null+****@clear*****
Wed Jul 19 18:32:16 JST 2017


Kouhei Sutou	2017-07-19 18:32:16 +0900 (Wed, 19 Jul 2017)

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

  Message:
    Fix a crash bug when no active index
    
    Gitter: https://gitter.im/groonga/ja?at=596714a5c101bc4e3a7db4e5
    
    Reported by K Torimoto. Thanks!!!

  Modified files:
    ha_mroonga.cpp
    lib/mrn_count_skip_checker.cpp

  Modified: ha_mroonga.cpp (+4 -1)
===================================================================
--- ha_mroonga.cpp    2017-07-06 13:26:11 +0900 (2a167b9)
+++ ha_mroonga.cpp    2017-07-19 18:32:16 +0900 (288908a)
@@ -10303,7 +10303,10 @@ void ha_mroonga::check_count_skip(key_part_map target_key_part_map)
   }
 
   st_select_lex *select_lex = table->pos_in_table_list->select_lex;
-  KEY *key_info = &(table->key_info[active_index]);
+  KEY *key_info = nullptr;
+  if (active_index != MAX_KEY) {
+    key_info = &(table->key_info[active_index]);
+  }
   mrn::CountSkipChecker checker(ctx,
                                 table,
                                 select_lex,

  Modified: lib/mrn_count_skip_checker.cpp (+9 -1)
===================================================================
--- lib/mrn_count_skip_checker.cpp    2017-07-06 13:26:11 +0900 (6c468e2)
+++ lib/mrn_count_skip_checker.cpp    2017-07-19 18:32:16 +0900 (8dcb024)
@@ -1,7 +1,7 @@
 /* -*- c-basic-offset: 2 -*- */
 /*
   Copyright(C) 2010-2013 Kentoku SHIBA
-  Copyright(C) 2011-2016 Kouhei Sutou <kou �� clear-code.com>
+  Copyright(C) 2011-2017 Kouhei Sutou <kou �� clear-code.com>
 
   This library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Lesser General Public
@@ -267,6 +267,14 @@ namespace mrn {
       DBUG_RETURN(false);
     }
 
+    if (!key_info_) {
+      GRN_LOG(ctx_, GRN_LOG_DEBUG,
+              "[mroonga][count-skip][false] no active index: <%s>:<%s>",
+              *(field->table_name),
+              field->field_name);
+      DBUG_RETURN(false);
+    }
+
     uint i;
     KEY_PART_INFO *key_part = key_info_->key_part;
     for (i = 0; i < KEY_N_KEY_PARTS(key_info_); i++) {
-------------- next part --------------
HTML����������������������������...
Download 



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