diff --git a/source/libs/nodes/src/nodesCloneFuncs.c b/source/libs/nodes/src/nodesCloneFuncs.c index 2c840c84ea2036ddc90e74051b18bd588b09fe00..bd4fb4737c3bd8a64f642e2cb4ef62c8e8f22318 100644 --- a/source/libs/nodes/src/nodesCloneFuncs.c +++ b/source/libs/nodes/src/nodesCloneFuncs.c @@ -111,6 +111,10 @@ static SNode* valueNodeCopy(const SValueNode* pSrc, SValueNode* pDst) { exprNodeCopy((const SExprNode*)pSrc, (SExprNode*)pDst); COPY_CHAR_POINT_FIELD(literal); COPY_SCALAR_FIELD(isDuration); + COPY_SCALAR_FIELD(translate); + if (!pSrc->translate) { + return (SNode*)pDst; + } switch (pSrc->node.resType.type) { case TSDB_DATA_TYPE_NULL: break; @@ -137,7 +141,12 @@ static SNode* valueNodeCopy(const SValueNode* pSrc, SValueNode* pDst) { case TSDB_DATA_TYPE_NCHAR: case TSDB_DATA_TYPE_VARCHAR: case TSDB_DATA_TYPE_VARBINARY: - COPY_CHAR_POINT_FIELD(datum.p); + pDst->datum.p = malloc(pSrc->node.resType.bytes + VARSTR_HEADER_SIZE); + if (NULL == pDst->datum.p) { + nodesDestroyNode(pDst); + return NULL; + } + memcpy(pDst->datum.p, pSrc->datum.p, pSrc->node.resType.bytes + VARSTR_HEADER_SIZE); break; case TSDB_DATA_TYPE_JSON: case TSDB_DATA_TYPE_DECIMAL: diff --git a/source/libs/parser/src/parTranslater.c b/source/libs/parser/src/parTranslater.c index 7345b5a7a012269328f252a62aa64055d4e32a75..fb796aef81b8ae43973367d4e5de97bcdecd5cda 100644 --- a/source/libs/parser/src/parTranslater.c +++ b/source/libs/parser/src/parTranslater.c @@ -1374,7 +1374,7 @@ static int32_t createOperatorNode(EOperatorType opType, const char* pColName, SN return TSDB_CODE_OUT_OF_MEMORY; } - pOper->opType = OP_TYPE_LIKE; + pOper->opType = opType; pOper->pLeft = nodesMakeNode(QUERY_NODE_COLUMN); pOper->pRight = nodesCloneNode(pRight); if (NULL == pOper->pLeft || NULL == pOper->pRight) {