[Groonga-mysql-commit] mroonga/mroonga at b2b9795 [master] mysql57: add NULL check in reset()

Back to archive index

Kouhei Sutou null+****@clear*****
Wed Mar 18 00:24:33 JST 2015


Kouhei Sutou	2015-03-18 00:24:33 +0900 (Wed, 18 Mar 2015)

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

  Message:
    mysql57: add NULL check in reset()
    
    Because table->pos_in_table_list may be NULL.

  Modified files:
    ha_mroonga.cpp

  Modified: ha_mroonga.cpp (+21 -8)
===================================================================
--- ha_mroonga.cpp    2015-03-18 00:20:19 +0900 (7f8f3b3)
+++ ha_mroonga.cpp    2015-03-18 00:24:33 +0900 (8b3107e)
@@ -11170,16 +11170,29 @@ int ha_mroonga::generic_reset()
 {
   MRN_DBUG_ENTER_METHOD();
   int error = 0;
-  if (thd_sql_command(ha_thd()) == SQLCOM_SELECT) {
-    st_select_lex *select_lex = table->pos_in_table_list->select_lex;
-    List_iterator<Item_func_match> iterator(*(select_lex->ftfunc_list));
-    Item_func_match *item;
-    while ((item = iterator++)) {
-      if (item->ft_handler) {
-        mrn_generic_ft_clear(item->ft_handler);
-      }
+
+  if (thd_sql_command(ha_thd()) != SQLCOM_SELECT) {
+    DBUG_RETURN(error);
+  }
+
+  TABLE_LIST *table_list = table->pos_in_table_list;
+  if (!table_list) {
+    DBUG_RETURN(error);
+  }
+
+  st_select_lex *select_lex = table_list->select_lex;
+  if (!select_lex) {
+    DBUG_RETURN(error);
+  }
+
+  List_iterator<Item_func_match> iterator(*(select_lex->ftfunc_list));
+  Item_func_match *item;
+  while ((item = iterator++)) {
+    if (item->ft_handler) {
+      mrn_generic_ft_clear(item->ft_handler);
     }
   }
+
   DBUG_RETURN(error);
 }
 
-------------- next part --------------
HTML����������������������������...
다운로드 



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