提交 c9adad62 编写于 作者: T tickduan

restore, fix build error

上级 f8c13734
...@@ -6675,7 +6675,7 @@ int32_t doCheckForStream(SSqlObj* pSql, SSqlInfo* pInfo) { ...@@ -6675,7 +6675,7 @@ int32_t doCheckForStream(SSqlObj* pSql, SSqlInfo* pInfo) {
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 = "the first column should be primary timestamp column"; const char* msg8 = "the first column should be primary timestamp column";
SSqlCmd* pCmd = &pSql->cmd; SSqlCmd* pCmd = &pSql->cmd;
SQueryInfo* pQueryInfo = tscGetQueryInfoDetail(pCmd, 0); SQueryInfo* pQueryInfo = tscGetQueryInfoDetail(pCmd, 0);
assert(pQueryInfo->numOfTables == 1); assert(pQueryInfo->numOfTables == 1);
...@@ -6732,15 +6732,26 @@ int32_t doCheckForStream(SSqlObj* pSql, SSqlInfo* pInfo) { ...@@ -6732,15 +6732,26 @@ 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)) {
SExprInfo* pExpr = tscExprGet(pQueryInfo, 0); size_t size = tscSqlExprNumOfExprs(pQueryInfo);
if (pExpr->base.colInfo.colId != PRIMARYKEY_TIMESTAMP_COL_INDEX) { // check zero
if(size == 0) {
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), msg8); return invalidSqlErrMsg(tscGetErrorMsgPayload(pCmd), msg8);
} }
} else { } else {
if (pQueryInfo->interval.interval == 0) { if (pQueryInfo->interval.interval == 0) {
return invalidSqlErrMsg(tscGetErrorMsgPayload(pCmd), msg7); return invalidSqlErrMsg(tscGetErrorMsgPayload(pCmd), msg7);
} }
} }
// set the created table[stream] name // set the created table[stream] name
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册