Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: add test case when --query parameter is changed
When the value of --query parameter is changed, Groonga returns result without using cache.
- Loading branch information
Showing
2 changed files
with
140 additions
and
0 deletions.
There are no files selected for viewing
109 changes: 109 additions & 0 deletions
109
test/command/suite/sharding/logical_select/cache/query.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,109 @@ | ||
| plugin_register sharding | ||
| [[0,0.0,0.0],true] | ||
| table_create Memos_20170416 TABLE_NO_KEY | ||
| [[0,0.0,0.0],true] | ||
| column_create Memos_20170416 timestamp COLUMN_SCALAR Time | ||
| [[0,0.0,0.0],true] | ||
| column_create Memos_20170416 content COLUMN_SCALAR Text | ||
| [[0,0.0,0.0],true] | ||
| table_create Memos_20170417 TABLE_NO_KEY | ||
| [[0,0.0,0.0],true] | ||
| column_create Memos_20170417 timestamp COLUMN_SCALAR Time | ||
| [[0,0.0,0.0],true] | ||
| column_create Memos_20170417 content COLUMN_SCALAR Text | ||
| [[0,0.0,0.0],true] | ||
| load --table Memos_20170416 | ||
| [ | ||
| {"timestamp": "2017/04/16 00:00:00", "content": "Groonga is fast."}, | ||
| {"timestamp": "2017/04/16 01:00:00", "content": "Mroonga is fast and easy to use."} | ||
| ] | ||
| [[0,0.0,0.0],2] | ||
| load --table Memos_20170417 | ||
| [ | ||
| {"timestamp": "2017/04/17 10:00:00", "content": "PGroonga is fast and easy to use."}, | ||
| {"timestamp": "2017/04/17 11:00:00", "content": "Rroonga is fast and easy to use."} | ||
| ] | ||
| [[0,0.0,0.0],2] | ||
| logical_select Memos --shard_key timestamp --query 'content:@easy' | ||
| [ | ||
| [ | ||
| 0, | ||
| 0.0, | ||
| 0.0 | ||
| ], | ||
| [ | ||
| [ | ||
| [ | ||
| 3 | ||
| ], | ||
| [ | ||
| [ | ||
| "_id", | ||
| "UInt32" | ||
| ], | ||
| [ | ||
| "content", | ||
| "Text" | ||
| ], | ||
| [ | ||
| "timestamp", | ||
| "Time" | ||
| ] | ||
| ], | ||
| [ | ||
| 2, | ||
| "Mroonga is fast and easy to use.", | ||
| 1492272000.0 | ||
| ], | ||
| [ | ||
| 1, | ||
| "PGroonga is fast and easy to use.", | ||
| 1492390800.0 | ||
| ], | ||
| [ | ||
| 2, | ||
| "Rroonga is fast and easy to use.", | ||
| 1492394400.0 | ||
| ] | ||
| ] | ||
| ] | ||
| ] | ||
| logical_select Memos --shard_key timestamp --query 'content:@groonga' | ||
| [ | ||
| [ | ||
| 0, | ||
| 0.0, | ||
| 0.0 | ||
| ], | ||
| [ | ||
| [ | ||
| [ | ||
| 2 | ||
| ], | ||
| [ | ||
| [ | ||
| "_id", | ||
| "UInt32" | ||
| ], | ||
| [ | ||
| "content", | ||
| "Text" | ||
| ], | ||
| [ | ||
| "timestamp", | ||
| "Time" | ||
| ] | ||
| ], | ||
| [ | ||
| 1, | ||
| "Groonga is fast.", | ||
| 1492268400.0 | ||
| ], | ||
| [ | ||
| 1, | ||
| "PGroonga is fast and easy to use.", | ||
| 1492390800.0 | ||
| ] | ||
| ] | ||
| ] | ||
| ] |
31 changes: 31 additions & 0 deletions
31
test/command/suite/sharding/logical_select/cache/query.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,31 @@ | ||
| #@on-error omit | ||
| plugin_register sharding | ||
| #@on-error default | ||
|
|
||
| table_create Memos_20170416 TABLE_NO_KEY | ||
| column_create Memos_20170416 timestamp COLUMN_SCALAR Time | ||
| column_create Memos_20170416 content COLUMN_SCALAR Text | ||
|
|
||
| table_create Memos_20170417 TABLE_NO_KEY | ||
| column_create Memos_20170417 timestamp COLUMN_SCALAR Time | ||
| column_create Memos_20170417 content COLUMN_SCALAR Text | ||
|
|
||
| load --table Memos_20170416 | ||
| [ | ||
| {"timestamp": "2017/04/16 00:00:00", "content": "Groonga is fast."}, | ||
| {"timestamp": "2017/04/16 01:00:00", "content": "Mroonga is fast and easy to use."} | ||
| ] | ||
|
|
||
| load --table Memos_20170417 | ||
| [ | ||
| {"timestamp": "2017/04/17 10:00:00", "content": "PGroonga is fast and easy to use."}, | ||
| {"timestamp": "2017/04/17 11:00:00", "content": "Rroonga is fast and easy to use."} | ||
| ] | ||
|
|
||
| logical_select Memos \ | ||
| --shard_key timestamp \ | ||
| --query 'content:@easy' | ||
|
|
||
| logical_select Memos \ | ||
| --shard_key timestamp \ | ||
| --query 'content:@groonga' |