[Groonga-commit] droonga/drnbench at 8b24881 [master] Remove "--sanitize" option.

Back to archive index

SHIMODA Piro Hiroshi null+****@clear*****
Mon Oct 6 10:51:06 JST 2014


SHIMODA "Piro" Hiroshi	2014-10-06 10:51:06 +0900 (Mon, 06 Oct 2014)

  New Revision: 8b24881765b8d1055a683980e1dcd383692df5ef
  https://github.com/droonga/drnbench/commit/8b24881765b8d1055a683980e1dcd383692df5ef

  Message:
    Remove "--sanitize" option.
    
    It should be done by query_flags=NONE.
    http://groonga.org/ja/docs/reference/commands/select.html#query-flags

  Modified files:
    bin/drnbench-extract-searchterms
    doc/text/news.md

  Modified: bin/drnbench-extract-searchterms (+0 -12)
===================================================================
--- bin/drnbench-extract-searchterms    2014-10-06 10:49:20 +0900 (10ceaf7)
+++ bin/drnbench-extract-searchterms    2014-10-06 10:51:06 +0900 (2089d87)
@@ -23,7 +23,6 @@ require "cgi"
 
 options = OpenStruct.new
 options.column_index = 0
-options.sanitize = false
 options.escape = false
 
 option_parser = OptionParser.new do |parser|
@@ -34,10 +33,6 @@ option_parser = OptionParser.new do |parser|
             "(#{options.output_column_index})") do |index|
     options.column_index = index
   end
-  parser.on("--sanitize",
-            "Sanitize dangerous characters for \"query\" parameter") do
-    options.sanitize = true
-  end
   parser.on("--escape",
             "Escape output for URL parameter") do
     options.escape = true
@@ -46,12 +41,6 @@ end
 
 groonga_select_result_files = option_parser.parse!(ARGV)
 
-def sanitize_for_query(value)
-  value.to_s
-       .gsub(/[:;]/, " ")
-       .strip
-end
-
 def escape_for_param(value)
   CGI.escape(value.to_s)
 end
@@ -63,7 +52,6 @@ def output_column_value(select_result, column_index)
   records = search_result[2..-1]
   records.each do |record|
     value = record[column_index]
-    value = sanitize_for_query(value) if options.sanitize
     value = escape_for_param(value) if options.escape
     puts(value)
   end

  Modified: doc/text/news.md (+0 -1)
===================================================================
--- doc/text/news.md    2014-10-06 10:49:20 +0900 (2068cee)
+++ doc/text/news.md    2014-10-06 10:51:06 +0900 (9b0307b)
@@ -7,7 +7,6 @@
      You can simulate load balancing for multiple endpoints easily.
    * Accept plain text file of a list of paths as the patterns file.
  * `drnbench-extract-searchterms`
-   * New `--sanitize` option is introduced to remove special characters for the `query` parameter.
    * New `--escape` option is introduced to escape URI-incompatible characters.
 
 ## 1.0.2: 2014-07-30
-------------- next part --------------
HTML����������������������������...
Download 



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