Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
logical_select: fix a bug that offset over shards reduce limit unexpe…
…ctedly
- Loading branch information
Showing
3 changed files
with
193 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
119 changes: 119 additions & 0 deletions
119
test/command/suite/sharding/logical_select/offset/with_limit.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,119 @@ | ||
| plugin_register sharding | ||
| [[0,0.0,0.0],true] | ||
| table_create Logs_20150203 TABLE_NO_KEY | ||
| [[0,0.0,0.0],true] | ||
| column_create Logs_20150203 timestamp COLUMN_SCALAR Time | ||
| [[0,0.0,0.0],true] | ||
| column_create Logs_20150203 memo COLUMN_SCALAR ShortText | ||
| [[0,0.0,0.0],true] | ||
| table_create Times_20150203 TABLE_PAT_KEY Time | ||
| [[0,0.0,0.0],true] | ||
| column_create Times_20150203 timestamp_index COLUMN_INDEX Logs_20150203 timestamp | ||
| [[0,0.0,0.0],true] | ||
| table_create Logs_20150204 TABLE_NO_KEY | ||
| [[0,0.0,0.0],true] | ||
| column_create Logs_20150204 timestamp COLUMN_SCALAR Time | ||
| [[0,0.0,0.0],true] | ||
| column_create Logs_20150204 memo COLUMN_SCALAR ShortText | ||
| [[0,0.0,0.0],true] | ||
| table_create Times_20150204 TABLE_PAT_KEY Time | ||
| [[0,0.0,0.0],true] | ||
| column_create Times_20150204 timestamp_index COLUMN_INDEX Logs_20150204 timestamp | ||
| [[0,0.0,0.0],true] | ||
| table_create Logs_20150205 TABLE_NO_KEY | ||
| [[0,0.0,0.0],true] | ||
| column_create Logs_20150205 timestamp COLUMN_SCALAR Time | ||
| [[0,0.0,0.0],true] | ||
| column_create Logs_20150205 memo COLUMN_SCALAR ShortText | ||
| [[0,0.0,0.0],true] | ||
| table_create Times_20150205 TABLE_PAT_KEY Time | ||
| [[0,0.0,0.0],true] | ||
| column_create Times_20150205 timestamp_index COLUMN_INDEX Logs_20150205 timestamp | ||
| [[0,0.0,0.0],true] | ||
| load --table Logs_20150203 | ||
| [ | ||
| { | ||
| "timestamp": "2015-02-03 12:49:00", | ||
| "memo": "2015-02-03 12:49:00" | ||
| }, | ||
| { | ||
| "timestamp": "2015-02-03 23:59:59", | ||
| "memo": "2015-02-03 23:59:59" | ||
| } | ||
| ] | ||
| [[0,0.0,0.0],2] | ||
| load --table Logs_20150204 | ||
| [ | ||
| { | ||
| "timestamp": "2015-02-04 00:00:00", | ||
| "memo": "2015-02-04 00:00:00" | ||
| }, | ||
| { | ||
| "timestamp": "2015-02-04 13:49:00", | ||
| "memo": "2015-02-04 13:49:00" | ||
| }, | ||
| { | ||
| "timestamp": "2015-02-04 13:50:00", | ||
| "memo": "2015-02-04 13:50:00" | ||
| } | ||
| ] | ||
| [[0,0.0,0.0],3] | ||
| load --table Logs_20150205 | ||
| [ | ||
| { | ||
| "timestamp": "2015-02-05 13:49:00", | ||
| "memo": "2015-02-05 13:49:00" | ||
| }, | ||
| { | ||
| "timestamp": "2015-02-05 13:50:00", | ||
| "memo": "2015-02-05 13:50:00" | ||
| }, | ||
| { | ||
| "timestamp": "2015-02-05 13:51:00", | ||
| "memo": "2015-02-05 13:51:00" | ||
| }, | ||
| { | ||
| "timestamp": "2015-02-05 13:52:00", | ||
| "memo": "2015-02-05 13:52:00" | ||
| } | ||
| ] | ||
| [[0,0.0,0.0],4] | ||
| logical_select Logs timestamp --offset 3 --limit 2 | ||
| [ | ||
| [ | ||
| 0, | ||
| 0.0, | ||
| 0.0 | ||
| ], | ||
| [ | ||
| [ | ||
| [ | ||
| 9 | ||
| ], | ||
| [ | ||
| [ | ||
| "_id", | ||
| "UInt32" | ||
| ], | ||
| [ | ||
| "memo", | ||
| "ShortText" | ||
| ], | ||
| [ | ||
| "timestamp", | ||
| "Time" | ||
| ] | ||
| ], | ||
| [ | ||
| 2, | ||
| "2015-02-04 13:49:00", | ||
| 1423025340.0 | ||
| ], | ||
| [ | ||
| 3, | ||
| "2015-02-04 13:50:00", | ||
| 1423025400.0 | ||
| ] | ||
| ] | ||
| ] | ||
| ] |
73 changes: 73 additions & 0 deletions
73
test/command/suite/sharding/logical_select/offset/with_limit.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,73 @@ | ||
| #@on-error omit | ||
| plugin_register sharding | ||
| #@on-error default | ||
|
|
||
| table_create Logs_20150203 TABLE_NO_KEY | ||
| column_create Logs_20150203 timestamp COLUMN_SCALAR Time | ||
| column_create Logs_20150203 memo COLUMN_SCALAR ShortText | ||
| table_create Times_20150203 TABLE_PAT_KEY Time | ||
| column_create Times_20150203 timestamp_index COLUMN_INDEX Logs_20150203 timestamp | ||
|
|
||
| table_create Logs_20150204 TABLE_NO_KEY | ||
| column_create Logs_20150204 timestamp COLUMN_SCALAR Time | ||
| column_create Logs_20150204 memo COLUMN_SCALAR ShortText | ||
| table_create Times_20150204 TABLE_PAT_KEY Time | ||
| column_create Times_20150204 timestamp_index COLUMN_INDEX Logs_20150204 timestamp | ||
|
|
||
| table_create Logs_20150205 TABLE_NO_KEY | ||
| column_create Logs_20150205 timestamp COLUMN_SCALAR Time | ||
| column_create Logs_20150205 memo COLUMN_SCALAR ShortText | ||
| table_create Times_20150205 TABLE_PAT_KEY Time | ||
| column_create Times_20150205 timestamp_index COLUMN_INDEX Logs_20150205 timestamp | ||
|
|
||
| load --table Logs_20150203 | ||
| [ | ||
| { | ||
| "timestamp": "2015-02-03 12:49:00", | ||
| "memo": "2015-02-03 12:49:00" | ||
| }, | ||
| { | ||
| "timestamp": "2015-02-03 23:59:59", | ||
| "memo": "2015-02-03 23:59:59" | ||
| } | ||
| ] | ||
|
|
||
| load --table Logs_20150204 | ||
| [ | ||
| { | ||
| "timestamp": "2015-02-04 00:00:00", | ||
| "memo": "2015-02-04 00:00:00" | ||
| }, | ||
| { | ||
| "timestamp": "2015-02-04 13:49:00", | ||
| "memo": "2015-02-04 13:49:00" | ||
| }, | ||
| { | ||
| "timestamp": "2015-02-04 13:50:00", | ||
| "memo": "2015-02-04 13:50:00" | ||
| } | ||
| ] | ||
|
|
||
| load --table Logs_20150205 | ||
| [ | ||
| { | ||
| "timestamp": "2015-02-05 13:49:00", | ||
| "memo": "2015-02-05 13:49:00" | ||
| }, | ||
| { | ||
| "timestamp": "2015-02-05 13:50:00", | ||
| "memo": "2015-02-05 13:50:00" | ||
| }, | ||
| { | ||
| "timestamp": "2015-02-05 13:51:00", | ||
| "memo": "2015-02-05 13:51:00" | ||
| }, | ||
| { | ||
| "timestamp": "2015-02-05 13:52:00", | ||
| "memo": "2015-02-05 13:52:00" | ||
| } | ||
| ] | ||
|
|
||
| logical_select Logs timestamp \ | ||
| --offset 3 \ | ||
| --limit 2 |