Navigation Menu

Skip to content

Commit

Permalink
select match_columns: report error for invalid match_columns
Browse files Browse the repository at this point in the history
GitHub: fix #269

Reported by Naoya Murakami. Thanks!!!
  • Loading branch information
kou committed Jan 3, 2015
1 parent 030a93a commit 6203da2
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/mrb/scripts/scan_info_data.rb
Expand Up @@ -127,6 +127,8 @@ def match_resolve_index_expression(expression)
i += 2
end
put_index(value, section_id, code.weight)
else
raise ErrorMessage, "invalid match target: <#{value.name}>"
end
i += 1
end
Expand Down
17 changes: 17 additions & 0 deletions test/command/suite/select/match_columns/invalid/table.expected
@@ -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>
15 changes: 15 additions & 0 deletions test/command/suite/select/match_columns/invalid/table.test
@@ -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

0 comments on commit 6203da2

Please sign in to comment.