Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
search: care about nonexistent column reference case
- Loading branch information
Showing
4 changed files
with
119 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
test/command/suite/search/condition/query/nonexistent_column.catalog.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| { | ||
| "datasets": { | ||
| "Droonga": { | ||
| "fact": "Memos", | ||
| "schema": { | ||
| "Memos": { | ||
| "type": "Hash", | ||
| "keyType": "ShortText", | ||
| "columns": { | ||
| "content": { | ||
| "type": "Scalar", | ||
| "valueType": "Text" | ||
| } | ||
| } | ||
| }, | ||
| "Terms": { | ||
| "type": "PatriciaTrie", | ||
| "keyType": "ShortText", | ||
| "tokenizer": "TokenBigram", | ||
| "normalizer": "NormalizerAuto", | ||
| "columns": { | ||
| "memos_index": { | ||
| "type": "Index", | ||
| "valueType": "Memos", | ||
| "indexOptions": { | ||
| "sources": [ | ||
| "content" | ||
| ] | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
|
|
48 changes: 48 additions & 0 deletions
48
test/command/suite/search/condition/query/nonexistent_column.expected
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| { | ||
| "inReplyTo": "request-id", | ||
| "statusCode": 400, | ||
| "type": "search.result", | ||
| "body": { | ||
| "name": "SyntaxError", | ||
| "message": "Syntax error: syntax:<query> input:<nonexistent:Droonga>", | ||
| "detail": { | ||
| "syntax": "query", | ||
| "input": "nonexistent:Droonga" | ||
| } | ||
| }, | ||
| "errors": { | ||
| "sources0": { | ||
| "statusCode": 400, | ||
| "body": { | ||
| "name": "SyntaxError", | ||
| "message": "Syntax error: syntax:<query> input:<nonexistent:Droonga>", | ||
| "detail": { | ||
| "syntax": "query", | ||
| "input": "nonexistent:Droonga" | ||
| } | ||
| } | ||
| }, | ||
| "sources1": { | ||
| "statusCode": 400, | ||
| "body": { | ||
| "name": "SyntaxError", | ||
| "message": "Syntax error: syntax:<query> input:<nonexistent:Droonga>", | ||
| "detail": { | ||
| "syntax": "query", | ||
| "input": "nonexistent:Droonga" | ||
| } | ||
| } | ||
| }, | ||
| "sources2": { | ||
| "statusCode": 400, | ||
| "body": { | ||
| "name": "SyntaxError", | ||
| "message": "Syntax error: syntax:<query> input:<nonexistent:Droonga>", | ||
| "detail": { | ||
| "syntax": "query", | ||
| "input": "nonexistent:Droonga" | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } |
33 changes: 33 additions & 0 deletions
33
test/command/suite/search/condition/query/nonexistent_column.test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| # -*- js -*- | ||
| #@require-catalog-version 2 | ||
| #@disable-logging | ||
| { | ||
| "type": "add", | ||
| "dataset": "Droonga", | ||
| "body": { | ||
| "table": "Memos", | ||
| "key": "droonga", | ||
| "values": { | ||
| "content": "Droonga is fun!" | ||
| } | ||
| } | ||
| } | ||
| #@enable-logging | ||
| { | ||
| "type": "search", | ||
| "dataset": "Droonga", | ||
| "body": { | ||
| "queries": { | ||
| "memos": { | ||
| "source": "Memos", | ||
| "condition": { | ||
| "matchTo": ["content"], | ||
| "query": "nonexistent:Droonga" | ||
| }, | ||
| "output": { | ||
| "elements": ["count"] | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } |