[Groonga-commit] droonga/fluent-plugin-droonga at 1d8344a [master] Handle error for unknown or anonymous table for column_create and table_remove

Back to archive index

YUKI Hiroshi null+****@clear*****
Wed Jan 22 19:38:09 JST 2014


YUKI Hiroshi	2014-01-22 19:38:09 +0900 (Wed, 22 Jan 2014)

  New Revision: 1d8344a5e4cf927ee4995a99c55c5722b8b42505
  https://github.com/droonga/fluent-plugin-droonga/commit/1d8344a5e4cf927ee4995a99c55c5722b8b42505

  Message:
    Handle error for unknown or anonymous table for column_create and table_remove

  Modified files:
    lib/droonga/plugin/handler/groonga/column_create.rb
    lib/droonga/plugin/handler/groonga/table_remove.rb

  Modified: lib/droonga/plugin/handler/groonga/column_create.rb (+7 -0)
===================================================================
--- lib/droonga/plugin/handler/groonga/column_create.rb    2014-01-22 19:29:42 +0900 (de6e79a)
+++ lib/droonga/plugin/handler/groonga/column_create.rb    2014-01-22 19:38:09 +0900 (dc501f5)
@@ -25,6 +25,13 @@ module Droonga
         command_class = Groonga::Command.find("column_create")
         @command = command_class.new("column_create", request)
 
+        table_name = @command["table"]
+        if table_name.nil? || @context[table_name].nil?
+          raise CommandError.new(:status => Status::INVALID_ARGUMENT,
+                                 :message => "table doesn't exist:<#{table_name.to_s}>",
+                                 :result => false)
+        end
+
         if****@comma*****_index?
           define_index
         else

  Modified: lib/droonga/plugin/handler/groonga/table_remove.rb (+2 -2)
===================================================================
--- lib/droonga/plugin/handler/groonga/table_remove.rb    2014-01-22 19:29:42 +0900 (6c590b0)
+++ lib/droonga/plugin/handler/groonga/table_remove.rb    2014-01-22 19:38:09 +0900 (24dd536)
@@ -26,9 +26,9 @@ module Droonga
         @command = command_class.new("table_remove", request)
 
         name = @command["name"]
-        unless name
+        if name.nil? || @context[name].nil?
           raise CommandError.new(:status => Status::INVALID_ARGUMENT,
-                                 :message => "Cannot remove anonymous table",
+                                 :message => "table not found",
                                  :result => false)
         end
 
-------------- next part --------------
HTML����������������������������...
Download 



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