Merge pull request #7381 from taosdata/hotfix/td-5998-2
[TD-5998]<fix>:_block_dist() only support tables, not subqueries
This commit is contained in:
commit
fb6dff3a1d
|
@ -2045,6 +2045,7 @@ int32_t validateSelectNodeList(SSqlCmd* pCmd, SQueryInfo* pQueryInfo, SArray* pS
|
||||||
const char* msg3 = "not support query expression";
|
const char* msg3 = "not support query expression";
|
||||||
const char* msg4 = "only support distinct one column or tag";
|
const char* msg4 = "only support distinct one column or tag";
|
||||||
const char* msg5 = "invalid function name";
|
const char* msg5 = "invalid function name";
|
||||||
|
const char* msg6 = "_block_dist not support subquery, only support stable/table";
|
||||||
|
|
||||||
// too many result columns not support order by in query
|
// too many result columns not support order by in query
|
||||||
if (taosArrayGetSize(pSelNodeList) > TSDB_MAX_COLUMNS) {
|
if (taosArrayGetSize(pSelNodeList) > TSDB_MAX_COLUMNS) {
|
||||||
|
@ -2068,6 +2069,11 @@ int32_t validateSelectNodeList(SSqlCmd* pCmd, SQueryInfo* pQueryInfo, SArray* pS
|
||||||
int32_t type = pItem->pNode->type;
|
int32_t type = pItem->pNode->type;
|
||||||
if (type == SQL_NODE_SQLFUNCTION) {
|
if (type == SQL_NODE_SQLFUNCTION) {
|
||||||
pItem->pNode->functionId = isValidFunction(pItem->pNode->Expr.operand.z, pItem->pNode->Expr.operand.n);
|
pItem->pNode->functionId = isValidFunction(pItem->pNode->Expr.operand.z, pItem->pNode->Expr.operand.n);
|
||||||
|
|
||||||
|
if (pItem->pNode->functionId == TSDB_FUNC_BLKINFO && taosArrayGetSize(pQueryInfo->pUpstream) > 0) {
|
||||||
|
return invalidOperationMsg(tscGetErrorMsgPayload(pCmd), msg6);
|
||||||
|
}
|
||||||
|
|
||||||
SUdfInfo* pUdfInfo = NULL;
|
SUdfInfo* pUdfInfo = NULL;
|
||||||
if (pItem->pNode->functionId < 0) {
|
if (pItem->pNode->functionId < 0) {
|
||||||
pUdfInfo = isValidUdf(pQueryInfo->pUdfInfo, pItem->pNode->Expr.operand.z, pItem->pNode->Expr.operand.n);
|
pUdfInfo = isValidUdf(pQueryInfo->pUdfInfo, pItem->pNode->Expr.operand.z, pItem->pNode->Expr.operand.n);
|
||||||
|
|
|
@ -84,6 +84,10 @@ if $rows != 1 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
|
print ============== TD-5998
|
||||||
|
sql_error select _block_dist() from (select * from $nt)
|
||||||
|
sql_error select _block_dist() from (select * from $mt)
|
||||||
|
|
||||||
print =============== clear
|
print =============== clear
|
||||||
sql drop database $db
|
sql drop database $db
|
||||||
sql show databases
|
sql show databases
|
||||||
|
|
Loading…
Reference in New Issue