提交 92c555f2 编写于 作者: D dapan1121

stmt query

上级 c4cfcef6
......@@ -313,6 +313,7 @@ bool nodesIsTimeorderQuery(const SNode* pQuery);
bool nodesIsTimelineQuery(const SNode* pQuery);
void* nodesGetValueFromNode(SValueNode* pNode);
int32_t nodesSetValueNodeValue(SValueNode* pNode, void *value);
char* nodesGetStrValueFromNode(SValueNode* pNode);
char* getFillModeString(EFillMode mode);
void valueNodeToVariant(const SValueNode* pNode, SVariant* pVal);
......
......@@ -894,51 +894,51 @@ int32_t nodesSetValueNodeValue(SValueNode* pNode, void *value) {
switch (pNode->node.resType.type) {
case TSDB_DATA_TYPE_BOOL:
pNode->datum.b = *(bool*)value;
*(bool*)pNode->typeData = pNode->datum.b;
*(bool*)&pNode->typeData = pNode->datum.b;
break;
case TSDB_DATA_TYPE_TINYINT:
pNode->datum.i = *(int8_t*)value;
*(int8_t*)pNode->typeData = pNode->datum.i;
*(int8_t*)&pNode->typeData = pNode->datum.i;
break;
case TSDB_DATA_TYPE_SMALLINT:
pNode->datum.i = *(int16_t*)value;
*(int16_t*)pNode->typeData = pNode->datum.i;
*(int16_t*)&pNode->typeData = pNode->datum.i;
break;
case TSDB_DATA_TYPE_INT:
pNode->datum.i = *(int32_t*)value;
*(int32_t*)pNode->typeData = pNode->datum.i;
*(int32_t*)&pNode->typeData = pNode->datum.i;
break;
case TSDB_DATA_TYPE_BIGINT:
pNode->datum.i = *(int64_t*)value;
*(int64_t*)pNode->typeData = pNode->datum.i;
*(int64_t*)&pNode->typeData = pNode->datum.i;
break;
case TSDB_DATA_TYPE_TIMESTAMP:
pNode->datum.i = *(int64_t*)value;
*(int64_t*)pNode->typeData = pNode->datum.i;
*(int64_t*)&pNode->typeData = pNode->datum.i;
break;
case TSDB_DATA_TYPE_UTINYINT:
pNode->datum.u = *(int8_t*)value;
*(int8_t*)pNode->typeData = pNode->datum.u;
*(int8_t*)&pNode->typeData = pNode->datum.u;
break;
case TSDB_DATA_TYPE_USMALLINT:
pNode->datum.u = *(int16_t*)value;
*(int16_t*)pNode->typeData = pNode->datum.u;
*(int16_t*)&pNode->typeData = pNode->datum.u;
break;
case TSDB_DATA_TYPE_UINT:
pNode->datum.u = *(int32_t*)value;
*(int32_t*)pNode->typeData = pNode->datum.u;
*(int32_t*)&pNode->typeData = pNode->datum.u;
break;
case TSDB_DATA_TYPE_UBIGINT:
pNode->datum.u = *(uint64_t*)value;
*(uint64_t*)pNode->typeData = pNode->datum.u;
*(uint64_t*)&pNode->typeData = pNode->datum.u;
break;
case TSDB_DATA_TYPE_FLOAT:
pNode->datum.d = *(float*)value;
*(float*)pNode->typeData = pNode->datum.d;
*(float*)&pNode->typeData = pNode->datum.d;
break;
case TSDB_DATA_TYPE_DOUBLE:
pNode->datum.d = *(double*)value;
*(double*)pNode->typeData = pNode->datum.d;
*(double*)&pNode->typeData = pNode->datum.d;
break;
case TSDB_DATA_TYPE_NCHAR:
case TSDB_DATA_TYPE_VARCHAR:
......
......@@ -599,7 +599,7 @@ EDealRes sclRewriteFunction(SNode** pNode, SScalarCtx *ctx) {
res->datum.p = taosMemoryCalloc(res->node.resType.bytes + VARSTR_HEADER_SIZE + 1, 1);
memcpy(res->datum.p, output.columnData->pData, varDataTLen(output.columnData->pData));
} else {
memcpy(nodesGetValueFromNode(res), output.columnData->pData, tDataTypes[type].bytes);
nodesSetValueNodeValue(res, output.columnData->pData);
}
}
......@@ -639,7 +639,7 @@ EDealRes sclRewriteLogic(SNode** pNode, SScalarCtx *ctx) {
res->datum.p = output.columnData->pData;
output.columnData->pData = NULL;
} else {
memcpy(nodesGetValueFromNode(res), output.columnData->pData, tDataTypes[type].bytes);
nodesSetValueNodeValue(res, output.columnData->pData);
}
nodesDestroyNode(*pNode);
......@@ -681,7 +681,7 @@ EDealRes sclRewriteOperator(SNode** pNode, SScalarCtx *ctx) {
res->datum.p = output.columnData->pData;
output.columnData->pData = NULL;
} else {
memcpy(nodesGetValueFromNode(res), output.columnData->pData, tDataTypes[type].bytes);
nodesSetValueNodeValue(res, output.columnData->pData);
}
}
......
......@@ -11,8 +11,8 @@
int32_t shortColList[] = {TSDB_DATA_TYPE_TIMESTAMP, TSDB_DATA_TYPE_INT};
int32_t fullColList[] = {TSDB_DATA_TYPE_TIMESTAMP, TSDB_DATA_TYPE_BOOL, TSDB_DATA_TYPE_TINYINT, TSDB_DATA_TYPE_UTINYINT, TSDB_DATA_TYPE_SMALLINT, TSDB_DATA_TYPE_USMALLINT, TSDB_DATA_TYPE_INT, TSDB_DATA_TYPE_UINT, TSDB_DATA_TYPE_BIGINT, TSDB_DATA_TYPE_UBIGINT, TSDB_DATA_TYPE_FLOAT, TSDB_DATA_TYPE_DOUBLE, TSDB_DATA_TYPE_BINARY, TSDB_DATA_TYPE_NCHAR};
int32_t bindColTypeList[] = {TSDB_DATA_TYPE_TIMESTAMP, TSDB_DATA_TYPE_INT, TSDB_DATA_TYPE_FLOAT};
int32_t optrIdxList[] = {3, 5, 2};
int32_t bindColTypeList[] = {TSDB_DATA_TYPE_TIMESTAMP, TSDB_DATA_TYPE_NCHAR, TSDB_DATA_TYPE_SMALLINT};
int32_t optrIdxList[] = {4, 11, 1};
typedef struct {
char* oper;
......@@ -33,7 +33,7 @@ OperInfo operInfo[] = {
{"like", 2, false},
{"not like", 2, false},
{"match", 2, false},
{"nmake", 2, false},
{"nmatch", 2, false},
};
int32_t operatorList[] = {0, 1, 2, 3, 4, 5, 6, 7};
......@@ -140,9 +140,7 @@ CaseCfg gCase[] = {
{"insert:MPME1-C012", tListLen(fullColList), fullColList, TTYPE_INSERT, false, false, insertMPMETest1, 10, 10, 2, 12, 0, 1, -1},
// 22
//{"query:SUBT-FULL", tListLen(fullColList), fullColList, TTYPE_QUERY, false, false, querySUBTTest1, 10, 10, 1, 3, 0, 1, 2},
{"query:SUBT-FULL", tListLen(fullColList), fullColList, TTYPE_QUERY, false, false, querySUBTTest1, 1, 10, 1, 3, 0, 1, 2},
{"query:SUBT-FULL", tListLen(fullColList), fullColList, TTYPE_QUERY, false, false, querySUBTTest1, 10, 10, 1, 3, 0, 1, 2},
};
......@@ -181,10 +179,10 @@ CaseCtrl gCaseCtrl = {
.rowNum = 0,
.bindColNum = 0,
.bindRowNum = 0,
// .bindColTypeNum = 0,
// .bindColTypeList = NULL,
// .optrIdxListNum = 0,
// .optrIdxList = NULL,
.bindColTypeNum = 0,
.bindColTypeList = NULL,
.optrIdxListNum = 0,
.optrIdxList = NULL,
.checkParamNum = false,
.printRes = true,
.runTimes = 0,
......@@ -194,10 +192,10 @@ CaseCtrl gCaseCtrl = {
// .caseRunNum = -1,
.optrIdxListNum = tListLen(optrIdxList),
.optrIdxList = optrIdxList,
.bindColTypeNum = tListLen(bindColTypeList),
.bindColTypeList = bindColTypeList,
// .optrIdxListNum = tListLen(optrIdxList),
// .optrIdxList = optrIdxList,
// .bindColTypeNum = tListLen(bindColTypeList),
// .bindColTypeList = bindColTypeList,
.caseIdx = 22,
.caseNum = 1,
.caseRunNum = 1,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册