fix bug
This commit is contained in:
parent
b6e41d48e0
commit
b13e65bd93
|
@ -1606,6 +1606,22 @@ bool isValidDistinctSql(SQueryInfo* pQueryInfo) {
|
|||
return false;
|
||||
}
|
||||
|
||||
static bool hasNoneUserDefineExpr(SQueryInfo* pQueryInfo) {
|
||||
size_t numOfExprs = taosArrayGetSize(pQueryInfo->exprList);
|
||||
for (int32_t i = 0; i < numOfExprs; ++i) {
|
||||
SSqlExpr* pExpr = taosArrayGetP(pQueryInfo->exprList, i);
|
||||
|
||||
if (TSDB_COL_IS_UD_COL(pExpr->colInfo.flag)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
int32_t parseSelectClause(SSqlCmd* pCmd, int32_t clauseIndex, SArray* pSelectList, bool isSTable, bool joinQuery, bool timeWindowQuery) {
|
||||
assert(pSelectList != NULL && pCmd != NULL);
|
||||
const char* msg1 = "too many columns in selection clause";
|
||||
|
@ -1670,7 +1686,7 @@ int32_t parseSelectClause(SSqlCmd* pCmd, int32_t clauseIndex, SArray* pSelectLis
|
|||
|
||||
// there is only one user-defined column in the final result field, add the timestamp column.
|
||||
size_t numOfSrcCols = taosArrayGetSize(pQueryInfo->colList);
|
||||
if (numOfSrcCols <= 0 && !tscQueryTags(pQueryInfo) && !tscQueryBlockInfo(pQueryInfo)) {
|
||||
if ((numOfSrcCols <= 0 || !hasNoneUserDefineExpr(pQueryInfo)) && !tscQueryTags(pQueryInfo) && !tscQueryBlockInfo(pQueryInfo)) {
|
||||
addPrimaryTsColIntoResult(pQueryInfo);
|
||||
}
|
||||
|
||||
|
|
|
@ -358,6 +358,13 @@ if $data00 != 0.300000000 then
|
|||
return -1
|
||||
endi
|
||||
|
||||
print =============================> td-3996
|
||||
sql select 'abc' as res from t1 where f1 < 0
|
||||
if $rows != 0 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
||||
print ======================udc with normal column group by
|
||||
|
||||
sql_error select from t1
|
||||
|
|
|
@ -421,8 +421,18 @@ if $data10 != @union_db0@ then
|
|||
return -1
|
||||
endi
|
||||
|
||||
sql select 'aaa' as option from union_tb1 where c1 < 0 limit 1 union all select 'bbb' as option from union_tb0 limit 1
|
||||
if $rows != 1 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
if $data00 != @bbb@ then
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
||||
sql_error show tables union all show tables
|
||||
sql_error show stables union all show stables
|
||||
sql_error show databases union all show databases
|
||||
|
||||
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||
|
|
Loading…
Reference in New Issue