[Groonga-mysql-commit] mroonga/mroonga [fix-for-visual-studio] change getting record_id error to warning. refs #1224

Back to archive index

Kentoku null+****@clear*****
Thu Oct 4 10:33:49 JST 2012


Kentoku	2011-12-26 02:19:49 +0900 (Mon, 26 Dec 2011)

  New Revision: 7501725fdf2649f67b6c3685915fc16bf9ec5136
  https://github.com/mroonga/mroonga/commit/7501725fdf2649f67b6c3685915fc16bf9ec5136

  Log:
    change getting record_id error to warning. refs #1224

  Modified files:
    ha_mroonga.cc

  Modified: ha_mroonga.cc (+9 -7)
===================================================================
--- ha_mroonga.cc    2011-12-24 23:33:00 +0900 (7f07de3)
+++ ha_mroonga.cc    2011-12-26 02:19:49 +0900 (3fd3a79)
@@ -3977,16 +3977,16 @@ int ha_mroonga::wrapper_write_row_index(uchar *buf)
                             GRN_TEXT_LEN(&key_buffer),
                             &added);
   if (record_id == GRN_ID_NIL) {
+    DBUG_PRINT("info", ("mroonga: failed to add a new record into groonga"));
     char error_message[MRN_MESSAGE_BUFFER_SIZE];
     snprintf(error_message, MRN_MESSAGE_BUFFER_SIZE,
              "failed to add a new record into groonga: key=<%.*s>",
              (int)GRN_TEXT_LEN(&key_buffer),
              GRN_TEXT_VALUE(&key_buffer));
     error = ER_ERROR_ON_WRITE;
-    my_message(error, error_message, MYF(0));
-  }
-  if (error) {
-    DBUG_RETURN(error);
+    push_warning(ha_thd(), Sql_condition::WARN_LEVEL_WARN, error,
+                 error_message);
+    DBUG_RETURN(0);
   }
 
 #ifndef DBUG_OFF
@@ -4312,12 +4312,14 @@ int ha_mroonga::wrapper_get_record_id(uchar *data, grn_id *record_id,
   *record_id = grn_table_get(ctx, grn_table,
                              GRN_TEXT_VALUE(&key), GRN_TEXT_LEN(&key));
   if (*record_id == GRN_ID_NIL) {
+    DBUG_PRINT("info", ("mroonga: %s", context));
     char error_message[MRN_MESSAGE_BUFFER_SIZE];
     snprintf(error_message, MRN_MESSAGE_BUFFER_SIZE,
              "%s: key=<%.*s>",
              context, (int)GRN_TEXT_LEN(&key), GRN_TEXT_VALUE(&key));
     error = ER_ERROR_ON_WRITE;
-    my_message(error, error_message, MYF(0));
+    push_warning(ha_thd(), Sql_condition::WARN_LEVEL_WARN, error,
+                 error_message);
   }
   grn_obj_unlink(ctx, &key);
 
@@ -4392,7 +4394,7 @@ int ha_mroonga::wrapper_update_row_index(const uchar *old_data, uchar *new_data)
     field->move_field_offset(-ptr_diff);
   }
   if (error) {
-    DBUG_RETURN(error);
+    DBUG_RETURN(0);
   }
 
 #ifndef DBUG_OFF
@@ -4708,7 +4710,7 @@ int ha_mroonga::wrapper_delete_row_index(const uchar *buf)
                                 "failed to get record ID "
                                 "for deleting from groonga");
   if (error) {
-    DBUG_RETURN(error);
+    DBUG_RETURN(0);
   }
 
 #ifndef DBUG_OFF
-------------- next part --------------
HTML����������������������������...
Download 



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