fix merge to develop conflict

This commit is contained in:
tickduan 2021-06-07 15:18:13 +08:00
parent ae9c4a4883
commit f8c13734d6
1 changed files with 5 additions and 17 deletions

View File

@ -6674,8 +6674,7 @@ int32_t doCheckForStream(SSqlObj* pSql, SSqlInfo* pInfo) {
const char* msg5 = "sql too long"; // todo ADD support const char* msg5 = "sql too long"; // todo ADD support
const char* msg6 = "from missing in subclause"; const char* msg6 = "from missing in subclause";
const char* msg7 = "time interval is required"; const char* msg7 = "time interval is required";
const char* msg8 = "query column is required"; const char* msg8 = "the first column should be primary timestamp column";
const char* msg9 = "the first column must be timestamp type";
SSqlCmd* pCmd = &pSql->cmd; SSqlCmd* pCmd = &pSql->cmd;
SQueryInfo* pQueryInfo = tscGetQueryInfoDetail(pCmd, 0); SQueryInfo* pQueryInfo = tscGetQueryInfoDetail(pCmd, 0);
@ -6733,22 +6732,11 @@ int32_t doCheckForStream(SSqlObj* pSql, SSqlInfo* pInfo) {
return invalidSqlErrMsg(tscGetErrorMsgPayload(pCmd), msg2); return invalidSqlErrMsg(tscGetErrorMsgPayload(pCmd), msg2);
} }
// project query primary column must be timestamp type
if (tscIsProjectionQuery(pQueryInfo)) { if (tscIsProjectionQuery(pQueryInfo)) {
size_t size = tscSqlExprNumOfExprs(pQueryInfo); SExprInfo* pExpr = tscExprGet(pQueryInfo, 0);
// check zero if (pExpr->base.colInfo.colId != PRIMARYKEY_TIMESTAMP_COL_INDEX) {
if(size == 0) {
return invalidSqlErrMsg(tscGetErrorMsgPayload(pCmd), msg8); return invalidSqlErrMsg(tscGetErrorMsgPayload(pCmd), msg8);
} }
// check primary column is timestamp
SSqlExpr* pSqlExpr = tscSqlExprGet(pQueryInfo, 0);
if(pSqlExpr == NULL) {
return invalidSqlErrMsg(tscGetErrorMsgPayload(pCmd), msg8);
}
if( pSqlExpr->colInfo.colId != PRIMARYKEY_TIMESTAMP_COL_INDEX) {
return invalidSqlErrMsg(tscGetErrorMsgPayload(pCmd), msg9);
}
} else { } else {
if (pQueryInfo->interval.interval == 0) { if (pQueryInfo->interval.interval == 0) {
return invalidSqlErrMsg(tscGetErrorMsgPayload(pCmd), msg7); return invalidSqlErrMsg(tscGetErrorMsgPayload(pCmd), msg7);