[Groonga-commit] groonga/groonga at b7d855b [master] Ensure removing generated ID for table on error

Back to archive index

Kouhei Sutou null+****@clear*****
Thu Jun 11 11:00:26 JST 2015


Kouhei Sutou	2015-06-11 11:00:26 +0900 (Thu, 11 Jun 2015)

  New Revision: b7d855b321605fe3186958bd01077af711b68621
  https://github.com/groonga/groonga/commit/b7d855b321605fe3186958bd01077af711b68621

  Message:
    Ensure removing generated ID for table on error

  Modified files:
    lib/db.c

  Modified: lib/db.c (+3 -0)
===================================================================
--- lib/db.c    2015-06-11 12:11:49 +0900 (223f86d)
+++ lib/db.c    2015-06-11 11:00:26 +0900 (5eb2042)
@@ -897,6 +897,7 @@ grn_table_create_with_max_n_subrecs(grn_ctx *ctx, const char *name,
         path = buffer;
       } else {
         ERR(GRN_INVALID_ARGUMENT, "path not assigned for persistent table");
+        grn_obj_delete_by_id(ctx, db, id, GRN_TRUE);
         return NULL;
       }
     } else {
@@ -905,10 +906,12 @@ grn_table_create_with_max_n_subrecs(grn_ctx *ctx, const char *name,
   } else {
     if (path) {
       ERR(GRN_INVALID_ARGUMENT, "path assigned for temporary table");
+      grn_obj_delete_by_id(ctx, db, id, GRN_TRUE);
       return NULL;
     }
     if (GRN_DB_PERSISTENT_P(db) && name && name_size) {
       ERR(GRN_INVALID_ARGUMENT, "name assigned for temporary table");
+      grn_obj_delete_by_id(ctx, db, id, GRN_TRUE);
       return NULL;
     }
   }
-------------- next part --------------
HTML����������������������������...
Download 



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