mirror of
https://gitee.com/milvus-io/milvus.git
synced 2026-01-02 00:45:30 +08:00
MS-622 Delete vectors should be failed if date range is invalid
Former-commit-id: 58ddce94d743c7dd5e97d2ed0f05658b15e6f69a
This commit is contained in:
parent
a56d6042e6
commit
034157c212
@ -11,6 +11,7 @@ Please mark all change in change log and use the ticket from JIRA.
|
||||
- MS-587 - Count get wrong result after adding vectors and index built immediately
|
||||
- MS-599 - search wrong result when table created with metric_type: IP
|
||||
- MS-601 - Docker logs error caused by get CPUTemperature error
|
||||
- MS-622 - Delete vectors should be failed if date range is invalid
|
||||
|
||||
## Improvement
|
||||
- MS-552 - Add and change the easylogging library
|
||||
|
||||
@ -42,6 +42,8 @@ static const char* DQL_TASK_GROUP = "dql";
|
||||
static const char* DDL_DML_TASK_GROUP = "ddl_dml";
|
||||
static const char* PING_TASK_GROUP = "ping";
|
||||
|
||||
constexpr int64_t DAY_SECONDS = 24 * 60 * 60;
|
||||
|
||||
using DB_META = milvus::engine::meta::Meta;
|
||||
using DB_DATE = milvus::engine::meta::DateT;
|
||||
|
||||
@ -78,8 +80,6 @@ IndexType(engine::EngineType type) {
|
||||
return map_type[type];
|
||||
}
|
||||
|
||||
constexpr int64_t DAY_SECONDS = 24 * 60 * 60;
|
||||
|
||||
Status
|
||||
ConvertTimeRangeToDBDates(const std::vector<::milvus::grpc::Range>& range_array, std::vector<DB_DATE>& dates) {
|
||||
dates.clear();
|
||||
@ -94,10 +94,10 @@ ConvertTimeRangeToDBDates(const std::vector<::milvus::grpc::Range>& range_array,
|
||||
return Status(SERVER_INVALID_TIME_RANGE, "Invalid time range: " + range.start_value());
|
||||
}
|
||||
|
||||
int64_t days = (tt_end > tt_start) ? (tt_end - tt_start) / DAY_SECONDS : (tt_start - tt_end) / DAY_SECONDS;
|
||||
if (days == 0) {
|
||||
int64_t days = (tt_end - tt_start) / DAY_SECONDS;
|
||||
if (days <= 0) {
|
||||
return Status(SERVER_INVALID_TIME_RANGE,
|
||||
"Invalid time range: " + range.start_value() + " to " + range.end_value());
|
||||
"Invalid time range: The start-date should be smaller than end-date!");
|
||||
}
|
||||
|
||||
// range: [start_day, end_day)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user