commit
4ebf4326db
|
@ -699,8 +699,8 @@ static int32_t sifExecLogic(SLogicConditionNode *node, SIFCtx *ctx, SIFParam *ou
|
||||||
} else {
|
} else {
|
||||||
for (int32_t m = 0; m < node->pParameterList->length; m++) {
|
for (int32_t m = 0; m < node->pParameterList->length; m++) {
|
||||||
output->status = sifMergeCond(node->condType, output->status, params[m].status);
|
output->status = sifMergeCond(node->condType, output->status, params[m].status);
|
||||||
taosArrayDestroy(params[m].result);
|
// taosArrayDestroy(params[m].result);
|
||||||
params[m].result = NULL;
|
// params[m].result = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
_return:
|
_return:
|
||||||
|
@ -857,9 +857,15 @@ static int32_t sifGetFltHint(SNode *pNode, SIdxFltStatus *status) {
|
||||||
SIF_ERR_RET(TSDB_CODE_QRY_APP_ERROR);
|
SIF_ERR_RET(TSDB_CODE_QRY_APP_ERROR);
|
||||||
}
|
}
|
||||||
*status = res->status;
|
*status = res->status;
|
||||||
|
|
||||||
sifFreeParam(res);
|
sifFreeParam(res);
|
||||||
taosHashRemove(ctx.pRes, (void *)&pNode, POINTER_BYTES);
|
taosHashRemove(ctx.pRes, (void *)&pNode, POINTER_BYTES);
|
||||||
|
|
||||||
|
void *iter = taosHashIterate(ctx.pRes, NULL);
|
||||||
|
while (iter != NULL) {
|
||||||
|
SIFParam *data = (SIFParam *)iter;
|
||||||
|
sifFreeParam(data);
|
||||||
|
iter = taosHashIterate(ctx.pRes, iter);
|
||||||
|
}
|
||||||
taosHashCleanup(ctx.pRes);
|
taosHashCleanup(ctx.pRes);
|
||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1210,6 +1210,7 @@ EDealRes sclRewriteOperator(SNode **pNode, SScalarCtx *ctx) {
|
||||||
SScalarParam output = {0};
|
SScalarParam output = {0};
|
||||||
ctx->code = sclExecOperator(node, ctx, &output);
|
ctx->code = sclExecOperator(node, ctx, &output);
|
||||||
if (ctx->code) {
|
if (ctx->code) {
|
||||||
|
sclFreeParam(&output);
|
||||||
return DEAL_RES_ERROR;
|
return DEAL_RES_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1358,6 +1359,7 @@ EDealRes sclWalkOperator(SNode *pNode, SScalarCtx *ctx) {
|
||||||
|
|
||||||
ctx->code = sclExecOperator(node, ctx, &output);
|
ctx->code = sclExecOperator(node, ctx, &output);
|
||||||
if (ctx->code) {
|
if (ctx->code) {
|
||||||
|
sclFreeParam(&output);
|
||||||
return DEAL_RES_ERROR;
|
return DEAL_RES_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -344,8 +344,8 @@ static FORCE_INLINE void varToNchar(char *buf, SScalarParam *pOut, int32_t rowIn
|
||||||
int32_t outputMaxLen = (inputLen + 1) * TSDB_NCHAR_SIZE + VARSTR_HEADER_SIZE;
|
int32_t outputMaxLen = (inputLen + 1) * TSDB_NCHAR_SIZE + VARSTR_HEADER_SIZE;
|
||||||
|
|
||||||
char *t = taosMemoryCalloc(1, outputMaxLen);
|
char *t = taosMemoryCalloc(1, outputMaxLen);
|
||||||
int32_t ret = taosMbsToUcs4(varDataVal(buf), inputLen, (TdUcs4 *)varDataVal(t),
|
int32_t ret =
|
||||||
outputMaxLen - VARSTR_HEADER_SIZE, &len);
|
taosMbsToUcs4(varDataVal(buf), inputLen, (TdUcs4 *)varDataVal(t), outputMaxLen - VARSTR_HEADER_SIZE, &len);
|
||||||
if (!ret) {
|
if (!ret) {
|
||||||
sclError("failed to convert to NCHAR");
|
sclError("failed to convert to NCHAR");
|
||||||
}
|
}
|
||||||
|
@ -588,7 +588,8 @@ int32_t vectorConvertToVarData(SSclVectorConvCtx *pCtx) {
|
||||||
SColumnInfoData *pOutputCol = pCtx->pOut->columnData;
|
SColumnInfoData *pOutputCol = pCtx->pOut->columnData;
|
||||||
char tmp[128] = {0};
|
char tmp[128] = {0};
|
||||||
|
|
||||||
if (IS_SIGNED_NUMERIC_TYPE(pCtx->inType) || pCtx->inType == TSDB_DATA_TYPE_BOOL || pCtx->inType == TSDB_DATA_TYPE_TIMESTAMP) {
|
if (IS_SIGNED_NUMERIC_TYPE(pCtx->inType) || pCtx->inType == TSDB_DATA_TYPE_BOOL ||
|
||||||
|
pCtx->inType == TSDB_DATA_TYPE_TIMESTAMP) {
|
||||||
for (int32_t i = pCtx->startIndex; i <= pCtx->endIndex; ++i) {
|
for (int32_t i = pCtx->startIndex; i <= pCtx->endIndex; ++i) {
|
||||||
if (colDataIsNull_f(pInputCol->nullbitmap, i)) {
|
if (colDataIsNull_f(pInputCol->nullbitmap, i)) {
|
||||||
colDataAppendNULL(pOutputCol, i);
|
colDataAppendNULL(pOutputCol, i);
|
||||||
|
@ -648,7 +649,8 @@ int32_t vectorConvertToVarData(SSclVectorConvCtx *pCtx) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO opt performance
|
// TODO opt performance
|
||||||
int32_t vectorConvertSingleColImpl(const SScalarParam* pIn, SScalarParam* pOut, int32_t* overflow, int32_t startIndex, int32_t numOfRows) {
|
int32_t vectorConvertSingleColImpl(const SScalarParam *pIn, SScalarParam *pOut, int32_t *overflow, int32_t startIndex,
|
||||||
|
int32_t numOfRows) {
|
||||||
SColumnInfoData *pInputCol = pIn->columnData;
|
SColumnInfoData *pInputCol = pIn->columnData;
|
||||||
SColumnInfoData *pOutputCol = pOut->columnData;
|
SColumnInfoData *pOutputCol = pOut->columnData;
|
||||||
|
|
||||||
|
@ -897,7 +899,8 @@ int32_t vectorGetConvertType(int32_t type1, int32_t type2) {
|
||||||
return gConvertTypes[type2][type1];
|
return gConvertTypes[type2][type1];
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t vectorConvertSingleCol(SScalarParam *input, SScalarParam *output, int32_t type, int32_t startIndex, int32_t numOfRows) {
|
int32_t vectorConvertSingleCol(SScalarParam *input, SScalarParam *output, int32_t type, int32_t startIndex,
|
||||||
|
int32_t numOfRows) {
|
||||||
SDataType t = {.type = type, .bytes = tDataTypes[type].bytes};
|
SDataType t = {.type = type, .bytes = tDataTypes[type].bytes};
|
||||||
output->numOfRows = input->numOfRows;
|
output->numOfRows = input->numOfRows;
|
||||||
|
|
||||||
|
@ -914,7 +917,8 @@ int32_t vectorConvertSingleCol(SScalarParam *input, SScalarParam *output, int32_
|
||||||
return TSDB_CODE_SUCCESS;
|
return TSDB_CODE_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t vectorConvertCols(SScalarParam* pLeft, SScalarParam* pRight, SScalarParam* pLeftOut, SScalarParam* pRightOut, int32_t startIndex, int32_t numOfRows) {
|
int32_t vectorConvertCols(SScalarParam *pLeft, SScalarParam *pRight, SScalarParam *pLeftOut, SScalarParam *pRightOut,
|
||||||
|
int32_t startIndex, int32_t numOfRows) {
|
||||||
int32_t leftType = GET_PARAM_TYPE(pLeft);
|
int32_t leftType = GET_PARAM_TYPE(pLeft);
|
||||||
int32_t rightType = GET_PARAM_TYPE(pRight);
|
int32_t rightType = GET_PARAM_TYPE(pRight);
|
||||||
if (leftType == rightType) {
|
if (leftType == rightType) {
|
||||||
|
@ -1536,8 +1540,8 @@ void vectorBitOr(SScalarParam *pLeft, SScalarParam *pRight, SScalarParam *pOut,
|
||||||
doReleaseVec(pRightCol, rightConvert);
|
doReleaseVec(pRightCol, rightConvert);
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t doVectorCompareImpl(SScalarParam *pLeft, SScalarParam *pRight, SScalarParam *pOut, int32_t startIndex, int32_t numOfRows,
|
int32_t doVectorCompareImpl(SScalarParam *pLeft, SScalarParam *pRight, SScalarParam *pOut, int32_t startIndex,
|
||||||
int32_t step, __compar_fn_t fp, int32_t optr) {
|
int32_t numOfRows, int32_t step, __compar_fn_t fp, int32_t optr) {
|
||||||
int32_t num = 0;
|
int32_t num = 0;
|
||||||
|
|
||||||
for (int32_t i = startIndex; i < numOfRows && i >= 0; i += step) {
|
for (int32_t i = startIndex; i < numOfRows && i >= 0; i += step) {
|
||||||
|
@ -1590,8 +1594,8 @@ int32_t doVectorCompareImpl(SScalarParam *pLeft, SScalarParam *pRight, SScalarPa
|
||||||
return num;
|
return num;
|
||||||
}
|
}
|
||||||
|
|
||||||
void doVectorCompare(SScalarParam* pLeft, SScalarParam* pRight, SScalarParam *pOut, int32_t startIndex, int32_t numOfRows,
|
void doVectorCompare(SScalarParam *pLeft, SScalarParam *pRight, SScalarParam *pOut, int32_t startIndex,
|
||||||
int32_t _ord, int32_t optr) {
|
int32_t numOfRows, int32_t _ord, int32_t optr) {
|
||||||
int32_t i = 0;
|
int32_t i = 0;
|
||||||
int32_t step = ((_ord) == TSDB_ORDER_ASC) ? 1 : -1;
|
int32_t step = ((_ord) == TSDB_ORDER_ASC) ? 1 : -1;
|
||||||
int32_t lType = GET_PARAM_TYPE(pLeft);
|
int32_t lType = GET_PARAM_TYPE(pLeft);
|
||||||
|
@ -1634,8 +1638,8 @@ void doVectorCompare(SScalarParam* pLeft, SScalarParam* pRight, SScalarParam *pO
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void vectorCompareImpl(SScalarParam* pLeft, SScalarParam* pRight, SScalarParam *pOut, int32_t startIndex, int32_t numOfRows,
|
void vectorCompareImpl(SScalarParam *pLeft, SScalarParam *pRight, SScalarParam *pOut, int32_t startIndex,
|
||||||
int32_t _ord, int32_t optr) {
|
int32_t numOfRows, int32_t _ord, int32_t optr) {
|
||||||
SScalarParam pLeftOut = {0};
|
SScalarParam pLeftOut = {0};
|
||||||
SScalarParam pRightOut = {0};
|
SScalarParam pRightOut = {0};
|
||||||
SScalarParam *param1 = NULL;
|
SScalarParam *param1 = NULL;
|
||||||
|
@ -1748,7 +1752,7 @@ void vectorIsTrue(SScalarParam* pLeft, SScalarParam* pRight, SScalarParam *pOut,
|
||||||
|
|
||||||
STagVal getJsonValue(char *json, char *key, bool *isExist) {
|
STagVal getJsonValue(char *json, char *key, bool *isExist) {
|
||||||
STagVal val = {.pKey = key};
|
STagVal val = {.pKey = key};
|
||||||
if (tTagIsJson((const STag *)json) == false) {
|
if (json == NULL || tTagIsJson((const STag *)json) == false) {
|
||||||
terrno = TSDB_CODE_QRY_JSON_NOT_SUPPORT_ERROR;
|
terrno = TSDB_CODE_QRY_JSON_NOT_SUPPORT_ERROR;
|
||||||
if (isExist) {
|
if (isExist) {
|
||||||
*isExist = false;
|
*isExist = false;
|
||||||
|
|
|
@ -195,7 +195,7 @@ static bool uvHandleReq(SSvrConn* pConn) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (transDecompressMsg((char**)&pHead, msgLen) < 0) {
|
if (transDecompressMsg((char**)&pHead, msgLen) < 0) {
|
||||||
tDebug("%s conn %p recv invalid packet, failed to decompress", transLabel(pTransInst), pConn);
|
tError("%s conn %p recv invalid packet, failed to decompress", transLabel(pTransInst), pConn);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -277,10 +277,8 @@ void uvOnRecvCb(uv_stream_t* cli, ssize_t nread, const uv_buf_t* buf) {
|
||||||
SConnBuffer* pBuf = &conn->readBuf;
|
SConnBuffer* pBuf = &conn->readBuf;
|
||||||
if (nread > 0) {
|
if (nread > 0) {
|
||||||
pBuf->len += nread;
|
pBuf->len += nread;
|
||||||
tTrace("%s conn %p total read:%d, current read:%d", transLabel(pTransInst), conn, pBuf->len, (int)nread);
|
|
||||||
if (pBuf->len <= TRANS_PACKET_LIMIT) {
|
if (pBuf->len <= TRANS_PACKET_LIMIT) {
|
||||||
while (transReadComplete(pBuf)) {
|
while (transReadComplete(pBuf)) {
|
||||||
tTrace("%s conn %p alread read complete packet", transLabel(pTransInst), conn);
|
|
||||||
if (true == pBuf->invalid || false == uvHandleReq(conn)) {
|
if (true == pBuf->invalid || false == uvHandleReq(conn)) {
|
||||||
tError("%s conn %p read invalid packet, received from %s, local info:%s", transLabel(pTransInst), conn,
|
tError("%s conn %p read invalid packet, received from %s, local info:%s", transLabel(pTransInst), conn,
|
||||||
conn->dst, conn->src);
|
conn->dst, conn->src);
|
||||||
|
|
|
@ -622,7 +622,7 @@
|
||||||
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/join2.py
|
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/join2.py
|
||||||
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/union1.py
|
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/union1.py
|
||||||
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/concat2.py
|
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/concat2.py
|
||||||
,,,system-test,python3 ./test.py -f 2-query/json_tag.py
|
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/json_tag.py
|
||||||
,,,system-test,python3 ./test.py -f 2-query/nestedQuery.py
|
,,,system-test,python3 ./test.py -f 2-query/nestedQuery.py
|
||||||
,,,system-test,python3 ./test.py -f 2-query/nestedQuery_str.py
|
,,,system-test,python3 ./test.py -f 2-query/nestedQuery_str.py
|
||||||
,,,system-test,python3 ./test.py -f 2-query/nestedQuery_math.py
|
,,,system-test,python3 ./test.py -f 2-query/nestedQuery_math.py
|
||||||
|
@ -768,7 +768,7 @@
|
||||||
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/timetruncate.py -Q 2
|
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/timetruncate.py -Q 2
|
||||||
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/diff.py -Q 2
|
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/diff.py -Q 2
|
||||||
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/Timediff.py -Q 2
|
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/Timediff.py -Q 2
|
||||||
,,,system-test,python3 ./test.py -f 2-query/json_tag.py -Q 2
|
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/json_tag.py -Q 2
|
||||||
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/top.py -Q 2
|
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/top.py -Q 2
|
||||||
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/bottom.py -Q 2
|
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/bottom.py -Q 2
|
||||||
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/percentile.py -Q 2
|
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/percentile.py -Q 2
|
||||||
|
@ -862,7 +862,7 @@
|
||||||
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/timetruncate.py -Q 3
|
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/timetruncate.py -Q 3
|
||||||
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/diff.py -Q 3
|
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/diff.py -Q 3
|
||||||
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/Timediff.py -Q 3
|
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/Timediff.py -Q 3
|
||||||
,,,system-test,python3 ./test.py -f 2-query/json_tag.py -Q 3
|
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/json_tag.py -Q 3
|
||||||
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/top.py -Q 3
|
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/top.py -Q 3
|
||||||
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/bottom.py -Q 3
|
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/bottom.py -Q 3
|
||||||
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/percentile.py -Q 3
|
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/percentile.py -Q 3
|
||||||
|
|
Loading…
Reference in New Issue