提交 c2e8aa96 编写于 作者: H Haojun Liao

refactor: do some internal refactor.

上级 f5dacec3
......@@ -338,7 +338,7 @@ int32_t parseLocaltime(char* timestr, int32_t len, int64_t* time, int32_t timePr
struct tm tm = {0};
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;
}
......@@ -373,7 +373,7 @@ int32_t parseLocaltimeDst(char* timestr, int32_t len, int64_t* time, int32_t tim
tm.tm_isdst = -1;
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;
}
......
......@@ -4201,13 +4201,13 @@ int32_t sampleFunction(SqlFunctionCtx* pCtx) {
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;
colDataAppend(pOutput, pos, pInfo->data + i * pInfo->colBytes, false);
//TODO: handle ts output
}
return pInfo->numSampled - alreadySampled;
return pInfo->numSampled;
}
bool getTailFuncEnv(SFunctionNode* pFunc, SFuncExecEnv* pEnv) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册