[Groonga-mysql-commit] mroonga/mroonga at b899b2a [master] Fix wrong return value

Back to archive index

Kouhei Sutou null+****@clear*****
Fri Aug 22 22:24:36 JST 2014


Kouhei Sutou	2014-08-22 22:24:36 +0900 (Fri, 22 Aug 2014)

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

  Message:
    Fix wrong return value
    
    We should not use grn_rc for error code in MySQL. grn_rc should be
    converted to MySQL error code.

  Modified files:
    ha_mroonga.cpp

  Modified: ha_mroonga.cpp (+6 -2)
===================================================================
--- ha_mroonga.cpp    2014-08-22 22:21:54 +0900 (f1edfae)
+++ ha_mroonga.cpp    2014-08-22 22:24:36 +0900 (22a5111)
@@ -4408,12 +4408,14 @@ int ha_mroonga::wrapper_delete_index(const char *name, MRN_SHARE *tmp_share,
   }
 
   grn_obj *table = grn_ctx_get(ctx, table_name, strlen(table_name));
+  if (!ctx->rc) {
+    grn_obj_remove(ctx, table);
+  }
   if (ctx->rc) {
     error = ER_CANT_OPEN_FILE;
     my_message(error, ctx->errbuf, MYF(0));
     DBUG_RETURN(error);
   }
-  error = grn_obj_remove(ctx, table);
   DBUG_RETURN(error);
 }
 
@@ -4441,12 +4443,14 @@ int ha_mroonga::storage_delete_table(const char *name, MRN_SHARE *tmp_share,
   }
 
   grn_obj *table_obj = grn_ctx_get(ctx, table_name, strlen(table_name));
+  if (!ctx->rc) {
+    grn_obj_remove(ctx, table_obj);
+  }
   if (ctx->rc) {
     error = ER_CANT_OPEN_FILE;
     my_message(error, ctx->errbuf, MYF(0));
     DBUG_RETURN(error);
   }
-  error = grn_obj_remove(ctx, table_obj);
   DBUG_RETURN(error);
 }
 
-------------- next part --------------
HTML����������������������������...
Download 



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