[Groonga-commit] droonga/droonga-engine at a538a66 [master] select: fix a bug that records structure is incompatible

Back to archive index

Kouhei Sutou null+****@clear*****
Tue May 27 18:08:59 JST 2014


Kouhei Sutou	2014-05-27 18:08:59 +0900 (Tue, 27 May 2014)

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

  Message:
    select: fix a bug that records structure is incompatible
    
    Before:
    
        [[STATUS_CODE, START_TIME, ELAPSED_TIME], HEADER, [RECORD1, RECORD2, ...]]
    
    After:
    
        [[STATUS_CODE, START_TIME, ELAPSED_TIME], HEADER, RECORD1, RECORD2, ...]

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

  Modified: lib/droonga/plugins/groonga/select.rb (+2 -6)
===================================================================
--- lib/droonga/plugins/groonga/select.rb    2014-05-27 17:54:12 +0900 (ee86bfc)
+++ lib/droonga/plugins/groonga/select.rb    2014-05-27 18:08:59 +0900 (92fd9b7)
@@ -196,12 +196,8 @@ module Droonga
           def convert_search_result(result)
             count      = result["count"]
             attributes = convert_attributes(result["attributes"])
-            records    = result["records"]
-            if records.nil? or records.empty?
-              [[count], attributes]
-            else
-              [[count], attributes, records]
-            end
+            records    = result["records"] || []
+            [[count], attributes, *records]
           end
 
           def convert_attributes(attributes)
-------------- next part --------------
HTML����������������������������...
下载 



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