[Groonga-commit] droonga/droonga-engine at a9f5890 [master] groonga: Ignore missing record by delete command

Back to archive index

YUKI Hiroshi null+****@clear*****
Thu Apr 24 14:21:04 JST 2014


YUKI Hiroshi	2014-04-24 14:21:04 +0900 (Thu, 24 Apr 2014)

  New Revision: a9f589028a2c5720a2a2a101aad7581fdf69a6ba
  https://github.com/droonga/droonga-engine/commit/a9f589028a2c5720a2a2a101aad7581fdf69a6ba

  Message:
    groonga: Ignore missing record by delete command

  Modified files:
    lib/droonga/plugins/groonga/delete.rb

  Modified: lib/droonga/plugins/groonga/delete.rb (+4 -2)
===================================================================
--- lib/droonga/plugins/groonga/delete.rb    2014-04-24 14:01:20 +0900 (e2658ae)
+++ lib/droonga/plugins/groonga/delete.rb    2014-04-24 14:21:04 +0900 (5d198ab)
@@ -79,9 +79,11 @@ module Droonga
           def delete_record(table_name, parameters={})
             table = @context[table_name]
             if parameters[:id]
-              table.delete(parameters[:id].to_i)
+              record = table[parameters[:id].to_i]
+              record.delete if record and record.valid_id?
             else
-              table.delete(parameters[:key])
+              record = table[parameters[:key]]
+              record.delete unless record.nil?
             end
             true
           end
-------------- next part --------------
HTML����������������������������...
Download 



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