From 6b818f2ce4274a3c0e0cea5e1d339489ccd1c251 Mon Sep 17 00:00:00 2001 From: xywang Date: Mon, 9 May 2022 12:10:46 +0800 Subject: [PATCH] feat(query): added bitwise operations --- src/client/src/tscSQLParser.c | 278 +++- src/client/src/tscUtil.c | 2 +- src/common/src/tarithoperator.c | 634 +++++--- src/common/src/texpr.c | 187 +-- src/inc/taosdef.h | 7 +- src/inc/ttokendef.h | 342 ++-- src/inc/ttype.h | 1 + src/kit/shell/src/shellEngine.c | 32 +- src/query/inc/qFilter.h | 19 +- src/query/inc/sql.y | 9 +- src/query/src/qExecutor.c | 4 + src/query/src/qFilter.c | 193 ++- src/query/src/qSqlParser.c | 74 +- src/query/src/sql.c | 2700 ++++++++++++++++--------------- src/tsdb/src/tsdbRead.c | 76 +- src/util/src/ttokenizer.c | 5 + 16 files changed, 2562 insertions(+), 2001 deletions(-) diff --git a/src/client/src/tscSQLParser.c b/src/client/src/tscSQLParser.c index 43b8494519..97f2058e75 100644 --- a/src/client/src/tscSQLParser.c +++ b/src/client/src/tscSQLParser.c @@ -145,6 +145,8 @@ static int32_t loadAllTableMeta(SSqlObj* pSql, struct SSqlInfo* pInfo); static tSqlExpr* extractExprForSTable(SSqlCmd* pCmd, tSqlExpr** pExpr, SQueryInfo* pQueryInfo, int32_t tableIndex); static void convertWhereStringCharset(tSqlExpr* pRight); +static bool isLogicalOperator(tSqlExpr* pExpr); +static bool isComparisonOperator(tSqlExpr* pExpr); int validateTableName(char *tblName, int len, SStrToken* psTblToken, bool *dbIncluded); static bool isTimeWindowQuery(SQueryInfo* pQueryInfo) { @@ -284,6 +286,16 @@ static uint8_t convertRelationalOperator(SStrToken *pToken) { return TSDB_BINARY_OP_REMAINDER; case TK_BITAND: return TSDB_BINARY_OP_BITAND; + case TK_BITOR: + return TSDB_BINARY_OP_BITOR; + case TK_BITXOR: + return TSDB_BINARY_OP_BITXOR; + case TK_BITNOT: + return TSDB_BINARY_OP_BITNOT; + case TK_LSHIFT: + return TSDB_BINARY_OP_LSHIFT; + case TK_RSHIFT: + return TSDB_BINARY_OP_RSHIFT; case TK_LIKE: return TSDB_RELATION_LIKE; case TK_MATCH: @@ -1142,7 +1154,7 @@ static int32_t addPrimaryTsColumnForTimeWindowQuery(SQueryInfo* pQueryInfo, SSql tstrncpy(s.name, pTableMetaInfo->pTableMeta->schema[PRIMARYKEY_TIMESTAMP_COL_INDEX].name, sizeof(s.name)); } else { 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, 0); @@ -4771,15 +4783,10 @@ static int32_t checkColumnFilterInfo(SSqlCmd* pCmd, SQueryInfo* pQueryInfo, SCol STableMeta* pTableMeta = pTableMetaInfo->pTableMeta; SSchema* pSchema = tscGetTableColumnSchema(pTableMeta, pIndex->columnIndex); - int32_t ret = 0; + int32_t ret = TSDB_CODE_SUCCESS; const char* msg1 = "non binary column not support like/match operator"; const char* msg3 = "bool column not support this operator"; const char* msg4 = "primary key not support this operator"; - - SColumn* pColumn = tscColumnListInsert(pQueryInfo->colList, pIndex->columnIndex, pTableMeta->id.uid, pSchema); - - pColumn->info.flist.numOfFilters++; - /* * in case of TK_AND filter condition, we first find the corresponding column and build the query condition together * the already existed condition. @@ -4793,7 +4800,7 @@ static int32_t checkColumnFilterInfo(SSqlCmd* pCmd, SQueryInfo* pQueryInfo, SCol pColFilter->filterstr = ((pSchema->type == TSDB_DATA_TYPE_BINARY || pSchema->type == TSDB_DATA_TYPE_NCHAR) ? 1 : 0); - if (!pColFilter->filterstr) { + if (!pColFilter->filterstr && tSqlExprIsParentOfLeaf(pExpr)) { if (pExpr->tokenId == TK_LIKE || pExpr->tokenId == TK_MATCH || pExpr->tokenId == TK_NMATCH) { ret = invalidOperationMsg(tscGetErrorMsgPayload(pCmd), msg1); goto _err_ret; @@ -4807,11 +4814,10 @@ static int32_t checkColumnFilterInfo(SSqlCmd* pCmd, SQueryInfo* pQueryInfo, SCol } } } - - pColumn->columnIndex = pIndex->columnIndex; - pColumn->tableUid = pTableMeta->id.uid; - if (pColumn->columnIndex == PRIMARYKEY_TIMESTAMP_COL_INDEX && pExpr->tokenId == TK_IN) { - return invalidOperationMsg(tscGetErrorMsgPayload(pCmd), msg4); + if (pIndex->columnIndex == PRIMARYKEY_TIMESTAMP_COL_INDEX && pTableMeta->id.uid == TK_IN + && tSqlExprIsParentOfLeaf(pExpr)) { + ret = invalidOperationMsg(tscGetErrorMsgPayload(pCmd), msg4); + goto _err_ret; } STableComInfo tinfo = tscGetTableInfo(pTableMeta); @@ -4823,8 +4829,32 @@ _err_ret: return ret; } +static int32_t addAllColumn(SSqlCmd* pCmd, SQueryInfo* pQueryInfo, tSqlExpr* pExpr, uint32_t conTokenId, + SColumnIndex* pIndex) { + int32_t ret = TSDB_CODE_SUCCESS; + + if(!tSqlExprIsLeaf(pExpr) || pExpr->tokenId == TK_ARROW) { + ret = addAllColumn(pCmd, pQueryInfo, pExpr->pLeft, conTokenId, pIndex); + if (ret != TSDB_CODE_SUCCESS) { + return ret; + } + return addAllColumn(pCmd, pQueryInfo, pExpr->pRight, conTokenId, pIndex); + } else if (pExpr->tokenId == TK_ID) { + if (getColumnIndexByName(&pExpr->columnName, pQueryInfo, pIndex, tscGetErrorMsgPayload(pCmd)) != TSDB_CODE_SUCCESS) { + return TSDB_CODE_TSC_INVALID_OPERATION; + } + STableMetaInfo* pTableMetaInfo = tscGetMetaInfo(pQueryInfo, pIndex->tableIndex); + STableMeta* pTableMeta = pTableMetaInfo->pTableMeta; + SSchema* pSchema = tscGetTableColumnSchema(pTableMeta, pIndex->columnIndex); + SColumn* pColumn = tscColumnListInsert(pQueryInfo->colList, pIndex->columnIndex, pTableMeta->id.uid, pSchema); + pColumn->info.flist.numOfFilters++; + } + return ret; +} + static int32_t getColQueryCondExpr(SSqlCmd* pCmd, SQueryInfo* pQueryInfo, tSqlExpr** pExpr) { int32_t ret = TSDB_CODE_SUCCESS; + const char* msg6 = "illegal condition expression"; for (int32_t i = 0; i < pQueryInfo->numOfTables; ++i) { tSqlExpr* p1 = extractExprForSTable(pCmd, pExpr, pQueryInfo, i); @@ -4836,7 +4866,18 @@ static int32_t getColQueryCondExpr(SSqlCmd* pCmd, SQueryInfo* pQueryInfo, tSqlEx SArray* colList = taosArrayInit(10, sizeof(SColIndex)); ret = exprTreeFromSqlExpr(pCmd, &p, p1, pQueryInfo, colList, NULL); + size_t colNum = taosArrayGetSize(colList); + for (int32_t k = 0; k < colNum; k++) { + SColIndex* pColIndex = taosArrayGet(colList, k); + if (TSDB_COL_IS_TAG(pColIndex->flag)) { + ret = invalidOperationMsg(tscGetErrorMsgPayload(pCmd), msg6); + break; + } + } taosArrayDestroy(&colList); + if (ret == TSDB_CODE_SUCCESS) { + ret = exprTreeValidateTree(tscGetErrorMsgPayload(pCmd), p); + } SBufferWriter bw = tbufInitWriter(NULL, false); @@ -4884,7 +4925,7 @@ static int32_t checkColumnQueryCondInfo(SSqlCmd* pCmd, SQueryInfo* pQueryInfo, t } pQueryInfo->onlyHasTagCond &= false; - if (!tSqlExprIsParentOfLeaf(pExpr)) { // internal node + if (isLogicalOperator(pExpr)) { // internal node int32_t ret = checkColumnQueryCondInfo(pCmd, pQueryInfo, pExpr->pLeft, pExpr->tokenId); if (ret != TSDB_CODE_SUCCESS) { return ret; @@ -4893,12 +4934,10 @@ static int32_t checkColumnQueryCondInfo(SSqlCmd* pCmd, SQueryInfo* pQueryInfo, t return checkColumnQueryCondInfo(pCmd, pQueryInfo, pExpr->pRight, pExpr->tokenId); } else { // handle leaf node SColumnIndex index = COLUMN_INDEX_INITIALIZER; - if (getColumnIndexByName(&pExpr->pLeft->columnName, pQueryInfo, &index, tscGetErrorMsgPayload(pCmd)) != TSDB_CODE_SUCCESS) { - return TSDB_CODE_TSC_INVALID_OPERATION; - } - + addAllColumn(pCmd, pQueryInfo, pExpr, pExpr->tokenId, &index); return checkColumnFilterInfo(pCmd, pQueryInfo, &index, pExpr, relOptr); } + return TSDB_CODE_SUCCESS; } static int32_t checkAndSetJoinCondInfo(SSqlCmd* pCmd, SQueryInfo* pQueryInfo, tSqlExpr* pExpr) { @@ -5175,19 +5214,23 @@ static int32_t validateSQLExprItemOperatorExpr(SSqlCmd* pCmd, tSqlExpr* pExpr, S if (ret != TSDB_CODE_SUCCESS) { return ret; } + int32_t rightHeight = 0; - ret = validateSQLExprItem(pCmd, pExpr->pRight, pQueryInfo, pList, &rightType, &uidRight, &rightHeight); - if (ret != TSDB_CODE_SUCCESS) { - return ret; - } + if (pExpr->tokenId != TK_BITNOT) { + ret = validateSQLExprItem(pCmd, pExpr->pRight, pQueryInfo, pList, &rightType, &uidRight, &rightHeight); + if (ret != TSDB_CODE_SUCCESS) { + return ret; + } - if (uidLeft != uidRight && uidLeft != 0 && uidRight != 0) { - return invalidOperationMsg(tscGetErrorMsgPayload(pCmd), msg1); + if (uidLeft != uidRight && uidLeft != 0 && uidRight != 0) { + return invalidOperationMsg(tscGetErrorMsgPayload(pCmd), msg1); + } } + *uid = uidLeft; - *height = (leftHeight > rightHeight) ? leftHeight + 1 : rightHeight+1; - { + *height = (leftHeight > rightHeight) ? leftHeight + 1 : rightHeight + 1; + if (pExpr->tokenId != TK_BITNOT) { if (leftType == SQLEXPR_TYPE_UNASSIGNED || rightType == SQLEXPR_TYPE_UNASSIGNED) { return invalidOperationMsg(tscGetErrorMsgPayload(pCmd), "invalid operand expression"); } @@ -5223,8 +5266,15 @@ static int32_t validateSQLExprItemOperatorExpr(SSqlCmd* pCmd, tSqlExpr* pExpr, S pExpr->tokenId == TK_MATCH || pExpr->tokenId == TK_NMATCH || pExpr->tokenId == TK_CONTAINS || pExpr->tokenId == TK_IN) { return invalidOperationMsg(tscGetErrorMsgPayload(pCmd), "unsupported filtering operations"); + } else if (pExpr->tokenId == TK_LSHIFT || pExpr->tokenId == TK_RSHIFT) { + if (rightType != SQLEXPR_TYPE_VALUE) { + return invalidOperationMsg(tscGetErrorMsgPayload(pCmd), "non numeric right operand"); + } } + } else { + *type = SQLEXPR_TYPE_SCALAR; } + return TSDB_CODE_SUCCESS; } @@ -5634,6 +5684,38 @@ void convertWhereStringCharset(tSqlExpr* pRight){ free(newData); } +static int32_t handleColumnInQueryCond(SSqlCmd* pCmd, SQueryInfo* pQueryInfo, tSqlExpr* pExpr, SColumnIndex* index) { + const char* msg2 = "illegal column name"; + int32_t ret = TSDB_CODE_SUCCESS; + if (pExpr == NULL) { + return ret; + } else if (!tSqlExprIsLeaf(pExpr)) { + if (isComparisonOperator(pExpr)) { + return TSDB_CODE_TSC_INVALID_OPERATION; + } + ret = handleColumnInQueryCond(pCmd, pQueryInfo, pExpr->pLeft, index); + if( ret != TSDB_CODE_SUCCESS) { + return ret; + } + ret = handleColumnInQueryCond(pCmd, pQueryInfo, pExpr->pRight, index); + return ret; + } + + SStrToken* colName = NULL; + if (pExpr->tokenId == TK_ARROW) { + colName = &(pExpr->pLeft->columnName); + } else if (pExpr->tokenId == TK_ID) { + colName = &(pExpr->columnName); + } + + if (colName) { + if (getColumnIndexByName(colName, pQueryInfo, index, tscGetErrorMsgPayload(pCmd)) != TSDB_CODE_SUCCESS) { + ret = invalidOperationMsg(tscGetErrorMsgPayload(pCmd), msg2); + } + } + return ret; +} + static int32_t handleExprInQueryCond(SSqlCmd* pCmd, SQueryInfo* pQueryInfo, tSqlExpr** pExpr, SCondExpr* pCondExpr, int32_t* type, int32_t* tbIdx, int32_t parentOptr, tSqlExpr** columnExpr, tSqlExpr** tsExpr, bool joinQuery, bool delData) { @@ -5641,7 +5723,6 @@ static int32_t handleExprInQueryCond(SSqlCmd* pCmd, SQueryInfo* pQueryInfo, tSql const char* msg2 = "illegal column name"; const char* msg4 = "too many join tables"; const char* msg5 = "not support ordinary column join"; - const char* msg6 = "illegal condition expression"; const char* msg7 = "only allow first timestamp column and tag column"; tSqlExpr* pLeft = (*pExpr)->pLeft; @@ -5657,14 +5738,23 @@ static int32_t handleExprInQueryCond(SSqlCmd* pCmd, SQueryInfo* pQueryInfo, tSql int32_t ret = TSDB_CODE_SUCCESS; SColumnIndex index = COLUMN_INDEX_INITIALIZER; - if (getColumnIndexByName(colName, pQueryInfo, &index, tscGetErrorMsgPayload(pCmd)) != TSDB_CODE_SUCCESS) { - return invalidOperationMsg(tscGetErrorMsgPayload(pCmd), msg2); + if (!tSqlExprIsParentOfLeaf(*pExpr)) { + ret = handleColumnInQueryCond(pCmd, pQueryInfo, pLeft, &index); + if (ret != TSDB_CODE_SUCCESS) { + return ret; + } + ret = handleColumnInQueryCond(pCmd, pQueryInfo, pRight, &index); + if (ret != TSDB_CODE_SUCCESS) { + return ret; + } + } else { + if (getColumnIndexByName(colName, pQueryInfo, &index, tscGetErrorMsgPayload(pCmd)) != TSDB_CODE_SUCCESS) { + return invalidOperationMsg(tscGetErrorMsgPayload(pCmd), msg2); + } } *tbIdx = index.tableIndex; - assert(tSqlExprIsParentOfLeaf(*pExpr)); - STableMetaInfo* pTableMetaInfo = tscGetMetaInfo(pQueryInfo, index.tableIndex); STableMeta* pTableMeta = pTableMetaInfo->pTableMeta; SSchema* pSchema = tscGetTableColumnSchema(pTableMeta, index.columnIndex); @@ -5701,7 +5791,7 @@ static int32_t handleExprInQueryCond(SSqlCmd* pCmd, SQueryInfo* pQueryInfo, tSql } if (pSchema->type == TSDB_DATA_TYPE_TIMESTAMP && index.columnIndex == PRIMARYKEY_TIMESTAMP_COL_INDEX) { // query on time range - if (!validateJoinExprNode(pCmd, pQueryInfo, *pExpr, &index)) { + if (!tSqlExprIsParentOfLeaf(*pExpr) || !validateJoinExprNode(pCmd, pQueryInfo, *pExpr, &index)) { return TSDB_CODE_TSC_INVALID_OPERATION; } @@ -5823,8 +5913,6 @@ static int32_t handleExprInQueryCond(SSqlCmd* pCmd, SQueryInfo* pQueryInfo, tSql if (pRight->tokenId == TK_ID) { if (joinQuery) { return invalidOperationMsg(tscGetErrorMsgPayload(pCmd), msg5); // other column cannot be served as the join column - } else { - return invalidOperationMsg(tscGetErrorMsgPayload(pCmd), msg6); } } @@ -5875,7 +5963,7 @@ int32_t getQueryCondExpr(SSqlCmd* pCmd, SQueryInfo* pQueryInfo, tSqlExpr** pExpr int32_t leftTbIdx = 0; int32_t rightTbIdx = 0; - if (!tSqlExprIsParentOfLeaf(*pExpr)) { + if (isLogicalOperator(*pExpr)) { ret = getQueryCondExpr(pCmd, pQueryInfo, &(*pExpr)->pLeft, pCondExpr, type ? &leftType : NULL, &leftTbIdx, (*pExpr)->tokenId, &columnLeft, &tsLeft, joinQuery, delData); if (ret != TSDB_CODE_SUCCESS) { goto err_ret; @@ -5936,6 +6024,11 @@ int32_t getQueryCondExpr(SSqlCmd* pCmd, SQueryInfo* pQueryInfo, tSqlExpr** pExpr goto err_ret; } + if (!tSqlExprIsLeaf((*pExpr)->pRight)) { + ret = TSDB_CODE_TSC_INVALID_OPERATION; + goto err_ret; + } + ret = handleExprInQueryCond(pCmd, pQueryInfo, pExpr, pCondExpr, type, tbIdx, parentOptr, columnExpr, tsExpr, joinQuery, delData); if (ret) { goto err_ret; @@ -5957,20 +6050,22 @@ static void doExtractExprForSTable(SSqlCmd* pCmd, tSqlExpr** pExpr, SQueryInfo* *pOut = NULL; return; } - - if (tSqlExprIsParentOfLeaf(*pExpr)) { + + if (!isLogicalOperator(*pExpr)) { tSqlExpr* pLeft = (*pExpr)->pLeft; - SColumnIndex index = COLUMN_INDEX_INITIALIZER; - if(pLeft->tokenId == TK_ARROW) { - pLeft = pLeft->pLeft; - } - if (getColumnIndexByName(&pLeft->columnName, pQueryInfo, &index, tscGetErrorMsgPayload(pCmd)) != TSDB_CODE_SUCCESS) { - return; - } + if (pLeft->tokenId == TK_ARROW || pLeft->tokenId == TK_ID) { + SColumnIndex index = COLUMN_INDEX_INITIALIZER; + if(pLeft->tokenId == TK_ARROW) { + pLeft = pLeft->pLeft; + } + if (getColumnIndexByName(&pLeft->columnName, pQueryInfo, &index, tscGetErrorMsgPayload(pCmd)) != TSDB_CODE_SUCCESS) { + return; + } - if (index.tableIndex != tableIndex) { - return; + if (index.tableIndex != tableIndex) { + return; + } } *pOut = *pExpr; @@ -6193,14 +6288,13 @@ static void doAddJoinTagsColumnsIntoTagList(SSqlCmd* pCmd, SQueryInfo* pQueryInf */ static int32_t validateTagCondExpr(SSqlCmd* pCmd, tExprNode *p) { - const char *msg1 = "invalid tag operator"; const char* msg2 = "not supported filter condition"; - + do { if (p->nodeType != TSQL_NODE_EXPR) { break; } - + if (!p->_node.pLeft || !p->_node.pRight) { break; } @@ -6213,23 +6307,19 @@ static int32_t validateTagCondExpr(SSqlCmd* pCmd, tExprNode *p) { if (p->_node.pRight && (retVal = validateTagCondExpr(pCmd, p->_node.pRight)) != TSDB_CODE_SUCCESS) { return retVal; } - - if (IS_ARITHMETIC_OPTR(p->_node.optr)) { - return invalidOperationMsg(tscGetErrorMsgPayload(pCmd), msg1); - } - + if (!IS_RELATION_OPTR(p->_node.optr)) { break; } - + tVariant * vVariant = NULL; int32_t schemaType = -1; - + if (p->_node.pLeft->nodeType == TSQL_NODE_VALUE && p->_node.pRight->nodeType == TSQL_NODE_COL) { if (!p->_node.pRight->pSchema) { break; } - + vVariant = p->_node.pLeft->pVal; schemaType = p->_node.pRight->pSchema->type; } else if (p->_node.pLeft->nodeType == TSQL_NODE_COL && p->_node.pRight->nodeType == TSQL_NODE_VALUE) { @@ -6269,7 +6359,7 @@ static int32_t validateTagCondExpr(SSqlCmd* pCmd, tExprNode *p) { double tmp; retVal = tVariantDump(vVariant, (char*)&tmp, schemaType, false); } - + if (retVal != TSDB_CODE_SUCCESS) { return invalidOperationMsg(tscGetErrorMsgPayload(pCmd), msg2); } @@ -6278,8 +6368,13 @@ static int32_t validateTagCondExpr(SSqlCmd* pCmd, tExprNode *p) { return TSDB_CODE_SUCCESS; } +bool isTablename(char* colName) { + return (strlen(colName) == strlen(TSQL_TBNAME_L) && strncasecmp(TSQL_TBNAME_L, colName, strlen(TSQL_TBNAME_L)) == 0); +} + static int32_t getTagQueryCondExpr(SSqlCmd* pCmd, SQueryInfo* pQueryInfo, SCondExpr* pCondExpr) { int32_t ret = TSDB_CODE_SUCCESS; + const char* msg6 = "illegal condition expression"; if (pCondExpr->pTagCond == NULL) { return ret; @@ -6295,6 +6390,17 @@ static int32_t getTagQueryCondExpr(SSqlCmd* pCmd, SQueryInfo* pQueryInfo, SCondE SArray* colList = taosArrayInit(10, sizeof(SColIndex)); ret = exprTreeFromSqlExpr(pCmd, &p, p1, pQueryInfo, colList, NULL); + size_t colNum = taosArrayGetSize(colList); + for (int32_t k = 0; k < colNum; k++) { + SColIndex* pColIndex = taosArrayGet(colList, k); + if (TSDB_COL_IS_NORMAL_COL(pColIndex->flag) && !isTablename(pColIndex->name)) { + ret = invalidOperationMsg(tscGetErrorMsgPayload(pCmd), msg6); + break; + } + } + if (ret == TSDB_CODE_SUCCESS) { + ret = exprTreeValidateTree(tscGetErrorMsgPayload(pCmd), p); + } //if (ret == TSDB_CODE_SUCCESS) { // ret = filterInitFromTree(p, &pQueryInfo->tagFilter, (int32_t)taosArrayGetSize(colList), NULL); //} @@ -10756,23 +10862,6 @@ int32_t exprTreeFromSqlExpr(SSqlCmd* pCmd, tExprNode **pExpr, const tSqlExpr* pS } } - if (pSqlExpr->tokenId == TK_BITAND && pSqlExpr->pLeft != NULL && pSqlExpr->pRight != NULL) { - // for example: col type is "bool" but expr "col & 1" received - uint8_t colType = pLeft->pSchema->type; - SStrToken *exprToken = &pSqlExpr->pRight->exprToken; - if (pSqlExpr->pLeft->type == SQL_NODE_TABLE_COLUMN && pSqlExpr->pRight->type == SQL_NODE_VALUE) { - if (colType == TSDB_DATA_TYPE_BOOL) { - if ((exprToken->n != 4 || strncasecmp(exprToken->z, "true", 4)) && (exprToken->n != 5 || strncasecmp(exprToken->z, "false", 5))) { - return TSDB_CODE_TSC_INVALID_OPERATION; - } - } else if (IS_SIGNED_NUMERIC_TYPE(colType) || IS_UNSIGNED_NUMERIC_TYPE(colType)) { - if ((exprToken->n == 4 && strncasecmp(exprToken->z, "true", 4) == 0) || (exprToken->n == 5 || strncasecmp(exprToken->z, "false", 5) == 0)) { - return TSDB_CODE_TSC_INVALID_OPERATION; - } - } - } - } - if (pSqlExpr->pRight != NULL) { int32_t ret = exprTreeFromSqlExpr(pCmd, &pRight, pSqlExpr->pRight, pQueryInfo, pCols, uid); if (ret != TSDB_CODE_SUCCESS) { @@ -10811,8 +10900,11 @@ int32_t exprTreeFromSqlExpr(SSqlCmd* pCmd, tExprNode **pExpr, const tSqlExpr* pS pLeft = pLeft->_node.pLeft; } if (pRight->pVal->nType == TSDB_DATA_TYPE_BOOL && pLeft->nodeType == TSQL_NODE_COL) { - if (((*pExpr)->_node.optr != TSDB_BINARY_OP_BITAND && pLeft->pSchema->type == TSDB_DATA_TYPE_BOOL) || - pLeft->pSchema->type == TSDB_DATA_TYPE_JSON) { + if ((((*pExpr)->_node.optr != TSDB_BINARY_OP_BITAND || (*pExpr)->_node.optr != TSDB_BINARY_OP_BITOR || + (*pExpr)->_node.optr != TSDB_BINARY_OP_BITXOR || (*pExpr)->_node.optr != TSDB_BINARY_OP_BITNOT || + (*pExpr)->_node.optr != TSDB_BINARY_OP_LSHIFT || (*pExpr)->_node.optr != TSDB_BINARY_OP_RSHIFT) && + pLeft->pSchema->type == TSDB_DATA_TYPE_BOOL) || pLeft->pSchema->type == TSDB_DATA_TYPE_JSON) + { return TSDB_CODE_TSC_INVALID_OPERATION; } } @@ -10925,3 +11017,35 @@ void normalizeSqlNode(SSqlNode* pSqlNode, const char* dbName) { } #endif + +bool isLogicalOperator(tSqlExpr* pExpr) { + if (pExpr->tokenId == TK_AND || pExpr->tokenId == TK_OR) { + return true; + } + return false; +} + +bool isComparisonOperator(tSqlExpr* pExpr) { + switch (pExpr->tokenId) { + case TK_EQ: + case TK_NE: + case TK_ISNULL: + case TK_NOTNULL: + case TK_IS: + case TK_LIKE: + case TK_MATCH: + case TK_NMATCH: + case TK_CONTAINS: + case TK_GLOB: + case TK_BETWEEN: + case TK_IN: + case TK_GT: + case TK_GE: + case TK_LT: + case TK_LE: + return true; + default: + return false; + } + return false; +} diff --git a/src/client/src/tscUtil.c b/src/client/src/tscUtil.c index c385e37fb9..548903bcba 100644 --- a/src/client/src/tscUtil.c +++ b/src/client/src/tscUtil.c @@ -1026,7 +1026,7 @@ static void doSetupSDataBlock(SSqlRes* pRes, SSDataBlock* pBlock, void* pFilterI int8_t* p = NULL; //bool all = doFilterDataBlock(pFilterInfo, numOfFilterCols, pBlock->info.rows, p); - bool all = filterExecute(pFilterInfo, pBlock->info.rows, &p, NULL, 0); + bool all = filterExecute(pFilterInfo, pBlock->info.rows, &p, NULL, (int16_t)taosArrayGetSize(pBlock->pDataBlock)); if (!all) { if (p) { doCompactSDataBlock(pBlock, pBlock->info.rows, p); diff --git a/src/common/src/tarithoperator.c b/src/common/src/tarithoperator.c index 6f3ac3e407..6c97c3427a 100644 --- a/src/common/src/tarithoperator.c +++ b/src/common/src/tarithoperator.c @@ -164,7 +164,7 @@ _arithmetic_getVectorValueAddr_fn_t getVectorValueAddrFn(int32_t srcType) { _arithmetic_getVectorValueAddr_fn_t p = NULL; if (srcType == TSDB_DATA_TYPE_BOOL) { p = getVectorValueAddr_BOOL; - }else if(srcType == TSDB_DATA_TYPE_TINYINT) { + }else if(srcType==TSDB_DATA_TYPE_TINYINT) { p = getVectorValueAddr_TINYINT; }else if(srcType==TSDB_DATA_TYPE_UTINYINT) { p = getVectorValueAddr_UTINYINT; @@ -474,267 +474,461 @@ void vectorRemainder(void *left, int32_t len1, int32_t _left_type, void *right, } } +typedef int64_t (*_arithmetic_getVectorBigintValue_fn_t)(void *src, int32_t index); + +int64_t getVectorBigintValue_BOOL(void *src, int32_t index) { + return (int64_t)*((bool *)src + index); +} +int64_t getVectorBigintValue_TINYINT(void *src, int32_t index) { + return (int64_t)*((int8_t *)src + index); +} +int64_t getVectorBigintValue_UTINYINT(void *src, int32_t index) { + return (int64_t)*((uint8_t *)src + index); +} +int64_t getVectorBigintValue_SMALLINT(void *src, int32_t index) { + return (int64_t)*((int16_t *)src + index); +} +int64_t getVectorBigintValue_USMALLINT(void *src, int32_t index) { + return (int64_t)*((uint16_t *)src + index); +} +int64_t getVectorBigintValue_INT(void *src, int32_t index) { + return (int64_t)*((int32_t *)src + index); +} +int64_t getVectorBigintValue_UINT(void *src, int32_t index) { + return (int64_t)*((uint32_t *)src + index); +} +int64_t getVectorBigintValue_BIGINT(void *src, int32_t index) { + return (int64_t)*((int64_t *)src + index); +} +int64_t getVectorBigintValue_UBIGINT(void *src, int32_t index) { + return (int64_t)*((uint64_t *)src + index); +} + +_arithmetic_getVectorBigintValue_fn_t getVectorBigintValueFn(int32_t srcType) { + _arithmetic_getVectorBigintValue_fn_t p = NULL; + if (srcType==TSDB_DATA_TYPE_BOOL) { + p = getVectorBigintValue_BOOL; + } else if (srcType==TSDB_DATA_TYPE_TINYINT) { + p = getVectorBigintValue_TINYINT; + } else if (srcType==TSDB_DATA_TYPE_UTINYINT) { + p = getVectorBigintValue_UTINYINT; + } else if (srcType==TSDB_DATA_TYPE_SMALLINT) { + p = getVectorBigintValue_SMALLINT; + } else if (srcType==TSDB_DATA_TYPE_USMALLINT) { + p = getVectorBigintValue_USMALLINT; + }else if (srcType==TSDB_DATA_TYPE_INT) { + p = getVectorBigintValue_INT; + } else if (srcType==TSDB_DATA_TYPE_UINT) { + p = getVectorBigintValue_UINT; + } else if (srcType==TSDB_DATA_TYPE_BIGINT) { + p = getVectorBigintValue_BIGINT; + } else if (srcType==TSDB_DATA_TYPE_UBIGINT) { + p = getVectorBigintValue_UBIGINT; + } else { + assert(0); + } + return p; +} + void vectorBitand(void *left, int32_t len1, int32_t _left_type, void *right, int32_t len2, int32_t _right_type, void *out, int32_t _ord) { - int32_t i = (_ord == TSDB_ORDER_ASC) ? 0 : MAX(len1, len2) - 1; - int32_t step = (_ord == TSDB_ORDER_ASC) ? 1 : -1; - char *output = out; + int32_t i = ((_ord) == TSDB_ORDER_ASC) ? 0 : MAX(len1, len2) - 1; + int32_t step = ((_ord) == TSDB_ORDER_ASC) ? 1 : -1; + double *output = (double *)out; _arithmetic_getVectorValueAddr_fn_t getVectorValueAddrFnLeft = getVectorValueAddrFn(_left_type); _arithmetic_getVectorValueAddr_fn_t getVectorValueAddrFnRight = getVectorValueAddrFn(_right_type); + _arithmetic_getVectorBigintValue_fn_t getVectorBigintValueFnLeft = getVectorBigintValueFn(_left_type); + _arithmetic_getVectorBigintValue_fn_t getVectorBigintValueFnRight = getVectorBigintValueFn(_right_type); - if (len1 == (len2)) { - for (; i >= 0 && i < (len2); i += step) { - if (isNull(getVectorValueAddrFnLeft(left, i), _left_type) || isNull(getVectorValueAddrFnRight(right, i), _right_type)) { - switch (_left_type) { - case TSDB_DATA_TYPE_BOOL: - *(bool *) output = TSDB_DATA_BOOL_NULL; - output += sizeof(bool); - break; - case TSDB_DATA_TYPE_TINYINT: - *(int8_t *) output = TSDB_DATA_TINYINT_NULL; - output += sizeof(int8_t); - break; - case TSDB_DATA_TYPE_SMALLINT: - *(int16_t *) output = TSDB_DATA_SMALLINT_NULL; - output += sizeof(int16_t); - break; - case TSDB_DATA_TYPE_INT: - *(int32_t *) output = TSDB_DATA_INT_NULL; - output += sizeof(int32_t); - break; - case TSDB_DATA_TYPE_BIGINT: - *(int64_t *) output = TSDB_DATA_BIGINT_NULL; - output += sizeof(int64_t); - break; - - case TSDB_DATA_TYPE_UTINYINT: - *(uint8_t *) output = TSDB_DATA_UTINYINT_NULL; - output += sizeof(int8_t); - break; - case TSDB_DATA_TYPE_USMALLINT: - *(uint16_t *) output = TSDB_DATA_USMALLINT_NULL; - output += sizeof(int16_t); - break; - case TSDB_DATA_TYPE_UINT: - *(uint32_t *) output = TSDB_DATA_UINT_NULL; - output += sizeof(int32_t); - break; - case TSDB_DATA_TYPE_UBIGINT: - *(uint64_t *) output = TSDB_DATA_UBIGINT_NULL; - output += sizeof(int64_t); - break; - } + if ((len1) == (len2)) { + for (; i < (len2) && i >= 0; i += step, output += 1) { + if (isNull(getVectorValueAddrFnLeft(left,i), _left_type) || isNull(getVectorValueAddrFnRight(right,i), _right_type)) { + SET_BIGINT_NULL(output); + continue; + } + *(int64_t *) output = getVectorBigintValueFnLeft(left,i) & getVectorBigintValueFnRight(right,i); + } + } else if ((len1) == 1) { + for (; i >= 0 && i < (len2); i += step, output += 1) { + if (isNull(getVectorValueAddrFnLeft(left,0), _left_type) || isNull(getVectorValueAddrFnRight(right,i), _right_type)) { + SET_BIGINT_NULL(output); + continue; + } + *(int64_t *) output = getVectorBigintValueFnLeft(left,0) & getVectorBigintValueFnRight(right,i); + } + } else if ((len2) == 1) { + for (; i >= 0 && i < (len1); i += step, output += 1) { + if (isNull(getVectorValueAddrFnLeft(left,i), _left_type) || isNull(getVectorValueAddrFnRight(right,0), _right_type)) { + SET_BIGINT_NULL(output); + continue; + } + *(int64_t *) output = getVectorBigintValueFnLeft(left,i) & getVectorBigintValueFnRight(right,0); + } + } +} + +void vectorBitor(void *left, int32_t len1, int32_t _left_type, void *right, int32_t len2, int32_t _right_type, void *out, int32_t _ord) { + int32_t i = ((_ord) == TSDB_ORDER_ASC) ? 0 : MAX(len1, len2) - 1; + int32_t step = ((_ord) == TSDB_ORDER_ASC) ? 1 : -1; + double *output = (double *)out; + _arithmetic_getVectorValueAddr_fn_t getVectorValueAddrFnLeft = getVectorValueAddrFn(_left_type); + _arithmetic_getVectorValueAddr_fn_t getVectorValueAddrFnRight = getVectorValueAddrFn(_right_type); + _arithmetic_getVectorBigintValue_fn_t getVectorBigintValueFnLeft = getVectorBigintValueFn(_left_type); + _arithmetic_getVectorBigintValue_fn_t getVectorBigintValueFnRight = getVectorBigintValueFn(_right_type); + + if ((len1) == (len2)) { + for (; i < (len2) && i >= 0; i += step, output += 1) { + if (isNull(getVectorValueAddrFnLeft(left,i), _left_type) || isNull(getVectorValueAddrFnRight(right,i), _right_type)) { + SET_BIGINT_NULL(output); + continue; + } + *(int64_t *) output = getVectorBigintValueFnLeft(left,i) | getVectorBigintValueFnRight(right,i); + } + } else if ((len1) == 1) { + for (; i >= 0 && i < (len2); i += step, output += 1) { + if (isNull(getVectorValueAddrFnLeft(left,0), _left_type) || isNull(getVectorValueAddrFnRight(right,i), _right_type)) { + SET_BIGINT_NULL(output); + continue; + } + *(int64_t *) output = getVectorBigintValueFnLeft(left,0) | getVectorBigintValueFnRight(right,i); + } + } else if ((len2) == 1) { + for (; i >= 0 && i < (len1); i += step, output += 1) { + if (isNull(getVectorValueAddrFnLeft(left,i), _left_type) || isNull(getVectorValueAddrFnRight(right,0), _right_type)) { + SET_BIGINT_NULL(output); + continue; + } + *(int64_t *) output = getVectorBigintValueFnLeft(left,i) | getVectorBigintValueFnRight(right,0); + } + } +} + +void vectorBitxor(void *left, int32_t len1, int32_t _left_type, void *right, int32_t len2, int32_t _right_type, void *out, int32_t _ord) { + int32_t i = ((_ord) == TSDB_ORDER_ASC) ? 0 : MAX(len1, len2) - 1; + int32_t step = ((_ord) == TSDB_ORDER_ASC) ? 1 : -1; + double *output=(double*)out; + _arithmetic_getVectorValueAddr_fn_t getVectorValueAddrFnLeft = getVectorValueAddrFn(_left_type); + _arithmetic_getVectorValueAddr_fn_t getVectorValueAddrFnRight = getVectorValueAddrFn(_right_type); + _arithmetic_getVectorBigintValue_fn_t getVectorBigintValueFnLeft = getVectorBigintValueFn(_left_type); + _arithmetic_getVectorBigintValue_fn_t getVectorBigintValueFnRight = getVectorBigintValueFn(_right_type); + + if ((len1) == (len2)) { + for (; i < (len2) && i >= 0; i += step, output += 1) { + if (isNull(getVectorValueAddrFnLeft(left,i), _left_type) || isNull(getVectorValueAddrFnRight(right,i), _right_type)) { + SET_BIGINT_NULL(output); + continue; + } + *(int64_t *) output = getVectorBigintValueFnLeft(left,i) ^ getVectorBigintValueFnRight(right,i); + } + } else if ((len1) == 1) { + for (; i >= 0 && i < (len2); i += step, output += 1) { + if (isNull(getVectorValueAddrFnLeft(left,0), _left_type) || isNull(getVectorValueAddrFnRight(right,i), _right_type)) { + SET_BIGINT_NULL(output); continue; } + *(int64_t *) output = getVectorBigintValueFnLeft(left,0) ^ getVectorBigintValueFnRight(right,i); + } + } else if ((len2) == 1) { + for (; i >= 0 && i < (len1); i += step, output += 1) { + if (isNull(getVectorValueAddrFnLeft(left,i), _left_type) || isNull(getVectorValueAddrFnRight(right,0), _right_type)) { + SET_BIGINT_NULL(output); + continue; + } + *(int64_t *) output = getVectorBigintValueFnLeft(left,i) ^ getVectorBigintValueFnRight(right,0); + } + } +} + +void vectorBitnot(void *left, int32_t len1, int32_t _left_type, void *right, int32_t len2, int32_t _right_type, void *out, int32_t _ord) { + int32_t i = ((_ord) == TSDB_ORDER_ASC) ? 0 : MAX(len1, len2) - 1; + int32_t step = ((_ord) == TSDB_ORDER_ASC) ? 1 : -1; + char *output = (char *) out; + _arithmetic_getVectorValueAddr_fn_t getVectorValueAddrFnLeft = getVectorValueAddrFn(_left_type); + for (; i < (len1) && i >= 0; i += step) { + if (isNull(getVectorValueAddrFnLeft(left,i), _left_type)) { switch (_left_type) { case TSDB_DATA_TYPE_BOOL: - *(bool *) output = (*((bool *) left + i)) & (*((bool *) right + i)); - output += sizeof(bool); - break; + *(bool *) output = TSDB_DATA_BOOL_NULL; + output += sizeof(bool); + break; case TSDB_DATA_TYPE_TINYINT: - *(int8_t *) output = (*((int8_t *) left + i)) & (*((int8_t *) right + i)); - output += sizeof(int8_t); - break; + *(int8_t *) output = TSDB_DATA_TINYINT_NULL; + output += sizeof(int8_t); + break; case TSDB_DATA_TYPE_SMALLINT: - *(int16_t *) output = (*((int16_t *) left + i)) & (*((int16_t *) right + i)); - output += sizeof(int16_t); - break; + *(int16_t *) output = TSDB_DATA_SMALLINT_NULL; + output += sizeof(int16_t); + break; case TSDB_DATA_TYPE_INT: - *(int32_t *) output = (*((int32_t *) left + i)) & (*((int32_t *) right + i)); - output += sizeof(int32_t); - break; + *(int32_t *) output = TSDB_DATA_INT_NULL; + output += sizeof(int32_t); + break; case TSDB_DATA_TYPE_BIGINT: - *(int64_t *) output = (*((int64_t *) left + i)) & (*((int64_t *) right + i)); - output += sizeof(int64_t); - break; + *(int64_t *) output = TSDB_DATA_BIGINT_NULL; + output += sizeof(int64_t); + break; case TSDB_DATA_TYPE_UTINYINT: - *(uint8_t *) output = (*((uint8_t *) left + i)) & (*((uint8_t *) right + i)); - output += sizeof(int8_t); - break; + *(uint8_t *) output = TSDB_DATA_UTINYINT_NULL; + output += sizeof(int8_t); + break; case TSDB_DATA_TYPE_USMALLINT: - *(uint16_t *) output = (*((uint16_t *) left + i)) & (*((uint16_t *) right + i)); - output += sizeof(int16_t); - break; + *(uint16_t *) output = TSDB_DATA_USMALLINT_NULL; + output += sizeof(int16_t); + break; case TSDB_DATA_TYPE_UINT: - *(uint32_t *) output = (*((uint32_t *) left + i)) & (*((uint32_t *) right + i)); - output += sizeof(int32_t); - break; + *(uint32_t *) output = TSDB_DATA_UINT_NULL; + output += sizeof(int32_t); + break; case TSDB_DATA_TYPE_UBIGINT: - *(uint64_t *) output = (*((uint64_t *) left + i)) & (*((uint64_t *) right + i)); - output += sizeof(int64_t); - break; + *(uint64_t *) output = TSDB_DATA_UBIGINT_NULL; + output += sizeof(int64_t); + break; } + + continue; } - } else if (len1 == 1) { - for (; i >= 0 && i < (len2); i += step) { - if (isNull(getVectorValueAddrFnLeft(left, 0), _left_type) || isNull(getVectorValueAddrFnRight(right, i), _right_type)) { - switch (_left_type) { - case TSDB_DATA_TYPE_BOOL: - *(bool *) output = TSDB_DATA_BOOL_NULL; - output += sizeof(bool); - break; - case TSDB_DATA_TYPE_TINYINT: - *(int8_t *) output = TSDB_DATA_TINYINT_NULL; - output += sizeof(int8_t); - break; - case TSDB_DATA_TYPE_SMALLINT: - *(int16_t *) output = TSDB_DATA_SMALLINT_NULL; - output += sizeof(int16_t); - break; - case TSDB_DATA_TYPE_INT: - *(int32_t *) output = TSDB_DATA_INT_NULL; - output += sizeof(int32_t); - break; - case TSDB_DATA_TYPE_BIGINT: - *(int64_t *) output = TSDB_DATA_BIGINT_NULL; - output += sizeof(int64_t); - break; - - case TSDB_DATA_TYPE_UTINYINT: - *(uint8_t *) output = TSDB_DATA_UTINYINT_NULL; - output += sizeof(int8_t); - break; - case TSDB_DATA_TYPE_USMALLINT: - *(uint16_t *) output = TSDB_DATA_USMALLINT_NULL; - output += sizeof(int16_t); - break; - case TSDB_DATA_TYPE_UINT: - *(uint32_t *) output = TSDB_DATA_UINT_NULL; - output += sizeof(int32_t); - break; - case TSDB_DATA_TYPE_UBIGINT: - *(uint64_t *) output = TSDB_DATA_UBIGINT_NULL; - output += sizeof(int64_t); - break; - } - continue; - } + switch (_left_type) { + case TSDB_DATA_TYPE_BOOL: + if (*((bool *)left + i)) { + *(bool *)output = 0; + } else { + *(bool *)output = 1; + } + output += sizeof(bool); + break; + case TSDB_DATA_TYPE_TINYINT: + *(int8_t *) output = ~(*((int8_t *) left + i)); + output += sizeof(int8_t); + break; + case TSDB_DATA_TYPE_SMALLINT: + *(int16_t *) output = ~(*((int16_t *) left + i)); + output += sizeof(int16_t); + break; + case TSDB_DATA_TYPE_INT: + *(int32_t *) output = ~(*((int32_t *) left + i)); + output += sizeof(int32_t); + break; + case TSDB_DATA_TYPE_BIGINT: + *(int64_t *) output = ~(*((int64_t *) left + i)); + output += sizeof(int64_t); + break; + + case TSDB_DATA_TYPE_UTINYINT: + *(uint8_t *) output = ~(*((uint8_t *) left + i)); + output += sizeof(int8_t); + break; + case TSDB_DATA_TYPE_USMALLINT: + *(uint16_t *) output = ~(*((uint16_t *) left + i)); + output += sizeof(int16_t); + break; + case TSDB_DATA_TYPE_UINT: + *(uint32_t *) output = ~(*((uint32_t *) left + i)); + output += sizeof(int32_t); + break; + case TSDB_DATA_TYPE_UBIGINT: + *(uint64_t *) output = ~(*((uint64_t *) left + i)); + output += sizeof(int64_t); + break; + } + } +} + +void vectorLshift(void *left, int32_t len1, int32_t _left_type, void *right, int32_t len2, int32_t _right_type, void *out, int32_t _ord) { + int32_t i = ((_ord) == TSDB_ORDER_ASC) ? 0 : MAX(len1, len2) - 1; + int32_t step = ((_ord) == TSDB_ORDER_ASC) ? 1 : -1; + + // the right operand is a number + if (len2 != 1) { + return; + } + + char *output = (char *) out; + _arithmetic_getVectorValueAddr_fn_t getVectorValueAddrFnLeft = getVectorValueAddrFn(_left_type); + + for (; i < (len1) && i >= 0; i += step) { + if (isNull(getVectorValueAddrFnLeft(left,i), _left_type)) { switch (_left_type) { case TSDB_DATA_TYPE_BOOL: - *(bool *) output = (*(bool *) left) & (*((bool *) right + i)); - output += sizeof(bool); - break; + *(bool *) output = TSDB_DATA_BOOL_NULL; + output += sizeof(bool); + break; case TSDB_DATA_TYPE_TINYINT: - *(int8_t *) output = (*(int8_t *) left) & (*((int8_t *) right + i)); - output += sizeof(int8_t); - break; + *(int8_t *) output = TSDB_DATA_TINYINT_NULL; + output += sizeof(int8_t); + break; case TSDB_DATA_TYPE_SMALLINT: - *(int16_t *) output = (*(int16_t *) left) & (*((int16_t *) right + i)); - output += sizeof(int16_t); - break; + *(int16_t *) output = TSDB_DATA_SMALLINT_NULL; + output += sizeof(int16_t); + break; case TSDB_DATA_TYPE_INT: - *(int32_t *) output = (*(int32_t *) left) & (*((int32_t *) right + i)); - output += sizeof(int32_t); - break; + *(int32_t *) output = TSDB_DATA_INT_NULL; + output += sizeof(int32_t); + break; case TSDB_DATA_TYPE_BIGINT: - *(int64_t *) output = (*(int64_t *) left) & (*((int64_t *) right + i)); - output += sizeof(int64_t); - break; + *(int64_t *) output = TSDB_DATA_BIGINT_NULL; + output += sizeof(int64_t); + break; case TSDB_DATA_TYPE_UTINYINT: - *(uint8_t *) output = (*(uint8_t *) left) & (*((uint8_t *) right + i)); - output += sizeof(int8_t); - break; + *(uint8_t *) output = TSDB_DATA_UTINYINT_NULL; + output += sizeof(int8_t); + break; case TSDB_DATA_TYPE_USMALLINT: - *(uint16_t *) output = (*(uint16_t *) left) & (*((uint16_t *) right + i)); - output += sizeof(int16_t); - break; + *(uint16_t *) output = TSDB_DATA_USMALLINT_NULL; + output += sizeof(int16_t); + break; case TSDB_DATA_TYPE_UINT: - *(uint32_t *) output = (*(uint32_t *) left) & (*((uint32_t *) right + i)); - output += sizeof(int32_t); - break; + *(uint32_t *) output = TSDB_DATA_UINT_NULL; + output += sizeof(int32_t); + break; case TSDB_DATA_TYPE_UBIGINT: - *(uint64_t *) output = (*(uint64_t *) left) & (*((uint64_t *) right + i)); - output += sizeof(int64_t); - break; + *(uint64_t *) output = TSDB_DATA_UBIGINT_NULL; + output += sizeof(int64_t); + break; } + + continue; } - } else if ((len2) == 1) { - for (; i >= 0 && i < len1; i += step) { - if (isNull(getVectorValueAddrFnLeft(left, i), _left_type) || isNull(getVectorValueAddrFnRight(right, 0), _right_type)) { - switch (_left_type) { - case TSDB_DATA_TYPE_BOOL: - *(bool *) output = TSDB_DATA_BOOL_NULL; - output += sizeof(bool); - break; - case TSDB_DATA_TYPE_TINYINT: - *(int8_t *) output = TSDB_DATA_TINYINT_NULL; - output += sizeof(int8_t); - break; - case TSDB_DATA_TYPE_SMALLINT: - *(int16_t *) output = TSDB_DATA_SMALLINT_NULL; - output += sizeof(int16_t); - break; - case TSDB_DATA_TYPE_INT: - *(int32_t *) output = TSDB_DATA_INT_NULL; - output += sizeof(int32_t); - break; - case TSDB_DATA_TYPE_BIGINT: - *(int64_t *) output = TSDB_DATA_BIGINT_NULL; - output += sizeof(int64_t); - break; - - case TSDB_DATA_TYPE_UTINYINT: - *(uint8_t *) output = TSDB_DATA_UTINYINT_NULL; - output += sizeof(int8_t); - break; - case TSDB_DATA_TYPE_USMALLINT: - *(uint16_t *) output = TSDB_DATA_USMALLINT_NULL; - output += sizeof(int16_t); - break; - case TSDB_DATA_TYPE_UINT: - *(uint32_t *) output = TSDB_DATA_UINT_NULL; - output += sizeof(int32_t); - break; - case TSDB_DATA_TYPE_UBIGINT: - *(uint64_t *) output = TSDB_DATA_UBIGINT_NULL; - output += sizeof(int64_t); - break; - } - continue; - } + switch (_left_type) { + case TSDB_DATA_TYPE_BOOL: + *(bool *)output = 0; + output += sizeof(bool); + break; + case TSDB_DATA_TYPE_TINYINT: + *(int8_t *) output = *((int8_t *) left + i) << *(int8_t *) right; + output += sizeof(int8_t); + break; + case TSDB_DATA_TYPE_SMALLINT: + *(int16_t *) output = *((int16_t *) left + i) << *(int16_t *) right; + output += sizeof(int16_t); + break; + case TSDB_DATA_TYPE_INT: + *(int32_t *) output = *((int32_t *) left + i) << *(int32_t *) right; + output += sizeof(int32_t); + break; + case TSDB_DATA_TYPE_BIGINT: + *(int64_t *) output = *((int64_t *) left + i) << *(int64_t *) right; + output += sizeof(int64_t); + break; + + case TSDB_DATA_TYPE_UTINYINT: + *(uint8_t *) output = *((uint8_t *) left + i) << *(uint8_t *) right; + output += sizeof(int8_t); + break; + case TSDB_DATA_TYPE_USMALLINT: + *(uint16_t *) output = *((uint16_t *) left + i) << *(uint16_t *) right; + output += sizeof(int16_t); + break; + case TSDB_DATA_TYPE_UINT: + *(uint32_t *) output = *((uint32_t *) left + i) << *(uint32_t *) right; + output += sizeof(int32_t); + break; + case TSDB_DATA_TYPE_UBIGINT: + *(uint64_t *) output = *((uint64_t *) left + i) << *(uint64_t *) right; + output += sizeof(int64_t); + break; + } + } +} + +void vectorRshift(void *left, int32_t len1, int32_t _left_type, void *right, int32_t len2, int32_t _right_type, void *out, int32_t _ord) { + int32_t i = ((_ord) == TSDB_ORDER_ASC) ? 0 : MAX(len1, len2) - 1; + int32_t step = ((_ord) == TSDB_ORDER_ASC) ? 1 : -1; + + // the right operand is a number + if (len2 != 1) { + return; + } + + char *output = (char *) out; + _arithmetic_getVectorValueAddr_fn_t getVectorValueAddrFnLeft = getVectorValueAddrFn(_left_type); + + for (; i < (len1) && i >= 0; i += step) { + if (isNull(getVectorValueAddrFnLeft(left,i), _left_type)) { switch (_left_type) { case TSDB_DATA_TYPE_BOOL: - *(bool *) output = (*((bool *) left + i)) & (*(bool *) right); - output += sizeof(bool); - break; + *(bool *) output = TSDB_DATA_BOOL_NULL; + output += sizeof(bool); + break; case TSDB_DATA_TYPE_TINYINT: - *(int8_t *) output = (*((int8_t *) left + i)) & (*(int8_t *) right); - output += sizeof(int8_t); - break; + *(int8_t *) output = TSDB_DATA_TINYINT_NULL; + output += sizeof(int8_t); + break; case TSDB_DATA_TYPE_SMALLINT: - *(int16_t *) output = (*((int16_t *) left + i)) & (*(int16_t *) right); - output += sizeof(int16_t); - break; + *(int16_t *) output = TSDB_DATA_SMALLINT_NULL; + output += sizeof(int16_t); + break; case TSDB_DATA_TYPE_INT: - *(int32_t *) output = (*((int32_t *) left + i)) & (*(int32_t *) right); - output += sizeof(int32_t); - break; + *(int32_t *) output = TSDB_DATA_INT_NULL; + output += sizeof(int32_t); + break; case TSDB_DATA_TYPE_BIGINT: - *(int64_t *) output = (*((int64_t *) left + i)) & (*(int64_t *) right); - output += sizeof(int64_t); - break; + *(int64_t *) output = TSDB_DATA_BIGINT_NULL; + output += sizeof(int64_t); + break; case TSDB_DATA_TYPE_UTINYINT: - *(uint8_t *) output = (*((uint8_t *) left + i)) & (*(uint8_t *) right); - output += sizeof(int8_t); - break; + *(uint8_t *) output = TSDB_DATA_UTINYINT_NULL; + output += sizeof(int8_t); + break; case TSDB_DATA_TYPE_USMALLINT: - *(uint16_t *) output = (*((uint16_t *) left + i)) & (*(uint16_t *) right); - output += sizeof(int16_t); - break; + *(uint16_t *) output = TSDB_DATA_USMALLINT_NULL; + output += sizeof(int16_t); + break; case TSDB_DATA_TYPE_UINT: - *(uint32_t *) output = (*((uint32_t *) left + i)) & (*(uint32_t *) right); - output += sizeof(int32_t); - break; + *(uint32_t *) output = TSDB_DATA_UINT_NULL; + output += sizeof(int32_t); + break; case TSDB_DATA_TYPE_UBIGINT: - *(uint64_t *) output = (*((uint64_t *) left + i)) & (*(uint64_t *) right); - output += sizeof(int64_t); - break; + *(uint64_t *) output = TSDB_DATA_UBIGINT_NULL; + output += sizeof(int64_t); + break; } + + continue; + } + + switch (_left_type) { + case TSDB_DATA_TYPE_BOOL: + *(bool *)output = 0; + output += sizeof(bool); + break; + case TSDB_DATA_TYPE_TINYINT: + *(int8_t *) output = *((int8_t *) left + i) >> *(int8_t *) right; + output += sizeof(int8_t); + break; + case TSDB_DATA_TYPE_SMALLINT: + *(int16_t *) output = *((int16_t *) left + i) >> *(int16_t *) right; + output += sizeof(int16_t); + break; + case TSDB_DATA_TYPE_INT: + *(int32_t *) output = *((int32_t *) left + i) >> *(int32_t *) right; + output += sizeof(int32_t); + break; + case TSDB_DATA_TYPE_BIGINT: + *(int64_t *) output = *((int64_t *) left + i) >> *(int64_t *) right; + output += sizeof(int64_t); + break; + + case TSDB_DATA_TYPE_UTINYINT: + *(uint8_t *) output = *((uint8_t *) left + i) >> *(uint8_t *) right; + output += sizeof(int8_t); + break; + case TSDB_DATA_TYPE_USMALLINT: + *(uint16_t *) output = *((uint16_t *) left + i) >> *(uint16_t *) right; + output += sizeof(int16_t); + break; + case TSDB_DATA_TYPE_UINT: + *(uint32_t *) output = *((uint32_t *) left + i) >> *(uint32_t *) right; + output += sizeof(int32_t); + break; + case TSDB_DATA_TYPE_UBIGINT: + *(uint64_t *) output = *((uint64_t *) left + i) >> *(uint64_t *) right; + output += sizeof(int64_t); + break; } } } @@ -753,6 +947,16 @@ _arithmetic_operator_fn_t getArithmeticOperatorFn(int32_t arithmeticOptr) { return vectorRemainder; case TSDB_BINARY_OP_BITAND: return vectorBitand; + case TSDB_BINARY_OP_BITOR: + return vectorBitor; + case TSDB_BINARY_OP_BITXOR: + return vectorBitxor; + case TSDB_BINARY_OP_BITNOT: + return vectorBitnot; + case TSDB_BINARY_OP_LSHIFT: + return vectorLshift; + case TSDB_BINARY_OP_RSHIFT: + return vectorRshift; default: assert(0); return NULL; diff --git a/src/common/src/texpr.c b/src/common/src/texpr.c index d348beb20c..a213354671 100644 --- a/src/common/src/texpr.c +++ b/src/common/src/texpr.c @@ -109,7 +109,6 @@ int32_t exprTreeValidateFunctionNode(char* msgbuf, tExprNode *pExpr) { int32_t exprTreeValidateExprNode(tExprNode *pExpr) { int16_t leftType = pExpr->_node.pLeft->resultType; int16_t rightType = pExpr->_node.pRight->resultType; - int16_t resultType = leftType; if (pExpr->_node.optr == TSDB_BINARY_OP_ADD || pExpr->_node.optr == TSDB_BINARY_OP_SUBTRACT || pExpr->_node.optr == TSDB_BINARY_OP_MULTIPLY || pExpr->_node.optr == TSDB_BINARY_OP_DIVIDE || @@ -135,171 +134,31 @@ int32_t exprTreeValidateExprNode(tExprNode *pExpr) { pExpr->resultBytes = tDataTypes[TSDB_DATA_TYPE_DOUBLE].bytes; } return TSDB_CODE_SUCCESS; - } else if (pExpr->_node.optr == TSDB_BINARY_OP_BITAND) { - if ((leftType != TSDB_DATA_TYPE_BOOL && !IS_SIGNED_NUMERIC_TYPE(leftType) && !IS_UNSIGNED_NUMERIC_TYPE(leftType)) || - (rightType != TSDB_DATA_TYPE_BOOL && !IS_SIGNED_NUMERIC_TYPE(rightType) && !IS_UNSIGNED_NUMERIC_TYPE(rightType))) - { + } else if (pExpr->_node.optr == TSDB_BINARY_OP_BITAND || pExpr->_node.optr == TSDB_BINARY_OP_BITOR || + pExpr->_node.optr == TSDB_BINARY_OP_BITXOR || pExpr->_node.optr == TSDB_BINARY_OP_LSHIFT || + pExpr->_node.optr == TSDB_BINARY_OP_RSHIFT) + { + if (!IS_NUMERIC_TYPE(leftType) || !IS_NUMERIC_TYPE(rightType)) { return TSDB_CODE_TSC_INVALID_OPERATION; } - - uint8_t schemaType; - // now leftType and rightType are both numeric - if (pExpr->_node.pLeft->nodeType == TSQL_NODE_COL && pExpr->_node.pRight->nodeType == TSQL_NODE_COL) { - if (leftType != rightType) { - return TSDB_CODE_TSC_INVALID_OPERATION; - } - } else if (pExpr->_node.pLeft->nodeType == TSQL_NODE_COL) { - if (pExpr->_node.pRight->nodeType != TSQL_NODE_VALUE) { - return TSDB_CODE_TSC_INVALID_OPERATION; - } else { - schemaType = pExpr->_node.pLeft->pSchema->type; - int64_t sVal = pExpr->_node.pRight->pVal->i64; - uint64_t uVal = pExpr->_node.pRight->pVal->u64; - - switch (schemaType) { - case TSDB_DATA_TYPE_BOOL: - if ((pExpr->_node.pRight->pVal->nType != TSDB_DATA_TYPE_BOOL) || - (pExpr->_node.pRight->pVal->i64 != 0 && - pExpr->_node.pRight->pVal->i64 != 1 && - pExpr->_node.pRight->pVal->i64 != TSDB_DATA_BOOL_NULL)) - { - return TSDB_CODE_TSC_INVALID_OPERATION; - } - break; - case TSDB_DATA_TYPE_TINYINT: - if (sVal < -128 || sVal > 127) { - return TSDB_CODE_TSC_INVALID_OPERATION; - } - break; - case TSDB_DATA_TYPE_SMALLINT: - if (sVal < -32768 || sVal > 32767) { - return TSDB_CODE_TSC_INVALID_OPERATION; - } - break; - case TSDB_DATA_TYPE_INT: - if (sVal < INT32_MIN || sVal > INT32_MAX) { - return TSDB_CODE_TSC_INVALID_OPERATION; - } - break; - case TSDB_DATA_TYPE_BIGINT: - if (sVal < INT64_MIN || sVal > INT64_MAX) { - return TSDB_CODE_TSC_INVALID_OPERATION; - } - break; - case TSDB_DATA_TYPE_UTINYINT: - if (uVal > 255) { - return TSDB_CODE_TSC_INVALID_OPERATION; - } - break; - case TSDB_DATA_TYPE_USMALLINT: - if (uVal > 65535) { - return TSDB_CODE_TSC_INVALID_OPERATION; - } - break; - case TSDB_DATA_TYPE_UINT: - if (uVal > UINT32_MAX) { - return TSDB_CODE_TSC_INVALID_OPERATION; - } - break; - case TSDB_DATA_TYPE_UBIGINT: - if (uVal > UINT64_MAX) { - return TSDB_CODE_TSC_INVALID_OPERATION; - } - break; - } - - pExpr->_node.pRight->pSchema->type = schemaType; - pExpr->_node.pRight->pVal->nType = schemaType; - - pExpr->_node.pRight->resultType = schemaType; - pExpr->_node.pRight->resultBytes = tDataTypes[schemaType].bytes; - } - } else { - if (pExpr->_node.pLeft->nodeType != TSQL_NODE_VALUE) { - return TSDB_CODE_TSC_INVALID_OPERATION; - } else { - schemaType = pExpr->_node.pRight->pSchema->type; - int64_t sVal = pExpr->_node.pLeft->pVal->i64; - uint64_t uVal = pExpr->_node.pLeft->pVal->u64; - switch (schemaType) { - case TSDB_DATA_TYPE_BOOL: - if ((pExpr->_node.pLeft->pVal->nType != TSDB_DATA_TYPE_BOOL) || - (pExpr->_node.pLeft->pVal->i64 != 0 && - pExpr->_node.pLeft->pVal->i64 != 1 && - pExpr->_node.pLeft->pVal->i64 != TSDB_DATA_BOOL_NULL)) - { - return TSDB_CODE_TSC_INVALID_OPERATION; - } - pExpr->_node.pLeft->pVal->nLen = 1; - break; - case TSDB_DATA_TYPE_TINYINT: - if (sVal < -128 || sVal > 127) { - return TSDB_CODE_TSC_INVALID_OPERATION; - } - pExpr->_node.pLeft->pVal->nLen = 1; - break; - case TSDB_DATA_TYPE_SMALLINT: - if (sVal < -32768 || sVal > 32767) { - return TSDB_CODE_TSC_INVALID_OPERATION; - } - pExpr->_node.pLeft->pVal->nLen = 2; - break; - case TSDB_DATA_TYPE_INT: - if (sVal < INT32_MIN || sVal > INT32_MAX) { - return TSDB_CODE_TSC_INVALID_OPERATION; - } - pExpr->_node.pLeft->pVal->nLen = 4; - break; - case TSDB_DATA_TYPE_BIGINT: - if (sVal < INT64_MIN || sVal > INT64_MAX) { - return TSDB_CODE_TSC_INVALID_OPERATION; - } - pExpr->_node.pLeft->pVal->nLen = 8; - break; - case TSDB_DATA_TYPE_UTINYINT: - if (uVal > 255) { - return TSDB_CODE_TSC_INVALID_OPERATION; - } - pExpr->_node.pLeft->pVal->nLen = 1; - break; - case TSDB_DATA_TYPE_USMALLINT: - if (uVal > 65535) { - return TSDB_CODE_TSC_INVALID_OPERATION; - } - pExpr->_node.pLeft->pVal->nLen = 2; - break; - case TSDB_DATA_TYPE_UINT: - if (uVal > UINT32_MAX) { - return TSDB_CODE_TSC_INVALID_OPERATION; - } - pExpr->_node.pLeft->pVal->nLen = 4; - break; - case TSDB_DATA_TYPE_UBIGINT: - if (uVal > UINT64_MAX) { - return TSDB_CODE_TSC_INVALID_OPERATION; - } - pExpr->_node.pLeft->pVal->nLen = 8; - break; - } - - pExpr->_node.pLeft->pSchema->type = schemaType; - pExpr->_node.pLeft->pVal->nType = schemaType; - - pExpr->_node.pLeft->resultType = schemaType; - pExpr->_node.pLeft->resultBytes = tDataTypes[schemaType].bytes; - } - - resultType = schemaType; + if (IS_FLOAT_TYPE(leftType) || IS_FLOAT_TYPE(rightType)) { + return TSDB_CODE_TSC_INVALID_OPERATION; } - - if (resultType == TSDB_DATA_TYPE_BOOL) { - pExpr->resultType = TSDB_DATA_TYPE_BOOL; - pExpr->resultBytes = tDataTypes[TSDB_DATA_TYPE_BOOL].bytes; + if (pExpr->_node.optr == TSDB_BINARY_OP_LSHIFT || pExpr->_node.optr == TSDB_BINARY_OP_RSHIFT) { + pExpr->resultType = leftType; + pExpr->resultBytes = tDataTypes[leftType].bytes; } else { - pExpr->resultType = resultType; - pExpr->resultBytes = tDataTypes[resultType].bytes; + pExpr->resultType = TSDB_DATA_TYPE_BIGINT; + pExpr->resultBytes = tDataTypes[TSDB_DATA_TYPE_BIGINT].bytes; } return TSDB_CODE_SUCCESS; + } else if (pExpr->_node.optr == TSDB_BINARY_OP_BITNOT) { + if (!IS_NUMERIC_TYPE(leftType) || IS_FLOAT_TYPE(leftType)) { + return TSDB_CODE_TSC_INVALID_OPERATION; + } + pExpr->resultType = leftType; + pExpr->resultBytes = tDataTypes[leftType].bytes; + return TSDB_CODE_SUCCESS; } else { return TSDB_CODE_SUCCESS; } @@ -689,6 +548,9 @@ void exprTreeExprNodeTraverse(tExprNode *pExpr, int32_t numOfRows, tExprOperandI rightType = pRight->pSchema->type; rightNum = numOfRows; + } else if (pRight->nodeType == TSQL_NODE_DUMMY) { + /* BITNOT */ + rightNum = 0; } else { assert(pRight->nodeType == TSQL_NODE_VALUE); rightIn = (char *)&pRight->pVal->i64; @@ -703,7 +565,10 @@ void exprTreeExprNodeTraverse(tExprNode *pExpr, int32_t numOfRows, tExprOperandI if(leftType == TSDB_DATA_TYPE_TIMESTAMP || rightType == TSDB_DATA_TYPE_TIMESTAMP) { output->type = TSDB_DATA_TYPE_BIGINT; } else { - if (pExpr->_node.optr == TSDB_BINARY_OP_BITAND) { + if (pExpr->_node.optr == TSDB_BINARY_OP_BITAND || pExpr->_node.optr == TSDB_BINARY_OP_BITOR || + pExpr->_node.optr == TSDB_BINARY_OP_BITXOR || pExpr->_node.optr == TSDB_BINARY_OP_BITNOT || + pExpr->_node.optr == TSDB_BINARY_OP_LSHIFT || pExpr->_node.optr == TSDB_BINARY_OP_RSHIFT) + { output->type = leftType; // rightType must be the same as leftType } else { output->type = TSDB_DATA_TYPE_DOUBLE; diff --git a/src/inc/taosdef.h b/src/inc/taosdef.h index 8f262252b0..9d4b472d89 100644 --- a/src/inc/taosdef.h +++ b/src/inc/taosdef.h @@ -184,10 +184,15 @@ do { \ #define TSDB_BINARY_OP_DIVIDE 33 #define TSDB_BINARY_OP_REMAINDER 34 #define TSDB_BINARY_OP_BITAND 35 +#define TSDB_BINARY_OP_BITOR 36 +#define TSDB_BINARY_OP_BITXOR 37 +#define TSDB_BINARY_OP_BITNOT 38 +#define TSDB_BINARY_OP_LSHIFT 39 +#define TSDB_BINARY_OP_RSHIFT 40 #define IS_RELATION_OPTR(op) (((op) >= TSDB_RELATION_LESS) && ((op) < TSDB_RELATION_IN)) -#define IS_ARITHMETIC_OPTR(op) (((op) >= TSDB_BINARY_OP_ADD) && ((op) <= TSDB_BINARY_OP_BITAND)) +#define IS_ARITHMETIC_OPTR(op) (((op) >= TSDB_BINARY_OP_ADD) && ((op) <= TSDB_BINARY_OP_RSHIFT)) #define TS_PATH_DELIMITER_LEN 1 diff --git a/src/inc/ttokendef.h b/src/inc/ttokendef.h index 1926999b2c..ce21a2c65a 100644 --- a/src/inc/ttokendef.h +++ b/src/inc/ttokendef.h @@ -50,177 +50,177 @@ #define TK_LE 32 #define TK_BITAND 33 #define TK_BITOR 34 -#define TK_LSHIFT 35 -#define TK_RSHIFT 36 -#define TK_PLUS 37 -#define TK_MINUS 38 -#define TK_DIVIDE 39 -#define TK_TIMES 40 -#define TK_STAR 41 -#define TK_SLASH 42 -#define TK_REM 43 -#define TK_UMINUS 44 -#define TK_UPLUS 45 -#define TK_BITNOT 46 -#define TK_ARROW 47 -#define TK_SHOW 48 -#define TK_DATABASES 49 -#define TK_TOPICS 50 -#define TK_FUNCTIONS 51 -#define TK_MNODES 52 -#define TK_DNODES 53 -#define TK_ACCOUNTS 54 -#define TK_USERS 55 -#define TK_MODULES 56 -#define TK_QUERIES 57 -#define TK_CONNECTIONS 58 -#define TK_STREAMS 59 -#define TK_VARIABLES 60 -#define TK_SCORES 61 -#define TK_GRANTS 62 -#define TK_VNODES 63 -#define TK_DOT 64 -#define TK_CREATE 65 -#define TK_TABLE 66 -#define TK_STABLE 67 -#define TK_DATABASE 68 -#define TK_TABLES 69 -#define TK_STABLES 70 -#define TK_VGROUPS 71 -#define TK_DROP 72 -#define TK_TOPIC 73 -#define TK_FUNCTION 74 -#define TK_DNODE 75 -#define TK_USER 76 -#define TK_ACCOUNT 77 -#define TK_USE 78 -#define TK_DESCRIBE 79 -#define TK_DESC 80 -#define TK_ALTER 81 -#define TK_PASS 82 -#define TK_PRIVILEGE 83 -#define TK_LOCAL 84 -#define TK_COMPACT 85 -#define TK_LP 86 -#define TK_RP 87 -#define TK_IF 88 -#define TK_EXISTS 89 -#define TK_AS 90 -#define TK_OUTPUTTYPE 91 -#define TK_AGGREGATE 92 -#define TK_BUFSIZE 93 -#define TK_PPS 94 -#define TK_TSERIES 95 -#define TK_DBS 96 -#define TK_STORAGE 97 -#define TK_QTIME 98 -#define TK_CONNS 99 -#define TK_STATE 100 -#define TK_COMMA 101 -#define TK_KEEP 102 -#define TK_CACHE 103 -#define TK_REPLICA 104 -#define TK_QUORUM 105 -#define TK_DAYS 106 -#define TK_MINROWS 107 -#define TK_MAXROWS 108 -#define TK_BLOCKS 109 -#define TK_CTIME 110 -#define TK_WAL 111 -#define TK_FSYNC 112 -#define TK_COMP 113 -#define TK_PRECISION 114 -#define TK_UPDATE 115 -#define TK_CACHELAST 116 -#define TK_PARTITIONS 117 -#define TK_UNSIGNED 118 -#define TK_TAGS 119 -#define TK_USING 120 -#define TK_TO 121 -#define TK_SPLIT 122 -#define TK_NULL 123 -#define TK_NOW 124 -#define TK_VARIABLE 125 -#define TK_SELECT 126 -#define TK_UNION 127 -#define TK_ALL 128 -#define TK_DISTINCT 129 -#define TK_FROM 130 -#define TK_RANGE 131 -#define TK_INTERVAL 132 -#define TK_EVERY 133 -#define TK_SESSION 134 -#define TK_STATE_WINDOW 135 -#define TK_FILL 136 -#define TK_SLIDING 137 -#define TK_ORDER 138 -#define TK_BY 139 -#define TK_ASC 140 -#define TK_GROUP 141 -#define TK_HAVING 142 -#define TK_LIMIT 143 -#define TK_OFFSET 144 -#define TK_SLIMIT 145 -#define TK_SOFFSET 146 -#define TK_WHERE 147 -#define TK_TODAY 148 -#define TK_RESET 149 -#define TK_QUERY 150 -#define TK_SYNCDB 151 -#define TK_ADD 152 -#define TK_COLUMN 153 -#define TK_MODIFY 154 -#define TK_TAG 155 -#define TK_CHANGE 156 -#define TK_SET 157 -#define TK_KILL 158 -#define TK_CONNECTION 159 -#define TK_STREAM 160 -#define TK_COLON 161 -#define TK_DELETE 162 -#define TK_ABORT 163 -#define TK_AFTER 164 -#define TK_ATTACH 165 -#define TK_BEFORE 166 -#define TK_BEGIN 167 -#define TK_CASCADE 168 -#define TK_CLUSTER 169 -#define TK_CONFLICT 170 -#define TK_COPY 171 -#define TK_DEFERRED 172 -#define TK_DELIMITERS 173 -#define TK_DETACH 174 -#define TK_EACH 175 -#define TK_END 176 -#define TK_EXPLAIN 177 -#define TK_FAIL 178 -#define TK_FOR 179 -#define TK_IGNORE 180 -#define TK_IMMEDIATE 181 -#define TK_INITIALLY 182 -#define TK_INSTEAD 183 -#define TK_KEY 184 -#define TK_OF 185 -#define TK_RAISE 186 -#define TK_REPLACE 187 -#define TK_RESTRICT 188 -#define TK_ROW 189 -#define TK_STATEMENT 190 -#define TK_TRIGGER 191 -#define TK_VIEW 192 -#define TK_IPTOKEN 193 -#define TK_SEMI 194 -#define TK_NONE 195 -#define TK_PREV 196 -#define TK_LINEAR 197 -#define TK_IMPORT 198 -#define TK_TBNAME 199 -#define TK_JOIN 200 -#define TK_INSERT 201 -#define TK_INTO 202 -#define TK_VALUES 203 -#define TK_FILE 204 - +#define TK_BITXOR 35 +#define TK_LSHIFT 36 +#define TK_RSHIFT 37 +#define TK_PLUS 38 +#define TK_MINUS 39 +#define TK_DIVIDE 40 +#define TK_TIMES 41 +#define TK_STAR 42 +#define TK_SLASH 43 +#define TK_REM 44 +#define TK_UMINUS 45 +#define TK_UPLUS 46 +#define TK_BITNOT 47 +#define TK_ARROW 48 +#define TK_SHOW 49 +#define TK_DATABASES 50 +#define TK_TOPICS 51 +#define TK_FUNCTIONS 52 +#define TK_MNODES 53 +#define TK_DNODES 54 +#define TK_ACCOUNTS 55 +#define TK_USERS 56 +#define TK_MODULES 57 +#define TK_QUERIES 58 +#define TK_CONNECTIONS 59 +#define TK_STREAMS 60 +#define TK_VARIABLES 61 +#define TK_SCORES 62 +#define TK_GRANTS 63 +#define TK_VNODES 64 +#define TK_DOT 65 +#define TK_CREATE 66 +#define TK_TABLE 67 +#define TK_STABLE 68 +#define TK_DATABASE 69 +#define TK_TABLES 70 +#define TK_STABLES 71 +#define TK_VGROUPS 72 +#define TK_DROP 73 +#define TK_TOPIC 74 +#define TK_FUNCTION 75 +#define TK_DNODE 76 +#define TK_USER 77 +#define TK_ACCOUNT 78 +#define TK_USE 79 +#define TK_DESCRIBE 80 +#define TK_DESC 81 +#define TK_ALTER 82 +#define TK_PASS 83 +#define TK_PRIVILEGE 84 +#define TK_LOCAL 85 +#define TK_COMPACT 86 +#define TK_LP 87 +#define TK_RP 88 +#define TK_IF 89 +#define TK_EXISTS 90 +#define TK_AS 91 +#define TK_OUTPUTTYPE 92 +#define TK_AGGREGATE 93 +#define TK_BUFSIZE 94 +#define TK_PPS 95 +#define TK_TSERIES 96 +#define TK_DBS 97 +#define TK_STORAGE 98 +#define TK_QTIME 99 +#define TK_CONNS 100 +#define TK_STATE 101 +#define TK_COMMA 102 +#define TK_KEEP 103 +#define TK_CACHE 104 +#define TK_REPLICA 105 +#define TK_QUORUM 106 +#define TK_DAYS 107 +#define TK_MINROWS 108 +#define TK_MAXROWS 109 +#define TK_BLOCKS 110 +#define TK_CTIME 111 +#define TK_WAL 112 +#define TK_FSYNC 113 +#define TK_COMP 114 +#define TK_PRECISION 115 +#define TK_UPDATE 116 +#define TK_CACHELAST 117 +#define TK_PARTITIONS 118 +#define TK_UNSIGNED 119 +#define TK_TAGS 120 +#define TK_USING 121 +#define TK_TO 122 +#define TK_SPLIT 123 +#define TK_NULL 124 +#define TK_NOW 125 +#define TK_VARIABLE 126 +#define TK_SELECT 127 +#define TK_UNION 128 +#define TK_ALL 129 +#define TK_DISTINCT 130 +#define TK_FROM 131 +#define TK_RANGE 132 +#define TK_INTERVAL 133 +#define TK_EVERY 134 +#define TK_SESSION 135 +#define TK_STATE_WINDOW 136 +#define TK_FILL 137 +#define TK_SLIDING 138 +#define TK_ORDER 139 +#define TK_BY 140 +#define TK_ASC 141 +#define TK_GROUP 142 +#define TK_HAVING 143 +#define TK_LIMIT 144 +#define TK_OFFSET 145 +#define TK_SLIMIT 146 +#define TK_SOFFSET 147 +#define TK_WHERE 148 +#define TK_TODAY 149 +#define TK_RESET 150 +#define TK_QUERY 151 +#define TK_SYNCDB 152 +#define TK_ADD 153 +#define TK_COLUMN 154 +#define TK_MODIFY 155 +#define TK_TAG 156 +#define TK_CHANGE 157 +#define TK_SET 158 +#define TK_KILL 159 +#define TK_CONNECTION 160 +#define TK_STREAM 161 +#define TK_COLON 162 +#define TK_DELETE 163 +#define TK_ABORT 164 +#define TK_AFTER 165 +#define TK_ATTACH 166 +#define TK_BEFORE 167 +#define TK_BEGIN 168 +#define TK_CASCADE 169 +#define TK_CLUSTER 170 +#define TK_CONFLICT 171 +#define TK_COPY 172 +#define TK_DEFERRED 173 +#define TK_DELIMITERS 174 +#define TK_DETACH 175 +#define TK_EACH 176 +#define TK_END 177 +#define TK_EXPLAIN 178 +#define TK_FAIL 179 +#define TK_FOR 180 +#define TK_IGNORE 181 +#define TK_IMMEDIATE 182 +#define TK_INITIALLY 183 +#define TK_INSTEAD 184 +#define TK_KEY 185 +#define TK_OF 186 +#define TK_RAISE 187 +#define TK_REPLACE 188 +#define TK_RESTRICT 189 +#define TK_ROW 190 +#define TK_STATEMENT 191 +#define TK_TRIGGER 192 +#define TK_VIEW 193 +#define TK_IPTOKEN 194 +#define TK_SEMI 195 +#define TK_NONE 196 +#define TK_PREV 197 +#define TK_LINEAR 198 +#define TK_IMPORT 199 +#define TK_TBNAME 200 +#define TK_JOIN 201 +#define TK_INSERT 202 +#define TK_INTO 203 +#define TK_VALUES 204 +#define TK_FILE 205 #define TK_SPACE 300 #define TK_COMMENT 301 diff --git a/src/inc/ttype.h b/src/inc/ttype.h index 5122ab2d00..3c645b8530 100644 --- a/src/inc/ttype.h +++ b/src/inc/ttype.h @@ -293,6 +293,7 @@ int32_t tStrToInteger(const char* z, int16_t type, int32_t n, int64_t* value, bo #define SET_DOUBLE_NULL(v) (*(uint64_t *)(v) = TSDB_DATA_DOUBLE_NULL) #define SET_TIMESTAMP_NULL(v) (*(uint64_t *)(v) = TSDB_DATA_TIMESTAMP_NULL) +#define SET_BIGINT_NULL(v) (*(int64_t *)(v) = TSDB_DATA_BIGINT_NULL) #ifdef __cplusplus } diff --git a/src/kit/shell/src/shellEngine.c b/src/kit/shell/src/shellEngine.c index 5cc9a4a588..37499d2350 100644 --- a/src/kit/shell/src/shellEngine.c +++ b/src/kit/shell/src/shellEngine.c @@ -244,22 +244,34 @@ void shellRunCommandOnServer(TAOS *con, char command[]) { int64_t st, et; wordexp_t full_path; char * sptr = NULL; + char * tmp = NULL; char * cptr = NULL; char * fname = NULL; bool printMode = false; - if ((sptr = tstrstr(command, ">>", true)) != NULL) { - cptr = tstrstr(command, ";", true); - if (cptr != NULL) { - *cptr = '\0'; - } + sptr = command; + while ((sptr = tstrstr(sptr, ">>", true)) != NULL) { + // find the last ">>" if any + tmp = sptr; + sptr += 2; + } - if (wordexp(sptr + 2, &full_path, 0) != 0) { - fprintf(stderr, "ERROR: invalid filename: %s\n", sptr + 2); - return; + sptr = tmp; + + if (sptr != NULL) { + if (regex_match(sptr + 2, "^\\s*[0-9]+\\s*[\\>|\\<|\\<=|\\>=|=|!=]\\s*.*;\\s*$", REG_EXTENDED | REG_ICASE) == 0) { + cptr = tstrstr(command, ";", true); + if (cptr != NULL) { + *cptr = '\0'; + } + + if (wordexp(sptr + 2, &full_path, 0) != 0) { + fprintf(stderr, "ERROR: invalid filename: %s\n", sptr + 2); + return; + } + *sptr = '\0'; + fname = full_path.we_wordv[0]; } - *sptr = '\0'; - fname = full_path.we_wordv[0]; } if ((sptr = tstrstr(command, "\\G", true)) != NULL) { diff --git a/src/query/inc/qFilter.h b/src/query/inc/qFilter.h index fe9ef0f47f..78a431fbdf 100644 --- a/src/query/inc/qFilter.h +++ b/src/query/inc/qFilter.h @@ -38,11 +38,12 @@ extern "C" { enum { FLD_TYPE_COLUMN = 1, - FLD_TYPE_VALUE = 2, - FLD_TYPE_MAX = 3, - FLD_DESC_NO_FREE = 4, - FLD_DATA_NO_FREE = 8, - FLD_DATA_IS_HASH = 16, + FLD_TYPE_VALUE = 2, + FLD_TYPE_EXPR = 3, + FLD_TYPE_MAX = 4, + FLD_DESC_NO_FREE = 16, + FLD_DATA_NO_FREE = 32, + FLD_DATA_IS_HASH = 64 }; enum { @@ -182,6 +183,7 @@ typedef struct SFilterGroupCtx { uint32_t colNum; uint32_t *colIdx; SFilterColInfo *colInfo; + bool hasExpr; } SFilterGroupCtx; typedef struct SFilterColCtx { @@ -206,6 +208,8 @@ typedef struct SFilterComUnit { void *colData; void *valData; void *valData2; + void *expr; + void *exprData; uint16_t colId; uint16_t dataSize; uint8_t dataType; @@ -289,7 +293,10 @@ typedef struct SFilterInfo { #define FILTER_GET_VAL_FIELD_TYPE(fi) (((tVariant *)((fi)->desc))->nType) #define FILTER_GET_VAL_FIELD_DATA(fi) ((char *)(fi)->data) #define FILTER_GET_JSON_VAL_FIELD_DATA(fi) ((char *)(fi)->desc) -#define FILTER_GET_TYPE(fl) ((fl) & FLD_TYPE_MAX) +#define FILTER_GET_TYPE(fl) ((fl) & 0xF) +#define FILTER_GET_FIELD_DESC(fi) ((fi)->desc) +#define FILTER_GET_EXPR_TYPE(i, id) (((tExprNode*)(FILTER_GET_FIELD_DESC(FILTER_GET_FIELD(i, id))))->resultType) +#define FILTER_GET_EXPR_SIZE(i, id) (((tExprNode*)(FILTER_GET_FIELD_DESC(FILTER_GET_FIELD(i, id))))->resultBytes) #define FILTER_GROUP_UNIT(i, g, uid) ((i)->units + (g)->unitIdxs[uid]) #define FILTER_UNIT_LEFT_FIELD(i, u) FILTER_GET_FIELD(i, (u)->left) diff --git a/src/query/inc/sql.y b/src/query/inc/sql.y index e2649ca70e..e55875f270 100644 --- a/src/query/inc/sql.y +++ b/src/query/inc/sql.y @@ -13,7 +13,7 @@ %right NOT. %left EQ NE ISNULL NOTNULL IS LIKE MATCH NMATCH CONTAINS GLOB BETWEEN IN. %left GT GE LT LE. -%left BITAND BITOR LSHIFT RSHIFT. +%left BITAND BITOR BITXOR LSHIFT RSHIFT. %left PLUS MINUS. %left DIVIDE TIMES. %left STAR SLASH REM. @@ -802,6 +802,11 @@ expr(A) ::= expr(X) STAR expr(Y). {A = tSqlExprCreate(X, Y, TK_STAR); } expr(A) ::= expr(X) SLASH expr(Y). {A = tSqlExprCreate(X, Y, TK_DIVIDE);} expr(A) ::= expr(X) REM expr(Y). {A = tSqlExprCreate(X, Y, TK_REM); } expr(A) ::= expr(X) BITAND expr(Y). {A = tSqlExprCreate(X, Y, TK_BITAND);} +expr(A) ::= expr(X) BITOR expr(Y). {A = tSqlExprCreate(X, Y, TK_BITOR); } +expr(A) ::= expr(X) BITXOR expr(Y). {A = tSqlExprCreate(X, Y, TK_BITXOR);} +expr(A) ::= BITNOT expr(X). {A = tSqlExprCreate(X, NULL, TK_BITNOT);} +expr(A) ::= expr(X) LSHIFT expr(Y). {A = tSqlExprCreate(X, Y, TK_LSHIFT);} +expr(A) ::= expr(X) RSHIFT expr(Y). {A = tSqlExprCreate(X, Y, TK_RSHIFT);} // like expression expr(A) ::= expr(X) LIKE expr(Y). {A = tSqlExprCreate(X, Y, TK_LIKE); } @@ -997,4 +1002,4 @@ cmd ::= DELETE FROM ifexists(Y) ids(X) cpxName(Z) where_opt(W). { %fallback ID ABORT AFTER ASC ATTACH BEFORE BEGIN CASCADE CLUSTER CONFLICT COPY DATABASE DEFERRED DELIMITERS DESC DETACH EACH END EXPLAIN FAIL FOR GLOB IGNORE IMMEDIATE INITIALLY INSTEAD LIKE MATCH NMATCH KEY OF OFFSET RAISE REPLACE RESTRICT ROW STATEMENT TRIGGER VIEW ALL - NOW TODAY IPTOKEN SEMI NONE PREV LINEAR IMPORT TBNAME JOIN STABLE NULL INSERT INTO VALUES FILE. \ No newline at end of file + NOW TODAY IPTOKEN SEMI NONE PREV LINEAR IMPORT TBNAME JOIN STABLE NULL INSERT INTO VALUES FILE. diff --git a/src/query/src/qExecutor.c b/src/query/src/qExecutor.c index 54099e24ef..682facdd3f 100644 --- a/src/query/src/qExecutor.c +++ b/src/query/src/qExecutor.c @@ -3164,6 +3164,10 @@ void doSetFilterColumnInfo(SSingleColumnFilterInfo* pFilterInfo, int32_t numOfFi FORCE_INLINE int32_t getColumnDataFromId(void *param, int32_t id, void **data) { int32_t numOfCols = ((SColumnDataParam *)param)->numOfCols; SArray* pDataBlock = ((SColumnDataParam *)param)->pDataBlock; + if (id == INT32_MAX) { + *data = pDataBlock; + return TSDB_CODE_SUCCESS; + } for (int32_t j = 0; j < numOfCols; ++j) { SColumnInfoData* pColInfo = taosArrayGet(pDataBlock, j); diff --git a/src/query/src/qFilter.c b/src/query/src/qFilter.c index 4fcf6fdef0..a3421c801b 100644 --- a/src/query/src/qFilter.c +++ b/src/query/src/qFilter.c @@ -54,11 +54,16 @@ static FORCE_INLINE int32_t filterFieldValDescCompare(const void *desc1, const v return tVariantCompare(val1, val2); } +static FORCE_INLINE int32_t filterExprCompare(const void *desc1, const void *desc2) { + return -1; +} + filter_desc_compare_func gDescCompare [FLD_TYPE_MAX] = { NULL, filterFieldColDescCompare, - filterFieldValDescCompare + filterFieldValDescCompare, + filterExprCompare }; bool filterRangeCompGi (const void *minv, const void *maxv, const void *minr, const void *maxr, __compar_fn_t cfunc) { @@ -834,7 +839,7 @@ int32_t filterAddField(SFilterInfo *info, void *desc, void **data, int32_t type, info->fields[type].fields[idx].desc = desc; info->fields[type].fields[idx].data = data ? *data : NULL; - if (type == FLD_TYPE_COLUMN) { + if (type == FLD_TYPE_COLUMN || type == FLD_TYPE_EXPR) { FILTER_SET_FLAG(info->fields[type].fields[idx].flag, FLD_DATA_NO_FREE); } @@ -874,7 +879,8 @@ static FORCE_INLINE int32_t filterAddColFieldFromField(SFilterInfo *info, SFilte int32_t filterAddFieldFromNode(SFilterInfo *info, tExprNode *node, SFilterFieldId *fid) { CHK_LRET(node == NULL, TSDB_CODE_QRY_APP_ERROR, "empty node"); - CHK_RET(node->nodeType != TSQL_NODE_COL && node->nodeType != TSQL_NODE_VALUE, TSDB_CODE_QRY_APP_ERROR); + CHK_RET(node->nodeType != TSQL_NODE_COL && node->nodeType != TSQL_NODE_VALUE + &&node->nodeType != TSQL_NODE_EXPR, TSDB_CODE_QRY_APP_ERROR); int32_t type; void *v; @@ -883,6 +889,9 @@ int32_t filterAddFieldFromNode(SFilterInfo *info, tExprNode *node, SFilterFieldI type = FLD_TYPE_COLUMN; v = node->pSchema; node->pSchema = NULL; + } else if (node->nodeType == TSQL_NODE_EXPR) { + type = FLD_TYPE_EXPR; + v = node; } else { type = FLD_TYPE_VALUE; v = node->pVal; @@ -934,9 +943,11 @@ int32_t filterAddUnit(SFilterInfo *info, uint8_t optr, SFilterFieldId *left, SFi } SFilterField *col = FILTER_UNIT_LEFT_FIELD(info, u); - assert(FILTER_GET_FLAG(col->flag, FLD_TYPE_COLUMN)); - - info->units[info->unitNum].compare.type = FILTER_GET_COL_FIELD_TYPE(col); + if (FILTER_GET_TYPE(col->flag) == FLD_TYPE_COLUMN) { + info->units[info->unitNum].compare.type = FILTER_GET_COL_FIELD_TYPE(col); + } else { + info->units[info->unitNum].compare.type = (uint8_t)FILTER_GET_EXPR_TYPE(info, u->left); + } *uidx = info->unitNum; @@ -1189,7 +1200,7 @@ static int32_t filterDealJson(SFilterInfo *info, tExprNode* tree, tExprNode** pL jsonKeyMd5((*pLeft)->_node.pRight->pVal->pz, (*pLeft)->_node.pRight->pVal->nLen, keyMd5); memcpy(schema->name, keyMd5, TSDB_MAX_JSON_KEY_MD5_LEN); (*pLeft) = (*pLeft)->_node.pLeft; // -> operation use left as input - }else if(((*pLeft)->pSchema->type == TSDB_DATA_TYPE_JSON) && + }else if((*pLeft)->nodeType == TSQL_NODE_COL && ((*pLeft)->pSchema->type == TSDB_DATA_TYPE_JSON) && (tree->_node.optr == TSDB_RELATION_ISNULL || tree->_node.optr == TSDB_RELATION_NOTNULL)){ SSchema* schema = (*pLeft)->pSchema; char keyMd5[TSDB_MAX_JSON_KEY_MD5_LEN] = {0}; @@ -1213,7 +1224,16 @@ int32_t filterAddGroupUnitFromNode(SFilterInfo *info, tExprNode* tree, SArray *g if((ret = filterDealJson(info, tree, &pLeft)) != TSDB_CODE_SUCCESS) return ret; SFilterFieldId left = {0}, right = {0}; filterAddFieldFromNode(info, pLeft, &left); - uint8_t type = FILTER_GET_COL_FIELD_TYPE(FILTER_GET_FIELD(info, left)); + if (pLeft->nodeType != TSQL_NODE_VALUE && pLeft->nodeType != TSQL_NODE_COL) { + tree->_node.pLeft = NULL; + } + + uint8_t type; + if (left.type == FLD_TYPE_EXPR) { + type = (uint8_t)FILTER_GET_EXPR_TYPE(info, left); + } else { + type = FILTER_GET_COL_FIELD_TYPE(FILTER_GET_FIELD(info, left)); + } int32_t len = 0; uint32_t uidx = 0; @@ -1577,6 +1597,9 @@ void filterDumpInfoToString(SFilterInfo *info, const char *msg, int32_t options) char str[512] = {0}; SFilterField *left = FILTER_UNIT_LEFT_FIELD(info, unit); + if (FILTER_GET_TYPE(left->flag) == FLD_TYPE_EXPR) { + continue; + } SSchema *sch = left->desc; if (unit->compare.optr >= TSDB_RELATION_INVALID && unit->compare.optr <= TSDB_RELATION_CONTAINS){ len = sprintf(str, "UNIT[%d] => [%d][%s] %s [", i, sch->colId, sch->name, gOptrStr[unit->compare.optr].str); @@ -1752,6 +1775,9 @@ void filterFreeField(SFilterField* field, int32_t type) { if (!FILTER_GET_FLAG(field->flag, FLD_DESC_NO_FREE)) { if (type == FLD_TYPE_VALUE) { tVariantDestroy(field->desc); + } else if (type == FLD_TYPE_EXPR) { + tExprTreeDestroy(field->desc, NULL); + field->desc = NULL; } tfree(field->desc); @@ -2101,20 +2127,30 @@ _return: int32_t filterMergeGroupUnits(SFilterInfo *info, SFilterGroupCtx** gRes, int32_t* gResNum) { bool empty = false; + if (info->fields[FLD_TYPE_COLUMN].num == 0) { + return TSDB_CODE_SUCCESS; + } uint32_t *colIdx = malloc(info->fields[FLD_TYPE_COLUMN].num * sizeof(uint32_t)); uint32_t colIdxi = 0; uint32_t gResIdx = 0; + bool hasExpr = false; for (uint32_t i = 0; i < info->groupNum; ++i) { SFilterGroup* g = info->groups + i; gRes[gResIdx] = calloc(1, sizeof(SFilterGroupCtx)); gRes[gResIdx]->colInfo = calloc(info->fields[FLD_TYPE_COLUMN].num, sizeof(SFilterColInfo)); + gRes[gResIdx]->hasExpr = false; colIdxi = 0; empty = false; for (uint32_t j = 0; j < g->unitNum; ++j) { SFilterUnit* u = FILTER_GROUP_UNIT(info, g, j); + if(u->left.type == FLD_TYPE_EXPR) { + gRes[gResIdx]->hasExpr = true; + hasExpr = true; + continue; + } uint32_t cidx = FILTER_UNIT_COL_IDX(u); if (gRes[gResIdx]->colInfo[cidx].info == NULL) { @@ -2161,6 +2197,9 @@ int32_t filterMergeGroupUnits(SFilterInfo *info, SFilterGroupCtx** gRes, int32_t ++gResIdx; } + if (hasExpr) { + FILTER_CLR_FLAG(info->status, FI_STATUS_REWRITE); + } tfree(colIdx); *gResNum = gResIdx; @@ -2175,6 +2214,10 @@ int32_t filterMergeGroupUnits(SFilterInfo *info, SFilterGroupCtx** gRes, int32_t void filterCheckColConflict(SFilterGroupCtx* gRes1, SFilterGroupCtx* gRes2, bool *conflict) { uint32_t idx1 = 0, idx2 = 0, m = 0, n = 0; bool equal = false; + if (gRes1->hasExpr || gRes2->hasExpr) { + *conflict = true; + return; + } for (; m < gRes1->colNum; ++m) { idx1 = gRes1->colIdx[m]; @@ -2647,7 +2690,12 @@ int32_t filterGenerateComInfo(SFilterInfo *info) { info->cunits[i].rfunc = filterGetRangeCompFuncFromOptrs(unit->compare.optr, unit->compare.optr2); info->cunits[i].optr = FILTER_UNIT_OPTR(unit); info->cunits[i].colData = NULL; - info->cunits[i].colId = FILTER_UNIT_COL_ID(info, unit); + info->cunits[i].expr = NULL; + if (unit->left.type == FLD_TYPE_COLUMN) { + info->cunits[i].colId = FILTER_UNIT_COL_ID(info, unit); + } else if (unit->left.type == FLD_TYPE_EXPR) { + info->cunits[i].expr = FILTER_GET_FIELD_DESC(FILTER_GET_FIELD(info, unit->left)); + } if (unit->right.type == FLD_TYPE_VALUE) { if(FILTER_UNIT_DATA_TYPE(unit) == TSDB_DATA_TYPE_JSON){ // json value is tVariant @@ -2663,8 +2711,12 @@ int32_t filterGenerateComInfo(SFilterInfo *info) { } else { info->cunits[i].valData2 = info->cunits[i].valData; } - - info->cunits[i].dataSize = FILTER_UNIT_COL_SIZE(info, unit); + + if (unit->left.type == FLD_TYPE_COLUMN) { + info->cunits[i].dataSize = FILTER_UNIT_COL_SIZE(info, unit); + } else { + info->cunits[i].dataSize = FILTER_GET_EXPR_SIZE(info, unit->left); + } info->cunits[i].dataType = FILTER_UNIT_DATA_TYPE(unit); } @@ -2674,8 +2726,14 @@ int32_t filterGenerateComInfo(SFilterInfo *info) { int32_t filterUpdateComUnits(SFilterInfo *info) { for (uint32_t i = 0; i < info->unitNum; ++i) { SFilterUnit *unit = &info->units[i]; - - info->cunits[i].colData = FILTER_UNIT_COL_DATA(info, unit, 0); + if (unit->left.type == FLD_TYPE_EXPR) { + SFilterField *t = FILTER_UNIT_LEFT_FIELD(info, unit); + info->cunits[i].colData = NULL; + info->cunits[i].exprData = t->data; + } else { + info->cunits[i].colData = FILTER_UNIT_COL_DATA(info, unit, 0); + info->cunits[i].exprData = NULL; + } } return TSDB_CODE_SUCCESS; @@ -2924,6 +2982,11 @@ bool filterExecuteBasedOnStatisImpl(void *pinfo, int32_t numOfRows, int8_t** p, int32_t filterExecuteBasedOnStatis(SFilterInfo *info, int32_t numOfRows, int8_t** p, SDataStatis *statis, int16_t numOfCols, bool* all) { + for (uint32_t i = 0; i < info->unitNum; ++i) { + if(info->cunits[i].expr) { + return 1; + } + } if (statis && numOfRows >= FILTER_RM_UNIT_MIN_ROWS) { info->blkFlag = 0; @@ -2954,6 +3017,20 @@ _return: return TSDB_CODE_SUCCESS; } +char *getExprColumnData(void *param, const char* name, int32_t colId) { + void *data = NULL; + getColumnDataFromId(param, colId, &data); + return (char *) data; +} + +void* filterExprTraverse (SFilterInfo *info, int32_t numOfRows, int16_t numOfCols) { + tExprOperandInfo output; + output.data = malloc(sizeof(int64_t) * numOfRows); + SSDataBlock* pBlock = (SSDataBlock*) info->cunits[0].exprData; + SColumnDataParam param = {.numOfCols = numOfCols, .pDataBlock = (SArray*)pBlock}; + exprTreeNodeTraverse(info->cunits[0].expr, numOfRows, &output, ¶m, TSDB_ORDER_ASC, getExprColumnData); + return output.data; +} static FORCE_INLINE bool filterExecuteImplAll(void *info, int32_t numOfRows, int8_t** p, SDataStatis *statis, int16_t numOfCols) { return true; @@ -2964,18 +3041,26 @@ static FORCE_INLINE bool filterExecuteImplEmpty(void *info, int32_t numOfRows, i static FORCE_INLINE bool filterExecuteImplIsNull(void *pinfo, int32_t numOfRows, int8_t** p, SDataStatis *statis, int16_t numOfCols) { SFilterInfo *info = (SFilterInfo *)pinfo; bool all = true; + char *exprData = NULL; + uint32_t uidx = info->groups[0].unitIdxs[0]; + void *colData = NULL; if (filterExecuteBasedOnStatis(info, numOfRows, p, statis, numOfCols, &all) == 0) { return all; } + if (info->cunits[0].expr) { + exprData = filterExprTraverse(info, numOfRows, numOfCols); + } else { + exprData = info->cunits[uidx].colData; + } + if (*p == NULL) { *p = calloc(numOfRows, sizeof(int8_t)); } for (int32_t i = 0; i < numOfRows; ++i) { - uint32_t uidx = info->groups[0].unitIdxs[0]; - void *colData = (char *)info->cunits[uidx].colData + info->cunits[uidx].dataSize * i; + colData = (char *)exprData + info->cunits[uidx].dataSize * i; if(info->cunits[uidx].dataType == TSDB_DATA_TYPE_JSON){ if (!colData){ // for json->'key' is null (*p)[i] = 1; @@ -2993,23 +3078,35 @@ static FORCE_INLINE bool filterExecuteImplIsNull(void *pinfo, int32_t numOfRows, } } + if (info->cunits[0].expr) { + tfree(exprData); + } + return all; } static FORCE_INLINE bool filterExecuteImplNotNull(void *pinfo, int32_t numOfRows, int8_t** p, SDataStatis *statis, int16_t numOfCols) { SFilterInfo *info = (SFilterInfo *)pinfo; bool all = true; + char *exprData = NULL; + uint32_t uidx = info->groups[0].unitIdxs[0]; + void *colData = NULL; if (filterExecuteBasedOnStatis(info, numOfRows, p, statis, numOfCols, &all) == 0) { return all; } + if (info->cunits[0].expr) { + exprData = filterExprTraverse(info, numOfRows, numOfCols); + } else { + exprData = info->cunits[uidx].colData; + } + if (*p == NULL) { *p = calloc(numOfRows, sizeof(int8_t)); } for (int32_t i = 0; i < numOfRows; ++i) { - uint32_t uidx = info->groups[0].unitIdxs[0]; - void *colData = (char *)info->cunits[uidx].colData + info->cunits[uidx].dataSize * i; + colData = (char *)exprData + info->cunits[uidx].dataSize * i; if(info->cunits[uidx].dataType == TSDB_DATA_TYPE_JSON){ if (!colData) { // for json->'key' is not null @@ -3029,6 +3126,10 @@ static FORCE_INLINE bool filterExecuteImplNotNull(void *pinfo, int32_t numOfRows } } + if (info->cunits[0].expr) { + tfree(exprData); + } + return all; } @@ -3082,11 +3183,16 @@ bool filterExecuteImplRange(void *pinfo, int32_t numOfRows, int8_t** p, SDataSta void *valData = info->cunits[0].valData; void *valData2 = info->cunits[0].valData2; __compar_fn_t func = gDataCompare[info->cunits[0].func]; + char *exprData = NULL; if (filterExecuteBasedOnStatis(info, numOfRows, p, statis, numOfCols, &all) == 0) { return all; } + if (info->cunits[0].expr) { + exprData = colData = filterExprTraverse(info, numOfRows, numOfCols); + } + if (*p == NULL) { *p = calloc(numOfRows, sizeof(int8_t)); } @@ -3106,6 +3212,9 @@ bool filterExecuteImplRange(void *pinfo, int32_t numOfRows, int8_t** p, SDataSta colData += dataSize; } + if (info->cunits[0].expr) { + tfree(exprData); + } return all; } @@ -3113,18 +3222,26 @@ bool filterExecuteImplRange(void *pinfo, int32_t numOfRows, int8_t** p, SDataSta bool filterExecuteImplMisc(void *pinfo, int32_t numOfRows, int8_t** p, SDataStatis *statis, int16_t numOfCols) { SFilterInfo *info = (SFilterInfo *)pinfo; bool all = true; + char *exprData = NULL; + uint32_t uidx = info->groups[0].unitIdxs[0]; + void *colData = NULL; if (filterExecuteBasedOnStatis(info, numOfRows, p, statis, numOfCols, &all) == 0) { return all; } + if (info->cunits[0].expr) { + exprData = filterExprTraverse(info, numOfRows, numOfCols); + } else { + exprData = info->cunits[uidx].colData; + } + if (*p == NULL) { *p = calloc(numOfRows, sizeof(int8_t)); } - + for (int32_t i = 0; i < numOfRows; ++i) { - uint32_t uidx = info->groups[0].unitIdxs[0]; - void *colData = (char *)info->cunits[uidx].colData + info->cunits[uidx].dataSize * i; + colData = (char *)exprData + info->cunits[uidx].dataSize * i; if (colData == NULL || isNull(colData, info->cunits[uidx].dataType)) { (*p)[i] = 0; all = false; @@ -3153,6 +3270,10 @@ bool filterExecuteImplMisc(void *pinfo, int32_t numOfRows, int8_t** p, SDataStat } } + if (info->cunits[0].expr) { + tfree(exprData); + } + return all; } @@ -3168,6 +3289,27 @@ bool filterExecuteImpl(void *pinfo, int32_t numOfRows, int8_t** p, SDataStatis * *p = calloc(numOfRows, sizeof(int8_t)); } + SArray* tmpData = NULL; + for (uint32_t g = 0; g < info->groupNum; ++g) { + SFilterGroup *group = &info->groups[g]; + for (uint32_t u = 0; u < group->unitNum; ++u) { + uint32_t uidx = group->unitIdxs[u]; + SFilterComUnit *cunit = &info->cunits[uidx]; + if (cunit->expr) { + if (!tmpData) { + tmpData = taosArrayInit(10, POINTER_BYTES); + } + tExprOperandInfo output; + output.data = malloc(sizeof(int64_t) * numOfRows); + taosArrayPush(tmpData, output.data); + SSDataBlock* pBlock = (SSDataBlock*) cunit->exprData; + SColumnDataParam param = {.numOfCols = numOfCols, .pDataBlock = (SArray*)pBlock}; + exprTreeNodeTraverse(cunit->expr, numOfRows, &output, ¶m, TSDB_ORDER_ASC, getExprColumnData); + cunit->colData = (char *) output.data; + } + } + } + for (int32_t i = 0; i < numOfRows; ++i) { //FILTER_UNIT_CLR_F(info); @@ -3229,6 +3371,9 @@ bool filterExecuteImpl(void *pinfo, int32_t numOfRows, int8_t** p, SDataStatis * } } + if (tmpData) { + taosArrayDestroy(&tmpData); + } return all; } @@ -3318,7 +3463,8 @@ _return: int32_t filterSetColFieldData(SFilterInfo *info, void *param, filer_get_col_from_id fp) { CHK_LRET(info == NULL, TSDB_CODE_QRY_APP_ERROR, "info NULL"); - CHK_LRET(info->fields[FLD_TYPE_COLUMN].num <= 0, TSDB_CODE_QRY_APP_ERROR, "no column fileds"); + CHK_LRET(info->fields[FLD_TYPE_COLUMN].num <= 0 && info->fields[FLD_TYPE_EXPR].num <= 0, + TSDB_CODE_QRY_APP_ERROR, "no column fileds"); if (FILTER_ALL_RES(info) || FILTER_EMPTY_RES(info)) { return TSDB_CODE_SUCCESS; @@ -3331,6 +3477,11 @@ int32_t filterSetColFieldData(SFilterInfo *info, void *param, filer_get_col_from (*fp)(param, sch->colId, &fi->data); } + for (uint32_t i = 0; i < info->fields[FLD_TYPE_EXPR].num; ++i) { + SFilterField* fi = &info->fields[FLD_TYPE_EXPR].fields[i]; + (*fp)(param, INT32_MAX, &fi->data); + } + filterUpdateComUnits(info); return TSDB_CODE_SUCCESS; diff --git a/src/query/src/qSqlParser.c b/src/query/src/qSqlParser.c index b360fa95fc..cee5130651 100644 --- a/src/query/src/qSqlParser.c +++ b/src/query/src/qSqlParser.c @@ -345,7 +345,9 @@ tSqlExpr *tSqlExprCreate(tSqlExpr *pLeft, tSqlExpr *pRight, int32_t optrType) { if ((pLeft != NULL && pRight != NULL) && (optrType == TK_PLUS || optrType == TK_MINUS || optrType == TK_STAR || optrType == TK_DIVIDE || optrType == TK_REM || optrType == TK_EQ || optrType == TK_NE || optrType == TK_LT || optrType == TK_GT || optrType == TK_LE || optrType == TK_GE || - optrType == TK_AND || optrType == TK_OR)) { + optrType == TK_AND || optrType == TK_OR || optrType == TK_BITAND || optrType == TK_BITOR || optrType == TK_BITXOR || + optrType == TK_LSHIFT || optrType == TK_RSHIFT)) + { /* * if a exprToken is noted as the TK_TIMESTAMP, the time precision is microsecond * Otherwise, the time precision is adaptive, determined by the time precision from databases. @@ -422,6 +424,61 @@ tSqlExpr *tSqlExprCreate(tSqlExpr *pLeft, tSqlExpr *pRight, int32_t optrType) { pExpr->value.i64 = (pLeft->value.i64 || pRight->value.i64) ? 1 : 0; break; } + case TK_BITAND: { + if (pLeft->tokenId == TK_BOOL || pRight->tokenId == TK_BOOL || + pLeft->tokenId == TK_FLOAT || pRight->tokenId == TK_FLOAT || + pLeft->tokenId == TK_TIMESTAMP || pRight->tokenId == TK_TIMESTAMP) + { + pExpr->value.i64 = TSDB_DATA_BIGINT_NULL; + } else { + pExpr->value.i64 = pLeft->value.i64 & pRight->value.i64; + } + break; + } + case TK_BITOR: { + if (pLeft->tokenId == TK_BOOL || pRight->tokenId == TK_BOOL || + pLeft->tokenId == TK_FLOAT || pRight->tokenId == TK_FLOAT || + pLeft->tokenId == TK_TIMESTAMP || pRight->tokenId == TK_TIMESTAMP) + { + pExpr->value.i64 = TSDB_DATA_BIGINT_NULL; + } else { + pExpr->value.i64 = pLeft->value.i64 | pRight->value.i64; + } + break; + } + case TK_BITXOR: { + if (pLeft->tokenId == TK_BOOL || pRight->tokenId == TK_BOOL || + pLeft->tokenId == TK_FLOAT || pRight->tokenId == TK_FLOAT || + pLeft->tokenId == TK_TIMESTAMP || pRight->tokenId == TK_TIMESTAMP) + { + pExpr->value.i64 = TSDB_DATA_BIGINT_NULL; + } else { + pExpr->value.i64 = pLeft->value.i64 ^ pRight->value.i64; + } + break; + } + case TK_LSHIFT: { + if (pLeft->tokenId == TK_BOOL || pRight->tokenId == TK_BOOL || + pLeft->tokenId == TK_FLOAT || pRight->tokenId == TK_FLOAT || + pLeft->tokenId == TK_TIMESTAMP || pRight->tokenId == TK_TIMESTAMP) + { + pExpr->value.i64 = TSDB_DATA_BIGINT_NULL; + } else { + pExpr->value.i64 = pLeft->value.i64 << pRight->value.i64; + } + break; + } + case TK_RSHIFT: { + if (pLeft->tokenId == TK_BOOL || pRight->tokenId == TK_BOOL || + pLeft->tokenId == TK_FLOAT || pRight->tokenId == TK_FLOAT || + pLeft->tokenId == TK_TIMESTAMP || pRight->tokenId == TK_TIMESTAMP) + { + pExpr->value.i64 = TSDB_DATA_BIGINT_NULL; + } else { + pExpr->value.i64 = pLeft->value.i64 >> pRight->value.i64; + } + break; + } } tSqlExprDestroy(pLeft); @@ -533,6 +590,13 @@ tSqlExpr *tSqlExprCreate(tSqlExpr *pLeft, tSqlExpr *pRight, int32_t optrType) { pExpr->value.i64 = (left || right) ? 1 : 0; break; } + case TK_BITAND: + case TK_BITOR: + case TK_BITXOR: + case TK_LSHIFT: + case TK_RSHIFT: + pExpr->value.i64 = TSDB_DATA_DOUBLE_NULL; + break; } tSqlExprDestroy(pLeft); @@ -566,6 +630,12 @@ tSqlExpr *tSqlExprCreate(tSqlExpr *pLeft, tSqlExpr *pRight, int32_t optrType) { } pExpr->pRight = pRight; + + if (optrType == TK_BITNOT) { + pExpr->exprToken.z = pLeft->exprToken.z - 1; + pExpr->exprToken.n = pLeft->exprToken.n + 1; + pExpr->exprToken.type = pLeft->exprToken.type; + } } return pExpr; @@ -1488,4 +1558,4 @@ SDelData* tGetDelData(SStrToken* pTableName, SStrToken* existsCheck, tSqlExpr* p pDelData->pWhere = pWhere; return pDelData; -} \ No newline at end of file +} diff --git a/src/query/src/sql.c b/src/query/src/sql.c index dfa1d45d93..c21482853e 100644 --- a/src/query/src/sql.c +++ b/src/query/src/sql.c @@ -97,30 +97,30 @@ #endif /************* Begin control #defines *****************************************/ #define YYCODETYPE unsigned short int -#define YYNOCODE 293 +#define YYNOCODE 294 #define YYACTIONTYPE unsigned short int #define ParseTOKENTYPE SStrToken typedef union { int yyinit; ParseTOKENTYPE yy0; - tVariant yy42; - int32_t yy44; - SCreateTableSql* yy78; - SRangeVal yy132; - int yy133; - SSqlNode* yy144; - SLimitVal yy190; - tSqlExpr* yy194; - SIntervalVal yy200; - SSessionWindowVal yy235; - SWindowStateVal yy248; - TAOS_FIELD yy263; - int64_t yy277; - SCreateAcctInfo yy299; - SArray* yy333; - SCreateDbInfo yy342; - SCreatedTableInfo yy400; - SRelationInfo* yy516; + SLimitVal yy24; + SCreateTableSql* yy74; + SCreatedTableInfo yy110; + SWindowStateVal yy204; + SRangeVal yy214; + int yy274; + TAOS_FIELD yy307; + SArray* yy367; + SSessionWindowVal yy373; + tSqlExpr* yy378; + tVariant yy410; + SSqlNode* yy426; + int64_t yy443; + SIntervalVal yy478; + SRelationInfo* yy480; + SCreateAcctInfo yy563; + SCreateDbInfo yy564; + int32_t yy586; } YYMINORTYPE; #ifndef YYSTACKDEPTH #define YYSTACKDEPTH 100 @@ -130,17 +130,17 @@ typedef union { #define ParseARG_FETCH SSqlInfo* pInfo = yypParser->pInfo #define ParseARG_STORE yypParser->pInfo = pInfo #define YYFALLBACK 1 -#define YYNSTATE 405 -#define YYNRULE 322 -#define YYNTOKEN 205 -#define YY_MAX_SHIFT 404 -#define YY_MIN_SHIFTREDUCE 633 -#define YY_MAX_SHIFTREDUCE 954 -#define YY_ERROR_ACTION 955 -#define YY_ACCEPT_ACTION 956 -#define YY_NO_ACTION 957 -#define YY_MIN_REDUCE 958 -#define YY_MAX_REDUCE 1279 +#define YYNSTATE 414 +#define YYNRULE 327 +#define YYNTOKEN 206 +#define YY_MAX_SHIFT 413 +#define YY_MIN_SHIFTREDUCE 643 +#define YY_MAX_SHIFTREDUCE 969 +#define YY_ERROR_ACTION 970 +#define YY_ACCEPT_ACTION 971 +#define YY_NO_ACTION 972 +#define YY_MIN_REDUCE 973 +#define YY_MAX_REDUCE 1299 /************* End control #defines *******************************************/ /* Define the yytestcase() macro to be a no-op if is not already defined @@ -206,325 +206,338 @@ typedef union { ** yy_default[] Default action for each state. ** *********** Begin parsing tables **********************************************/ -#define YY_ACTTAB_COUNT (889) +#define YY_ACTTAB_COUNT (935) static const YYACTIONTYPE yy_action[] = { - /* 0 */ 223, 684, 1107, 168, 956, 404, 24, 768, 1141, 685, - /* 10 */ 1252, 684, 1254, 256, 38, 39, 1252, 42, 43, 685, - /* 20 */ 1117, 271, 31, 30, 29, 403, 249, 41, 354, 46, - /* 30 */ 44, 47, 45, 32, 110, 258, 221, 37, 36, 379, - /* 40 */ 378, 35, 34, 33, 38, 39, 1252, 42, 43, 264, - /* 50 */ 183, 271, 31, 30, 29, 303, 1132, 41, 354, 46, - /* 60 */ 44, 47, 45, 32, 35, 34, 33, 37, 36, 311, - /* 70 */ 1101, 35, 34, 33, 295, 684, 302, 301, 38, 39, - /* 80 */ 1138, 42, 43, 685, 720, 271, 31, 30, 29, 60, - /* 90 */ 90, 41, 354, 46, 44, 47, 45, 32, 402, 400, - /* 100 */ 661, 37, 36, 222, 227, 35, 34, 33, 38, 39, - /* 110 */ 13, 42, 43, 1252, 1252, 271, 31, 30, 29, 296, - /* 120 */ 59, 41, 354, 46, 44, 47, 45, 32, 161, 159, - /* 130 */ 158, 37, 36, 61, 251, 35, 34, 33, 350, 38, - /* 140 */ 40, 1114, 42, 43, 109, 88, 271, 31, 30, 29, - /* 150 */ 281, 882, 41, 354, 46, 44, 47, 45, 32, 389, - /* 160 */ 52, 190, 37, 36, 228, 684, 35, 34, 33, 39, - /* 170 */ 229, 42, 43, 685, 1252, 271, 31, 30, 29, 240, - /* 180 */ 1252, 41, 354, 46, 44, 47, 45, 32, 60, 1252, - /* 190 */ 96, 37, 36, 842, 843, 35, 34, 33, 68, 348, - /* 200 */ 396, 395, 347, 346, 345, 394, 344, 343, 342, 393, - /* 210 */ 341, 392, 391, 634, 635, 636, 637, 638, 639, 640, - /* 220 */ 641, 642, 643, 644, 645, 646, 647, 162, 60, 250, - /* 230 */ 69, 42, 43, 261, 1116, 271, 31, 30, 29, 287, - /* 240 */ 1114, 41, 354, 46, 44, 47, 45, 32, 291, 290, - /* 250 */ 811, 37, 36, 60, 1274, 35, 34, 33, 25, 352, - /* 260 */ 1075, 1063, 1064, 1065, 1066, 1067, 1068, 1069, 1070, 1071, - /* 270 */ 1072, 1073, 1074, 1076, 1077, 233, 324, 243, 898, 10, - /* 280 */ 1113, 886, 235, 889, 1193, 892, 1194, 321, 149, 148, - /* 290 */ 147, 234, 1243, 243, 898, 362, 96, 886, 262, 889, - /* 300 */ 304, 892, 1252, 359, 1191, 1114, 1192, 46, 44, 47, - /* 310 */ 45, 32, 1242, 247, 248, 37, 36, 356, 1241, 35, - /* 320 */ 34, 33, 1252, 1204, 5, 63, 194, 245, 1252, 247, - /* 330 */ 248, 193, 116, 121, 112, 120, 69, 1252, 796, 325, - /* 340 */ 102, 793, 101, 794, 32, 795, 1266, 830, 37, 36, - /* 350 */ 337, 833, 35, 34, 33, 1099, 214, 212, 210, 294, - /* 360 */ 60, 86, 48, 209, 153, 152, 151, 150, 244, 274, - /* 370 */ 268, 267, 284, 276, 277, 133, 127, 138, 48, 307, - /* 380 */ 308, 888, 137, 891, 143, 146, 136, 280, 272, 887, - /* 390 */ 104, 890, 103, 140, 246, 1083, 1203, 1081, 1082, 899, - /* 400 */ 893, 895, 1084, 107, 1252, 366, 1085, 263, 1086, 1087, - /* 410 */ 903, 60, 1114, 259, 1117, 899, 893, 895, 68, 353, - /* 420 */ 396, 395, 37, 36, 894, 394, 35, 34, 33, 393, - /* 430 */ 60, 392, 391, 60, 219, 223, 1096, 1097, 56, 1100, - /* 440 */ 894, 352, 60, 350, 1252, 1252, 1255, 1255, 186, 275, - /* 450 */ 60, 273, 223, 365, 364, 60, 367, 281, 270, 797, - /* 460 */ 278, 60, 1252, 1114, 1255, 814, 254, 282, 191, 279, - /* 470 */ 265, 374, 373, 281, 164, 368, 225, 1117, 369, 226, - /* 480 */ 6, 230, 1114, 224, 355, 1114, 1252, 375, 231, 1252, - /* 490 */ 87, 1252, 281, 1252, 1114, 376, 862, 1006, 1252, 93, - /* 500 */ 377, 896, 1114, 1115, 204, 232, 381, 1114, 135, 897, - /* 510 */ 105, 237, 238, 1114, 1132, 1252, 239, 236, 220, 1132, - /* 520 */ 389, 1252, 1252, 94, 1098, 91, 1252, 1252, 1252, 397, - /* 530 */ 1044, 1016, 252, 1007, 839, 1, 192, 253, 204, 298, - /* 540 */ 204, 3, 205, 306, 305, 849, 850, 77, 170, 269, - /* 550 */ 778, 80, 329, 818, 780, 331, 861, 779, 55, 72, - /* 560 */ 49, 928, 358, 298, 61, 900, 61, 683, 72, 108, - /* 570 */ 15, 72, 14, 84, 126, 9, 125, 292, 17, 9, - /* 580 */ 16, 9, 371, 370, 357, 803, 801, 804, 802, 885, - /* 590 */ 166, 332, 78, 19, 81, 18, 132, 21, 131, 20, - /* 600 */ 145, 144, 1200, 167, 1199, 767, 260, 380, 1112, 1140, - /* 610 */ 26, 1151, 1148, 1149, 1153, 1133, 169, 174, 299, 317, - /* 620 */ 1108, 1183, 1182, 1181, 185, 1180, 187, 1106, 188, 1279, - /* 630 */ 189, 1021, 160, 829, 398, 334, 335, 336, 339, 340, - /* 640 */ 70, 217, 66, 351, 27, 1015, 363, 1273, 1130, 123, - /* 650 */ 1272, 310, 82, 1269, 255, 312, 195, 372, 314, 1265, - /* 660 */ 129, 1264, 1261, 196, 1041, 67, 79, 175, 62, 71, - /* 670 */ 218, 326, 1003, 28, 139, 176, 322, 1001, 178, 141, - /* 680 */ 320, 142, 177, 999, 998, 283, 318, 207, 316, 208, - /* 690 */ 995, 994, 993, 992, 991, 313, 990, 989, 211, 213, - /* 700 */ 981, 215, 978, 216, 974, 309, 89, 338, 163, 390, - /* 710 */ 85, 297, 1110, 92, 97, 315, 134, 382, 383, 384, - /* 720 */ 385, 386, 387, 83, 388, 165, 266, 333, 953, 286, - /* 730 */ 285, 952, 288, 241, 242, 289, 951, 934, 933, 1020, - /* 740 */ 1019, 117, 118, 293, 298, 328, 11, 95, 806, 300, - /* 750 */ 997, 53, 996, 199, 154, 198, 1042, 197, 200, 202, - /* 760 */ 201, 203, 838, 155, 156, 988, 987, 2, 157, 1079, - /* 770 */ 179, 327, 1043, 980, 979, 184, 180, 4, 181, 182, - /* 780 */ 54, 98, 75, 836, 835, 1089, 832, 831, 76, 173, - /* 790 */ 840, 171, 257, 851, 172, 64, 845, 99, 357, 847, - /* 800 */ 100, 319, 323, 22, 12, 65, 23, 106, 50, 330, - /* 810 */ 111, 51, 109, 114, 698, 733, 731, 730, 57, 113, - /* 820 */ 729, 727, 726, 58, 115, 725, 722, 688, 119, 349, - /* 830 */ 7, 925, 923, 926, 902, 901, 924, 361, 8, 904, - /* 840 */ 122, 124, 360, 73, 61, 800, 799, 74, 128, 770, - /* 850 */ 130, 769, 766, 714, 712, 704, 710, 706, 708, 702, - /* 860 */ 700, 736, 735, 734, 732, 728, 724, 723, 206, 686, - /* 870 */ 958, 651, 660, 957, 658, 957, 957, 957, 957, 957, - /* 880 */ 957, 957, 957, 957, 957, 957, 399, 957, 401, + /* 0 */ 228, 694, 290, 173, 1208, 65, 1209, 330, 694, 695, + /* 10 */ 1272, 267, 1274, 195, 43, 44, 695, 47, 48, 412, + /* 20 */ 258, 280, 32, 31, 30, 1131, 65, 46, 363, 51, + /* 30 */ 49, 52, 50, 37, 36, 35, 34, 33, 42, 41, + /* 40 */ 265, 110, 40, 39, 38, 43, 44, 1132, 47, 48, + /* 50 */ 260, 778, 280, 32, 31, 30, 96, 1129, 46, 363, + /* 60 */ 51, 49, 52, 50, 37, 36, 35, 34, 33, 42, + /* 70 */ 41, 270, 1147, 40, 39, 38, 311, 310, 1129, 43, + /* 80 */ 44, 730, 47, 48, 388, 387, 280, 32, 31, 30, + /* 90 */ 261, 95, 46, 363, 51, 49, 52, 50, 37, 36, + /* 100 */ 35, 34, 33, 42, 41, 24, 226, 40, 39, 38, + /* 110 */ 43, 44, 13, 47, 48, 1272, 1272, 280, 32, 31, + /* 120 */ 30, 1122, 64, 46, 363, 51, 49, 52, 50, 37, + /* 130 */ 36, 35, 34, 33, 42, 41, 272, 82, 40, 39, + /* 140 */ 38, 43, 45, 1132, 47, 48, 114, 93, 280, 32, + /* 150 */ 31, 30, 359, 892, 46, 363, 51, 49, 52, 50, + /* 160 */ 37, 36, 35, 34, 33, 42, 41, 296, 273, 40, + /* 170 */ 39, 38, 44, 227, 47, 48, 300, 299, 280, 32, + /* 180 */ 31, 30, 83, 1272, 46, 363, 51, 49, 52, 50, + /* 190 */ 37, 36, 35, 34, 33, 42, 41, 694, 140, 40, + /* 200 */ 39, 38, 47, 48, 274, 695, 280, 32, 31, 30, + /* 210 */ 398, 1132, 46, 363, 51, 49, 52, 50, 37, 36, + /* 220 */ 35, 34, 33, 42, 41, 852, 853, 40, 39, 38, + /* 230 */ 398, 73, 357, 405, 404, 356, 355, 354, 403, 353, + /* 240 */ 352, 351, 402, 350, 401, 400, 644, 645, 646, 647, + /* 250 */ 648, 649, 650, 651, 652, 653, 654, 655, 656, 657, + /* 260 */ 167, 101, 259, 1090, 1078, 1079, 1080, 1081, 1082, 1083, + /* 270 */ 1084, 1085, 1086, 1087, 1088, 1089, 1091, 1092, 25, 840, + /* 280 */ 252, 908, 362, 843, 896, 85, 899, 188, 902, 138, + /* 290 */ 132, 143, 166, 164, 163, 242, 142, 312, 148, 151, + /* 300 */ 141, 74, 244, 290, 277, 361, 320, 145, 154, 153, + /* 310 */ 152, 243, 316, 317, 196, 371, 101, 256, 257, 1156, + /* 320 */ 1262, 365, 279, 252, 908, 1147, 29, 896, 86, 899, + /* 330 */ 1272, 902, 51, 49, 52, 50, 37, 36, 35, 34, + /* 340 */ 33, 42, 41, 262, 6, 40, 39, 38, 65, 112, + /* 350 */ 806, 694, 232, 803, 115, 804, 74, 805, 313, 695, + /* 360 */ 256, 257, 1272, 5, 68, 199, 53, 1294, 224, 29, + /* 370 */ 198, 121, 126, 117, 125, 411, 409, 671, 1272, 303, + /* 380 */ 1275, 91, 1111, 1112, 61, 1115, 285, 286, 253, 346, + /* 390 */ 1116, 1153, 293, 271, 1114, 334, 107, 283, 106, 263, + /* 400 */ 1129, 1021, 1219, 909, 903, 905, 289, 89, 209, 53, + /* 410 */ 898, 276, 901, 37, 36, 35, 34, 33, 42, 41, + /* 420 */ 233, 234, 40, 39, 38, 219, 217, 215, 904, 281, + /* 430 */ 1272, 1272, 214, 158, 157, 156, 155, 57, 73, 777, + /* 440 */ 405, 404, 971, 413, 98, 403, 909, 903, 905, 402, + /* 450 */ 65, 401, 400, 1098, 65, 1096, 1097, 42, 41, 65, + /* 460 */ 1099, 40, 39, 38, 1100, 65, 1101, 1102, 65, 65, + /* 470 */ 65, 904, 807, 287, 65, 228, 897, 284, 900, 282, + /* 480 */ 872, 374, 373, 359, 307, 1272, 291, 1275, 288, 290, + /* 490 */ 383, 382, 361, 228, 1147, 375, 40, 39, 38, 376, + /* 500 */ 364, 824, 1129, 1272, 377, 1275, 1129, 92, 245, 333, + /* 510 */ 378, 1129, 304, 384, 385, 386, 65, 1129, 1272, 390, + /* 520 */ 1129, 1129, 1129, 246, 247, 290, 1129, 248, 249, 1258, + /* 530 */ 368, 906, 1257, 1272, 1272, 1256, 1130, 1272, 1272, 1272, + /* 540 */ 871, 1113, 1272, 254, 255, 1272, 230, 231, 235, 229, + /* 550 */ 236, 237, 239, 1272, 1272, 240, 1272, 1272, 1272, 1272, + /* 560 */ 1272, 1272, 1272, 241, 238, 1272, 821, 225, 1128, 1206, + /* 570 */ 109, 1207, 108, 1272, 1272, 1031, 1022, 1272, 406, 1059, + /* 580 */ 1, 197, 209, 209, 3, 210, 305, 99, 849, 828, + /* 590 */ 315, 314, 859, 860, 788, 10, 338, 907, 790, 340, + /* 600 */ 66, 789, 175, 60, 278, 943, 77, 54, 66, 910, + /* 610 */ 66, 367, 77, 113, 693, 77, 15, 1286, 14, 9, + /* 620 */ 131, 1218, 130, 9, 17, 268, 16, 307, 9, 813, + /* 630 */ 811, 814, 812, 19, 366, 18, 341, 1215, 913, 380, + /* 640 */ 379, 137, 21, 136, 20, 895, 150, 149, 191, 1214, + /* 650 */ 269, 389, 169, 26, 301, 171, 172, 1127, 1155, 1166, + /* 660 */ 1163, 1164, 1148, 308, 1168, 174, 179, 326, 1198, 1123, + /* 670 */ 1197, 1196, 1195, 190, 192, 165, 1121, 193, 194, 1299, + /* 680 */ 407, 1036, 343, 344, 345, 348, 349, 75, 839, 222, + /* 690 */ 71, 360, 1030, 372, 1293, 128, 27, 319, 1292, 1289, + /* 700 */ 200, 381, 1285, 134, 1284, 1281, 201, 264, 321, 323, + /* 710 */ 1056, 72, 67, 87, 1145, 180, 76, 84, 223, 335, + /* 720 */ 28, 1018, 329, 331, 144, 327, 182, 1016, 146, 147, + /* 730 */ 185, 1014, 1013, 292, 212, 181, 213, 1010, 1009, 1008, + /* 740 */ 1007, 1006, 1005, 1004, 216, 218, 996, 220, 993, 221, + /* 750 */ 989, 325, 322, 168, 318, 90, 306, 1125, 97, 94, + /* 760 */ 102, 324, 347, 399, 139, 391, 392, 393, 88, 395, + /* 770 */ 275, 342, 394, 396, 397, 170, 968, 295, 967, 250, + /* 780 */ 294, 251, 1035, 122, 123, 1034, 298, 1012, 297, 966, + /* 790 */ 949, 948, 302, 11, 307, 816, 337, 309, 100, 204, + /* 800 */ 159, 203, 1057, 202, 206, 205, 208, 1011, 207, 160, + /* 810 */ 1003, 2, 161, 1094, 336, 1002, 183, 162, 995, 1058, + /* 820 */ 189, 187, 184, 186, 59, 4, 994, 58, 103, 848, + /* 830 */ 80, 846, 1104, 842, 845, 841, 81, 178, 850, 176, + /* 840 */ 266, 861, 177, 22, 855, 104, 69, 857, 105, 328, + /* 850 */ 366, 332, 23, 70, 111, 12, 55, 339, 116, 114, + /* 860 */ 119, 56, 62, 708, 743, 741, 740, 118, 739, 63, + /* 870 */ 120, 737, 736, 735, 732, 358, 698, 124, 7, 940, + /* 880 */ 938, 912, 941, 911, 939, 8, 370, 127, 914, 78, + /* 890 */ 369, 66, 129, 810, 79, 133, 780, 779, 135, 776, + /* 900 */ 724, 722, 714, 720, 809, 716, 718, 712, 710, 746, + /* 910 */ 745, 744, 742, 738, 734, 733, 211, 696, 661, 973, + /* 920 */ 670, 408, 668, 972, 972, 972, 972, 972, 972, 972, + /* 930 */ 972, 972, 972, 972, 410, }; static const YYCODETYPE yy_lookahead[] = { - /* 0 */ 279, 1, 208, 208, 206, 207, 279, 5, 208, 9, - /* 10 */ 289, 1, 291, 254, 14, 15, 289, 17, 18, 9, - /* 20 */ 261, 21, 22, 23, 24, 208, 209, 27, 28, 29, - /* 30 */ 30, 31, 32, 33, 216, 1, 279, 37, 38, 37, - /* 40 */ 38, 41, 42, 43, 14, 15, 289, 17, 18, 255, - /* 50 */ 266, 21, 22, 23, 24, 284, 258, 27, 28, 29, - /* 60 */ 30, 31, 32, 33, 41, 42, 43, 37, 38, 285, - /* 70 */ 252, 41, 42, 43, 276, 1, 281, 282, 14, 15, - /* 80 */ 280, 17, 18, 9, 5, 21, 22, 23, 24, 208, - /* 90 */ 90, 27, 28, 29, 30, 31, 32, 33, 69, 70, - /* 100 */ 71, 37, 38, 279, 279, 41, 42, 43, 14, 15, - /* 110 */ 86, 17, 18, 289, 289, 21, 22, 23, 24, 87, - /* 120 */ 90, 27, 28, 29, 30, 31, 32, 33, 66, 67, - /* 130 */ 68, 37, 38, 101, 253, 41, 42, 43, 88, 14, - /* 140 */ 15, 260, 17, 18, 120, 121, 21, 22, 23, 24, - /* 150 */ 208, 87, 27, 28, 29, 30, 31, 32, 33, 94, - /* 160 */ 86, 219, 37, 38, 279, 1, 41, 42, 43, 15, - /* 170 */ 279, 17, 18, 9, 289, 21, 22, 23, 24, 279, - /* 180 */ 289, 27, 28, 29, 30, 31, 32, 33, 208, 289, - /* 190 */ 86, 37, 38, 132, 133, 41, 42, 43, 102, 103, - /* 200 */ 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, - /* 210 */ 114, 115, 116, 49, 50, 51, 52, 53, 54, 55, - /* 220 */ 56, 57, 58, 59, 60, 61, 62, 63, 208, 65, - /* 230 */ 126, 17, 18, 253, 261, 21, 22, 23, 24, 150, - /* 240 */ 260, 27, 28, 29, 30, 31, 32, 33, 159, 160, - /* 250 */ 101, 37, 38, 208, 261, 41, 42, 43, 48, 47, - /* 260 */ 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, - /* 270 */ 242, 243, 244, 245, 246, 65, 64, 1, 2, 130, - /* 280 */ 260, 5, 72, 7, 287, 9, 289, 290, 78, 79, - /* 290 */ 80, 81, 279, 1, 2, 85, 86, 5, 253, 7, - /* 300 */ 284, 9, 289, 16, 287, 260, 289, 29, 30, 31, - /* 310 */ 32, 33, 279, 37, 38, 37, 38, 41, 279, 41, - /* 320 */ 42, 43, 289, 248, 66, 67, 68, 279, 289, 37, - /* 330 */ 38, 73, 74, 75, 76, 77, 126, 289, 2, 286, - /* 340 */ 287, 5, 289, 7, 33, 9, 261, 5, 37, 38, - /* 350 */ 92, 9, 41, 42, 43, 0, 66, 67, 68, 149, - /* 360 */ 208, 151, 86, 73, 74, 75, 76, 77, 158, 72, - /* 370 */ 215, 215, 162, 37, 38, 66, 67, 68, 86, 37, - /* 380 */ 38, 5, 73, 7, 75, 76, 77, 72, 215, 5, - /* 390 */ 287, 7, 289, 84, 279, 232, 248, 234, 235, 123, - /* 400 */ 124, 125, 239, 216, 289, 253, 243, 254, 245, 246, - /* 410 */ 123, 208, 260, 248, 261, 123, 124, 125, 102, 25, - /* 420 */ 104, 105, 37, 38, 148, 109, 41, 42, 43, 113, - /* 430 */ 208, 115, 116, 208, 279, 279, 249, 250, 251, 252, - /* 440 */ 148, 47, 208, 88, 289, 289, 291, 291, 256, 152, - /* 450 */ 208, 154, 279, 156, 157, 208, 253, 208, 64, 123, - /* 460 */ 124, 208, 289, 260, 291, 41, 124, 152, 219, 154, - /* 470 */ 254, 156, 157, 208, 208, 253, 279, 261, 253, 279, - /* 480 */ 86, 279, 260, 279, 219, 260, 289, 253, 279, 289, - /* 490 */ 216, 289, 208, 289, 260, 253, 80, 214, 289, 87, - /* 500 */ 253, 125, 260, 219, 221, 279, 253, 260, 82, 125, - /* 510 */ 262, 279, 279, 260, 258, 289, 279, 279, 279, 258, - /* 520 */ 94, 289, 289, 87, 250, 277, 289, 289, 289, 230, - /* 530 */ 231, 214, 276, 214, 87, 217, 218, 276, 221, 127, - /* 540 */ 221, 212, 213, 37, 38, 87, 87, 101, 101, 1, - /* 550 */ 87, 101, 87, 129, 87, 87, 140, 87, 86, 101, - /* 560 */ 101, 87, 25, 127, 101, 87, 101, 87, 101, 101, - /* 570 */ 153, 101, 155, 86, 153, 101, 155, 208, 153, 101, - /* 580 */ 155, 101, 37, 38, 47, 5, 5, 7, 7, 41, - /* 590 */ 208, 119, 146, 153, 144, 155, 153, 153, 155, 155, - /* 600 */ 82, 83, 248, 208, 248, 118, 248, 248, 208, 208, - /* 610 */ 278, 208, 208, 208, 208, 258, 208, 208, 258, 208, - /* 620 */ 258, 288, 288, 288, 263, 288, 208, 208, 208, 264, - /* 630 */ 208, 208, 64, 125, 88, 208, 208, 208, 208, 208, - /* 640 */ 208, 208, 208, 208, 147, 208, 208, 208, 275, 208, - /* 650 */ 208, 283, 143, 208, 283, 283, 208, 208, 283, 208, - /* 660 */ 208, 208, 208, 208, 208, 208, 145, 274, 208, 208, - /* 670 */ 208, 138, 208, 142, 208, 273, 141, 208, 271, 208, - /* 680 */ 136, 208, 272, 208, 208, 208, 135, 208, 134, 208, - /* 690 */ 208, 208, 208, 208, 208, 137, 208, 208, 208, 208, - /* 700 */ 208, 208, 208, 208, 208, 131, 122, 93, 210, 117, - /* 710 */ 211, 210, 210, 210, 210, 210, 100, 99, 55, 96, - /* 720 */ 98, 59, 97, 210, 95, 130, 210, 210, 5, 5, - /* 730 */ 161, 5, 161, 210, 210, 5, 5, 104, 103, 220, - /* 740 */ 220, 216, 216, 150, 127, 119, 86, 128, 87, 101, - /* 750 */ 210, 86, 210, 223, 211, 227, 229, 228, 226, 225, - /* 760 */ 224, 222, 87, 211, 211, 210, 210, 217, 211, 247, - /* 770 */ 270, 257, 231, 210, 210, 264, 269, 212, 268, 267, - /* 780 */ 265, 101, 101, 125, 125, 247, 5, 5, 86, 101, - /* 790 */ 87, 86, 1, 87, 86, 101, 87, 86, 47, 87, - /* 800 */ 86, 86, 1, 139, 86, 101, 139, 90, 86, 119, - /* 810 */ 82, 86, 120, 74, 5, 9, 5, 5, 91, 90, - /* 820 */ 5, 5, 5, 91, 90, 5, 5, 89, 82, 16, - /* 830 */ 86, 9, 9, 9, 87, 87, 9, 63, 86, 123, - /* 840 */ 155, 155, 28, 17, 101, 125, 125, 17, 155, 5, - /* 850 */ 155, 5, 87, 5, 5, 5, 5, 5, 5, 5, - /* 860 */ 5, 5, 5, 5, 5, 5, 5, 5, 101, 89, - /* 870 */ 0, 64, 9, 292, 9, 292, 292, 292, 292, 292, - /* 880 */ 292, 292, 292, 292, 292, 292, 22, 292, 22, 292, - /* 890 */ 292, 292, 292, 292, 292, 292, 292, 292, 292, 292, - /* 900 */ 292, 292, 292, 292, 292, 292, 292, 292, 292, 292, - /* 910 */ 292, 292, 292, 292, 292, 292, 292, 292, 292, 292, - /* 920 */ 292, 292, 292, 292, 292, 292, 292, 292, 292, 292, - /* 930 */ 292, 292, 292, 292, 292, 292, 292, 292, 292, 292, - /* 940 */ 292, 292, 292, 292, 292, 292, 292, 292, 292, 292, - /* 950 */ 292, 292, 292, 292, 292, 292, 292, 292, 292, 292, - /* 960 */ 292, 292, 292, 292, 292, 292, 292, 292, 292, 292, - /* 970 */ 292, 292, 292, 292, 292, 292, 292, 292, 292, 292, - /* 980 */ 292, 292, 292, 292, 292, 292, 292, 292, 292, 292, - /* 990 */ 292, 292, 292, 292, 292, 292, 292, 292, 292, 292, - /* 1000 */ 292, 292, 292, 292, 292, 292, 292, 292, 292, 292, - /* 1010 */ 292, 292, 292, 292, 292, 292, 292, 292, 292, 292, - /* 1020 */ 292, 292, 292, 292, 292, 292, 292, 292, 292, 292, - /* 1030 */ 292, 292, 292, 292, 292, 292, 292, 292, 292, 292, - /* 1040 */ 292, 292, 292, 292, 292, 292, 292, 292, 292, 292, - /* 1050 */ 292, 292, 292, 292, 292, 292, 292, 292, 292, 292, - /* 1060 */ 292, 292, 292, 292, 292, 292, 292, 292, 292, 292, - /* 1070 */ 292, 292, 292, 292, 292, 292, 292, 292, 292, 292, - /* 1080 */ 292, 292, 292, 292, 292, 292, 292, 292, 292, 292, - /* 1090 */ 292, 292, 292, 292, + /* 0 */ 280, 1, 209, 209, 288, 209, 290, 291, 1, 9, + /* 10 */ 290, 1, 292, 220, 14, 15, 9, 17, 18, 209, + /* 20 */ 210, 21, 22, 23, 24, 262, 209, 27, 28, 29, + /* 30 */ 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, + /* 40 */ 255, 263, 42, 43, 44, 14, 15, 262, 17, 18, + /* 50 */ 254, 5, 21, 22, 23, 24, 278, 261, 27, 28, + /* 60 */ 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, + /* 70 */ 39, 254, 259, 42, 43, 44, 282, 283, 261, 14, + /* 80 */ 15, 5, 17, 18, 38, 39, 21, 22, 23, 24, + /* 90 */ 277, 91, 27, 28, 29, 30, 31, 32, 33, 34, + /* 100 */ 35, 36, 37, 38, 39, 280, 280, 42, 43, 44, + /* 110 */ 14, 15, 87, 17, 18, 290, 290, 21, 22, 23, + /* 120 */ 24, 209, 91, 27, 28, 29, 30, 31, 32, 33, + /* 130 */ 34, 35, 36, 37, 38, 39, 255, 102, 42, 43, + /* 140 */ 44, 14, 15, 262, 17, 18, 121, 122, 21, 22, + /* 150 */ 23, 24, 89, 88, 27, 28, 29, 30, 31, 32, + /* 160 */ 33, 34, 35, 36, 37, 38, 39, 151, 256, 42, + /* 170 */ 43, 44, 15, 280, 17, 18, 160, 161, 21, 22, + /* 180 */ 23, 24, 147, 290, 27, 28, 29, 30, 31, 32, + /* 190 */ 33, 34, 35, 36, 37, 38, 39, 1, 83, 42, + /* 200 */ 43, 44, 17, 18, 255, 9, 21, 22, 23, 24, + /* 210 */ 95, 262, 27, 28, 29, 30, 31, 32, 33, 34, + /* 220 */ 35, 36, 37, 38, 39, 133, 134, 42, 43, 44, + /* 230 */ 95, 103, 104, 105, 106, 107, 108, 109, 110, 111, + /* 240 */ 112, 113, 114, 115, 116, 117, 50, 51, 52, 53, + /* 250 */ 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, + /* 260 */ 64, 87, 66, 233, 234, 235, 236, 237, 238, 239, + /* 270 */ 240, 241, 242, 243, 244, 245, 246, 247, 49, 5, + /* 280 */ 1, 2, 25, 9, 5, 102, 7, 267, 9, 67, + /* 290 */ 68, 69, 67, 68, 69, 66, 74, 285, 76, 77, + /* 300 */ 78, 127, 73, 209, 216, 48, 286, 85, 79, 80, + /* 310 */ 81, 82, 38, 39, 220, 86, 87, 38, 39, 209, + /* 320 */ 280, 42, 65, 1, 2, 259, 47, 5, 145, 7, + /* 330 */ 290, 9, 29, 30, 31, 32, 33, 34, 35, 36, + /* 340 */ 37, 38, 39, 277, 87, 42, 43, 44, 209, 217, + /* 350 */ 2, 1, 280, 5, 217, 7, 127, 9, 285, 9, + /* 360 */ 38, 39, 290, 67, 68, 69, 87, 262, 280, 47, + /* 370 */ 74, 75, 76, 77, 78, 70, 71, 72, 290, 150, + /* 380 */ 292, 152, 250, 251, 252, 253, 38, 39, 159, 93, + /* 390 */ 253, 281, 163, 254, 0, 287, 288, 73, 290, 125, + /* 400 */ 261, 215, 249, 124, 125, 126, 73, 87, 222, 87, + /* 410 */ 5, 216, 7, 33, 34, 35, 36, 37, 38, 39, + /* 420 */ 280, 280, 42, 43, 44, 67, 68, 69, 149, 216, + /* 430 */ 290, 290, 74, 75, 76, 77, 78, 87, 103, 119, + /* 440 */ 105, 106, 207, 208, 88, 110, 124, 125, 126, 114, + /* 450 */ 209, 116, 117, 233, 209, 235, 236, 38, 39, 209, + /* 460 */ 240, 42, 43, 44, 244, 209, 246, 247, 209, 209, + /* 470 */ 209, 149, 124, 125, 209, 280, 5, 153, 7, 155, + /* 480 */ 81, 157, 158, 89, 128, 290, 153, 292, 155, 209, + /* 490 */ 157, 158, 48, 280, 259, 254, 42, 43, 44, 254, + /* 500 */ 220, 42, 261, 290, 254, 292, 261, 217, 280, 65, + /* 510 */ 254, 261, 277, 254, 254, 254, 209, 261, 290, 254, + /* 520 */ 261, 261, 261, 280, 280, 209, 261, 280, 280, 280, + /* 530 */ 16, 126, 280, 290, 290, 280, 220, 290, 290, 290, + /* 540 */ 141, 251, 290, 280, 280, 290, 280, 280, 280, 280, + /* 550 */ 280, 280, 280, 290, 290, 280, 290, 290, 290, 290, + /* 560 */ 290, 290, 290, 280, 280, 290, 102, 280, 261, 288, + /* 570 */ 288, 290, 290, 290, 290, 215, 215, 290, 231, 232, + /* 580 */ 218, 219, 222, 222, 213, 214, 88, 88, 88, 130, + /* 590 */ 38, 39, 88, 88, 88, 131, 88, 126, 88, 88, + /* 600 */ 102, 88, 102, 87, 1, 88, 102, 102, 102, 88, + /* 610 */ 102, 25, 102, 102, 88, 102, 154, 262, 156, 102, + /* 620 */ 154, 249, 156, 102, 154, 249, 156, 128, 102, 5, + /* 630 */ 5, 7, 7, 154, 48, 156, 120, 249, 124, 38, + /* 640 */ 39, 154, 154, 156, 156, 42, 83, 84, 257, 249, + /* 650 */ 249, 249, 209, 279, 209, 209, 209, 209, 209, 209, + /* 660 */ 209, 209, 259, 259, 209, 209, 209, 209, 289, 259, + /* 670 */ 289, 289, 289, 264, 209, 65, 209, 209, 209, 265, + /* 680 */ 89, 209, 209, 209, 209, 209, 209, 209, 126, 209, + /* 690 */ 209, 209, 209, 209, 209, 209, 148, 284, 209, 209, + /* 700 */ 209, 209, 209, 209, 209, 209, 209, 284, 284, 284, + /* 710 */ 209, 209, 209, 144, 276, 275, 209, 146, 209, 139, + /* 720 */ 143, 209, 137, 142, 209, 136, 273, 209, 209, 209, + /* 730 */ 270, 209, 209, 209, 209, 274, 209, 209, 209, 209, + /* 740 */ 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, + /* 750 */ 209, 135, 138, 211, 132, 212, 211, 211, 211, 123, + /* 760 */ 211, 211, 94, 118, 101, 100, 56, 97, 211, 60, + /* 770 */ 211, 211, 99, 98, 96, 131, 5, 5, 5, 211, + /* 780 */ 162, 211, 221, 217, 217, 221, 5, 211, 162, 5, + /* 790 */ 105, 104, 151, 87, 128, 88, 120, 102, 129, 224, + /* 800 */ 212, 228, 230, 229, 225, 227, 223, 211, 226, 212, + /* 810 */ 211, 218, 212, 248, 258, 211, 272, 212, 211, 232, + /* 820 */ 265, 268, 271, 269, 266, 213, 211, 87, 102, 88, + /* 830 */ 102, 126, 248, 5, 126, 5, 87, 102, 88, 87, + /* 840 */ 1, 88, 87, 140, 88, 87, 102, 88, 87, 87, + /* 850 */ 48, 1, 140, 102, 91, 87, 87, 120, 83, 121, + /* 860 */ 75, 87, 92, 5, 9, 5, 5, 91, 5, 92, + /* 870 */ 91, 5, 5, 5, 5, 16, 90, 83, 87, 9, + /* 880 */ 9, 88, 9, 88, 9, 87, 64, 156, 124, 17, + /* 890 */ 28, 102, 156, 126, 17, 156, 5, 5, 156, 88, + /* 900 */ 5, 5, 5, 5, 126, 5, 5, 5, 5, 5, + /* 910 */ 5, 5, 5, 5, 5, 5, 102, 90, 65, 0, + /* 920 */ 9, 22, 9, 293, 293, 293, 293, 293, 293, 293, + /* 930 */ 293, 293, 293, 293, 22, 293, 293, 293, 293, 293, + /* 940 */ 293, 293, 293, 293, 293, 293, 293, 293, 293, 293, + /* 950 */ 293, 293, 293, 293, 293, 293, 293, 293, 293, 293, + /* 960 */ 293, 293, 293, 293, 293, 293, 293, 293, 293, 293, + /* 970 */ 293, 293, 293, 293, 293, 293, 293, 293, 293, 293, + /* 980 */ 293, 293, 293, 293, 293, 293, 293, 293, 293, 293, + /* 990 */ 293, 293, 293, 293, 293, 293, 293, 293, 293, 293, + /* 1000 */ 293, 293, 293, 293, 293, 293, 293, 293, 293, 293, + /* 1010 */ 293, 293, 293, 293, 293, 293, 293, 293, 293, 293, + /* 1020 */ 293, 293, 293, 293, 293, 293, 293, 293, 293, 293, + /* 1030 */ 293, 293, 293, 293, 293, 293, 293, 293, 293, 293, + /* 1040 */ 293, 293, 293, 293, 293, 293, 293, 293, 293, 293, + /* 1050 */ 293, 293, 293, 293, 293, 293, 293, 293, 293, 293, + /* 1060 */ 293, 293, 293, 293, 293, 293, 293, 293, 293, 293, + /* 1070 */ 293, 293, 293, 293, 293, 293, 293, 293, 293, 293, + /* 1080 */ 293, 293, 293, 293, 293, 293, 293, 293, 293, 293, + /* 1090 */ 293, 293, 293, 293, 293, 293, 293, 293, 293, 293, + /* 1100 */ 293, 293, 293, 293, 293, 293, 293, 293, 293, 293, + /* 1110 */ 293, 293, 293, 293, 293, 293, 293, 293, 293, 293, + /* 1120 */ 293, 293, 293, 293, 293, 293, 293, 293, 293, 293, + /* 1130 */ 293, 293, 293, 293, 293, 293, 293, 293, 293, 293, + /* 1140 */ 293, }; -#define YY_SHIFT_COUNT (404) +#define YY_SHIFT_COUNT (413) #define YY_SHIFT_MIN (0) -#define YY_SHIFT_MAX (870) +#define YY_SHIFT_MAX (919) static const unsigned short int yy_shift_ofst[] = { - /* 0 */ 210, 96, 96, 316, 316, 50, 276, 292, 292, 292, - /* 10 */ 74, 10, 10, 10, 10, 10, 10, 10, 10, 10, - /* 20 */ 10, 10, 34, 34, 0, 164, 292, 292, 292, 292, - /* 30 */ 292, 292, 292, 292, 292, 292, 292, 292, 292, 292, - /* 40 */ 292, 292, 292, 292, 292, 292, 292, 292, 292, 336, - /* 50 */ 336, 336, 104, 104, 61, 10, 355, 10, 10, 10, - /* 60 */ 10, 10, 426, 50, 34, 34, 65, 65, 79, 889, - /* 70 */ 889, 889, 336, 336, 336, 342, 342, 2, 2, 2, - /* 80 */ 2, 2, 2, 24, 2, 10, 10, 10, 10, 10, - /* 90 */ 10, 424, 10, 10, 10, 104, 104, 10, 10, 10, - /* 100 */ 10, 416, 416, 416, 416, 149, 104, 10, 10, 10, - /* 110 */ 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - /* 120 */ 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - /* 130 */ 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - /* 140 */ 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - /* 150 */ 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - /* 160 */ 10, 10, 10, 497, 568, 546, 568, 568, 568, 568, - /* 170 */ 508, 508, 508, 508, 568, 509, 521, 533, 531, 535, - /* 180 */ 544, 551, 554, 558, 574, 497, 584, 568, 568, 568, - /* 190 */ 614, 614, 592, 50, 50, 568, 568, 616, 618, 663, - /* 200 */ 623, 622, 662, 625, 629, 592, 79, 568, 568, 546, - /* 210 */ 546, 568, 546, 568, 546, 568, 568, 889, 889, 30, - /* 220 */ 64, 94, 94, 94, 125, 154, 214, 278, 278, 278, - /* 230 */ 278, 278, 278, 258, 309, 290, 311, 311, 311, 311, - /* 240 */ 385, 297, 315, 394, 89, 23, 23, 376, 384, 29, - /* 250 */ 62, 32, 412, 436, 506, 447, 458, 459, 212, 446, - /* 260 */ 450, 463, 465, 467, 468, 470, 472, 474, 478, 537, - /* 270 */ 548, 287, 480, 417, 421, 425, 580, 581, 545, 440, - /* 280 */ 443, 487, 444, 518, 595, 723, 569, 724, 726, 571, - /* 290 */ 730, 731, 633, 635, 593, 617, 626, 660, 619, 661, - /* 300 */ 665, 648, 680, 675, 681, 658, 659, 781, 782, 702, - /* 310 */ 703, 705, 706, 708, 709, 688, 711, 712, 714, 791, - /* 320 */ 715, 694, 664, 751, 801, 704, 667, 717, 718, 626, - /* 330 */ 722, 690, 725, 692, 728, 727, 729, 739, 809, 732, - /* 340 */ 734, 806, 811, 812, 815, 816, 817, 820, 821, 738, - /* 350 */ 813, 746, 822, 823, 744, 747, 748, 824, 827, 716, - /* 360 */ 752, 814, 774, 826, 685, 686, 743, 743, 743, 743, - /* 370 */ 720, 721, 830, 693, 695, 743, 743, 743, 844, 846, - /* 380 */ 765, 743, 848, 849, 850, 851, 852, 853, 854, 855, - /* 390 */ 856, 857, 858, 859, 860, 861, 862, 767, 780, 863, - /* 400 */ 864, 865, 866, 807, 870, + /* 0 */ 229, 128, 128, 335, 335, 63, 279, 322, 322, 322, + /* 10 */ 350, 7, 7, 7, 7, 7, 7, 7, 7, 7, + /* 20 */ 7, 7, 10, 10, 0, 196, 322, 322, 322, 322, + /* 30 */ 322, 322, 322, 322, 322, 322, 322, 322, 322, 322, + /* 40 */ 322, 322, 322, 322, 322, 322, 322, 322, 322, 322, + /* 50 */ 322, 322, 322, 322, 348, 348, 348, 174, 174, 92, + /* 60 */ 7, 394, 7, 7, 7, 7, 7, 115, 63, 10, + /* 70 */ 10, 135, 135, 76, 935, 935, 935, 348, 348, 348, + /* 80 */ 274, 274, 46, 46, 46, 46, 46, 46, 25, 46, + /* 90 */ 7, 7, 7, 7, 7, 7, 459, 7, 7, 7, + /* 100 */ 174, 174, 7, 7, 7, 7, 399, 399, 399, 399, + /* 110 */ 464, 174, 7, 7, 7, 7, 7, 7, 7, 7, + /* 120 */ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, + /* 130 */ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, + /* 140 */ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, + /* 150 */ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, + /* 160 */ 7, 7, 7, 7, 7, 7, 7, 7, 548, 610, + /* 170 */ 591, 610, 610, 610, 610, 562, 562, 562, 562, 610, + /* 180 */ 569, 571, 580, 577, 581, 585, 589, 616, 614, 622, + /* 190 */ 548, 636, 610, 610, 610, 668, 668, 645, 63, 63, + /* 200 */ 610, 610, 663, 665, 710, 670, 673, 709, 675, 678, + /* 210 */ 645, 76, 610, 610, 591, 591, 610, 591, 610, 591, + /* 220 */ 610, 610, 935, 935, 31, 65, 96, 96, 96, 127, + /* 230 */ 157, 185, 303, 303, 303, 303, 303, 303, 380, 380, + /* 240 */ 380, 380, 296, 222, 358, 419, 419, 419, 419, 419, + /* 250 */ 324, 333, 257, 16, 454, 454, 405, 471, 305, 225, + /* 260 */ 498, 356, 499, 552, 500, 504, 505, 444, 35, 183, + /* 270 */ 506, 508, 510, 511, 513, 516, 517, 521, 586, 603, + /* 280 */ 514, 526, 462, 466, 470, 624, 625, 601, 479, 487, + /* 290 */ 320, 488, 563, 644, 771, 618, 772, 773, 626, 781, + /* 300 */ 784, 685, 687, 641, 666, 676, 706, 669, 707, 740, + /* 310 */ 695, 726, 741, 728, 705, 708, 828, 830, 749, 750, + /* 320 */ 752, 753, 755, 756, 735, 758, 759, 761, 839, 762, + /* 330 */ 744, 703, 802, 850, 751, 712, 763, 768, 676, 769, + /* 340 */ 737, 774, 738, 775, 770, 776, 785, 858, 777, 779, + /* 350 */ 855, 860, 861, 863, 866, 867, 868, 869, 786, 859, + /* 360 */ 794, 870, 871, 791, 793, 795, 873, 875, 764, 798, + /* 370 */ 862, 822, 872, 731, 736, 789, 789, 789, 789, 767, + /* 380 */ 778, 877, 739, 742, 789, 789, 789, 891, 892, 811, + /* 390 */ 789, 895, 896, 897, 898, 900, 901, 902, 903, 904, + /* 400 */ 905, 906, 907, 908, 909, 910, 814, 827, 911, 899, + /* 410 */ 913, 912, 853, 919, }; -#define YY_REDUCE_COUNT (218) -#define YY_REDUCE_MIN (-279) -#define YY_REDUCE_MAX (565) +#define YY_REDUCE_COUNT (223) +#define YY_REDUCE_MIN (-284) +#define YY_REDUCE_MAX (615) static const short yy_reduce_ofst[] = { - /* 0 */ -202, 28, 28, 163, 163, 187, 155, 156, 173, -279, - /* 10 */ -205, -119, -20, 45, 152, 203, 222, 225, 234, 242, - /* 20 */ 247, 253, -3, 53, -200, -183, -273, -243, -176, -175, - /* 30 */ -115, -109, -100, 13, 33, 39, 48, 115, 197, 200, - /* 40 */ 202, 204, 209, 226, 232, 233, 237, 238, 239, -241, - /* 50 */ 153, 216, 256, 261, -216, -206, -182, -58, 249, 265, - /* 60 */ 284, 20, 283, 274, 17, 103, 317, 319, 299, 248, - /* 70 */ 318, 329, -27, -7, 85, -229, 16, 75, 148, 165, - /* 80 */ 354, 356, 358, 192, 359, 266, 369, 382, 395, 400, - /* 90 */ 401, 332, 403, 404, 405, 357, 360, 406, 408, 409, - /* 100 */ 411, 333, 334, 335, 337, 361, 362, 418, 419, 420, - /* 110 */ 422, 423, 427, 428, 429, 430, 431, 432, 433, 434, - /* 120 */ 435, 437, 438, 439, 441, 442, 445, 448, 449, 451, - /* 130 */ 452, 453, 454, 455, 456, 457, 460, 461, 462, 464, - /* 140 */ 466, 469, 471, 473, 475, 476, 477, 479, 481, 482, - /* 150 */ 483, 484, 485, 486, 488, 489, 490, 491, 492, 493, - /* 160 */ 494, 495, 496, 365, 498, 499, 501, 502, 503, 504, - /* 170 */ 368, 371, 372, 375, 505, 373, 393, 402, 410, 407, - /* 180 */ 500, 507, 510, 512, 515, 511, 514, 513, 516, 517, - /* 190 */ 519, 520, 522, 525, 526, 523, 524, 527, 529, 528, - /* 200 */ 530, 532, 536, 534, 539, 538, 541, 540, 542, 543, - /* 210 */ 552, 555, 553, 556, 557, 563, 564, 550, 565, + /* 0 */ 235, 30, 30, 220, 220, 132, 88, 195, 213, -280, + /* 10 */ -206, -204, -183, 139, 241, 245, 250, 256, 259, 260, + /* 20 */ 261, 265, -284, 108, 110, -190, -175, -174, -107, 40, + /* 30 */ 72, 140, 141, 228, 243, 244, 247, 248, 249, 252, + /* 40 */ 255, 263, 264, 266, 267, 268, 269, 270, 271, 272, + /* 50 */ 275, 283, 284, 287, -215, -119, -51, -187, 66, 20, + /* 60 */ -88, 137, -207, 94, 280, 316, 307, 186, 290, 281, + /* 70 */ 282, 360, 361, 347, -222, 362, 371, -237, 105, 355, + /* 80 */ 12, 73, 153, 372, 376, 388, 400, 401, 391, 402, + /* 90 */ 443, 445, 446, 447, 448, 449, 374, 450, 451, 452, + /* 100 */ 403, 404, 455, 456, 457, 458, 379, 381, 382, 383, + /* 110 */ 409, 410, 465, 467, 468, 469, 472, 473, 474, 475, + /* 120 */ 476, 477, 478, 480, 481, 482, 483, 484, 485, 486, + /* 130 */ 489, 490, 491, 492, 493, 494, 495, 496, 497, 501, + /* 140 */ 502, 503, 507, 509, 512, 515, 518, 519, 520, 522, + /* 150 */ 523, 524, 525, 527, 528, 529, 530, 531, 532, 533, + /* 160 */ 534, 535, 536, 537, 538, 539, 540, 541, 414, 542, + /* 170 */ 543, 545, 546, 547, 549, 413, 423, 424, 425, 550, + /* 180 */ 438, 440, 461, 453, 544, 551, 460, 554, 553, 558, + /* 190 */ 555, 556, 557, 559, 560, 561, 564, 565, 566, 567, + /* 200 */ 568, 570, 572, 574, 573, 575, 578, 579, 582, 583, + /* 210 */ 584, 587, 576, 596, 588, 597, 599, 600, 604, 605, + /* 220 */ 607, 615, 593, 612, }; static const YYACTIONTYPE yy_default[] = { - /* 0 */ 955, 1078, 1017, 1088, 1004, 1014, 1257, 1257, 1257, 1257, - /* 10 */ 955, 955, 955, 955, 955, 955, 955, 955, 955, 955, - /* 20 */ 955, 955, 955, 955, 1142, 975, 955, 955, 955, 955, - /* 30 */ 955, 955, 955, 955, 955, 955, 955, 955, 955, 955, - /* 40 */ 955, 955, 955, 955, 955, 955, 955, 955, 955, 955, - /* 50 */ 955, 955, 955, 955, 1166, 955, 1014, 955, 955, 955, - /* 60 */ 955, 955, 1024, 1014, 955, 955, 1024, 1024, 955, 1137, - /* 70 */ 1062, 1080, 955, 955, 955, 955, 955, 955, 955, 955, - /* 80 */ 955, 955, 955, 1109, 955, 955, 955, 955, 955, 955, - /* 90 */ 955, 1144, 1150, 1147, 955, 955, 955, 1152, 955, 955, - /* 100 */ 955, 1188, 1188, 1188, 1188, 1135, 955, 955, 955, 955, - /* 110 */ 955, 955, 955, 955, 955, 955, 955, 955, 955, 955, - /* 120 */ 955, 955, 955, 955, 955, 955, 955, 955, 955, 955, - /* 130 */ 955, 955, 955, 955, 955, 955, 955, 955, 955, 1002, - /* 140 */ 955, 1000, 955, 955, 955, 955, 955, 955, 955, 955, - /* 150 */ 955, 955, 955, 955, 955, 955, 955, 955, 955, 955, - /* 160 */ 955, 955, 973, 1205, 977, 1012, 977, 977, 977, 977, - /* 170 */ 955, 955, 955, 955, 977, 1197, 1201, 1178, 1195, 1189, - /* 180 */ 1173, 1171, 1169, 1177, 1162, 1205, 1111, 977, 977, 977, - /* 190 */ 1022, 1022, 1018, 1014, 1014, 977, 977, 1040, 1038, 1036, - /* 200 */ 1028, 1034, 1030, 1032, 1026, 1005, 955, 977, 977, 1012, - /* 210 */ 1012, 977, 1012, 977, 1012, 977, 977, 1062, 1080, 1256, - /* 220 */ 955, 1206, 1196, 1256, 955, 1238, 1237, 1247, 1246, 1245, - /* 230 */ 1236, 1235, 1234, 955, 955, 955, 1230, 1233, 1232, 1231, - /* 240 */ 1244, 955, 955, 1208, 955, 1240, 1239, 955, 955, 955, - /* 250 */ 955, 955, 955, 955, 1159, 955, 955, 955, 1184, 1202, - /* 260 */ 1198, 955, 955, 955, 955, 955, 955, 955, 955, 1209, - /* 270 */ 955, 955, 955, 955, 955, 955, 955, 955, 1123, 955, - /* 280 */ 955, 1090, 955, 955, 955, 955, 955, 955, 955, 955, - /* 290 */ 955, 955, 955, 955, 955, 1134, 955, 955, 955, 955, - /* 300 */ 955, 1146, 1145, 955, 955, 955, 955, 955, 955, 955, - /* 310 */ 955, 955, 955, 955, 955, 955, 955, 955, 955, 955, - /* 320 */ 955, 1190, 955, 1185, 955, 1179, 955, 955, 955, 1102, - /* 330 */ 955, 955, 955, 955, 955, 955, 955, 955, 955, 955, - /* 340 */ 955, 955, 955, 955, 955, 955, 955, 955, 955, 955, - /* 350 */ 955, 955, 955, 955, 955, 955, 955, 955, 955, 955, - /* 360 */ 955, 955, 955, 955, 955, 955, 1275, 1270, 1271, 1268, - /* 370 */ 955, 955, 955, 955, 955, 1267, 1262, 1263, 955, 955, - /* 380 */ 955, 1260, 955, 955, 955, 955, 955, 955, 955, 955, - /* 390 */ 955, 955, 955, 955, 955, 955, 955, 1046, 955, 955, - /* 400 */ 984, 955, 982, 955, 955, + /* 0 */ 970, 1093, 1032, 1103, 1019, 1029, 1277, 1277, 1277, 1277, + /* 10 */ 970, 970, 970, 970, 970, 970, 970, 970, 970, 970, + /* 20 */ 970, 970, 970, 970, 1157, 990, 970, 970, 970, 970, + /* 30 */ 970, 970, 970, 970, 970, 970, 970, 970, 970, 970, + /* 40 */ 970, 970, 970, 970, 970, 970, 970, 970, 970, 970, + /* 50 */ 970, 970, 970, 970, 970, 970, 970, 970, 970, 1181, + /* 60 */ 970, 1029, 970, 970, 970, 970, 970, 1039, 1029, 970, + /* 70 */ 970, 1039, 1039, 970, 1152, 1077, 1095, 970, 970, 970, + /* 80 */ 970, 970, 970, 970, 970, 970, 970, 970, 1124, 970, + /* 90 */ 970, 970, 970, 970, 970, 970, 1159, 1165, 1162, 970, + /* 100 */ 970, 970, 1167, 970, 970, 970, 1203, 1203, 1203, 1203, + /* 110 */ 1150, 970, 970, 970, 970, 970, 970, 970, 970, 970, + /* 120 */ 970, 970, 970, 970, 970, 970, 970, 970, 970, 970, + /* 130 */ 970, 970, 970, 970, 970, 970, 970, 970, 970, 970, + /* 140 */ 970, 970, 970, 970, 1017, 970, 1015, 970, 970, 970, + /* 150 */ 970, 970, 970, 970, 970, 970, 970, 970, 970, 970, + /* 160 */ 970, 970, 970, 970, 970, 970, 970, 988, 1220, 992, + /* 170 */ 1027, 992, 992, 992, 992, 970, 970, 970, 970, 992, + /* 180 */ 1212, 1216, 1193, 1210, 1204, 1188, 1186, 1184, 1192, 1177, + /* 190 */ 1220, 1126, 992, 992, 992, 1037, 1037, 1033, 1029, 1029, + /* 200 */ 992, 992, 1055, 1053, 1051, 1043, 1049, 1045, 1047, 1041, + /* 210 */ 1020, 970, 992, 992, 1027, 1027, 992, 1027, 992, 1027, + /* 220 */ 992, 992, 1077, 1095, 1276, 970, 1221, 1211, 1276, 970, + /* 230 */ 1253, 1252, 1267, 1266, 1265, 1251, 1250, 1249, 1245, 1248, + /* 240 */ 1247, 1246, 970, 970, 970, 1264, 1263, 1261, 1260, 1259, + /* 250 */ 970, 970, 1223, 970, 1255, 1254, 970, 970, 970, 970, + /* 260 */ 970, 970, 970, 1174, 970, 970, 970, 1199, 1217, 1213, + /* 270 */ 970, 970, 970, 970, 970, 970, 970, 970, 1224, 970, + /* 280 */ 970, 970, 970, 970, 970, 970, 970, 1138, 970, 970, + /* 290 */ 1105, 970, 970, 970, 970, 970, 970, 970, 970, 970, + /* 300 */ 970, 970, 970, 970, 1149, 970, 970, 970, 970, 970, + /* 310 */ 1161, 1160, 970, 970, 970, 970, 970, 970, 970, 970, + /* 320 */ 970, 970, 970, 970, 970, 970, 970, 970, 970, 970, + /* 330 */ 1205, 970, 1200, 970, 1194, 970, 970, 970, 1117, 970, + /* 340 */ 970, 970, 970, 970, 970, 970, 970, 970, 970, 970, + /* 350 */ 970, 970, 970, 970, 970, 970, 970, 970, 970, 970, + /* 360 */ 970, 970, 970, 970, 970, 970, 970, 970, 970, 970, + /* 370 */ 970, 970, 970, 970, 970, 1295, 1290, 1291, 1288, 970, + /* 380 */ 970, 970, 970, 970, 1287, 1282, 1283, 970, 970, 970, + /* 390 */ 1280, 970, 970, 970, 970, 970, 970, 970, 970, 970, + /* 400 */ 970, 970, 970, 970, 970, 970, 1061, 970, 970, 999, + /* 410 */ 970, 997, 970, 970, }; /********** End of lemon-generated parsing tables *****************************/ @@ -579,6 +592,7 @@ static const YYCODETYPE yyFallback[] = { 0, /* LE => nothing */ 0, /* BITAND => nothing */ 0, /* BITOR => nothing */ + 0, /* BITXOR => nothing */ 0, /* LSHIFT => nothing */ 0, /* RSHIFT => nothing */ 0, /* PLUS => nothing */ @@ -870,263 +884,264 @@ static const char *const yyTokenName[] = { /* 32 */ "LE", /* 33 */ "BITAND", /* 34 */ "BITOR", - /* 35 */ "LSHIFT", - /* 36 */ "RSHIFT", - /* 37 */ "PLUS", - /* 38 */ "MINUS", - /* 39 */ "DIVIDE", - /* 40 */ "TIMES", - /* 41 */ "STAR", - /* 42 */ "SLASH", - /* 43 */ "REM", - /* 44 */ "UMINUS", - /* 45 */ "UPLUS", - /* 46 */ "BITNOT", - /* 47 */ "ARROW", - /* 48 */ "SHOW", - /* 49 */ "DATABASES", - /* 50 */ "TOPICS", - /* 51 */ "FUNCTIONS", - /* 52 */ "MNODES", - /* 53 */ "DNODES", - /* 54 */ "ACCOUNTS", - /* 55 */ "USERS", - /* 56 */ "MODULES", - /* 57 */ "QUERIES", - /* 58 */ "CONNECTIONS", - /* 59 */ "STREAMS", - /* 60 */ "VARIABLES", - /* 61 */ "SCORES", - /* 62 */ "GRANTS", - /* 63 */ "VNODES", - /* 64 */ "DOT", - /* 65 */ "CREATE", - /* 66 */ "TABLE", - /* 67 */ "STABLE", - /* 68 */ "DATABASE", - /* 69 */ "TABLES", - /* 70 */ "STABLES", - /* 71 */ "VGROUPS", - /* 72 */ "DROP", - /* 73 */ "TOPIC", - /* 74 */ "FUNCTION", - /* 75 */ "DNODE", - /* 76 */ "USER", - /* 77 */ "ACCOUNT", - /* 78 */ "USE", - /* 79 */ "DESCRIBE", - /* 80 */ "DESC", - /* 81 */ "ALTER", - /* 82 */ "PASS", - /* 83 */ "PRIVILEGE", - /* 84 */ "LOCAL", - /* 85 */ "COMPACT", - /* 86 */ "LP", - /* 87 */ "RP", - /* 88 */ "IF", - /* 89 */ "EXISTS", - /* 90 */ "AS", - /* 91 */ "OUTPUTTYPE", - /* 92 */ "AGGREGATE", - /* 93 */ "BUFSIZE", - /* 94 */ "PPS", - /* 95 */ "TSERIES", - /* 96 */ "DBS", - /* 97 */ "STORAGE", - /* 98 */ "QTIME", - /* 99 */ "CONNS", - /* 100 */ "STATE", - /* 101 */ "COMMA", - /* 102 */ "KEEP", - /* 103 */ "CACHE", - /* 104 */ "REPLICA", - /* 105 */ "QUORUM", - /* 106 */ "DAYS", - /* 107 */ "MINROWS", - /* 108 */ "MAXROWS", - /* 109 */ "BLOCKS", - /* 110 */ "CTIME", - /* 111 */ "WAL", - /* 112 */ "FSYNC", - /* 113 */ "COMP", - /* 114 */ "PRECISION", - /* 115 */ "UPDATE", - /* 116 */ "CACHELAST", - /* 117 */ "PARTITIONS", - /* 118 */ "UNSIGNED", - /* 119 */ "TAGS", - /* 120 */ "USING", - /* 121 */ "TO", - /* 122 */ "SPLIT", - /* 123 */ "NULL", - /* 124 */ "NOW", - /* 125 */ "VARIABLE", - /* 126 */ "SELECT", - /* 127 */ "UNION", - /* 128 */ "ALL", - /* 129 */ "DISTINCT", - /* 130 */ "FROM", - /* 131 */ "RANGE", - /* 132 */ "INTERVAL", - /* 133 */ "EVERY", - /* 134 */ "SESSION", - /* 135 */ "STATE_WINDOW", - /* 136 */ "FILL", - /* 137 */ "SLIDING", - /* 138 */ "ORDER", - /* 139 */ "BY", - /* 140 */ "ASC", - /* 141 */ "GROUP", - /* 142 */ "HAVING", - /* 143 */ "LIMIT", - /* 144 */ "OFFSET", - /* 145 */ "SLIMIT", - /* 146 */ "SOFFSET", - /* 147 */ "WHERE", - /* 148 */ "TODAY", - /* 149 */ "RESET", - /* 150 */ "QUERY", - /* 151 */ "SYNCDB", - /* 152 */ "ADD", - /* 153 */ "COLUMN", - /* 154 */ "MODIFY", - /* 155 */ "TAG", - /* 156 */ "CHANGE", - /* 157 */ "SET", - /* 158 */ "KILL", - /* 159 */ "CONNECTION", - /* 160 */ "STREAM", - /* 161 */ "COLON", - /* 162 */ "DELETE", - /* 163 */ "ABORT", - /* 164 */ "AFTER", - /* 165 */ "ATTACH", - /* 166 */ "BEFORE", - /* 167 */ "BEGIN", - /* 168 */ "CASCADE", - /* 169 */ "CLUSTER", - /* 170 */ "CONFLICT", - /* 171 */ "COPY", - /* 172 */ "DEFERRED", - /* 173 */ "DELIMITERS", - /* 174 */ "DETACH", - /* 175 */ "EACH", - /* 176 */ "END", - /* 177 */ "EXPLAIN", - /* 178 */ "FAIL", - /* 179 */ "FOR", - /* 180 */ "IGNORE", - /* 181 */ "IMMEDIATE", - /* 182 */ "INITIALLY", - /* 183 */ "INSTEAD", - /* 184 */ "KEY", - /* 185 */ "OF", - /* 186 */ "RAISE", - /* 187 */ "REPLACE", - /* 188 */ "RESTRICT", - /* 189 */ "ROW", - /* 190 */ "STATEMENT", - /* 191 */ "TRIGGER", - /* 192 */ "VIEW", - /* 193 */ "IPTOKEN", - /* 194 */ "SEMI", - /* 195 */ "NONE", - /* 196 */ "PREV", - /* 197 */ "LINEAR", - /* 198 */ "IMPORT", - /* 199 */ "TBNAME", - /* 200 */ "JOIN", - /* 201 */ "INSERT", - /* 202 */ "INTO", - /* 203 */ "VALUES", - /* 204 */ "FILE", - /* 205 */ "error", - /* 206 */ "program", - /* 207 */ "cmd", - /* 208 */ "ids", - /* 209 */ "dbPrefix", - /* 210 */ "cpxName", - /* 211 */ "ifexists", - /* 212 */ "alter_db_optr", - /* 213 */ "alter_topic_optr", - /* 214 */ "acct_optr", - /* 215 */ "exprlist", - /* 216 */ "ifnotexists", - /* 217 */ "db_optr", - /* 218 */ "topic_optr", - /* 219 */ "typename", - /* 220 */ "bufsize", - /* 221 */ "pps", - /* 222 */ "tseries", - /* 223 */ "dbs", - /* 224 */ "streams", - /* 225 */ "storage", - /* 226 */ "qtime", - /* 227 */ "users", - /* 228 */ "conns", - /* 229 */ "state", - /* 230 */ "intitemlist", - /* 231 */ "intitem", - /* 232 */ "keep", - /* 233 */ "cache", - /* 234 */ "replica", - /* 235 */ "quorum", - /* 236 */ "days", - /* 237 */ "minrows", - /* 238 */ "maxrows", - /* 239 */ "blocks", - /* 240 */ "ctime", - /* 241 */ "wal", - /* 242 */ "fsync", - /* 243 */ "comp", - /* 244 */ "prec", - /* 245 */ "update", - /* 246 */ "cachelast", - /* 247 */ "partitions", - /* 248 */ "signed", - /* 249 */ "create_table_args", - /* 250 */ "create_stable_args", - /* 251 */ "create_table_list", - /* 252 */ "create_from_stable", - /* 253 */ "columnlist", - /* 254 */ "tagitemlist", - /* 255 */ "tagNamelist", - /* 256 */ "to_opt", - /* 257 */ "split_opt", - /* 258 */ "select", - /* 259 */ "to_split", - /* 260 */ "column", - /* 261 */ "tagitem", - /* 262 */ "selcollist", - /* 263 */ "from", - /* 264 */ "where_opt", - /* 265 */ "range_option", - /* 266 */ "interval_option", - /* 267 */ "sliding_opt", - /* 268 */ "session_option", - /* 269 */ "windowstate_option", - /* 270 */ "fill_opt", - /* 271 */ "groupby_opt", - /* 272 */ "having_opt", - /* 273 */ "orderby_opt", - /* 274 */ "slimit_opt", - /* 275 */ "limit_opt", - /* 276 */ "union", - /* 277 */ "sclp", - /* 278 */ "distinct", - /* 279 */ "expr", - /* 280 */ "as", - /* 281 */ "tablelist", - /* 282 */ "sub", - /* 283 */ "tmvar", - /* 284 */ "timestamp", - /* 285 */ "intervalKey", - /* 286 */ "sortlist", - /* 287 */ "item", - /* 288 */ "sortorder", - /* 289 */ "arrow", - /* 290 */ "grouplist", - /* 291 */ "expritem", + /* 35 */ "BITXOR", + /* 36 */ "LSHIFT", + /* 37 */ "RSHIFT", + /* 38 */ "PLUS", + /* 39 */ "MINUS", + /* 40 */ "DIVIDE", + /* 41 */ "TIMES", + /* 42 */ "STAR", + /* 43 */ "SLASH", + /* 44 */ "REM", + /* 45 */ "UMINUS", + /* 46 */ "UPLUS", + /* 47 */ "BITNOT", + /* 48 */ "ARROW", + /* 49 */ "SHOW", + /* 50 */ "DATABASES", + /* 51 */ "TOPICS", + /* 52 */ "FUNCTIONS", + /* 53 */ "MNODES", + /* 54 */ "DNODES", + /* 55 */ "ACCOUNTS", + /* 56 */ "USERS", + /* 57 */ "MODULES", + /* 58 */ "QUERIES", + /* 59 */ "CONNECTIONS", + /* 60 */ "STREAMS", + /* 61 */ "VARIABLES", + /* 62 */ "SCORES", + /* 63 */ "GRANTS", + /* 64 */ "VNODES", + /* 65 */ "DOT", + /* 66 */ "CREATE", + /* 67 */ "TABLE", + /* 68 */ "STABLE", + /* 69 */ "DATABASE", + /* 70 */ "TABLES", + /* 71 */ "STABLES", + /* 72 */ "VGROUPS", + /* 73 */ "DROP", + /* 74 */ "TOPIC", + /* 75 */ "FUNCTION", + /* 76 */ "DNODE", + /* 77 */ "USER", + /* 78 */ "ACCOUNT", + /* 79 */ "USE", + /* 80 */ "DESCRIBE", + /* 81 */ "DESC", + /* 82 */ "ALTER", + /* 83 */ "PASS", + /* 84 */ "PRIVILEGE", + /* 85 */ "LOCAL", + /* 86 */ "COMPACT", + /* 87 */ "LP", + /* 88 */ "RP", + /* 89 */ "IF", + /* 90 */ "EXISTS", + /* 91 */ "AS", + /* 92 */ "OUTPUTTYPE", + /* 93 */ "AGGREGATE", + /* 94 */ "BUFSIZE", + /* 95 */ "PPS", + /* 96 */ "TSERIES", + /* 97 */ "DBS", + /* 98 */ "STORAGE", + /* 99 */ "QTIME", + /* 100 */ "CONNS", + /* 101 */ "STATE", + /* 102 */ "COMMA", + /* 103 */ "KEEP", + /* 104 */ "CACHE", + /* 105 */ "REPLICA", + /* 106 */ "QUORUM", + /* 107 */ "DAYS", + /* 108 */ "MINROWS", + /* 109 */ "MAXROWS", + /* 110 */ "BLOCKS", + /* 111 */ "CTIME", + /* 112 */ "WAL", + /* 113 */ "FSYNC", + /* 114 */ "COMP", + /* 115 */ "PRECISION", + /* 116 */ "UPDATE", + /* 117 */ "CACHELAST", + /* 118 */ "PARTITIONS", + /* 119 */ "UNSIGNED", + /* 120 */ "TAGS", + /* 121 */ "USING", + /* 122 */ "TO", + /* 123 */ "SPLIT", + /* 124 */ "NULL", + /* 125 */ "NOW", + /* 126 */ "VARIABLE", + /* 127 */ "SELECT", + /* 128 */ "UNION", + /* 129 */ "ALL", + /* 130 */ "DISTINCT", + /* 131 */ "FROM", + /* 132 */ "RANGE", + /* 133 */ "INTERVAL", + /* 134 */ "EVERY", + /* 135 */ "SESSION", + /* 136 */ "STATE_WINDOW", + /* 137 */ "FILL", + /* 138 */ "SLIDING", + /* 139 */ "ORDER", + /* 140 */ "BY", + /* 141 */ "ASC", + /* 142 */ "GROUP", + /* 143 */ "HAVING", + /* 144 */ "LIMIT", + /* 145 */ "OFFSET", + /* 146 */ "SLIMIT", + /* 147 */ "SOFFSET", + /* 148 */ "WHERE", + /* 149 */ "TODAY", + /* 150 */ "RESET", + /* 151 */ "QUERY", + /* 152 */ "SYNCDB", + /* 153 */ "ADD", + /* 154 */ "COLUMN", + /* 155 */ "MODIFY", + /* 156 */ "TAG", + /* 157 */ "CHANGE", + /* 158 */ "SET", + /* 159 */ "KILL", + /* 160 */ "CONNECTION", + /* 161 */ "STREAM", + /* 162 */ "COLON", + /* 163 */ "DELETE", + /* 164 */ "ABORT", + /* 165 */ "AFTER", + /* 166 */ "ATTACH", + /* 167 */ "BEFORE", + /* 168 */ "BEGIN", + /* 169 */ "CASCADE", + /* 170 */ "CLUSTER", + /* 171 */ "CONFLICT", + /* 172 */ "COPY", + /* 173 */ "DEFERRED", + /* 174 */ "DELIMITERS", + /* 175 */ "DETACH", + /* 176 */ "EACH", + /* 177 */ "END", + /* 178 */ "EXPLAIN", + /* 179 */ "FAIL", + /* 180 */ "FOR", + /* 181 */ "IGNORE", + /* 182 */ "IMMEDIATE", + /* 183 */ "INITIALLY", + /* 184 */ "INSTEAD", + /* 185 */ "KEY", + /* 186 */ "OF", + /* 187 */ "RAISE", + /* 188 */ "REPLACE", + /* 189 */ "RESTRICT", + /* 190 */ "ROW", + /* 191 */ "STATEMENT", + /* 192 */ "TRIGGER", + /* 193 */ "VIEW", + /* 194 */ "IPTOKEN", + /* 195 */ "SEMI", + /* 196 */ "NONE", + /* 197 */ "PREV", + /* 198 */ "LINEAR", + /* 199 */ "IMPORT", + /* 200 */ "TBNAME", + /* 201 */ "JOIN", + /* 202 */ "INSERT", + /* 203 */ "INTO", + /* 204 */ "VALUES", + /* 205 */ "FILE", + /* 206 */ "error", + /* 207 */ "program", + /* 208 */ "cmd", + /* 209 */ "ids", + /* 210 */ "dbPrefix", + /* 211 */ "cpxName", + /* 212 */ "ifexists", + /* 213 */ "alter_db_optr", + /* 214 */ "alter_topic_optr", + /* 215 */ "acct_optr", + /* 216 */ "exprlist", + /* 217 */ "ifnotexists", + /* 218 */ "db_optr", + /* 219 */ "topic_optr", + /* 220 */ "typename", + /* 221 */ "bufsize", + /* 222 */ "pps", + /* 223 */ "tseries", + /* 224 */ "dbs", + /* 225 */ "streams", + /* 226 */ "storage", + /* 227 */ "qtime", + /* 228 */ "users", + /* 229 */ "conns", + /* 230 */ "state", + /* 231 */ "intitemlist", + /* 232 */ "intitem", + /* 233 */ "keep", + /* 234 */ "cache", + /* 235 */ "replica", + /* 236 */ "quorum", + /* 237 */ "days", + /* 238 */ "minrows", + /* 239 */ "maxrows", + /* 240 */ "blocks", + /* 241 */ "ctime", + /* 242 */ "wal", + /* 243 */ "fsync", + /* 244 */ "comp", + /* 245 */ "prec", + /* 246 */ "update", + /* 247 */ "cachelast", + /* 248 */ "partitions", + /* 249 */ "signed", + /* 250 */ "create_table_args", + /* 251 */ "create_stable_args", + /* 252 */ "create_table_list", + /* 253 */ "create_from_stable", + /* 254 */ "columnlist", + /* 255 */ "tagitemlist", + /* 256 */ "tagNamelist", + /* 257 */ "to_opt", + /* 258 */ "split_opt", + /* 259 */ "select", + /* 260 */ "to_split", + /* 261 */ "column", + /* 262 */ "tagitem", + /* 263 */ "selcollist", + /* 264 */ "from", + /* 265 */ "where_opt", + /* 266 */ "range_option", + /* 267 */ "interval_option", + /* 268 */ "sliding_opt", + /* 269 */ "session_option", + /* 270 */ "windowstate_option", + /* 271 */ "fill_opt", + /* 272 */ "groupby_opt", + /* 273 */ "having_opt", + /* 274 */ "orderby_opt", + /* 275 */ "slimit_opt", + /* 276 */ "limit_opt", + /* 277 */ "union", + /* 278 */ "sclp", + /* 279 */ "distinct", + /* 280 */ "expr", + /* 281 */ "as", + /* 282 */ "tablelist", + /* 283 */ "sub", + /* 284 */ "tmvar", + /* 285 */ "timestamp", + /* 286 */ "intervalKey", + /* 287 */ "sortlist", + /* 288 */ "item", + /* 289 */ "sortorder", + /* 290 */ "arrow", + /* 291 */ "grouplist", + /* 292 */ "expritem", }; #endif /* defined(YYCOVERAGE) || !defined(NDEBUG) */ @@ -1421,41 +1436,46 @@ static const char *const yyRuleName[] = { /* 284 */ "expr ::= expr SLASH expr", /* 285 */ "expr ::= expr REM expr", /* 286 */ "expr ::= expr BITAND expr", - /* 287 */ "expr ::= expr LIKE expr", - /* 288 */ "expr ::= expr MATCH expr", - /* 289 */ "expr ::= expr NMATCH expr", - /* 290 */ "expr ::= ID CONTAINS STRING", - /* 291 */ "expr ::= ID DOT ID CONTAINS STRING", - /* 292 */ "arrow ::= ID ARROW STRING", - /* 293 */ "arrow ::= ID DOT ID ARROW STRING", - /* 294 */ "expr ::= arrow", - /* 295 */ "expr ::= expr IN LP exprlist RP", - /* 296 */ "exprlist ::= exprlist COMMA expritem", - /* 297 */ "exprlist ::= expritem", - /* 298 */ "expritem ::= expr", - /* 299 */ "expritem ::=", - /* 300 */ "cmd ::= RESET QUERY CACHE", - /* 301 */ "cmd ::= SYNCDB ids REPLICA", - /* 302 */ "cmd ::= ALTER TABLE ids cpxName ADD COLUMN columnlist", - /* 303 */ "cmd ::= ALTER TABLE ids cpxName DROP COLUMN ids", - /* 304 */ "cmd ::= ALTER TABLE ids cpxName MODIFY COLUMN columnlist", - /* 305 */ "cmd ::= ALTER TABLE ids cpxName ADD TAG columnlist", - /* 306 */ "cmd ::= ALTER TABLE ids cpxName DROP TAG ids", - /* 307 */ "cmd ::= ALTER TABLE ids cpxName CHANGE TAG ids ids", - /* 308 */ "cmd ::= ALTER TABLE ids cpxName SET TAG ids EQ tagitem", - /* 309 */ "cmd ::= ALTER TABLE ids cpxName MODIFY TAG columnlist", - /* 310 */ "cmd ::= ALTER STABLE ids cpxName ADD COLUMN columnlist", - /* 311 */ "cmd ::= ALTER STABLE ids cpxName DROP COLUMN ids", - /* 312 */ "cmd ::= ALTER STABLE ids cpxName MODIFY COLUMN columnlist", - /* 313 */ "cmd ::= ALTER STABLE ids cpxName ADD TAG columnlist", - /* 314 */ "cmd ::= ALTER STABLE ids cpxName DROP TAG ids", - /* 315 */ "cmd ::= ALTER STABLE ids cpxName CHANGE TAG ids ids", - /* 316 */ "cmd ::= ALTER STABLE ids cpxName SET TAG ids EQ tagitem", - /* 317 */ "cmd ::= ALTER STABLE ids cpxName MODIFY TAG columnlist", - /* 318 */ "cmd ::= KILL CONNECTION INTEGER", - /* 319 */ "cmd ::= KILL STREAM INTEGER COLON INTEGER", - /* 320 */ "cmd ::= KILL QUERY INTEGER COLON INTEGER", - /* 321 */ "cmd ::= DELETE FROM ifexists ids cpxName where_opt", + /* 287 */ "expr ::= expr BITOR expr", + /* 288 */ "expr ::= expr BITXOR expr", + /* 289 */ "expr ::= BITNOT expr", + /* 290 */ "expr ::= expr LSHIFT expr", + /* 291 */ "expr ::= expr RSHIFT expr", + /* 292 */ "expr ::= expr LIKE expr", + /* 293 */ "expr ::= expr MATCH expr", + /* 294 */ "expr ::= expr NMATCH expr", + /* 295 */ "expr ::= ID CONTAINS STRING", + /* 296 */ "expr ::= ID DOT ID CONTAINS STRING", + /* 297 */ "arrow ::= ID ARROW STRING", + /* 298 */ "arrow ::= ID DOT ID ARROW STRING", + /* 299 */ "expr ::= arrow", + /* 300 */ "expr ::= expr IN LP exprlist RP", + /* 301 */ "exprlist ::= exprlist COMMA expritem", + /* 302 */ "exprlist ::= expritem", + /* 303 */ "expritem ::= expr", + /* 304 */ "expritem ::=", + /* 305 */ "cmd ::= RESET QUERY CACHE", + /* 306 */ "cmd ::= SYNCDB ids REPLICA", + /* 307 */ "cmd ::= ALTER TABLE ids cpxName ADD COLUMN columnlist", + /* 308 */ "cmd ::= ALTER TABLE ids cpxName DROP COLUMN ids", + /* 309 */ "cmd ::= ALTER TABLE ids cpxName MODIFY COLUMN columnlist", + /* 310 */ "cmd ::= ALTER TABLE ids cpxName ADD TAG columnlist", + /* 311 */ "cmd ::= ALTER TABLE ids cpxName DROP TAG ids", + /* 312 */ "cmd ::= ALTER TABLE ids cpxName CHANGE TAG ids ids", + /* 313 */ "cmd ::= ALTER TABLE ids cpxName SET TAG ids EQ tagitem", + /* 314 */ "cmd ::= ALTER TABLE ids cpxName MODIFY TAG columnlist", + /* 315 */ "cmd ::= ALTER STABLE ids cpxName ADD COLUMN columnlist", + /* 316 */ "cmd ::= ALTER STABLE ids cpxName DROP COLUMN ids", + /* 317 */ "cmd ::= ALTER STABLE ids cpxName MODIFY COLUMN columnlist", + /* 318 */ "cmd ::= ALTER STABLE ids cpxName ADD TAG columnlist", + /* 319 */ "cmd ::= ALTER STABLE ids cpxName DROP TAG ids", + /* 320 */ "cmd ::= ALTER STABLE ids cpxName CHANGE TAG ids ids", + /* 321 */ "cmd ::= ALTER STABLE ids cpxName SET TAG ids EQ tagitem", + /* 322 */ "cmd ::= ALTER STABLE ids cpxName MODIFY TAG columnlist", + /* 323 */ "cmd ::= KILL CONNECTION INTEGER", + /* 324 */ "cmd ::= KILL STREAM INTEGER COLON INTEGER", + /* 325 */ "cmd ::= KILL QUERY INTEGER COLON INTEGER", + /* 326 */ "cmd ::= DELETE FROM ifexists ids cpxName where_opt", }; #endif /* NDEBUG */ @@ -1576,57 +1596,57 @@ static void yy_destructor( ** inside the C code. */ /********* Begin destructor definitions ***************************************/ - case 215: /* exprlist */ - case 262: /* selcollist */ - case 277: /* sclp */ + case 216: /* exprlist */ + case 263: /* selcollist */ + case 278: /* sclp */ { -tSqlExprListDestroy((yypminor->yy333)); +tSqlExprListDestroy((yypminor->yy367)); } break; - case 230: /* intitemlist */ - case 232: /* keep */ - case 253: /* columnlist */ - case 254: /* tagitemlist */ - case 255: /* tagNamelist */ - case 270: /* fill_opt */ - case 271: /* groupby_opt */ - case 273: /* orderby_opt */ - case 286: /* sortlist */ - case 290: /* grouplist */ -{ -taosArrayDestroy(&(yypminor->yy333)); + case 231: /* intitemlist */ + case 233: /* keep */ + case 254: /* columnlist */ + case 255: /* tagitemlist */ + case 256: /* tagNamelist */ + case 271: /* fill_opt */ + case 272: /* groupby_opt */ + case 274: /* orderby_opt */ + case 287: /* sortlist */ + case 291: /* grouplist */ +{ +taosArrayDestroy(&(yypminor->yy367)); } break; - case 251: /* create_table_list */ + case 252: /* create_table_list */ { -destroyCreateTableSql((yypminor->yy78)); +destroyCreateTableSql((yypminor->yy74)); } break; - case 258: /* select */ + case 259: /* select */ { -destroySqlNode((yypminor->yy144)); +destroySqlNode((yypminor->yy426)); } break; - case 263: /* from */ - case 281: /* tablelist */ - case 282: /* sub */ + case 264: /* from */ + case 282: /* tablelist */ + case 283: /* sub */ { -destroyRelationInfo((yypminor->yy516)); +destroyRelationInfo((yypminor->yy480)); } break; - case 264: /* where_opt */ - case 272: /* having_opt */ - case 279: /* expr */ - case 284: /* timestamp */ - case 289: /* arrow */ - case 291: /* expritem */ + case 265: /* where_opt */ + case 273: /* having_opt */ + case 280: /* expr */ + case 285: /* timestamp */ + case 290: /* arrow */ + case 292: /* expritem */ { -tSqlExprDestroy((yypminor->yy194)); +tSqlExprDestroy((yypminor->yy378)); } break; - case 276: /* union */ + case 277: /* union */ { -destroyAllSqlNode((yypminor->yy333)); +destroyAllSqlNode((yypminor->yy367)); } break; /********* End destructor definitions *****************************************/ @@ -1920,328 +1940,333 @@ 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[] = { - { 206, -1 }, /* (0) program ::= cmd */ - { 207, -2 }, /* (1) cmd ::= SHOW DATABASES */ - { 207, -2 }, /* (2) cmd ::= SHOW TOPICS */ - { 207, -2 }, /* (3) cmd ::= SHOW FUNCTIONS */ - { 207, -2 }, /* (4) cmd ::= SHOW MNODES */ - { 207, -2 }, /* (5) cmd ::= SHOW DNODES */ - { 207, -2 }, /* (6) cmd ::= SHOW ACCOUNTS */ - { 207, -2 }, /* (7) cmd ::= SHOW USERS */ - { 207, -2 }, /* (8) cmd ::= SHOW MODULES */ - { 207, -2 }, /* (9) cmd ::= SHOW QUERIES */ - { 207, -2 }, /* (10) cmd ::= SHOW CONNECTIONS */ - { 207, -2 }, /* (11) cmd ::= SHOW STREAMS */ - { 207, -2 }, /* (12) cmd ::= SHOW VARIABLES */ - { 207, -2 }, /* (13) cmd ::= SHOW SCORES */ - { 207, -2 }, /* (14) cmd ::= SHOW GRANTS */ - { 207, -2 }, /* (15) cmd ::= SHOW VNODES */ - { 207, -3 }, /* (16) cmd ::= SHOW VNODES ids */ - { 209, 0 }, /* (17) dbPrefix ::= */ - { 209, -2 }, /* (18) dbPrefix ::= ids DOT */ - { 210, 0 }, /* (19) cpxName ::= */ - { 210, -2 }, /* (20) cpxName ::= DOT ids */ - { 207, -5 }, /* (21) cmd ::= SHOW CREATE TABLE ids cpxName */ - { 207, -5 }, /* (22) cmd ::= SHOW CREATE STABLE ids cpxName */ - { 207, -4 }, /* (23) cmd ::= SHOW CREATE DATABASE ids */ - { 207, -3 }, /* (24) cmd ::= SHOW dbPrefix TABLES */ - { 207, -5 }, /* (25) cmd ::= SHOW dbPrefix TABLES LIKE STRING */ - { 207, -3 }, /* (26) cmd ::= SHOW dbPrefix STABLES */ - { 207, -5 }, /* (27) cmd ::= SHOW dbPrefix STABLES LIKE STRING */ - { 207, -3 }, /* (28) cmd ::= SHOW dbPrefix VGROUPS */ - { 207, -5 }, /* (29) cmd ::= DROP TABLE ifexists ids cpxName */ - { 207, -5 }, /* (30) cmd ::= DROP STABLE ifexists ids cpxName */ - { 207, -4 }, /* (31) cmd ::= DROP DATABASE ifexists ids */ - { 207, -4 }, /* (32) cmd ::= DROP TOPIC ifexists ids */ - { 207, -3 }, /* (33) cmd ::= DROP FUNCTION ids */ - { 207, -3 }, /* (34) cmd ::= DROP DNODE ids */ - { 207, -3 }, /* (35) cmd ::= DROP USER ids */ - { 207, -3 }, /* (36) cmd ::= DROP ACCOUNT ids */ - { 207, -2 }, /* (37) cmd ::= USE ids */ - { 207, -3 }, /* (38) cmd ::= DESCRIBE ids cpxName */ - { 207, -3 }, /* (39) cmd ::= DESC ids cpxName */ - { 207, -5 }, /* (40) cmd ::= ALTER USER ids PASS ids */ - { 207, -5 }, /* (41) cmd ::= ALTER USER ids PRIVILEGE ids */ - { 207, -4 }, /* (42) cmd ::= ALTER DNODE ids ids */ - { 207, -5 }, /* (43) cmd ::= ALTER DNODE ids ids ids */ - { 207, -3 }, /* (44) cmd ::= ALTER LOCAL ids */ - { 207, -4 }, /* (45) cmd ::= ALTER LOCAL ids ids */ - { 207, -4 }, /* (46) cmd ::= ALTER DATABASE ids alter_db_optr */ - { 207, -4 }, /* (47) cmd ::= ALTER TOPIC ids alter_topic_optr */ - { 207, -4 }, /* (48) cmd ::= ALTER ACCOUNT ids acct_optr */ - { 207, -6 }, /* (49) cmd ::= ALTER ACCOUNT ids PASS ids acct_optr */ - { 207, -6 }, /* (50) cmd ::= COMPACT VNODES IN LP exprlist RP */ - { 208, -1 }, /* (51) ids ::= ID */ - { 208, -1 }, /* (52) ids ::= STRING */ - { 211, -2 }, /* (53) ifexists ::= IF EXISTS */ - { 211, 0 }, /* (54) ifexists ::= */ - { 216, -3 }, /* (55) ifnotexists ::= IF NOT EXISTS */ - { 216, 0 }, /* (56) ifnotexists ::= */ - { 207, -3 }, /* (57) cmd ::= CREATE DNODE ids */ - { 207, -6 }, /* (58) cmd ::= CREATE ACCOUNT ids PASS ids acct_optr */ - { 207, -5 }, /* (59) cmd ::= CREATE DATABASE ifnotexists ids db_optr */ - { 207, -5 }, /* (60) cmd ::= CREATE TOPIC ifnotexists ids topic_optr */ - { 207, -8 }, /* (61) cmd ::= CREATE FUNCTION ids AS ids OUTPUTTYPE typename bufsize */ - { 207, -9 }, /* (62) cmd ::= CREATE AGGREGATE FUNCTION ids AS ids OUTPUTTYPE typename bufsize */ - { 207, -5 }, /* (63) cmd ::= CREATE USER ids PASS ids */ - { 220, 0 }, /* (64) bufsize ::= */ - { 220, -2 }, /* (65) bufsize ::= BUFSIZE INTEGER */ - { 221, 0 }, /* (66) pps ::= */ - { 221, -2 }, /* (67) pps ::= PPS INTEGER */ - { 222, 0 }, /* (68) tseries ::= */ - { 222, -2 }, /* (69) tseries ::= TSERIES INTEGER */ - { 223, 0 }, /* (70) dbs ::= */ - { 223, -2 }, /* (71) dbs ::= DBS INTEGER */ - { 224, 0 }, /* (72) streams ::= */ - { 224, -2 }, /* (73) streams ::= STREAMS INTEGER */ - { 225, 0 }, /* (74) storage ::= */ - { 225, -2 }, /* (75) storage ::= STORAGE INTEGER */ - { 226, 0 }, /* (76) qtime ::= */ - { 226, -2 }, /* (77) qtime ::= QTIME INTEGER */ - { 227, 0 }, /* (78) users ::= */ - { 227, -2 }, /* (79) users ::= USERS INTEGER */ - { 228, 0 }, /* (80) conns ::= */ - { 228, -2 }, /* (81) conns ::= CONNS INTEGER */ - { 229, 0 }, /* (82) state ::= */ - { 229, -2 }, /* (83) state ::= STATE ids */ - { 214, -9 }, /* (84) acct_optr ::= pps tseries storage streams qtime dbs users conns state */ - { 230, -3 }, /* (85) intitemlist ::= intitemlist COMMA intitem */ - { 230, -1 }, /* (86) intitemlist ::= intitem */ - { 231, -1 }, /* (87) intitem ::= INTEGER */ - { 232, -2 }, /* (88) keep ::= KEEP intitemlist */ - { 233, -2 }, /* (89) cache ::= CACHE INTEGER */ - { 234, -2 }, /* (90) replica ::= REPLICA INTEGER */ - { 235, -2 }, /* (91) quorum ::= QUORUM INTEGER */ - { 236, -2 }, /* (92) days ::= DAYS INTEGER */ - { 237, -2 }, /* (93) minrows ::= MINROWS INTEGER */ - { 238, -2 }, /* (94) maxrows ::= MAXROWS INTEGER */ - { 239, -2 }, /* (95) blocks ::= BLOCKS INTEGER */ - { 240, -2 }, /* (96) ctime ::= CTIME INTEGER */ - { 241, -2 }, /* (97) wal ::= WAL INTEGER */ - { 242, -2 }, /* (98) fsync ::= FSYNC INTEGER */ - { 243, -2 }, /* (99) comp ::= COMP INTEGER */ - { 244, -2 }, /* (100) prec ::= PRECISION STRING */ - { 245, -2 }, /* (101) update ::= UPDATE INTEGER */ - { 246, -2 }, /* (102) cachelast ::= CACHELAST INTEGER */ - { 247, -2 }, /* (103) partitions ::= PARTITIONS INTEGER */ - { 217, 0 }, /* (104) db_optr ::= */ - { 217, -2 }, /* (105) db_optr ::= db_optr cache */ - { 217, -2 }, /* (106) db_optr ::= db_optr replica */ - { 217, -2 }, /* (107) db_optr ::= db_optr quorum */ - { 217, -2 }, /* (108) db_optr ::= db_optr days */ - { 217, -2 }, /* (109) db_optr ::= db_optr minrows */ - { 217, -2 }, /* (110) db_optr ::= db_optr maxrows */ - { 217, -2 }, /* (111) db_optr ::= db_optr blocks */ - { 217, -2 }, /* (112) db_optr ::= db_optr ctime */ - { 217, -2 }, /* (113) db_optr ::= db_optr wal */ - { 217, -2 }, /* (114) db_optr ::= db_optr fsync */ - { 217, -2 }, /* (115) db_optr ::= db_optr comp */ - { 217, -2 }, /* (116) db_optr ::= db_optr prec */ - { 217, -2 }, /* (117) db_optr ::= db_optr keep */ - { 217, -2 }, /* (118) db_optr ::= db_optr update */ - { 217, -2 }, /* (119) db_optr ::= db_optr cachelast */ - { 218, -1 }, /* (120) topic_optr ::= db_optr */ - { 218, -2 }, /* (121) topic_optr ::= topic_optr partitions */ - { 212, 0 }, /* (122) alter_db_optr ::= */ - { 212, -2 }, /* (123) alter_db_optr ::= alter_db_optr replica */ - { 212, -2 }, /* (124) alter_db_optr ::= alter_db_optr quorum */ - { 212, -2 }, /* (125) alter_db_optr ::= alter_db_optr keep */ - { 212, -2 }, /* (126) alter_db_optr ::= alter_db_optr blocks */ - { 212, -2 }, /* (127) alter_db_optr ::= alter_db_optr comp */ - { 212, -2 }, /* (128) alter_db_optr ::= alter_db_optr update */ - { 212, -2 }, /* (129) alter_db_optr ::= alter_db_optr cachelast */ - { 213, -1 }, /* (130) alter_topic_optr ::= alter_db_optr */ - { 213, -2 }, /* (131) alter_topic_optr ::= alter_topic_optr partitions */ - { 219, -1 }, /* (132) typename ::= ids */ - { 219, -4 }, /* (133) typename ::= ids LP signed RP */ - { 219, -2 }, /* (134) typename ::= ids UNSIGNED */ - { 248, -1 }, /* (135) signed ::= INTEGER */ - { 248, -2 }, /* (136) signed ::= PLUS INTEGER */ - { 248, -2 }, /* (137) signed ::= MINUS INTEGER */ - { 207, -3 }, /* (138) cmd ::= CREATE TABLE create_table_args */ - { 207, -3 }, /* (139) cmd ::= CREATE TABLE create_stable_args */ - { 207, -3 }, /* (140) cmd ::= CREATE STABLE create_stable_args */ - { 207, -3 }, /* (141) cmd ::= CREATE TABLE create_table_list */ - { 251, -1 }, /* (142) create_table_list ::= create_from_stable */ - { 251, -2 }, /* (143) create_table_list ::= create_table_list create_from_stable */ - { 249, -6 }, /* (144) create_table_args ::= ifnotexists ids cpxName LP columnlist RP */ - { 250, -10 }, /* (145) create_stable_args ::= ifnotexists ids cpxName LP columnlist RP TAGS LP columnlist RP */ - { 252, -10 }, /* (146) create_from_stable ::= ifnotexists ids cpxName USING ids cpxName TAGS LP tagitemlist RP */ - { 252, -13 }, /* (147) create_from_stable ::= ifnotexists ids cpxName USING ids cpxName LP tagNamelist RP TAGS LP tagitemlist RP */ - { 255, -3 }, /* (148) tagNamelist ::= tagNamelist COMMA ids */ - { 255, -1 }, /* (149) tagNamelist ::= ids */ - { 249, -7 }, /* (150) create_table_args ::= ifnotexists ids cpxName to_opt split_opt AS select */ - { 256, 0 }, /* (151) to_opt ::= */ - { 256, -3 }, /* (152) to_opt ::= TO ids cpxName */ - { 257, 0 }, /* (153) split_opt ::= */ - { 257, -2 }, /* (154) split_opt ::= SPLIT ids */ - { 253, -3 }, /* (155) columnlist ::= columnlist COMMA column */ - { 253, -1 }, /* (156) columnlist ::= column */ - { 260, -2 }, /* (157) column ::= ids typename */ - { 254, -3 }, /* (158) tagitemlist ::= tagitemlist COMMA tagitem */ - { 254, -1 }, /* (159) tagitemlist ::= tagitem */ - { 261, -1 }, /* (160) tagitem ::= INTEGER */ - { 261, -1 }, /* (161) tagitem ::= FLOAT */ - { 261, -1 }, /* (162) tagitem ::= STRING */ - { 261, -1 }, /* (163) tagitem ::= BOOL */ - { 261, -1 }, /* (164) tagitem ::= NULL */ - { 261, -1 }, /* (165) tagitem ::= NOW */ - { 261, -3 }, /* (166) tagitem ::= NOW PLUS VARIABLE */ - { 261, -3 }, /* (167) tagitem ::= NOW MINUS VARIABLE */ - { 261, -2 }, /* (168) tagitem ::= MINUS INTEGER */ - { 261, -2 }, /* (169) tagitem ::= MINUS FLOAT */ - { 261, -2 }, /* (170) tagitem ::= PLUS INTEGER */ - { 261, -2 }, /* (171) tagitem ::= PLUS FLOAT */ - { 258, -15 }, /* (172) select ::= SELECT selcollist from where_opt range_option interval_option sliding_opt session_option windowstate_option fill_opt groupby_opt having_opt orderby_opt slimit_opt limit_opt */ - { 258, -3 }, /* (173) select ::= LP select RP */ - { 276, -1 }, /* (174) union ::= select */ - { 276, -4 }, /* (175) union ::= union UNION ALL select */ - { 207, -1 }, /* (176) cmd ::= union */ - { 258, -2 }, /* (177) select ::= SELECT selcollist */ - { 277, -2 }, /* (178) sclp ::= selcollist COMMA */ - { 277, 0 }, /* (179) sclp ::= */ - { 262, -4 }, /* (180) selcollist ::= sclp distinct expr as */ - { 262, -2 }, /* (181) selcollist ::= sclp STAR */ - { 280, -2 }, /* (182) as ::= AS ids */ - { 280, -1 }, /* (183) as ::= ids */ - { 280, 0 }, /* (184) as ::= */ - { 278, -1 }, /* (185) distinct ::= DISTINCT */ - { 278, 0 }, /* (186) distinct ::= */ - { 263, -2 }, /* (187) from ::= FROM tablelist */ - { 263, -2 }, /* (188) from ::= FROM sub */ - { 282, -3 }, /* (189) sub ::= LP union RP */ - { 282, -4 }, /* (190) sub ::= LP union RP ids */ - { 282, -6 }, /* (191) sub ::= sub COMMA LP union RP ids */ - { 281, -2 }, /* (192) tablelist ::= ids cpxName */ - { 281, -3 }, /* (193) tablelist ::= ids cpxName ids */ - { 281, -4 }, /* (194) tablelist ::= tablelist COMMA ids cpxName */ - { 281, -5 }, /* (195) tablelist ::= tablelist COMMA ids cpxName ids */ - { 283, -1 }, /* (196) tmvar ::= VARIABLE */ - { 284, -1 }, /* (197) timestamp ::= INTEGER */ - { 284, -2 }, /* (198) timestamp ::= MINUS INTEGER */ - { 284, -2 }, /* (199) timestamp ::= PLUS INTEGER */ - { 284, -1 }, /* (200) timestamp ::= STRING */ - { 284, -1 }, /* (201) timestamp ::= NOW */ - { 284, -3 }, /* (202) timestamp ::= NOW PLUS VARIABLE */ - { 284, -3 }, /* (203) timestamp ::= NOW MINUS VARIABLE */ - { 265, 0 }, /* (204) range_option ::= */ - { 265, -6 }, /* (205) range_option ::= RANGE LP timestamp COMMA timestamp RP */ - { 266, -4 }, /* (206) interval_option ::= intervalKey LP tmvar RP */ - { 266, -6 }, /* (207) interval_option ::= intervalKey LP tmvar COMMA tmvar RP */ - { 266, 0 }, /* (208) interval_option ::= */ - { 285, -1 }, /* (209) intervalKey ::= INTERVAL */ - { 285, -1 }, /* (210) intervalKey ::= EVERY */ - { 268, 0 }, /* (211) session_option ::= */ - { 268, -7 }, /* (212) session_option ::= SESSION LP ids cpxName COMMA tmvar RP */ - { 269, 0 }, /* (213) windowstate_option ::= */ - { 269, -4 }, /* (214) windowstate_option ::= STATE_WINDOW LP ids RP */ - { 270, 0 }, /* (215) fill_opt ::= */ - { 270, -6 }, /* (216) fill_opt ::= FILL LP ID COMMA tagitemlist RP */ - { 270, -4 }, /* (217) fill_opt ::= FILL LP ID RP */ - { 267, -4 }, /* (218) sliding_opt ::= SLIDING LP tmvar RP */ - { 267, 0 }, /* (219) sliding_opt ::= */ - { 273, 0 }, /* (220) orderby_opt ::= */ - { 273, -3 }, /* (221) orderby_opt ::= ORDER BY sortlist */ - { 286, -4 }, /* (222) sortlist ::= sortlist COMMA item sortorder */ - { 286, -4 }, /* (223) sortlist ::= sortlist COMMA arrow sortorder */ - { 286, -2 }, /* (224) sortlist ::= item sortorder */ - { 286, -2 }, /* (225) sortlist ::= arrow sortorder */ - { 287, -1 }, /* (226) item ::= ID */ - { 287, -3 }, /* (227) item ::= ID DOT ID */ - { 288, -1 }, /* (228) sortorder ::= ASC */ - { 288, -1 }, /* (229) sortorder ::= DESC */ - { 288, 0 }, /* (230) sortorder ::= */ - { 271, 0 }, /* (231) groupby_opt ::= */ - { 271, -3 }, /* (232) groupby_opt ::= GROUP BY grouplist */ - { 290, -3 }, /* (233) grouplist ::= grouplist COMMA item */ - { 290, -3 }, /* (234) grouplist ::= grouplist COMMA arrow */ - { 290, -1 }, /* (235) grouplist ::= item */ - { 290, -1 }, /* (236) grouplist ::= arrow */ - { 272, 0 }, /* (237) having_opt ::= */ - { 272, -2 }, /* (238) having_opt ::= HAVING expr */ - { 275, 0 }, /* (239) limit_opt ::= */ - { 275, -2 }, /* (240) limit_opt ::= LIMIT signed */ - { 275, -4 }, /* (241) limit_opt ::= LIMIT signed OFFSET signed */ - { 275, -4 }, /* (242) limit_opt ::= LIMIT signed COMMA signed */ - { 274, 0 }, /* (243) slimit_opt ::= */ - { 274, -2 }, /* (244) slimit_opt ::= SLIMIT signed */ - { 274, -4 }, /* (245) slimit_opt ::= SLIMIT signed SOFFSET signed */ - { 274, -4 }, /* (246) slimit_opt ::= SLIMIT signed COMMA signed */ - { 264, 0 }, /* (247) where_opt ::= */ - { 264, -2 }, /* (248) where_opt ::= WHERE expr */ - { 279, -3 }, /* (249) expr ::= LP expr RP */ - { 279, -1 }, /* (250) expr ::= ID */ - { 279, -3 }, /* (251) expr ::= ID DOT ID */ - { 279, -3 }, /* (252) expr ::= ID DOT STAR */ - { 279, -1 }, /* (253) expr ::= INTEGER */ - { 279, -2 }, /* (254) expr ::= MINUS INTEGER */ - { 279, -2 }, /* (255) expr ::= PLUS INTEGER */ - { 279, -1 }, /* (256) expr ::= FLOAT */ - { 279, -2 }, /* (257) expr ::= MINUS FLOAT */ - { 279, -2 }, /* (258) expr ::= PLUS FLOAT */ - { 279, -1 }, /* (259) expr ::= STRING */ - { 279, -1 }, /* (260) expr ::= NOW */ - { 279, -1 }, /* (261) expr ::= TODAY */ - { 279, -1 }, /* (262) expr ::= VARIABLE */ - { 279, -2 }, /* (263) expr ::= PLUS VARIABLE */ - { 279, -2 }, /* (264) expr ::= MINUS VARIABLE */ - { 279, -1 }, /* (265) expr ::= BOOL */ - { 279, -1 }, /* (266) expr ::= NULL */ - { 279, -4 }, /* (267) expr ::= ID LP exprlist RP */ - { 279, -4 }, /* (268) expr ::= ID LP STAR RP */ - { 279, -6 }, /* (269) expr ::= ID LP expr AS typename RP */ - { 279, -3 }, /* (270) expr ::= expr IS NULL */ - { 279, -4 }, /* (271) expr ::= expr IS NOT NULL */ - { 279, -3 }, /* (272) expr ::= expr LT expr */ - { 279, -3 }, /* (273) expr ::= expr GT expr */ - { 279, -3 }, /* (274) expr ::= expr LE expr */ - { 279, -3 }, /* (275) expr ::= expr GE expr */ - { 279, -3 }, /* (276) expr ::= expr NE expr */ - { 279, -3 }, /* (277) expr ::= expr EQ expr */ - { 279, -5 }, /* (278) expr ::= expr BETWEEN expr AND expr */ - { 279, -3 }, /* (279) expr ::= expr AND expr */ - { 279, -3 }, /* (280) expr ::= expr OR expr */ - { 279, -3 }, /* (281) expr ::= expr PLUS expr */ - { 279, -3 }, /* (282) expr ::= expr MINUS expr */ - { 279, -3 }, /* (283) expr ::= expr STAR expr */ - { 279, -3 }, /* (284) expr ::= expr SLASH expr */ - { 279, -3 }, /* (285) expr ::= expr REM expr */ - { 279, -3 }, /* (286) expr ::= expr BITAND expr */ - { 279, -3 }, /* (287) expr ::= expr LIKE expr */ - { 279, -3 }, /* (288) expr ::= expr MATCH expr */ - { 279, -3 }, /* (289) expr ::= expr NMATCH expr */ - { 279, -3 }, /* (290) expr ::= ID CONTAINS STRING */ - { 279, -5 }, /* (291) expr ::= ID DOT ID CONTAINS STRING */ - { 289, -3 }, /* (292) arrow ::= ID ARROW STRING */ - { 289, -5 }, /* (293) arrow ::= ID DOT ID ARROW STRING */ - { 279, -1 }, /* (294) expr ::= arrow */ - { 279, -5 }, /* (295) expr ::= expr IN LP exprlist RP */ - { 215, -3 }, /* (296) exprlist ::= exprlist COMMA expritem */ - { 215, -1 }, /* (297) exprlist ::= expritem */ - { 291, -1 }, /* (298) expritem ::= expr */ - { 291, 0 }, /* (299) expritem ::= */ - { 207, -3 }, /* (300) cmd ::= RESET QUERY CACHE */ - { 207, -3 }, /* (301) cmd ::= SYNCDB ids REPLICA */ - { 207, -7 }, /* (302) cmd ::= ALTER TABLE ids cpxName ADD COLUMN columnlist */ - { 207, -7 }, /* (303) cmd ::= ALTER TABLE ids cpxName DROP COLUMN ids */ - { 207, -7 }, /* (304) cmd ::= ALTER TABLE ids cpxName MODIFY COLUMN columnlist */ - { 207, -7 }, /* (305) cmd ::= ALTER TABLE ids cpxName ADD TAG columnlist */ - { 207, -7 }, /* (306) cmd ::= ALTER TABLE ids cpxName DROP TAG ids */ - { 207, -8 }, /* (307) cmd ::= ALTER TABLE ids cpxName CHANGE TAG ids ids */ - { 207, -9 }, /* (308) cmd ::= ALTER TABLE ids cpxName SET TAG ids EQ tagitem */ - { 207, -7 }, /* (309) cmd ::= ALTER TABLE ids cpxName MODIFY TAG columnlist */ - { 207, -7 }, /* (310) cmd ::= ALTER STABLE ids cpxName ADD COLUMN columnlist */ - { 207, -7 }, /* (311) cmd ::= ALTER STABLE ids cpxName DROP COLUMN ids */ - { 207, -7 }, /* (312) cmd ::= ALTER STABLE ids cpxName MODIFY COLUMN columnlist */ - { 207, -7 }, /* (313) cmd ::= ALTER STABLE ids cpxName ADD TAG columnlist */ - { 207, -7 }, /* (314) cmd ::= ALTER STABLE ids cpxName DROP TAG ids */ - { 207, -8 }, /* (315) cmd ::= ALTER STABLE ids cpxName CHANGE TAG ids ids */ - { 207, -9 }, /* (316) cmd ::= ALTER STABLE ids cpxName SET TAG ids EQ tagitem */ - { 207, -7 }, /* (317) cmd ::= ALTER STABLE ids cpxName MODIFY TAG columnlist */ - { 207, -3 }, /* (318) cmd ::= KILL CONNECTION INTEGER */ - { 207, -5 }, /* (319) cmd ::= KILL STREAM INTEGER COLON INTEGER */ - { 207, -5 }, /* (320) cmd ::= KILL QUERY INTEGER COLON INTEGER */ - { 207, -6 }, /* (321) cmd ::= DELETE FROM ifexists ids cpxName where_opt */ + { 207, -1 }, /* (0) program ::= cmd */ + { 208, -2 }, /* (1) cmd ::= SHOW DATABASES */ + { 208, -2 }, /* (2) cmd ::= SHOW TOPICS */ + { 208, -2 }, /* (3) cmd ::= SHOW FUNCTIONS */ + { 208, -2 }, /* (4) cmd ::= SHOW MNODES */ + { 208, -2 }, /* (5) cmd ::= SHOW DNODES */ + { 208, -2 }, /* (6) cmd ::= SHOW ACCOUNTS */ + { 208, -2 }, /* (7) cmd ::= SHOW USERS */ + { 208, -2 }, /* (8) cmd ::= SHOW MODULES */ + { 208, -2 }, /* (9) cmd ::= SHOW QUERIES */ + { 208, -2 }, /* (10) cmd ::= SHOW CONNECTIONS */ + { 208, -2 }, /* (11) cmd ::= SHOW STREAMS */ + { 208, -2 }, /* (12) cmd ::= SHOW VARIABLES */ + { 208, -2 }, /* (13) cmd ::= SHOW SCORES */ + { 208, -2 }, /* (14) cmd ::= SHOW GRANTS */ + { 208, -2 }, /* (15) cmd ::= SHOW VNODES */ + { 208, -3 }, /* (16) cmd ::= SHOW VNODES ids */ + { 210, 0 }, /* (17) dbPrefix ::= */ + { 210, -2 }, /* (18) dbPrefix ::= ids DOT */ + { 211, 0 }, /* (19) cpxName ::= */ + { 211, -2 }, /* (20) cpxName ::= DOT ids */ + { 208, -5 }, /* (21) cmd ::= SHOW CREATE TABLE ids cpxName */ + { 208, -5 }, /* (22) cmd ::= SHOW CREATE STABLE ids cpxName */ + { 208, -4 }, /* (23) cmd ::= SHOW CREATE DATABASE ids */ + { 208, -3 }, /* (24) cmd ::= SHOW dbPrefix TABLES */ + { 208, -5 }, /* (25) cmd ::= SHOW dbPrefix TABLES LIKE STRING */ + { 208, -3 }, /* (26) cmd ::= SHOW dbPrefix STABLES */ + { 208, -5 }, /* (27) cmd ::= SHOW dbPrefix STABLES LIKE STRING */ + { 208, -3 }, /* (28) cmd ::= SHOW dbPrefix VGROUPS */ + { 208, -5 }, /* (29) cmd ::= DROP TABLE ifexists ids cpxName */ + { 208, -5 }, /* (30) cmd ::= DROP STABLE ifexists ids cpxName */ + { 208, -4 }, /* (31) cmd ::= DROP DATABASE ifexists ids */ + { 208, -4 }, /* (32) cmd ::= DROP TOPIC ifexists ids */ + { 208, -3 }, /* (33) cmd ::= DROP FUNCTION ids */ + { 208, -3 }, /* (34) cmd ::= DROP DNODE ids */ + { 208, -3 }, /* (35) cmd ::= DROP USER ids */ + { 208, -3 }, /* (36) cmd ::= DROP ACCOUNT ids */ + { 208, -2 }, /* (37) cmd ::= USE ids */ + { 208, -3 }, /* (38) cmd ::= DESCRIBE ids cpxName */ + { 208, -3 }, /* (39) cmd ::= DESC ids cpxName */ + { 208, -5 }, /* (40) cmd ::= ALTER USER ids PASS ids */ + { 208, -5 }, /* (41) cmd ::= ALTER USER ids PRIVILEGE ids */ + { 208, -4 }, /* (42) cmd ::= ALTER DNODE ids ids */ + { 208, -5 }, /* (43) cmd ::= ALTER DNODE ids ids ids */ + { 208, -3 }, /* (44) cmd ::= ALTER LOCAL ids */ + { 208, -4 }, /* (45) cmd ::= ALTER LOCAL ids ids */ + { 208, -4 }, /* (46) cmd ::= ALTER DATABASE ids alter_db_optr */ + { 208, -4 }, /* (47) cmd ::= ALTER TOPIC ids alter_topic_optr */ + { 208, -4 }, /* (48) cmd ::= ALTER ACCOUNT ids acct_optr */ + { 208, -6 }, /* (49) cmd ::= ALTER ACCOUNT ids PASS ids acct_optr */ + { 208, -6 }, /* (50) cmd ::= COMPACT VNODES IN LP exprlist RP */ + { 209, -1 }, /* (51) ids ::= ID */ + { 209, -1 }, /* (52) ids ::= STRING */ + { 212, -2 }, /* (53) ifexists ::= IF EXISTS */ + { 212, 0 }, /* (54) ifexists ::= */ + { 217, -3 }, /* (55) ifnotexists ::= IF NOT EXISTS */ + { 217, 0 }, /* (56) ifnotexists ::= */ + { 208, -3 }, /* (57) cmd ::= CREATE DNODE ids */ + { 208, -6 }, /* (58) cmd ::= CREATE ACCOUNT ids PASS ids acct_optr */ + { 208, -5 }, /* (59) cmd ::= CREATE DATABASE ifnotexists ids db_optr */ + { 208, -5 }, /* (60) cmd ::= CREATE TOPIC ifnotexists ids topic_optr */ + { 208, -8 }, /* (61) cmd ::= CREATE FUNCTION ids AS ids OUTPUTTYPE typename bufsize */ + { 208, -9 }, /* (62) cmd ::= CREATE AGGREGATE FUNCTION ids AS ids OUTPUTTYPE typename bufsize */ + { 208, -5 }, /* (63) cmd ::= CREATE USER ids PASS ids */ + { 221, 0 }, /* (64) bufsize ::= */ + { 221, -2 }, /* (65) bufsize ::= BUFSIZE INTEGER */ + { 222, 0 }, /* (66) pps ::= */ + { 222, -2 }, /* (67) pps ::= PPS INTEGER */ + { 223, 0 }, /* (68) tseries ::= */ + { 223, -2 }, /* (69) tseries ::= TSERIES INTEGER */ + { 224, 0 }, /* (70) dbs ::= */ + { 224, -2 }, /* (71) dbs ::= DBS INTEGER */ + { 225, 0 }, /* (72) streams ::= */ + { 225, -2 }, /* (73) streams ::= STREAMS INTEGER */ + { 226, 0 }, /* (74) storage ::= */ + { 226, -2 }, /* (75) storage ::= STORAGE INTEGER */ + { 227, 0 }, /* (76) qtime ::= */ + { 227, -2 }, /* (77) qtime ::= QTIME INTEGER */ + { 228, 0 }, /* (78) users ::= */ + { 228, -2 }, /* (79) users ::= USERS INTEGER */ + { 229, 0 }, /* (80) conns ::= */ + { 229, -2 }, /* (81) conns ::= CONNS INTEGER */ + { 230, 0 }, /* (82) state ::= */ + { 230, -2 }, /* (83) state ::= STATE ids */ + { 215, -9 }, /* (84) acct_optr ::= pps tseries storage streams qtime dbs users conns state */ + { 231, -3 }, /* (85) intitemlist ::= intitemlist COMMA intitem */ + { 231, -1 }, /* (86) intitemlist ::= intitem */ + { 232, -1 }, /* (87) intitem ::= INTEGER */ + { 233, -2 }, /* (88) keep ::= KEEP intitemlist */ + { 234, -2 }, /* (89) cache ::= CACHE INTEGER */ + { 235, -2 }, /* (90) replica ::= REPLICA INTEGER */ + { 236, -2 }, /* (91) quorum ::= QUORUM INTEGER */ + { 237, -2 }, /* (92) days ::= DAYS INTEGER */ + { 238, -2 }, /* (93) minrows ::= MINROWS INTEGER */ + { 239, -2 }, /* (94) maxrows ::= MAXROWS INTEGER */ + { 240, -2 }, /* (95) blocks ::= BLOCKS INTEGER */ + { 241, -2 }, /* (96) ctime ::= CTIME INTEGER */ + { 242, -2 }, /* (97) wal ::= WAL INTEGER */ + { 243, -2 }, /* (98) fsync ::= FSYNC INTEGER */ + { 244, -2 }, /* (99) comp ::= COMP INTEGER */ + { 245, -2 }, /* (100) prec ::= PRECISION STRING */ + { 246, -2 }, /* (101) update ::= UPDATE INTEGER */ + { 247, -2 }, /* (102) cachelast ::= CACHELAST INTEGER */ + { 248, -2 }, /* (103) partitions ::= PARTITIONS INTEGER */ + { 218, 0 }, /* (104) db_optr ::= */ + { 218, -2 }, /* (105) db_optr ::= db_optr cache */ + { 218, -2 }, /* (106) db_optr ::= db_optr replica */ + { 218, -2 }, /* (107) db_optr ::= db_optr quorum */ + { 218, -2 }, /* (108) db_optr ::= db_optr days */ + { 218, -2 }, /* (109) db_optr ::= db_optr minrows */ + { 218, -2 }, /* (110) db_optr ::= db_optr maxrows */ + { 218, -2 }, /* (111) db_optr ::= db_optr blocks */ + { 218, -2 }, /* (112) db_optr ::= db_optr ctime */ + { 218, -2 }, /* (113) db_optr ::= db_optr wal */ + { 218, -2 }, /* (114) db_optr ::= db_optr fsync */ + { 218, -2 }, /* (115) db_optr ::= db_optr comp */ + { 218, -2 }, /* (116) db_optr ::= db_optr prec */ + { 218, -2 }, /* (117) db_optr ::= db_optr keep */ + { 218, -2 }, /* (118) db_optr ::= db_optr update */ + { 218, -2 }, /* (119) db_optr ::= db_optr cachelast */ + { 219, -1 }, /* (120) topic_optr ::= db_optr */ + { 219, -2 }, /* (121) topic_optr ::= topic_optr partitions */ + { 213, 0 }, /* (122) alter_db_optr ::= */ + { 213, -2 }, /* (123) alter_db_optr ::= alter_db_optr replica */ + { 213, -2 }, /* (124) alter_db_optr ::= alter_db_optr quorum */ + { 213, -2 }, /* (125) alter_db_optr ::= alter_db_optr keep */ + { 213, -2 }, /* (126) alter_db_optr ::= alter_db_optr blocks */ + { 213, -2 }, /* (127) alter_db_optr ::= alter_db_optr comp */ + { 213, -2 }, /* (128) alter_db_optr ::= alter_db_optr update */ + { 213, -2 }, /* (129) alter_db_optr ::= alter_db_optr cachelast */ + { 214, -1 }, /* (130) alter_topic_optr ::= alter_db_optr */ + { 214, -2 }, /* (131) alter_topic_optr ::= alter_topic_optr partitions */ + { 220, -1 }, /* (132) typename ::= ids */ + { 220, -4 }, /* (133) typename ::= ids LP signed RP */ + { 220, -2 }, /* (134) typename ::= ids UNSIGNED */ + { 249, -1 }, /* (135) signed ::= INTEGER */ + { 249, -2 }, /* (136) signed ::= PLUS INTEGER */ + { 249, -2 }, /* (137) signed ::= MINUS INTEGER */ + { 208, -3 }, /* (138) cmd ::= CREATE TABLE create_table_args */ + { 208, -3 }, /* (139) cmd ::= CREATE TABLE create_stable_args */ + { 208, -3 }, /* (140) cmd ::= CREATE STABLE create_stable_args */ + { 208, -3 }, /* (141) cmd ::= CREATE TABLE create_table_list */ + { 252, -1 }, /* (142) create_table_list ::= create_from_stable */ + { 252, -2 }, /* (143) create_table_list ::= create_table_list create_from_stable */ + { 250, -6 }, /* (144) create_table_args ::= ifnotexists ids cpxName LP columnlist RP */ + { 251, -10 }, /* (145) create_stable_args ::= ifnotexists ids cpxName LP columnlist RP TAGS LP columnlist RP */ + { 253, -10 }, /* (146) create_from_stable ::= ifnotexists ids cpxName USING ids cpxName TAGS LP tagitemlist RP */ + { 253, -13 }, /* (147) create_from_stable ::= ifnotexists ids cpxName USING ids cpxName LP tagNamelist RP TAGS LP tagitemlist RP */ + { 256, -3 }, /* (148) tagNamelist ::= tagNamelist COMMA ids */ + { 256, -1 }, /* (149) tagNamelist ::= ids */ + { 250, -7 }, /* (150) create_table_args ::= ifnotexists ids cpxName to_opt split_opt AS select */ + { 257, 0 }, /* (151) to_opt ::= */ + { 257, -3 }, /* (152) to_opt ::= TO ids cpxName */ + { 258, 0 }, /* (153) split_opt ::= */ + { 258, -2 }, /* (154) split_opt ::= SPLIT ids */ + { 254, -3 }, /* (155) columnlist ::= columnlist COMMA column */ + { 254, -1 }, /* (156) columnlist ::= column */ + { 261, -2 }, /* (157) column ::= ids typename */ + { 255, -3 }, /* (158) tagitemlist ::= tagitemlist COMMA tagitem */ + { 255, -1 }, /* (159) tagitemlist ::= tagitem */ + { 262, -1 }, /* (160) tagitem ::= INTEGER */ + { 262, -1 }, /* (161) tagitem ::= FLOAT */ + { 262, -1 }, /* (162) tagitem ::= STRING */ + { 262, -1 }, /* (163) tagitem ::= BOOL */ + { 262, -1 }, /* (164) tagitem ::= NULL */ + { 262, -1 }, /* (165) tagitem ::= NOW */ + { 262, -3 }, /* (166) tagitem ::= NOW PLUS VARIABLE */ + { 262, -3 }, /* (167) tagitem ::= NOW MINUS VARIABLE */ + { 262, -2 }, /* (168) tagitem ::= MINUS INTEGER */ + { 262, -2 }, /* (169) tagitem ::= MINUS FLOAT */ + { 262, -2 }, /* (170) tagitem ::= PLUS INTEGER */ + { 262, -2 }, /* (171) tagitem ::= PLUS FLOAT */ + { 259, -15 }, /* (172) select ::= SELECT selcollist from where_opt range_option interval_option sliding_opt session_option windowstate_option fill_opt groupby_opt having_opt orderby_opt slimit_opt limit_opt */ + { 259, -3 }, /* (173) select ::= LP select RP */ + { 277, -1 }, /* (174) union ::= select */ + { 277, -4 }, /* (175) union ::= union UNION ALL select */ + { 208, -1 }, /* (176) cmd ::= union */ + { 259, -2 }, /* (177) select ::= SELECT selcollist */ + { 278, -2 }, /* (178) sclp ::= selcollist COMMA */ + { 278, 0 }, /* (179) sclp ::= */ + { 263, -4 }, /* (180) selcollist ::= sclp distinct expr as */ + { 263, -2 }, /* (181) selcollist ::= sclp STAR */ + { 281, -2 }, /* (182) as ::= AS ids */ + { 281, -1 }, /* (183) as ::= ids */ + { 281, 0 }, /* (184) as ::= */ + { 279, -1 }, /* (185) distinct ::= DISTINCT */ + { 279, 0 }, /* (186) distinct ::= */ + { 264, -2 }, /* (187) from ::= FROM tablelist */ + { 264, -2 }, /* (188) from ::= FROM sub */ + { 283, -3 }, /* (189) sub ::= LP union RP */ + { 283, -4 }, /* (190) sub ::= LP union RP ids */ + { 283, -6 }, /* (191) sub ::= sub COMMA LP union RP ids */ + { 282, -2 }, /* (192) tablelist ::= ids cpxName */ + { 282, -3 }, /* (193) tablelist ::= ids cpxName ids */ + { 282, -4 }, /* (194) tablelist ::= tablelist COMMA ids cpxName */ + { 282, -5 }, /* (195) tablelist ::= tablelist COMMA ids cpxName ids */ + { 284, -1 }, /* (196) tmvar ::= VARIABLE */ + { 285, -1 }, /* (197) timestamp ::= INTEGER */ + { 285, -2 }, /* (198) timestamp ::= MINUS INTEGER */ + { 285, -2 }, /* (199) timestamp ::= PLUS INTEGER */ + { 285, -1 }, /* (200) timestamp ::= STRING */ + { 285, -1 }, /* (201) timestamp ::= NOW */ + { 285, -3 }, /* (202) timestamp ::= NOW PLUS VARIABLE */ + { 285, -3 }, /* (203) timestamp ::= NOW MINUS VARIABLE */ + { 266, 0 }, /* (204) range_option ::= */ + { 266, -6 }, /* (205) range_option ::= RANGE LP timestamp COMMA timestamp RP */ + { 267, -4 }, /* (206) interval_option ::= intervalKey LP tmvar RP */ + { 267, -6 }, /* (207) interval_option ::= intervalKey LP tmvar COMMA tmvar RP */ + { 267, 0 }, /* (208) interval_option ::= */ + { 286, -1 }, /* (209) intervalKey ::= INTERVAL */ + { 286, -1 }, /* (210) intervalKey ::= EVERY */ + { 269, 0 }, /* (211) session_option ::= */ + { 269, -7 }, /* (212) session_option ::= SESSION LP ids cpxName COMMA tmvar RP */ + { 270, 0 }, /* (213) windowstate_option ::= */ + { 270, -4 }, /* (214) windowstate_option ::= STATE_WINDOW LP ids RP */ + { 271, 0 }, /* (215) fill_opt ::= */ + { 271, -6 }, /* (216) fill_opt ::= FILL LP ID COMMA tagitemlist RP */ + { 271, -4 }, /* (217) fill_opt ::= FILL LP ID RP */ + { 268, -4 }, /* (218) sliding_opt ::= SLIDING LP tmvar RP */ + { 268, 0 }, /* (219) sliding_opt ::= */ + { 274, 0 }, /* (220) orderby_opt ::= */ + { 274, -3 }, /* (221) orderby_opt ::= ORDER BY sortlist */ + { 287, -4 }, /* (222) sortlist ::= sortlist COMMA item sortorder */ + { 287, -4 }, /* (223) sortlist ::= sortlist COMMA arrow sortorder */ + { 287, -2 }, /* (224) sortlist ::= item sortorder */ + { 287, -2 }, /* (225) sortlist ::= arrow sortorder */ + { 288, -1 }, /* (226) item ::= ID */ + { 288, -3 }, /* (227) item ::= ID DOT ID */ + { 289, -1 }, /* (228) sortorder ::= ASC */ + { 289, -1 }, /* (229) sortorder ::= DESC */ + { 289, 0 }, /* (230) sortorder ::= */ + { 272, 0 }, /* (231) groupby_opt ::= */ + { 272, -3 }, /* (232) groupby_opt ::= GROUP BY grouplist */ + { 291, -3 }, /* (233) grouplist ::= grouplist COMMA item */ + { 291, -3 }, /* (234) grouplist ::= grouplist COMMA arrow */ + { 291, -1 }, /* (235) grouplist ::= item */ + { 291, -1 }, /* (236) grouplist ::= arrow */ + { 273, 0 }, /* (237) having_opt ::= */ + { 273, -2 }, /* (238) having_opt ::= HAVING expr */ + { 276, 0 }, /* (239) limit_opt ::= */ + { 276, -2 }, /* (240) limit_opt ::= LIMIT signed */ + { 276, -4 }, /* (241) limit_opt ::= LIMIT signed OFFSET signed */ + { 276, -4 }, /* (242) limit_opt ::= LIMIT signed COMMA signed */ + { 275, 0 }, /* (243) slimit_opt ::= */ + { 275, -2 }, /* (244) slimit_opt ::= SLIMIT signed */ + { 275, -4 }, /* (245) slimit_opt ::= SLIMIT signed SOFFSET signed */ + { 275, -4 }, /* (246) slimit_opt ::= SLIMIT signed COMMA signed */ + { 265, 0 }, /* (247) where_opt ::= */ + { 265, -2 }, /* (248) where_opt ::= WHERE expr */ + { 280, -3 }, /* (249) expr ::= LP expr RP */ + { 280, -1 }, /* (250) expr ::= ID */ + { 280, -3 }, /* (251) expr ::= ID DOT ID */ + { 280, -3 }, /* (252) expr ::= ID DOT STAR */ + { 280, -1 }, /* (253) expr ::= INTEGER */ + { 280, -2 }, /* (254) expr ::= MINUS INTEGER */ + { 280, -2 }, /* (255) expr ::= PLUS INTEGER */ + { 280, -1 }, /* (256) expr ::= FLOAT */ + { 280, -2 }, /* (257) expr ::= MINUS FLOAT */ + { 280, -2 }, /* (258) expr ::= PLUS FLOAT */ + { 280, -1 }, /* (259) expr ::= STRING */ + { 280, -1 }, /* (260) expr ::= NOW */ + { 280, -1 }, /* (261) expr ::= TODAY */ + { 280, -1 }, /* (262) expr ::= VARIABLE */ + { 280, -2 }, /* (263) expr ::= PLUS VARIABLE */ + { 280, -2 }, /* (264) expr ::= MINUS VARIABLE */ + { 280, -1 }, /* (265) expr ::= BOOL */ + { 280, -1 }, /* (266) expr ::= NULL */ + { 280, -4 }, /* (267) expr ::= ID LP exprlist RP */ + { 280, -4 }, /* (268) expr ::= ID LP STAR RP */ + { 280, -6 }, /* (269) expr ::= ID LP expr AS typename RP */ + { 280, -3 }, /* (270) expr ::= expr IS NULL */ + { 280, -4 }, /* (271) expr ::= expr IS NOT NULL */ + { 280, -3 }, /* (272) expr ::= expr LT expr */ + { 280, -3 }, /* (273) expr ::= expr GT expr */ + { 280, -3 }, /* (274) expr ::= expr LE expr */ + { 280, -3 }, /* (275) expr ::= expr GE expr */ + { 280, -3 }, /* (276) expr ::= expr NE expr */ + { 280, -3 }, /* (277) expr ::= expr EQ expr */ + { 280, -5 }, /* (278) expr ::= expr BETWEEN expr AND expr */ + { 280, -3 }, /* (279) expr ::= expr AND expr */ + { 280, -3 }, /* (280) expr ::= expr OR expr */ + { 280, -3 }, /* (281) expr ::= expr PLUS expr */ + { 280, -3 }, /* (282) expr ::= expr MINUS expr */ + { 280, -3 }, /* (283) expr ::= expr STAR expr */ + { 280, -3 }, /* (284) expr ::= expr SLASH expr */ + { 280, -3 }, /* (285) expr ::= expr REM expr */ + { 280, -3 }, /* (286) expr ::= expr BITAND expr */ + { 280, -3 }, /* (287) expr ::= expr BITOR expr */ + { 280, -3 }, /* (288) expr ::= expr BITXOR expr */ + { 280, -2 }, /* (289) expr ::= BITNOT expr */ + { 280, -3 }, /* (290) expr ::= expr LSHIFT expr */ + { 280, -3 }, /* (291) expr ::= expr RSHIFT expr */ + { 280, -3 }, /* (292) expr ::= expr LIKE expr */ + { 280, -3 }, /* (293) expr ::= expr MATCH expr */ + { 280, -3 }, /* (294) expr ::= expr NMATCH expr */ + { 280, -3 }, /* (295) expr ::= ID CONTAINS STRING */ + { 280, -5 }, /* (296) expr ::= ID DOT ID CONTAINS STRING */ + { 290, -3 }, /* (297) arrow ::= ID ARROW STRING */ + { 290, -5 }, /* (298) arrow ::= ID DOT ID ARROW STRING */ + { 280, -1 }, /* (299) expr ::= arrow */ + { 280, -5 }, /* (300) expr ::= expr IN LP exprlist RP */ + { 216, -3 }, /* (301) exprlist ::= exprlist COMMA expritem */ + { 216, -1 }, /* (302) exprlist ::= expritem */ + { 292, -1 }, /* (303) expritem ::= expr */ + { 292, 0 }, /* (304) expritem ::= */ + { 208, -3 }, /* (305) cmd ::= RESET QUERY CACHE */ + { 208, -3 }, /* (306) cmd ::= SYNCDB ids REPLICA */ + { 208, -7 }, /* (307) cmd ::= ALTER TABLE ids cpxName ADD COLUMN columnlist */ + { 208, -7 }, /* (308) cmd ::= ALTER TABLE ids cpxName DROP COLUMN ids */ + { 208, -7 }, /* (309) cmd ::= ALTER TABLE ids cpxName MODIFY COLUMN columnlist */ + { 208, -7 }, /* (310) cmd ::= ALTER TABLE ids cpxName ADD TAG columnlist */ + { 208, -7 }, /* (311) cmd ::= ALTER TABLE ids cpxName DROP TAG ids */ + { 208, -8 }, /* (312) cmd ::= ALTER TABLE ids cpxName CHANGE TAG ids ids */ + { 208, -9 }, /* (313) cmd ::= ALTER TABLE ids cpxName SET TAG ids EQ tagitem */ + { 208, -7 }, /* (314) cmd ::= ALTER TABLE ids cpxName MODIFY TAG columnlist */ + { 208, -7 }, /* (315) cmd ::= ALTER STABLE ids cpxName ADD COLUMN columnlist */ + { 208, -7 }, /* (316) cmd ::= ALTER STABLE ids cpxName DROP COLUMN ids */ + { 208, -7 }, /* (317) cmd ::= ALTER STABLE ids cpxName MODIFY COLUMN columnlist */ + { 208, -7 }, /* (318) cmd ::= ALTER STABLE ids cpxName ADD TAG columnlist */ + { 208, -7 }, /* (319) cmd ::= ALTER STABLE ids cpxName DROP TAG ids */ + { 208, -8 }, /* (320) cmd ::= ALTER STABLE ids cpxName CHANGE TAG ids ids */ + { 208, -9 }, /* (321) cmd ::= ALTER STABLE ids cpxName SET TAG ids EQ tagitem */ + { 208, -7 }, /* (322) cmd ::= ALTER STABLE ids cpxName MODIFY TAG columnlist */ + { 208, -3 }, /* (323) cmd ::= KILL CONNECTION INTEGER */ + { 208, -5 }, /* (324) cmd ::= KILL STREAM INTEGER COLON INTEGER */ + { 208, -5 }, /* (325) cmd ::= KILL QUERY INTEGER COLON INTEGER */ + { 208, -6 }, /* (326) cmd ::= DELETE FROM ifexists ids cpxName where_opt */ }; static void yy_accept(yyParser*); /* Forward Declaration */ @@ -2494,16 +2519,16 @@ static void yy_reduce( break; case 46: /* cmd ::= ALTER DATABASE ids alter_db_optr */ case 47: /* cmd ::= ALTER TOPIC ids alter_topic_optr */ yytestcase(yyruleno==47); -{ SStrToken t = {0}; setCreateDbInfo(pInfo, TSDB_SQL_ALTER_DB, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy342, &t);} +{ SStrToken t = {0}; setCreateDbInfo(pInfo, TSDB_SQL_ALTER_DB, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy564, &t);} break; case 48: /* cmd ::= ALTER ACCOUNT ids acct_optr */ -{ setCreateAcctSql(pInfo, TSDB_SQL_ALTER_ACCT, &yymsp[-1].minor.yy0, NULL, &yymsp[0].minor.yy299);} +{ setCreateAcctSql(pInfo, TSDB_SQL_ALTER_ACCT, &yymsp[-1].minor.yy0, NULL, &yymsp[0].minor.yy563);} break; case 49: /* 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.yy299);} +{ setCreateAcctSql(pInfo, TSDB_SQL_ALTER_ACCT, &yymsp[-3].minor.yy0, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy563);} break; case 50: /* cmd ::= COMPACT VNODES IN LP exprlist RP */ -{ setCompactVnodeSql(pInfo, TSDB_SQL_COMPACT_VNODE, yymsp[-1].minor.yy333);} +{ setCompactVnodeSql(pInfo, TSDB_SQL_COMPACT_VNODE, yymsp[-1].minor.yy367);} break; case 51: /* ids ::= ID */ case 52: /* ids ::= STRING */ yytestcase(yyruleno==52); @@ -2525,17 +2550,17 @@ static void yy_reduce( { setDCLSqlElems(pInfo, TSDB_SQL_CREATE_DNODE, 1, &yymsp[0].minor.yy0);} break; case 58: /* 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.yy299);} +{ setCreateAcctSql(pInfo, TSDB_SQL_CREATE_ACCT, &yymsp[-3].minor.yy0, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy563);} break; case 59: /* cmd ::= CREATE DATABASE ifnotexists ids db_optr */ case 60: /* cmd ::= CREATE TOPIC ifnotexists ids topic_optr */ yytestcase(yyruleno==60); -{ setCreateDbInfo(pInfo, TSDB_SQL_CREATE_DB, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy342, &yymsp[-2].minor.yy0);} +{ setCreateDbInfo(pInfo, TSDB_SQL_CREATE_DB, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy564, &yymsp[-2].minor.yy0);} break; case 61: /* cmd ::= CREATE FUNCTION ids AS ids OUTPUTTYPE typename bufsize */ -{ setCreateFuncInfo(pInfo, TSDB_SQL_CREATE_FUNCTION, &yymsp[-5].minor.yy0, &yymsp[-3].minor.yy0, &yymsp[-1].minor.yy263, &yymsp[0].minor.yy0, 1);} +{ setCreateFuncInfo(pInfo, TSDB_SQL_CREATE_FUNCTION, &yymsp[-5].minor.yy0, &yymsp[-3].minor.yy0, &yymsp[-1].minor.yy307, &yymsp[0].minor.yy0, 1);} break; case 62: /* cmd ::= CREATE AGGREGATE FUNCTION ids AS ids OUTPUTTYPE typename bufsize */ -{ setCreateFuncInfo(pInfo, TSDB_SQL_CREATE_FUNCTION, &yymsp[-5].minor.yy0, &yymsp[-3].minor.yy0, &yymsp[-1].minor.yy263, &yymsp[0].minor.yy0, 2);} +{ setCreateFuncInfo(pInfo, TSDB_SQL_CREATE_FUNCTION, &yymsp[-5].minor.yy0, &yymsp[-3].minor.yy0, &yymsp[-1].minor.yy307, &yymsp[0].minor.yy0, 2);} break; case 63: /* cmd ::= CREATE USER ids PASS ids */ { setCreateUserSql(pInfo, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0);} @@ -2566,38 +2591,38 @@ static void yy_reduce( break; case 84: /* acct_optr ::= pps tseries storage streams qtime dbs users conns state */ { - yylhsminor.yy299.maxUsers = (yymsp[-2].minor.yy0.n>0)?atoi(yymsp[-2].minor.yy0.z):-1; - yylhsminor.yy299.maxDbs = (yymsp[-3].minor.yy0.n>0)?atoi(yymsp[-3].minor.yy0.z):-1; - yylhsminor.yy299.maxTimeSeries = (yymsp[-7].minor.yy0.n>0)?atoi(yymsp[-7].minor.yy0.z):-1; - yylhsminor.yy299.maxStreams = (yymsp[-5].minor.yy0.n>0)?atoi(yymsp[-5].minor.yy0.z):-1; - yylhsminor.yy299.maxPointsPerSecond = (yymsp[-8].minor.yy0.n>0)?atoi(yymsp[-8].minor.yy0.z):-1; - yylhsminor.yy299.maxStorage = (yymsp[-6].minor.yy0.n>0)?strtoll(yymsp[-6].minor.yy0.z, NULL, 10):-1; - yylhsminor.yy299.maxQueryTime = (yymsp[-4].minor.yy0.n>0)?strtoll(yymsp[-4].minor.yy0.z, NULL, 10):-1; - yylhsminor.yy299.maxConnections = (yymsp[-1].minor.yy0.n>0)?atoi(yymsp[-1].minor.yy0.z):-1; - yylhsminor.yy299.stat = yymsp[0].minor.yy0; + yylhsminor.yy563.maxUsers = (yymsp[-2].minor.yy0.n>0)?atoi(yymsp[-2].minor.yy0.z):-1; + yylhsminor.yy563.maxDbs = (yymsp[-3].minor.yy0.n>0)?atoi(yymsp[-3].minor.yy0.z):-1; + yylhsminor.yy563.maxTimeSeries = (yymsp[-7].minor.yy0.n>0)?atoi(yymsp[-7].minor.yy0.z):-1; + yylhsminor.yy563.maxStreams = (yymsp[-5].minor.yy0.n>0)?atoi(yymsp[-5].minor.yy0.z):-1; + yylhsminor.yy563.maxPointsPerSecond = (yymsp[-8].minor.yy0.n>0)?atoi(yymsp[-8].minor.yy0.z):-1; + yylhsminor.yy563.maxStorage = (yymsp[-6].minor.yy0.n>0)?strtoll(yymsp[-6].minor.yy0.z, NULL, 10):-1; + yylhsminor.yy563.maxQueryTime = (yymsp[-4].minor.yy0.n>0)?strtoll(yymsp[-4].minor.yy0.z, NULL, 10):-1; + yylhsminor.yy563.maxConnections = (yymsp[-1].minor.yy0.n>0)?atoi(yymsp[-1].minor.yy0.z):-1; + yylhsminor.yy563.stat = yymsp[0].minor.yy0; } - yymsp[-8].minor.yy299 = yylhsminor.yy299; + yymsp[-8].minor.yy563 = yylhsminor.yy563; break; case 85: /* intitemlist ::= intitemlist COMMA intitem */ case 158: /* tagitemlist ::= tagitemlist COMMA tagitem */ yytestcase(yyruleno==158); -{ yylhsminor.yy333 = tVariantListAppend(yymsp[-2].minor.yy333, &yymsp[0].minor.yy42, -1); } - yymsp[-2].minor.yy333 = yylhsminor.yy333; +{ yylhsminor.yy367 = tVariantListAppend(yymsp[-2].minor.yy367, &yymsp[0].minor.yy410, -1); } + yymsp[-2].minor.yy367 = yylhsminor.yy367; break; case 86: /* intitemlist ::= intitem */ case 159: /* tagitemlist ::= tagitem */ yytestcase(yyruleno==159); -{ yylhsminor.yy333 = tVariantListAppend(NULL, &yymsp[0].minor.yy42, -1); } - yymsp[0].minor.yy333 = yylhsminor.yy333; +{ yylhsminor.yy367 = tVariantListAppend(NULL, &yymsp[0].minor.yy410, -1); } + yymsp[0].minor.yy367 = yylhsminor.yy367; break; case 87: /* intitem ::= INTEGER */ case 160: /* tagitem ::= INTEGER */ yytestcase(yyruleno==160); case 161: /* tagitem ::= FLOAT */ yytestcase(yyruleno==161); case 162: /* tagitem ::= STRING */ yytestcase(yyruleno==162); case 163: /* tagitem ::= BOOL */ yytestcase(yyruleno==163); -{ toTSDBType(yymsp[0].minor.yy0.type); tVariantCreate(&yylhsminor.yy42, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy42 = yylhsminor.yy42; +{ toTSDBType(yymsp[0].minor.yy0.type); tVariantCreate(&yylhsminor.yy410, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy410 = yylhsminor.yy410; break; case 88: /* keep ::= KEEP intitemlist */ -{ yymsp[-1].minor.yy333 = yymsp[0].minor.yy333; } +{ yymsp[-1].minor.yy367 = yymsp[0].minor.yy367; } break; case 89: /* cache ::= CACHE INTEGER */ case 90: /* replica ::= REPLICA INTEGER */ yytestcase(yyruleno==90); @@ -2617,200 +2642,200 @@ static void yy_reduce( { yymsp[-1].minor.yy0 = yymsp[0].minor.yy0; } break; case 104: /* db_optr ::= */ -{setDefaultCreateDbOption(&yymsp[1].minor.yy342); yymsp[1].minor.yy342.dbType = TSDB_DB_TYPE_DEFAULT;} +{setDefaultCreateDbOption(&yymsp[1].minor.yy564); yymsp[1].minor.yy564.dbType = TSDB_DB_TYPE_DEFAULT;} break; case 105: /* db_optr ::= db_optr cache */ -{ yylhsminor.yy342 = yymsp[-1].minor.yy342; yylhsminor.yy342.cacheBlockSize = strtol(yymsp[0].minor.yy0.z, NULL, 10); } - yymsp[-1].minor.yy342 = yylhsminor.yy342; +{ yylhsminor.yy564 = yymsp[-1].minor.yy564; yylhsminor.yy564.cacheBlockSize = strtol(yymsp[0].minor.yy0.z, NULL, 10); } + yymsp[-1].minor.yy564 = yylhsminor.yy564; break; case 106: /* db_optr ::= db_optr replica */ case 123: /* alter_db_optr ::= alter_db_optr replica */ yytestcase(yyruleno==123); -{ yylhsminor.yy342 = yymsp[-1].minor.yy342; yylhsminor.yy342.replica = strtol(yymsp[0].minor.yy0.z, NULL, 10); } - yymsp[-1].minor.yy342 = yylhsminor.yy342; +{ yylhsminor.yy564 = yymsp[-1].minor.yy564; yylhsminor.yy564.replica = strtol(yymsp[0].minor.yy0.z, NULL, 10); } + yymsp[-1].minor.yy564 = yylhsminor.yy564; break; case 107: /* db_optr ::= db_optr quorum */ case 124: /* alter_db_optr ::= alter_db_optr quorum */ yytestcase(yyruleno==124); -{ yylhsminor.yy342 = yymsp[-1].minor.yy342; yylhsminor.yy342.quorum = strtol(yymsp[0].minor.yy0.z, NULL, 10); } - yymsp[-1].minor.yy342 = yylhsminor.yy342; +{ yylhsminor.yy564 = yymsp[-1].minor.yy564; yylhsminor.yy564.quorum = strtol(yymsp[0].minor.yy0.z, NULL, 10); } + yymsp[-1].minor.yy564 = yylhsminor.yy564; break; case 108: /* db_optr ::= db_optr days */ -{ yylhsminor.yy342 = yymsp[-1].minor.yy342; yylhsminor.yy342.daysPerFile = strtol(yymsp[0].minor.yy0.z, NULL, 10); } - yymsp[-1].minor.yy342 = yylhsminor.yy342; +{ yylhsminor.yy564 = yymsp[-1].minor.yy564; yylhsminor.yy564.daysPerFile = strtol(yymsp[0].minor.yy0.z, NULL, 10); } + yymsp[-1].minor.yy564 = yylhsminor.yy564; break; case 109: /* db_optr ::= db_optr minrows */ -{ yylhsminor.yy342 = yymsp[-1].minor.yy342; yylhsminor.yy342.minRowsPerBlock = strtod(yymsp[0].minor.yy0.z, NULL); } - yymsp[-1].minor.yy342 = yylhsminor.yy342; +{ yylhsminor.yy564 = yymsp[-1].minor.yy564; yylhsminor.yy564.minRowsPerBlock = strtod(yymsp[0].minor.yy0.z, NULL); } + yymsp[-1].minor.yy564 = yylhsminor.yy564; break; case 110: /* db_optr ::= db_optr maxrows */ -{ yylhsminor.yy342 = yymsp[-1].minor.yy342; yylhsminor.yy342.maxRowsPerBlock = strtod(yymsp[0].minor.yy0.z, NULL); } - yymsp[-1].minor.yy342 = yylhsminor.yy342; +{ yylhsminor.yy564 = yymsp[-1].minor.yy564; yylhsminor.yy564.maxRowsPerBlock = strtod(yymsp[0].minor.yy0.z, NULL); } + yymsp[-1].minor.yy564 = yylhsminor.yy564; break; case 111: /* db_optr ::= db_optr blocks */ case 126: /* alter_db_optr ::= alter_db_optr blocks */ yytestcase(yyruleno==126); -{ yylhsminor.yy342 = yymsp[-1].minor.yy342; yylhsminor.yy342.numOfBlocks = strtol(yymsp[0].minor.yy0.z, NULL, 10); } - yymsp[-1].minor.yy342 = yylhsminor.yy342; +{ yylhsminor.yy564 = yymsp[-1].minor.yy564; yylhsminor.yy564.numOfBlocks = strtol(yymsp[0].minor.yy0.z, NULL, 10); } + yymsp[-1].minor.yy564 = yylhsminor.yy564; break; case 112: /* db_optr ::= db_optr ctime */ -{ yylhsminor.yy342 = yymsp[-1].minor.yy342; yylhsminor.yy342.commitTime = strtol(yymsp[0].minor.yy0.z, NULL, 10); } - yymsp[-1].minor.yy342 = yylhsminor.yy342; +{ yylhsminor.yy564 = yymsp[-1].minor.yy564; yylhsminor.yy564.commitTime = strtol(yymsp[0].minor.yy0.z, NULL, 10); } + yymsp[-1].minor.yy564 = yylhsminor.yy564; break; case 113: /* db_optr ::= db_optr wal */ -{ yylhsminor.yy342 = yymsp[-1].minor.yy342; yylhsminor.yy342.walLevel = strtol(yymsp[0].minor.yy0.z, NULL, 10); } - yymsp[-1].minor.yy342 = yylhsminor.yy342; +{ yylhsminor.yy564 = yymsp[-1].minor.yy564; yylhsminor.yy564.walLevel = strtol(yymsp[0].minor.yy0.z, NULL, 10); } + yymsp[-1].minor.yy564 = yylhsminor.yy564; break; case 114: /* db_optr ::= db_optr fsync */ -{ yylhsminor.yy342 = yymsp[-1].minor.yy342; yylhsminor.yy342.fsyncPeriod = strtol(yymsp[0].minor.yy0.z, NULL, 10); } - yymsp[-1].minor.yy342 = yylhsminor.yy342; +{ yylhsminor.yy564 = yymsp[-1].minor.yy564; yylhsminor.yy564.fsyncPeriod = strtol(yymsp[0].minor.yy0.z, NULL, 10); } + yymsp[-1].minor.yy564 = yylhsminor.yy564; break; case 115: /* db_optr ::= db_optr comp */ case 127: /* alter_db_optr ::= alter_db_optr comp */ yytestcase(yyruleno==127); -{ yylhsminor.yy342 = yymsp[-1].minor.yy342; yylhsminor.yy342.compressionLevel = strtol(yymsp[0].minor.yy0.z, NULL, 10); } - yymsp[-1].minor.yy342 = yylhsminor.yy342; +{ yylhsminor.yy564 = yymsp[-1].minor.yy564; yylhsminor.yy564.compressionLevel = strtol(yymsp[0].minor.yy0.z, NULL, 10); } + yymsp[-1].minor.yy564 = yylhsminor.yy564; break; case 116: /* db_optr ::= db_optr prec */ -{ yylhsminor.yy342 = yymsp[-1].minor.yy342; yylhsminor.yy342.precision = yymsp[0].minor.yy0; } - yymsp[-1].minor.yy342 = yylhsminor.yy342; +{ yylhsminor.yy564 = yymsp[-1].minor.yy564; yylhsminor.yy564.precision = yymsp[0].minor.yy0; } + yymsp[-1].minor.yy564 = yylhsminor.yy564; break; case 117: /* db_optr ::= db_optr keep */ case 125: /* alter_db_optr ::= alter_db_optr keep */ yytestcase(yyruleno==125); -{ yylhsminor.yy342 = yymsp[-1].minor.yy342; yylhsminor.yy342.keep = yymsp[0].minor.yy333; } - yymsp[-1].minor.yy342 = yylhsminor.yy342; +{ yylhsminor.yy564 = yymsp[-1].minor.yy564; yylhsminor.yy564.keep = yymsp[0].minor.yy367; } + yymsp[-1].minor.yy564 = yylhsminor.yy564; break; case 118: /* db_optr ::= db_optr update */ case 128: /* alter_db_optr ::= alter_db_optr update */ yytestcase(yyruleno==128); -{ yylhsminor.yy342 = yymsp[-1].minor.yy342; yylhsminor.yy342.update = strtol(yymsp[0].minor.yy0.z, NULL, 10); } - yymsp[-1].minor.yy342 = yylhsminor.yy342; +{ yylhsminor.yy564 = yymsp[-1].minor.yy564; yylhsminor.yy564.update = strtol(yymsp[0].minor.yy0.z, NULL, 10); } + yymsp[-1].minor.yy564 = yylhsminor.yy564; break; case 119: /* db_optr ::= db_optr cachelast */ case 129: /* alter_db_optr ::= alter_db_optr cachelast */ yytestcase(yyruleno==129); -{ yylhsminor.yy342 = yymsp[-1].minor.yy342; yylhsminor.yy342.cachelast = strtol(yymsp[0].minor.yy0.z, NULL, 10); } - yymsp[-1].minor.yy342 = yylhsminor.yy342; +{ yylhsminor.yy564 = yymsp[-1].minor.yy564; yylhsminor.yy564.cachelast = strtol(yymsp[0].minor.yy0.z, NULL, 10); } + yymsp[-1].minor.yy564 = yylhsminor.yy564; break; case 120: /* topic_optr ::= db_optr */ case 130: /* alter_topic_optr ::= alter_db_optr */ yytestcase(yyruleno==130); -{ yylhsminor.yy342 = yymsp[0].minor.yy342; yylhsminor.yy342.dbType = TSDB_DB_TYPE_TOPIC; } - yymsp[0].minor.yy342 = yylhsminor.yy342; +{ yylhsminor.yy564 = yymsp[0].minor.yy564; yylhsminor.yy564.dbType = TSDB_DB_TYPE_TOPIC; } + yymsp[0].minor.yy564 = yylhsminor.yy564; break; case 121: /* topic_optr ::= topic_optr partitions */ case 131: /* alter_topic_optr ::= alter_topic_optr partitions */ yytestcase(yyruleno==131); -{ yylhsminor.yy342 = yymsp[-1].minor.yy342; yylhsminor.yy342.partitions = strtol(yymsp[0].minor.yy0.z, NULL, 10); } - yymsp[-1].minor.yy342 = yylhsminor.yy342; +{ yylhsminor.yy564 = yymsp[-1].minor.yy564; yylhsminor.yy564.partitions = strtol(yymsp[0].minor.yy0.z, NULL, 10); } + yymsp[-1].minor.yy564 = yylhsminor.yy564; break; case 122: /* alter_db_optr ::= */ -{ setDefaultCreateDbOption(&yymsp[1].minor.yy342); yymsp[1].minor.yy342.dbType = TSDB_DB_TYPE_DEFAULT;} +{ setDefaultCreateDbOption(&yymsp[1].minor.yy564); yymsp[1].minor.yy564.dbType = TSDB_DB_TYPE_DEFAULT;} break; case 132: /* typename ::= ids */ { yymsp[0].minor.yy0.type = 0; - tSetColumnType (&yylhsminor.yy263, &yymsp[0].minor.yy0); + tSetColumnType (&yylhsminor.yy307, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy263 = yylhsminor.yy263; + yymsp[0].minor.yy307 = yylhsminor.yy307; break; case 133: /* typename ::= ids LP signed RP */ { - if (yymsp[-1].minor.yy277 <= 0) { + if (yymsp[-1].minor.yy443 <= 0) { yymsp[-3].minor.yy0.type = 0; - tSetColumnType(&yylhsminor.yy263, &yymsp[-3].minor.yy0); + tSetColumnType(&yylhsminor.yy307, &yymsp[-3].minor.yy0); } else { - yymsp[-3].minor.yy0.type = -yymsp[-1].minor.yy277; // negative value of name length - tSetColumnType(&yylhsminor.yy263, &yymsp[-3].minor.yy0); + yymsp[-3].minor.yy0.type = -yymsp[-1].minor.yy443; // negative value of name length + tSetColumnType(&yylhsminor.yy307, &yymsp[-3].minor.yy0); } } - yymsp[-3].minor.yy263 = yylhsminor.yy263; + yymsp[-3].minor.yy307 = yylhsminor.yy307; break; case 134: /* 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); - tSetColumnType (&yylhsminor.yy263, &yymsp[-1].minor.yy0); + tSetColumnType (&yylhsminor.yy307, &yymsp[-1].minor.yy0); } - yymsp[-1].minor.yy263 = yylhsminor.yy263; + yymsp[-1].minor.yy307 = yylhsminor.yy307; break; case 135: /* signed ::= INTEGER */ -{ yylhsminor.yy277 = strtol(yymsp[0].minor.yy0.z, NULL, 10); } - yymsp[0].minor.yy277 = yylhsminor.yy277; +{ yylhsminor.yy443 = strtol(yymsp[0].minor.yy0.z, NULL, 10); } + yymsp[0].minor.yy443 = yylhsminor.yy443; break; case 136: /* signed ::= PLUS INTEGER */ -{ yymsp[-1].minor.yy277 = strtol(yymsp[0].minor.yy0.z, NULL, 10); } +{ yymsp[-1].minor.yy443 = strtol(yymsp[0].minor.yy0.z, NULL, 10); } break; case 137: /* signed ::= MINUS INTEGER */ -{ yymsp[-1].minor.yy277 = -strtol(yymsp[0].minor.yy0.z, NULL, 10);} +{ yymsp[-1].minor.yy443 = -strtol(yymsp[0].minor.yy0.z, NULL, 10);} break; case 141: /* cmd ::= CREATE TABLE create_table_list */ -{ pInfo->type = TSDB_SQL_CREATE_TABLE; pInfo->pCreateTableInfo = yymsp[0].minor.yy78;} +{ pInfo->type = TSDB_SQL_CREATE_TABLE; pInfo->pCreateTableInfo = yymsp[0].minor.yy74;} break; case 142: /* create_table_list ::= create_from_stable */ { SCreateTableSql* pCreateTable = calloc(1, sizeof(SCreateTableSql)); pCreateTable->childTableInfo = taosArrayInit(4, sizeof(SCreatedTableInfo)); - taosArrayPush(pCreateTable->childTableInfo, &yymsp[0].minor.yy400); + taosArrayPush(pCreateTable->childTableInfo, &yymsp[0].minor.yy110); pCreateTable->type = TSQL_CREATE_TABLE_FROM_STABLE; - yylhsminor.yy78 = pCreateTable; + yylhsminor.yy74 = pCreateTable; } - yymsp[0].minor.yy78 = yylhsminor.yy78; + yymsp[0].minor.yy74 = yylhsminor.yy74; break; case 143: /* create_table_list ::= create_table_list create_from_stable */ { - taosArrayPush(yymsp[-1].minor.yy78->childTableInfo, &yymsp[0].minor.yy400); - yylhsminor.yy78 = yymsp[-1].minor.yy78; + taosArrayPush(yymsp[-1].minor.yy74->childTableInfo, &yymsp[0].minor.yy110); + yylhsminor.yy74 = yymsp[-1].minor.yy74; } - yymsp[-1].minor.yy78 = yylhsminor.yy78; + yymsp[-1].minor.yy74 = yylhsminor.yy74; break; case 144: /* create_table_args ::= ifnotexists ids cpxName LP columnlist RP */ { - yylhsminor.yy78 = tSetCreateTableInfo(yymsp[-1].minor.yy333, NULL, NULL, TSQL_CREATE_TABLE); - setSqlInfo(pInfo, yylhsminor.yy78, NULL, TSDB_SQL_CREATE_TABLE); + yylhsminor.yy74 = tSetCreateTableInfo(yymsp[-1].minor.yy367, NULL, NULL, TSQL_CREATE_TABLE); + setSqlInfo(pInfo, yylhsminor.yy74, 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.yy78 = yylhsminor.yy78; + yymsp[-5].minor.yy74 = yylhsminor.yy74; break; case 145: /* create_stable_args ::= ifnotexists ids cpxName LP columnlist RP TAGS LP columnlist RP */ { - yylhsminor.yy78 = tSetCreateTableInfo(yymsp[-5].minor.yy333, yymsp[-1].minor.yy333, NULL, TSQL_CREATE_STABLE); - setSqlInfo(pInfo, yylhsminor.yy78, NULL, TSDB_SQL_CREATE_TABLE); + yylhsminor.yy74 = tSetCreateTableInfo(yymsp[-5].minor.yy367, yymsp[-1].minor.yy367, NULL, TSQL_CREATE_STABLE); + setSqlInfo(pInfo, yylhsminor.yy74, 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.yy78 = yylhsminor.yy78; + yymsp[-9].minor.yy74 = yylhsminor.yy74; break; case 146: /* 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.yy400 = createNewChildTableInfo(&yymsp[-5].minor.yy0, NULL, yymsp[-1].minor.yy333, &yymsp[-8].minor.yy0, &yymsp[-9].minor.yy0); + yylhsminor.yy110 = createNewChildTableInfo(&yymsp[-5].minor.yy0, NULL, yymsp[-1].minor.yy367, &yymsp[-8].minor.yy0, &yymsp[-9].minor.yy0); } - yymsp[-9].minor.yy400 = yylhsminor.yy400; + yymsp[-9].minor.yy110 = yylhsminor.yy110; break; case 147: /* 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.yy400 = createNewChildTableInfo(&yymsp[-8].minor.yy0, yymsp[-5].minor.yy333, yymsp[-1].minor.yy333, &yymsp[-11].minor.yy0, &yymsp[-12].minor.yy0); + yylhsminor.yy110 = createNewChildTableInfo(&yymsp[-8].minor.yy0, yymsp[-5].minor.yy367, yymsp[-1].minor.yy367, &yymsp[-11].minor.yy0, &yymsp[-12].minor.yy0); } - yymsp[-12].minor.yy400 = yylhsminor.yy400; + yymsp[-12].minor.yy110 = yylhsminor.yy110; break; case 148: /* tagNamelist ::= tagNamelist COMMA ids */ -{taosArrayPush(yymsp[-2].minor.yy333, &yymsp[0].minor.yy0); yylhsminor.yy333 = yymsp[-2].minor.yy333; } - yymsp[-2].minor.yy333 = yylhsminor.yy333; +{taosArrayPush(yymsp[-2].minor.yy367, &yymsp[0].minor.yy0); yylhsminor.yy367 = yymsp[-2].minor.yy367; } + yymsp[-2].minor.yy367 = yylhsminor.yy367; break; case 149: /* tagNamelist ::= ids */ -{yylhsminor.yy333 = taosArrayInit(4, sizeof(SStrToken)); taosArrayPush(yylhsminor.yy333, &yymsp[0].minor.yy0);} - yymsp[0].minor.yy333 = yylhsminor.yy333; +{yylhsminor.yy367 = taosArrayInit(4, sizeof(SStrToken)); taosArrayPush(yylhsminor.yy367, &yymsp[0].minor.yy0);} + yymsp[0].minor.yy367 = yylhsminor.yy367; break; case 150: /* create_table_args ::= ifnotexists ids cpxName to_opt split_opt AS select */ { - yylhsminor.yy78 = tSetCreateTableInfo(NULL, NULL, yymsp[0].minor.yy144, TSQL_CREATE_STREAM); - setSqlInfo(pInfo, yylhsminor.yy78, NULL, TSDB_SQL_CREATE_TABLE); + yylhsminor.yy74 = tSetCreateTableInfo(NULL, NULL, yymsp[0].minor.yy426, TSQL_CREATE_STREAM); + setSqlInfo(pInfo, yylhsminor.yy74, NULL, TSDB_SQL_CREATE_TABLE); setCreatedStreamOpt(pInfo, &yymsp[-3].minor.yy0, &yymsp[-2].minor.yy0); yymsp[-5].minor.yy0.n += yymsp[-4].minor.yy0.n; setCreatedTableName(pInfo, &yymsp[-5].minor.yy0, &yymsp[-6].minor.yy0); } - yymsp[-6].minor.yy78 = yylhsminor.yy78; + yymsp[-6].minor.yy74 = yylhsminor.yy74; break; case 151: /* to_opt ::= */ case 153: /* split_opt ::= */ yytestcase(yyruleno==153); @@ -2826,37 +2851,37 @@ static void yy_reduce( { yymsp[-1].minor.yy0 = yymsp[0].minor.yy0;} break; case 155: /* columnlist ::= columnlist COMMA column */ -{taosArrayPush(yymsp[-2].minor.yy333, &yymsp[0].minor.yy263); yylhsminor.yy333 = yymsp[-2].minor.yy333; } - yymsp[-2].minor.yy333 = yylhsminor.yy333; +{taosArrayPush(yymsp[-2].minor.yy367, &yymsp[0].minor.yy307); yylhsminor.yy367 = yymsp[-2].minor.yy367; } + yymsp[-2].minor.yy367 = yylhsminor.yy367; break; case 156: /* columnlist ::= column */ -{yylhsminor.yy333 = taosArrayInit(4, sizeof(TAOS_FIELD)); taosArrayPush(yylhsminor.yy333, &yymsp[0].minor.yy263);} - yymsp[0].minor.yy333 = yylhsminor.yy333; +{yylhsminor.yy367 = taosArrayInit(4, sizeof(TAOS_FIELD)); taosArrayPush(yylhsminor.yy367, &yymsp[0].minor.yy307);} + yymsp[0].minor.yy367 = yylhsminor.yy367; break; case 157: /* column ::= ids typename */ { - tSetColumnInfo(&yylhsminor.yy263, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy263); + tSetColumnInfo(&yylhsminor.yy307, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy307); } - yymsp[-1].minor.yy263 = yylhsminor.yy263; + yymsp[-1].minor.yy307 = yylhsminor.yy307; break; case 164: /* tagitem ::= NULL */ -{ yymsp[0].minor.yy0.type = 0; tVariantCreate(&yylhsminor.yy42, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy42 = yylhsminor.yy42; +{ yymsp[0].minor.yy0.type = 0; tVariantCreate(&yylhsminor.yy410, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy410 = yylhsminor.yy410; break; case 165: /* tagitem ::= NOW */ -{ yymsp[0].minor.yy0.type = TSDB_DATA_TYPE_TIMESTAMP; tVariantCreateExt(&yylhsminor.yy42, &yymsp[0].minor.yy0, TK_NOW, true);} - yymsp[0].minor.yy42 = yylhsminor.yy42; +{ yymsp[0].minor.yy0.type = TSDB_DATA_TYPE_TIMESTAMP; tVariantCreateExt(&yylhsminor.yy410, &yymsp[0].minor.yy0, TK_NOW, true);} + yymsp[0].minor.yy410 = yylhsminor.yy410; break; case 166: /* tagitem ::= NOW PLUS VARIABLE */ { yymsp[0].minor.yy0.type = TSDB_DATA_TYPE_TIMESTAMP; - tVariantCreateExt(&yymsp[-2].minor.yy42, &yymsp[0].minor.yy0, TK_PLUS, true); + tVariantCreateExt(&yymsp[-2].minor.yy410, &yymsp[0].minor.yy0, TK_PLUS, true); } break; case 167: /* tagitem ::= NOW MINUS VARIABLE */ { yymsp[0].minor.yy0.type = TSDB_DATA_TYPE_TIMESTAMP; - tVariantCreateExt(&yymsp[-2].minor.yy42, &yymsp[0].minor.yy0, TK_MINUS, true); + tVariantCreateExt(&yymsp[-2].minor.yy410, &yymsp[0].minor.yy0, TK_MINUS, true); } break; case 168: /* tagitem ::= MINUS INTEGER */ @@ -2867,56 +2892,56 @@ 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.yy42, &yymsp[-1].minor.yy0); + tVariantCreate(&yylhsminor.yy410, &yymsp[-1].minor.yy0); } - yymsp[-1].minor.yy42 = yylhsminor.yy42; + yymsp[-1].minor.yy410 = yylhsminor.yy410; break; case 172: /* select ::= SELECT selcollist from where_opt range_option interval_option sliding_opt session_option windowstate_option fill_opt groupby_opt having_opt orderby_opt slimit_opt limit_opt */ { - yylhsminor.yy144 = tSetQuerySqlNode(&yymsp[-14].minor.yy0, yymsp[-13].minor.yy333, yymsp[-12].minor.yy516, yymsp[-11].minor.yy194, yymsp[-4].minor.yy333, yymsp[-2].minor.yy333, &yymsp[-9].minor.yy200, &yymsp[-7].minor.yy235, &yymsp[-6].minor.yy248, &yymsp[-8].minor.yy0, yymsp[-5].minor.yy333, &yymsp[0].minor.yy190, &yymsp[-1].minor.yy190, yymsp[-3].minor.yy194, &yymsp[-10].minor.yy132); + yylhsminor.yy426 = tSetQuerySqlNode(&yymsp[-14].minor.yy0, yymsp[-13].minor.yy367, yymsp[-12].minor.yy480, yymsp[-11].minor.yy378, yymsp[-4].minor.yy367, yymsp[-2].minor.yy367, &yymsp[-9].minor.yy478, &yymsp[-7].minor.yy373, &yymsp[-6].minor.yy204, &yymsp[-8].minor.yy0, yymsp[-5].minor.yy367, &yymsp[0].minor.yy24, &yymsp[-1].minor.yy24, yymsp[-3].minor.yy378, &yymsp[-10].minor.yy214); } - yymsp[-14].minor.yy144 = yylhsminor.yy144; + yymsp[-14].minor.yy426 = yylhsminor.yy426; break; case 173: /* select ::= LP select RP */ -{yymsp[-2].minor.yy144 = yymsp[-1].minor.yy144;} +{yymsp[-2].minor.yy426 = yymsp[-1].minor.yy426;} break; case 174: /* union ::= select */ -{ yylhsminor.yy333 = setSubclause(NULL, yymsp[0].minor.yy144); } - yymsp[0].minor.yy333 = yylhsminor.yy333; +{ yylhsminor.yy367 = setSubclause(NULL, yymsp[0].minor.yy426); } + yymsp[0].minor.yy367 = yylhsminor.yy367; break; case 175: /* union ::= union UNION ALL select */ -{ yylhsminor.yy333 = appendSelectClause(yymsp[-3].minor.yy333, yymsp[0].minor.yy144); } - yymsp[-3].minor.yy333 = yylhsminor.yy333; +{ yylhsminor.yy367 = appendSelectClause(yymsp[-3].minor.yy367, yymsp[0].minor.yy426); } + yymsp[-3].minor.yy367 = yylhsminor.yy367; break; case 176: /* cmd ::= union */ -{ setSqlInfo(pInfo, yymsp[0].minor.yy333, NULL, TSDB_SQL_SELECT); } +{ setSqlInfo(pInfo, yymsp[0].minor.yy367, NULL, TSDB_SQL_SELECT); } break; case 177: /* select ::= SELECT selcollist */ { - yylhsminor.yy144 = tSetQuerySqlNode(&yymsp[-1].minor.yy0, yymsp[0].minor.yy333, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + yylhsminor.yy426 = tSetQuerySqlNode(&yymsp[-1].minor.yy0, yymsp[0].minor.yy367, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); } - yymsp[-1].minor.yy144 = yylhsminor.yy144; + yymsp[-1].minor.yy426 = yylhsminor.yy426; break; case 178: /* sclp ::= selcollist COMMA */ -{yylhsminor.yy333 = yymsp[-1].minor.yy333;} - yymsp[-1].minor.yy333 = yylhsminor.yy333; +{yylhsminor.yy367 = yymsp[-1].minor.yy367;} + yymsp[-1].minor.yy367 = yylhsminor.yy367; break; case 179: /* sclp ::= */ case 220: /* orderby_opt ::= */ yytestcase(yyruleno==220); -{yymsp[1].minor.yy333 = 0;} +{yymsp[1].minor.yy367 = 0;} break; case 180: /* selcollist ::= sclp distinct expr as */ { - yylhsminor.yy333 = tSqlExprListAppend(yymsp[-3].minor.yy333, yymsp[-1].minor.yy194, yymsp[-2].minor.yy0.n? &yymsp[-2].minor.yy0:0, yymsp[0].minor.yy0.n?&yymsp[0].minor.yy0:0); + yylhsminor.yy367 = tSqlExprListAppend(yymsp[-3].minor.yy367, yymsp[-1].minor.yy378, yymsp[-2].minor.yy0.n? &yymsp[-2].minor.yy0:0, yymsp[0].minor.yy0.n?&yymsp[0].minor.yy0:0); } - yymsp[-3].minor.yy333 = yylhsminor.yy333; + yymsp[-3].minor.yy367 = yylhsminor.yy367; break; case 181: /* selcollist ::= sclp STAR */ { tSqlExpr *pNode = tSqlExprCreateIdValue(pInfo, NULL, TK_ALL); - yylhsminor.yy333 = tSqlExprListAppend(yymsp[-1].minor.yy333, pNode, 0, 0); + yylhsminor.yy367 = tSqlExprListAppend(yymsp[-1].minor.yy367, pNode, 0, 0); } - yymsp[-1].minor.yy333 = yylhsminor.yy333; + yymsp[-1].minor.yy367 = yylhsminor.yy367; break; case 182: /* as ::= AS ids */ { yymsp[-1].minor.yy0 = yymsp[0].minor.yy0; } @@ -2934,114 +2959,114 @@ static void yy_reduce( break; case 187: /* from ::= FROM tablelist */ case 188: /* from ::= FROM sub */ yytestcase(yyruleno==188); -{yymsp[-1].minor.yy516 = yymsp[0].minor.yy516;} +{yymsp[-1].minor.yy480 = yymsp[0].minor.yy480;} break; case 189: /* sub ::= LP union RP */ -{yymsp[-2].minor.yy516 = addSubqueryElem(NULL, yymsp[-1].minor.yy333, NULL);} +{yymsp[-2].minor.yy480 = addSubqueryElem(NULL, yymsp[-1].minor.yy367, NULL);} break; case 190: /* sub ::= LP union RP ids */ -{yymsp[-3].minor.yy516 = addSubqueryElem(NULL, yymsp[-2].minor.yy333, &yymsp[0].minor.yy0);} +{yymsp[-3].minor.yy480 = addSubqueryElem(NULL, yymsp[-2].minor.yy367, &yymsp[0].minor.yy0);} break; case 191: /* sub ::= sub COMMA LP union RP ids */ -{yylhsminor.yy516 = addSubqueryElem(yymsp[-5].minor.yy516, yymsp[-2].minor.yy333, &yymsp[0].minor.yy0);} - yymsp[-5].minor.yy516 = yylhsminor.yy516; +{yylhsminor.yy480 = addSubqueryElem(yymsp[-5].minor.yy480, yymsp[-2].minor.yy367, &yymsp[0].minor.yy0);} + yymsp[-5].minor.yy480 = yylhsminor.yy480; break; case 192: /* tablelist ::= ids cpxName */ { yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; - yylhsminor.yy516 = setTableNameList(NULL, &yymsp[-1].minor.yy0, NULL); + yylhsminor.yy480 = setTableNameList(NULL, &yymsp[-1].minor.yy0, NULL); } - yymsp[-1].minor.yy516 = yylhsminor.yy516; + yymsp[-1].minor.yy480 = yylhsminor.yy480; break; case 193: /* tablelist ::= ids cpxName ids */ { yymsp[-2].minor.yy0.n += yymsp[-1].minor.yy0.n; - yylhsminor.yy516 = setTableNameList(NULL, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0); + yylhsminor.yy480 = setTableNameList(NULL, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0); } - yymsp[-2].minor.yy516 = yylhsminor.yy516; + yymsp[-2].minor.yy480 = yylhsminor.yy480; break; case 194: /* tablelist ::= tablelist COMMA ids cpxName */ { yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; - yylhsminor.yy516 = setTableNameList(yymsp[-3].minor.yy516, &yymsp[-1].minor.yy0, NULL); + yylhsminor.yy480 = setTableNameList(yymsp[-3].minor.yy480, &yymsp[-1].minor.yy0, NULL); } - yymsp[-3].minor.yy516 = yylhsminor.yy516; + yymsp[-3].minor.yy480 = yylhsminor.yy480; break; case 195: /* tablelist ::= tablelist COMMA ids cpxName ids */ { yymsp[-2].minor.yy0.n += yymsp[-1].minor.yy0.n; - yylhsminor.yy516 = setTableNameList(yymsp[-4].minor.yy516, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0); + yylhsminor.yy480 = setTableNameList(yymsp[-4].minor.yy480, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0); } - yymsp[-4].minor.yy516 = yylhsminor.yy516; + yymsp[-4].minor.yy480 = yylhsminor.yy480; break; case 196: /* tmvar ::= VARIABLE */ {yylhsminor.yy0 = yymsp[0].minor.yy0;} yymsp[0].minor.yy0 = yylhsminor.yy0; break; case 197: /* timestamp ::= INTEGER */ -{ yylhsminor.yy194 = tSqlExprCreateTimestamp(&yymsp[0].minor.yy0, TK_INTEGER);} - yymsp[0].minor.yy194 = yylhsminor.yy194; +{ yylhsminor.yy378 = tSqlExprCreateTimestamp(&yymsp[0].minor.yy0, TK_INTEGER);} + yymsp[0].minor.yy378 = yylhsminor.yy378; break; case 198: /* timestamp ::= MINUS INTEGER */ case 199: /* timestamp ::= PLUS INTEGER */ yytestcase(yyruleno==199); -{ yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; yymsp[-1].minor.yy0.type = TK_INTEGER; yylhsminor.yy194 = tSqlExprCreateTimestamp(&yymsp[-1].minor.yy0, TK_INTEGER);} - yymsp[-1].minor.yy194 = yylhsminor.yy194; +{ yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; yymsp[-1].minor.yy0.type = TK_INTEGER; yylhsminor.yy378 = tSqlExprCreateTimestamp(&yymsp[-1].minor.yy0, TK_INTEGER);} + yymsp[-1].minor.yy378 = yylhsminor.yy378; break; case 200: /* timestamp ::= STRING */ -{ yylhsminor.yy194 = tSqlExprCreateTimestamp(&yymsp[0].minor.yy0, TK_STRING);} - yymsp[0].minor.yy194 = yylhsminor.yy194; +{ yylhsminor.yy378 = tSqlExprCreateTimestamp(&yymsp[0].minor.yy0, TK_STRING);} + yymsp[0].minor.yy378 = yylhsminor.yy378; break; case 201: /* timestamp ::= NOW */ -{ yylhsminor.yy194 = tSqlExprCreateTimestamp(&yymsp[0].minor.yy0, TK_NOW); } - yymsp[0].minor.yy194 = yylhsminor.yy194; +{ yylhsminor.yy378 = tSqlExprCreateTimestamp(&yymsp[0].minor.yy0, TK_NOW); } + yymsp[0].minor.yy378 = yylhsminor.yy378; break; case 202: /* timestamp ::= NOW PLUS VARIABLE */ -{yymsp[-2].minor.yy194 = tSqlExprCreateTimestamp(&yymsp[0].minor.yy0, TK_PLUS); } +{yymsp[-2].minor.yy378 = tSqlExprCreateTimestamp(&yymsp[0].minor.yy0, TK_PLUS); } break; case 203: /* timestamp ::= NOW MINUS VARIABLE */ -{yymsp[-2].minor.yy194 = tSqlExprCreateTimestamp(&yymsp[0].minor.yy0, TK_MINUS); } +{yymsp[-2].minor.yy378 = tSqlExprCreateTimestamp(&yymsp[0].minor.yy0, TK_MINUS); } break; case 204: /* range_option ::= */ -{yymsp[1].minor.yy132.start = 0; yymsp[1].minor.yy132.end = 0;} +{yymsp[1].minor.yy214.start = 0; yymsp[1].minor.yy214.end = 0;} break; case 205: /* range_option ::= RANGE LP timestamp COMMA timestamp RP */ -{yymsp[-5].minor.yy132.start = yymsp[-3].minor.yy194; yymsp[-5].minor.yy132.end = yymsp[-1].minor.yy194;} +{yymsp[-5].minor.yy214.start = yymsp[-3].minor.yy378; yymsp[-5].minor.yy214.end = yymsp[-1].minor.yy378;} break; case 206: /* interval_option ::= intervalKey LP tmvar RP */ -{yylhsminor.yy200.interval = yymsp[-1].minor.yy0; yylhsminor.yy200.offset.n = 0; yylhsminor.yy200.token = yymsp[-3].minor.yy44;} - yymsp[-3].minor.yy200 = yylhsminor.yy200; +{yylhsminor.yy478.interval = yymsp[-1].minor.yy0; yylhsminor.yy478.offset.n = 0; yylhsminor.yy478.token = yymsp[-3].minor.yy586;} + yymsp[-3].minor.yy478 = yylhsminor.yy478; break; case 207: /* interval_option ::= intervalKey LP tmvar COMMA tmvar RP */ -{yylhsminor.yy200.interval = yymsp[-3].minor.yy0; yylhsminor.yy200.offset = yymsp[-1].minor.yy0; yylhsminor.yy200.token = yymsp[-5].minor.yy44;} - yymsp[-5].minor.yy200 = yylhsminor.yy200; +{yylhsminor.yy478.interval = yymsp[-3].minor.yy0; yylhsminor.yy478.offset = yymsp[-1].minor.yy0; yylhsminor.yy478.token = yymsp[-5].minor.yy586;} + yymsp[-5].minor.yy478 = yylhsminor.yy478; break; case 208: /* interval_option ::= */ -{memset(&yymsp[1].minor.yy200, 0, sizeof(yymsp[1].minor.yy200));} +{memset(&yymsp[1].minor.yy478, 0, sizeof(yymsp[1].minor.yy478));} break; case 209: /* intervalKey ::= INTERVAL */ -{yymsp[0].minor.yy44 = TK_INTERVAL;} +{yymsp[0].minor.yy586 = TK_INTERVAL;} break; case 210: /* intervalKey ::= EVERY */ -{yymsp[0].minor.yy44 = TK_EVERY; } +{yymsp[0].minor.yy586 = TK_EVERY; } break; case 211: /* session_option ::= */ -{yymsp[1].minor.yy235.col.n = 0; yymsp[1].minor.yy235.gap.n = 0;} +{yymsp[1].minor.yy373.col.n = 0; yymsp[1].minor.yy373.gap.n = 0;} break; case 212: /* session_option ::= SESSION LP ids cpxName COMMA tmvar RP */ { yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n; - yymsp[-6].minor.yy235.col = yymsp[-4].minor.yy0; - yymsp[-6].minor.yy235.gap = yymsp[-1].minor.yy0; + yymsp[-6].minor.yy373.col = yymsp[-4].minor.yy0; + yymsp[-6].minor.yy373.gap = yymsp[-1].minor.yy0; } break; case 213: /* windowstate_option ::= */ -{ yymsp[1].minor.yy248.col.n = 0; yymsp[1].minor.yy248.col.z = NULL;} +{ yymsp[1].minor.yy204.col.n = 0; yymsp[1].minor.yy204.col.z = NULL;} break; case 214: /* windowstate_option ::= STATE_WINDOW LP ids RP */ -{ yymsp[-3].minor.yy248.col = yymsp[-1].minor.yy0; } +{ yymsp[-3].minor.yy204.col = yymsp[-1].minor.yy0; } break; case 215: /* fill_opt ::= */ -{ yymsp[1].minor.yy333 = 0; } +{ yymsp[1].minor.yy367 = 0; } break; case 216: /* fill_opt ::= FILL LP ID COMMA tagitemlist RP */ { @@ -3049,14 +3074,14 @@ static void yy_reduce( toTSDBType(yymsp[-3].minor.yy0.type); tVariantCreate(&A, &yymsp[-3].minor.yy0); - tVariantListInsert(yymsp[-1].minor.yy333, &A, -1, 0); - yymsp[-5].minor.yy333 = yymsp[-1].minor.yy333; + tVariantListInsert(yymsp[-1].minor.yy367, &A, -1, 0); + yymsp[-5].minor.yy367 = yymsp[-1].minor.yy367; } break; case 217: /* fill_opt ::= FILL LP ID RP */ { toTSDBType(yymsp[-1].minor.yy0.type); - yymsp[-3].minor.yy333 = tVariantListAppendToken(NULL, &yymsp[-1].minor.yy0, -1, true); + yymsp[-3].minor.yy367 = tVariantListAppendToken(NULL, &yymsp[-1].minor.yy0, -1, true); } break; case 218: /* sliding_opt ::= SLIDING LP tmvar RP */ @@ -3066,317 +3091,336 @@ static void yy_reduce( {yymsp[1].minor.yy0.n = 0; yymsp[1].minor.yy0.z = NULL; yymsp[1].minor.yy0.type = 0; } break; case 221: /* orderby_opt ::= ORDER BY sortlist */ -{yymsp[-2].minor.yy333 = yymsp[0].minor.yy333;} +{yymsp[-2].minor.yy367 = yymsp[0].minor.yy367;} break; case 222: /* sortlist ::= sortlist COMMA item sortorder */ { - yylhsminor.yy333 = commonItemAppend(yymsp[-3].minor.yy333, &yymsp[-1].minor.yy42, NULL, false, yymsp[0].minor.yy133); + yylhsminor.yy367 = commonItemAppend(yymsp[-3].minor.yy367, &yymsp[-1].minor.yy410, NULL, false, yymsp[0].minor.yy274); } - yymsp[-3].minor.yy333 = yylhsminor.yy333; + yymsp[-3].minor.yy367 = yylhsminor.yy367; break; case 223: /* sortlist ::= sortlist COMMA arrow sortorder */ { - yylhsminor.yy333 = commonItemAppend(yymsp[-3].minor.yy333, NULL, yymsp[-1].minor.yy194, true, yymsp[0].minor.yy133); + yylhsminor.yy367 = commonItemAppend(yymsp[-3].minor.yy367, NULL, yymsp[-1].minor.yy378, true, yymsp[0].minor.yy274); } - yymsp[-3].minor.yy333 = yylhsminor.yy333; + yymsp[-3].minor.yy367 = yylhsminor.yy367; break; case 224: /* sortlist ::= item sortorder */ { - yylhsminor.yy333 = commonItemAppend(NULL, &yymsp[-1].minor.yy42, NULL, false, yymsp[0].minor.yy133); + yylhsminor.yy367 = commonItemAppend(NULL, &yymsp[-1].minor.yy410, NULL, false, yymsp[0].minor.yy274); } - yymsp[-1].minor.yy333 = yylhsminor.yy333; + yymsp[-1].minor.yy367 = yylhsminor.yy367; break; case 225: /* sortlist ::= arrow sortorder */ { - yylhsminor.yy333 = commonItemAppend(NULL, NULL, yymsp[-1].minor.yy194, true, yymsp[0].minor.yy133); + yylhsminor.yy367 = commonItemAppend(NULL, NULL, yymsp[-1].minor.yy378, true, yymsp[0].minor.yy274); } - yymsp[-1].minor.yy333 = yylhsminor.yy333; + yymsp[-1].minor.yy367 = yylhsminor.yy367; break; case 226: /* item ::= ID */ { toTSDBType(yymsp[0].minor.yy0.type); - tVariantCreate(&yylhsminor.yy42, &yymsp[0].minor.yy0); + tVariantCreate(&yylhsminor.yy410, &yymsp[0].minor.yy0); } - yymsp[0].minor.yy42 = yylhsminor.yy42; + yymsp[0].minor.yy410 = yylhsminor.yy410; break; case 227: /* item ::= ID DOT ID */ { toTSDBType(yymsp[-2].minor.yy0.type); yymsp[-2].minor.yy0.n += (1+yymsp[0].minor.yy0.n); - tVariantCreate(&yylhsminor.yy42, &yymsp[-2].minor.yy0); + tVariantCreate(&yylhsminor.yy410, &yymsp[-2].minor.yy0); } - yymsp[-2].minor.yy42 = yylhsminor.yy42; + yymsp[-2].minor.yy410 = yylhsminor.yy410; break; case 228: /* sortorder ::= ASC */ -{ yymsp[0].minor.yy133 = TSDB_ORDER_ASC; } +{ yymsp[0].minor.yy274 = TSDB_ORDER_ASC; } break; case 229: /* sortorder ::= DESC */ -{ yymsp[0].minor.yy133 = TSDB_ORDER_DESC;} +{ yymsp[0].minor.yy274 = TSDB_ORDER_DESC;} break; case 230: /* sortorder ::= */ -{ yymsp[1].minor.yy133 = TSDB_ORDER_ASC; } +{ yymsp[1].minor.yy274 = TSDB_ORDER_ASC; } break; case 231: /* groupby_opt ::= */ -{ yymsp[1].minor.yy333 = 0;} +{ yymsp[1].minor.yy367 = 0;} break; case 232: /* groupby_opt ::= GROUP BY grouplist */ -{ yymsp[-2].minor.yy333 = yymsp[0].minor.yy333;} +{ yymsp[-2].minor.yy367 = yymsp[0].minor.yy367;} break; case 233: /* grouplist ::= grouplist COMMA item */ { - yylhsminor.yy333 = commonItemAppend(yymsp[-2].minor.yy333, &yymsp[0].minor.yy42, NULL, false, -1); + yylhsminor.yy367 = commonItemAppend(yymsp[-2].minor.yy367, &yymsp[0].minor.yy410, NULL, false, -1); } - yymsp[-2].minor.yy333 = yylhsminor.yy333; + yymsp[-2].minor.yy367 = yylhsminor.yy367; break; case 234: /* grouplist ::= grouplist COMMA arrow */ { - yylhsminor.yy333 = commonItemAppend(yymsp[-2].minor.yy333, NULL, yymsp[0].minor.yy194, true, -1); + yylhsminor.yy367 = commonItemAppend(yymsp[-2].minor.yy367, NULL, yymsp[0].minor.yy378, true, -1); } - yymsp[-2].minor.yy333 = yylhsminor.yy333; + yymsp[-2].minor.yy367 = yylhsminor.yy367; break; case 235: /* grouplist ::= item */ { - yylhsminor.yy333 = commonItemAppend(NULL, &yymsp[0].minor.yy42, NULL, false, -1); + yylhsminor.yy367 = commonItemAppend(NULL, &yymsp[0].minor.yy410, NULL, false, -1); } - yymsp[0].minor.yy333 = yylhsminor.yy333; + yymsp[0].minor.yy367 = yylhsminor.yy367; break; case 236: /* grouplist ::= arrow */ { - yylhsminor.yy333 = commonItemAppend(NULL, NULL, yymsp[0].minor.yy194, true, -1); + yylhsminor.yy367 = commonItemAppend(NULL, NULL, yymsp[0].minor.yy378, true, -1); } - yymsp[0].minor.yy333 = yylhsminor.yy333; + yymsp[0].minor.yy367 = yylhsminor.yy367; break; case 237: /* having_opt ::= */ case 247: /* where_opt ::= */ yytestcase(yyruleno==247); - case 299: /* expritem ::= */ yytestcase(yyruleno==299); -{yymsp[1].minor.yy194 = 0;} + case 304: /* expritem ::= */ yytestcase(yyruleno==304); +{yymsp[1].minor.yy378 = 0;} break; case 238: /* having_opt ::= HAVING expr */ case 248: /* where_opt ::= WHERE expr */ yytestcase(yyruleno==248); -{yymsp[-1].minor.yy194 = yymsp[0].minor.yy194;} +{yymsp[-1].minor.yy378 = yymsp[0].minor.yy378;} break; case 239: /* limit_opt ::= */ case 243: /* slimit_opt ::= */ yytestcase(yyruleno==243); -{yymsp[1].minor.yy190.limit = -1; yymsp[1].minor.yy190.offset = 0;} +{yymsp[1].minor.yy24.limit = -1; yymsp[1].minor.yy24.offset = 0;} break; case 240: /* limit_opt ::= LIMIT signed */ case 244: /* slimit_opt ::= SLIMIT signed */ yytestcase(yyruleno==244); -{yymsp[-1].minor.yy190.limit = yymsp[0].minor.yy277; yymsp[-1].minor.yy190.offset = 0;} +{yymsp[-1].minor.yy24.limit = yymsp[0].minor.yy443; yymsp[-1].minor.yy24.offset = 0;} break; case 241: /* limit_opt ::= LIMIT signed OFFSET signed */ -{ yymsp[-3].minor.yy190.limit = yymsp[-2].minor.yy277; yymsp[-3].minor.yy190.offset = yymsp[0].minor.yy277;} +{ yymsp[-3].minor.yy24.limit = yymsp[-2].minor.yy443; yymsp[-3].minor.yy24.offset = yymsp[0].minor.yy443;} break; case 242: /* limit_opt ::= LIMIT signed COMMA signed */ -{ yymsp[-3].minor.yy190.limit = yymsp[0].minor.yy277; yymsp[-3].minor.yy190.offset = yymsp[-2].minor.yy277;} +{ yymsp[-3].minor.yy24.limit = yymsp[0].minor.yy443; yymsp[-3].minor.yy24.offset = yymsp[-2].minor.yy443;} break; case 245: /* slimit_opt ::= SLIMIT signed SOFFSET signed */ -{yymsp[-3].minor.yy190.limit = yymsp[-2].minor.yy277; yymsp[-3].minor.yy190.offset = yymsp[0].minor.yy277;} +{yymsp[-3].minor.yy24.limit = yymsp[-2].minor.yy443; yymsp[-3].minor.yy24.offset = yymsp[0].minor.yy443;} break; case 246: /* slimit_opt ::= SLIMIT signed COMMA signed */ -{yymsp[-3].minor.yy190.limit = yymsp[0].minor.yy277; yymsp[-3].minor.yy190.offset = yymsp[-2].minor.yy277;} +{yymsp[-3].minor.yy24.limit = yymsp[0].minor.yy443; yymsp[-3].minor.yy24.offset = yymsp[-2].minor.yy443;} break; case 249: /* expr ::= LP expr RP */ -{yylhsminor.yy194 = yymsp[-1].minor.yy194; yylhsminor.yy194->exprToken.z = yymsp[-2].minor.yy0.z; yylhsminor.yy194->exprToken.n = (yymsp[0].minor.yy0.z - yymsp[-2].minor.yy0.z + 1);} - yymsp[-2].minor.yy194 = yylhsminor.yy194; +{yylhsminor.yy378 = yymsp[-1].minor.yy378; yylhsminor.yy378->exprToken.z = yymsp[-2].minor.yy0.z; yylhsminor.yy378->exprToken.n = (yymsp[0].minor.yy0.z - yymsp[-2].minor.yy0.z + 1);} + yymsp[-2].minor.yy378 = yylhsminor.yy378; break; case 250: /* expr ::= ID */ -{ yylhsminor.yy194 = tSqlExprCreateIdValue(pInfo, &yymsp[0].minor.yy0, TK_ID);} - yymsp[0].minor.yy194 = yylhsminor.yy194; +{ yylhsminor.yy378 = tSqlExprCreateIdValue(pInfo, &yymsp[0].minor.yy0, TK_ID);} + yymsp[0].minor.yy378 = yylhsminor.yy378; break; case 251: /* expr ::= ID DOT ID */ -{ yymsp[-2].minor.yy0.n += (1+yymsp[0].minor.yy0.n); yylhsminor.yy194 = tSqlExprCreateIdValue(pInfo, &yymsp[-2].minor.yy0, TK_ID);} - yymsp[-2].minor.yy194 = yylhsminor.yy194; +{ yymsp[-2].minor.yy0.n += (1+yymsp[0].minor.yy0.n); yylhsminor.yy378 = tSqlExprCreateIdValue(pInfo, &yymsp[-2].minor.yy0, TK_ID);} + yymsp[-2].minor.yy378 = yylhsminor.yy378; break; case 252: /* expr ::= ID DOT STAR */ -{ yymsp[-2].minor.yy0.n += (1+yymsp[0].minor.yy0.n); yylhsminor.yy194 = tSqlExprCreateIdValue(pInfo, &yymsp[-2].minor.yy0, TK_ALL);} - yymsp[-2].minor.yy194 = yylhsminor.yy194; +{ yymsp[-2].minor.yy0.n += (1+yymsp[0].minor.yy0.n); yylhsminor.yy378 = tSqlExprCreateIdValue(pInfo, &yymsp[-2].minor.yy0, TK_ALL);} + yymsp[-2].minor.yy378 = yylhsminor.yy378; break; case 253: /* expr ::= INTEGER */ -{ yylhsminor.yy194 = tSqlExprCreateIdValue(pInfo, &yymsp[0].minor.yy0, TK_INTEGER);} - yymsp[0].minor.yy194 = yylhsminor.yy194; +{ yylhsminor.yy378 = tSqlExprCreateIdValue(pInfo, &yymsp[0].minor.yy0, TK_INTEGER);} + yymsp[0].minor.yy378 = yylhsminor.yy378; break; case 254: /* expr ::= MINUS INTEGER */ case 255: /* expr ::= PLUS INTEGER */ yytestcase(yyruleno==255); -{ yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; yymsp[-1].minor.yy0.type = TK_INTEGER; yylhsminor.yy194 = tSqlExprCreateIdValue(pInfo, &yymsp[-1].minor.yy0, TK_INTEGER);} - yymsp[-1].minor.yy194 = yylhsminor.yy194; +{ yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; yymsp[-1].minor.yy0.type = TK_INTEGER; yylhsminor.yy378 = tSqlExprCreateIdValue(pInfo, &yymsp[-1].minor.yy0, TK_INTEGER);} + yymsp[-1].minor.yy378 = yylhsminor.yy378; break; case 256: /* expr ::= FLOAT */ -{ yylhsminor.yy194 = tSqlExprCreateIdValue(pInfo, &yymsp[0].minor.yy0, TK_FLOAT);} - yymsp[0].minor.yy194 = yylhsminor.yy194; +{ yylhsminor.yy378 = tSqlExprCreateIdValue(pInfo, &yymsp[0].minor.yy0, TK_FLOAT);} + yymsp[0].minor.yy378 = yylhsminor.yy378; break; case 257: /* expr ::= MINUS FLOAT */ case 258: /* expr ::= PLUS FLOAT */ yytestcase(yyruleno==258); -{ yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; yymsp[-1].minor.yy0.type = TK_FLOAT; yylhsminor.yy194 = tSqlExprCreateIdValue(pInfo, &yymsp[-1].minor.yy0, TK_FLOAT);} - yymsp[-1].minor.yy194 = yylhsminor.yy194; +{ yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; yymsp[-1].minor.yy0.type = TK_FLOAT; yylhsminor.yy378 = tSqlExprCreateIdValue(pInfo, &yymsp[-1].minor.yy0, TK_FLOAT);} + yymsp[-1].minor.yy378 = yylhsminor.yy378; break; case 259: /* expr ::= STRING */ -{ yylhsminor.yy194 = tSqlExprCreateIdValue(pInfo, &yymsp[0].minor.yy0, TK_STRING);} - yymsp[0].minor.yy194 = yylhsminor.yy194; +{ yylhsminor.yy378 = tSqlExprCreateIdValue(pInfo, &yymsp[0].minor.yy0, TK_STRING);} + yymsp[0].minor.yy378 = yylhsminor.yy378; break; case 260: /* expr ::= NOW */ -{ yylhsminor.yy194 = tSqlExprCreateIdValue(pInfo, &yymsp[0].minor.yy0, TK_NOW); } - yymsp[0].minor.yy194 = yylhsminor.yy194; +{ yylhsminor.yy378 = tSqlExprCreateIdValue(pInfo, &yymsp[0].minor.yy0, TK_NOW); } + yymsp[0].minor.yy378 = yylhsminor.yy378; break; case 261: /* expr ::= TODAY */ -{ yylhsminor.yy194 = tSqlExprCreateIdValue(pInfo, &yymsp[0].minor.yy0, TK_TODAY); } - yymsp[0].minor.yy194 = yylhsminor.yy194; +{ yylhsminor.yy378 = tSqlExprCreateIdValue(pInfo, &yymsp[0].minor.yy0, TK_TODAY); } + yymsp[0].minor.yy378 = yylhsminor.yy378; break; case 262: /* expr ::= VARIABLE */ -{ yylhsminor.yy194 = tSqlExprCreateIdValue(pInfo, &yymsp[0].minor.yy0, TK_VARIABLE);} - yymsp[0].minor.yy194 = yylhsminor.yy194; +{ yylhsminor.yy378 = tSqlExprCreateIdValue(pInfo, &yymsp[0].minor.yy0, TK_VARIABLE);} + yymsp[0].minor.yy378 = yylhsminor.yy378; break; case 263: /* expr ::= PLUS VARIABLE */ case 264: /* expr ::= MINUS VARIABLE */ yytestcase(yyruleno==264); -{ yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; yymsp[-1].minor.yy0.type = TK_VARIABLE; yylhsminor.yy194 = tSqlExprCreateIdValue(pInfo, &yymsp[-1].minor.yy0, TK_VARIABLE);} - yymsp[-1].minor.yy194 = yylhsminor.yy194; +{ yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; yymsp[-1].minor.yy0.type = TK_VARIABLE; yylhsminor.yy378 = tSqlExprCreateIdValue(pInfo, &yymsp[-1].minor.yy0, TK_VARIABLE);} + yymsp[-1].minor.yy378 = yylhsminor.yy378; break; case 265: /* expr ::= BOOL */ -{ yylhsminor.yy194 = tSqlExprCreateIdValue(pInfo, &yymsp[0].minor.yy0, TK_BOOL);} - yymsp[0].minor.yy194 = yylhsminor.yy194; +{ yylhsminor.yy378 = tSqlExprCreateIdValue(pInfo, &yymsp[0].minor.yy0, TK_BOOL);} + yymsp[0].minor.yy378 = yylhsminor.yy378; break; case 266: /* expr ::= NULL */ -{ yylhsminor.yy194 = tSqlExprCreateIdValue(pInfo, &yymsp[0].minor.yy0, TK_NULL);} - yymsp[0].minor.yy194 = yylhsminor.yy194; +{ yylhsminor.yy378 = tSqlExprCreateIdValue(pInfo, &yymsp[0].minor.yy0, TK_NULL);} + yymsp[0].minor.yy378 = yylhsminor.yy378; break; case 267: /* expr ::= ID LP exprlist RP */ -{ tStrTokenAppend(pInfo->funcs, &yymsp[-3].minor.yy0); yylhsminor.yy194 = tSqlExprCreateFunction(yymsp[-1].minor.yy333, &yymsp[-3].minor.yy0, &yymsp[0].minor.yy0, yymsp[-3].minor.yy0.type); } - yymsp[-3].minor.yy194 = yylhsminor.yy194; +{ tStrTokenAppend(pInfo->funcs, &yymsp[-3].minor.yy0); yylhsminor.yy378 = tSqlExprCreateFunction(yymsp[-1].minor.yy367, &yymsp[-3].minor.yy0, &yymsp[0].minor.yy0, yymsp[-3].minor.yy0.type); } + yymsp[-3].minor.yy378 = yylhsminor.yy378; break; case 268: /* expr ::= ID LP STAR RP */ -{ tStrTokenAppend(pInfo->funcs, &yymsp[-3].minor.yy0); yylhsminor.yy194 = tSqlExprCreateFunction(NULL, &yymsp[-3].minor.yy0, &yymsp[0].minor.yy0, yymsp[-3].minor.yy0.type); } - yymsp[-3].minor.yy194 = yylhsminor.yy194; +{ tStrTokenAppend(pInfo->funcs, &yymsp[-3].minor.yy0); yylhsminor.yy378 = tSqlExprCreateFunction(NULL, &yymsp[-3].minor.yy0, &yymsp[0].minor.yy0, yymsp[-3].minor.yy0.type); } + yymsp[-3].minor.yy378 = yylhsminor.yy378; break; case 269: /* expr ::= ID LP expr AS typename RP */ -{ tStrTokenAppend(pInfo->funcs, &yymsp[-5].minor.yy0); yylhsminor.yy194 = tSqlExprCreateFuncWithParams(pInfo, yymsp[-3].minor.yy194, &yymsp[-1].minor.yy263, &yymsp[-5].minor.yy0, &yymsp[0].minor.yy0, yymsp[-5].minor.yy0.type); } - yymsp[-5].minor.yy194 = yylhsminor.yy194; +{ tStrTokenAppend(pInfo->funcs, &yymsp[-5].minor.yy0); yylhsminor.yy378 = tSqlExprCreateFuncWithParams(pInfo, yymsp[-3].minor.yy378, &yymsp[-1].minor.yy307, &yymsp[-5].minor.yy0, &yymsp[0].minor.yy0, yymsp[-5].minor.yy0.type); } + yymsp[-5].minor.yy378 = yylhsminor.yy378; break; case 270: /* expr ::= expr IS NULL */ -{yylhsminor.yy194 = tSqlExprCreate(yymsp[-2].minor.yy194, NULL, TK_ISNULL);} - yymsp[-2].minor.yy194 = yylhsminor.yy194; +{yylhsminor.yy378 = tSqlExprCreate(yymsp[-2].minor.yy378, NULL, TK_ISNULL);} + yymsp[-2].minor.yy378 = yylhsminor.yy378; break; case 271: /* expr ::= expr IS NOT NULL */ -{yylhsminor.yy194 = tSqlExprCreate(yymsp[-3].minor.yy194, NULL, TK_NOTNULL);} - yymsp[-3].minor.yy194 = yylhsminor.yy194; +{yylhsminor.yy378 = tSqlExprCreate(yymsp[-3].minor.yy378, NULL, TK_NOTNULL);} + yymsp[-3].minor.yy378 = yylhsminor.yy378; break; case 272: /* expr ::= expr LT expr */ -{yylhsminor.yy194 = tSqlExprCreate(yymsp[-2].minor.yy194, yymsp[0].minor.yy194, TK_LT);} - yymsp[-2].minor.yy194 = yylhsminor.yy194; +{yylhsminor.yy378 = tSqlExprCreate(yymsp[-2].minor.yy378, yymsp[0].minor.yy378, TK_LT);} + yymsp[-2].minor.yy378 = yylhsminor.yy378; break; case 273: /* expr ::= expr GT expr */ -{yylhsminor.yy194 = tSqlExprCreate(yymsp[-2].minor.yy194, yymsp[0].minor.yy194, TK_GT);} - yymsp[-2].minor.yy194 = yylhsminor.yy194; +{yylhsminor.yy378 = tSqlExprCreate(yymsp[-2].minor.yy378, yymsp[0].minor.yy378, TK_GT);} + yymsp[-2].minor.yy378 = yylhsminor.yy378; break; case 274: /* expr ::= expr LE expr */ -{yylhsminor.yy194 = tSqlExprCreate(yymsp[-2].minor.yy194, yymsp[0].minor.yy194, TK_LE);} - yymsp[-2].minor.yy194 = yylhsminor.yy194; +{yylhsminor.yy378 = tSqlExprCreate(yymsp[-2].minor.yy378, yymsp[0].minor.yy378, TK_LE);} + yymsp[-2].minor.yy378 = yylhsminor.yy378; break; case 275: /* expr ::= expr GE expr */ -{yylhsminor.yy194 = tSqlExprCreate(yymsp[-2].minor.yy194, yymsp[0].minor.yy194, TK_GE);} - yymsp[-2].minor.yy194 = yylhsminor.yy194; +{yylhsminor.yy378 = tSqlExprCreate(yymsp[-2].minor.yy378, yymsp[0].minor.yy378, TK_GE);} + yymsp[-2].minor.yy378 = yylhsminor.yy378; break; case 276: /* expr ::= expr NE expr */ -{yylhsminor.yy194 = tSqlExprCreate(yymsp[-2].minor.yy194, yymsp[0].minor.yy194, TK_NE);} - yymsp[-2].minor.yy194 = yylhsminor.yy194; +{yylhsminor.yy378 = tSqlExprCreate(yymsp[-2].minor.yy378, yymsp[0].minor.yy378, TK_NE);} + yymsp[-2].minor.yy378 = yylhsminor.yy378; break; case 277: /* expr ::= expr EQ expr */ -{yylhsminor.yy194 = tSqlExprCreate(yymsp[-2].minor.yy194, yymsp[0].minor.yy194, TK_EQ);} - yymsp[-2].minor.yy194 = yylhsminor.yy194; +{yylhsminor.yy378 = tSqlExprCreate(yymsp[-2].minor.yy378, yymsp[0].minor.yy378, TK_EQ);} + yymsp[-2].minor.yy378 = yylhsminor.yy378; break; case 278: /* expr ::= expr BETWEEN expr AND expr */ -{ tSqlExpr* X2 = tSqlExprClone(yymsp[-4].minor.yy194); yylhsminor.yy194 = tSqlExprCreate(tSqlExprCreate(yymsp[-4].minor.yy194, yymsp[-2].minor.yy194, TK_GE), tSqlExprCreate(X2, yymsp[0].minor.yy194, TK_LE), TK_AND);} - yymsp[-4].minor.yy194 = yylhsminor.yy194; +{ tSqlExpr* X2 = tSqlExprClone(yymsp[-4].minor.yy378); yylhsminor.yy378 = tSqlExprCreate(tSqlExprCreate(yymsp[-4].minor.yy378, yymsp[-2].minor.yy378, TK_GE), tSqlExprCreate(X2, yymsp[0].minor.yy378, TK_LE), TK_AND);} + yymsp[-4].minor.yy378 = yylhsminor.yy378; break; case 279: /* expr ::= expr AND expr */ -{yylhsminor.yy194 = tSqlExprCreate(yymsp[-2].minor.yy194, yymsp[0].minor.yy194, TK_AND);} - yymsp[-2].minor.yy194 = yylhsminor.yy194; +{yylhsminor.yy378 = tSqlExprCreate(yymsp[-2].minor.yy378, yymsp[0].minor.yy378, TK_AND);} + yymsp[-2].minor.yy378 = yylhsminor.yy378; break; case 280: /* expr ::= expr OR expr */ -{yylhsminor.yy194 = tSqlExprCreate(yymsp[-2].minor.yy194, yymsp[0].minor.yy194, TK_OR); } - yymsp[-2].minor.yy194 = yylhsminor.yy194; +{yylhsminor.yy378 = tSqlExprCreate(yymsp[-2].minor.yy378, yymsp[0].minor.yy378, TK_OR); } + yymsp[-2].minor.yy378 = yylhsminor.yy378; break; case 281: /* expr ::= expr PLUS expr */ -{yylhsminor.yy194 = tSqlExprCreate(yymsp[-2].minor.yy194, yymsp[0].minor.yy194, TK_PLUS); } - yymsp[-2].minor.yy194 = yylhsminor.yy194; +{yylhsminor.yy378 = tSqlExprCreate(yymsp[-2].minor.yy378, yymsp[0].minor.yy378, TK_PLUS); } + yymsp[-2].minor.yy378 = yylhsminor.yy378; break; case 282: /* expr ::= expr MINUS expr */ -{yylhsminor.yy194 = tSqlExprCreate(yymsp[-2].minor.yy194, yymsp[0].minor.yy194, TK_MINUS); } - yymsp[-2].minor.yy194 = yylhsminor.yy194; +{yylhsminor.yy378 = tSqlExprCreate(yymsp[-2].minor.yy378, yymsp[0].minor.yy378, TK_MINUS); } + yymsp[-2].minor.yy378 = yylhsminor.yy378; break; case 283: /* expr ::= expr STAR expr */ -{yylhsminor.yy194 = tSqlExprCreate(yymsp[-2].minor.yy194, yymsp[0].minor.yy194, TK_STAR); } - yymsp[-2].minor.yy194 = yylhsminor.yy194; +{yylhsminor.yy378 = tSqlExprCreate(yymsp[-2].minor.yy378, yymsp[0].minor.yy378, TK_STAR); } + yymsp[-2].minor.yy378 = yylhsminor.yy378; break; case 284: /* expr ::= expr SLASH expr */ -{yylhsminor.yy194 = tSqlExprCreate(yymsp[-2].minor.yy194, yymsp[0].minor.yy194, TK_DIVIDE);} - yymsp[-2].minor.yy194 = yylhsminor.yy194; +{yylhsminor.yy378 = tSqlExprCreate(yymsp[-2].minor.yy378, yymsp[0].minor.yy378, TK_DIVIDE);} + yymsp[-2].minor.yy378 = yylhsminor.yy378; break; case 285: /* expr ::= expr REM expr */ -{yylhsminor.yy194 = tSqlExprCreate(yymsp[-2].minor.yy194, yymsp[0].minor.yy194, TK_REM); } - yymsp[-2].minor.yy194 = yylhsminor.yy194; +{yylhsminor.yy378 = tSqlExprCreate(yymsp[-2].minor.yy378, yymsp[0].minor.yy378, TK_REM); } + yymsp[-2].minor.yy378 = yylhsminor.yy378; break; case 286: /* expr ::= expr BITAND expr */ -{yylhsminor.yy194 = tSqlExprCreate(yymsp[-2].minor.yy194, yymsp[0].minor.yy194, TK_BITAND);} - yymsp[-2].minor.yy194 = yylhsminor.yy194; +{yylhsminor.yy378 = tSqlExprCreate(yymsp[-2].minor.yy378, yymsp[0].minor.yy378, TK_BITAND);} + yymsp[-2].minor.yy378 = yylhsminor.yy378; break; - case 287: /* expr ::= expr LIKE expr */ -{yylhsminor.yy194 = tSqlExprCreate(yymsp[-2].minor.yy194, yymsp[0].minor.yy194, TK_LIKE); } - yymsp[-2].minor.yy194 = yylhsminor.yy194; + case 287: /* expr ::= expr BITOR expr */ +{yylhsminor.yy378 = tSqlExprCreate(yymsp[-2].minor.yy378, yymsp[0].minor.yy378, TK_BITOR); } + yymsp[-2].minor.yy378 = yylhsminor.yy378; break; - case 288: /* expr ::= expr MATCH expr */ -{yylhsminor.yy194 = tSqlExprCreate(yymsp[-2].minor.yy194, yymsp[0].minor.yy194, TK_MATCH); } - yymsp[-2].minor.yy194 = yylhsminor.yy194; + case 288: /* expr ::= expr BITXOR expr */ +{yylhsminor.yy378 = tSqlExprCreate(yymsp[-2].minor.yy378, yymsp[0].minor.yy378, TK_BITXOR);} + yymsp[-2].minor.yy378 = yylhsminor.yy378; break; - case 289: /* expr ::= expr NMATCH expr */ -{yylhsminor.yy194 = tSqlExprCreate(yymsp[-2].minor.yy194, yymsp[0].minor.yy194, TK_NMATCH); } - yymsp[-2].minor.yy194 = yylhsminor.yy194; + case 289: /* expr ::= BITNOT expr */ +{yymsp[-1].minor.yy378 = tSqlExprCreate(yymsp[0].minor.yy378, NULL, TK_BITNOT);} break; - case 290: /* expr ::= ID CONTAINS STRING */ -{ tSqlExpr* S = tSqlExprCreateIdValue(pInfo, &yymsp[-2].minor.yy0, TK_ID); tSqlExpr* M = tSqlExprCreateIdValue(pInfo, &yymsp[0].minor.yy0, TK_STRING); yylhsminor.yy194 = tSqlExprCreate(S, M, TK_CONTAINS); } - yymsp[-2].minor.yy194 = yylhsminor.yy194; + case 290: /* expr ::= expr LSHIFT expr */ +{yylhsminor.yy378 = tSqlExprCreate(yymsp[-2].minor.yy378, yymsp[0].minor.yy378, TK_LSHIFT);} + yymsp[-2].minor.yy378 = yylhsminor.yy378; break; - case 291: /* expr ::= ID DOT ID CONTAINS STRING */ -{ yymsp[-4].minor.yy0.n += (1+yymsp[-2].minor.yy0.n); tSqlExpr* S = tSqlExprCreateIdValue(pInfo, &yymsp[-4].minor.yy0, TK_ID); tSqlExpr* M = tSqlExprCreateIdValue(pInfo, &yymsp[0].minor.yy0, TK_STRING); yylhsminor.yy194 = tSqlExprCreate(S, M, TK_CONTAINS); } - yymsp[-4].minor.yy194 = yylhsminor.yy194; + case 291: /* expr ::= expr RSHIFT expr */ +{yylhsminor.yy378 = tSqlExprCreate(yymsp[-2].minor.yy378, yymsp[0].minor.yy378, TK_RSHIFT);} + yymsp[-2].minor.yy378 = yylhsminor.yy378; break; - case 292: /* arrow ::= ID ARROW STRING */ -{tSqlExpr* S = tSqlExprCreateIdValue(pInfo, &yymsp[-2].minor.yy0, TK_ID); tSqlExpr* M = tSqlExprCreateIdValue(pInfo, &yymsp[0].minor.yy0, TK_STRING); yylhsminor.yy194 = tSqlExprCreate(S, M, TK_ARROW); } - yymsp[-2].minor.yy194 = yylhsminor.yy194; + case 292: /* expr ::= expr LIKE expr */ +{yylhsminor.yy378 = tSqlExprCreate(yymsp[-2].minor.yy378, yymsp[0].minor.yy378, TK_LIKE); } + yymsp[-2].minor.yy378 = yylhsminor.yy378; break; - case 293: /* arrow ::= ID DOT ID ARROW STRING */ -{yymsp[-4].minor.yy0.n += (1+yymsp[-2].minor.yy0.n); tSqlExpr* S = tSqlExprCreateIdValue(pInfo, &yymsp[-4].minor.yy0, TK_ID); tSqlExpr* M = tSqlExprCreateIdValue(pInfo, &yymsp[0].minor.yy0, TK_STRING); yylhsminor.yy194 = tSqlExprCreate(S, M, TK_ARROW); } - yymsp[-4].minor.yy194 = yylhsminor.yy194; + case 293: /* expr ::= expr MATCH expr */ +{yylhsminor.yy378 = tSqlExprCreate(yymsp[-2].minor.yy378, yymsp[0].minor.yy378, TK_MATCH); } + yymsp[-2].minor.yy378 = yylhsminor.yy378; break; - case 294: /* expr ::= arrow */ - case 298: /* expritem ::= expr */ yytestcase(yyruleno==298); -{yylhsminor.yy194 = yymsp[0].minor.yy194;} - yymsp[0].minor.yy194 = yylhsminor.yy194; + case 294: /* expr ::= expr NMATCH expr */ +{yylhsminor.yy378 = tSqlExprCreate(yymsp[-2].minor.yy378, yymsp[0].minor.yy378, TK_NMATCH); } + yymsp[-2].minor.yy378 = yylhsminor.yy378; break; - case 295: /* expr ::= expr IN LP exprlist RP */ -{yylhsminor.yy194 = tSqlExprCreate(yymsp[-4].minor.yy194, (tSqlExpr*)yymsp[-1].minor.yy333, TK_IN); } - yymsp[-4].minor.yy194 = yylhsminor.yy194; + case 295: /* expr ::= ID CONTAINS STRING */ +{ tSqlExpr* S = tSqlExprCreateIdValue(pInfo, &yymsp[-2].minor.yy0, TK_ID); tSqlExpr* M = tSqlExprCreateIdValue(pInfo, &yymsp[0].minor.yy0, TK_STRING); yylhsminor.yy378 = tSqlExprCreate(S, M, TK_CONTAINS); } + yymsp[-2].minor.yy378 = yylhsminor.yy378; break; - case 296: /* exprlist ::= exprlist COMMA expritem */ -{yylhsminor.yy333 = tSqlExprListAppend(yymsp[-2].minor.yy333,yymsp[0].minor.yy194,0, 0);} - yymsp[-2].minor.yy333 = yylhsminor.yy333; + case 296: /* expr ::= ID DOT ID CONTAINS STRING */ +{ yymsp[-4].minor.yy0.n += (1+yymsp[-2].minor.yy0.n); tSqlExpr* S = tSqlExprCreateIdValue(pInfo, &yymsp[-4].minor.yy0, TK_ID); tSqlExpr* M = tSqlExprCreateIdValue(pInfo, &yymsp[0].minor.yy0, TK_STRING); yylhsminor.yy378 = tSqlExprCreate(S, M, TK_CONTAINS); } + yymsp[-4].minor.yy378 = yylhsminor.yy378; break; - case 297: /* exprlist ::= expritem */ -{yylhsminor.yy333 = tSqlExprListAppend(0,yymsp[0].minor.yy194,0, 0);} - yymsp[0].minor.yy333 = yylhsminor.yy333; + case 297: /* arrow ::= ID ARROW STRING */ +{tSqlExpr* S = tSqlExprCreateIdValue(pInfo, &yymsp[-2].minor.yy0, TK_ID); tSqlExpr* M = tSqlExprCreateIdValue(pInfo, &yymsp[0].minor.yy0, TK_STRING); yylhsminor.yy378 = tSqlExprCreate(S, M, TK_ARROW); } + yymsp[-2].minor.yy378 = yylhsminor.yy378; break; - case 300: /* cmd ::= RESET QUERY CACHE */ + case 298: /* arrow ::= ID DOT ID ARROW STRING */ +{yymsp[-4].minor.yy0.n += (1+yymsp[-2].minor.yy0.n); tSqlExpr* S = tSqlExprCreateIdValue(pInfo, &yymsp[-4].minor.yy0, TK_ID); tSqlExpr* M = tSqlExprCreateIdValue(pInfo, &yymsp[0].minor.yy0, TK_STRING); yylhsminor.yy378 = tSqlExprCreate(S, M, TK_ARROW); } + yymsp[-4].minor.yy378 = yylhsminor.yy378; + break; + case 299: /* expr ::= arrow */ + case 303: /* expritem ::= expr */ yytestcase(yyruleno==303); +{yylhsminor.yy378 = yymsp[0].minor.yy378;} + yymsp[0].minor.yy378 = yylhsminor.yy378; + break; + case 300: /* expr ::= expr IN LP exprlist RP */ +{yylhsminor.yy378 = tSqlExprCreate(yymsp[-4].minor.yy378, (tSqlExpr*)yymsp[-1].minor.yy367, TK_IN); } + yymsp[-4].minor.yy378 = yylhsminor.yy378; + break; + case 301: /* exprlist ::= exprlist COMMA expritem */ +{yylhsminor.yy367 = tSqlExprListAppend(yymsp[-2].minor.yy367,yymsp[0].minor.yy378,0, 0);} + yymsp[-2].minor.yy367 = yylhsminor.yy367; + break; + case 302: /* exprlist ::= expritem */ +{yylhsminor.yy367 = tSqlExprListAppend(0,yymsp[0].minor.yy378,0, 0);} + yymsp[0].minor.yy367 = yylhsminor.yy367; + break; + case 305: /* cmd ::= RESET QUERY CACHE */ { setDCLSqlElems(pInfo, TSDB_SQL_RESET_CACHE, 0);} break; - case 301: /* cmd ::= SYNCDB ids REPLICA */ + case 306: /* cmd ::= SYNCDB ids REPLICA */ { setDCLSqlElems(pInfo, TSDB_SQL_SYNC_DB_REPLICA, 1, &yymsp[-1].minor.yy0);} break; - case 302: /* cmd ::= ALTER TABLE ids cpxName ADD COLUMN columnlist */ + case 307: /* cmd ::= ALTER TABLE ids cpxName ADD COLUMN columnlist */ { yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n; - SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, yymsp[0].minor.yy333, NULL, TSDB_ALTER_TABLE_ADD_COLUMN, -1); + SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, yymsp[0].minor.yy367, NULL, TSDB_ALTER_TABLE_ADD_COLUMN, -1); setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); } break; - case 303: /* cmd ::= ALTER TABLE ids cpxName DROP COLUMN ids */ + case 308: /* cmd ::= ALTER TABLE ids cpxName DROP COLUMN ids */ { yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n; @@ -3387,21 +3431,21 @@ static void yy_reduce( setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); } break; - case 304: /* cmd ::= ALTER TABLE ids cpxName MODIFY COLUMN columnlist */ + case 309: /* cmd ::= ALTER TABLE ids cpxName MODIFY COLUMN columnlist */ { yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n; - SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, yymsp[0].minor.yy333, NULL, TSDB_ALTER_TABLE_CHANGE_COLUMN, -1); + SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, yymsp[0].minor.yy367, NULL, TSDB_ALTER_TABLE_CHANGE_COLUMN, -1); setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); } break; - case 305: /* cmd ::= ALTER TABLE ids cpxName ADD TAG columnlist */ + case 310: /* cmd ::= ALTER TABLE ids cpxName ADD TAG columnlist */ { yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n; - SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, yymsp[0].minor.yy333, NULL, TSDB_ALTER_TABLE_ADD_TAG_COLUMN, -1); + SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, yymsp[0].minor.yy367, NULL, TSDB_ALTER_TABLE_ADD_TAG_COLUMN, -1); setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); } break; - case 306: /* cmd ::= ALTER TABLE ids cpxName DROP TAG ids */ + case 311: /* cmd ::= ALTER TABLE ids cpxName DROP TAG ids */ { yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n; @@ -3412,7 +3456,7 @@ static void yy_reduce( setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); } break; - case 307: /* cmd ::= ALTER TABLE ids cpxName CHANGE TAG ids ids */ + case 312: /* cmd ::= ALTER TABLE ids cpxName CHANGE TAG ids ids */ { yymsp[-5].minor.yy0.n += yymsp[-4].minor.yy0.n; @@ -3426,33 +3470,33 @@ static void yy_reduce( setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); } break; - case 308: /* cmd ::= ALTER TABLE ids cpxName SET TAG ids EQ tagitem */ + case 313: /* 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, false); - A = tVariantListAppend(A, &yymsp[0].minor.yy42, -1); + A = tVariantListAppend(A, &yymsp[0].minor.yy410, -1); SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-6].minor.yy0, NULL, A, TSDB_ALTER_TABLE_UPDATE_TAG_VAL, -1); setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); } break; - case 309: /* cmd ::= ALTER TABLE ids cpxName MODIFY TAG columnlist */ + case 314: /* cmd ::= ALTER TABLE ids cpxName MODIFY TAG columnlist */ { yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n; - SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, yymsp[0].minor.yy333, NULL, TSDB_ALTER_TABLE_MODIFY_TAG_COLUMN, -1); + SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, yymsp[0].minor.yy367, NULL, TSDB_ALTER_TABLE_MODIFY_TAG_COLUMN, -1); setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); } break; - case 310: /* cmd ::= ALTER STABLE ids cpxName ADD COLUMN columnlist */ + case 315: /* cmd ::= ALTER STABLE ids cpxName ADD COLUMN columnlist */ { yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n; - SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, yymsp[0].minor.yy333, NULL, TSDB_ALTER_TABLE_ADD_COLUMN, TSDB_SUPER_TABLE); + SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, yymsp[0].minor.yy367, NULL, TSDB_ALTER_TABLE_ADD_COLUMN, TSDB_SUPER_TABLE); setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); } break; - case 311: /* cmd ::= ALTER STABLE ids cpxName DROP COLUMN ids */ + case 316: /* cmd ::= ALTER STABLE ids cpxName DROP COLUMN ids */ { yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n; @@ -3463,21 +3507,21 @@ static void yy_reduce( setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); } break; - case 312: /* cmd ::= ALTER STABLE ids cpxName MODIFY COLUMN columnlist */ + case 317: /* cmd ::= ALTER STABLE ids cpxName MODIFY COLUMN columnlist */ { yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n; - SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, yymsp[0].minor.yy333, NULL, TSDB_ALTER_TABLE_CHANGE_COLUMN, TSDB_SUPER_TABLE); + SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, yymsp[0].minor.yy367, NULL, TSDB_ALTER_TABLE_CHANGE_COLUMN, TSDB_SUPER_TABLE); setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); } break; - case 313: /* cmd ::= ALTER STABLE ids cpxName ADD TAG columnlist */ + case 318: /* cmd ::= ALTER STABLE ids cpxName ADD TAG columnlist */ { yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n; - SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, yymsp[0].minor.yy333, NULL, TSDB_ALTER_TABLE_ADD_TAG_COLUMN, TSDB_SUPER_TABLE); + SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, yymsp[0].minor.yy367, NULL, TSDB_ALTER_TABLE_ADD_TAG_COLUMN, TSDB_SUPER_TABLE); setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); } break; - case 314: /* cmd ::= ALTER STABLE ids cpxName DROP TAG ids */ + case 319: /* cmd ::= ALTER STABLE ids cpxName DROP TAG ids */ { yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n; @@ -3488,7 +3532,7 @@ static void yy_reduce( setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); } break; - case 315: /* cmd ::= ALTER STABLE ids cpxName CHANGE TAG ids ids */ + case 320: /* cmd ::= ALTER STABLE ids cpxName CHANGE TAG ids ids */ { yymsp[-5].minor.yy0.n += yymsp[-4].minor.yy0.n; @@ -3502,38 +3546,38 @@ static void yy_reduce( setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); } break; - case 316: /* cmd ::= ALTER STABLE ids cpxName SET TAG ids EQ tagitem */ + case 321: /* cmd ::= ALTER STABLE 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, false); - A = tVariantListAppend(A, &yymsp[0].minor.yy42, -1); + A = tVariantListAppend(A, &yymsp[0].minor.yy410, -1); SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-6].minor.yy0, NULL, A, TSDB_ALTER_TABLE_UPDATE_TAG_VAL, TSDB_SUPER_TABLE); setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); } break; - case 317: /* cmd ::= ALTER STABLE ids cpxName MODIFY TAG columnlist */ + case 322: /* cmd ::= ALTER STABLE ids cpxName MODIFY TAG columnlist */ { yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n; - SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, yymsp[0].minor.yy333, NULL, TSDB_ALTER_TABLE_MODIFY_TAG_COLUMN, TSDB_SUPER_TABLE); + SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, yymsp[0].minor.yy367, NULL, TSDB_ALTER_TABLE_MODIFY_TAG_COLUMN, TSDB_SUPER_TABLE); setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); } break; - case 318: /* cmd ::= KILL CONNECTION INTEGER */ + case 323: /* cmd ::= KILL CONNECTION INTEGER */ {setKillSql(pInfo, TSDB_SQL_KILL_CONNECTION, &yymsp[0].minor.yy0);} break; - case 319: /* cmd ::= KILL STREAM INTEGER COLON INTEGER */ + case 324: /* 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 320: /* cmd ::= KILL QUERY INTEGER COLON INTEGER */ + case 325: /* 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; - case 321: /* cmd ::= DELETE FROM ifexists ids cpxName where_opt */ + case 326: /* cmd ::= DELETE FROM ifexists ids cpxName where_opt */ { yymsp[-2].minor.yy0.n += yymsp[-1].minor.yy0.n; - SDelData * pDelData = tGetDelData(&yymsp[-2].minor.yy0, &yymsp[-3].minor.yy0, yymsp[0].minor.yy194); + SDelData * pDelData = tGetDelData(&yymsp[-2].minor.yy0, &yymsp[-3].minor.yy0, yymsp[0].minor.yy378); setSqlInfo(pInfo, pDelData, NULL, TSDB_SQL_DELETE_DATA); } break; diff --git a/src/tsdb/src/tsdbRead.c b/src/tsdb/src/tsdbRead.c index 8fd22e44d2..56e215e0b2 100644 --- a/src/tsdb/src/tsdbRead.c +++ b/src/tsdb/src/tsdbRead.c @@ -156,7 +156,7 @@ typedef struct STsdbQueryHandle { SArray *prev; // previous row which is before than time window SArray *next; // next row which is after the query time window SIOCostSummary cost; - + // callback readover_callback readover_cb; void* param; @@ -173,6 +173,11 @@ typedef struct SRange { int32_t to; } SRange; +typedef struct STagBlockInfo { + SSkipListNode *pSkipListNode; + SArray *pBlock; +} STagBlockInfo; + static STimeWindow updateLastrowForEachGroup(STableGroupInfo *groupList); static int32_t checkForCachedLastRow(STsdbQueryHandle* pQueryHandle, STableGroupInfo *groupList); static int32_t checkForCachedLast(STsdbQueryHandle* pQueryHandle); @@ -4333,7 +4338,15 @@ static FORCE_INLINE int32_t tsdbGetTagDataFromId(void *param, int32_t id, void * return TSDB_CODE_SUCCESS; } - +static FORCE_INLINE int32_t tsdbGetTagData(void *param, int32_t id, void **data) { + STagBlockInfo* pInfo = (STagBlockInfo*) param; + if (id == INT32_MAX) { + *data = pInfo->pBlock; + } else { + return tsdbGetTagDataFromId(pInfo->pSkipListNode, id, data); + } + return TSDB_CODE_SUCCESS; +} static void queryIndexedColumn(SSkipList* pSkipList, void* filterInfo, SArray* res) { SSkipListIterator* iter = NULL; @@ -4388,26 +4401,77 @@ static void queryIndexedColumn(SSkipList* pSkipList, void* filterInfo, SArray* r tsdbDebug("filter index column end"); } +static void getAllExprColId(tExprNode* pExpr, SArray* array) { + if (!pExpr) { + return; + } + if (pExpr->nodeType == TSQL_NODE_FUNC) { + for (int32_t i = 0; i < pExpr->_func.numChildren; ++i) { + getAllExprColId(pExpr->_func.pChildren[i], array); + } + } else if (pExpr->nodeType == TSQL_NODE_EXPR) { + getAllExprColId(pExpr->_node.pLeft, array); + getAllExprColId(pExpr->_node.pRight, array); + } else if (pExpr->nodeType == TSQL_NODE_COL) { + taosArrayPush(array, &pExpr->pSchema->colId); + } +} + +static void getAllFilterExprColId(SFilterFields* pSf, SArray* array) { + for (uint32_t i = 0; i < pSf->num; ++i) { + SFilterField* fi = &(pSf->fields[i]); + if (FILTER_GET_TYPE(fi->flag) == FLD_TYPE_EXPR) { + getAllExprColId(fi->desc, array); + } + } + taosArraySort(array, getComparFunc(TSDB_DATA_TYPE_SMALLINT, 0)); + taosArrayRemoveDuplicate(array, getComparFunc(TSDB_DATA_TYPE_SMALLINT, 0), NULL); +} + static void queryIndexlessColumn(SSkipList* pSkipList, void* filterInfo, SArray* res) { SSkipListIterator* iter = tSkipListCreateIter(pSkipList); int8_t *addToResult = NULL; + SFilterInfo *sfInfo = (SFilterInfo *)filterInfo; + SArray *array = NULL; + SArray *pDataBlock = NULL; + if (sfInfo->fields[FLD_TYPE_EXPR].num > 0) { + array = taosArrayInit(10, sizeof(int16_t)); + getAllFilterExprColId(&(sfInfo->fields[FLD_TYPE_EXPR]), array); + } while (tSkipListIterNext(iter)) { SSkipListNode *pNode = tSkipListIterGet(iter); - filterSetColFieldData(filterInfo, pNode, tsdbGetTagDataFromId); - char *pData = SL_GET_NODE_DATA(pNode); + if (sfInfo->fields[FLD_TYPE_EXPR].num > 0) { + pDataBlock = taosArrayInit(10, sizeof(SColumnInfoData)); + size_t num = taosArrayGetSize(array); + for(int32_t i = 0; i < num; ++i) { + int16_t *pColId = taosArrayGet(array, i); + void *data = NULL; + tsdbGetTagDataFromId(pNode, *pColId, &data); + SColumnInfoData colData = {{0}}; + colData.pData = data; + colData.info.colId = *pColId; + taosArrayPush(pDataBlock, &colData); + } + } + STagBlockInfo stInfo = {.pSkipListNode = pNode, .pBlock = pDataBlock}; + filterSetColFieldData(filterInfo, &stInfo, tsdbGetTagData); - bool all = filterExecute(filterInfo, 1, &addToResult, NULL, 0); + char *pData = SL_GET_NODE_DATA(pNode); + int16_t numOfCols = array ? (int16_t)taosArrayGetSize(array) : 0; + bool all = filterExecute(filterInfo, 1, &addToResult, NULL, numOfCols); if (all || (addToResult && *addToResult)) { STableKeyInfo info = {.pTable = (void*)pData, .lastKey = TSKEY_INITIAL_VAL}; taosArrayPush(res, &info); } + taosArrayDestroy(&pDataBlock); } + taosArrayDestroy(&array); tfree(addToResult); tSkipListDestroyIter(iter); @@ -4696,4 +4760,4 @@ void tsdbAddScanCallback(TsdbQueryHandleT* queryHandle, readover_callback callba int32_t tsdbTableTid(void* pTable) { STable *p = (STable *)pTable; return p->tableId.tid; -} \ No newline at end of file +} diff --git a/src/util/src/ttokenizer.c b/src/util/src/ttokenizer.c index d97e3b7990..af6654d7e8 100644 --- a/src/util/src/ttokenizer.c +++ b/src/util/src/ttokenizer.c @@ -58,6 +58,7 @@ static SKeyword keywordTable[] = { {"IN", TK_IN}, {"BITAND", TK_BITAND}, {"BITOR", TK_BITOR}, + {"BITXOR", TK_BITXOR}, {"LSHIFT", TK_LSHIFT}, {"RSHIFT", TK_RSHIFT}, {"PLUS", TK_PLUS}, @@ -411,6 +412,10 @@ uint32_t tGetToken(char* z, uint32_t* tokenId) { *tokenId = TK_BITNOT; return 1; } + case '^': { + *tokenId = TK_BITXOR; + return 1; + } case '?': { *tokenId = TK_QUESTION; return 1; -- GitLab