[Groonga-commit] groonga/groonga [master] don't call hook for undeletable record.

Back to archive index

null+****@clear***** null+****@clear*****
2010年 9月 24日 (金) 17:02:48 JST


Kouhei Sutou	2010-09-24 08:02:48 +0000 (Fri, 24 Sep 2010)

  New Revision: 06b4b00e57e0fe3a49dcd39dff7f1e522aecb89f

  Log:
    don't call hook for undeletable record.

  Modified files:
    lib/db.c

  Modified: lib/db.c (+4 -4)
===================================================================
--- lib/db.c    2010-10-04 01:19:16 +0000 (1791529)
+++ lib/db.c    2010-09-24 08:02:48 +0000 (ad83ec1)
@@ -1240,11 +1240,11 @@ grn_table_delete(grn_ctx *ctx, grn_obj *table, const void *key, unsigned key_siz
   grn_rc rc = GRN_INVALID_ARGUMENT;
   GRN_API_ENTER;
   if (table) {
-    if (key && key_size) {
-      rid = grn_table_get(ctx, table, key, key_size);
-      call_delete_hook(ctx, table, rid, key, key_size);
-    }
     if (is_deletable(ctx, table, rid)) {
+      if (key && key_size) {
+        rid = grn_table_get(ctx, table, key, key_size);
+        call_delete_hook(ctx, table, rid, key, key_size);
+      }
       switch (table->header.type) {
       case GRN_DB :
         /* todo : delete tables and columns from db */




Groonga-commit メーリングリストの案内
Back to archive index