fix: tupleData

This commit is contained in:
xsren 2024-07-22 20:26:55 +08:00
parent feba37b5ea
commit bf03c2b3d8
2 changed files with 39 additions and 1 deletions

View File

@ -1627,7 +1627,8 @@ static int32_t setSelectValueColumnInfo(SqlFunctionCtx* pCtx, int32_t numOfOutpu
SHashObj* pSelectFuncs = taosHashInit(8, taosGetDefaultHashFunction(TSDB_DATA_TYPE_BINARY), false, HASH_ENTRY_LOCK); SHashObj* pSelectFuncs = taosHashInit(8, taosGetDefaultHashFunction(TSDB_DATA_TYPE_BINARY), false, HASH_ENTRY_LOCK);
for (int32_t i = 0; i < numOfOutput; ++i) { for (int32_t i = 0; i < numOfOutput; ++i) {
const char* pName = pCtx[i].pExpr->pExpr->_function.functionName; const char* pName = pCtx[i].pExpr->pExpr->_function.functionName;
if ((strcmp(pName, "_select_value") == 0) || (strcmp(pName, "_group_key") == 0)) { if ((strcmp(pName, "_select_value") == 0) || (strcmp(pName, "_group_key") == 0)
|| (strcmp(pName, "_group_const_value") == 0)) {
pValCtx[num++] = &pCtx[i]; pValCtx[num++] = &pCtx[i];
} else if (fmIsSelectFunc(pCtx[i].functionId)) { } else if (fmIsSelectFunc(pCtx[i].functionId)) {
void* data = taosHashGet(pSelectFuncs, pName, strlen(pName)); void* data = taosHashGet(pSelectFuncs, pName, strlen(pName));

View File

@ -452,6 +452,43 @@ if $data04 != @abc0@ then
return -1 return -1
endi endi
sql select ts, top(c1, 100), tbname, t1, t2 from select_tags_mt0 where tbname in ('select_tags_tb0', 'select_tags_tb1') partition by tbname order by ts;
if $row != 200 then
return -1
endi
if $data00 != @70-01-01 08:01:40.087@ then
return -1
endi
if $data10 != @70-01-01 08:01:40.088@ then
return -1
endi
if $data20 != @70-01-01 08:01:40.089@ then
return -1
endi
if $data90 != @70-01-01 08:01:40.096@ then
return -1
endi
if $data01 != 87 then
return -1
endi
if $data02 != @select_tags_tb0@ then
return -1
endi
if $data03 != 0 then
return -1
endi
if $data04 != @abc0@ then
return -1
endi
sql select ts, top(c1, 2), t2, tbname, t2 from select_tags_mt0 where tbname in ('select_tags_tb0', 'select_tags_tb1') group by tbname,t2 order by ts; sql select ts, top(c1, 2), t2, tbname, t2 from select_tags_mt0 where tbname in ('select_tags_tb0', 'select_tags_tb1') group by tbname,t2 order by ts;
if $row != 4 then if $row != 4 then
return -1 return -1