-
Notifications
You must be signed in to change notification settings - Fork 117
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
functions/time: add test for overflow interval case
- Loading branch information
Showing
2 changed files
with
85 additions
and
0 deletions.
There are no files selected for viewing
67 changes: 67 additions & 0 deletions
67
test/command/suite/select/function/time/time_classify_month/overflow_interval.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,67 @@ | ||
plugin_register functions/time | ||
[[0,0.0,0.0],true] | ||
table_create Timestamps TABLE_PAT_KEY Time | ||
[[0,0.0,0.0],true] | ||
load --table Timestamps | ||
[ | ||
{"_key": "2016-04-30 23:59:59.999999"}, | ||
{"_key": "2016-05-01 00:00:00.000000"}, | ||
{"_key": "2016-05-01 00:00:00.000001"}, | ||
{"_key": "2016-06-30 23:59:59.999999"}, | ||
{"_key": "2016-07-01 00:00:00.000000"}, | ||
{"_key": "2016-07-01 00:00:00.000001"} | ||
] | ||
[[0,0.0,0.0],6] | ||
select Timestamps --sortby _id --limit -1 --output_columns '_key, time_classify_month(_key, 4294967296)' | ||
[ | ||
[ | ||
[ | ||
-22, | ||
0.0, | ||
0.0 | ||
], | ||
"time_classify_month(): the second argument must not be zero: <4294967296>" | ||
], | ||
[ | ||
[ | ||
[ | ||
6 | ||
], | ||
[ | ||
[ | ||
"_key", | ||
"Time" | ||
], | ||
[ | ||
"time_classify_month", | ||
null | ||
] | ||
], | ||
[ | ||
1462060799.999999, | ||
"time_classify_month(): the second argument must not be zero: <4294967296>" | ||
], | ||
[ | ||
1462060800.0, | ||
"time_classify_month(): the second argument must not be zero: <4294967296>" | ||
], | ||
[ | ||
1462060800.000001, | ||
"time_classify_month(): the second argument must not be zero: <4294967296>" | ||
], | ||
[ | ||
1467331199.999999, | ||
"time_classify_month(): the second argument must not be zero: <4294967296>" | ||
], | ||
[ | ||
1467331200.0, | ||
"time_classify_month(): the second argument must not be zero: <4294967296>" | ||
], | ||
[ | ||
1467331200.000001, | ||
"time_classify_month(): the second argument must not be zero: <4294967296>" | ||
] | ||
] | ||
] | ||
] | ||
#|e| time_classify_month(): the second argument must not be zero: <4294967296> |
18 changes: 18 additions & 0 deletions
18
test/command/suite/select/function/time/time_classify_month/overflow_interval.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,18 @@ | ||
plugin_register functions/time | ||
|
||
table_create Timestamps TABLE_PAT_KEY Time | ||
|
||
load --table Timestamps | ||
[ | ||
{"_key": "2016-04-30 23:59:59.999999"}, | ||
{"_key": "2016-05-01 00:00:00.000000"}, | ||
{"_key": "2016-05-01 00:00:00.000001"}, | ||
{"_key": "2016-06-30 23:59:59.999999"}, | ||
{"_key": "2016-07-01 00:00:00.000000"}, | ||
{"_key": "2016-07-01 00:00:00.000001"} | ||
] | ||
|
||
select Timestamps \ | ||
--sortby _id \ | ||
--limit -1 \ | ||
--output_columns '_key, time_classify_month(_key, 4294967296)' |