[Groonga-commit] groonga/grnxx at da92efe [master] Disable to remove a referenced table.

Back to archive index

susumu.yata null+****@clear*****
Thu Oct 2 17:49:24 JST 2014


susumu.yata	2014-10-02 17:49:24 +0900 (Thu, 02 Oct 2014)

  New Revision: da92efe2b285f89323d7a3b08d9b080f87330af8
  https://github.com/groonga/grnxx/commit/da92efe2b285f89323d7a3b08d9b080f87330af8

  Message:
    Disable to remove a referenced table.

  Modified files:
    lib/grnxx/table.cpp

  Modified: lib/grnxx/table.cpp (+6 -1)
===================================================================
--- lib/grnxx/table.cpp    2014-10-02 17:20:49 +0900 (9eddbb1)
+++ lib/grnxx/table.cpp    2014-10-02 17:49:24 +0900 (0f0a73b)
@@ -595,7 +595,12 @@ bool Table::rename(Error *error, const StringCRef &new_name) {
 }
 
 bool Table::is_removable() {
-  // TODO: Referenced table (except self-reference) is not removable.
+  // Referenced table (except self-reference) is not removable.
+  for (Int i = 0; i < referrer_columns_.size(); ++i) {
+    if (referrer_columns_[i]->table() != this) {
+      return false;
+    }
+  }
   return true;
 }
 
-------------- next part --------------
HTML����������������������������...
Download 



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