diff --git a/src/client/inc/tscUtil.h b/src/client/inc/tscUtil.h index 60a8ff894ff98fa1b9021c73dbe57c246d88c86e..f69ee23222119b3bc9b983c8fb24b067f11ff996 100644 --- a/src/client/inc/tscUtil.h +++ b/src/client/inc/tscUtil.h @@ -123,6 +123,7 @@ int32_t tscGetDataBlockFromList(SHashObj* pHashList, int64_t id, int32_t size, i bool tscIsPointInterpQuery(SQueryInfo* pQueryInfo); bool tscIsTWAQuery(SQueryInfo* pQueryInfo); bool tscIsSecondStageQuery(SQueryInfo* pQueryInfo); +bool tscGroupbyColumn(SQueryInfo* pQueryInfo); bool tscNonOrderedProjectionQueryOnSTable(SQueryInfo *pQueryInfo, int32_t tableIndex); bool tscOrderedProjectionQueryOnSTable(SQueryInfo* pQueryInfo, int32_t tableIndex); @@ -153,7 +154,6 @@ SInternalField* tscFieldInfoInsert(SFieldInfo* pFieldInfo, int32_t index, TAOS_F SInternalField* tscFieldInfoGetInternalField(SFieldInfo* pFieldInfo, int32_t index); TAOS_FIELD* tscFieldInfoGetField(SFieldInfo* pFieldInfo, int32_t index); -void tscFieldInfoUpdateOffset(SQueryInfo* pQueryInfo); void tscFieldInfoUpdateOffset(SQueryInfo* pQueryInfo); int16_t tscFieldInfoGetOffset(SQueryInfo* pQueryInfo, int32_t index); diff --git a/src/client/inc/tsclient.h b/src/client/inc/tsclient.h index 29624e4db2ad33ed76d3b703bc870d18fcc3ab28..1740266518dd2c736feb47a5e9baa98cb66cbd94 100644 --- a/src/client/inc/tsclient.h +++ b/src/client/inc/tsclient.h @@ -198,9 +198,10 @@ typedef struct STableDataBlocks { typedef struct SQueryInfo { int16_t command; // the command may be different for each subclause, so keep it seperately. uint32_t type; // query/insert type + STimeWindow window; // the whole query time window - STimeWindow window; // query time window - SInterval interval; + SInterval interval; // tumble time window + SSessionWindow sessionWindow; // session time window SSqlGroupbyExpr groupbyExpr; // group by tags info SArray * colList; // SArray @@ -402,7 +403,6 @@ typedef struct SSqlStream { void tscSetStreamDestTable(SSqlStream* pStream, const char* dstTable); - int tscAcquireRpc(const char *key, const char *user, const char *secret,void **pRpcObj); void tscReleaseRpc(void *param); void tscInitMsgsFp(); diff --git a/src/client/src/tscSQLParser.c b/src/client/src/tscSQLParser.c index 94c684719b328f1f3bb415a60658585ef5eeb4cc..e88ae1bbea79dd0f5f7a0eaa8a48607e74005c02 100644 --- a/src/client/src/tscSQLParser.c +++ b/src/client/src/tscSQLParser.c @@ -77,7 +77,7 @@ static int32_t insertResultField(SQueryInfo* pQueryInfo, int32_t outputIndex, SC static uint8_t convertOptr(SStrToken *pToken); -static int32_t parseSelectClause(SSqlCmd* pCmd, int32_t clauseIndex, tSQLExprList* pSelection, bool isSTable, bool joinQuery, bool intervalQuery); +static int32_t parseSelectClause(SSqlCmd* pCmd, int32_t clauseIndex, tSQLExprList* pSelection, bool isSTable, bool joinQuery, bool timeWindowQuery); static bool validateIpAddress(const char* ip, size_t size); static bool hasUnsupportFunctionsForSTableQuery(SSqlCmd* pCmd, SQueryInfo* pQueryInfo); @@ -86,8 +86,8 @@ static bool functionCompatibleCheck(SQueryInfo* pQueryInfo, bool joinQuery, bool static int32_t parseGroupbyClause(SQueryInfo* pQueryInfo, SArray* pList, SSqlCmd* pCmd); static int32_t parseIntervalClause(SSqlObj* pSql, SQueryInfo* pQueryInfo, SQuerySQL* pQuerySql); -static int32_t parseOffsetClause(SSqlCmd* pCmd, SQueryInfo* pQueryInfo, SQuerySQL* pQuerySql); -static int32_t parseSlidingClause(SSqlObj* pSql, SQueryInfo* pQueryInfo, SQuerySQL* pQuerySql); +static int32_t parseIntervalOffset(SSqlCmd* pCmd, SQueryInfo* pQueryInfo, SStrToken* offsetToken); +static int32_t parseSlidingClause(SSqlCmd* pCmd, SQueryInfo* pQueryInfo, SStrToken* pSliding); static int32_t addProjectionExprAndResultField(SSqlCmd* pCmd, SQueryInfo* pQueryInfo, tSqlExprItem* pItem); @@ -128,7 +128,11 @@ static int32_t doCheckForCreateFromStable(SSqlObj* pSql, SSqlInfo* pInfo); static int32_t doCheckForStream(SSqlObj* pSql, SSqlInfo* pInfo); static int32_t doCheckForQuery(SSqlObj* pSql, SQuerySQL* pQuerySql, int32_t index); static int32_t exprTreeFromSqlExpr(SSqlCmd* pCmd, tExprNode **pExpr, const tSQLExpr* pSqlExpr, SQueryInfo* pQueryInfo, SArray* pCols, int64_t *uid); -static bool validateDebugFlag(int32_t flag); +static bool validateDebugFlag(int32_t v); + +static bool isTimeWindowQuery(SQueryInfo* pQueryInfo) { + return pQueryInfo->interval.interval > 0 || pQueryInfo->sessionWindow.gap > 0; +} int16_t getNewResColId(SQueryInfo* pQueryInfo) { return pQueryInfo->resColumnId--; @@ -701,21 +705,86 @@ static bool isTopBottomQuery(SQueryInfo* pQueryInfo) { return false; } -int32_t parseIntervalClause(SSqlObj* pSql, SQueryInfo* pQueryInfo, SQuerySQL* pQuerySql) { +// need to add timestamp column in result set, if it is a time window query +static int32_t addPrimaryTsColumnForTimeWindowQuery(SQueryInfo* pQueryInfo) { + uint64_t uid = tscSqlExprGet(pQueryInfo, 0)->uid; + + int32_t tableIndex = COLUMN_INDEX_INITIAL_VAL; + for (int32_t i = 0; i < pQueryInfo->numOfTables; ++i) { + STableMetaInfo* pTableMetaInfo = tscGetMetaInfo(pQueryInfo, i); + if (pTableMetaInfo->pTableMeta->id.uid == uid) { + tableIndex = i; + break; + } + } + + if (tableIndex == COLUMN_INDEX_INITIAL_VAL) { + return TSDB_CODE_TSC_INVALID_SQL; + } + + SSchema s = {.bytes = TSDB_KEYSIZE, .type = TSDB_DATA_TYPE_TIMESTAMP, .colId = PRIMARYKEY_TIMESTAMP_COL_INDEX}; + tstrncpy(s.name, aAggs[TSDB_FUNC_TS].name, sizeof(s.name)); + + SColumnIndex index = {tableIndex, PRIMARYKEY_TIMESTAMP_COL_INDEX}; + tscAddFuncInSelectClause(pQueryInfo, 0, TSDB_FUNC_TS, &index, &s, TSDB_COL_NORMAL); + return TSDB_CODE_SUCCESS; +} + +static int32_t checkInvalidExprForTimeWindow(SSqlCmd* pCmd, SQueryInfo* pQueryInfo) { const char* msg1 = "invalid query expression"; + const char* msg2 = "top/bottom query does not support order by value in time window query"; + + // for top/bottom + interval query, we do not add additional timestamp column in the front + if (isTopBottomQuery(pQueryInfo)) { + + // invalid sql: + // top(col, k) from table_name [interval(1d)|session(ts, 1d)] order by k asc + // order by normal column is not supported + int32_t colId = pQueryInfo->order.orderColId; + if (isTimeWindowQuery(pQueryInfo) && colId != PRIMARYKEY_TIMESTAMP_COL_INDEX) { + return invalidSqlErrMsg(tscGetErrorMsgPayload(pCmd), msg2); + } + + return TSDB_CODE_SUCCESS; + } + + /* + * invalid sql: + * select count(tbname)/count(tag1)/count(tag2) from super_table_name [interval(1d)|session(ts, 1d)]; + */ + size_t size = tscSqlExprNumOfExprs(pQueryInfo); + for (int32_t i = 0; i < size; ++i) { + SSqlExpr* pExpr = tscSqlExprGet(pQueryInfo, i); + if (pExpr->functionId == TSDB_FUNC_COUNT && TSDB_COL_IS_TAG(pExpr->colInfo.flag)) { + return invalidSqlErrMsg(tscGetErrorMsgPayload(pCmd), msg1); + } + } + + /* + * invalid sql: + * select tbname, tags_fields from super_table_name [interval(1s)|session(ts,1s)] + */ + if (tscQueryTags(pQueryInfo) && isTimeWindowQuery(pQueryInfo)) { + return invalidSqlErrMsg(tscGetErrorMsgPayload(pCmd), msg1); + } + + return addPrimaryTsColumnForTimeWindowQuery(pQueryInfo); +} + +int32_t parseIntervalClause(SSqlObj* pSql, SQueryInfo* pQueryInfo, SQuerySQL* pQuerySql) { const char* msg2 = "interval cannot be less than 10 ms"; const char* msg3 = "sliding cannot be used without interval"; - const char* msg4 = "top/bottom query does not support order by value in interval query"; SSqlCmd* pCmd = &pSql->cmd; STableMetaInfo* pTableMetaInfo = tscGetMetaInfo(pQueryInfo, 0); STableComInfo tinfo = tscGetTableInfo(pTableMetaInfo->pTableMeta); - if (pQuerySql->interval.type == 0 || pQuerySql->interval.n == 0) { + if (pQuerySql->interval.interval.type == 0 || pQuerySql->interval.interval.n == 0) { if (pQuerySql->sliding.n > 0) { return invalidSqlErrMsg(tscGetErrorMsgPayload(pCmd), msg3); } + return TSDB_CODE_SUCCESS; } @@ -725,7 +794,7 @@ int32_t parseIntervalClause(SSqlObj* pSql, SQueryInfo* pQueryInfo, SQuerySQL* pQ } // interval is not null - SStrToken* t = &pQuerySql->interval; + SStrToken* t = &pQuerySql->interval.interval; if (parseNatualDuration(t->z, t->n, &pQueryInfo->interval.interval, &pQueryInfo->interval.intervalUnit) != TSDB_CODE_SUCCESS) { return TSDB_CODE_TSC_INVALID_SQL; } @@ -742,78 +811,64 @@ int32_t parseIntervalClause(SSqlObj* pSql, SQueryInfo* pQueryInfo, SQuerySQL* pQ } } - // for top/bottom + interval query, we do not add additional timestamp column in the front - if (isTopBottomQuery(pQueryInfo)) { - if (parseOffsetClause(pCmd, pQueryInfo, pQuerySql) != TSDB_CODE_SUCCESS) { - return TSDB_CODE_TSC_INVALID_SQL; - } + if (parseIntervalOffset(pCmd, pQueryInfo, &pQuerySql->interval.offset) != TSDB_CODE_SUCCESS) { + return TSDB_CODE_TSC_INVALID_SQL; + } - if (parseSlidingClause(pSql, pQueryInfo, pQuerySql) != TSDB_CODE_SUCCESS) { - return TSDB_CODE_TSC_INVALID_SQL; - } + if (parseSlidingClause(pCmd, pQueryInfo, &pQuerySql->sliding) != TSDB_CODE_SUCCESS) { + return TSDB_CODE_TSC_INVALID_SQL; + } - int32_t colId = pQueryInfo->order.orderColId; - if (pQueryInfo->interval.interval > 0 && colId != PRIMARYKEY_TIMESTAMP_COL_INDEX) { - return invalidSqlErrMsg(tscGetErrorMsgPayload(pCmd), msg4); - } + // The following part is used to check for the invalid query expression. + return checkInvalidExprForTimeWindow(pCmd, pQueryInfo); +} + +int32_t parseSessionClause(SSqlCmd* pCmd, SQueryInfo* pQueryInfo, SQuerySQL * pQuerySql) { + const char* msg1 = "gap should be fixed time window"; + const char* msg2 = "only one type time window allowed"; + const char* msg3 = "invalid column name"; + const char* msg4 = "invalid time window"; + // no session window + if (pQuerySql->sessionVal.gap.n == 0 || pQuerySql->sessionVal.col.n == 0) { return TSDB_CODE_SUCCESS; } - /* - * check invalid SQL: - * select count(tbname)/count(tag1)/count(tag2) from super_table_name interval(1d); - */ - size_t size = tscSqlExprNumOfExprs(pQueryInfo); - for (int32_t i = 0; i < size; ++i) { - SSqlExpr* pExpr = tscSqlExprGet(pQueryInfo, i); - if (pExpr->functionId == TSDB_FUNC_COUNT && TSDB_COL_IS_TAG(pExpr->colInfo.flag)) { - return invalidSqlErrMsg(tscGetErrorMsgPayload(pCmd), msg1); - } + SStrToken* col = &pQuerySql->sessionVal.col; + SStrToken* gap = &pQuerySql->sessionVal.gap; + + char timeUnit = 0; + if (parseNatualDuration(gap->z, gap->n, &pQueryInfo->sessionWindow.gap, &timeUnit) != TSDB_CODE_SUCCESS) { + return invalidSqlErrMsg(tscGetErrorMsgPayload(pCmd), msg4); } - /* - * check invalid SQL: - * select tbname, tags_fields from super_table_name interval(1s) - */ - if (tscQueryTags(pQueryInfo) && pQueryInfo->interval.interval > 0) { + if (timeUnit == 'y' || timeUnit == 'n') { return invalidSqlErrMsg(tscGetErrorMsgPayload(pCmd), msg1); } - // need to add timestamp column in result set, if interval is existed - uint64_t uid = tscSqlExprGet(pQueryInfo, 0)->uid; - - int32_t tableIndex = COLUMN_INDEX_INITIAL_VAL; - for (int32_t i = 0; i < pQueryInfo->numOfTables; ++i) { - pTableMetaInfo = tscGetMetaInfo(pQueryInfo, i); - if (pTableMetaInfo->pTableMeta->id.uid == uid) { - tableIndex = i; - break; - } + // if the unit of time window value is millisecond, change the value from microsecond + STableMetaInfo* pTableMetaInfo = tscGetMetaInfo(pQueryInfo, 0); + STableComInfo tinfo = tscGetTableInfo(pTableMetaInfo->pTableMeta); + if (tinfo.precision == TSDB_TIME_PRECISION_MILLI) { + pQueryInfo->sessionWindow.gap = pQueryInfo->sessionWindow.gap / 1000; } - if (tableIndex == COLUMN_INDEX_INITIAL_VAL) { - return TSDB_CODE_TSC_INVALID_SQL; + if (pQueryInfo->sessionWindow.gap != 0 && pQueryInfo->interval.interval != 0) { + return invalidSqlErrMsg(tscGetErrorMsgPayload(pCmd), msg2); } - SSchema s = {.bytes = TSDB_KEYSIZE, .type = TSDB_DATA_TYPE_TIMESTAMP, .colId = PRIMARYKEY_TIMESTAMP_COL_INDEX}; - tstrncpy(s.name, aAggs[TSDB_FUNC_TS].name, sizeof(s.name)); - - SColumnIndex index = {tableIndex, PRIMARYKEY_TIMESTAMP_COL_INDEX}; - tscAddFuncInSelectClause(pQueryInfo, 0, TSDB_FUNC_TS, &index, &s, TSDB_COL_NORMAL); - - if (parseOffsetClause(pCmd, pQueryInfo, pQuerySql) != TSDB_CODE_SUCCESS) { - return TSDB_CODE_TSC_INVALID_SQL; + SColumnIndex index = COLUMN_INDEX_INITIALIZER; + if (getColumnIndexByName(pCmd, col, pQueryInfo, &index) != TSDB_CODE_SUCCESS) { + return invalidSqlErrMsg(tscGetErrorMsgPayload(pCmd), msg3); } - if (parseSlidingClause(pSql, pQueryInfo, pQuerySql) != TSDB_CODE_SUCCESS) { - return TSDB_CODE_TSC_INVALID_SQL; - } + pQueryInfo->sessionWindow.primaryColId = PRIMARYKEY_TIMESTAMP_COL_INDEX; - return TSDB_CODE_SUCCESS; + // The following part is used to check for the invalid query expression. + return checkInvalidExprForTimeWindow(pCmd, pQueryInfo); } -int32_t parseOffsetClause(SSqlCmd* pCmd, SQueryInfo* pQueryInfo, SQuerySQL* pQuerySql) { +int32_t parseIntervalOffset(SSqlCmd* pCmd, SQueryInfo* pQueryInfo, SStrToken* offsetToken) { const char* msg1 = "interval offset cannot be negative"; const char* msg2 = "interval offset should be shorter than interval"; const char* msg3 = "cannot use 'year' as offset when interval is 'month'"; @@ -821,7 +876,7 @@ int32_t parseOffsetClause(SSqlCmd* pCmd, SQueryInfo* pQueryInfo, SQuerySQL* pQue STableMetaInfo* pTableMetaInfo = tscGetMetaInfo(pQueryInfo, 0); STableComInfo tinfo = tscGetTableInfo(pTableMetaInfo->pTableMeta); - SStrToken* t = &pQuerySql->offset; + SStrToken* t = offsetToken; if (t->n == 0) { pQueryInfo->interval.offsetUnit = pQueryInfo->interval.intervalUnit; pQueryInfo->interval.offset = 0; @@ -864,20 +919,17 @@ int32_t parseOffsetClause(SSqlCmd* pCmd, SQueryInfo* pQueryInfo, SQuerySQL* pQue return TSDB_CODE_SUCCESS; } -int32_t parseSlidingClause(SSqlObj* pSql, SQueryInfo* pQueryInfo, SQuerySQL* pQuerySql) { +int32_t parseSlidingClause(SSqlCmd* pCmd, SQueryInfo* pQueryInfo, SStrToken* pSliding) { const char* msg0 = "sliding value too small"; const char* msg1 = "sliding value no larger than the interval value"; const char* msg2 = "sliding value can not less than 1% of interval value"; const char* msg3 = "does not support sliding when interval is natural month/year"; -// const char* msg4 = "sliding not support yet in ordinary query"; const static int32_t INTERVAL_SLIDING_FACTOR = 100; - SSqlCmd* pCmd = &pSql->cmd; STableMetaInfo* pTableMetaInfo = tscGetMetaInfo(pQueryInfo, 0); STableComInfo tinfo = tscGetTableInfo(pTableMetaInfo->pTableMeta); - SStrToken* pSliding = &pQuerySql->sliding; if (pSliding->n == 0) { pQueryInfo->interval.slidingUnit = pQueryInfo->interval.intervalUnit; pQueryInfo->interval.sliding = pQueryInfo->interval.interval; @@ -969,7 +1021,7 @@ static bool validateTableColumnInfo(SArray* pFieldList, SSqlCmd* pCmd) { const char* msg1 = "first column must be timestamp"; const char* msg2 = "row length exceeds max length"; const char* msg3 = "duplicated column names"; - const char* msg4 = "invalid data types"; + const char* msg4 = "invalid data type"; const char* msg5 = "invalid binary/nchar column length"; const char* msg6 = "invalid column name"; @@ -990,14 +1042,13 @@ static bool validateTableColumnInfo(SArray* pFieldList, SSqlCmd* pCmd) { int32_t nLen = 0; for (int32_t i = 0; i < numOfCols; ++i) { pField = taosArrayGet(pFieldList, i); - - if (pField->bytes == 0) { - invalidSqlErrMsg(tscGetErrorMsgPayload(pCmd), msg5); + if (!isValidDataType(pField->type)) { + invalidSqlErrMsg(tscGetErrorMsgPayload(pCmd), msg4); return false; } - if (!isValidDataType(pField->type)) { - invalidSqlErrMsg(tscGetErrorMsgPayload(pCmd), msg4); + if (pField->bytes == 0) { + invalidSqlErrMsg(tscGetErrorMsgPayload(pCmd), msg5); return false; } @@ -1190,7 +1241,7 @@ bool validateOneColumn(SSqlCmd* pCmd, TAOS_FIELD* pColField) { const char* msg1 = "too many columns"; const char* msg2 = "duplicated column names"; const char* msg3 = "column length too long"; - const char* msg4 = "invalid data types"; + const char* msg4 = "invalid data type"; const char* msg5 = "invalid column name"; const char* msg6 = "invalid column length"; @@ -1537,7 +1588,7 @@ bool isValidDistinctSql(SQueryInfo* pQueryInfo) { return false; } -int32_t parseSelectClause(SSqlCmd* pCmd, int32_t clauseIndex, tSQLExprList* pSelection, bool isSTable, bool joinQuery, bool intervalQuery) { +int32_t parseSelectClause(SSqlCmd* pCmd, int32_t clauseIndex, tSQLExprList* pSelection, bool isSTable, bool joinQuery, bool timeWindowQuery) { assert(pSelection != NULL && pCmd != NULL); const char* msg2 = "functions or others can not be mixed up"; @@ -1604,7 +1655,7 @@ int32_t parseSelectClause(SSqlCmd* pCmd, int32_t clauseIndex, tSQLExprList* pSel addPrimaryTsColIntoResult(pQueryInfo); } - if (!functionCompatibleCheck(pQueryInfo, joinQuery, intervalQuery)) { + if (!functionCompatibleCheck(pQueryInfo, joinQuery, timeWindowQuery)) { return invalidSqlErrMsg(tscGetErrorMsgPayload(pCmd), msg2); } @@ -1872,22 +1923,18 @@ void setResultColName(char* name, tSqlExprItem* pItem, int32_t functionId, SStrT } } -static void updateLastQueryInfoForGroupby(SQueryInfo* pQueryInfo, STableMeta* pTableMeta, int32_t functionId, int32_t index) { - if (functionId != TSDB_FUNC_LAST) { // todo refactor - return; - } - - SSqlGroupbyExpr* pGroupBy = &pQueryInfo->groupbyExpr; - if (pGroupBy->numOfGroupCols > 0) { - for(int32_t k = 0; k < pGroupBy->numOfGroupCols; ++k) { - SColIndex* pIndex = taosArrayGet(pGroupBy->columnInfo, k); - if (!TSDB_COL_IS_TAG(pIndex->flag) && pIndex->colIndex < tscGetNumOfColumns(pTableMeta)) { // group by normal columns - SSqlExpr* pExpr = taosArrayGetP(pQueryInfo->exprList, index); - pExpr->numOfParams = 1; - pExpr->param->i64 = TSDB_ORDER_ASC; - - return; +static void updateLastScanOrderIfNeeded(SQueryInfo* pQueryInfo) { + if (pQueryInfo->sessionWindow.gap > 0 || tscGroupbyColumn(pQueryInfo)) { + size_t numOfExpr = tscSqlExprNumOfExprs(pQueryInfo); + for (int32_t i = 0; i < numOfExpr; ++i) { + SSqlExpr* pExpr = tscSqlExprGet(pQueryInfo, i); + if (pExpr->functionId != TSDB_FUNC_LAST && pExpr->functionId != TSDB_FUNC_LAST_DST) { + continue; } + + pExpr->numOfParams = 1; + pExpr->param->i64 = TSDB_ORDER_ASC; + pExpr->param->nType = TSDB_DATA_TYPE_INT; } } } @@ -2156,8 +2203,6 @@ int32_t addExprAndResultField(SSqlCmd* pCmd, SQueryInfo* pQueryInfo, int32_t col if (setExprInfoForFunctions(pCmd, pQueryInfo, &pSchema[j], cvtFunc, name, colIndex++, &index, finalResult) != 0) { return TSDB_CODE_TSC_INVALID_SQL; } - - updateLastQueryInfoForGroupby(pQueryInfo, pTableMetaInfo->pTableMeta, functionId, colIndex - 1); } } else { @@ -2181,8 +2226,6 @@ int32_t addExprAndResultField(SSqlCmd* pCmd, SQueryInfo* pQueryInfo, int32_t col if (setExprInfoForFunctions(pCmd, pQueryInfo, pSchema, cvtFunc, name, colIndex + i, &index, finalResult) != 0) { return TSDB_CODE_TSC_INVALID_SQL; } - - updateLastQueryInfoForGroupby(pQueryInfo, pTableMetaInfo->pTableMeta, functionId, colIndex + i); } } @@ -2209,8 +2252,6 @@ int32_t addExprAndResultField(SSqlCmd* pCmd, SQueryInfo* pQueryInfo, int32_t col if (setExprInfoForFunctions(pCmd, pQueryInfo, &pSchema[index.columnIndex], cvtFunc, name, colIndex, &index, finalResult) != 0) { return TSDB_CODE_TSC_INVALID_SQL; } - - updateLastQueryInfoForGroupby(pQueryInfo, pTableMetaInfo->pTableMeta, functionId, colIndex); colIndex++; } @@ -2845,23 +2886,23 @@ static bool groupbyTagsOrNull(SQueryInfo* pQueryInfo) { return true; } -static bool functionCompatibleCheck(SQueryInfo* pQueryInfo, bool joinQuery, bool intervalQuery) { +static bool functionCompatibleCheck(SQueryInfo* pQueryInfo, bool joinQuery, bool twQuery) { int32_t startIdx = 0; size_t numOfExpr = tscSqlExprNumOfExprs(pQueryInfo); assert(numOfExpr > 0); SSqlExpr* pExpr = tscSqlExprGet(pQueryInfo, startIdx); - int32_t functionID = pExpr->functionId; // ts function can be simultaneously used with any other functions. + int32_t functionID = pExpr->functionId; if (functionID == TSDB_FUNC_TS || functionID == TSDB_FUNC_TS_DUMMY) { startIdx++; } int32_t factor = functionCompatList[tscSqlExprGet(pQueryInfo, startIdx)->functionId]; - if (tscSqlExprGet(pQueryInfo, 0)->functionId == TSDB_FUNC_LAST_ROW && (joinQuery || intervalQuery || !groupbyTagsOrNull(pQueryInfo))) { + if (tscSqlExprGet(pQueryInfo, 0)->functionId == TSDB_FUNC_LAST_ROW && (joinQuery || twQuery || !groupbyTagsOrNull(pQueryInfo))) { return false; } @@ -2889,7 +2930,7 @@ static bool functionCompatibleCheck(SQueryInfo* pQueryInfo, bool joinQuery, bool } } - if (functionId == TSDB_FUNC_LAST_ROW && (joinQuery || intervalQuery || !groupbyTagsOrNull(pQueryInfo))) { + if (functionId == TSDB_FUNC_LAST_ROW && (joinQuery || twQuery || !groupbyTagsOrNull(pQueryInfo))) { return false; } } @@ -5919,8 +5960,8 @@ static int32_t doAddGroupbyColumnsOnDemand(SSqlCmd* pCmd, SQueryInfo* pQueryInfo SColumnList ids = getColumnList(1, 0, pColIndex->colIndex); insertResultField(pQueryInfo, (int32_t)size, &ids, bytes, (int8_t)type, name, pExpr); } else { - // if this query is "group by" normal column, interval is not allowed - if (pQueryInfo->interval.interval > 0) { + // if this query is "group by" normal column, time window query is not allowed + if (isTimeWindowQuery(pQueryInfo)) { return invalidSqlErrMsg(tscGetErrorMsgPayload(pCmd), msg2); } @@ -5982,7 +6023,7 @@ int32_t doFunctionsCompatibleCheck(SSqlCmd* pCmd, SQueryInfo* pQueryInfo) { return invalidSqlErrMsg(tscGetErrorMsgPayload(pCmd), msg5); } - if (pQueryInfo->groupbyExpr.numOfGroupCols > 0 || pQueryInfo->interval.interval > 0) { + if (pQueryInfo->groupbyExpr.numOfGroupCols > 0 || isTimeWindowQuery(pQueryInfo)) { return invalidSqlErrMsg(tscGetErrorMsgPayload(pCmd), msg4); } else { return TSDB_CODE_SUCCESS; @@ -6557,8 +6598,7 @@ int32_t doCheckForStream(SSqlObj* pSql, SSqlInfo* pInfo) { return TSDB_CODE_TSC_INVALID_SQL; } - if ((pQueryInfo->interval.interval > 0) && - (validateFunctionsInIntervalOrGroupbyQuery(pCmd, pQueryInfo) != TSDB_CODE_SUCCESS)) { + if (isTimeWindowQuery(pQueryInfo) && (validateFunctionsInIntervalOrGroupbyQuery(pCmd, pQueryInfo) != TSDB_CODE_SUCCESS)) { return invalidSqlErrMsg(tscGetErrorMsgPayload(pCmd), msg2); } @@ -6790,10 +6830,10 @@ int32_t doCheckForQuery(SSqlObj* pSql, SQuerySQL* pQuerySql, int32_t index) { } int32_t joinQuery = (pQuerySql->from != NULL && taosArrayGetSize(pQuerySql->from) > 2); + int32_t timeWindowQuery = !(pQuerySql->interval.interval.type == 0 || pQuerySql->interval.interval.n == 0 || + pQuerySql->sessionVal.gap.n == 0); - int32_t intervalQuery = !(pQuerySql->interval.type == 0 || pQuerySql->interval.n == 0); - - if (parseSelectClause(pCmd, index, pQuerySql->pSelection, isSTable, joinQuery, intervalQuery) != TSDB_CODE_SUCCESS) { + if (parseSelectClause(pCmd, index, pQuerySql->pSelection, isSTable, joinQuery, timeWindowQuery) != TSDB_CODE_SUCCESS) { return TSDB_CODE_TSC_INVALID_SQL; } @@ -6806,12 +6846,16 @@ int32_t doCheckForQuery(SSqlObj* pSql, SQuerySQL* pQuerySql, int32_t index) { if (parseIntervalClause(pSql, pQueryInfo, pQuerySql) != TSDB_CODE_SUCCESS) { return TSDB_CODE_TSC_INVALID_SQL; } else { - if ((pQueryInfo->interval.interval > 0) && + if (isTimeWindowQuery(pQueryInfo) && (validateFunctionsInIntervalOrGroupbyQuery(pCmd, pQueryInfo) != TSDB_CODE_SUCCESS)) { return TSDB_CODE_TSC_INVALID_SQL; } } + if (parseSessionClause(pCmd, pQueryInfo, pQuerySql) != TSDB_CODE_SUCCESS) { + return TSDB_CODE_TSC_INVALID_SQL; + } + // no result due to invalid query time range if (pQueryInfo->window.skey > pQueryInfo->window.ekey) { pQueryInfo->command = TSDB_SQL_RETRIEVE_EMPTY_RESULT; @@ -6825,7 +6869,6 @@ int32_t doCheckForQuery(SSqlObj* pSql, SQuerySQL* pQuerySql, int32_t index) { // in case of join query, time range is required. if (QUERY_IS_JOIN_QUERY(pQueryInfo->type)) { int64_t timeRange = ABS(pQueryInfo->window.skey - pQueryInfo->window.ekey); - if (timeRange == 0 && pQueryInfo->window.skey == 0) { return invalidSqlErrMsg(tscGetErrorMsgPayload(pCmd), msg3); } @@ -6839,6 +6882,7 @@ int32_t doCheckForQuery(SSqlObj* pSql, SQuerySQL* pQuerySql, int32_t index) { return code; } + updateLastScanOrderIfNeeded(pQueryInfo); tscFieldInfoUpdateOffset(pQueryInfo); if (pQuerySql->fillType != NULL) { diff --git a/src/client/src/tscServer.c b/src/client/src/tscServer.c index 81269d468648927f13320ca3dc38cb3fc784bb77..c44322d636e4304239195e28cfeb850f61c2e6c4 100644 --- a/src/client/src/tscServer.c +++ b/src/client/src/tscServer.c @@ -643,7 +643,6 @@ static char *doSerializeTableInfo(SQueryTableMsg* pQueryMsg, SSqlObj *pSql, char } pSql->epSet.inUse = rand()%pSql->epSet.numOfEps; - pQueryMsg->head.vgId = htonl(vgId); STableIdInfo *pTableIdInfo = (STableIdInfo *)pMsg; @@ -658,8 +657,6 @@ static char *doSerializeTableInfo(SQueryTableMsg* pQueryMsg, SSqlObj *pSql, char int32_t numOfVgroups = (int32_t)taosArrayGetSize(pTableMetaInfo->pVgroupTables); assert(index >= 0 && index < numOfVgroups); - tscDebug("%p query on stable, vgIndex:%d, numOfVgroups:%d", pSql, index, numOfVgroups); - SVgroupTableInfo* pTableIdList = taosArrayGet(pTableMetaInfo->pVgroupTables, index); // set the vgroup info @@ -668,7 +665,10 @@ static char *doSerializeTableInfo(SQueryTableMsg* pQueryMsg, SSqlObj *pSql, char int32_t numOfTables = (int32_t)taosArrayGetSize(pTableIdList->itemList); pQueryMsg->numOfTables = htonl(numOfTables); // set the number of tables - + + tscDebug("%p query on stable, vgId:%d, numOfTables:%d, vgIndex:%d, numOfVgroups:%d", pSql, + pTableIdList->vgInfo.vgId, numOfTables, index, numOfVgroups); + // serialize each table id info for(int32_t i = 0; i < numOfTables; ++i) { STableIdInfo* pItem = taosArrayGet(pTableIdList->itemList, i); @@ -754,6 +754,8 @@ int tscBuildQueryMsg(SSqlObj *pSql, SSqlInfo *pInfo) { pQueryMsg->vgroupLimit = htobe64(pQueryInfo->vgroupLimit); pQueryMsg->sqlstrLen = htonl(sqlLen); pQueryMsg->prevResultLen = htonl(pQueryInfo->bufLen); + pQueryMsg->sw.gap = htobe64(pQueryInfo->sessionWindow.gap); + pQueryMsg->sw.primaryColId = htonl(PRIMARYKEY_TIMESTAMP_COL_INDEX); size_t numOfOutput = tscSqlExprNumOfExprs(pQueryInfo); pQueryMsg->numOfOutput = htons((int16_t)numOfOutput); // this is the stage one output column number diff --git a/src/client/src/tscSubquery.c b/src/client/src/tscSubquery.c index 71a9513313db87dd4d4839eba6b389b39e7eb539..22cb5809510e0863c8aaeb71e0072a3146b31610 100644 --- a/src/client/src/tscSubquery.c +++ b/src/client/src/tscSubquery.c @@ -1062,7 +1062,6 @@ static void tsCompRetrieveCallback(void* param, TAOS_RES* tres, int32_t numOfRow tscError("%p invalid ts comp file from vnode, abort subquery, file size:%d", pSql, numOfRows); pParentSql->res.code = TAOS_SYSTEM_ERROR(errno); - if (quitAllSubquery(pSql, pParentSql, pSupporter)){ return; } diff --git a/src/client/src/tscUtil.c b/src/client/src/tscUtil.c index 8fd4e6e6f1f143f8569b77c4273e2f1ffe51710a..2d5e8382a430f144a09697b709748f605ce2625a 100644 --- a/src/client/src/tscUtil.c +++ b/src/client/src/tscUtil.c @@ -239,6 +239,21 @@ bool tscIsSecondStageQuery(SQueryInfo* pQueryInfo) { return false; } +bool tscGroupbyColumn(SQueryInfo* pQueryInfo) { + STableMetaInfo* pTableMetaInfo = tscGetMetaInfo(pQueryInfo, 0); + int32_t numOfCols = tscGetNumOfColumns(pTableMetaInfo->pTableMeta); + + SSqlGroupbyExpr* pGroupbyExpr = &pQueryInfo->groupbyExpr; + for (int32_t k = 0; k < pGroupbyExpr->numOfGroupCols; ++k) { + SColIndex* pIndex = taosArrayGet(pGroupbyExpr->columnInfo, k); + if (!TSDB_COL_IS_TAG(pIndex->flag) && pIndex->colIndex < numOfCols) { // group by normal columns + return true; + } + } + + return false; +} + bool tscIsTWAQuery(SQueryInfo* pQueryInfo) { size_t numOfExprs = tscSqlExprNumOfExprs(pQueryInfo); for (int32_t i = 0; i < numOfExprs; ++i) { diff --git a/src/inc/taosmsg.h b/src/inc/taosmsg.h index 8892127f70527ae84420c5d3251eae21b9343356..00f64eba77154fdb1217a7d132f0041906eeec20 100644 --- a/src/inc/taosmsg.h +++ b/src/inc/taosmsg.h @@ -485,12 +485,13 @@ typedef struct { int16_t orderColId; int16_t numOfCols; // the number of columns will be load from vnode SInterval interval; + SSessionWindow sw; // session window uint16_t tagCondLen; // tag length in current query uint32_t tbnameCondLen; // table name filter condition string length int16_t numOfGroupCols; // num of group by columns int16_t orderByIdx; int16_t orderType; // used in group by xx order by xxx - int64_t vgroupLimit; // limit the number of rows for each table, used in order by + limit in stable projection query. + int64_t vgroupLimit; // limit the number of rows for each table, used in order by + limit in stable projection query. int16_t prjOrder; // global order in super table projection query. int64_t limit; int64_t offset; diff --git a/src/inc/ttokendef.h b/src/inc/ttokendef.h index ba4ae884c56c2d2a6e551952c8cb82e04d279b88..31e38c1b50abd0013b7aa326b5f71cd884959b16 100644 --- a/src/inc/ttokendef.h +++ b/src/inc/ttokendef.h @@ -135,74 +135,75 @@ #define TK_FROM 116 #define TK_VARIABLE 117 #define TK_INTERVAL 118 -#define TK_FILL 119 -#define TK_SLIDING 120 -#define TK_ORDER 121 -#define TK_BY 122 -#define TK_ASC 123 -#define TK_DESC 124 -#define TK_GROUP 125 -#define TK_HAVING 126 -#define TK_LIMIT 127 -#define TK_OFFSET 128 -#define TK_SLIMIT 129 -#define TK_SOFFSET 130 -#define TK_WHERE 131 -#define TK_NOW 132 -#define TK_RESET 133 -#define TK_QUERY 134 -#define TK_ADD 135 -#define TK_COLUMN 136 -#define TK_TAG 137 -#define TK_CHANGE 138 -#define TK_SET 139 -#define TK_KILL 140 -#define TK_CONNECTION 141 -#define TK_STREAM 142 -#define TK_COLON 143 -#define TK_ABORT 144 -#define TK_AFTER 145 -#define TK_ATTACH 146 -#define TK_BEFORE 147 -#define TK_BEGIN 148 -#define TK_CASCADE 149 -#define TK_CLUSTER 150 -#define TK_CONFLICT 151 -#define TK_COPY 152 -#define TK_DEFERRED 153 -#define TK_DELIMITERS 154 -#define TK_DETACH 155 -#define TK_EACH 156 -#define TK_END 157 -#define TK_EXPLAIN 158 -#define TK_FAIL 159 -#define TK_FOR 160 -#define TK_IGNORE 161 -#define TK_IMMEDIATE 162 -#define TK_INITIALLY 163 -#define TK_INSTEAD 164 -#define TK_MATCH 165 -#define TK_KEY 166 -#define TK_OF 167 -#define TK_RAISE 168 -#define TK_REPLACE 169 -#define TK_RESTRICT 170 -#define TK_ROW 171 -#define TK_STATEMENT 172 -#define TK_TRIGGER 173 -#define TK_VIEW 174 -#define TK_SEMI 175 -#define TK_NONE 176 -#define TK_PREV 177 -#define TK_LINEAR 178 -#define TK_IMPORT 179 -#define TK_METRIC 180 -#define TK_TBNAME 181 -#define TK_JOIN 182 -#define TK_METRICS 183 -#define TK_INSERT 184 -#define TK_INTO 185 -#define TK_VALUES 186 +#define TK_SESSION 119 +#define TK_FILL 120 +#define TK_SLIDING 121 +#define TK_ORDER 122 +#define TK_BY 123 +#define TK_ASC 124 +#define TK_DESC 125 +#define TK_GROUP 126 +#define TK_HAVING 127 +#define TK_LIMIT 128 +#define TK_OFFSET 129 +#define TK_SLIMIT 130 +#define TK_SOFFSET 131 +#define TK_WHERE 132 +#define TK_NOW 133 +#define TK_RESET 134 +#define TK_QUERY 135 +#define TK_ADD 136 +#define TK_COLUMN 137 +#define TK_TAG 138 +#define TK_CHANGE 139 +#define TK_SET 140 +#define TK_KILL 141 +#define TK_CONNECTION 142 +#define TK_STREAM 143 +#define TK_COLON 144 +#define TK_ABORT 145 +#define TK_AFTER 146 +#define TK_ATTACH 147 +#define TK_BEFORE 148 +#define TK_BEGIN 149 +#define TK_CASCADE 150 +#define TK_CLUSTER 151 +#define TK_CONFLICT 152 +#define TK_COPY 153 +#define TK_DEFERRED 154 +#define TK_DELIMITERS 155 +#define TK_DETACH 156 +#define TK_EACH 157 +#define TK_END 158 +#define TK_EXPLAIN 159 +#define TK_FAIL 160 +#define TK_FOR 161 +#define TK_IGNORE 162 +#define TK_IMMEDIATE 163 +#define TK_INITIALLY 164 +#define TK_INSTEAD 165 +#define TK_MATCH 166 +#define TK_KEY 167 +#define TK_OF 168 +#define TK_RAISE 169 +#define TK_REPLACE 170 +#define TK_RESTRICT 171 +#define TK_ROW 172 +#define TK_STATEMENT 173 +#define TK_TRIGGER 174 +#define TK_VIEW 175 +#define TK_SEMI 176 +#define TK_NONE 177 +#define TK_PREV 178 +#define TK_LINEAR 179 +#define TK_IMPORT 180 +#define TK_METRIC 181 +#define TK_TBNAME 182 +#define TK_JOIN 183 +#define TK_METRICS 184 +#define TK_INSERT 185 +#define TK_INTO 186 +#define TK_VALUES 187 #define TK_SPACE 300 diff --git a/src/os/inc/osTime.h b/src/os/inc/osTime.h index b20ccadadb22a04733d97bd19b919660ee677d0d..2c50e7eeabd934a9d88f32d4b3bdc29d41d699b1 100644 --- a/src/os/inc/osTime.h +++ b/src/os/inc/osTime.h @@ -72,6 +72,11 @@ typedef struct SInterval { int64_t offset; } SInterval; +typedef struct SSessionWindow { + int64_t gap; // gap between two session window(in microseconds) + int32_t primaryColId; // primary timestamp column +} SSessionWindow; + int64_t taosTimeAdd(int64_t t, int64_t duration, char unit, int32_t precision); int64_t taosTimeTruncate(int64_t t, const SInterval* pInterval, int32_t precision); int32_t taosTimeCountInterval(int64_t skey, int64_t ekey, int64_t interval, char unit, int32_t precision); diff --git a/src/query/inc/qExecutor.h b/src/query/inc/qExecutor.h index 0d8870a377fb76803aee5f2a00d94454a35bea87..3615c32a905a87f7a5ed604bcd2e86baa3a5ee77 100644 --- a/src/query/inc/qExecutor.h +++ b/src/query/inc/qExecutor.h @@ -185,7 +185,6 @@ typedef struct SQuery { bool groupbyColumn; // denote if this is a groupby normal column query bool hasTagResults; // if there are tag values in final result or not bool timeWindowInterpo;// if the time window start/end required interpolation - bool queryWindowIdentical; // all query time windows are identical for all tables in one group bool queryBlockDist; // if query data block distribution bool stabledev; // super table stddev query int32_t interBufSize; // intermediate buffer sizse @@ -196,6 +195,7 @@ typedef struct SQuery { STimeWindow window; SInterval interval; + SSessionWindow sw; int16_t precision; int16_t numOfOutput; int16_t fillType; @@ -279,10 +279,11 @@ enum OPERATOR_TYPE_E { OP_Groupby = 8, OP_Limit = 9, OP_Offset = 10, - OP_TimeInterval = 11, - OP_Fill = 12, - OP_MultiTableAggregate = 13, - OP_MultiTableTimeInterval = 14, + OP_TimeWindow = 11, + OP_SessionWindow = 12, + OP_Fill = 13, + OP_MultiTableAggregate = 14, + OP_MultiTableTimeInterval = 15, }; typedef struct SOperatorInfo { @@ -411,6 +412,14 @@ typedef struct SGroupbyOperatorInfo { char *prevData; // previous group by value } SGroupbyOperatorInfo; +typedef struct SSWindowOperatorInfo { + SOptrBasicInfo binfo; + STimeWindow curWindow; // current time window + TSKEY prevTs; // previous timestamp + int32_t numOfRows; // number of rows + int32_t start; // start row index +} SSWindowOperatorInfo; + void freeParam(SQueryParam *param); int32_t convertQueryMsg(SQueryTableMsg *pQueryMsg, SQueryParam* param); int32_t createQueryFuncExprFromMsg(SQueryTableMsg *pQueryMsg, int32_t numOfOutput, SExprInfo **pExprInfo, SSqlFuncMsg **pExprMsg, diff --git a/src/query/inc/qSqlparser.h b/src/query/inc/qSqlparser.h index 0ad502994008044c27b757f54314cb77a6cf5707..11cab1e69b849025c0d4ec2fd372e92945c3a3b7 100644 --- a/src/query/inc/qSqlparser.h +++ b/src/query/inc/qSqlparser.h @@ -58,14 +58,19 @@ typedef struct SIntervalVal { SStrToken offset; } SIntervalVal; +typedef struct SSessionWindowVal { + SStrToken col; + SStrToken gap; +} SSessionWindowVal; + typedef struct SQuerySQL { struct tSQLExprList *pSelection; // select clause SArray * from; // from clause SArray struct tSQLExpr * pWhere; // where clause [optional] SArray * pGroupby; // groupby clause, only for tags[optional], SArray SArray * pSortOrder; // orderby [optional], SArray - SStrToken interval; // interval [optional] - SStrToken offset; // offset window [optional] + SIntervalVal interval; // (interval, interval_offset) [optional] + SSessionWindowVal sessionVal; // session window [optional] SStrToken sliding; // sliding window [optional] SLimitVal limit; // limit offset [optional] SLimitVal slimit; // group limit offset [optional] @@ -256,8 +261,8 @@ tSQLExprList *tSqlExprListAppend(tSQLExprList *pList, tSQLExpr *pNode, SStrToken void tSqlExprListDestroy(tSQLExprList *pList); -SQuerySQL *tSetQuerySqlElems(SStrToken *pSelectToken, tSQLExprList *pSelection, SArray *pFrom, tSQLExpr *pWhere, - SArray *pGroupby, SArray *pSortOrder, SIntervalVal *pInterval, +SQuerySQL *tSetQuerySqlNode(SStrToken *pSelectToken, tSQLExprList *pSelection, SArray *pFrom, tSQLExpr *pWhere, + SArray *pGroupby, SArray *pSortOrder, SIntervalVal *pInterval, SSessionWindowVal *pSession, SStrToken *pSliding, SArray *pFill, SLimitVal *pLimit, SLimitVal *pGLimit); SCreateTableSQL *tSetCreateSqlElems(SArray *pCols, SArray *pTags, SQuerySQL *pSelect, int32_t type); diff --git a/src/query/inc/sql.y b/src/query/inc/sql.y index c340ea8224b0996a35638fde1261be8bc142d8b4..b35644b6f2e4c7fa50e734f11ce12cb7a0505933 100644 --- a/src/query/inc/sql.y +++ b/src/query/inc/sql.y @@ -326,8 +326,8 @@ signed(A) ::= PLUS INTEGER(X). { A = strtol(X.z, NULL, 10); } signed(A) ::= MINUS INTEGER(X). { A = -strtol(X.z, NULL, 10);} ////////////////////////////////// The CREATE TABLE statement /////////////////////////////// -cmd ::= CREATE TABLE create_table_args. {} -cmd ::= CREATE TABLE create_stable_args. {} +cmd ::= CREATE TABLE create_table_args. {} +cmd ::= CREATE TABLE create_stable_args. {} cmd ::= CREATE STABLE create_stable_args. {} cmd ::= CREATE TABLE create_table_list(Z). { pInfo->type = TSDB_SQL_CREATE_TABLE; pInfo->pCreateTableInfo = Z;} @@ -452,8 +452,8 @@ tagitem(A) ::= PLUS(X) FLOAT(Y). { //////////////////////// The SELECT statement ///////////////////////////////// %type select {SQuerySQL*} %destructor select {doDestroyQuerySql($$);} -select(A) ::= SELECT(T) selcollist(W) from(X) where_opt(Y) interval_opt(K) fill_opt(F) sliding_opt(S) groupby_opt(P) orderby_opt(Z) having_opt(N) slimit_opt(G) limit_opt(L). { - A = tSetQuerySqlElems(&T, W, X, Y, P, Z, &K, &S, F, &L, &G); +select(A) ::= SELECT(T) selcollist(W) from(X) where_opt(Y) interval_opt(K) session_option(H) fill_opt(F) sliding_opt(S) groupby_opt(P) orderby_opt(Z) having_opt(N) slimit_opt(G) limit_opt(L). { + A = tSetQuerySqlNode(&T, W, X, Y, P, Z, &K, &H, &S, F, &L, &G); } %type union {SSubclauseInfo*} @@ -471,7 +471,7 @@ cmd ::= union(X). { setSqlInfo(pInfo, X, NULL, TSDB_SQL_SELECT); } // select server_version(), select client_version(), // select server_state(); select(A) ::= SELECT(T) selcollist(W). { - A = tSetQuerySqlElems(&T, W, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + A = tSetQuerySqlNode(&T, W, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); } // selcollist is a list of expressions that are to become the return @@ -546,13 +546,21 @@ tablelist(A) ::= tablelist(Y) COMMA ids(X) cpxName(Z) ids(F). { tmvar(A) ::= VARIABLE(X). {A = X;} %type interval_opt {SIntervalVal} -interval_opt(N) ::= INTERVAL LP tmvar(E) RP. {N.interval = E; N.offset.n = 0; N.offset.z = NULL; N.offset.type = 0;} -interval_opt(N) ::= INTERVAL LP tmvar(E) COMMA tmvar(O) RP. {N.interval = E; N.offset = O;} +interval_opt(N) ::= INTERVAL LP tmvar(E) RP. {N.interval = E; N.offset.n = 0;} +interval_opt(N) ::= INTERVAL LP tmvar(E) COMMA tmvar(X) RP. {N.interval = E; N.offset = X;} interval_opt(N) ::= . {memset(&N, 0, sizeof(N));} +%type session_option {SSessionWindowVal} +session_option(X) ::= . {X.col.n = 0; X.gap.n = 0;} +session_option(X) ::= SESSION LP ids(V) cpxName(Z) COMMA tmvar(Y) RP. { + V.n += Z.n; + X.col = V; + X.gap = Y; +} + %type fill_opt {SArray*} %destructor fill_opt {taosArrayDestroy($$);} -fill_opt(N) ::= . {N = 0; } +fill_opt(N) ::= . { N = 0; } fill_opt(N) ::= FILL LP ID(Y) COMMA tagitemlist(X) RP. { tVariant A = {0}; toTSDBType(Y.type); diff --git a/src/query/src/qExecutor.c b/src/query/src/qExecutor.c index dca0e1f46413eec50e8d13350ec4725701f5cb52..3aad2187531d077e92072f7c995f872469c8e6bb 100644 --- a/src/query/src/qExecutor.c +++ b/src/query/src/qExecutor.c @@ -171,6 +171,7 @@ static SOperatorInfo* createArithOperatorInfo(SQueryRuntimeEnv* pRuntimeEnv, SOp static SOperatorInfo* createLimitOperatorInfo(SQueryRuntimeEnv* pRuntimeEnv, SOperatorInfo* upstream); static SOperatorInfo* createOffsetOperatorInfo(SQueryRuntimeEnv* pRuntimeEnv, SOperatorInfo* upstream); static SOperatorInfo* createTimeIntervalOperatorInfo(SQueryRuntimeEnv* pRuntimeEnv, SOperatorInfo* upstream, SExprInfo* pExpr, int32_t numOfOutput); +static SOperatorInfo* createSWindowOperatorInfo(SQueryRuntimeEnv* pRuntimeEnv, SOperatorInfo* upstream, SExprInfo* pExpr, int32_t numOfOutput); static SOperatorInfo* createFillOperatorInfo(SQueryRuntimeEnv* pRuntimeEnv, SOperatorInfo* upstream, SExprInfo* pExpr, int32_t numOfOutput); static SOperatorInfo* createGroupbyOperatorInfo(SQueryRuntimeEnv* pRuntimeEnv, SOperatorInfo* upstream, SExprInfo* pExpr, int32_t numOfOutput); static SOperatorInfo* createMultiTableAggOperatorInfo(SQueryRuntimeEnv* pRuntimeEnv, SOperatorInfo* upstream, SExprInfo* pExpr, int32_t numOfOutput); @@ -1254,8 +1255,7 @@ static void hashIntervalAgg(SOperatorInfo* pOperatorInfo, SResultRowInfo* pResul setResultRowInterpo(pResult, RESULT_ROW_END_INTERP); setNotInterpoWindowKey(pInfo->pCtx, pQuery->numOfOutput, RESULT_ROW_START_INTERP); - doApplyFunctions(pRuntimeEnv, pInfo->pCtx, &w, startPos, 0, tsCols, pSDataBlock->info.rows, - numOfOutput); + doApplyFunctions(pRuntimeEnv, pInfo->pCtx, &w, startPos, 0, tsCols, pSDataBlock->info.rows, numOfOutput); } // restore current time window @@ -1268,8 +1268,7 @@ static void hashIntervalAgg(SOperatorInfo* pOperatorInfo, SResultRowInfo* pResul // window start key interpolation doWindowBorderInterpolation(pOperatorInfo, pSDataBlock, pInfo->pCtx, pResult, &win, startPos, forwardStep); - doApplyFunctions(pRuntimeEnv, pInfo->pCtx, &win, startPos, forwardStep, tsCols, pSDataBlock->info.rows, - numOfOutput); + doApplyFunctions(pRuntimeEnv, pInfo->pCtx, &win, startPos, forwardStep, tsCols, pSDataBlock->info.rows, numOfOutput); STimeWindow nextWin = win; while (1) { @@ -1287,13 +1286,11 @@ static void hashIntervalAgg(SOperatorInfo* pOperatorInfo, SResultRowInfo* pResul } ekey = reviseWindowEkey(pQuery, &nextWin); - forwardStep = - getNumOfRowsInTimeWindow(pQuery, &pSDataBlock->info, tsCols, startPos, ekey, binarySearchForKey, true); + forwardStep = getNumOfRowsInTimeWindow(pQuery, &pSDataBlock->info, tsCols, startPos, ekey, binarySearchForKey, true); // window start(end) key interpolation doWindowBorderInterpolation(pOperatorInfo, pSDataBlock, pInfo->pCtx, pResult, &nextWin, startPos, forwardStep); - doApplyFunctions(pRuntimeEnv, pInfo->pCtx, &nextWin, startPos, forwardStep, tsCols, - pSDataBlock->info.rows, numOfOutput); + doApplyFunctions(pRuntimeEnv, pInfo->pCtx, &nextWin, startPos, forwardStep, tsCols, pSDataBlock->info.rows, numOfOutput); } if (pQuery->timeWindowInterpo) { @@ -1323,6 +1320,7 @@ static void doHashGroupbyAgg(SOperatorInfo* pOperator, SGroupbyOperatorInfo *pIn continue; } + // Compare with the previous row of this column, and do not set the output buffer again if they are identical. if (pInfo->prevData == NULL || (memcmp(pInfo->prevData, val, bytes) != 0)) { if (pInfo->prevData == NULL) { pInfo->prevData = malloc(bytes); @@ -1347,6 +1345,66 @@ static void doHashGroupbyAgg(SOperatorInfo* pOperator, SGroupbyOperatorInfo *pIn } } +static void doSessionWindowAggImpl(SOperatorInfo* pOperator, SSWindowOperatorInfo *pInfo, SSDataBlock *pSDataBlock) { + SQueryRuntimeEnv* pRuntimeEnv = pOperator->pRuntimeEnv; + STableQueryInfo* item = pRuntimeEnv->pQuery->current; + + // primary timestamp column + SColumnInfoData* pColInfoData = taosArrayGet(pSDataBlock->pDataBlock, 0); + + bool masterScan = IS_MASTER_SCAN(pRuntimeEnv); + SOptrBasicInfo* pBInfo = &pInfo->binfo; + + int64_t gap = pOperator->pRuntimeEnv->pQuery->sw.gap; + pInfo->numOfRows = 0; + + TSKEY* tsList = (TSKEY*)pColInfoData->pData; + for (int32_t j = 0; j < pSDataBlock->info.rows; ++j) { + if (pInfo->prevTs == INT64_MIN) { + pInfo->curWindow.skey = tsList[j]; + pInfo->curWindow.ekey = tsList[j]; + pInfo->prevTs = tsList[j]; + pInfo->numOfRows = 1; + pInfo->start = j; + } else if (tsList[j] - pInfo->prevTs <= gap) { + pInfo->curWindow.ekey = tsList[j]; + pInfo->prevTs = tsList[j]; + pInfo->numOfRows += 1; + pInfo->start = j; + } else { // start a new session window + SResultRow* pResult = NULL; + + int32_t ret = setWindowOutputBufByKey(pRuntimeEnv, &pBInfo->resultRowInfo, &pInfo->curWindow, masterScan, + &pResult, item->groupIndex, pBInfo->pCtx, pOperator->numOfOutput, + pBInfo->rowCellInfoOffset); + if (ret != TSDB_CODE_SUCCESS) { // null data, too many state code + longjmp(pRuntimeEnv->env, TSDB_CODE_QRY_APP_ERROR); + } + + doApplyFunctions(pRuntimeEnv, pBInfo->pCtx, &pInfo->curWindow, pInfo->start, pInfo->numOfRows, tsList, + pSDataBlock->info.rows, pOperator->numOfOutput); + + pInfo->curWindow.skey = tsList[j]; + pInfo->curWindow.ekey = tsList[j]; + pInfo->prevTs = tsList[j]; + pInfo->numOfRows = 1; + pInfo->start = j; + } + } + + SResultRow* pResult = NULL; + + int32_t ret = setWindowOutputBufByKey(pRuntimeEnv, &pBInfo->resultRowInfo, &pInfo->curWindow, masterScan, + &pResult, item->groupIndex, pBInfo->pCtx, pOperator->numOfOutput, + pBInfo->rowCellInfoOffset); + if (ret != TSDB_CODE_SUCCESS) { // null data, too many state code + longjmp(pRuntimeEnv->env, TSDB_CODE_QRY_APP_ERROR); + } + + doApplyFunctions(pRuntimeEnv, pBInfo->pCtx, &pInfo->curWindow, pInfo->start, pInfo->numOfRows, tsList, + pSDataBlock->info.rows, pOperator->numOfOutput); +} + static void setResultRowKey(SResultRow* pResultRow, char* pData, int16_t type) { int64_t v = -1; GET_TYPED_DATA(v, int64_t, type, pData); @@ -1700,6 +1758,13 @@ static int32_t setupQueryRuntimeEnv(SQueryRuntimeEnv *pRuntimeEnv, int32_t numOf createGroupbyOperatorInfo(pRuntimeEnv, pRuntimeEnv->pTableScanner, pQuery->pExpr1, pQuery->numOfOutput); setTableScanFilterOperatorInfo(pRuntimeEnv->pTableScanner->info, pRuntimeEnv->proot); + if (pQuery->pExpr2 != NULL) { + pRuntimeEnv->proot = createArithOperatorInfo(pRuntimeEnv, pRuntimeEnv->proot, pQuery->pExpr2, pQuery->numOfExpr2); + } + } else if (pQuery->sw.gap > 0) { + pRuntimeEnv->proot = createSWindowOperatorInfo(pRuntimeEnv, pRuntimeEnv->pTableScanner, pQuery->pExpr1, pQuery->numOfOutput); + setTableScanFilterOperatorInfo(pRuntimeEnv->pTableScanner->info, pRuntimeEnv->proot); + if (pQuery->pExpr2 != NULL) { pRuntimeEnv->proot = createArithOperatorInfo(pRuntimeEnv, pRuntimeEnv->proot, pQuery->pExpr2, pQuery->numOfExpr2); } @@ -2482,7 +2547,7 @@ int32_t loadDataBlockOnDemand(SQueryRuntimeEnv* pRuntimeEnv, STableScanInfo* pTa // Calculate all time windows that are overlapping or contain current data block. // If current data block is contained by all possible time window, do not load current data block. - if (pQuery->numOfFilterCols > 0 || pQuery->groupbyColumn || + if (pQuery->numOfFilterCols > 0 || pQuery->groupbyColumn || pQuery->sw.gap > 0 || (QUERY_IS_INTERVAL_QUERY(pQuery) && overlapWithTimeWindow(pQuery, &pBlock->info))) { (*status) = BLK_DATA_ALL_NEEDED; } @@ -3039,7 +3104,7 @@ void finalizeQueryResult(SOperatorInfo* pOperator, SQLFunctionCtx* pCtx, SResult SQuery *pQuery = pRuntimeEnv->pQuery; int32_t numOfOutput = pOperator->numOfOutput; - if (pQuery->groupbyColumn || QUERY_IS_INTERVAL_QUERY(pQuery)) { + if (pQuery->groupbyColumn || QUERY_IS_INTERVAL_QUERY(pQuery) || pQuery->sw.gap > 0) { // for each group result, call the finalize function for each column if (pQuery->groupbyColumn) { closeAllResultRows(pResultRowInfo); @@ -4240,7 +4305,7 @@ void setTableScanFilterOperatorInfo(STableScanInfo* pTableScanInfo, SOperatorInf pTableScanInfo->pCtx = pAggInfo->binfo.pCtx; pTableScanInfo->pResultRowInfo = &pAggInfo->binfo.resultRowInfo; pTableScanInfo->rowCellInfoOffset = pAggInfo->binfo.rowCellInfoOffset; - } else if (pDownstream->operatorType == OP_TimeInterval) { + } else if (pDownstream->operatorType == OP_TimeWindow) { STableIntervalOperatorInfo *pIntervalInfo = pDownstream->info; pTableScanInfo->pCtx = pIntervalInfo->pCtx; @@ -4264,6 +4329,12 @@ void setTableScanFilterOperatorInfo(STableScanInfo* pTableScanInfo, SOperatorInf } else if (pDownstream->operatorType == OP_Arithmetic) { SArithOperatorInfo *pInfo = pDownstream->info; + pTableScanInfo->pCtx = pInfo->binfo.pCtx; + pTableScanInfo->pResultRowInfo = &pInfo->binfo.resultRowInfo; + pTableScanInfo->rowCellInfoOffset = pInfo->binfo.rowCellInfoOffset; + } else if (pDownstream->operatorType == OP_SessionWindow) { + SSWindowOperatorInfo* pInfo = pDownstream->info; + pTableScanInfo->pCtx = pInfo->binfo.pCtx; pTableScanInfo->pResultRowInfo = &pInfo->binfo.resultRowInfo; pTableScanInfo->rowCellInfoOffset = pInfo->binfo.rowCellInfoOffset; @@ -4619,6 +4690,62 @@ static SSDataBlock* doSTableIntervalAgg(void* param) { return pIntervalInfo->pRes; } +static SSDataBlock* doSessionWindowAgg(void* param) { + SOperatorInfo* pOperator = (SOperatorInfo*) param; + if (pOperator->status == OP_EXEC_DONE) { + return NULL; + } + + SSWindowOperatorInfo* pWindowInfo = pOperator->info; + SOptrBasicInfo* pBInfo = &pWindowInfo->binfo; + + SQueryRuntimeEnv* pRuntimeEnv = pOperator->pRuntimeEnv; + if (pOperator->status == OP_RES_TO_RETURN) { + toSSDataBlock(&pRuntimeEnv->groupResInfo, pRuntimeEnv, pBInfo->pRes); + + if (pBInfo->pRes->info.rows == 0 || !hasRemainDataInCurrentGroup(&pRuntimeEnv->groupResInfo)) { + pOperator->status = OP_EXEC_DONE; + } + + return pBInfo->pRes; + } + + SQuery* pQuery = pRuntimeEnv->pQuery; + int32_t order = pQuery->order.order; + STimeWindow win = pQuery->window; + + SOperatorInfo* upstream = pOperator->upstream; + + while(1) { + SSDataBlock* pBlock = upstream->exec(upstream); + if (pBlock == NULL) { + break; + } + + // the pDataBlock are always the same one, no need to call this again + setInputDataBlock(pOperator, pBInfo->pCtx, pBlock, pQuery->order.order); + doSessionWindowAggImpl(pOperator, pWindowInfo, pBlock); + } + + // restore the value + pQuery->order.order = order; + pQuery->window = win; + + pOperator->status = OP_RES_TO_RETURN; + closeAllResultRows(&pBInfo->resultRowInfo); + setQueryStatus(pRuntimeEnv, QUERY_COMPLETED); + finalizeQueryResult(pOperator, pBInfo->pCtx, &pBInfo->resultRowInfo, pBInfo->rowCellInfoOffset); + + initGroupResInfo(&pRuntimeEnv->groupResInfo, &pBInfo->resultRowInfo); + toSSDataBlock(&pRuntimeEnv->groupResInfo, pRuntimeEnv, pBInfo->pRes); + + if (pBInfo->pRes->info.rows == 0 || !hasRemainDataInCurrentGroup(&pRuntimeEnv->groupResInfo)) { + pOperator->status = OP_EXEC_DONE; + } + + return pBInfo->pRes->info.rows == 0? NULL:pBInfo->pRes; +} + static SSDataBlock* hashGroupbyAggregate(void* param) { SOperatorInfo* pOperator = (SOperatorInfo*) param; if (pOperator->status == OP_EXEC_DONE) { @@ -4908,7 +5035,7 @@ SOperatorInfo* createTimeIntervalOperatorInfo(SQueryRuntimeEnv* pRuntimeEnv, SOp SOperatorInfo* pOperator = calloc(1, sizeof(SOperatorInfo)); pOperator->name = "TimeIntervalAggOperator"; - pOperator->operatorType = OP_TimeInterval; + pOperator->operatorType = OP_TimeWindow; pOperator->blockingOptr = true; pOperator->status = OP_IN_EXECUTING; pOperator->upstream = upstream; @@ -4922,6 +5049,31 @@ SOperatorInfo* createTimeIntervalOperatorInfo(SQueryRuntimeEnv* pRuntimeEnv, SOp return pOperator; } +SOperatorInfo* createSWindowOperatorInfo(SQueryRuntimeEnv* pRuntimeEnv, SOperatorInfo* upstream, SExprInfo* pExpr, int32_t numOfOutput) { + SSWindowOperatorInfo* pInfo = calloc(1, sizeof(SSWindowOperatorInfo)); + + pInfo->binfo.pCtx = createSQLFunctionCtx(pRuntimeEnv, pExpr, numOfOutput, &pInfo->binfo.rowCellInfoOffset); + pInfo->binfo.pRes = createOutputBuf(pExpr, numOfOutput, pRuntimeEnv->resultInfo.capacity); + initResultRowInfo(&pInfo->binfo.resultRowInfo, 8, TSDB_DATA_TYPE_INT); + + pInfo->prevTs = INT64_MIN; + SOperatorInfo* pOperator = calloc(1, sizeof(SOperatorInfo)); + + pOperator->name = "SessionWindowAggOperator"; + pOperator->operatorType = OP_SessionWindow; + pOperator->blockingOptr = true; + pOperator->status = OP_IN_EXECUTING; + pOperator->upstream = upstream; + pOperator->pExpr = pExpr; + pOperator->numOfOutput = numOfOutput; + pOperator->info = pInfo; + pOperator->pRuntimeEnv = pRuntimeEnv; + pOperator->exec = doSessionWindowAgg; + pOperator->cleanup = destroyBasicOperatorInfo; + + return pOperator; +} + SOperatorInfo* createMultiTableTimeIntervalOperatorInfo(SQueryRuntimeEnv* pRuntimeEnv, SOperatorInfo* upstream, SExprInfo* pExpr, int32_t numOfOutput) { STableIntervalOperatorInfo* pInfo = calloc(1, sizeof(STableIntervalOperatorInfo)); @@ -4971,7 +5123,7 @@ SOperatorInfo* createGroupbyOperatorInfo(SQueryRuntimeEnv* pRuntimeEnv, SOperato } SOperatorInfo* createFillOperatorInfo(SQueryRuntimeEnv* pRuntimeEnv, SOperatorInfo* upstream, SExprInfo* pExpr, - int32_t numOfOutput) { + int32_t numOfOutput) { SFillOperatorInfo* pInfo = calloc(1, sizeof(SFillOperatorInfo)); pInfo->pRes = createOutputBuf(pExpr, numOfOutput, pRuntimeEnv->resultInfo.capacity); @@ -5203,6 +5355,17 @@ static bool validateQueryMsg(SQueryTableMsg *pQueryMsg) { return false; } + if (pQueryMsg->sw.gap < 0 || pQueryMsg->sw.primaryColId != PRIMARYKEY_TIMESTAMP_COL_INDEX) { + qError("qmsg:%p illegal value of session window time %" PRId64, pQueryMsg, pQueryMsg->sw.gap); + return false; + } + + if (pQueryMsg->sw.gap > 0 && pQueryMsg->interval.interval > 0) { + qError("qmsg:%p illegal value of session window time %" PRId64" and interval value %"PRId64, pQueryMsg, + pQueryMsg->sw.gap, pQueryMsg->interval.interval); + return false; + } + if (pQueryMsg->numOfTables <= 0) { qError("qmsg:%p illegal value of numOfTables %d", pQueryMsg, pQueryMsg->numOfTables); return false; @@ -5315,6 +5478,8 @@ int32_t convertQueryMsg(SQueryTableMsg *pQueryMsg, SQueryParam* param) { pQueryMsg->secondStageOutput = htonl(pQueryMsg->secondStageOutput); pQueryMsg->sqlstrLen = htonl(pQueryMsg->sqlstrLen); pQueryMsg->prevResultLen = htonl(pQueryMsg->prevResultLen); + pQueryMsg->sw.gap = htobe64(pQueryMsg->sw.gap); + pQueryMsg->sw.primaryColId = htonl(pQueryMsg->sw.primaryColId); // query msg safety check if (!validateQueryMsg(pQueryMsg)) { @@ -5953,7 +6118,7 @@ SQInfo* createQInfoImpl(SQueryTableMsg* pQueryMsg, SSqlGroupbyExpr* pGroupbyExpr pQuery->tagColList = pTagCols; pQuery->prjInfo.vgroupLimit = pQueryMsg->vgroupLimit; pQuery->prjInfo.ts = (pQueryMsg->order == TSDB_ORDER_ASC)? INT64_MIN:INT64_MAX; - + pQuery->sw = pQueryMsg->sw; pQuery->colList = calloc(numOfCols, sizeof(SSingleColumnFilterInfo)); if (pQuery->colList == NULL) { goto _cleanup; @@ -6023,7 +6188,6 @@ SQInfo* createQInfoImpl(SQueryTableMsg* pQueryMsg, SSqlGroupbyExpr* pGroupbyExpr changeExecuteScanOrder(pQInfo, pQueryMsg, stableQuery); SQueryRuntimeEnv* pRuntimeEnv = &pQInfo->runtimeEnv; - pQuery->queryWindowIdentical = true; bool groupByCol = isGroupbyColumn(pQuery->pGroupbyExpr); STimeWindow window = pQuery->window; @@ -6042,11 +6206,7 @@ SQInfo* createQInfoImpl(SQueryTableMsg* pQueryMsg, SSqlGroupbyExpr* pGroupbyExpr for(int32_t j = 0; j < s; ++j) { STableKeyInfo* info = taosArrayGet(pa, j); - window.skey = info->lastKey; - if (info->lastKey != pQuery->window.skey) { - pQInfo->query.queryWindowIdentical = false; - } void* buf = (char*) pQInfo->pBuf + index * sizeof(STableQueryInfo); STableQueryInfo* item = createTableQueryInfo(pQuery, info->pTable, groupByCol, window, buf); diff --git a/src/query/src/qParserImpl.c b/src/query/src/qParserImpl.c index 2488b563b9e58c3082321826411113cba8f17270..6f64a9d4be3f6b9c99e64d0217ed4b45c08ad37d 100644 --- a/src/query/src/qParserImpl.c +++ b/src/query/src/qParserImpl.c @@ -550,8 +550,8 @@ void tSqlSetColumnType(TAOS_FIELD *pField, SStrToken *type) { /* * extract the select info out of sql string */ -SQuerySQL *tSetQuerySqlElems(SStrToken *pSelectToken, tSQLExprList *pSelection, SArray *pFrom, tSQLExpr *pWhere, - SArray *pGroupby, SArray *pSortOrder, SIntervalVal *pInterval, +SQuerySQL *tSetQuerySqlNode(SStrToken *pSelectToken, tSQLExprList *pSelection, SArray *pFrom, tSQLExpr *pWhere, + SArray *pGroupby, SArray *pSortOrder, SIntervalVal *pInterval, SSessionWindowVal *pSession, SStrToken *pSliding, SArray *pFill, SLimitVal *pLimit, SLimitVal *pGLimit) { assert(pSelection != NULL); @@ -574,14 +574,17 @@ SQuerySQL *tSetQuerySqlElems(SStrToken *pSelectToken, tSQLExprList *pSelection, } if (pInterval != NULL) { - pQuery->interval = pInterval->interval; - pQuery->offset = pInterval->offset; + pQuery->interval = *pInterval; } if (pSliding != NULL) { pQuery->sliding = *pSliding; } + if (pSession != NULL) { + pQuery->sessionVal = *pSession; + } + pQuery->fillType = pFill; return pQuery; } diff --git a/src/query/src/qTokenizer.c b/src/query/src/qTokenizer.c index d6f9671d128df5620100c54b29cbecef616b1a02..63ec2bd342d3ddfb3b4158d079eb3d33117f271a 100644 --- a/src/query/src/qTokenizer.c +++ b/src/query/src/qTokenizer.c @@ -139,6 +139,7 @@ static SKeyword keywordTable[] = { {"FROM", TK_FROM}, {"VARIABLE", TK_VARIABLE}, {"INTERVAL", TK_INTERVAL}, + {"SESSION", TK_SESSION}, {"FILL", TK_FILL}, {"SLIDING", TK_SLIDING}, {"ORDER", TK_ORDER}, diff --git a/src/query/src/qUtil.c b/src/query/src/qUtil.c index 6271fab7a86a80182d9f469d95c1026b8788122d..1e7d3c9b58d3594280edc294e2147e7c908b9d0f 100644 --- a/src/query/src/qUtil.c +++ b/src/query/src/qUtil.c @@ -42,12 +42,11 @@ int32_t getOutputInterResultBufSize(SQuery* pQuery) { } int32_t initResultRowInfo(SResultRowInfo *pResultRowInfo, int32_t size, int16_t type) { - pResultRowInfo->capacity = size; - - pResultRowInfo->type = type; - pResultRowInfo->curIndex = -1; + pResultRowInfo->type = type; pResultRowInfo->size = 0; pResultRowInfo->prevSKey = TSKEY_INITIAL_VAL; + pResultRowInfo->curIndex = -1; + pResultRowInfo->capacity = size; pResultRowInfo->pResult = calloc(pResultRowInfo->capacity, POINTER_BYTES); if (pResultRowInfo->pResult == NULL) { diff --git a/src/query/src/sql.c b/src/query/src/sql.c index a66cc709b0809c46c909bdd674312e36a76549b3..2daf623ac2b3a241ddb892f14296677443d7dac0 100644 --- a/src/query/src/sql.c +++ b/src/query/src/sql.c @@ -97,27 +97,28 @@ #endif /************* Begin control #defines *****************************************/ #define YYCODETYPE unsigned short int -#define YYNOCODE 263 +#define YYNOCODE 265 #define YYACTIONTYPE unsigned short int #define ParseTOKENTYPE SStrToken typedef union { int yyinit; ParseTOKENTYPE yy0; - SLimitVal yy18; - SCreateDbInfo yy94; - int yy116; - SSubclauseInfo* yy141; - tSQLExprList* yy170; - tVariant yy218; - SIntervalVal yy220; - SCreatedTableInfo yy252; - tSQLExpr* yy282; - SCreateTableSQL* yy310; - SQuerySQL* yy372; - SCreateAcctInfo yy419; - SArray* yy429; - TAOS_FIELD yy451; - int64_t yy481; + SCreatedTableInfo yy96; + tSQLExpr* yy178; + SCreateAcctInfo yy187; + SQuerySQL* yy216; + SCreateTableSQL* yy230; + SArray* yy285; + TAOS_FIELD yy295; + tVariant yy362; + SIntervalVal yy376; + tSQLExprList* yy434; + SLimitVal yy438; + int yy460; + SSubclauseInfo* yy513; + SSessionWindowVal yy523; + int64_t yy525; + SCreateDbInfo yy526; } YYMINORTYPE; #ifndef YYSTACKDEPTH #define YYSTACKDEPTH 100 @@ -127,17 +128,17 @@ typedef union { #define ParseARG_FETCH SSqlInfo* pInfo = yypParser->pInfo #define ParseARG_STORE yypParser->pInfo = pInfo #define YYFALLBACK 1 -#define YYNSTATE 306 -#define YYNRULE 263 -#define YYNTOKEN 187 -#define YY_MAX_SHIFT 305 -#define YY_MIN_SHIFTREDUCE 494 -#define YY_MAX_SHIFTREDUCE 756 -#define YY_ERROR_ACTION 757 -#define YY_ACCEPT_ACTION 758 -#define YY_NO_ACTION 759 -#define YY_MIN_REDUCE 760 -#define YY_MAX_REDUCE 1022 +#define YYNSTATE 313 +#define YYNRULE 265 +#define YYNTOKEN 188 +#define YY_MAX_SHIFT 312 +#define YY_MIN_SHIFTREDUCE 502 +#define YY_MAX_SHIFTREDUCE 766 +#define YY_ERROR_ACTION 767 +#define YY_ACCEPT_ACTION 768 +#define YY_NO_ACTION 769 +#define YY_MIN_REDUCE 770 +#define YY_MAX_REDUCE 1034 /************* End control #defines *******************************************/ /* Define the yytestcase() macro to be a no-op if is not already defined @@ -203,255 +204,259 @@ typedef union { ** yy_default[] Default action for each state. ** *********** Begin parsing tables **********************************************/ -#define YY_ACTTAB_COUNT (668) +#define YY_ACTTAB_COUNT (675) static const YYACTIONTYPE yy_action[] = { - /* 0 */ 176, 541, 176, 197, 303, 17, 135, 620, 174, 542, - /* 10 */ 1004, 204, 1005, 47, 48, 30, 51, 52, 135, 201, - /* 20 */ 209, 41, 176, 50, 253, 55, 53, 57, 54, 758, - /* 30 */ 305, 203, 1005, 46, 45, 279, 278, 44, 43, 42, - /* 40 */ 47, 48, 214, 51, 52, 906, 928, 209, 41, 541, - /* 50 */ 50, 253, 55, 53, 57, 54, 199, 542, 660, 903, - /* 60 */ 46, 45, 216, 135, 44, 43, 42, 48, 906, 51, - /* 70 */ 52, 30, 956, 209, 41, 917, 50, 253, 55, 53, - /* 80 */ 57, 54, 250, 130, 75, 289, 46, 45, 906, 236, - /* 90 */ 44, 43, 42, 495, 496, 497, 498, 499, 500, 501, - /* 100 */ 502, 503, 504, 505, 506, 507, 304, 925, 81, 226, - /* 110 */ 70, 541, 212, 47, 48, 903, 51, 52, 30, 542, - /* 120 */ 209, 41, 24, 50, 253, 55, 53, 57, 54, 957, - /* 130 */ 36, 248, 704, 46, 45, 135, 664, 44, 43, 42, - /* 140 */ 47, 49, 894, 51, 52, 241, 892, 209, 41, 229, - /* 150 */ 50, 253, 55, 53, 57, 54, 233, 232, 180, 213, - /* 160 */ 46, 45, 903, 218, 44, 43, 42, 23, 267, 298, - /* 170 */ 297, 266, 265, 264, 296, 263, 295, 294, 293, 262, - /* 180 */ 292, 291, 866, 30, 854, 855, 856, 857, 858, 859, - /* 190 */ 860, 861, 862, 863, 864, 865, 867, 868, 51, 52, - /* 200 */ 917, 76, 209, 41, 900, 50, 253, 55, 53, 57, - /* 210 */ 54, 299, 18, 30, 198, 46, 45, 69, 269, 44, - /* 220 */ 43, 42, 208, 717, 272, 269, 708, 903, 711, 185, - /* 230 */ 714, 219, 208, 717, 271, 186, 708, 906, 711, 101, - /* 240 */ 714, 114, 113, 184, 289, 644, 215, 221, 641, 891, - /* 250 */ 642, 128, 643, 1014, 205, 206, 77, 902, 252, 36, - /* 260 */ 23, 706, 298, 297, 205, 206, 967, 296, 71, 295, - /* 270 */ 294, 293, 24, 292, 291, 874, 223, 224, 872, 873, - /* 280 */ 36, 1001, 904, 875, 805, 877, 878, 876, 161, 879, - /* 290 */ 880, 55, 53, 57, 54, 1000, 220, 707, 814, 46, - /* 300 */ 45, 235, 161, 44, 43, 42, 99, 104, 192, 44, - /* 310 */ 43, 42, 93, 103, 109, 112, 102, 254, 78, 302, - /* 320 */ 301, 122, 106, 5, 151, 56, 1, 149, 999, 33, - /* 330 */ 150, 88, 83, 87, 657, 56, 169, 165, 716, 30, - /* 340 */ 30, 25, 167, 164, 117, 116, 115, 30, 716, 889, - /* 350 */ 890, 29, 893, 715, 645, 193, 46, 45, 3, 162, - /* 360 */ 44, 43, 42, 715, 222, 207, 806, 276, 275, 12, - /* 370 */ 161, 685, 686, 80, 652, 145, 710, 709, 713, 712, - /* 380 */ 273, 277, 238, 903, 903, 239, 672, 61, 281, 31, - /* 390 */ 132, 903, 676, 677, 737, 718, 60, 20, 19, 19, - /* 400 */ 64, 194, 630, 256, 92, 91, 31, 31, 62, 6, - /* 410 */ 178, 632, 258, 720, 631, 60, 79, 28, 60, 65, - /* 420 */ 259, 14, 13, 67, 648, 619, 649, 179, 98, 97, - /* 430 */ 16, 15, 646, 966, 647, 111, 110, 127, 125, 181, - /* 440 */ 175, 182, 183, 189, 190, 188, 173, 187, 177, 905, - /* 450 */ 210, 963, 919, 962, 211, 280, 949, 39, 129, 948, - /* 460 */ 144, 927, 934, 36, 936, 126, 131, 146, 899, 237, - /* 470 */ 147, 671, 142, 148, 817, 261, 136, 37, 251, 66, - /* 480 */ 916, 58, 63, 137, 171, 138, 34, 270, 242, 249, - /* 490 */ 813, 1019, 89, 200, 1018, 1016, 246, 139, 247, 152, - /* 500 */ 140, 274, 1013, 95, 245, 1012, 1010, 153, 835, 35, - /* 510 */ 243, 32, 38, 172, 40, 802, 105, 800, 107, 108, - /* 520 */ 798, 797, 225, 163, 795, 794, 793, 792, 791, 790, - /* 530 */ 166, 168, 787, 785, 783, 781, 779, 170, 290, 240, - /* 540 */ 72, 73, 950, 100, 282, 283, 284, 285, 286, 287, - /* 550 */ 288, 300, 756, 195, 217, 260, 227, 228, 755, 230, - /* 560 */ 196, 191, 231, 84, 85, 754, 742, 234, 238, 654, - /* 570 */ 74, 68, 673, 255, 796, 8, 156, 133, 836, 118, - /* 580 */ 154, 159, 155, 158, 157, 160, 119, 789, 2, 120, - /* 590 */ 870, 788, 901, 121, 780, 4, 202, 141, 678, 143, - /* 600 */ 244, 134, 9, 10, 82, 719, 882, 26, 27, 7, - /* 610 */ 11, 21, 721, 22, 583, 257, 579, 577, 80, 576, - /* 620 */ 575, 572, 545, 268, 86, 90, 31, 94, 96, 59, - /* 630 */ 622, 621, 618, 567, 565, 557, 563, 559, 561, 555, - /* 640 */ 553, 586, 585, 584, 582, 581, 580, 578, 574, 573, - /* 650 */ 60, 543, 511, 509, 760, 759, 759, 759, 759, 759, - /* 660 */ 759, 759, 759, 759, 759, 759, 123, 124, + /* 0 */ 910, 549, 201, 310, 205, 138, 938, 3, 166, 550, + /* 10 */ 768, 312, 17, 47, 48, 138, 51, 52, 30, 180, + /* 20 */ 213, 41, 180, 50, 260, 55, 53, 57, 54, 1016, + /* 30 */ 916, 208, 1017, 46, 45, 178, 180, 44, 43, 42, + /* 40 */ 47, 48, 219, 51, 52, 207, 1017, 213, 41, 549, + /* 50 */ 50, 260, 55, 53, 57, 54, 927, 550, 184, 203, + /* 60 */ 46, 45, 913, 218, 44, 43, 42, 48, 935, 51, + /* 70 */ 52, 240, 968, 213, 41, 549, 50, 260, 55, 53, + /* 80 */ 57, 54, 969, 550, 255, 220, 46, 45, 82, 916, + /* 90 */ 44, 43, 42, 503, 504, 505, 506, 507, 508, 509, + /* 100 */ 510, 511, 512, 513, 514, 515, 311, 628, 815, 230, + /* 110 */ 70, 916, 165, 47, 48, 30, 51, 52, 276, 30, + /* 120 */ 213, 41, 904, 50, 260, 55, 53, 57, 54, 44, + /* 130 */ 43, 42, 714, 46, 45, 286, 285, 44, 43, 42, + /* 140 */ 47, 49, 824, 51, 52, 224, 165, 213, 41, 24, + /* 150 */ 50, 260, 55, 53, 57, 54, 216, 36, 902, 913, + /* 160 */ 46, 45, 222, 912, 44, 43, 42, 23, 274, 305, + /* 170 */ 304, 273, 272, 271, 303, 270, 302, 301, 300, 269, + /* 180 */ 299, 298, 876, 138, 864, 865, 866, 867, 868, 869, + /* 190 */ 870, 871, 872, 873, 874, 875, 877, 878, 51, 52, + /* 200 */ 816, 306, 213, 41, 165, 50, 260, 55, 53, 57, + /* 210 */ 54, 296, 18, 79, 226, 46, 45, 283, 282, 44, + /* 220 */ 43, 42, 212, 727, 927, 131, 718, 916, 721, 189, + /* 230 */ 724, 223, 212, 727, 278, 190, 718, 276, 721, 202, + /* 240 */ 724, 115, 114, 188, 899, 900, 29, 903, 257, 233, + /* 250 */ 76, 309, 308, 123, 209, 210, 237, 236, 259, 138, + /* 260 */ 23, 225, 305, 304, 209, 210, 69, 303, 979, 302, + /* 270 */ 301, 300, 24, 299, 298, 884, 102, 30, 882, 883, + /* 280 */ 36, 296, 78, 885, 1013, 887, 888, 886, 245, 889, + /* 290 */ 890, 55, 53, 57, 54, 71, 914, 261, 901, 46, + /* 300 */ 45, 668, 239, 44, 43, 42, 100, 105, 30, 196, + /* 310 */ 1, 153, 94, 104, 110, 113, 103, 720, 217, 723, + /* 320 */ 129, 913, 107, 5, 155, 56, 77, 30, 36, 33, + /* 330 */ 154, 89, 84, 88, 30, 56, 173, 169, 726, 719, + /* 340 */ 30, 722, 171, 168, 118, 117, 116, 12, 726, 279, + /* 350 */ 211, 81, 913, 149, 725, 660, 46, 45, 695, 696, + /* 360 */ 44, 43, 42, 242, 725, 243, 665, 652, 280, 31, + /* 370 */ 649, 913, 650, 25, 651, 284, 680, 716, 913, 672, + /* 380 */ 133, 288, 686, 687, 913, 747, 60, 20, 728, 19, + /* 390 */ 61, 1012, 19, 730, 6, 64, 638, 263, 227, 228, + /* 400 */ 31, 31, 640, 265, 639, 1011, 60, 80, 60, 93, + /* 410 */ 92, 28, 62, 717, 266, 65, 14, 13, 67, 197, + /* 420 */ 627, 99, 98, 198, 16, 15, 656, 654, 657, 655, + /* 430 */ 112, 111, 128, 126, 182, 1026, 183, 185, 179, 186, + /* 440 */ 915, 187, 193, 194, 192, 177, 191, 181, 978, 929, + /* 450 */ 214, 975, 974, 215, 287, 130, 39, 937, 148, 944, + /* 460 */ 946, 132, 136, 36, 241, 961, 960, 150, 909, 127, + /* 470 */ 679, 246, 911, 204, 248, 140, 653, 151, 141, 926, + /* 480 */ 152, 827, 63, 253, 66, 268, 37, 175, 34, 139, + /* 490 */ 58, 258, 277, 823, 1031, 90, 1030, 1028, 156, 256, + /* 500 */ 281, 1025, 96, 1024, 142, 1022, 254, 157, 845, 35, + /* 510 */ 32, 38, 176, 812, 106, 252, 810, 108, 109, 808, + /* 520 */ 807, 229, 167, 805, 804, 803, 250, 802, 801, 800, + /* 530 */ 170, 172, 797, 795, 793, 791, 789, 174, 247, 244, + /* 540 */ 72, 73, 249, 962, 40, 297, 101, 289, 290, 291, + /* 550 */ 292, 293, 294, 199, 295, 221, 307, 267, 766, 231, + /* 560 */ 232, 765, 234, 235, 200, 85, 86, 195, 764, 752, + /* 570 */ 238, 242, 662, 74, 68, 8, 262, 806, 681, 799, + /* 580 */ 164, 846, 160, 158, 159, 162, 161, 163, 119, 2, + /* 590 */ 120, 121, 880, 798, 4, 122, 790, 134, 147, 143, + /* 600 */ 144, 145, 146, 135, 684, 75, 206, 251, 137, 892, + /* 610 */ 688, 26, 9, 10, 729, 27, 7, 11, 731, 21, + /* 620 */ 22, 264, 83, 591, 587, 81, 585, 584, 583, 580, + /* 630 */ 553, 275, 31, 87, 91, 630, 59, 629, 95, 626, + /* 640 */ 575, 573, 565, 571, 567, 569, 97, 563, 561, 594, + /* 650 */ 593, 592, 590, 589, 588, 586, 582, 581, 60, 551, + /* 660 */ 519, 517, 124, 770, 769, 769, 769, 769, 769, 769, + /* 670 */ 769, 769, 769, 769, 125, }; static const YYCODETYPE yy_lookahead[] = { - /* 0 */ 251, 1, 251, 190, 191, 251, 191, 5, 251, 9, - /* 10 */ 261, 260, 261, 13, 14, 191, 16, 17, 191, 210, - /* 20 */ 20, 21, 251, 23, 24, 25, 26, 27, 28, 188, - /* 30 */ 189, 260, 261, 33, 34, 33, 34, 37, 38, 39, - /* 40 */ 13, 14, 210, 16, 17, 236, 191, 20, 21, 1, - /* 50 */ 23, 24, 25, 26, 27, 28, 232, 9, 37, 235, - /* 60 */ 33, 34, 210, 191, 37, 38, 39, 14, 236, 16, - /* 70 */ 17, 191, 257, 20, 21, 234, 23, 24, 25, 26, - /* 80 */ 27, 28, 255, 191, 257, 81, 33, 34, 236, 248, + /* 0 */ 192, 1, 191, 192, 211, 192, 192, 195, 196, 9, + /* 10 */ 189, 190, 253, 13, 14, 192, 16, 17, 192, 253, + /* 20 */ 20, 21, 253, 23, 24, 25, 26, 27, 28, 263, + /* 30 */ 237, 262, 263, 33, 34, 253, 253, 37, 38, 39, + /* 40 */ 13, 14, 234, 16, 17, 262, 263, 20, 21, 1, + /* 50 */ 23, 24, 25, 26, 27, 28, 235, 9, 253, 233, + /* 60 */ 33, 34, 236, 211, 37, 38, 39, 14, 254, 16, + /* 70 */ 17, 250, 259, 20, 21, 1, 23, 24, 25, 26, + /* 80 */ 27, 28, 259, 9, 261, 211, 33, 34, 198, 237, /* 90 */ 37, 38, 39, 45, 46, 47, 48, 49, 50, 51, - /* 100 */ 52, 53, 54, 55, 56, 57, 58, 252, 197, 61, - /* 110 */ 110, 1, 232, 13, 14, 235, 16, 17, 191, 9, - /* 120 */ 20, 21, 104, 23, 24, 25, 26, 27, 28, 257, - /* 130 */ 112, 259, 105, 33, 34, 191, 115, 37, 38, 39, - /* 140 */ 13, 14, 231, 16, 17, 253, 0, 20, 21, 134, - /* 150 */ 23, 24, 25, 26, 27, 28, 141, 142, 251, 232, - /* 160 */ 33, 34, 235, 67, 37, 38, 39, 88, 89, 90, + /* 100 */ 52, 53, 54, 55, 56, 57, 58, 5, 197, 61, + /* 110 */ 110, 237, 201, 13, 14, 192, 16, 17, 79, 192, + /* 120 */ 20, 21, 232, 23, 24, 25, 26, 27, 28, 37, + /* 130 */ 38, 39, 105, 33, 34, 33, 34, 37, 38, 39, + /* 140 */ 13, 14, 197, 16, 17, 67, 201, 20, 21, 104, + /* 150 */ 23, 24, 25, 26, 27, 28, 233, 112, 0, 236, + /* 160 */ 33, 34, 67, 236, 37, 38, 39, 88, 89, 90, /* 170 */ 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, - /* 180 */ 101, 102, 209, 191, 211, 212, 213, 214, 215, 216, - /* 190 */ 217, 218, 219, 220, 221, 222, 223, 224, 16, 17, - /* 200 */ 234, 257, 20, 21, 191, 23, 24, 25, 26, 27, - /* 210 */ 28, 210, 44, 191, 248, 33, 34, 197, 79, 37, - /* 220 */ 38, 39, 1, 2, 232, 79, 5, 235, 7, 61, - /* 230 */ 9, 135, 1, 2, 138, 67, 5, 236, 7, 76, - /* 240 */ 9, 73, 74, 75, 81, 2, 233, 191, 5, 229, - /* 250 */ 7, 104, 9, 236, 33, 34, 237, 235, 37, 112, - /* 260 */ 88, 1, 90, 91, 33, 34, 227, 95, 249, 97, - /* 270 */ 98, 99, 104, 101, 102, 209, 33, 34, 212, 213, - /* 280 */ 112, 251, 226, 217, 196, 219, 220, 221, 200, 223, - /* 290 */ 224, 25, 26, 27, 28, 251, 67, 37, 196, 33, - /* 300 */ 34, 133, 200, 37, 38, 39, 62, 63, 140, 37, - /* 310 */ 38, 39, 68, 69, 70, 71, 72, 15, 197, 64, - /* 320 */ 65, 66, 78, 62, 63, 104, 198, 199, 251, 68, - /* 330 */ 69, 70, 71, 72, 109, 104, 62, 63, 117, 191, - /* 340 */ 191, 116, 68, 69, 70, 71, 72, 191, 117, 228, - /* 350 */ 229, 230, 231, 132, 111, 251, 33, 34, 194, 195, - /* 360 */ 37, 38, 39, 132, 135, 60, 196, 138, 139, 104, - /* 370 */ 200, 123, 124, 108, 105, 110, 5, 5, 7, 7, - /* 380 */ 232, 232, 113, 235, 235, 105, 105, 109, 232, 109, - /* 390 */ 109, 235, 105, 105, 105, 105, 109, 109, 109, 109, - /* 400 */ 109, 251, 105, 105, 136, 137, 109, 109, 130, 104, - /* 410 */ 251, 105, 105, 111, 105, 109, 109, 104, 109, 128, - /* 420 */ 107, 136, 137, 104, 5, 106, 7, 251, 136, 137, - /* 430 */ 136, 137, 5, 227, 7, 76, 77, 62, 63, 251, - /* 440 */ 251, 251, 251, 251, 251, 251, 251, 251, 251, 236, - /* 450 */ 227, 227, 234, 227, 227, 227, 258, 250, 191, 258, - /* 460 */ 238, 191, 191, 112, 191, 60, 191, 191, 191, 234, - /* 470 */ 191, 117, 240, 191, 191, 191, 246, 191, 121, 127, - /* 480 */ 247, 126, 129, 245, 191, 244, 191, 191, 254, 125, - /* 490 */ 191, 191, 191, 254, 191, 191, 254, 243, 120, 191, - /* 500 */ 242, 191, 191, 191, 119, 191, 191, 191, 191, 191, - /* 510 */ 118, 191, 191, 191, 131, 191, 191, 191, 191, 191, - /* 520 */ 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, - /* 530 */ 191, 191, 191, 191, 191, 191, 191, 191, 103, 192, - /* 540 */ 192, 192, 192, 87, 86, 50, 83, 85, 54, 84, - /* 550 */ 82, 79, 5, 192, 192, 192, 143, 5, 5, 143, - /* 560 */ 192, 192, 5, 197, 197, 5, 89, 134, 113, 105, - /* 570 */ 109, 114, 105, 107, 192, 104, 202, 104, 208, 193, - /* 580 */ 207, 204, 206, 203, 205, 201, 193, 192, 198, 193, - /* 590 */ 225, 192, 234, 193, 192, 194, 1, 241, 105, 239, - /* 600 */ 104, 104, 122, 122, 76, 105, 225, 109, 109, 104, - /* 610 */ 104, 104, 111, 104, 9, 107, 5, 5, 108, 5, - /* 620 */ 5, 5, 80, 15, 76, 137, 109, 137, 137, 16, - /* 630 */ 5, 5, 105, 5, 5, 5, 5, 5, 5, 5, - /* 640 */ 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - /* 650 */ 109, 80, 60, 59, 0, 262, 262, 262, 262, 262, - /* 660 */ 262, 262, 262, 262, 262, 262, 21, 21, 262, 262, - /* 670 */ 262, 262, 262, 262, 262, 262, 262, 262, 262, 262, - /* 680 */ 262, 262, 262, 262, 262, 262, 262, 262, 262, 262, - /* 690 */ 262, 262, 262, 262, 262, 262, 262, 262, 262, 262, - /* 700 */ 262, 262, 262, 262, 262, 262, 262, 262, 262, 262, - /* 710 */ 262, 262, 262, 262, 262, 262, 262, 262, 262, 262, - /* 720 */ 262, 262, 262, 262, 262, 262, 262, 262, 262, 262, - /* 730 */ 262, 262, 262, 262, 262, 262, 262, 262, 262, 262, - /* 740 */ 262, 262, 262, 262, 262, 262, 262, 262, 262, 262, - /* 750 */ 262, 262, 262, 262, 262, 262, 262, 262, 262, 262, - /* 760 */ 262, 262, 262, 262, 262, 262, 262, 262, 262, 262, - /* 770 */ 262, 262, 262, 262, 262, 262, 262, 262, 262, 262, - /* 780 */ 262, 262, 262, 262, 262, 262, 262, 262, 262, 262, - /* 790 */ 262, 262, 262, 262, 262, 262, 262, 262, 262, 262, - /* 800 */ 262, 262, 262, 262, 262, 262, 262, 262, 262, 262, - /* 810 */ 262, 262, 262, 262, 262, 262, 262, 262, 262, 262, - /* 820 */ 262, 262, 262, 262, 262, 262, 262, 262, 262, 262, - /* 830 */ 262, 262, 262, 262, 262, 262, 262, 262, 262, 262, - /* 840 */ 262, 262, 262, 262, 262, 262, 262, 262, 262, 262, - /* 850 */ 262, 262, 262, 262, 262, + /* 180 */ 101, 102, 210, 192, 212, 213, 214, 215, 216, 217, + /* 190 */ 218, 219, 220, 221, 222, 223, 224, 225, 16, 17, + /* 200 */ 197, 211, 20, 21, 201, 23, 24, 25, 26, 27, + /* 210 */ 28, 81, 44, 198, 136, 33, 34, 139, 140, 37, + /* 220 */ 38, 39, 1, 2, 235, 192, 5, 237, 7, 61, + /* 230 */ 9, 136, 1, 2, 139, 67, 5, 79, 7, 250, + /* 240 */ 9, 73, 74, 75, 229, 230, 231, 232, 257, 135, + /* 250 */ 259, 64, 65, 66, 33, 34, 142, 143, 37, 192, + /* 260 */ 88, 192, 90, 91, 33, 34, 198, 95, 228, 97, + /* 270 */ 98, 99, 104, 101, 102, 210, 76, 192, 213, 214, + /* 280 */ 112, 81, 238, 218, 253, 220, 221, 222, 255, 224, + /* 290 */ 225, 25, 26, 27, 28, 251, 227, 15, 230, 33, + /* 300 */ 34, 37, 134, 37, 38, 39, 62, 63, 192, 141, + /* 310 */ 199, 200, 68, 69, 70, 71, 72, 5, 233, 7, + /* 320 */ 104, 236, 78, 62, 63, 104, 259, 192, 112, 68, + /* 330 */ 69, 70, 71, 72, 192, 104, 62, 63, 117, 5, + /* 340 */ 192, 7, 68, 69, 70, 71, 72, 104, 117, 233, + /* 350 */ 60, 108, 236, 110, 133, 105, 33, 34, 124, 125, + /* 360 */ 37, 38, 39, 113, 133, 105, 109, 2, 233, 109, + /* 370 */ 5, 236, 7, 116, 9, 233, 105, 1, 236, 115, + /* 380 */ 109, 233, 105, 105, 236, 105, 109, 109, 105, 109, + /* 390 */ 109, 253, 109, 111, 104, 109, 105, 105, 33, 34, + /* 400 */ 109, 109, 105, 105, 105, 253, 109, 109, 109, 137, + /* 410 */ 138, 104, 131, 37, 107, 129, 137, 138, 104, 253, + /* 420 */ 106, 137, 138, 253, 137, 138, 5, 5, 7, 7, + /* 430 */ 76, 77, 62, 63, 253, 237, 253, 253, 253, 253, + /* 440 */ 237, 253, 253, 253, 253, 253, 253, 253, 228, 235, + /* 450 */ 228, 228, 228, 228, 228, 192, 252, 192, 239, 192, + /* 460 */ 192, 192, 192, 112, 235, 260, 260, 192, 192, 60, + /* 470 */ 117, 256, 235, 256, 256, 247, 111, 192, 246, 249, + /* 480 */ 192, 192, 130, 256, 128, 192, 192, 192, 192, 248, + /* 490 */ 127, 122, 192, 192, 192, 192, 192, 192, 192, 126, + /* 500 */ 192, 192, 192, 192, 245, 192, 121, 192, 192, 192, + /* 510 */ 192, 192, 192, 192, 192, 120, 192, 192, 192, 192, + /* 520 */ 192, 192, 192, 192, 192, 192, 119, 192, 192, 192, + /* 530 */ 192, 192, 192, 192, 192, 192, 192, 192, 118, 193, + /* 540 */ 193, 193, 193, 193, 132, 103, 87, 86, 50, 83, + /* 550 */ 85, 54, 84, 193, 82, 193, 79, 193, 5, 144, + /* 560 */ 5, 5, 144, 5, 193, 198, 198, 193, 5, 89, + /* 570 */ 135, 113, 105, 109, 114, 104, 107, 193, 105, 193, + /* 580 */ 202, 209, 203, 208, 207, 204, 206, 205, 194, 199, + /* 590 */ 194, 194, 226, 193, 195, 194, 193, 104, 240, 244, + /* 600 */ 243, 242, 241, 109, 105, 104, 1, 104, 104, 226, + /* 610 */ 105, 109, 123, 123, 105, 109, 104, 104, 111, 104, + /* 620 */ 104, 107, 76, 9, 5, 108, 5, 5, 5, 5, + /* 630 */ 80, 15, 109, 76, 138, 5, 16, 5, 138, 105, + /* 640 */ 5, 5, 5, 5, 5, 5, 138, 5, 5, 5, + /* 650 */ 5, 5, 5, 5, 5, 5, 5, 5, 109, 80, + /* 660 */ 60, 59, 21, 0, 264, 264, 264, 264, 264, 264, + /* 670 */ 264, 264, 264, 264, 21, 264, 264, 264, 264, 264, + /* 680 */ 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, + /* 690 */ 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, + /* 700 */ 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, + /* 710 */ 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, + /* 720 */ 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, + /* 730 */ 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, + /* 740 */ 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, + /* 750 */ 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, + /* 760 */ 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, + /* 770 */ 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, + /* 780 */ 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, + /* 790 */ 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, + /* 800 */ 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, + /* 810 */ 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, + /* 820 */ 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, + /* 830 */ 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, + /* 840 */ 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, + /* 850 */ 264, 264, 264, 264, 264, 264, 264, 264, 264, 264, + /* 860 */ 264, 264, 264, }; -#define YY_SHIFT_COUNT (305) +#define YY_SHIFT_COUNT (312) #define YY_SHIFT_MIN (0) -#define YY_SHIFT_MAX (654) +#define YY_SHIFT_MAX (663) static const unsigned short int yy_shift_ofst[] = { - /* 0 */ 168, 79, 79, 172, 172, 139, 221, 231, 110, 110, - /* 10 */ 110, 110, 110, 110, 110, 110, 110, 0, 48, 231, - /* 20 */ 243, 243, 243, 243, 18, 110, 110, 110, 110, 146, - /* 30 */ 110, 110, 163, 139, 4, 4, 668, 668, 668, 231, + /* 0 */ 168, 79, 79, 172, 172, 39, 221, 231, 74, 74, + /* 10 */ 74, 74, 74, 74, 74, 74, 74, 0, 48, 231, + /* 20 */ 365, 365, 365, 365, 45, 74, 74, 74, 74, 158, + /* 30 */ 74, 74, 200, 39, 130, 130, 675, 675, 675, 231, /* 40 */ 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, - /* 50 */ 231, 231, 231, 231, 231, 231, 231, 231, 231, 243, - /* 60 */ 243, 2, 2, 2, 2, 2, 2, 2, 147, 110, - /* 70 */ 110, 21, 110, 110, 110, 248, 248, 225, 110, 110, - /* 80 */ 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, - /* 90 */ 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, - /* 100 */ 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, - /* 110 */ 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, - /* 120 */ 110, 110, 110, 110, 110, 110, 110, 110, 351, 405, - /* 130 */ 405, 405, 354, 354, 354, 405, 352, 353, 355, 357, - /* 140 */ 364, 378, 385, 392, 383, 351, 405, 405, 405, 435, - /* 150 */ 139, 139, 405, 405, 456, 458, 495, 463, 462, 494, - /* 160 */ 465, 468, 435, 405, 472, 472, 405, 472, 405, 472, - /* 170 */ 405, 668, 668, 27, 100, 127, 100, 100, 53, 182, - /* 180 */ 266, 266, 266, 266, 244, 261, 274, 323, 323, 323, - /* 190 */ 323, 229, 15, 272, 272, 265, 96, 255, 269, 280, - /* 200 */ 281, 287, 288, 289, 290, 371, 372, 260, 305, 302, - /* 210 */ 278, 291, 297, 298, 306, 307, 309, 313, 268, 285, - /* 220 */ 292, 319, 294, 419, 427, 359, 375, 547, 413, 552, - /* 230 */ 553, 416, 557, 560, 477, 433, 455, 464, 457, 466, - /* 240 */ 471, 461, 467, 473, 595, 496, 493, 497, 498, 480, - /* 250 */ 499, 481, 500, 505, 501, 506, 466, 507, 508, 509, - /* 260 */ 510, 528, 605, 611, 612, 614, 615, 616, 542, 608, - /* 270 */ 548, 488, 517, 517, 613, 490, 491, 517, 625, 626, - /* 280 */ 527, 517, 628, 629, 630, 631, 632, 633, 634, 635, - /* 290 */ 636, 637, 638, 639, 640, 641, 642, 643, 644, 541, - /* 300 */ 571, 645, 646, 592, 594, 654, + /* 50 */ 231, 231, 231, 231, 231, 231, 231, 231, 231, 365, + /* 60 */ 365, 102, 102, 102, 102, 102, 102, 102, 216, 74, + /* 70 */ 74, 264, 74, 74, 74, 74, 234, 234, 257, 74, + /* 80 */ 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, + /* 90 */ 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, + /* 100 */ 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, + /* 110 */ 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, + /* 120 */ 74, 74, 74, 74, 74, 74, 74, 74, 74, 351, + /* 130 */ 409, 409, 409, 353, 353, 353, 409, 353, 409, 356, + /* 140 */ 352, 363, 369, 373, 385, 395, 407, 420, 412, 351, + /* 150 */ 409, 409, 409, 442, 39, 39, 409, 409, 459, 461, + /* 160 */ 498, 466, 465, 497, 468, 472, 442, 409, 477, 477, + /* 170 */ 409, 477, 409, 477, 409, 675, 675, 27, 100, 127, + /* 180 */ 100, 100, 53, 182, 266, 266, 266, 266, 244, 261, + /* 190 */ 274, 323, 323, 323, 323, 78, 114, 92, 92, 243, + /* 200 */ 95, 187, 250, 260, 271, 277, 278, 280, 283, 312, + /* 210 */ 334, 376, 290, 282, 281, 286, 291, 292, 297, 298, + /* 220 */ 299, 307, 272, 279, 284, 314, 287, 421, 422, 354, + /* 230 */ 370, 553, 415, 555, 556, 418, 558, 563, 480, 435, + /* 240 */ 458, 467, 460, 469, 471, 464, 473, 493, 499, 494, + /* 250 */ 501, 605, 503, 505, 504, 502, 489, 506, 490, 509, + /* 260 */ 512, 507, 513, 469, 515, 514, 516, 517, 546, 614, + /* 270 */ 619, 621, 622, 623, 624, 550, 616, 557, 496, 523, + /* 280 */ 523, 620, 500, 508, 523, 630, 632, 534, 523, 635, + /* 290 */ 636, 637, 638, 639, 640, 642, 643, 644, 645, 646, + /* 300 */ 647, 648, 649, 650, 651, 652, 549, 579, 641, 653, + /* 310 */ 600, 602, 663, }; -#define YY_REDUCE_COUNT (172) -#define YY_REDUCE_MIN (-251) -#define YY_REDUCE_MAX (402) +#define YY_REDUCE_COUNT (176) +#define YY_REDUCE_MIN (-241) +#define YY_REDUCE_MAX (403) static const short yy_reduce_ofst[] = { - /* 0 */ -159, -27, -27, 66, 66, 121, -249, -229, -176, -128, - /* 10 */ -173, -120, -73, -8, 148, 149, 156, -145, -187, -251, - /* 20 */ -191, -168, -148, 1, -34, -108, -185, -56, 13, -89, - /* 30 */ 56, 22, 88, 20, 102, 170, 19, 128, 164, -246, - /* 40 */ -243, -93, 30, 44, 77, 104, 150, 159, 176, 188, - /* 50 */ 189, 190, 191, 192, 193, 194, 195, 196, 197, 17, - /* 60 */ 213, 39, 206, 223, 224, 226, 227, 228, 218, 267, - /* 70 */ 270, 207, 271, 273, 275, 198, 201, 222, 276, 277, - /* 80 */ 279, 282, 283, 284, 286, 293, 295, 296, 299, 300, - /* 90 */ 301, 303, 304, 308, 310, 311, 312, 314, 315, 316, - /* 100 */ 317, 318, 320, 321, 322, 324, 325, 326, 327, 328, - /* 110 */ 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, - /* 120 */ 339, 340, 341, 342, 343, 344, 345, 346, 235, 347, - /* 130 */ 348, 349, 234, 239, 242, 350, 233, 230, 238, 241, - /* 140 */ 254, 258, 356, 232, 360, 358, 361, 362, 363, 365, - /* 150 */ 366, 367, 368, 369, 370, 373, 376, 374, 379, 380, - /* 160 */ 377, 384, 381, 382, 386, 393, 395, 396, 399, 400, - /* 170 */ 402, 390, 401, + /* 0 */ -179, -28, -28, 65, 65, 15, -231, -217, -174, -177, + /* 10 */ -9, -77, 85, 116, 135, 142, 148, -186, -189, -234, + /* 20 */ -207, -148, -126, -10, -11, 33, -187, 67, -192, -110, + /* 30 */ 69, -73, -89, 68, -55, 3, 44, 111, -188, -241, + /* 40 */ -218, -195, 31, 138, 152, 166, 170, 181, 183, 184, + /* 50 */ 185, 186, 188, 189, 190, 191, 192, 193, 194, 198, + /* 60 */ 203, 40, 220, 222, 223, 224, 225, 226, 214, 263, + /* 70 */ 265, 204, 267, 268, 269, 270, 205, 206, 219, 275, + /* 80 */ 276, 285, 288, 289, 293, 294, 295, 296, 300, 301, + /* 90 */ 302, 303, 304, 305, 306, 308, 309, 310, 311, 313, + /* 100 */ 315, 316, 317, 318, 319, 320, 321, 322, 324, 325, + /* 110 */ 326, 327, 328, 329, 330, 331, 332, 333, 335, 336, + /* 120 */ 337, 338, 339, 340, 341, 342, 343, 344, 345, 229, + /* 130 */ 346, 347, 348, 215, 217, 218, 349, 227, 350, 230, + /* 140 */ 241, 228, 232, 259, 355, 357, 359, 361, 358, 237, + /* 150 */ 360, 362, 364, 366, 367, 368, 371, 374, 372, 375, + /* 160 */ 377, 379, 380, 381, 382, 378, 383, 384, 394, 396, + /* 170 */ 386, 397, 400, 401, 403, 390, 399, }; static const YYACTIONTYPE yy_default[] = { - /* 0 */ 757, 869, 815, 881, 803, 812, 1007, 1007, 757, 757, - /* 10 */ 757, 757, 757, 757, 757, 757, 757, 929, 776, 1007, - /* 20 */ 757, 757, 757, 757, 757, 757, 757, 757, 757, 812, - /* 30 */ 757, 757, 818, 812, 818, 818, 924, 853, 871, 757, - /* 40 */ 757, 757, 757, 757, 757, 757, 757, 757, 757, 757, - /* 50 */ 757, 757, 757, 757, 757, 757, 757, 757, 757, 757, - /* 60 */ 757, 757, 757, 757, 757, 757, 757, 757, 757, 757, - /* 70 */ 757, 931, 933, 935, 757, 953, 953, 922, 757, 757, - /* 80 */ 757, 757, 757, 757, 757, 757, 757, 757, 757, 757, - /* 90 */ 757, 757, 757, 757, 757, 757, 757, 757, 757, 757, - /* 100 */ 757, 757, 757, 757, 757, 801, 757, 799, 757, 757, - /* 110 */ 757, 757, 757, 757, 757, 757, 757, 757, 757, 757, - /* 120 */ 757, 757, 786, 757, 757, 757, 757, 757, 757, 778, - /* 130 */ 778, 778, 757, 757, 757, 778, 960, 964, 958, 946, - /* 140 */ 954, 945, 941, 940, 968, 757, 778, 778, 778, 816, - /* 150 */ 812, 812, 778, 778, 834, 832, 830, 822, 828, 824, - /* 160 */ 826, 820, 804, 778, 810, 810, 778, 810, 778, 810, - /* 170 */ 778, 853, 871, 757, 969, 757, 1006, 959, 996, 995, - /* 180 */ 1002, 994, 993, 992, 757, 757, 757, 988, 989, 991, - /* 190 */ 990, 757, 757, 998, 997, 757, 757, 757, 757, 757, - /* 200 */ 757, 757, 757, 757, 757, 757, 757, 757, 971, 757, - /* 210 */ 965, 961, 757, 757, 757, 757, 757, 757, 757, 757, - /* 220 */ 757, 883, 757, 757, 757, 757, 757, 757, 757, 757, - /* 230 */ 757, 757, 757, 757, 757, 757, 921, 757, 757, 757, - /* 240 */ 757, 932, 757, 757, 757, 757, 757, 757, 955, 757, - /* 250 */ 947, 757, 757, 757, 757, 757, 895, 757, 757, 757, - /* 260 */ 757, 757, 757, 757, 757, 757, 757, 757, 757, 757, - /* 270 */ 757, 757, 1017, 1015, 757, 757, 757, 1011, 757, 757, - /* 280 */ 757, 1009, 757, 757, 757, 757, 757, 757, 757, 757, - /* 290 */ 757, 757, 757, 757, 757, 757, 757, 757, 757, 837, - /* 300 */ 757, 784, 782, 757, 774, 757, + /* 0 */ 767, 879, 825, 891, 813, 822, 1019, 1019, 767, 767, + /* 10 */ 767, 767, 767, 767, 767, 767, 767, 939, 786, 1019, + /* 20 */ 767, 767, 767, 767, 767, 767, 767, 767, 767, 822, + /* 30 */ 767, 767, 828, 822, 828, 828, 934, 863, 881, 767, + /* 40 */ 767, 767, 767, 767, 767, 767, 767, 767, 767, 767, + /* 50 */ 767, 767, 767, 767, 767, 767, 767, 767, 767, 767, + /* 60 */ 767, 767, 767, 767, 767, 767, 767, 767, 767, 767, + /* 70 */ 767, 941, 943, 945, 767, 767, 965, 965, 932, 767, + /* 80 */ 767, 767, 767, 767, 767, 767, 767, 767, 767, 767, + /* 90 */ 767, 767, 767, 767, 767, 767, 767, 767, 767, 767, + /* 100 */ 767, 767, 767, 767, 767, 767, 811, 767, 809, 767, + /* 110 */ 767, 767, 767, 767, 767, 767, 767, 767, 767, 767, + /* 120 */ 767, 767, 767, 796, 767, 767, 767, 767, 767, 767, + /* 130 */ 788, 788, 788, 767, 767, 767, 788, 767, 788, 972, + /* 140 */ 976, 970, 958, 966, 957, 953, 951, 950, 980, 767, + /* 150 */ 788, 788, 788, 826, 822, 822, 788, 788, 844, 842, + /* 160 */ 840, 832, 838, 834, 836, 830, 814, 788, 820, 820, + /* 170 */ 788, 820, 788, 820, 788, 863, 881, 767, 981, 767, + /* 180 */ 1018, 971, 1008, 1007, 1014, 1006, 1005, 1004, 767, 767, + /* 190 */ 767, 1000, 1001, 1003, 1002, 767, 767, 1010, 1009, 767, + /* 200 */ 767, 767, 767, 767, 767, 767, 767, 767, 767, 767, + /* 210 */ 767, 767, 983, 767, 977, 973, 767, 767, 767, 767, + /* 220 */ 767, 767, 767, 767, 767, 893, 767, 767, 767, 767, + /* 230 */ 767, 767, 767, 767, 767, 767, 767, 767, 767, 767, + /* 240 */ 931, 767, 767, 767, 767, 942, 767, 767, 767, 767, + /* 250 */ 767, 767, 767, 767, 767, 967, 767, 959, 767, 767, + /* 260 */ 767, 767, 767, 905, 767, 767, 767, 767, 767, 767, + /* 270 */ 767, 767, 767, 767, 767, 767, 767, 767, 767, 1029, + /* 280 */ 1027, 767, 767, 767, 1023, 767, 767, 767, 1021, 767, + /* 290 */ 767, 767, 767, 767, 767, 767, 767, 767, 767, 767, + /* 300 */ 767, 767, 767, 767, 767, 767, 847, 767, 794, 792, + /* 310 */ 767, 784, 767, }; /********** End of lemon-generated parsing tables *****************************/ @@ -590,6 +595,7 @@ static const YYCODETYPE yyFallback[] = { 0, /* FROM => nothing */ 0, /* VARIABLE => nothing */ 0, /* INTERVAL => nothing */ + 0, /* SESSION => nothing */ 0, /* FILL => nothing */ 0, /* SLIDING => nothing */ 0, /* ORDER => nothing */ @@ -863,149 +869,151 @@ static const char *const yyTokenName[] = { /* 116 */ "FROM", /* 117 */ "VARIABLE", /* 118 */ "INTERVAL", - /* 119 */ "FILL", - /* 120 */ "SLIDING", - /* 121 */ "ORDER", - /* 122 */ "BY", - /* 123 */ "ASC", - /* 124 */ "DESC", - /* 125 */ "GROUP", - /* 126 */ "HAVING", - /* 127 */ "LIMIT", - /* 128 */ "OFFSET", - /* 129 */ "SLIMIT", - /* 130 */ "SOFFSET", - /* 131 */ "WHERE", - /* 132 */ "NOW", - /* 133 */ "RESET", - /* 134 */ "QUERY", - /* 135 */ "ADD", - /* 136 */ "COLUMN", - /* 137 */ "TAG", - /* 138 */ "CHANGE", - /* 139 */ "SET", - /* 140 */ "KILL", - /* 141 */ "CONNECTION", - /* 142 */ "STREAM", - /* 143 */ "COLON", - /* 144 */ "ABORT", - /* 145 */ "AFTER", - /* 146 */ "ATTACH", - /* 147 */ "BEFORE", - /* 148 */ "BEGIN", - /* 149 */ "CASCADE", - /* 150 */ "CLUSTER", - /* 151 */ "CONFLICT", - /* 152 */ "COPY", - /* 153 */ "DEFERRED", - /* 154 */ "DELIMITERS", - /* 155 */ "DETACH", - /* 156 */ "EACH", - /* 157 */ "END", - /* 158 */ "EXPLAIN", - /* 159 */ "FAIL", - /* 160 */ "FOR", - /* 161 */ "IGNORE", - /* 162 */ "IMMEDIATE", - /* 163 */ "INITIALLY", - /* 164 */ "INSTEAD", - /* 165 */ "MATCH", - /* 166 */ "KEY", - /* 167 */ "OF", - /* 168 */ "RAISE", - /* 169 */ "REPLACE", - /* 170 */ "RESTRICT", - /* 171 */ "ROW", - /* 172 */ "STATEMENT", - /* 173 */ "TRIGGER", - /* 174 */ "VIEW", - /* 175 */ "SEMI", - /* 176 */ "NONE", - /* 177 */ "PREV", - /* 178 */ "LINEAR", - /* 179 */ "IMPORT", - /* 180 */ "METRIC", - /* 181 */ "TBNAME", - /* 182 */ "JOIN", - /* 183 */ "METRICS", - /* 184 */ "INSERT", - /* 185 */ "INTO", - /* 186 */ "VALUES", - /* 187 */ "error", - /* 188 */ "program", - /* 189 */ "cmd", - /* 190 */ "dbPrefix", - /* 191 */ "ids", - /* 192 */ "cpxName", - /* 193 */ "ifexists", - /* 194 */ "alter_db_optr", - /* 195 */ "alter_topic_optr", - /* 196 */ "acct_optr", - /* 197 */ "ifnotexists", - /* 198 */ "db_optr", - /* 199 */ "topic_optr", - /* 200 */ "pps", - /* 201 */ "tseries", - /* 202 */ "dbs", - /* 203 */ "streams", - /* 204 */ "storage", - /* 205 */ "qtime", - /* 206 */ "users", - /* 207 */ "conns", - /* 208 */ "state", - /* 209 */ "keep", - /* 210 */ "tagitemlist", - /* 211 */ "cache", - /* 212 */ "replica", - /* 213 */ "quorum", - /* 214 */ "days", - /* 215 */ "minrows", - /* 216 */ "maxrows", - /* 217 */ "blocks", - /* 218 */ "ctime", - /* 219 */ "wal", - /* 220 */ "fsync", - /* 221 */ "comp", - /* 222 */ "prec", - /* 223 */ "update", - /* 224 */ "cachelast", - /* 225 */ "partitions", - /* 226 */ "typename", - /* 227 */ "signed", - /* 228 */ "create_table_args", - /* 229 */ "create_stable_args", - /* 230 */ "create_table_list", - /* 231 */ "create_from_stable", - /* 232 */ "columnlist", - /* 233 */ "tagNamelist", - /* 234 */ "select", - /* 235 */ "column", - /* 236 */ "tagitem", - /* 237 */ "selcollist", - /* 238 */ "from", - /* 239 */ "where_opt", - /* 240 */ "interval_opt", - /* 241 */ "fill_opt", - /* 242 */ "sliding_opt", - /* 243 */ "groupby_opt", - /* 244 */ "orderby_opt", - /* 245 */ "having_opt", - /* 246 */ "slimit_opt", - /* 247 */ "limit_opt", - /* 248 */ "union", - /* 249 */ "sclp", - /* 250 */ "distinct", - /* 251 */ "expr", - /* 252 */ "as", - /* 253 */ "tablelist", - /* 254 */ "tmvar", - /* 255 */ "sortlist", - /* 256 */ "sortitem", - /* 257 */ "item", - /* 258 */ "sortorder", - /* 259 */ "grouplist", - /* 260 */ "exprlist", - /* 261 */ "expritem", + /* 119 */ "SESSION", + /* 120 */ "FILL", + /* 121 */ "SLIDING", + /* 122 */ "ORDER", + /* 123 */ "BY", + /* 124 */ "ASC", + /* 125 */ "DESC", + /* 126 */ "GROUP", + /* 127 */ "HAVING", + /* 128 */ "LIMIT", + /* 129 */ "OFFSET", + /* 130 */ "SLIMIT", + /* 131 */ "SOFFSET", + /* 132 */ "WHERE", + /* 133 */ "NOW", + /* 134 */ "RESET", + /* 135 */ "QUERY", + /* 136 */ "ADD", + /* 137 */ "COLUMN", + /* 138 */ "TAG", + /* 139 */ "CHANGE", + /* 140 */ "SET", + /* 141 */ "KILL", + /* 142 */ "CONNECTION", + /* 143 */ "STREAM", + /* 144 */ "COLON", + /* 145 */ "ABORT", + /* 146 */ "AFTER", + /* 147 */ "ATTACH", + /* 148 */ "BEFORE", + /* 149 */ "BEGIN", + /* 150 */ "CASCADE", + /* 151 */ "CLUSTER", + /* 152 */ "CONFLICT", + /* 153 */ "COPY", + /* 154 */ "DEFERRED", + /* 155 */ "DELIMITERS", + /* 156 */ "DETACH", + /* 157 */ "EACH", + /* 158 */ "END", + /* 159 */ "EXPLAIN", + /* 160 */ "FAIL", + /* 161 */ "FOR", + /* 162 */ "IGNORE", + /* 163 */ "IMMEDIATE", + /* 164 */ "INITIALLY", + /* 165 */ "INSTEAD", + /* 166 */ "MATCH", + /* 167 */ "KEY", + /* 168 */ "OF", + /* 169 */ "RAISE", + /* 170 */ "REPLACE", + /* 171 */ "RESTRICT", + /* 172 */ "ROW", + /* 173 */ "STATEMENT", + /* 174 */ "TRIGGER", + /* 175 */ "VIEW", + /* 176 */ "SEMI", + /* 177 */ "NONE", + /* 178 */ "PREV", + /* 179 */ "LINEAR", + /* 180 */ "IMPORT", + /* 181 */ "METRIC", + /* 182 */ "TBNAME", + /* 183 */ "JOIN", + /* 184 */ "METRICS", + /* 185 */ "INSERT", + /* 186 */ "INTO", + /* 187 */ "VALUES", + /* 188 */ "error", + /* 189 */ "program", + /* 190 */ "cmd", + /* 191 */ "dbPrefix", + /* 192 */ "ids", + /* 193 */ "cpxName", + /* 194 */ "ifexists", + /* 195 */ "alter_db_optr", + /* 196 */ "alter_topic_optr", + /* 197 */ "acct_optr", + /* 198 */ "ifnotexists", + /* 199 */ "db_optr", + /* 200 */ "topic_optr", + /* 201 */ "pps", + /* 202 */ "tseries", + /* 203 */ "dbs", + /* 204 */ "streams", + /* 205 */ "storage", + /* 206 */ "qtime", + /* 207 */ "users", + /* 208 */ "conns", + /* 209 */ "state", + /* 210 */ "keep", + /* 211 */ "tagitemlist", + /* 212 */ "cache", + /* 213 */ "replica", + /* 214 */ "quorum", + /* 215 */ "days", + /* 216 */ "minrows", + /* 217 */ "maxrows", + /* 218 */ "blocks", + /* 219 */ "ctime", + /* 220 */ "wal", + /* 221 */ "fsync", + /* 222 */ "comp", + /* 223 */ "prec", + /* 224 */ "update", + /* 225 */ "cachelast", + /* 226 */ "partitions", + /* 227 */ "typename", + /* 228 */ "signed", + /* 229 */ "create_table_args", + /* 230 */ "create_stable_args", + /* 231 */ "create_table_list", + /* 232 */ "create_from_stable", + /* 233 */ "columnlist", + /* 234 */ "tagNamelist", + /* 235 */ "select", + /* 236 */ "column", + /* 237 */ "tagitem", + /* 238 */ "selcollist", + /* 239 */ "from", + /* 240 */ "where_opt", + /* 241 */ "interval_opt", + /* 242 */ "session_option", + /* 243 */ "fill_opt", + /* 244 */ "sliding_opt", + /* 245 */ "groupby_opt", + /* 246 */ "orderby_opt", + /* 247 */ "having_opt", + /* 248 */ "slimit_opt", + /* 249 */ "limit_opt", + /* 250 */ "union", + /* 251 */ "sclp", + /* 252 */ "distinct", + /* 253 */ "expr", + /* 254 */ "as", + /* 255 */ "tablelist", + /* 256 */ "tmvar", + /* 257 */ "sortlist", + /* 258 */ "sortitem", + /* 259 */ "item", + /* 260 */ "sortorder", + /* 261 */ "grouplist", + /* 262 */ "exprlist", + /* 263 */ "expritem", }; #endif /* defined(YYCOVERAGE) || !defined(NDEBUG) */ @@ -1169,7 +1177,7 @@ static const char *const yyRuleName[] = { /* 153 */ "tagitem ::= MINUS FLOAT", /* 154 */ "tagitem ::= PLUS INTEGER", /* 155 */ "tagitem ::= PLUS FLOAT", - /* 156 */ "select ::= SELECT selcollist from where_opt interval_opt fill_opt sliding_opt groupby_opt orderby_opt having_opt slimit_opt limit_opt", + /* 156 */ "select ::= SELECT selcollist from where_opt interval_opt session_option fill_opt sliding_opt groupby_opt orderby_opt having_opt slimit_opt limit_opt", /* 157 */ "union ::= select", /* 158 */ "union ::= LP union RP", /* 159 */ "union ::= union UNION ALL select", @@ -1194,88 +1202,90 @@ static const char *const yyRuleName[] = { /* 178 */ "interval_opt ::= INTERVAL LP tmvar RP", /* 179 */ "interval_opt ::= INTERVAL LP tmvar COMMA tmvar RP", /* 180 */ "interval_opt ::=", - /* 181 */ "fill_opt ::=", - /* 182 */ "fill_opt ::= FILL LP ID COMMA tagitemlist RP", - /* 183 */ "fill_opt ::= FILL LP ID RP", - /* 184 */ "sliding_opt ::= SLIDING LP tmvar RP", - /* 185 */ "sliding_opt ::=", - /* 186 */ "orderby_opt ::=", - /* 187 */ "orderby_opt ::= ORDER BY sortlist", - /* 188 */ "sortlist ::= sortlist COMMA item sortorder", - /* 189 */ "sortlist ::= item sortorder", - /* 190 */ "item ::= ids cpxName", - /* 191 */ "sortorder ::= ASC", - /* 192 */ "sortorder ::= DESC", - /* 193 */ "sortorder ::=", - /* 194 */ "groupby_opt ::=", - /* 195 */ "groupby_opt ::= GROUP BY grouplist", - /* 196 */ "grouplist ::= grouplist COMMA item", - /* 197 */ "grouplist ::= item", - /* 198 */ "having_opt ::=", - /* 199 */ "having_opt ::= HAVING expr", - /* 200 */ "limit_opt ::=", - /* 201 */ "limit_opt ::= LIMIT signed", - /* 202 */ "limit_opt ::= LIMIT signed OFFSET signed", - /* 203 */ "limit_opt ::= LIMIT signed COMMA signed", - /* 204 */ "slimit_opt ::=", - /* 205 */ "slimit_opt ::= SLIMIT signed", - /* 206 */ "slimit_opt ::= SLIMIT signed SOFFSET signed", - /* 207 */ "slimit_opt ::= SLIMIT signed COMMA signed", - /* 208 */ "where_opt ::=", - /* 209 */ "where_opt ::= WHERE expr", - /* 210 */ "expr ::= LP expr RP", - /* 211 */ "expr ::= ID", - /* 212 */ "expr ::= ID DOT ID", - /* 213 */ "expr ::= ID DOT STAR", - /* 214 */ "expr ::= INTEGER", - /* 215 */ "expr ::= MINUS INTEGER", - /* 216 */ "expr ::= PLUS INTEGER", - /* 217 */ "expr ::= FLOAT", - /* 218 */ "expr ::= MINUS FLOAT", - /* 219 */ "expr ::= PLUS FLOAT", - /* 220 */ "expr ::= STRING", - /* 221 */ "expr ::= NOW", - /* 222 */ "expr ::= VARIABLE", - /* 223 */ "expr ::= BOOL", - /* 224 */ "expr ::= ID LP exprlist RP", - /* 225 */ "expr ::= ID LP STAR RP", - /* 226 */ "expr ::= expr IS NULL", - /* 227 */ "expr ::= expr IS NOT NULL", - /* 228 */ "expr ::= expr LT expr", - /* 229 */ "expr ::= expr GT expr", - /* 230 */ "expr ::= expr LE expr", - /* 231 */ "expr ::= expr GE expr", - /* 232 */ "expr ::= expr NE expr", - /* 233 */ "expr ::= expr EQ expr", - /* 234 */ "expr ::= expr BETWEEN expr AND expr", - /* 235 */ "expr ::= expr AND expr", - /* 236 */ "expr ::= expr OR expr", - /* 237 */ "expr ::= expr PLUS expr", - /* 238 */ "expr ::= expr MINUS expr", - /* 239 */ "expr ::= expr STAR expr", - /* 240 */ "expr ::= expr SLASH expr", - /* 241 */ "expr ::= expr REM expr", - /* 242 */ "expr ::= expr LIKE expr", - /* 243 */ "expr ::= expr IN LP exprlist RP", - /* 244 */ "exprlist ::= exprlist COMMA expritem", - /* 245 */ "exprlist ::= expritem", - /* 246 */ "expritem ::= expr", - /* 247 */ "expritem ::=", - /* 248 */ "cmd ::= RESET QUERY CACHE", - /* 249 */ "cmd ::= ALTER TABLE ids cpxName ADD COLUMN columnlist", - /* 250 */ "cmd ::= ALTER TABLE ids cpxName DROP COLUMN ids", - /* 251 */ "cmd ::= ALTER TABLE ids cpxName ADD TAG columnlist", - /* 252 */ "cmd ::= ALTER TABLE ids cpxName DROP TAG ids", - /* 253 */ "cmd ::= ALTER TABLE ids cpxName CHANGE TAG ids ids", - /* 254 */ "cmd ::= ALTER TABLE ids cpxName SET TAG ids EQ tagitem", - /* 255 */ "cmd ::= ALTER STABLE ids cpxName ADD COLUMN columnlist", - /* 256 */ "cmd ::= ALTER STABLE ids cpxName DROP COLUMN ids", - /* 257 */ "cmd ::= ALTER STABLE ids cpxName ADD TAG columnlist", - /* 258 */ "cmd ::= ALTER STABLE ids cpxName DROP TAG ids", - /* 259 */ "cmd ::= ALTER STABLE ids cpxName CHANGE TAG ids ids", - /* 260 */ "cmd ::= KILL CONNECTION INTEGER", - /* 261 */ "cmd ::= KILL STREAM INTEGER COLON INTEGER", - /* 262 */ "cmd ::= KILL QUERY INTEGER COLON INTEGER", + /* 181 */ "session_option ::=", + /* 182 */ "session_option ::= SESSION LP ids cpxName COMMA tmvar RP", + /* 183 */ "fill_opt ::=", + /* 184 */ "fill_opt ::= FILL LP ID COMMA tagitemlist RP", + /* 185 */ "fill_opt ::= FILL LP ID RP", + /* 186 */ "sliding_opt ::= SLIDING LP tmvar RP", + /* 187 */ "sliding_opt ::=", + /* 188 */ "orderby_opt ::=", + /* 189 */ "orderby_opt ::= ORDER BY sortlist", + /* 190 */ "sortlist ::= sortlist COMMA item sortorder", + /* 191 */ "sortlist ::= item sortorder", + /* 192 */ "item ::= ids cpxName", + /* 193 */ "sortorder ::= ASC", + /* 194 */ "sortorder ::= DESC", + /* 195 */ "sortorder ::=", + /* 196 */ "groupby_opt ::=", + /* 197 */ "groupby_opt ::= GROUP BY grouplist", + /* 198 */ "grouplist ::= grouplist COMMA item", + /* 199 */ "grouplist ::= item", + /* 200 */ "having_opt ::=", + /* 201 */ "having_opt ::= HAVING expr", + /* 202 */ "limit_opt ::=", + /* 203 */ "limit_opt ::= LIMIT signed", + /* 204 */ "limit_opt ::= LIMIT signed OFFSET signed", + /* 205 */ "limit_opt ::= LIMIT signed COMMA signed", + /* 206 */ "slimit_opt ::=", + /* 207 */ "slimit_opt ::= SLIMIT signed", + /* 208 */ "slimit_opt ::= SLIMIT signed SOFFSET signed", + /* 209 */ "slimit_opt ::= SLIMIT signed COMMA signed", + /* 210 */ "where_opt ::=", + /* 211 */ "where_opt ::= WHERE expr", + /* 212 */ "expr ::= LP expr RP", + /* 213 */ "expr ::= ID", + /* 214 */ "expr ::= ID DOT ID", + /* 215 */ "expr ::= ID DOT STAR", + /* 216 */ "expr ::= INTEGER", + /* 217 */ "expr ::= MINUS INTEGER", + /* 218 */ "expr ::= PLUS INTEGER", + /* 219 */ "expr ::= FLOAT", + /* 220 */ "expr ::= MINUS FLOAT", + /* 221 */ "expr ::= PLUS FLOAT", + /* 222 */ "expr ::= STRING", + /* 223 */ "expr ::= NOW", + /* 224 */ "expr ::= VARIABLE", + /* 225 */ "expr ::= BOOL", + /* 226 */ "expr ::= ID LP exprlist RP", + /* 227 */ "expr ::= ID LP STAR RP", + /* 228 */ "expr ::= expr IS NULL", + /* 229 */ "expr ::= expr IS NOT NULL", + /* 230 */ "expr ::= expr LT expr", + /* 231 */ "expr ::= expr GT expr", + /* 232 */ "expr ::= expr LE expr", + /* 233 */ "expr ::= expr GE expr", + /* 234 */ "expr ::= expr NE expr", + /* 235 */ "expr ::= expr EQ expr", + /* 236 */ "expr ::= expr BETWEEN expr AND expr", + /* 237 */ "expr ::= expr AND expr", + /* 238 */ "expr ::= expr OR expr", + /* 239 */ "expr ::= expr PLUS expr", + /* 240 */ "expr ::= expr MINUS expr", + /* 241 */ "expr ::= expr STAR expr", + /* 242 */ "expr ::= expr SLASH expr", + /* 243 */ "expr ::= expr REM expr", + /* 244 */ "expr ::= expr LIKE expr", + /* 245 */ "expr ::= expr IN LP exprlist RP", + /* 246 */ "exprlist ::= exprlist COMMA expritem", + /* 247 */ "exprlist ::= expritem", + /* 248 */ "expritem ::= expr", + /* 249 */ "expritem ::=", + /* 250 */ "cmd ::= RESET QUERY CACHE", + /* 251 */ "cmd ::= ALTER TABLE ids cpxName ADD COLUMN columnlist", + /* 252 */ "cmd ::= ALTER TABLE ids cpxName DROP COLUMN ids", + /* 253 */ "cmd ::= ALTER TABLE ids cpxName ADD TAG columnlist", + /* 254 */ "cmd ::= ALTER TABLE ids cpxName DROP TAG ids", + /* 255 */ "cmd ::= ALTER TABLE ids cpxName CHANGE TAG ids ids", + /* 256 */ "cmd ::= ALTER TABLE ids cpxName SET TAG ids EQ tagitem", + /* 257 */ "cmd ::= ALTER STABLE ids cpxName ADD COLUMN columnlist", + /* 258 */ "cmd ::= ALTER STABLE ids cpxName DROP COLUMN ids", + /* 259 */ "cmd ::= ALTER STABLE ids cpxName ADD TAG columnlist", + /* 260 */ "cmd ::= ALTER STABLE ids cpxName DROP TAG ids", + /* 261 */ "cmd ::= ALTER STABLE ids cpxName CHANGE TAG ids ids", + /* 262 */ "cmd ::= KILL CONNECTION INTEGER", + /* 263 */ "cmd ::= KILL STREAM INTEGER COLON INTEGER", + /* 264 */ "cmd ::= KILL QUERY INTEGER COLON INTEGER", }; #endif /* NDEBUG */ @@ -1396,52 +1406,52 @@ static void yy_destructor( ** inside the C code. */ /********* Begin destructor definitions ***************************************/ - case 209: /* keep */ - case 210: /* tagitemlist */ - case 232: /* columnlist */ - case 233: /* tagNamelist */ - case 241: /* fill_opt */ - case 243: /* groupby_opt */ - case 244: /* orderby_opt */ - case 255: /* sortlist */ - case 259: /* grouplist */ + case 210: /* keep */ + case 211: /* tagitemlist */ + case 233: /* columnlist */ + case 234: /* tagNamelist */ + case 243: /* fill_opt */ + case 245: /* groupby_opt */ + case 246: /* orderby_opt */ + case 257: /* sortlist */ + case 261: /* grouplist */ { -taosArrayDestroy((yypminor->yy429)); +taosArrayDestroy((yypminor->yy285)); } break; - case 230: /* create_table_list */ + case 231: /* create_table_list */ { -destroyCreateTableSql((yypminor->yy310)); +destroyCreateTableSql((yypminor->yy230)); } break; - case 234: /* select */ + case 235: /* select */ { -doDestroyQuerySql((yypminor->yy372)); +doDestroyQuerySql((yypminor->yy216)); } break; - case 237: /* selcollist */ - case 249: /* sclp */ - case 260: /* exprlist */ + case 238: /* selcollist */ + case 251: /* sclp */ + case 262: /* exprlist */ { -tSqlExprListDestroy((yypminor->yy170)); +tSqlExprListDestroy((yypminor->yy434)); } break; - case 239: /* where_opt */ - case 245: /* having_opt */ - case 251: /* expr */ - case 261: /* expritem */ + case 240: /* where_opt */ + case 247: /* having_opt */ + case 253: /* expr */ + case 263: /* expritem */ { -tSqlExprDestroy((yypminor->yy282)); +tSqlExprDestroy((yypminor->yy178)); } break; - case 248: /* union */ + case 250: /* union */ { -destroyAllSelectClause((yypminor->yy141)); +destroyAllSelectClause((yypminor->yy513)); } break; - case 256: /* sortitem */ + case 258: /* sortitem */ { -tVariantDestroy(&(yypminor->yy218)); +tVariantDestroy(&(yypminor->yy362)); } break; /********* End destructor definitions *****************************************/ @@ -1735,269 +1745,271 @@ static const struct { YYCODETYPE lhs; /* Symbol on the left-hand side of the rule */ signed char nrhs; /* Negative of the number of RHS symbols in the rule */ } yyRuleInfo[] = { - { 188, -1 }, /* (0) program ::= cmd */ - { 189, -2 }, /* (1) cmd ::= SHOW DATABASES */ - { 189, -2 }, /* (2) cmd ::= SHOW TOPICS */ - { 189, -2 }, /* (3) cmd ::= SHOW MNODES */ - { 189, -2 }, /* (4) cmd ::= SHOW DNODES */ - { 189, -2 }, /* (5) cmd ::= SHOW ACCOUNTS */ - { 189, -2 }, /* (6) cmd ::= SHOW USERS */ - { 189, -2 }, /* (7) cmd ::= SHOW MODULES */ - { 189, -2 }, /* (8) cmd ::= SHOW QUERIES */ - { 189, -2 }, /* (9) cmd ::= SHOW CONNECTIONS */ - { 189, -2 }, /* (10) cmd ::= SHOW STREAMS */ - { 189, -2 }, /* (11) cmd ::= SHOW VARIABLES */ - { 189, -2 }, /* (12) cmd ::= SHOW SCORES */ - { 189, -2 }, /* (13) cmd ::= SHOW GRANTS */ - { 189, -2 }, /* (14) cmd ::= SHOW VNODES */ - { 189, -3 }, /* (15) cmd ::= SHOW VNODES IPTOKEN */ - { 190, 0 }, /* (16) dbPrefix ::= */ - { 190, -2 }, /* (17) dbPrefix ::= ids DOT */ - { 192, 0 }, /* (18) cpxName ::= */ - { 192, -2 }, /* (19) cpxName ::= DOT ids */ - { 189, -5 }, /* (20) cmd ::= SHOW CREATE TABLE ids cpxName */ - { 189, -4 }, /* (21) cmd ::= SHOW CREATE DATABASE ids */ - { 189, -3 }, /* (22) cmd ::= SHOW dbPrefix TABLES */ - { 189, -5 }, /* (23) cmd ::= SHOW dbPrefix TABLES LIKE ids */ - { 189, -3 }, /* (24) cmd ::= SHOW dbPrefix STABLES */ - { 189, -5 }, /* (25) cmd ::= SHOW dbPrefix STABLES LIKE ids */ - { 189, -3 }, /* (26) cmd ::= SHOW dbPrefix VGROUPS */ - { 189, -4 }, /* (27) cmd ::= SHOW dbPrefix VGROUPS ids */ - { 189, -5 }, /* (28) cmd ::= DROP TABLE ifexists ids cpxName */ - { 189, -5 }, /* (29) cmd ::= DROP STABLE ifexists ids cpxName */ - { 189, -4 }, /* (30) cmd ::= DROP DATABASE ifexists ids */ - { 189, -4 }, /* (31) cmd ::= DROP TOPIC ifexists ids */ - { 189, -3 }, /* (32) cmd ::= DROP DNODE ids */ - { 189, -3 }, /* (33) cmd ::= DROP USER ids */ - { 189, -3 }, /* (34) cmd ::= DROP ACCOUNT ids */ - { 189, -2 }, /* (35) cmd ::= USE ids */ - { 189, -3 }, /* (36) cmd ::= DESCRIBE ids cpxName */ - { 189, -5 }, /* (37) cmd ::= ALTER USER ids PASS ids */ - { 189, -5 }, /* (38) cmd ::= ALTER USER ids PRIVILEGE ids */ - { 189, -4 }, /* (39) cmd ::= ALTER DNODE ids ids */ - { 189, -5 }, /* (40) cmd ::= ALTER DNODE ids ids ids */ - { 189, -3 }, /* (41) cmd ::= ALTER LOCAL ids */ - { 189, -4 }, /* (42) cmd ::= ALTER LOCAL ids ids */ - { 189, -4 }, /* (43) cmd ::= ALTER DATABASE ids alter_db_optr */ - { 189, -4 }, /* (44) cmd ::= ALTER TOPIC ids alter_topic_optr */ - { 189, -4 }, /* (45) cmd ::= ALTER ACCOUNT ids acct_optr */ - { 189, -6 }, /* (46) cmd ::= ALTER ACCOUNT ids PASS ids acct_optr */ - { 191, -1 }, /* (47) ids ::= ID */ - { 191, -1 }, /* (48) ids ::= STRING */ - { 193, -2 }, /* (49) ifexists ::= IF EXISTS */ - { 193, 0 }, /* (50) ifexists ::= */ - { 197, -3 }, /* (51) ifnotexists ::= IF NOT EXISTS */ - { 197, 0 }, /* (52) ifnotexists ::= */ - { 189, -3 }, /* (53) cmd ::= CREATE DNODE ids */ - { 189, -6 }, /* (54) cmd ::= CREATE ACCOUNT ids PASS ids acct_optr */ - { 189, -5 }, /* (55) cmd ::= CREATE DATABASE ifnotexists ids db_optr */ - { 189, -5 }, /* (56) cmd ::= CREATE TOPIC ifnotexists ids topic_optr */ - { 189, -5 }, /* (57) cmd ::= CREATE USER ids PASS ids */ - { 200, 0 }, /* (58) pps ::= */ - { 200, -2 }, /* (59) pps ::= PPS INTEGER */ - { 201, 0 }, /* (60) tseries ::= */ - { 201, -2 }, /* (61) tseries ::= TSERIES INTEGER */ - { 202, 0 }, /* (62) dbs ::= */ - { 202, -2 }, /* (63) dbs ::= DBS INTEGER */ - { 203, 0 }, /* (64) streams ::= */ - { 203, -2 }, /* (65) streams ::= STREAMS INTEGER */ - { 204, 0 }, /* (66) storage ::= */ - { 204, -2 }, /* (67) storage ::= STORAGE INTEGER */ - { 205, 0 }, /* (68) qtime ::= */ - { 205, -2 }, /* (69) qtime ::= QTIME INTEGER */ - { 206, 0 }, /* (70) users ::= */ - { 206, -2 }, /* (71) users ::= USERS INTEGER */ - { 207, 0 }, /* (72) conns ::= */ - { 207, -2 }, /* (73) conns ::= CONNS INTEGER */ - { 208, 0 }, /* (74) state ::= */ - { 208, -2 }, /* (75) state ::= STATE ids */ - { 196, -9 }, /* (76) acct_optr ::= pps tseries storage streams qtime dbs users conns state */ - { 209, -2 }, /* (77) keep ::= KEEP tagitemlist */ - { 211, -2 }, /* (78) cache ::= CACHE INTEGER */ - { 212, -2 }, /* (79) replica ::= REPLICA INTEGER */ - { 213, -2 }, /* (80) quorum ::= QUORUM INTEGER */ - { 214, -2 }, /* (81) days ::= DAYS INTEGER */ - { 215, -2 }, /* (82) minrows ::= MINROWS INTEGER */ - { 216, -2 }, /* (83) maxrows ::= MAXROWS INTEGER */ - { 217, -2 }, /* (84) blocks ::= BLOCKS INTEGER */ - { 218, -2 }, /* (85) ctime ::= CTIME INTEGER */ - { 219, -2 }, /* (86) wal ::= WAL INTEGER */ - { 220, -2 }, /* (87) fsync ::= FSYNC INTEGER */ - { 221, -2 }, /* (88) comp ::= COMP INTEGER */ - { 222, -2 }, /* (89) prec ::= PRECISION STRING */ - { 223, -2 }, /* (90) update ::= UPDATE INTEGER */ - { 224, -2 }, /* (91) cachelast ::= CACHELAST INTEGER */ - { 225, -2 }, /* (92) partitions ::= PARTITIONS INTEGER */ - { 198, 0 }, /* (93) db_optr ::= */ - { 198, -2 }, /* (94) db_optr ::= db_optr cache */ - { 198, -2 }, /* (95) db_optr ::= db_optr replica */ - { 198, -2 }, /* (96) db_optr ::= db_optr quorum */ - { 198, -2 }, /* (97) db_optr ::= db_optr days */ - { 198, -2 }, /* (98) db_optr ::= db_optr minrows */ - { 198, -2 }, /* (99) db_optr ::= db_optr maxrows */ - { 198, -2 }, /* (100) db_optr ::= db_optr blocks */ - { 198, -2 }, /* (101) db_optr ::= db_optr ctime */ - { 198, -2 }, /* (102) db_optr ::= db_optr wal */ - { 198, -2 }, /* (103) db_optr ::= db_optr fsync */ - { 198, -2 }, /* (104) db_optr ::= db_optr comp */ - { 198, -2 }, /* (105) db_optr ::= db_optr prec */ - { 198, -2 }, /* (106) db_optr ::= db_optr keep */ - { 198, -2 }, /* (107) db_optr ::= db_optr update */ - { 198, -2 }, /* (108) db_optr ::= db_optr cachelast */ - { 199, -1 }, /* (109) topic_optr ::= db_optr */ - { 199, -2 }, /* (110) topic_optr ::= topic_optr partitions */ - { 194, 0 }, /* (111) alter_db_optr ::= */ - { 194, -2 }, /* (112) alter_db_optr ::= alter_db_optr replica */ - { 194, -2 }, /* (113) alter_db_optr ::= alter_db_optr quorum */ - { 194, -2 }, /* (114) alter_db_optr ::= alter_db_optr keep */ - { 194, -2 }, /* (115) alter_db_optr ::= alter_db_optr blocks */ - { 194, -2 }, /* (116) alter_db_optr ::= alter_db_optr comp */ - { 194, -2 }, /* (117) alter_db_optr ::= alter_db_optr wal */ - { 194, -2 }, /* (118) alter_db_optr ::= alter_db_optr fsync */ - { 194, -2 }, /* (119) alter_db_optr ::= alter_db_optr update */ - { 194, -2 }, /* (120) alter_db_optr ::= alter_db_optr cachelast */ - { 195, -1 }, /* (121) alter_topic_optr ::= alter_db_optr */ - { 195, -2 }, /* (122) alter_topic_optr ::= alter_topic_optr partitions */ - { 226, -1 }, /* (123) typename ::= ids */ - { 226, -4 }, /* (124) typename ::= ids LP signed RP */ - { 226, -2 }, /* (125) typename ::= ids UNSIGNED */ - { 227, -1 }, /* (126) signed ::= INTEGER */ - { 227, -2 }, /* (127) signed ::= PLUS INTEGER */ - { 227, -2 }, /* (128) signed ::= MINUS INTEGER */ - { 189, -3 }, /* (129) cmd ::= CREATE TABLE create_table_args */ - { 189, -3 }, /* (130) cmd ::= CREATE TABLE create_stable_args */ - { 189, -3 }, /* (131) cmd ::= CREATE STABLE create_stable_args */ - { 189, -3 }, /* (132) cmd ::= CREATE TABLE create_table_list */ - { 230, -1 }, /* (133) create_table_list ::= create_from_stable */ - { 230, -2 }, /* (134) create_table_list ::= create_table_list create_from_stable */ - { 228, -6 }, /* (135) create_table_args ::= ifnotexists ids cpxName LP columnlist RP */ - { 229, -10 }, /* (136) create_stable_args ::= ifnotexists ids cpxName LP columnlist RP TAGS LP columnlist RP */ - { 231, -10 }, /* (137) create_from_stable ::= ifnotexists ids cpxName USING ids cpxName TAGS LP tagitemlist RP */ - { 231, -13 }, /* (138) create_from_stable ::= ifnotexists ids cpxName USING ids cpxName LP tagNamelist RP TAGS LP tagitemlist RP */ - { 233, -3 }, /* (139) tagNamelist ::= tagNamelist COMMA ids */ - { 233, -1 }, /* (140) tagNamelist ::= ids */ - { 228, -5 }, /* (141) create_table_args ::= ifnotexists ids cpxName AS select */ - { 232, -3 }, /* (142) columnlist ::= columnlist COMMA column */ - { 232, -1 }, /* (143) columnlist ::= column */ - { 235, -2 }, /* (144) column ::= ids typename */ - { 210, -3 }, /* (145) tagitemlist ::= tagitemlist COMMA tagitem */ - { 210, -1 }, /* (146) tagitemlist ::= tagitem */ - { 236, -1 }, /* (147) tagitem ::= INTEGER */ - { 236, -1 }, /* (148) tagitem ::= FLOAT */ - { 236, -1 }, /* (149) tagitem ::= STRING */ - { 236, -1 }, /* (150) tagitem ::= BOOL */ - { 236, -1 }, /* (151) tagitem ::= NULL */ - { 236, -2 }, /* (152) tagitem ::= MINUS INTEGER */ - { 236, -2 }, /* (153) tagitem ::= MINUS FLOAT */ - { 236, -2 }, /* (154) tagitem ::= PLUS INTEGER */ - { 236, -2 }, /* (155) tagitem ::= PLUS FLOAT */ - { 234, -12 }, /* (156) select ::= SELECT selcollist from where_opt interval_opt fill_opt sliding_opt groupby_opt orderby_opt having_opt slimit_opt limit_opt */ - { 248, -1 }, /* (157) union ::= select */ - { 248, -3 }, /* (158) union ::= LP union RP */ - { 248, -4 }, /* (159) union ::= union UNION ALL select */ - { 248, -6 }, /* (160) union ::= union UNION ALL LP select RP */ - { 189, -1 }, /* (161) cmd ::= union */ - { 234, -2 }, /* (162) select ::= SELECT selcollist */ - { 249, -2 }, /* (163) sclp ::= selcollist COMMA */ - { 249, 0 }, /* (164) sclp ::= */ - { 237, -4 }, /* (165) selcollist ::= sclp distinct expr as */ - { 237, -2 }, /* (166) selcollist ::= sclp STAR */ - { 252, -2 }, /* (167) as ::= AS ids */ - { 252, -1 }, /* (168) as ::= ids */ - { 252, 0 }, /* (169) as ::= */ - { 250, -1 }, /* (170) distinct ::= DISTINCT */ - { 250, 0 }, /* (171) distinct ::= */ - { 238, -2 }, /* (172) from ::= FROM tablelist */ - { 253, -2 }, /* (173) tablelist ::= ids cpxName */ - { 253, -3 }, /* (174) tablelist ::= ids cpxName ids */ - { 253, -4 }, /* (175) tablelist ::= tablelist COMMA ids cpxName */ - { 253, -5 }, /* (176) tablelist ::= tablelist COMMA ids cpxName ids */ - { 254, -1 }, /* (177) tmvar ::= VARIABLE */ - { 240, -4 }, /* (178) interval_opt ::= INTERVAL LP tmvar RP */ - { 240, -6 }, /* (179) interval_opt ::= INTERVAL LP tmvar COMMA tmvar RP */ - { 240, 0 }, /* (180) interval_opt ::= */ - { 241, 0 }, /* (181) fill_opt ::= */ - { 241, -6 }, /* (182) fill_opt ::= FILL LP ID COMMA tagitemlist RP */ - { 241, -4 }, /* (183) fill_opt ::= FILL LP ID RP */ - { 242, -4 }, /* (184) sliding_opt ::= SLIDING LP tmvar RP */ - { 242, 0 }, /* (185) sliding_opt ::= */ - { 244, 0 }, /* (186) orderby_opt ::= */ - { 244, -3 }, /* (187) orderby_opt ::= ORDER BY sortlist */ - { 255, -4 }, /* (188) sortlist ::= sortlist COMMA item sortorder */ - { 255, -2 }, /* (189) sortlist ::= item sortorder */ - { 257, -2 }, /* (190) item ::= ids cpxName */ - { 258, -1 }, /* (191) sortorder ::= ASC */ - { 258, -1 }, /* (192) sortorder ::= DESC */ - { 258, 0 }, /* (193) sortorder ::= */ - { 243, 0 }, /* (194) groupby_opt ::= */ - { 243, -3 }, /* (195) groupby_opt ::= GROUP BY grouplist */ - { 259, -3 }, /* (196) grouplist ::= grouplist COMMA item */ - { 259, -1 }, /* (197) grouplist ::= item */ - { 245, 0 }, /* (198) having_opt ::= */ - { 245, -2 }, /* (199) having_opt ::= HAVING expr */ - { 247, 0 }, /* (200) limit_opt ::= */ - { 247, -2 }, /* (201) limit_opt ::= LIMIT signed */ - { 247, -4 }, /* (202) limit_opt ::= LIMIT signed OFFSET signed */ - { 247, -4 }, /* (203) limit_opt ::= LIMIT signed COMMA signed */ - { 246, 0 }, /* (204) slimit_opt ::= */ - { 246, -2 }, /* (205) slimit_opt ::= SLIMIT signed */ - { 246, -4 }, /* (206) slimit_opt ::= SLIMIT signed SOFFSET signed */ - { 246, -4 }, /* (207) slimit_opt ::= SLIMIT signed COMMA signed */ - { 239, 0 }, /* (208) where_opt ::= */ - { 239, -2 }, /* (209) where_opt ::= WHERE expr */ - { 251, -3 }, /* (210) expr ::= LP expr RP */ - { 251, -1 }, /* (211) expr ::= ID */ - { 251, -3 }, /* (212) expr ::= ID DOT ID */ - { 251, -3 }, /* (213) expr ::= ID DOT STAR */ - { 251, -1 }, /* (214) expr ::= INTEGER */ - { 251, -2 }, /* (215) expr ::= MINUS INTEGER */ - { 251, -2 }, /* (216) expr ::= PLUS INTEGER */ - { 251, -1 }, /* (217) expr ::= FLOAT */ - { 251, -2 }, /* (218) expr ::= MINUS FLOAT */ - { 251, -2 }, /* (219) expr ::= PLUS FLOAT */ - { 251, -1 }, /* (220) expr ::= STRING */ - { 251, -1 }, /* (221) expr ::= NOW */ - { 251, -1 }, /* (222) expr ::= VARIABLE */ - { 251, -1 }, /* (223) expr ::= BOOL */ - { 251, -4 }, /* (224) expr ::= ID LP exprlist RP */ - { 251, -4 }, /* (225) expr ::= ID LP STAR RP */ - { 251, -3 }, /* (226) expr ::= expr IS NULL */ - { 251, -4 }, /* (227) expr ::= expr IS NOT NULL */ - { 251, -3 }, /* (228) expr ::= expr LT expr */ - { 251, -3 }, /* (229) expr ::= expr GT expr */ - { 251, -3 }, /* (230) expr ::= expr LE expr */ - { 251, -3 }, /* (231) expr ::= expr GE expr */ - { 251, -3 }, /* (232) expr ::= expr NE expr */ - { 251, -3 }, /* (233) expr ::= expr EQ expr */ - { 251, -5 }, /* (234) expr ::= expr BETWEEN expr AND expr */ - { 251, -3 }, /* (235) expr ::= expr AND expr */ - { 251, -3 }, /* (236) expr ::= expr OR expr */ - { 251, -3 }, /* (237) expr ::= expr PLUS expr */ - { 251, -3 }, /* (238) expr ::= expr MINUS expr */ - { 251, -3 }, /* (239) expr ::= expr STAR expr */ - { 251, -3 }, /* (240) expr ::= expr SLASH expr */ - { 251, -3 }, /* (241) expr ::= expr REM expr */ - { 251, -3 }, /* (242) expr ::= expr LIKE expr */ - { 251, -5 }, /* (243) expr ::= expr IN LP exprlist RP */ - { 260, -3 }, /* (244) exprlist ::= exprlist COMMA expritem */ - { 260, -1 }, /* (245) exprlist ::= expritem */ - { 261, -1 }, /* (246) expritem ::= expr */ - { 261, 0 }, /* (247) expritem ::= */ - { 189, -3 }, /* (248) cmd ::= RESET QUERY CACHE */ - { 189, -7 }, /* (249) cmd ::= ALTER TABLE ids cpxName ADD COLUMN columnlist */ - { 189, -7 }, /* (250) cmd ::= ALTER TABLE ids cpxName DROP COLUMN ids */ - { 189, -7 }, /* (251) cmd ::= ALTER TABLE ids cpxName ADD TAG columnlist */ - { 189, -7 }, /* (252) cmd ::= ALTER TABLE ids cpxName DROP TAG ids */ - { 189, -8 }, /* (253) cmd ::= ALTER TABLE ids cpxName CHANGE TAG ids ids */ - { 189, -9 }, /* (254) cmd ::= ALTER TABLE ids cpxName SET TAG ids EQ tagitem */ - { 189, -7 }, /* (255) cmd ::= ALTER STABLE ids cpxName ADD COLUMN columnlist */ - { 189, -7 }, /* (256) cmd ::= ALTER STABLE ids cpxName DROP COLUMN ids */ - { 189, -7 }, /* (257) cmd ::= ALTER STABLE ids cpxName ADD TAG columnlist */ - { 189, -7 }, /* (258) cmd ::= ALTER STABLE ids cpxName DROP TAG ids */ - { 189, -8 }, /* (259) cmd ::= ALTER STABLE ids cpxName CHANGE TAG ids ids */ - { 189, -3 }, /* (260) cmd ::= KILL CONNECTION INTEGER */ - { 189, -5 }, /* (261) cmd ::= KILL STREAM INTEGER COLON INTEGER */ - { 189, -5 }, /* (262) cmd ::= KILL QUERY INTEGER COLON INTEGER */ + { 189, -1 }, /* (0) program ::= cmd */ + { 190, -2 }, /* (1) cmd ::= SHOW DATABASES */ + { 190, -2 }, /* (2) cmd ::= SHOW TOPICS */ + { 190, -2 }, /* (3) cmd ::= SHOW MNODES */ + { 190, -2 }, /* (4) cmd ::= SHOW DNODES */ + { 190, -2 }, /* (5) cmd ::= SHOW ACCOUNTS */ + { 190, -2 }, /* (6) cmd ::= SHOW USERS */ + { 190, -2 }, /* (7) cmd ::= SHOW MODULES */ + { 190, -2 }, /* (8) cmd ::= SHOW QUERIES */ + { 190, -2 }, /* (9) cmd ::= SHOW CONNECTIONS */ + { 190, -2 }, /* (10) cmd ::= SHOW STREAMS */ + { 190, -2 }, /* (11) cmd ::= SHOW VARIABLES */ + { 190, -2 }, /* (12) cmd ::= SHOW SCORES */ + { 190, -2 }, /* (13) cmd ::= SHOW GRANTS */ + { 190, -2 }, /* (14) cmd ::= SHOW VNODES */ + { 190, -3 }, /* (15) cmd ::= SHOW VNODES IPTOKEN */ + { 191, 0 }, /* (16) dbPrefix ::= */ + { 191, -2 }, /* (17) dbPrefix ::= ids DOT */ + { 193, 0 }, /* (18) cpxName ::= */ + { 193, -2 }, /* (19) cpxName ::= DOT ids */ + { 190, -5 }, /* (20) cmd ::= SHOW CREATE TABLE ids cpxName */ + { 190, -4 }, /* (21) cmd ::= SHOW CREATE DATABASE ids */ + { 190, -3 }, /* (22) cmd ::= SHOW dbPrefix TABLES */ + { 190, -5 }, /* (23) cmd ::= SHOW dbPrefix TABLES LIKE ids */ + { 190, -3 }, /* (24) cmd ::= SHOW dbPrefix STABLES */ + { 190, -5 }, /* (25) cmd ::= SHOW dbPrefix STABLES LIKE ids */ + { 190, -3 }, /* (26) cmd ::= SHOW dbPrefix VGROUPS */ + { 190, -4 }, /* (27) cmd ::= SHOW dbPrefix VGROUPS ids */ + { 190, -5 }, /* (28) cmd ::= DROP TABLE ifexists ids cpxName */ + { 190, -5 }, /* (29) cmd ::= DROP STABLE ifexists ids cpxName */ + { 190, -4 }, /* (30) cmd ::= DROP DATABASE ifexists ids */ + { 190, -4 }, /* (31) cmd ::= DROP TOPIC ifexists ids */ + { 190, -3 }, /* (32) cmd ::= DROP DNODE ids */ + { 190, -3 }, /* (33) cmd ::= DROP USER ids */ + { 190, -3 }, /* (34) cmd ::= DROP ACCOUNT ids */ + { 190, -2 }, /* (35) cmd ::= USE ids */ + { 190, -3 }, /* (36) cmd ::= DESCRIBE ids cpxName */ + { 190, -5 }, /* (37) cmd ::= ALTER USER ids PASS ids */ + { 190, -5 }, /* (38) cmd ::= ALTER USER ids PRIVILEGE ids */ + { 190, -4 }, /* (39) cmd ::= ALTER DNODE ids ids */ + { 190, -5 }, /* (40) cmd ::= ALTER DNODE ids ids ids */ + { 190, -3 }, /* (41) cmd ::= ALTER LOCAL ids */ + { 190, -4 }, /* (42) cmd ::= ALTER LOCAL ids ids */ + { 190, -4 }, /* (43) cmd ::= ALTER DATABASE ids alter_db_optr */ + { 190, -4 }, /* (44) cmd ::= ALTER TOPIC ids alter_topic_optr */ + { 190, -4 }, /* (45) cmd ::= ALTER ACCOUNT ids acct_optr */ + { 190, -6 }, /* (46) cmd ::= ALTER ACCOUNT ids PASS ids acct_optr */ + { 192, -1 }, /* (47) ids ::= ID */ + { 192, -1 }, /* (48) ids ::= STRING */ + { 194, -2 }, /* (49) ifexists ::= IF EXISTS */ + { 194, 0 }, /* (50) ifexists ::= */ + { 198, -3 }, /* (51) ifnotexists ::= IF NOT EXISTS */ + { 198, 0 }, /* (52) ifnotexists ::= */ + { 190, -3 }, /* (53) cmd ::= CREATE DNODE ids */ + { 190, -6 }, /* (54) cmd ::= CREATE ACCOUNT ids PASS ids acct_optr */ + { 190, -5 }, /* (55) cmd ::= CREATE DATABASE ifnotexists ids db_optr */ + { 190, -5 }, /* (56) cmd ::= CREATE TOPIC ifnotexists ids topic_optr */ + { 190, -5 }, /* (57) cmd ::= CREATE USER ids PASS ids */ + { 201, 0 }, /* (58) pps ::= */ + { 201, -2 }, /* (59) pps ::= PPS INTEGER */ + { 202, 0 }, /* (60) tseries ::= */ + { 202, -2 }, /* (61) tseries ::= TSERIES INTEGER */ + { 203, 0 }, /* (62) dbs ::= */ + { 203, -2 }, /* (63) dbs ::= DBS INTEGER */ + { 204, 0 }, /* (64) streams ::= */ + { 204, -2 }, /* (65) streams ::= STREAMS INTEGER */ + { 205, 0 }, /* (66) storage ::= */ + { 205, -2 }, /* (67) storage ::= STORAGE INTEGER */ + { 206, 0 }, /* (68) qtime ::= */ + { 206, -2 }, /* (69) qtime ::= QTIME INTEGER */ + { 207, 0 }, /* (70) users ::= */ + { 207, -2 }, /* (71) users ::= USERS INTEGER */ + { 208, 0 }, /* (72) conns ::= */ + { 208, -2 }, /* (73) conns ::= CONNS INTEGER */ + { 209, 0 }, /* (74) state ::= */ + { 209, -2 }, /* (75) state ::= STATE ids */ + { 197, -9 }, /* (76) acct_optr ::= pps tseries storage streams qtime dbs users conns state */ + { 210, -2 }, /* (77) keep ::= KEEP tagitemlist */ + { 212, -2 }, /* (78) cache ::= CACHE INTEGER */ + { 213, -2 }, /* (79) replica ::= REPLICA INTEGER */ + { 214, -2 }, /* (80) quorum ::= QUORUM INTEGER */ + { 215, -2 }, /* (81) days ::= DAYS INTEGER */ + { 216, -2 }, /* (82) minrows ::= MINROWS INTEGER */ + { 217, -2 }, /* (83) maxrows ::= MAXROWS INTEGER */ + { 218, -2 }, /* (84) blocks ::= BLOCKS INTEGER */ + { 219, -2 }, /* (85) ctime ::= CTIME INTEGER */ + { 220, -2 }, /* (86) wal ::= WAL INTEGER */ + { 221, -2 }, /* (87) fsync ::= FSYNC INTEGER */ + { 222, -2 }, /* (88) comp ::= COMP INTEGER */ + { 223, -2 }, /* (89) prec ::= PRECISION STRING */ + { 224, -2 }, /* (90) update ::= UPDATE INTEGER */ + { 225, -2 }, /* (91) cachelast ::= CACHELAST INTEGER */ + { 226, -2 }, /* (92) partitions ::= PARTITIONS INTEGER */ + { 199, 0 }, /* (93) db_optr ::= */ + { 199, -2 }, /* (94) db_optr ::= db_optr cache */ + { 199, -2 }, /* (95) db_optr ::= db_optr replica */ + { 199, -2 }, /* (96) db_optr ::= db_optr quorum */ + { 199, -2 }, /* (97) db_optr ::= db_optr days */ + { 199, -2 }, /* (98) db_optr ::= db_optr minrows */ + { 199, -2 }, /* (99) db_optr ::= db_optr maxrows */ + { 199, -2 }, /* (100) db_optr ::= db_optr blocks */ + { 199, -2 }, /* (101) db_optr ::= db_optr ctime */ + { 199, -2 }, /* (102) db_optr ::= db_optr wal */ + { 199, -2 }, /* (103) db_optr ::= db_optr fsync */ + { 199, -2 }, /* (104) db_optr ::= db_optr comp */ + { 199, -2 }, /* (105) db_optr ::= db_optr prec */ + { 199, -2 }, /* (106) db_optr ::= db_optr keep */ + { 199, -2 }, /* (107) db_optr ::= db_optr update */ + { 199, -2 }, /* (108) db_optr ::= db_optr cachelast */ + { 200, -1 }, /* (109) topic_optr ::= db_optr */ + { 200, -2 }, /* (110) topic_optr ::= topic_optr partitions */ + { 195, 0 }, /* (111) alter_db_optr ::= */ + { 195, -2 }, /* (112) alter_db_optr ::= alter_db_optr replica */ + { 195, -2 }, /* (113) alter_db_optr ::= alter_db_optr quorum */ + { 195, -2 }, /* (114) alter_db_optr ::= alter_db_optr keep */ + { 195, -2 }, /* (115) alter_db_optr ::= alter_db_optr blocks */ + { 195, -2 }, /* (116) alter_db_optr ::= alter_db_optr comp */ + { 195, -2 }, /* (117) alter_db_optr ::= alter_db_optr wal */ + { 195, -2 }, /* (118) alter_db_optr ::= alter_db_optr fsync */ + { 195, -2 }, /* (119) alter_db_optr ::= alter_db_optr update */ + { 195, -2 }, /* (120) alter_db_optr ::= alter_db_optr cachelast */ + { 196, -1 }, /* (121) alter_topic_optr ::= alter_db_optr */ + { 196, -2 }, /* (122) alter_topic_optr ::= alter_topic_optr partitions */ + { 227, -1 }, /* (123) typename ::= ids */ + { 227, -4 }, /* (124) typename ::= ids LP signed RP */ + { 227, -2 }, /* (125) typename ::= ids UNSIGNED */ + { 228, -1 }, /* (126) signed ::= INTEGER */ + { 228, -2 }, /* (127) signed ::= PLUS INTEGER */ + { 228, -2 }, /* (128) signed ::= MINUS INTEGER */ + { 190, -3 }, /* (129) cmd ::= CREATE TABLE create_table_args */ + { 190, -3 }, /* (130) cmd ::= CREATE TABLE create_stable_args */ + { 190, -3 }, /* (131) cmd ::= CREATE STABLE create_stable_args */ + { 190, -3 }, /* (132) cmd ::= CREATE TABLE create_table_list */ + { 231, -1 }, /* (133) create_table_list ::= create_from_stable */ + { 231, -2 }, /* (134) create_table_list ::= create_table_list create_from_stable */ + { 229, -6 }, /* (135) create_table_args ::= ifnotexists ids cpxName LP columnlist RP */ + { 230, -10 }, /* (136) create_stable_args ::= ifnotexists ids cpxName LP columnlist RP TAGS LP columnlist RP */ + { 232, -10 }, /* (137) create_from_stable ::= ifnotexists ids cpxName USING ids cpxName TAGS LP tagitemlist RP */ + { 232, -13 }, /* (138) create_from_stable ::= ifnotexists ids cpxName USING ids cpxName LP tagNamelist RP TAGS LP tagitemlist RP */ + { 234, -3 }, /* (139) tagNamelist ::= tagNamelist COMMA ids */ + { 234, -1 }, /* (140) tagNamelist ::= ids */ + { 229, -5 }, /* (141) create_table_args ::= ifnotexists ids cpxName AS select */ + { 233, -3 }, /* (142) columnlist ::= columnlist COMMA column */ + { 233, -1 }, /* (143) columnlist ::= column */ + { 236, -2 }, /* (144) column ::= ids typename */ + { 211, -3 }, /* (145) tagitemlist ::= tagitemlist COMMA tagitem */ + { 211, -1 }, /* (146) tagitemlist ::= tagitem */ + { 237, -1 }, /* (147) tagitem ::= INTEGER */ + { 237, -1 }, /* (148) tagitem ::= FLOAT */ + { 237, -1 }, /* (149) tagitem ::= STRING */ + { 237, -1 }, /* (150) tagitem ::= BOOL */ + { 237, -1 }, /* (151) tagitem ::= NULL */ + { 237, -2 }, /* (152) tagitem ::= MINUS INTEGER */ + { 237, -2 }, /* (153) tagitem ::= MINUS FLOAT */ + { 237, -2 }, /* (154) tagitem ::= PLUS INTEGER */ + { 237, -2 }, /* (155) tagitem ::= PLUS FLOAT */ + { 235, -13 }, /* (156) select ::= SELECT selcollist from where_opt interval_opt session_option fill_opt sliding_opt groupby_opt orderby_opt having_opt slimit_opt limit_opt */ + { 250, -1 }, /* (157) union ::= select */ + { 250, -3 }, /* (158) union ::= LP union RP */ + { 250, -4 }, /* (159) union ::= union UNION ALL select */ + { 250, -6 }, /* (160) union ::= union UNION ALL LP select RP */ + { 190, -1 }, /* (161) cmd ::= union */ + { 235, -2 }, /* (162) select ::= SELECT selcollist */ + { 251, -2 }, /* (163) sclp ::= selcollist COMMA */ + { 251, 0 }, /* (164) sclp ::= */ + { 238, -4 }, /* (165) selcollist ::= sclp distinct expr as */ + { 238, -2 }, /* (166) selcollist ::= sclp STAR */ + { 254, -2 }, /* (167) as ::= AS ids */ + { 254, -1 }, /* (168) as ::= ids */ + { 254, 0 }, /* (169) as ::= */ + { 252, -1 }, /* (170) distinct ::= DISTINCT */ + { 252, 0 }, /* (171) distinct ::= */ + { 239, -2 }, /* (172) from ::= FROM tablelist */ + { 255, -2 }, /* (173) tablelist ::= ids cpxName */ + { 255, -3 }, /* (174) tablelist ::= ids cpxName ids */ + { 255, -4 }, /* (175) tablelist ::= tablelist COMMA ids cpxName */ + { 255, -5 }, /* (176) tablelist ::= tablelist COMMA ids cpxName ids */ + { 256, -1 }, /* (177) tmvar ::= VARIABLE */ + { 241, -4 }, /* (178) interval_opt ::= INTERVAL LP tmvar RP */ + { 241, -6 }, /* (179) interval_opt ::= INTERVAL LP tmvar COMMA tmvar RP */ + { 241, 0 }, /* (180) interval_opt ::= */ + { 242, 0 }, /* (181) session_option ::= */ + { 242, -7 }, /* (182) session_option ::= SESSION LP ids cpxName COMMA tmvar RP */ + { 243, 0 }, /* (183) fill_opt ::= */ + { 243, -6 }, /* (184) fill_opt ::= FILL LP ID COMMA tagitemlist RP */ + { 243, -4 }, /* (185) fill_opt ::= FILL LP ID RP */ + { 244, -4 }, /* (186) sliding_opt ::= SLIDING LP tmvar RP */ + { 244, 0 }, /* (187) sliding_opt ::= */ + { 246, 0 }, /* (188) orderby_opt ::= */ + { 246, -3 }, /* (189) orderby_opt ::= ORDER BY sortlist */ + { 257, -4 }, /* (190) sortlist ::= sortlist COMMA item sortorder */ + { 257, -2 }, /* (191) sortlist ::= item sortorder */ + { 259, -2 }, /* (192) item ::= ids cpxName */ + { 260, -1 }, /* (193) sortorder ::= ASC */ + { 260, -1 }, /* (194) sortorder ::= DESC */ + { 260, 0 }, /* (195) sortorder ::= */ + { 245, 0 }, /* (196) groupby_opt ::= */ + { 245, -3 }, /* (197) groupby_opt ::= GROUP BY grouplist */ + { 261, -3 }, /* (198) grouplist ::= grouplist COMMA item */ + { 261, -1 }, /* (199) grouplist ::= item */ + { 247, 0 }, /* (200) having_opt ::= */ + { 247, -2 }, /* (201) having_opt ::= HAVING expr */ + { 249, 0 }, /* (202) limit_opt ::= */ + { 249, -2 }, /* (203) limit_opt ::= LIMIT signed */ + { 249, -4 }, /* (204) limit_opt ::= LIMIT signed OFFSET signed */ + { 249, -4 }, /* (205) limit_opt ::= LIMIT signed COMMA signed */ + { 248, 0 }, /* (206) slimit_opt ::= */ + { 248, -2 }, /* (207) slimit_opt ::= SLIMIT signed */ + { 248, -4 }, /* (208) slimit_opt ::= SLIMIT signed SOFFSET signed */ + { 248, -4 }, /* (209) slimit_opt ::= SLIMIT signed COMMA signed */ + { 240, 0 }, /* (210) where_opt ::= */ + { 240, -2 }, /* (211) where_opt ::= WHERE expr */ + { 253, -3 }, /* (212) expr ::= LP expr RP */ + { 253, -1 }, /* (213) expr ::= ID */ + { 253, -3 }, /* (214) expr ::= ID DOT ID */ + { 253, -3 }, /* (215) expr ::= ID DOT STAR */ + { 253, -1 }, /* (216) expr ::= INTEGER */ + { 253, -2 }, /* (217) expr ::= MINUS INTEGER */ + { 253, -2 }, /* (218) expr ::= PLUS INTEGER */ + { 253, -1 }, /* (219) expr ::= FLOAT */ + { 253, -2 }, /* (220) expr ::= MINUS FLOAT */ + { 253, -2 }, /* (221) expr ::= PLUS FLOAT */ + { 253, -1 }, /* (222) expr ::= STRING */ + { 253, -1 }, /* (223) expr ::= NOW */ + { 253, -1 }, /* (224) expr ::= VARIABLE */ + { 253, -1 }, /* (225) expr ::= BOOL */ + { 253, -4 }, /* (226) expr ::= ID LP exprlist RP */ + { 253, -4 }, /* (227) expr ::= ID LP STAR RP */ + { 253, -3 }, /* (228) expr ::= expr IS NULL */ + { 253, -4 }, /* (229) expr ::= expr IS NOT NULL */ + { 253, -3 }, /* (230) expr ::= expr LT expr */ + { 253, -3 }, /* (231) expr ::= expr GT expr */ + { 253, -3 }, /* (232) expr ::= expr LE expr */ + { 253, -3 }, /* (233) expr ::= expr GE expr */ + { 253, -3 }, /* (234) expr ::= expr NE expr */ + { 253, -3 }, /* (235) expr ::= expr EQ expr */ + { 253, -5 }, /* (236) expr ::= expr BETWEEN expr AND expr */ + { 253, -3 }, /* (237) expr ::= expr AND expr */ + { 253, -3 }, /* (238) expr ::= expr OR expr */ + { 253, -3 }, /* (239) expr ::= expr PLUS expr */ + { 253, -3 }, /* (240) expr ::= expr MINUS expr */ + { 253, -3 }, /* (241) expr ::= expr STAR expr */ + { 253, -3 }, /* (242) expr ::= expr SLASH expr */ + { 253, -3 }, /* (243) expr ::= expr REM expr */ + { 253, -3 }, /* (244) expr ::= expr LIKE expr */ + { 253, -5 }, /* (245) expr ::= expr IN LP exprlist RP */ + { 262, -3 }, /* (246) exprlist ::= exprlist COMMA expritem */ + { 262, -1 }, /* (247) exprlist ::= expritem */ + { 263, -1 }, /* (248) expritem ::= expr */ + { 263, 0 }, /* (249) expritem ::= */ + { 190, -3 }, /* (250) cmd ::= RESET QUERY CACHE */ + { 190, -7 }, /* (251) cmd ::= ALTER TABLE ids cpxName ADD COLUMN columnlist */ + { 190, -7 }, /* (252) cmd ::= ALTER TABLE ids cpxName DROP COLUMN ids */ + { 190, -7 }, /* (253) cmd ::= ALTER TABLE ids cpxName ADD TAG columnlist */ + { 190, -7 }, /* (254) cmd ::= ALTER TABLE ids cpxName DROP TAG ids */ + { 190, -8 }, /* (255) cmd ::= ALTER TABLE ids cpxName CHANGE TAG ids ids */ + { 190, -9 }, /* (256) cmd ::= ALTER TABLE ids cpxName SET TAG ids EQ tagitem */ + { 190, -7 }, /* (257) cmd ::= ALTER STABLE ids cpxName ADD COLUMN columnlist */ + { 190, -7 }, /* (258) cmd ::= ALTER STABLE ids cpxName DROP COLUMN ids */ + { 190, -7 }, /* (259) cmd ::= ALTER STABLE ids cpxName ADD TAG columnlist */ + { 190, -7 }, /* (260) cmd ::= ALTER STABLE ids cpxName DROP TAG ids */ + { 190, -8 }, /* (261) cmd ::= ALTER STABLE ids cpxName CHANGE TAG ids ids */ + { 190, -3 }, /* (262) cmd ::= KILL CONNECTION INTEGER */ + { 190, -5 }, /* (263) cmd ::= KILL STREAM INTEGER COLON INTEGER */ + { 190, -5 }, /* (264) cmd ::= KILL QUERY INTEGER COLON INTEGER */ }; static void yy_accept(yyParser*); /* Forward Declaration */ @@ -2244,13 +2256,13 @@ static void yy_reduce( break; case 43: /* cmd ::= ALTER DATABASE ids alter_db_optr */ case 44: /* cmd ::= ALTER TOPIC ids alter_topic_optr */ yytestcase(yyruleno==44); -{ SStrToken t = {0}; setCreateDbInfo(pInfo, TSDB_SQL_ALTER_DB, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy94, &t);} +{ SStrToken t = {0}; setCreateDbInfo(pInfo, TSDB_SQL_ALTER_DB, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy526, &t);} break; case 45: /* cmd ::= ALTER ACCOUNT ids acct_optr */ -{ setCreateAcctSql(pInfo, TSDB_SQL_ALTER_ACCT, &yymsp[-1].minor.yy0, NULL, &yymsp[0].minor.yy419);} +{ setCreateAcctSql(pInfo, TSDB_SQL_ALTER_ACCT, &yymsp[-1].minor.yy0, NULL, &yymsp[0].minor.yy187);} break; case 46: /* cmd ::= ALTER ACCOUNT ids PASS ids acct_optr */ -{ setCreateAcctSql(pInfo, TSDB_SQL_ALTER_ACCT, &yymsp[-3].minor.yy0, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy419);} +{ setCreateAcctSql(pInfo, TSDB_SQL_ALTER_ACCT, &yymsp[-3].minor.yy0, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy187);} break; case 47: /* ids ::= ID */ case 48: /* ids ::= STRING */ yytestcase(yyruleno==48); @@ -2272,11 +2284,11 @@ static void yy_reduce( { setDCLSQLElems(pInfo, TSDB_SQL_CREATE_DNODE, 1, &yymsp[0].minor.yy0);} break; case 54: /* cmd ::= CREATE ACCOUNT ids PASS ids acct_optr */ -{ setCreateAcctSql(pInfo, TSDB_SQL_CREATE_ACCT, &yymsp[-3].minor.yy0, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy419);} +{ setCreateAcctSql(pInfo, TSDB_SQL_CREATE_ACCT, &yymsp[-3].minor.yy0, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy187);} break; case 55: /* cmd ::= CREATE DATABASE ifnotexists ids db_optr */ case 56: /* cmd ::= CREATE TOPIC ifnotexists ids topic_optr */ yytestcase(yyruleno==56); -{ setCreateDbInfo(pInfo, TSDB_SQL_CREATE_DB, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy94, &yymsp[-2].minor.yy0);} +{ setCreateDbInfo(pInfo, TSDB_SQL_CREATE_DB, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy526, &yymsp[-2].minor.yy0);} break; case 57: /* cmd ::= CREATE USER ids PASS ids */ { setCreateUserSql(pInfo, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0);} @@ -2305,20 +2317,20 @@ static void yy_reduce( break; case 76: /* acct_optr ::= pps tseries storage streams qtime dbs users conns state */ { - yylhsminor.yy419.maxUsers = (yymsp[-2].minor.yy0.n>0)?atoi(yymsp[-2].minor.yy0.z):-1; - yylhsminor.yy419.maxDbs = (yymsp[-3].minor.yy0.n>0)?atoi(yymsp[-3].minor.yy0.z):-1; - yylhsminor.yy419.maxTimeSeries = (yymsp[-7].minor.yy0.n>0)?atoi(yymsp[-7].minor.yy0.z):-1; - yylhsminor.yy419.maxStreams = (yymsp[-5].minor.yy0.n>0)?atoi(yymsp[-5].minor.yy0.z):-1; - yylhsminor.yy419.maxPointsPerSecond = (yymsp[-8].minor.yy0.n>0)?atoi(yymsp[-8].minor.yy0.z):-1; - yylhsminor.yy419.maxStorage = (yymsp[-6].minor.yy0.n>0)?strtoll(yymsp[-6].minor.yy0.z, NULL, 10):-1; - yylhsminor.yy419.maxQueryTime = (yymsp[-4].minor.yy0.n>0)?strtoll(yymsp[-4].minor.yy0.z, NULL, 10):-1; - yylhsminor.yy419.maxConnections = (yymsp[-1].minor.yy0.n>0)?atoi(yymsp[-1].minor.yy0.z):-1; - yylhsminor.yy419.stat = yymsp[0].minor.yy0; -} - yymsp[-8].minor.yy419 = yylhsminor.yy419; + yylhsminor.yy187.maxUsers = (yymsp[-2].minor.yy0.n>0)?atoi(yymsp[-2].minor.yy0.z):-1; + yylhsminor.yy187.maxDbs = (yymsp[-3].minor.yy0.n>0)?atoi(yymsp[-3].minor.yy0.z):-1; + yylhsminor.yy187.maxTimeSeries = (yymsp[-7].minor.yy0.n>0)?atoi(yymsp[-7].minor.yy0.z):-1; + yylhsminor.yy187.maxStreams = (yymsp[-5].minor.yy0.n>0)?atoi(yymsp[-5].minor.yy0.z):-1; + yylhsminor.yy187.maxPointsPerSecond = (yymsp[-8].minor.yy0.n>0)?atoi(yymsp[-8].minor.yy0.z):-1; + yylhsminor.yy187.maxStorage = (yymsp[-6].minor.yy0.n>0)?strtoll(yymsp[-6].minor.yy0.z, NULL, 10):-1; + yylhsminor.yy187.maxQueryTime = (yymsp[-4].minor.yy0.n>0)?strtoll(yymsp[-4].minor.yy0.z, NULL, 10):-1; + yylhsminor.yy187.maxConnections = (yymsp[-1].minor.yy0.n>0)?atoi(yymsp[-1].minor.yy0.z):-1; + yylhsminor.yy187.stat = yymsp[0].minor.yy0; +} + yymsp[-8].minor.yy187 = yylhsminor.yy187; break; case 77: /* keep ::= KEEP tagitemlist */ -{ yymsp[-1].minor.yy429 = yymsp[0].minor.yy429; } +{ yymsp[-1].minor.yy285 = yymsp[0].minor.yy285; } break; case 78: /* cache ::= CACHE INTEGER */ case 79: /* replica ::= REPLICA INTEGER */ yytestcase(yyruleno==79); @@ -2338,234 +2350,234 @@ static void yy_reduce( { yymsp[-1].minor.yy0 = yymsp[0].minor.yy0; } break; case 93: /* db_optr ::= */ -{setDefaultCreateDbOption(&yymsp[1].minor.yy94); yymsp[1].minor.yy94.dbType = TSDB_DB_TYPE_DEFAULT;} +{setDefaultCreateDbOption(&yymsp[1].minor.yy526); yymsp[1].minor.yy526.dbType = TSDB_DB_TYPE_DEFAULT;} break; case 94: /* db_optr ::= db_optr cache */ -{ yylhsminor.yy94 = yymsp[-1].minor.yy94; yylhsminor.yy94.cacheBlockSize = strtol(yymsp[0].minor.yy0.z, NULL, 10); } - yymsp[-1].minor.yy94 = yylhsminor.yy94; +{ yylhsminor.yy526 = yymsp[-1].minor.yy526; yylhsminor.yy526.cacheBlockSize = strtol(yymsp[0].minor.yy0.z, NULL, 10); } + yymsp[-1].minor.yy526 = yylhsminor.yy526; break; case 95: /* db_optr ::= db_optr replica */ case 112: /* alter_db_optr ::= alter_db_optr replica */ yytestcase(yyruleno==112); -{ yylhsminor.yy94 = yymsp[-1].minor.yy94; yylhsminor.yy94.replica = strtol(yymsp[0].minor.yy0.z, NULL, 10); } - yymsp[-1].minor.yy94 = yylhsminor.yy94; +{ yylhsminor.yy526 = yymsp[-1].minor.yy526; yylhsminor.yy526.replica = strtol(yymsp[0].minor.yy0.z, NULL, 10); } + yymsp[-1].minor.yy526 = yylhsminor.yy526; break; case 96: /* db_optr ::= db_optr quorum */ case 113: /* alter_db_optr ::= alter_db_optr quorum */ yytestcase(yyruleno==113); -{ yylhsminor.yy94 = yymsp[-1].minor.yy94; yylhsminor.yy94.quorum = strtol(yymsp[0].minor.yy0.z, NULL, 10); } - yymsp[-1].minor.yy94 = yylhsminor.yy94; +{ yylhsminor.yy526 = yymsp[-1].minor.yy526; yylhsminor.yy526.quorum = strtol(yymsp[0].minor.yy0.z, NULL, 10); } + yymsp[-1].minor.yy526 = yylhsminor.yy526; break; case 97: /* db_optr ::= db_optr days */ -{ yylhsminor.yy94 = yymsp[-1].minor.yy94; yylhsminor.yy94.daysPerFile = strtol(yymsp[0].minor.yy0.z, NULL, 10); } - yymsp[-1].minor.yy94 = yylhsminor.yy94; +{ yylhsminor.yy526 = yymsp[-1].minor.yy526; yylhsminor.yy526.daysPerFile = strtol(yymsp[0].minor.yy0.z, NULL, 10); } + yymsp[-1].minor.yy526 = yylhsminor.yy526; break; case 98: /* db_optr ::= db_optr minrows */ -{ yylhsminor.yy94 = yymsp[-1].minor.yy94; yylhsminor.yy94.minRowsPerBlock = strtod(yymsp[0].minor.yy0.z, NULL); } - yymsp[-1].minor.yy94 = yylhsminor.yy94; +{ yylhsminor.yy526 = yymsp[-1].minor.yy526; yylhsminor.yy526.minRowsPerBlock = strtod(yymsp[0].minor.yy0.z, NULL); } + yymsp[-1].minor.yy526 = yylhsminor.yy526; break; case 99: /* db_optr ::= db_optr maxrows */ -{ yylhsminor.yy94 = yymsp[-1].minor.yy94; yylhsminor.yy94.maxRowsPerBlock = strtod(yymsp[0].minor.yy0.z, NULL); } - yymsp[-1].minor.yy94 = yylhsminor.yy94; +{ yylhsminor.yy526 = yymsp[-1].minor.yy526; yylhsminor.yy526.maxRowsPerBlock = strtod(yymsp[0].minor.yy0.z, NULL); } + yymsp[-1].minor.yy526 = yylhsminor.yy526; break; case 100: /* db_optr ::= db_optr blocks */ case 115: /* alter_db_optr ::= alter_db_optr blocks */ yytestcase(yyruleno==115); -{ yylhsminor.yy94 = yymsp[-1].minor.yy94; yylhsminor.yy94.numOfBlocks = strtol(yymsp[0].minor.yy0.z, NULL, 10); } - yymsp[-1].minor.yy94 = yylhsminor.yy94; +{ yylhsminor.yy526 = yymsp[-1].minor.yy526; yylhsminor.yy526.numOfBlocks = strtol(yymsp[0].minor.yy0.z, NULL, 10); } + yymsp[-1].minor.yy526 = yylhsminor.yy526; break; case 101: /* db_optr ::= db_optr ctime */ -{ yylhsminor.yy94 = yymsp[-1].minor.yy94; yylhsminor.yy94.commitTime = strtol(yymsp[0].minor.yy0.z, NULL, 10); } - yymsp[-1].minor.yy94 = yylhsminor.yy94; +{ yylhsminor.yy526 = yymsp[-1].minor.yy526; yylhsminor.yy526.commitTime = strtol(yymsp[0].minor.yy0.z, NULL, 10); } + yymsp[-1].minor.yy526 = yylhsminor.yy526; break; case 102: /* db_optr ::= db_optr wal */ case 117: /* alter_db_optr ::= alter_db_optr wal */ yytestcase(yyruleno==117); -{ yylhsminor.yy94 = yymsp[-1].minor.yy94; yylhsminor.yy94.walLevel = strtol(yymsp[0].minor.yy0.z, NULL, 10); } - yymsp[-1].minor.yy94 = yylhsminor.yy94; +{ yylhsminor.yy526 = yymsp[-1].minor.yy526; yylhsminor.yy526.walLevel = strtol(yymsp[0].minor.yy0.z, NULL, 10); } + yymsp[-1].minor.yy526 = yylhsminor.yy526; break; case 103: /* db_optr ::= db_optr fsync */ case 118: /* alter_db_optr ::= alter_db_optr fsync */ yytestcase(yyruleno==118); -{ yylhsminor.yy94 = yymsp[-1].minor.yy94; yylhsminor.yy94.fsyncPeriod = strtol(yymsp[0].minor.yy0.z, NULL, 10); } - yymsp[-1].minor.yy94 = yylhsminor.yy94; +{ yylhsminor.yy526 = yymsp[-1].minor.yy526; yylhsminor.yy526.fsyncPeriod = strtol(yymsp[0].minor.yy0.z, NULL, 10); } + yymsp[-1].minor.yy526 = yylhsminor.yy526; break; case 104: /* db_optr ::= db_optr comp */ case 116: /* alter_db_optr ::= alter_db_optr comp */ yytestcase(yyruleno==116); -{ yylhsminor.yy94 = yymsp[-1].minor.yy94; yylhsminor.yy94.compressionLevel = strtol(yymsp[0].minor.yy0.z, NULL, 10); } - yymsp[-1].minor.yy94 = yylhsminor.yy94; +{ yylhsminor.yy526 = yymsp[-1].minor.yy526; yylhsminor.yy526.compressionLevel = strtol(yymsp[0].minor.yy0.z, NULL, 10); } + yymsp[-1].minor.yy526 = yylhsminor.yy526; break; case 105: /* db_optr ::= db_optr prec */ -{ yylhsminor.yy94 = yymsp[-1].minor.yy94; yylhsminor.yy94.precision = yymsp[0].minor.yy0; } - yymsp[-1].minor.yy94 = yylhsminor.yy94; +{ yylhsminor.yy526 = yymsp[-1].minor.yy526; yylhsminor.yy526.precision = yymsp[0].minor.yy0; } + yymsp[-1].minor.yy526 = yylhsminor.yy526; break; case 106: /* db_optr ::= db_optr keep */ case 114: /* alter_db_optr ::= alter_db_optr keep */ yytestcase(yyruleno==114); -{ yylhsminor.yy94 = yymsp[-1].minor.yy94; yylhsminor.yy94.keep = yymsp[0].minor.yy429; } - yymsp[-1].minor.yy94 = yylhsminor.yy94; +{ yylhsminor.yy526 = yymsp[-1].minor.yy526; yylhsminor.yy526.keep = yymsp[0].minor.yy285; } + yymsp[-1].minor.yy526 = yylhsminor.yy526; break; case 107: /* db_optr ::= db_optr update */ case 119: /* alter_db_optr ::= alter_db_optr update */ yytestcase(yyruleno==119); -{ yylhsminor.yy94 = yymsp[-1].minor.yy94; yylhsminor.yy94.update = strtol(yymsp[0].minor.yy0.z, NULL, 10); } - yymsp[-1].minor.yy94 = yylhsminor.yy94; +{ yylhsminor.yy526 = yymsp[-1].minor.yy526; yylhsminor.yy526.update = strtol(yymsp[0].minor.yy0.z, NULL, 10); } + yymsp[-1].minor.yy526 = yylhsminor.yy526; break; case 108: /* db_optr ::= db_optr cachelast */ case 120: /* alter_db_optr ::= alter_db_optr cachelast */ yytestcase(yyruleno==120); -{ yylhsminor.yy94 = yymsp[-1].minor.yy94; yylhsminor.yy94.cachelast = strtol(yymsp[0].minor.yy0.z, NULL, 10); } - yymsp[-1].minor.yy94 = yylhsminor.yy94; +{ yylhsminor.yy526 = yymsp[-1].minor.yy526; yylhsminor.yy526.cachelast = strtol(yymsp[0].minor.yy0.z, NULL, 10); } + yymsp[-1].minor.yy526 = yylhsminor.yy526; break; case 109: /* topic_optr ::= db_optr */ case 121: /* alter_topic_optr ::= alter_db_optr */ yytestcase(yyruleno==121); -{ yylhsminor.yy94 = yymsp[0].minor.yy94; yylhsminor.yy94.dbType = TSDB_DB_TYPE_TOPIC; } - yymsp[0].minor.yy94 = yylhsminor.yy94; +{ yylhsminor.yy526 = yymsp[0].minor.yy526; yylhsminor.yy526.dbType = TSDB_DB_TYPE_TOPIC; } + yymsp[0].minor.yy526 = yylhsminor.yy526; break; case 110: /* topic_optr ::= topic_optr partitions */ case 122: /* alter_topic_optr ::= alter_topic_optr partitions */ yytestcase(yyruleno==122); -{ yylhsminor.yy94 = yymsp[-1].minor.yy94; yylhsminor.yy94.partitions = strtol(yymsp[0].minor.yy0.z, NULL, 10); } - yymsp[-1].minor.yy94 = yylhsminor.yy94; +{ yylhsminor.yy526 = yymsp[-1].minor.yy526; yylhsminor.yy526.partitions = strtol(yymsp[0].minor.yy0.z, NULL, 10); } + yymsp[-1].minor.yy526 = yylhsminor.yy526; break; case 111: /* alter_db_optr ::= */ -{ setDefaultCreateDbOption(&yymsp[1].minor.yy94); yymsp[1].minor.yy94.dbType = TSDB_DB_TYPE_DEFAULT;} +{ setDefaultCreateDbOption(&yymsp[1].minor.yy526); yymsp[1].minor.yy526.dbType = TSDB_DB_TYPE_DEFAULT;} break; case 123: /* typename ::= ids */ { yymsp[0].minor.yy0.type = 0; - tSqlSetColumnType (&yylhsminor.yy451, &yymsp[0].minor.yy0); + tSqlSetColumnType (&yylhsminor.yy295, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy451 = yylhsminor.yy451; + yymsp[0].minor.yy295 = yylhsminor.yy295; break; case 124: /* typename ::= ids LP signed RP */ { - if (yymsp[-1].minor.yy481 <= 0) { + if (yymsp[-1].minor.yy525 <= 0) { yymsp[-3].minor.yy0.type = 0; - tSqlSetColumnType(&yylhsminor.yy451, &yymsp[-3].minor.yy0); + tSqlSetColumnType(&yylhsminor.yy295, &yymsp[-3].minor.yy0); } else { - yymsp[-3].minor.yy0.type = -yymsp[-1].minor.yy481; // negative value of name length - tSqlSetColumnType(&yylhsminor.yy451, &yymsp[-3].minor.yy0); + yymsp[-3].minor.yy0.type = -yymsp[-1].minor.yy525; // negative value of name length + tSqlSetColumnType(&yylhsminor.yy295, &yymsp[-3].minor.yy0); } } - yymsp[-3].minor.yy451 = yylhsminor.yy451; + yymsp[-3].minor.yy295 = yylhsminor.yy295; break; case 125: /* typename ::= ids UNSIGNED */ { yymsp[-1].minor.yy0.type = 0; yymsp[-1].minor.yy0.n = ((yymsp[0].minor.yy0.z + yymsp[0].minor.yy0.n) - yymsp[-1].minor.yy0.z); - tSqlSetColumnType (&yylhsminor.yy451, &yymsp[-1].minor.yy0); + tSqlSetColumnType (&yylhsminor.yy295, &yymsp[-1].minor.yy0); } - yymsp[-1].minor.yy451 = yylhsminor.yy451; + yymsp[-1].minor.yy295 = yylhsminor.yy295; break; case 126: /* signed ::= INTEGER */ -{ yylhsminor.yy481 = strtol(yymsp[0].minor.yy0.z, NULL, 10); } - yymsp[0].minor.yy481 = yylhsminor.yy481; +{ yylhsminor.yy525 = strtol(yymsp[0].minor.yy0.z, NULL, 10); } + yymsp[0].minor.yy525 = yylhsminor.yy525; break; case 127: /* signed ::= PLUS INTEGER */ -{ yymsp[-1].minor.yy481 = strtol(yymsp[0].minor.yy0.z, NULL, 10); } +{ yymsp[-1].minor.yy525 = strtol(yymsp[0].minor.yy0.z, NULL, 10); } break; case 128: /* signed ::= MINUS INTEGER */ -{ yymsp[-1].minor.yy481 = -strtol(yymsp[0].minor.yy0.z, NULL, 10);} +{ yymsp[-1].minor.yy525 = -strtol(yymsp[0].minor.yy0.z, NULL, 10);} break; case 132: /* cmd ::= CREATE TABLE create_table_list */ -{ pInfo->type = TSDB_SQL_CREATE_TABLE; pInfo->pCreateTableInfo = yymsp[0].minor.yy310;} +{ pInfo->type = TSDB_SQL_CREATE_TABLE; pInfo->pCreateTableInfo = yymsp[0].minor.yy230;} break; case 133: /* create_table_list ::= create_from_stable */ { SCreateTableSQL* pCreateTable = calloc(1, sizeof(SCreateTableSQL)); pCreateTable->childTableInfo = taosArrayInit(4, sizeof(SCreatedTableInfo)); - taosArrayPush(pCreateTable->childTableInfo, &yymsp[0].minor.yy252); + taosArrayPush(pCreateTable->childTableInfo, &yymsp[0].minor.yy96); pCreateTable->type = TSQL_CREATE_TABLE_FROM_STABLE; - yylhsminor.yy310 = pCreateTable; + yylhsminor.yy230 = pCreateTable; } - yymsp[0].minor.yy310 = yylhsminor.yy310; + yymsp[0].minor.yy230 = yylhsminor.yy230; break; case 134: /* create_table_list ::= create_table_list create_from_stable */ { - taosArrayPush(yymsp[-1].minor.yy310->childTableInfo, &yymsp[0].minor.yy252); - yylhsminor.yy310 = yymsp[-1].minor.yy310; + taosArrayPush(yymsp[-1].minor.yy230->childTableInfo, &yymsp[0].minor.yy96); + yylhsminor.yy230 = yymsp[-1].minor.yy230; } - yymsp[-1].minor.yy310 = yylhsminor.yy310; + yymsp[-1].minor.yy230 = yylhsminor.yy230; break; case 135: /* create_table_args ::= ifnotexists ids cpxName LP columnlist RP */ { - yylhsminor.yy310 = tSetCreateSqlElems(yymsp[-1].minor.yy429, NULL, NULL, TSQL_CREATE_TABLE); - setSqlInfo(pInfo, yylhsminor.yy310, NULL, TSDB_SQL_CREATE_TABLE); + yylhsminor.yy230 = tSetCreateSqlElems(yymsp[-1].minor.yy285, NULL, NULL, TSQL_CREATE_TABLE); + setSqlInfo(pInfo, yylhsminor.yy230, NULL, TSDB_SQL_CREATE_TABLE); yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n; setCreatedTableName(pInfo, &yymsp[-4].minor.yy0, &yymsp[-5].minor.yy0); } - yymsp[-5].minor.yy310 = yylhsminor.yy310; + yymsp[-5].minor.yy230 = yylhsminor.yy230; break; case 136: /* create_stable_args ::= ifnotexists ids cpxName LP columnlist RP TAGS LP columnlist RP */ { - yylhsminor.yy310 = tSetCreateSqlElems(yymsp[-5].minor.yy429, yymsp[-1].minor.yy429, NULL, TSQL_CREATE_STABLE); - setSqlInfo(pInfo, yylhsminor.yy310, NULL, TSDB_SQL_CREATE_TABLE); + yylhsminor.yy230 = tSetCreateSqlElems(yymsp[-5].minor.yy285, yymsp[-1].minor.yy285, NULL, TSQL_CREATE_STABLE); + setSqlInfo(pInfo, yylhsminor.yy230, NULL, TSDB_SQL_CREATE_TABLE); yymsp[-8].minor.yy0.n += yymsp[-7].minor.yy0.n; setCreatedTableName(pInfo, &yymsp[-8].minor.yy0, &yymsp[-9].minor.yy0); } - yymsp[-9].minor.yy310 = yylhsminor.yy310; + yymsp[-9].minor.yy230 = yylhsminor.yy230; break; case 137: /* create_from_stable ::= ifnotexists ids cpxName USING ids cpxName TAGS LP tagitemlist RP */ { yymsp[-5].minor.yy0.n += yymsp[-4].minor.yy0.n; yymsp[-8].minor.yy0.n += yymsp[-7].minor.yy0.n; - yylhsminor.yy252 = createNewChildTableInfo(&yymsp[-5].minor.yy0, NULL, yymsp[-1].minor.yy429, &yymsp[-8].minor.yy0, &yymsp[-9].minor.yy0); + yylhsminor.yy96 = createNewChildTableInfo(&yymsp[-5].minor.yy0, NULL, yymsp[-1].minor.yy285, &yymsp[-8].minor.yy0, &yymsp[-9].minor.yy0); } - yymsp[-9].minor.yy252 = yylhsminor.yy252; + yymsp[-9].minor.yy96 = yylhsminor.yy96; break; case 138: /* create_from_stable ::= ifnotexists ids cpxName USING ids cpxName LP tagNamelist RP TAGS LP tagitemlist RP */ { yymsp[-8].minor.yy0.n += yymsp[-7].minor.yy0.n; yymsp[-11].minor.yy0.n += yymsp[-10].minor.yy0.n; - yylhsminor.yy252 = createNewChildTableInfo(&yymsp[-8].minor.yy0, yymsp[-5].minor.yy429, yymsp[-1].minor.yy429, &yymsp[-11].minor.yy0, &yymsp[-12].minor.yy0); + yylhsminor.yy96 = createNewChildTableInfo(&yymsp[-8].minor.yy0, yymsp[-5].minor.yy285, yymsp[-1].minor.yy285, &yymsp[-11].minor.yy0, &yymsp[-12].minor.yy0); } - yymsp[-12].minor.yy252 = yylhsminor.yy252; + yymsp[-12].minor.yy96 = yylhsminor.yy96; break; case 139: /* tagNamelist ::= tagNamelist COMMA ids */ -{taosArrayPush(yymsp[-2].minor.yy429, &yymsp[0].minor.yy0); yylhsminor.yy429 = yymsp[-2].minor.yy429; } - yymsp[-2].minor.yy429 = yylhsminor.yy429; +{taosArrayPush(yymsp[-2].minor.yy285, &yymsp[0].minor.yy0); yylhsminor.yy285 = yymsp[-2].minor.yy285; } + yymsp[-2].minor.yy285 = yylhsminor.yy285; break; case 140: /* tagNamelist ::= ids */ -{yylhsminor.yy429 = taosArrayInit(4, sizeof(SStrToken)); taosArrayPush(yylhsminor.yy429, &yymsp[0].minor.yy0);} - yymsp[0].minor.yy429 = yylhsminor.yy429; +{yylhsminor.yy285 = taosArrayInit(4, sizeof(SStrToken)); taosArrayPush(yylhsminor.yy285, &yymsp[0].minor.yy0);} + yymsp[0].minor.yy285 = yylhsminor.yy285; break; case 141: /* create_table_args ::= ifnotexists ids cpxName AS select */ { - yylhsminor.yy310 = tSetCreateSqlElems(NULL, NULL, yymsp[0].minor.yy372, TSQL_CREATE_STREAM); - setSqlInfo(pInfo, yylhsminor.yy310, NULL, TSDB_SQL_CREATE_TABLE); + yylhsminor.yy230 = tSetCreateSqlElems(NULL, NULL, yymsp[0].minor.yy216, TSQL_CREATE_STREAM); + setSqlInfo(pInfo, yylhsminor.yy230, NULL, TSDB_SQL_CREATE_TABLE); yymsp[-3].minor.yy0.n += yymsp[-2].minor.yy0.n; setCreatedTableName(pInfo, &yymsp[-3].minor.yy0, &yymsp[-4].minor.yy0); } - yymsp[-4].minor.yy310 = yylhsminor.yy310; + yymsp[-4].minor.yy230 = yylhsminor.yy230; break; case 142: /* columnlist ::= columnlist COMMA column */ -{taosArrayPush(yymsp[-2].minor.yy429, &yymsp[0].minor.yy451); yylhsminor.yy429 = yymsp[-2].minor.yy429; } - yymsp[-2].minor.yy429 = yylhsminor.yy429; +{taosArrayPush(yymsp[-2].minor.yy285, &yymsp[0].minor.yy295); yylhsminor.yy285 = yymsp[-2].minor.yy285; } + yymsp[-2].minor.yy285 = yylhsminor.yy285; break; case 143: /* columnlist ::= column */ -{yylhsminor.yy429 = taosArrayInit(4, sizeof(TAOS_FIELD)); taosArrayPush(yylhsminor.yy429, &yymsp[0].minor.yy451);} - yymsp[0].minor.yy429 = yylhsminor.yy429; +{yylhsminor.yy285 = taosArrayInit(4, sizeof(TAOS_FIELD)); taosArrayPush(yylhsminor.yy285, &yymsp[0].minor.yy295);} + yymsp[0].minor.yy285 = yylhsminor.yy285; break; case 144: /* column ::= ids typename */ { - tSqlSetColumnInfo(&yylhsminor.yy451, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy451); + tSqlSetColumnInfo(&yylhsminor.yy295, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy295); } - yymsp[-1].minor.yy451 = yylhsminor.yy451; + yymsp[-1].minor.yy295 = yylhsminor.yy295; break; case 145: /* tagitemlist ::= tagitemlist COMMA tagitem */ -{ yylhsminor.yy429 = tVariantListAppend(yymsp[-2].minor.yy429, &yymsp[0].minor.yy218, -1); } - yymsp[-2].minor.yy429 = yylhsminor.yy429; +{ yylhsminor.yy285 = tVariantListAppend(yymsp[-2].minor.yy285, &yymsp[0].minor.yy362, -1); } + yymsp[-2].minor.yy285 = yylhsminor.yy285; break; case 146: /* tagitemlist ::= tagitem */ -{ yylhsminor.yy429 = tVariantListAppend(NULL, &yymsp[0].minor.yy218, -1); } - yymsp[0].minor.yy429 = yylhsminor.yy429; +{ yylhsminor.yy285 = tVariantListAppend(NULL, &yymsp[0].minor.yy362, -1); } + yymsp[0].minor.yy285 = yylhsminor.yy285; break; case 147: /* tagitem ::= INTEGER */ case 148: /* tagitem ::= FLOAT */ yytestcase(yyruleno==148); case 149: /* tagitem ::= STRING */ yytestcase(yyruleno==149); case 150: /* tagitem ::= BOOL */ yytestcase(yyruleno==150); -{ toTSDBType(yymsp[0].minor.yy0.type); tVariantCreate(&yylhsminor.yy218, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy218 = yylhsminor.yy218; +{ toTSDBType(yymsp[0].minor.yy0.type); tVariantCreate(&yylhsminor.yy362, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy362 = yylhsminor.yy362; break; case 151: /* tagitem ::= NULL */ -{ yymsp[0].minor.yy0.type = 0; tVariantCreate(&yylhsminor.yy218, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy218 = yylhsminor.yy218; +{ yymsp[0].minor.yy0.type = 0; tVariantCreate(&yylhsminor.yy362, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy362 = yylhsminor.yy362; break; case 152: /* tagitem ::= MINUS INTEGER */ case 153: /* tagitem ::= MINUS FLOAT */ yytestcase(yyruleno==153); @@ -2575,59 +2587,59 @@ static void yy_reduce( yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; yymsp[-1].minor.yy0.type = yymsp[0].minor.yy0.type; toTSDBType(yymsp[-1].minor.yy0.type); - tVariantCreate(&yylhsminor.yy218, &yymsp[-1].minor.yy0); + tVariantCreate(&yylhsminor.yy362, &yymsp[-1].minor.yy0); } - yymsp[-1].minor.yy218 = yylhsminor.yy218; + yymsp[-1].minor.yy362 = yylhsminor.yy362; break; - case 156: /* select ::= SELECT selcollist from where_opt interval_opt fill_opt sliding_opt groupby_opt orderby_opt having_opt slimit_opt limit_opt */ + case 156: /* select ::= SELECT selcollist from where_opt interval_opt session_option fill_opt sliding_opt groupby_opt orderby_opt having_opt slimit_opt limit_opt */ { - yylhsminor.yy372 = tSetQuerySqlElems(&yymsp[-11].minor.yy0, yymsp[-10].minor.yy170, yymsp[-9].minor.yy429, yymsp[-8].minor.yy282, yymsp[-4].minor.yy429, yymsp[-3].minor.yy429, &yymsp[-7].minor.yy220, &yymsp[-5].minor.yy0, yymsp[-6].minor.yy429, &yymsp[0].minor.yy18, &yymsp[-1].minor.yy18); + yylhsminor.yy216 = tSetQuerySqlNode(&yymsp[-12].minor.yy0, yymsp[-11].minor.yy434, yymsp[-10].minor.yy285, yymsp[-9].minor.yy178, yymsp[-4].minor.yy285, yymsp[-3].minor.yy285, &yymsp[-8].minor.yy376, &yymsp[-7].minor.yy523, &yymsp[-5].minor.yy0, yymsp[-6].minor.yy285, &yymsp[0].minor.yy438, &yymsp[-1].minor.yy438); } - yymsp[-11].minor.yy372 = yylhsminor.yy372; + yymsp[-12].minor.yy216 = yylhsminor.yy216; break; case 157: /* union ::= select */ -{ yylhsminor.yy141 = setSubclause(NULL, yymsp[0].minor.yy372); } - yymsp[0].minor.yy141 = yylhsminor.yy141; +{ yylhsminor.yy513 = setSubclause(NULL, yymsp[0].minor.yy216); } + yymsp[0].minor.yy513 = yylhsminor.yy513; break; case 158: /* union ::= LP union RP */ -{ yymsp[-2].minor.yy141 = yymsp[-1].minor.yy141; } +{ yymsp[-2].minor.yy513 = yymsp[-1].minor.yy513; } break; case 159: /* union ::= union UNION ALL select */ -{ yylhsminor.yy141 = appendSelectClause(yymsp[-3].minor.yy141, yymsp[0].minor.yy372); } - yymsp[-3].minor.yy141 = yylhsminor.yy141; +{ yylhsminor.yy513 = appendSelectClause(yymsp[-3].minor.yy513, yymsp[0].minor.yy216); } + yymsp[-3].minor.yy513 = yylhsminor.yy513; break; case 160: /* union ::= union UNION ALL LP select RP */ -{ yylhsminor.yy141 = appendSelectClause(yymsp[-5].minor.yy141, yymsp[-1].minor.yy372); } - yymsp[-5].minor.yy141 = yylhsminor.yy141; +{ yylhsminor.yy513 = appendSelectClause(yymsp[-5].minor.yy513, yymsp[-1].minor.yy216); } + yymsp[-5].minor.yy513 = yylhsminor.yy513; break; case 161: /* cmd ::= union */ -{ setSqlInfo(pInfo, yymsp[0].minor.yy141, NULL, TSDB_SQL_SELECT); } +{ setSqlInfo(pInfo, yymsp[0].minor.yy513, NULL, TSDB_SQL_SELECT); } break; case 162: /* select ::= SELECT selcollist */ { - yylhsminor.yy372 = tSetQuerySqlElems(&yymsp[-1].minor.yy0, yymsp[0].minor.yy170, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + yylhsminor.yy216 = tSetQuerySqlNode(&yymsp[-1].minor.yy0, yymsp[0].minor.yy434, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); } - yymsp[-1].minor.yy372 = yylhsminor.yy372; + yymsp[-1].minor.yy216 = yylhsminor.yy216; break; case 163: /* sclp ::= selcollist COMMA */ -{yylhsminor.yy170 = yymsp[-1].minor.yy170;} - yymsp[-1].minor.yy170 = yylhsminor.yy170; +{yylhsminor.yy434 = yymsp[-1].minor.yy434;} + yymsp[-1].minor.yy434 = yylhsminor.yy434; break; case 164: /* sclp ::= */ -{yymsp[1].minor.yy170 = 0;} +{yymsp[1].minor.yy434 = 0;} break; case 165: /* selcollist ::= sclp distinct expr as */ { - yylhsminor.yy170 = tSqlExprListAppend(yymsp[-3].minor.yy170, yymsp[-1].minor.yy282, yymsp[-2].minor.yy0.n? &yymsp[-2].minor.yy0:0, yymsp[0].minor.yy0.n?&yymsp[0].minor.yy0:0); + yylhsminor.yy434 = tSqlExprListAppend(yymsp[-3].minor.yy434, yymsp[-1].minor.yy178, yymsp[-2].minor.yy0.n? &yymsp[-2].minor.yy0:0, yymsp[0].minor.yy0.n?&yymsp[0].minor.yy0:0); } - yymsp[-3].minor.yy170 = yylhsminor.yy170; + yymsp[-3].minor.yy434 = yylhsminor.yy434; break; case 166: /* selcollist ::= sclp STAR */ { tSQLExpr *pNode = tSqlExprIdValueCreate(NULL, TK_ALL); - yylhsminor.yy170 = tSqlExprListAppend(yymsp[-1].minor.yy170, pNode, 0, 0); + yylhsminor.yy434 = tSqlExprListAppend(yymsp[-1].minor.yy434, pNode, 0, 0); } - yymsp[-1].minor.yy170 = yylhsminor.yy170; + yymsp[-1].minor.yy434 = yylhsminor.yy434; break; case 167: /* as ::= AS ids */ { yymsp[-1].minor.yy0 = yymsp[0].minor.yy0; } @@ -2644,320 +2656,330 @@ static void yy_reduce( yymsp[0].minor.yy0 = yylhsminor.yy0; break; case 172: /* from ::= FROM tablelist */ -{yymsp[-1].minor.yy429 = yymsp[0].minor.yy429;} +{yymsp[-1].minor.yy285 = yymsp[0].minor.yy285;} break; case 173: /* tablelist ::= ids cpxName */ { toTSDBType(yymsp[-1].minor.yy0.type); yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; - yylhsminor.yy429 = tVariantListAppendToken(NULL, &yymsp[-1].minor.yy0, -1); - yylhsminor.yy429 = tVariantListAppendToken(yylhsminor.yy429, &yymsp[-1].minor.yy0, -1); // table alias name + yylhsminor.yy285 = tVariantListAppendToken(NULL, &yymsp[-1].minor.yy0, -1); + yylhsminor.yy285 = tVariantListAppendToken(yylhsminor.yy285, &yymsp[-1].minor.yy0, -1); // table alias name } - yymsp[-1].minor.yy429 = yylhsminor.yy429; + yymsp[-1].minor.yy285 = yylhsminor.yy285; break; case 174: /* tablelist ::= ids cpxName ids */ { toTSDBType(yymsp[-2].minor.yy0.type); toTSDBType(yymsp[0].minor.yy0.type); yymsp[-2].minor.yy0.n += yymsp[-1].minor.yy0.n; - yylhsminor.yy429 = tVariantListAppendToken(NULL, &yymsp[-2].minor.yy0, -1); - yylhsminor.yy429 = tVariantListAppendToken(yylhsminor.yy429, &yymsp[0].minor.yy0, -1); + yylhsminor.yy285 = tVariantListAppendToken(NULL, &yymsp[-2].minor.yy0, -1); + yylhsminor.yy285 = tVariantListAppendToken(yylhsminor.yy285, &yymsp[0].minor.yy0, -1); } - yymsp[-2].minor.yy429 = yylhsminor.yy429; + yymsp[-2].minor.yy285 = yylhsminor.yy285; break; case 175: /* tablelist ::= tablelist COMMA ids cpxName */ { toTSDBType(yymsp[-1].minor.yy0.type); yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; - yylhsminor.yy429 = tVariantListAppendToken(yymsp[-3].minor.yy429, &yymsp[-1].minor.yy0, -1); - yylhsminor.yy429 = tVariantListAppendToken(yylhsminor.yy429, &yymsp[-1].minor.yy0, -1); + yylhsminor.yy285 = tVariantListAppendToken(yymsp[-3].minor.yy285, &yymsp[-1].minor.yy0, -1); + yylhsminor.yy285 = tVariantListAppendToken(yylhsminor.yy285, &yymsp[-1].minor.yy0, -1); } - yymsp[-3].minor.yy429 = yylhsminor.yy429; + yymsp[-3].minor.yy285 = yylhsminor.yy285; break; case 176: /* tablelist ::= tablelist COMMA ids cpxName ids */ { toTSDBType(yymsp[-2].minor.yy0.type); toTSDBType(yymsp[0].minor.yy0.type); yymsp[-2].minor.yy0.n += yymsp[-1].minor.yy0.n; - yylhsminor.yy429 = tVariantListAppendToken(yymsp[-4].minor.yy429, &yymsp[-2].minor.yy0, -1); - yylhsminor.yy429 = tVariantListAppendToken(yylhsminor.yy429, &yymsp[0].minor.yy0, -1); + yylhsminor.yy285 = tVariantListAppendToken(yymsp[-4].minor.yy285, &yymsp[-2].minor.yy0, -1); + yylhsminor.yy285 = tVariantListAppendToken(yylhsminor.yy285, &yymsp[0].minor.yy0, -1); } - yymsp[-4].minor.yy429 = yylhsminor.yy429; + yymsp[-4].minor.yy285 = yylhsminor.yy285; break; case 177: /* tmvar ::= VARIABLE */ {yylhsminor.yy0 = yymsp[0].minor.yy0;} yymsp[0].minor.yy0 = yylhsminor.yy0; break; case 178: /* interval_opt ::= INTERVAL LP tmvar RP */ -{yymsp[-3].minor.yy220.interval = yymsp[-1].minor.yy0; yymsp[-3].minor.yy220.offset.n = 0; yymsp[-3].minor.yy220.offset.z = NULL; yymsp[-3].minor.yy220.offset.type = 0;} +{yymsp[-3].minor.yy376.interval = yymsp[-1].minor.yy0; yymsp[-3].minor.yy376.offset.n = 0;} break; case 179: /* interval_opt ::= INTERVAL LP tmvar COMMA tmvar RP */ -{yymsp[-5].minor.yy220.interval = yymsp[-3].minor.yy0; yymsp[-5].minor.yy220.offset = yymsp[-1].minor.yy0;} +{yymsp[-5].minor.yy376.interval = yymsp[-3].minor.yy0; yymsp[-5].minor.yy376.offset = yymsp[-1].minor.yy0;} break; case 180: /* interval_opt ::= */ -{memset(&yymsp[1].minor.yy220, 0, sizeof(yymsp[1].minor.yy220));} +{memset(&yymsp[1].minor.yy376, 0, sizeof(yymsp[1].minor.yy376));} break; - case 181: /* fill_opt ::= */ -{yymsp[1].minor.yy429 = 0; } + case 181: /* session_option ::= */ +{yymsp[1].minor.yy523.col.n = 0; yymsp[1].minor.yy523.gap.n = 0;} break; - case 182: /* fill_opt ::= FILL LP ID COMMA tagitemlist RP */ + case 182: /* session_option ::= SESSION LP ids cpxName COMMA tmvar RP */ +{ + yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n; + yymsp[-6].minor.yy523.col = yymsp[-4].minor.yy0; + yymsp[-6].minor.yy523.gap = yymsp[-1].minor.yy0; +} + break; + case 183: /* fill_opt ::= */ +{ yymsp[1].minor.yy285 = 0; } + break; + case 184: /* fill_opt ::= FILL LP ID COMMA tagitemlist RP */ { tVariant A = {0}; toTSDBType(yymsp[-3].minor.yy0.type); tVariantCreate(&A, &yymsp[-3].minor.yy0); - tVariantListInsert(yymsp[-1].minor.yy429, &A, -1, 0); - yymsp[-5].minor.yy429 = yymsp[-1].minor.yy429; + tVariantListInsert(yymsp[-1].minor.yy285, &A, -1, 0); + yymsp[-5].minor.yy285 = yymsp[-1].minor.yy285; } break; - case 183: /* fill_opt ::= FILL LP ID RP */ + case 185: /* fill_opt ::= FILL LP ID RP */ { toTSDBType(yymsp[-1].minor.yy0.type); - yymsp[-3].minor.yy429 = tVariantListAppendToken(NULL, &yymsp[-1].minor.yy0, -1); + yymsp[-3].minor.yy285 = tVariantListAppendToken(NULL, &yymsp[-1].minor.yy0, -1); } break; - case 184: /* sliding_opt ::= SLIDING LP tmvar RP */ + case 186: /* sliding_opt ::= SLIDING LP tmvar RP */ {yymsp[-3].minor.yy0 = yymsp[-1].minor.yy0; } break; - case 185: /* sliding_opt ::= */ + case 187: /* sliding_opt ::= */ {yymsp[1].minor.yy0.n = 0; yymsp[1].minor.yy0.z = NULL; yymsp[1].minor.yy0.type = 0; } break; - case 186: /* orderby_opt ::= */ -{yymsp[1].minor.yy429 = 0;} + case 188: /* orderby_opt ::= */ +{yymsp[1].minor.yy285 = 0;} break; - case 187: /* orderby_opt ::= ORDER BY sortlist */ -{yymsp[-2].minor.yy429 = yymsp[0].minor.yy429;} + case 189: /* orderby_opt ::= ORDER BY sortlist */ +{yymsp[-2].minor.yy285 = yymsp[0].minor.yy285;} break; - case 188: /* sortlist ::= sortlist COMMA item sortorder */ + case 190: /* sortlist ::= sortlist COMMA item sortorder */ { - yylhsminor.yy429 = tVariantListAppend(yymsp[-3].minor.yy429, &yymsp[-1].minor.yy218, yymsp[0].minor.yy116); + yylhsminor.yy285 = tVariantListAppend(yymsp[-3].minor.yy285, &yymsp[-1].minor.yy362, yymsp[0].minor.yy460); } - yymsp[-3].minor.yy429 = yylhsminor.yy429; + yymsp[-3].minor.yy285 = yylhsminor.yy285; break; - case 189: /* sortlist ::= item sortorder */ + case 191: /* sortlist ::= item sortorder */ { - yylhsminor.yy429 = tVariantListAppend(NULL, &yymsp[-1].minor.yy218, yymsp[0].minor.yy116); + yylhsminor.yy285 = tVariantListAppend(NULL, &yymsp[-1].minor.yy362, yymsp[0].minor.yy460); } - yymsp[-1].minor.yy429 = yylhsminor.yy429; + yymsp[-1].minor.yy285 = yylhsminor.yy285; break; - case 190: /* item ::= ids cpxName */ + case 192: /* item ::= ids cpxName */ { toTSDBType(yymsp[-1].minor.yy0.type); yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; - tVariantCreate(&yylhsminor.yy218, &yymsp[-1].minor.yy0); + tVariantCreate(&yylhsminor.yy362, &yymsp[-1].minor.yy0); } - yymsp[-1].minor.yy218 = yylhsminor.yy218; + yymsp[-1].minor.yy362 = yylhsminor.yy362; break; - case 191: /* sortorder ::= ASC */ -{ yymsp[0].minor.yy116 = TSDB_ORDER_ASC; } + case 193: /* sortorder ::= ASC */ +{ yymsp[0].minor.yy460 = TSDB_ORDER_ASC; } break; - case 192: /* sortorder ::= DESC */ -{ yymsp[0].minor.yy116 = TSDB_ORDER_DESC;} + case 194: /* sortorder ::= DESC */ +{ yymsp[0].minor.yy460 = TSDB_ORDER_DESC;} break; - case 193: /* sortorder ::= */ -{ yymsp[1].minor.yy116 = TSDB_ORDER_ASC; } + case 195: /* sortorder ::= */ +{ yymsp[1].minor.yy460 = TSDB_ORDER_ASC; } break; - case 194: /* groupby_opt ::= */ -{ yymsp[1].minor.yy429 = 0;} + case 196: /* groupby_opt ::= */ +{ yymsp[1].minor.yy285 = 0;} break; - case 195: /* groupby_opt ::= GROUP BY grouplist */ -{ yymsp[-2].minor.yy429 = yymsp[0].minor.yy429;} + case 197: /* groupby_opt ::= GROUP BY grouplist */ +{ yymsp[-2].minor.yy285 = yymsp[0].minor.yy285;} break; - case 196: /* grouplist ::= grouplist COMMA item */ + case 198: /* grouplist ::= grouplist COMMA item */ { - yylhsminor.yy429 = tVariantListAppend(yymsp[-2].minor.yy429, &yymsp[0].minor.yy218, -1); + yylhsminor.yy285 = tVariantListAppend(yymsp[-2].minor.yy285, &yymsp[0].minor.yy362, -1); } - yymsp[-2].minor.yy429 = yylhsminor.yy429; + yymsp[-2].minor.yy285 = yylhsminor.yy285; break; - case 197: /* grouplist ::= item */ + case 199: /* grouplist ::= item */ { - yylhsminor.yy429 = tVariantListAppend(NULL, &yymsp[0].minor.yy218, -1); + yylhsminor.yy285 = tVariantListAppend(NULL, &yymsp[0].minor.yy362, -1); } - yymsp[0].minor.yy429 = yylhsminor.yy429; + yymsp[0].minor.yy285 = yylhsminor.yy285; break; - case 198: /* having_opt ::= */ - case 208: /* where_opt ::= */ yytestcase(yyruleno==208); - case 247: /* expritem ::= */ yytestcase(yyruleno==247); -{yymsp[1].minor.yy282 = 0;} + case 200: /* having_opt ::= */ + case 210: /* where_opt ::= */ yytestcase(yyruleno==210); + case 249: /* expritem ::= */ yytestcase(yyruleno==249); +{yymsp[1].minor.yy178 = 0;} break; - case 199: /* having_opt ::= HAVING expr */ - case 209: /* where_opt ::= WHERE expr */ yytestcase(yyruleno==209); -{yymsp[-1].minor.yy282 = yymsp[0].minor.yy282;} + case 201: /* having_opt ::= HAVING expr */ + case 211: /* where_opt ::= WHERE expr */ yytestcase(yyruleno==211); +{yymsp[-1].minor.yy178 = yymsp[0].minor.yy178;} break; - case 200: /* limit_opt ::= */ - case 204: /* slimit_opt ::= */ yytestcase(yyruleno==204); -{yymsp[1].minor.yy18.limit = -1; yymsp[1].minor.yy18.offset = 0;} + case 202: /* limit_opt ::= */ + case 206: /* slimit_opt ::= */ yytestcase(yyruleno==206); +{yymsp[1].minor.yy438.limit = -1; yymsp[1].minor.yy438.offset = 0;} break; - case 201: /* limit_opt ::= LIMIT signed */ - case 205: /* slimit_opt ::= SLIMIT signed */ yytestcase(yyruleno==205); -{yymsp[-1].minor.yy18.limit = yymsp[0].minor.yy481; yymsp[-1].minor.yy18.offset = 0;} + case 203: /* limit_opt ::= LIMIT signed */ + case 207: /* slimit_opt ::= SLIMIT signed */ yytestcase(yyruleno==207); +{yymsp[-1].minor.yy438.limit = yymsp[0].minor.yy525; yymsp[-1].minor.yy438.offset = 0;} break; - case 202: /* limit_opt ::= LIMIT signed OFFSET signed */ -{ yymsp[-3].minor.yy18.limit = yymsp[-2].minor.yy481; yymsp[-3].minor.yy18.offset = yymsp[0].minor.yy481;} + case 204: /* limit_opt ::= LIMIT signed OFFSET signed */ +{ yymsp[-3].minor.yy438.limit = yymsp[-2].minor.yy525; yymsp[-3].minor.yy438.offset = yymsp[0].minor.yy525;} break; - case 203: /* limit_opt ::= LIMIT signed COMMA signed */ -{ yymsp[-3].minor.yy18.limit = yymsp[0].minor.yy481; yymsp[-3].minor.yy18.offset = yymsp[-2].minor.yy481;} + case 205: /* limit_opt ::= LIMIT signed COMMA signed */ +{ yymsp[-3].minor.yy438.limit = yymsp[0].minor.yy525; yymsp[-3].minor.yy438.offset = yymsp[-2].minor.yy525;} break; - case 206: /* slimit_opt ::= SLIMIT signed SOFFSET signed */ -{yymsp[-3].minor.yy18.limit = yymsp[-2].minor.yy481; yymsp[-3].minor.yy18.offset = yymsp[0].minor.yy481;} + case 208: /* slimit_opt ::= SLIMIT signed SOFFSET signed */ +{yymsp[-3].minor.yy438.limit = yymsp[-2].minor.yy525; yymsp[-3].minor.yy438.offset = yymsp[0].minor.yy525;} break; - case 207: /* slimit_opt ::= SLIMIT signed COMMA signed */ -{yymsp[-3].minor.yy18.limit = yymsp[0].minor.yy481; yymsp[-3].minor.yy18.offset = yymsp[-2].minor.yy481;} + case 209: /* slimit_opt ::= SLIMIT signed COMMA signed */ +{yymsp[-3].minor.yy438.limit = yymsp[0].minor.yy525; yymsp[-3].minor.yy438.offset = yymsp[-2].minor.yy525;} break; - case 210: /* expr ::= LP expr RP */ -{yylhsminor.yy282 = yymsp[-1].minor.yy282; yylhsminor.yy282->token.z = yymsp[-2].minor.yy0.z; yylhsminor.yy282->token.n = (yymsp[0].minor.yy0.z - yymsp[-2].minor.yy0.z + 1);} - yymsp[-2].minor.yy282 = yylhsminor.yy282; + case 212: /* expr ::= LP expr RP */ +{yylhsminor.yy178 = yymsp[-1].minor.yy178; yylhsminor.yy178->token.z = yymsp[-2].minor.yy0.z; yylhsminor.yy178->token.n = (yymsp[0].minor.yy0.z - yymsp[-2].minor.yy0.z + 1);} + yymsp[-2].minor.yy178 = yylhsminor.yy178; break; - case 211: /* expr ::= ID */ -{ yylhsminor.yy282 = tSqlExprIdValueCreate(&yymsp[0].minor.yy0, TK_ID);} - yymsp[0].minor.yy282 = yylhsminor.yy282; + case 213: /* expr ::= ID */ +{ yylhsminor.yy178 = tSqlExprIdValueCreate(&yymsp[0].minor.yy0, TK_ID);} + yymsp[0].minor.yy178 = yylhsminor.yy178; break; - case 212: /* expr ::= ID DOT ID */ -{ yymsp[-2].minor.yy0.n += (1+yymsp[0].minor.yy0.n); yylhsminor.yy282 = tSqlExprIdValueCreate(&yymsp[-2].minor.yy0, TK_ID);} - yymsp[-2].minor.yy282 = yylhsminor.yy282; + case 214: /* expr ::= ID DOT ID */ +{ yymsp[-2].minor.yy0.n += (1+yymsp[0].minor.yy0.n); yylhsminor.yy178 = tSqlExprIdValueCreate(&yymsp[-2].minor.yy0, TK_ID);} + yymsp[-2].minor.yy178 = yylhsminor.yy178; break; - case 213: /* expr ::= ID DOT STAR */ -{ yymsp[-2].minor.yy0.n += (1+yymsp[0].minor.yy0.n); yylhsminor.yy282 = tSqlExprIdValueCreate(&yymsp[-2].minor.yy0, TK_ALL);} - yymsp[-2].minor.yy282 = yylhsminor.yy282; + case 215: /* expr ::= ID DOT STAR */ +{ yymsp[-2].minor.yy0.n += (1+yymsp[0].minor.yy0.n); yylhsminor.yy178 = tSqlExprIdValueCreate(&yymsp[-2].minor.yy0, TK_ALL);} + yymsp[-2].minor.yy178 = yylhsminor.yy178; break; - case 214: /* expr ::= INTEGER */ -{ yylhsminor.yy282 = tSqlExprIdValueCreate(&yymsp[0].minor.yy0, TK_INTEGER);} - yymsp[0].minor.yy282 = yylhsminor.yy282; + case 216: /* expr ::= INTEGER */ +{ yylhsminor.yy178 = tSqlExprIdValueCreate(&yymsp[0].minor.yy0, TK_INTEGER);} + yymsp[0].minor.yy178 = yylhsminor.yy178; break; - case 215: /* expr ::= MINUS INTEGER */ - case 216: /* expr ::= PLUS INTEGER */ yytestcase(yyruleno==216); -{ yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; yymsp[-1].minor.yy0.type = TK_INTEGER; yylhsminor.yy282 = tSqlExprIdValueCreate(&yymsp[-1].minor.yy0, TK_INTEGER);} - yymsp[-1].minor.yy282 = yylhsminor.yy282; + case 217: /* expr ::= MINUS INTEGER */ + case 218: /* expr ::= PLUS INTEGER */ yytestcase(yyruleno==218); +{ yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; yymsp[-1].minor.yy0.type = TK_INTEGER; yylhsminor.yy178 = tSqlExprIdValueCreate(&yymsp[-1].minor.yy0, TK_INTEGER);} + yymsp[-1].minor.yy178 = yylhsminor.yy178; break; - case 217: /* expr ::= FLOAT */ -{ yylhsminor.yy282 = tSqlExprIdValueCreate(&yymsp[0].minor.yy0, TK_FLOAT);} - yymsp[0].minor.yy282 = yylhsminor.yy282; + case 219: /* expr ::= FLOAT */ +{ yylhsminor.yy178 = tSqlExprIdValueCreate(&yymsp[0].minor.yy0, TK_FLOAT);} + yymsp[0].minor.yy178 = yylhsminor.yy178; break; - case 218: /* expr ::= MINUS FLOAT */ - case 219: /* expr ::= PLUS FLOAT */ yytestcase(yyruleno==219); -{ yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; yymsp[-1].minor.yy0.type = TK_FLOAT; yylhsminor.yy282 = tSqlExprIdValueCreate(&yymsp[-1].minor.yy0, TK_FLOAT);} - yymsp[-1].minor.yy282 = yylhsminor.yy282; + case 220: /* expr ::= MINUS FLOAT */ + case 221: /* expr ::= PLUS FLOAT */ yytestcase(yyruleno==221); +{ yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; yymsp[-1].minor.yy0.type = TK_FLOAT; yylhsminor.yy178 = tSqlExprIdValueCreate(&yymsp[-1].minor.yy0, TK_FLOAT);} + yymsp[-1].minor.yy178 = yylhsminor.yy178; break; - case 220: /* expr ::= STRING */ -{ yylhsminor.yy282 = tSqlExprIdValueCreate(&yymsp[0].minor.yy0, TK_STRING);} - yymsp[0].minor.yy282 = yylhsminor.yy282; + case 222: /* expr ::= STRING */ +{ yylhsminor.yy178 = tSqlExprIdValueCreate(&yymsp[0].minor.yy0, TK_STRING);} + yymsp[0].minor.yy178 = yylhsminor.yy178; break; - case 221: /* expr ::= NOW */ -{ yylhsminor.yy282 = tSqlExprIdValueCreate(&yymsp[0].minor.yy0, TK_NOW); } - yymsp[0].minor.yy282 = yylhsminor.yy282; + case 223: /* expr ::= NOW */ +{ yylhsminor.yy178 = tSqlExprIdValueCreate(&yymsp[0].minor.yy0, TK_NOW); } + yymsp[0].minor.yy178 = yylhsminor.yy178; break; - case 222: /* expr ::= VARIABLE */ -{ yylhsminor.yy282 = tSqlExprIdValueCreate(&yymsp[0].minor.yy0, TK_VARIABLE);} - yymsp[0].minor.yy282 = yylhsminor.yy282; + case 224: /* expr ::= VARIABLE */ +{ yylhsminor.yy178 = tSqlExprIdValueCreate(&yymsp[0].minor.yy0, TK_VARIABLE);} + yymsp[0].minor.yy178 = yylhsminor.yy178; break; - case 223: /* expr ::= BOOL */ -{ yylhsminor.yy282 = tSqlExprIdValueCreate(&yymsp[0].minor.yy0, TK_BOOL);} - yymsp[0].minor.yy282 = yylhsminor.yy282; + case 225: /* expr ::= BOOL */ +{ yylhsminor.yy178 = tSqlExprIdValueCreate(&yymsp[0].minor.yy0, TK_BOOL);} + yymsp[0].minor.yy178 = yylhsminor.yy178; break; - case 224: /* expr ::= ID LP exprlist RP */ -{ yylhsminor.yy282 = tSqlExprCreateFunction(yymsp[-1].minor.yy170, &yymsp[-3].minor.yy0, &yymsp[0].minor.yy0, yymsp[-3].minor.yy0.type); } - yymsp[-3].minor.yy282 = yylhsminor.yy282; + case 226: /* expr ::= ID LP exprlist RP */ +{ yylhsminor.yy178 = tSqlExprCreateFunction(yymsp[-1].minor.yy434, &yymsp[-3].minor.yy0, &yymsp[0].minor.yy0, yymsp[-3].minor.yy0.type); } + yymsp[-3].minor.yy178 = yylhsminor.yy178; break; - case 225: /* expr ::= ID LP STAR RP */ -{ yylhsminor.yy282 = tSqlExprCreateFunction(NULL, &yymsp[-3].minor.yy0, &yymsp[0].minor.yy0, yymsp[-3].minor.yy0.type); } - yymsp[-3].minor.yy282 = yylhsminor.yy282; + case 227: /* expr ::= ID LP STAR RP */ +{ yylhsminor.yy178 = tSqlExprCreateFunction(NULL, &yymsp[-3].minor.yy0, &yymsp[0].minor.yy0, yymsp[-3].minor.yy0.type); } + yymsp[-3].minor.yy178 = yylhsminor.yy178; break; - case 226: /* expr ::= expr IS NULL */ -{yylhsminor.yy282 = tSqlExprCreate(yymsp[-2].minor.yy282, NULL, TK_ISNULL);} - yymsp[-2].minor.yy282 = yylhsminor.yy282; + case 228: /* expr ::= expr IS NULL */ +{yylhsminor.yy178 = tSqlExprCreate(yymsp[-2].minor.yy178, NULL, TK_ISNULL);} + yymsp[-2].minor.yy178 = yylhsminor.yy178; break; - case 227: /* expr ::= expr IS NOT NULL */ -{yylhsminor.yy282 = tSqlExprCreate(yymsp[-3].minor.yy282, NULL, TK_NOTNULL);} - yymsp[-3].minor.yy282 = yylhsminor.yy282; + case 229: /* expr ::= expr IS NOT NULL */ +{yylhsminor.yy178 = tSqlExprCreate(yymsp[-3].minor.yy178, NULL, TK_NOTNULL);} + yymsp[-3].minor.yy178 = yylhsminor.yy178; break; - case 228: /* expr ::= expr LT expr */ -{yylhsminor.yy282 = tSqlExprCreate(yymsp[-2].minor.yy282, yymsp[0].minor.yy282, TK_LT);} - yymsp[-2].minor.yy282 = yylhsminor.yy282; + case 230: /* expr ::= expr LT expr */ +{yylhsminor.yy178 = tSqlExprCreate(yymsp[-2].minor.yy178, yymsp[0].minor.yy178, TK_LT);} + yymsp[-2].minor.yy178 = yylhsminor.yy178; break; - case 229: /* expr ::= expr GT expr */ -{yylhsminor.yy282 = tSqlExprCreate(yymsp[-2].minor.yy282, yymsp[0].minor.yy282, TK_GT);} - yymsp[-2].minor.yy282 = yylhsminor.yy282; + case 231: /* expr ::= expr GT expr */ +{yylhsminor.yy178 = tSqlExprCreate(yymsp[-2].minor.yy178, yymsp[0].minor.yy178, TK_GT);} + yymsp[-2].minor.yy178 = yylhsminor.yy178; break; - case 230: /* expr ::= expr LE expr */ -{yylhsminor.yy282 = tSqlExprCreate(yymsp[-2].minor.yy282, yymsp[0].minor.yy282, TK_LE);} - yymsp[-2].minor.yy282 = yylhsminor.yy282; + case 232: /* expr ::= expr LE expr */ +{yylhsminor.yy178 = tSqlExprCreate(yymsp[-2].minor.yy178, yymsp[0].minor.yy178, TK_LE);} + yymsp[-2].minor.yy178 = yylhsminor.yy178; break; - case 231: /* expr ::= expr GE expr */ -{yylhsminor.yy282 = tSqlExprCreate(yymsp[-2].minor.yy282, yymsp[0].minor.yy282, TK_GE);} - yymsp[-2].minor.yy282 = yylhsminor.yy282; + case 233: /* expr ::= expr GE expr */ +{yylhsminor.yy178 = tSqlExprCreate(yymsp[-2].minor.yy178, yymsp[0].minor.yy178, TK_GE);} + yymsp[-2].minor.yy178 = yylhsminor.yy178; break; - case 232: /* expr ::= expr NE expr */ -{yylhsminor.yy282 = tSqlExprCreate(yymsp[-2].minor.yy282, yymsp[0].minor.yy282, TK_NE);} - yymsp[-2].minor.yy282 = yylhsminor.yy282; + case 234: /* expr ::= expr NE expr */ +{yylhsminor.yy178 = tSqlExprCreate(yymsp[-2].minor.yy178, yymsp[0].minor.yy178, TK_NE);} + yymsp[-2].minor.yy178 = yylhsminor.yy178; break; - case 233: /* expr ::= expr EQ expr */ -{yylhsminor.yy282 = tSqlExprCreate(yymsp[-2].minor.yy282, yymsp[0].minor.yy282, TK_EQ);} - yymsp[-2].minor.yy282 = yylhsminor.yy282; + case 235: /* expr ::= expr EQ expr */ +{yylhsminor.yy178 = tSqlExprCreate(yymsp[-2].minor.yy178, yymsp[0].minor.yy178, TK_EQ);} + yymsp[-2].minor.yy178 = yylhsminor.yy178; break; - case 234: /* expr ::= expr BETWEEN expr AND expr */ -{ tSQLExpr* X2 = tSqlExprClone(yymsp[-4].minor.yy282); yylhsminor.yy282 = tSqlExprCreate(tSqlExprCreate(yymsp[-4].minor.yy282, yymsp[-2].minor.yy282, TK_GE), tSqlExprCreate(X2, yymsp[0].minor.yy282, TK_LE), TK_AND);} - yymsp[-4].minor.yy282 = yylhsminor.yy282; + case 236: /* expr ::= expr BETWEEN expr AND expr */ +{ tSQLExpr* X2 = tSqlExprClone(yymsp[-4].minor.yy178); yylhsminor.yy178 = tSqlExprCreate(tSqlExprCreate(yymsp[-4].minor.yy178, yymsp[-2].minor.yy178, TK_GE), tSqlExprCreate(X2, yymsp[0].minor.yy178, TK_LE), TK_AND);} + yymsp[-4].minor.yy178 = yylhsminor.yy178; break; - case 235: /* expr ::= expr AND expr */ -{yylhsminor.yy282 = tSqlExprCreate(yymsp[-2].minor.yy282, yymsp[0].minor.yy282, TK_AND);} - yymsp[-2].minor.yy282 = yylhsminor.yy282; + case 237: /* expr ::= expr AND expr */ +{yylhsminor.yy178 = tSqlExprCreate(yymsp[-2].minor.yy178, yymsp[0].minor.yy178, TK_AND);} + yymsp[-2].minor.yy178 = yylhsminor.yy178; break; - case 236: /* expr ::= expr OR expr */ -{yylhsminor.yy282 = tSqlExprCreate(yymsp[-2].minor.yy282, yymsp[0].minor.yy282, TK_OR); } - yymsp[-2].minor.yy282 = yylhsminor.yy282; + case 238: /* expr ::= expr OR expr */ +{yylhsminor.yy178 = tSqlExprCreate(yymsp[-2].minor.yy178, yymsp[0].minor.yy178, TK_OR); } + yymsp[-2].minor.yy178 = yylhsminor.yy178; break; - case 237: /* expr ::= expr PLUS expr */ -{yylhsminor.yy282 = tSqlExprCreate(yymsp[-2].minor.yy282, yymsp[0].minor.yy282, TK_PLUS); } - yymsp[-2].minor.yy282 = yylhsminor.yy282; + case 239: /* expr ::= expr PLUS expr */ +{yylhsminor.yy178 = tSqlExprCreate(yymsp[-2].minor.yy178, yymsp[0].minor.yy178, TK_PLUS); } + yymsp[-2].minor.yy178 = yylhsminor.yy178; break; - case 238: /* expr ::= expr MINUS expr */ -{yylhsminor.yy282 = tSqlExprCreate(yymsp[-2].minor.yy282, yymsp[0].minor.yy282, TK_MINUS); } - yymsp[-2].minor.yy282 = yylhsminor.yy282; + case 240: /* expr ::= expr MINUS expr */ +{yylhsminor.yy178 = tSqlExprCreate(yymsp[-2].minor.yy178, yymsp[0].minor.yy178, TK_MINUS); } + yymsp[-2].minor.yy178 = yylhsminor.yy178; break; - case 239: /* expr ::= expr STAR expr */ -{yylhsminor.yy282 = tSqlExprCreate(yymsp[-2].minor.yy282, yymsp[0].minor.yy282, TK_STAR); } - yymsp[-2].minor.yy282 = yylhsminor.yy282; + case 241: /* expr ::= expr STAR expr */ +{yylhsminor.yy178 = tSqlExprCreate(yymsp[-2].minor.yy178, yymsp[0].minor.yy178, TK_STAR); } + yymsp[-2].minor.yy178 = yylhsminor.yy178; break; - case 240: /* expr ::= expr SLASH expr */ -{yylhsminor.yy282 = tSqlExprCreate(yymsp[-2].minor.yy282, yymsp[0].minor.yy282, TK_DIVIDE);} - yymsp[-2].minor.yy282 = yylhsminor.yy282; + case 242: /* expr ::= expr SLASH expr */ +{yylhsminor.yy178 = tSqlExprCreate(yymsp[-2].minor.yy178, yymsp[0].minor.yy178, TK_DIVIDE);} + yymsp[-2].minor.yy178 = yylhsminor.yy178; break; - case 241: /* expr ::= expr REM expr */ -{yylhsminor.yy282 = tSqlExprCreate(yymsp[-2].minor.yy282, yymsp[0].minor.yy282, TK_REM); } - yymsp[-2].minor.yy282 = yylhsminor.yy282; + case 243: /* expr ::= expr REM expr */ +{yylhsminor.yy178 = tSqlExprCreate(yymsp[-2].minor.yy178, yymsp[0].minor.yy178, TK_REM); } + yymsp[-2].minor.yy178 = yylhsminor.yy178; break; - case 242: /* expr ::= expr LIKE expr */ -{yylhsminor.yy282 = tSqlExprCreate(yymsp[-2].minor.yy282, yymsp[0].minor.yy282, TK_LIKE); } - yymsp[-2].minor.yy282 = yylhsminor.yy282; + case 244: /* expr ::= expr LIKE expr */ +{yylhsminor.yy178 = tSqlExprCreate(yymsp[-2].minor.yy178, yymsp[0].minor.yy178, TK_LIKE); } + yymsp[-2].minor.yy178 = yylhsminor.yy178; break; - case 243: /* expr ::= expr IN LP exprlist RP */ -{yylhsminor.yy282 = tSqlExprCreate(yymsp[-4].minor.yy282, (tSQLExpr*)yymsp[-1].minor.yy170, TK_IN); } - yymsp[-4].minor.yy282 = yylhsminor.yy282; + case 245: /* expr ::= expr IN LP exprlist RP */ +{yylhsminor.yy178 = tSqlExprCreate(yymsp[-4].minor.yy178, (tSQLExpr*)yymsp[-1].minor.yy434, TK_IN); } + yymsp[-4].minor.yy178 = yylhsminor.yy178; break; - case 244: /* exprlist ::= exprlist COMMA expritem */ -{yylhsminor.yy170 = tSqlExprListAppend(yymsp[-2].minor.yy170,yymsp[0].minor.yy282,0, 0);} - yymsp[-2].minor.yy170 = yylhsminor.yy170; + case 246: /* exprlist ::= exprlist COMMA expritem */ +{yylhsminor.yy434 = tSqlExprListAppend(yymsp[-2].minor.yy434,yymsp[0].minor.yy178,0, 0);} + yymsp[-2].minor.yy434 = yylhsminor.yy434; break; - case 245: /* exprlist ::= expritem */ -{yylhsminor.yy170 = tSqlExprListAppend(0,yymsp[0].minor.yy282,0, 0);} - yymsp[0].minor.yy170 = yylhsminor.yy170; + case 247: /* exprlist ::= expritem */ +{yylhsminor.yy434 = tSqlExprListAppend(0,yymsp[0].minor.yy178,0, 0);} + yymsp[0].minor.yy434 = yylhsminor.yy434; break; - case 246: /* expritem ::= expr */ -{yylhsminor.yy282 = yymsp[0].minor.yy282;} - yymsp[0].minor.yy282 = yylhsminor.yy282; + case 248: /* expritem ::= expr */ +{yylhsminor.yy178 = yymsp[0].minor.yy178;} + yymsp[0].minor.yy178 = yylhsminor.yy178; break; - case 248: /* cmd ::= RESET QUERY CACHE */ + case 250: /* cmd ::= RESET QUERY CACHE */ { setDCLSQLElems(pInfo, TSDB_SQL_RESET_CACHE, 0);} break; - case 249: /* cmd ::= ALTER TABLE ids cpxName ADD COLUMN columnlist */ + case 251: /* cmd ::= ALTER TABLE ids cpxName ADD COLUMN columnlist */ { yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n; - SAlterTableInfo* pAlterTable = tAlterTableSqlElems(&yymsp[-4].minor.yy0, yymsp[0].minor.yy429, NULL, TSDB_ALTER_TABLE_ADD_COLUMN, -1); + SAlterTableInfo* pAlterTable = tAlterTableSqlElems(&yymsp[-4].minor.yy0, yymsp[0].minor.yy285, NULL, TSDB_ALTER_TABLE_ADD_COLUMN, -1); setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); } break; - case 250: /* cmd ::= ALTER TABLE ids cpxName DROP COLUMN ids */ + case 252: /* cmd ::= ALTER TABLE ids cpxName DROP COLUMN ids */ { yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n; @@ -2968,14 +2990,14 @@ static void yy_reduce( setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); } break; - case 251: /* cmd ::= ALTER TABLE ids cpxName ADD TAG columnlist */ + case 253: /* cmd ::= ALTER TABLE ids cpxName ADD TAG columnlist */ { yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n; - SAlterTableInfo* pAlterTable = tAlterTableSqlElems(&yymsp[-4].minor.yy0, yymsp[0].minor.yy429, NULL, TSDB_ALTER_TABLE_ADD_TAG_COLUMN, -1); + SAlterTableInfo* pAlterTable = tAlterTableSqlElems(&yymsp[-4].minor.yy0, yymsp[0].minor.yy285, NULL, TSDB_ALTER_TABLE_ADD_TAG_COLUMN, -1); setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); } break; - case 252: /* cmd ::= ALTER TABLE ids cpxName DROP TAG ids */ + case 254: /* cmd ::= ALTER TABLE ids cpxName DROP TAG ids */ { yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n; @@ -2986,7 +3008,7 @@ static void yy_reduce( setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); } break; - case 253: /* cmd ::= ALTER TABLE ids cpxName CHANGE TAG ids ids */ + case 255: /* cmd ::= ALTER TABLE ids cpxName CHANGE TAG ids ids */ { yymsp[-5].minor.yy0.n += yymsp[-4].minor.yy0.n; @@ -3000,26 +3022,26 @@ static void yy_reduce( setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); } break; - case 254: /* cmd ::= ALTER TABLE ids cpxName SET TAG ids EQ tagitem */ + case 256: /* cmd ::= ALTER TABLE ids cpxName SET TAG ids EQ tagitem */ { yymsp[-6].minor.yy0.n += yymsp[-5].minor.yy0.n; toTSDBType(yymsp[-2].minor.yy0.type); SArray* A = tVariantListAppendToken(NULL, &yymsp[-2].minor.yy0, -1); - A = tVariantListAppend(A, &yymsp[0].minor.yy218, -1); + A = tVariantListAppend(A, &yymsp[0].minor.yy362, -1); SAlterTableInfo* pAlterTable = tAlterTableSqlElems(&yymsp[-6].minor.yy0, NULL, A, TSDB_ALTER_TABLE_UPDATE_TAG_VAL, -1); setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); } break; - case 255: /* cmd ::= ALTER STABLE ids cpxName ADD COLUMN columnlist */ + case 257: /* cmd ::= ALTER STABLE ids cpxName ADD COLUMN columnlist */ { yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n; - SAlterTableInfo* pAlterTable = tAlterTableSqlElems(&yymsp[-4].minor.yy0, yymsp[0].minor.yy429, NULL, TSDB_ALTER_TABLE_ADD_COLUMN, TSDB_SUPER_TABLE); + SAlterTableInfo* pAlterTable = tAlterTableSqlElems(&yymsp[-4].minor.yy0, yymsp[0].minor.yy285, NULL, TSDB_ALTER_TABLE_ADD_COLUMN, TSDB_SUPER_TABLE); setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); } break; - case 256: /* cmd ::= ALTER STABLE ids cpxName DROP COLUMN ids */ + case 258: /* cmd ::= ALTER STABLE ids cpxName DROP COLUMN ids */ { yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n; @@ -3030,14 +3052,14 @@ static void yy_reduce( setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); } break; - case 257: /* cmd ::= ALTER STABLE ids cpxName ADD TAG columnlist */ + case 259: /* cmd ::= ALTER STABLE ids cpxName ADD TAG columnlist */ { yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n; - SAlterTableInfo* pAlterTable = tAlterTableSqlElems(&yymsp[-4].minor.yy0, yymsp[0].minor.yy429, NULL, TSDB_ALTER_TABLE_ADD_TAG_COLUMN, TSDB_SUPER_TABLE); + SAlterTableInfo* pAlterTable = tAlterTableSqlElems(&yymsp[-4].minor.yy0, yymsp[0].minor.yy285, NULL, TSDB_ALTER_TABLE_ADD_TAG_COLUMN, TSDB_SUPER_TABLE); setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); } break; - case 258: /* cmd ::= ALTER STABLE ids cpxName DROP TAG ids */ + case 260: /* cmd ::= ALTER STABLE ids cpxName DROP TAG ids */ { yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n; @@ -3048,7 +3070,7 @@ static void yy_reduce( setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); } break; - case 259: /* cmd ::= ALTER STABLE ids cpxName CHANGE TAG ids ids */ + case 261: /* cmd ::= ALTER STABLE ids cpxName CHANGE TAG ids ids */ { yymsp[-5].minor.yy0.n += yymsp[-4].minor.yy0.n; @@ -3062,13 +3084,13 @@ static void yy_reduce( setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); } break; - case 260: /* cmd ::= KILL CONNECTION INTEGER */ + case 262: /* cmd ::= KILL CONNECTION INTEGER */ {setKillSql(pInfo, TSDB_SQL_KILL_CONNECTION, &yymsp[0].minor.yy0);} break; - case 261: /* cmd ::= KILL STREAM INTEGER COLON INTEGER */ + case 263: /* cmd ::= KILL STREAM INTEGER COLON INTEGER */ {yymsp[-2].minor.yy0.n += (yymsp[-1].minor.yy0.n + yymsp[0].minor.yy0.n); setKillSql(pInfo, TSDB_SQL_KILL_STREAM, &yymsp[-2].minor.yy0);} break; - case 262: /* cmd ::= KILL QUERY INTEGER COLON INTEGER */ + case 264: /* cmd ::= KILL QUERY INTEGER COLON INTEGER */ {yymsp[-2].minor.yy0.n += (yymsp[-1].minor.yy0.n + yymsp[0].minor.yy0.n); setKillSql(pInfo, TSDB_SQL_KILL_QUERY, &yymsp[-2].minor.yy0);} break; default: diff --git a/src/vnode/src/vnodeRead.c b/src/vnode/src/vnodeRead.c index acb1fc78f6554dc7cd4b984107a7bc1b95315b67..8b26f4a8e22e00286a833f88efdf31e1e84b58e9 100644 --- a/src/vnode/src/vnodeRead.c +++ b/src/vnode/src/vnodeRead.c @@ -372,7 +372,7 @@ static int32_t vnodeProcessFetchMsg(SVnodeObj *pVnode, SVReadMsg *pRead) { // kill current query and free corresponding resources. if (pRetrieve->free == 1) { - vWarn("vgId:%d, QInfo:%p, retrieve msg received to kill query and free qhandle", pVnode->vgId, *handle); + vDebug("vgId:%d, QInfo:%p, retrieve msg received to kill query and free qhandle", pVnode->vgId, *handle); qKillQuery(*handle); qReleaseQInfo(pVnode->qMgmt, (void **)&handle, true);