[Groonga-commit] groonga/groonga at c279731 [master] table_remove: disable removing referenced table

Back to archive index

Kouhei Sutou null+****@clear*****
Sat Aug 3 20:35:02 JST 2013


Kouhei Sutou	2013-08-03 20:35:02 +0900 (Sat, 03 Aug 2013)

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

  Message:
    table_remove: disable removing referenced table
    
    Patricia trie table referenced by other double array trie table should
    not be removed.

  Added files:
    test/command/suite/table_remove/patricia_trie/referenced/table_double_trie_array.expected
    test/command/suite/table_remove/patricia_trie/referenced/table_double_trie_array.test
  Modified files:
    lib/db.c

  Modified: lib/db.c (+1 -0)
===================================================================
--- lib/db.c    2013-08-03 20:32:47 +0900 (5f61da4)
+++ lib/db.c    2013-08-03 20:35:02 +0900 (f0a8fbf)
@@ -6664,6 +6664,7 @@ is_removable_table(grn_ctx *ctx, grn_obj *table, grn_obj *db)
 
       switch (object->header.type) {
       case GRN_TABLE_PAT_KEY :
+      case GRN_TABLE_DAT_KEY :
         if (DB_OBJ(object)->id == table_id) {
           break;
         }

  Added: test/command/suite/table_remove/patricia_trie/referenced/table_double_trie_array.expected (+21 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/table_remove/patricia_trie/referenced/table_double_trie_array.expected    2013-08-03 20:35:02 +0900 (c845c5c)
@@ -0,0 +1,21 @@
+table_create Names TABLE_PAT_KEY ShortText
+[[0,0.0,0.0],true]
+table_create Users TABLE_DAT_KEY Names
+[[0,0.0,0.0],true]
+table_remove Names
+[
+  [
+    [
+      -2,
+      0.0,
+      0.0
+    ],
+    "[table][remove] a table that references the table exists: <Users._key> -> <Names>"
+  ],
+  false
+]
+#|e| [table][remove] a table that references the table exists: <Users._key> -> <Names>
+dump
+table_create Names TABLE_PAT_KEY ShortText
+table_create Users TABLE_DAT_KEY Names
+

  Added: test/command/suite/table_remove/patricia_trie/referenced/table_double_trie_array.test (+6 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/table_remove/patricia_trie/referenced/table_double_trie_array.test    2013-08-03 20:35:02 +0900 (c461792)
@@ -0,0 +1,6 @@
+table_create Names TABLE_PAT_KEY ShortText
+table_create Users TABLE_DAT_KEY Names
+
+table_remove Names
+
+dump
-------------- next part --------------
HTML����������������������������...
Download 



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