[Groonga-commit] ranguba/groonga-client-model at 8e94951 [master] Escape key

Back to archive index

Kouhei Sutou null+****@clear*****
Tue Dec 6 18:17:39 JST 2016


Kouhei Sutou	2016-12-06 18:17:39 +0900 (Tue, 06 Dec 2016)

  New Revision: 8e94951c7dafeafba11b6a6a0abaa4e7c554c752
  https://github.com/ranguba/groonga-client-model/commit/8e94951c7dafeafba11b6a6a0abaa4e7c554c752

  Message:
    Escape key

  Modified files:
    lib/groonga_client_model/record.rb

  Modified: lib/groonga_client_model/record.rb (+5 -2)
===================================================================
--- lib/groonga_client_model/record.rb    2016-12-06 18:06:26 +0900 (0df9cdf)
+++ lib/groonga_client_model/record.rb    2016-12-06 18:17:39 +0900 (e7fbb7c)
@@ -209,9 +209,12 @@ module GroongaClientModel
           id = response.ids.first
           if id.nil?
             if****@attri*****?("_key")
+              key = _key
+              if key.is_a?(String)
+                key = Groonga::Client::ScryptSyntax.format_string(key)
+              end
               select_response = client.select(table: table.name,
-                                              # TODO: #{_key} is dangerous
-                                              filter: "_key == #{_key}",
+                                              filter: "_key == #{key}",
                                               limit: 1,
                                               output_columns: "_id")
             else
-------------- next part --------------
HTML����������������������������...
다운로드 



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