[Groonga-commit] groonga/groonga at 6203da2 [master] select match_columns: report error for invalid match_columns

Back to archive index

Kouhei Sutou null+****@clear*****
Sat Jan 3 14:23:13 JST 2015


Kouhei Sutou	2015-01-03 14:23:13 +0900 (Sat, 03 Jan 2015)

  New Revision: 6203da2102100451693d726cb80127001bba5b7d
  https://github.com/groonga/groonga/commit/6203da2102100451693d726cb80127001bba5b7d

  Message:
    select match_columns: report error for invalid match_columns
    
    GitHub: fix #269
    
    Reported by Naoya Murakami. Thanks!!!

  Added files:
    test/command/suite/select/match_columns/invalid/table.expected
    test/command/suite/select/match_columns/invalid/table.test
  Modified files:
    lib/mrb/scripts/scan_info_data.rb

  Modified: lib/mrb/scripts/scan_info_data.rb (+2 -0)
===================================================================
--- lib/mrb/scripts/scan_info_data.rb    2014-12-31 00:09:38 +0900 (783f4a1)
+++ lib/mrb/scripts/scan_info_data.rb    2015-01-03 14:23:13 +0900 (cfc1dfc)
@@ -127,6 +127,8 @@ module Groonga
             i += 2
           end
           put_index(value, section_id, code.weight)
+        else
+          raise ErrorMessage, "invalid match target: <#{value.name}>"
         end
         i += 1
       end

  Added: test/command/suite/select/match_columns/invalid/table.expected (+17 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/select/match_columns/invalid/table.expected    2015-01-03 14:23:13 +0900 (d87714f)
@@ -0,0 +1,17 @@
+table_create Memos TABLE_NO_KEY
+[[0,0.0,0.0],true]
+column_create Memos title COLUMN_SCALAR ShortText
+[[0,0.0,0.0],true]
+table_create Lexicon TABLE_PAT_KEY ShortText --default_tokenizer TokenBigram
+[[0,0.0,0.0],true]
+column_create Lexicon memo_index COLUMN_INDEX|WITH_POSITION Memos title
+[[0,0.0,0.0],true]
+load --table Memos
+[
+["title"],
+["Groonga"]
+]
+[[0,0.0,0.0],1]
+select Memos   --match_columns Memos   --query Groonga
+[[[-22,0.0,0.0],"invalid match target: <Memos>"],[]]
+#|e| invalid match target: <Memos>

  Added: test/command/suite/select/match_columns/invalid/table.test (+15 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/select/match_columns/invalid/table.test    2015-01-03 14:23:13 +0900 (2ca240b)
@@ -0,0 +1,15 @@
+table_create Memos TABLE_NO_KEY
+column_create Memos title COLUMN_SCALAR ShortText
+
+table_create Lexicon TABLE_PAT_KEY ShortText --default_tokenizer TokenBigram
+column_create Lexicon memo_index COLUMN_INDEX|WITH_POSITION Memos title
+
+load --table Memos
+[
+["title"],
+["Groonga"]
+]
+
+select Memos \
+  --match_columns Memos \
+  --query Groonga
-------------- next part --------------
HTML����������������������������...
다운로드 



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