refactor: do some internal refactor.
This commit is contained in:
parent
f5dacec38d
commit
c2e8aa9659
|
@ -338,7 +338,7 @@ int32_t parseLocaltime(char* timestr, int32_t len, int64_t* time, int32_t timePr
|
||||||
struct tm tm = {0};
|
struct tm tm = {0};
|
||||||
|
|
||||||
char* str = taosStrpTime(timestr, "%Y-%m-%d %H:%M:%S", &tm);
|
char* str = taosStrpTime(timestr, "%Y-%m-%d %H:%M:%S", &tm);
|
||||||
if (str == NULL || ((str - timestr) < len) || !validateTm(&tm)) {
|
if (str == NULL || (((str - timestr) < len) && (*str != '.')) || !validateTm(&tm)) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -373,7 +373,7 @@ int32_t parseLocaltimeDst(char* timestr, int32_t len, int64_t* time, int32_t tim
|
||||||
tm.tm_isdst = -1;
|
tm.tm_isdst = -1;
|
||||||
|
|
||||||
char* str = taosStrpTime(timestr, "%Y-%m-%d %H:%M:%S", &tm);
|
char* str = taosStrpTime(timestr, "%Y-%m-%d %H:%M:%S", &tm);
|
||||||
if (str == NULL || ((str - timestr) < len) || !validateTm(&tm)) {
|
if (str == NULL || (((str - timestr) < len) && (*str != '.')) || !validateTm(&tm)) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -4201,13 +4201,13 @@ int32_t sampleFunction(SqlFunctionCtx* pCtx) {
|
||||||
doReservoirSample(pInfo, data, tsList[i], i);
|
doReservoirSample(pInfo, data, tsList[i], i);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int32_t i = alreadySampled; i < pInfo->numSampled; ++i) {
|
for (int32_t i = 0; i < pInfo->numSampled; ++i) {
|
||||||
int32_t pos = startOffset + i;
|
int32_t pos = startOffset + i;
|
||||||
colDataAppend(pOutput, pos, pInfo->data + i * pInfo->colBytes, false);
|
colDataAppend(pOutput, pos, pInfo->data + i * pInfo->colBytes, false);
|
||||||
//TODO: handle ts output
|
//TODO: handle ts output
|
||||||
}
|
}
|
||||||
|
|
||||||
return pInfo->numSampled - alreadySampled;
|
return pInfo->numSampled;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool getTailFuncEnv(SFunctionNode* pFunc, SFuncExecEnv* pEnv) {
|
bool getTailFuncEnv(SFunctionNode* pFunc, SFuncExecEnv* pEnv) {
|
||||||
|
|
Loading…
Reference in New Issue