fix: the problem of data loss when interval is used for outer query
This commit is contained in:
parent
958f3586c0
commit
675c91cc6b
|
@ -2879,7 +2879,7 @@ int32_t getTableScanInfo(SOperatorInfo* pOperator, int32_t* order, int32_t* scan
|
||||||
*order = TSDB_ORDER_ASC;
|
*order = TSDB_ORDER_ASC;
|
||||||
*scanFlag = MAIN_SCAN;
|
*scanFlag = MAIN_SCAN;
|
||||||
return TSDB_CODE_SUCCESS;
|
return TSDB_CODE_SUCCESS;
|
||||||
} else if (type == QUERY_NODE_PHYSICAL_PLAN_TABLE_SCAN) {
|
} else if (type == QUERY_NODE_PHYSICAL_PLAN_TABLE_SCAN || type == QUERY_NODE_PHYSICAL_PLAN_TABLE_MERGE_SCAN) {
|
||||||
STableScanInfo* pTableScanInfo = pOperator->info;
|
STableScanInfo* pTableScanInfo = pOperator->info;
|
||||||
*order = pTableScanInfo->cond.order;
|
*order = pTableScanInfo->cond.order;
|
||||||
*scanFlag = pTableScanInfo->scanFlag;
|
*scanFlag = pTableScanInfo->scanFlag;
|
||||||
|
|
|
@ -438,6 +438,10 @@ static bool isNullStr(SToken* pToken) {
|
||||||
(strncasecmp(TSDB_DATA_NULL_STR_L, pToken->z, pToken->n) == 0));
|
(strncasecmp(TSDB_DATA_NULL_STR_L, pToken->z, pToken->n) == 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static bool isNullValue(int8_t dataType, SToken* pToken) {
|
||||||
|
return TK_NULL == pToken->type || (!IS_STR_DATA_TYPE(dataType) && isNullStr(pToken));
|
||||||
|
}
|
||||||
|
|
||||||
static FORCE_INLINE int32_t toDouble(SToken* pToken, double* value, char** endPtr) {
|
static FORCE_INLINE int32_t toDouble(SToken* pToken, double* value, char** endPtr) {
|
||||||
errno = 0;
|
errno = 0;
|
||||||
*value = taosStr2Double(pToken->z, endPtr);
|
*value = taosStr2Double(pToken->z, endPtr);
|
||||||
|
@ -461,7 +465,7 @@ static int32_t parseValueToken(char** end, SToken* pToken, SSchema* pSchema, int
|
||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (TK_NULL == pToken->type || (!IS_VAR_DATA_TYPE(pSchema->type) && isNullStr(pToken))) {
|
if (isNullValue(pSchema->type, pToken)) {
|
||||||
if (TSDB_DATA_TYPE_TIMESTAMP == pSchema->type && PRIMARYKEY_TIMESTAMP_COL_ID == pSchema->colId) {
|
if (TSDB_DATA_TYPE_TIMESTAMP == pSchema->type && PRIMARYKEY_TIMESTAMP_COL_ID == pSchema->colId) {
|
||||||
return buildSyntaxErrMsg(pMsgBuf, "primary timestamp should not be null", pToken->z);
|
return buildSyntaxErrMsg(pMsgBuf, "primary timestamp should not be null", pToken->z);
|
||||||
}
|
}
|
||||||
|
@ -754,7 +758,7 @@ static int32_t parseTagToken(char** end, SToken* pToken, SSchema* pSchema, int16
|
||||||
uint64_t uv;
|
uint64_t uv;
|
||||||
char* endptr = NULL;
|
char* endptr = NULL;
|
||||||
|
|
||||||
if (isNullStr(pToken)) {
|
if (isNullValue(pSchema->type, pToken)) {
|
||||||
if (TSDB_DATA_TYPE_TIMESTAMP == pSchema->type && PRIMARYKEY_TIMESTAMP_COL_ID == pSchema->colId) {
|
if (TSDB_DATA_TYPE_TIMESTAMP == pSchema->type && PRIMARYKEY_TIMESTAMP_COL_ID == pSchema->colId) {
|
||||||
return buildSyntaxErrMsg(pMsgBuf, "primary timestamp should not be null", pToken->z);
|
return buildSyntaxErrMsg(pMsgBuf, "primary timestamp should not be null", pToken->z);
|
||||||
}
|
}
|
||||||
|
@ -972,7 +976,7 @@ static int32_t parseTagsClause(SInsertParseContext* pCxt, SSchema* pSchema, uint
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!isNullStr(&sToken)) {
|
if (!isNullValue(pTagSchema->type, &sToken)) {
|
||||||
taosArrayPush(tagName, pTagSchema->name);
|
taosArrayPush(tagName, pTagSchema->name);
|
||||||
}
|
}
|
||||||
if (pTagSchema->type == TSDB_DATA_TYPE_JSON) {
|
if (pTagSchema->type == TSDB_DATA_TYPE_JSON) {
|
||||||
|
@ -981,7 +985,7 @@ static int32_t parseTagsClause(SInsertParseContext* pCxt, SSchema* pSchema, uint
|
||||||
taosMemoryFree(tmpTokenBuf);
|
taosMemoryFree(tmpTokenBuf);
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
if (isNullStr(&sToken)) {
|
if (isNullValue(pTagSchema->type, &sToken)) {
|
||||||
code = tTagNew(pTagVals, 1, true, &pTag);
|
code = tTagNew(pTagVals, 1, true, &pTag);
|
||||||
} else {
|
} else {
|
||||||
code = parseJsontoTagData(sToken.z, pTagVals, &pTag, &pCxt->msg);
|
code = parseJsontoTagData(sToken.z, pTagVals, &pTag, &pCxt->msg);
|
||||||
|
|
Loading…
Reference in New Issue