[Groonga-mysql-commit] mroonga/mroonga at 13858df [master] show error message when creating a table for matched records

Back to archive index

Kentaro Hayashi null+****@clear*****
Fri Jun 2 13:09:26 JST 2017


Kentaro Hayashi	2017-06-02 13:09:26 +0900 (Fri, 02 Jun 2017)

  New Revision: 13858df104f766369e5c7d3b1903d54ee4c7c632
  https://github.com/mroonga/mroonga/commit/13858df104f766369e5c7d3b1903d54ee4c7c632

  Merged a24ae13: Merge pull request #143 from kenhys/check-invalid-argument

  Message:
    show error message when creating a table for matched records
    
    When indexes are broken, there is a case that the value of
     matched_record_keys is null.
    This commit shows error message for such a case.

  Modified files:
    ha_mroonga.cpp

  Modified: ha_mroonga.cpp (+8 -0)
===================================================================
--- ha_mroonga.cpp    2017-06-01 12:11:03 +0900 (9fcd2b3)
+++ ha_mroonga.cpp    2017-06-02 13:09:26 +0900 (4303a41)
@@ -8705,6 +8705,14 @@ FT_INFO *ha_mroonga::generic_ft_init_ext(uint flags, uint key_nr, String *key)
     matched_record_keys = grn_table_create(ctx, NULL, 0, NULL,
                                            GRN_OBJ_TABLE_HASH_KEY | GRN_OBJ_WITH_SUBREC,
                                            grn_table, 0);
+    if (!matched_record_keys) {
+      char error_message[MRN_MESSAGE_BUFFER_SIZE];
+      snprintf(error_message, MRN_MESSAGE_BUFFER_SIZE,
+               "failed to create a table for matched record: <%s>",
+               ctx->errbuf);
+      my_message(ER_ERROR_ON_READ, error_message, MYF(0));
+      GRN_LOG(ctx, GRN_LOG_ERROR, "%s", error_message);
+    }
   }
 
   grn_table_sort_key *sort_keys = NULL;
-------------- next part --------------
HTML����������������������������...
Download 



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