diff --git a/src/client/src/tscPrepare.c b/src/client/src/tscPrepare.c index a8aea1c8d3f4d4923ab648c1918da36d410edfa0..89d915a813f67915bf4e2210a9eacb8515c54f54 100644 --- a/src/client/src/tscPrepare.c +++ b/src/client/src/tscPrepare.c @@ -951,7 +951,10 @@ static int insertStmtBindParamBatch(STscStmt* stmt, TAOS_MULTI_BIND* bind, int c } } - assert(colIdx == -1 || (colIdx >= 0 && colIdx < pBlock->numOfParams)); + if (!(colIdx == -1 || (colIdx >= 0 && colIdx < pBlock->numOfParams))) { + tscError("0x%"PRIx64" invalid colIdx:%d", pStmt->pSql->self, colIdx); + return invalidOperationMsg(tscGetErrorMsgPayload(&stmt->pSql->cmd), "invalid param colIdx"); + } uint32_t totalDataSize = sizeof(SSubmitBlk) + (pCmd->batchSize + rowNum) * pBlock->rowSize; if (totalDataSize > pBlock->nAllocSize) { @@ -1462,6 +1465,11 @@ int taos_stmt_prepare(TAOS_STMT* stmt, const char* sql, unsigned long length) { STMT_RET(TSDB_CODE_TSC_DISCONNECTED); } + if (sql == NULL) { + tscError("sql is NULL"); + STMT_RET(invalidOperationMsg(tscGetErrorMsgPayload(&pStmt->pSql->cmd), "sql is NULL")); + } + if (pStmt->last != STMT_INIT) { tscError("prepare status error, last:%d", pStmt->last); STMT_RET(invalidOperationMsg(tscGetErrorMsgPayload(&pStmt->pSql->cmd), "prepare status error")); @@ -1736,7 +1744,7 @@ int taos_stmt_bind_single_param_batch(TAOS_STMT* stmt, TAOS_MULTI_BIND* bind, in STMT_RET(TSDB_CODE_TSC_DISCONNECTED); } - if (bind == NULL || bind->num <= 0 || bind->num > INT16_MAX) { + if (bind == NULL || bind->num <= 0 || bind->num > INT16_MAX || colIdx < 0) { tscError("0x%"PRIx64" invalid parameter", pStmt->pSql->self); STMT_RET(invalidOperationMsg(tscGetErrorMsgPayload(&pStmt->pSql->cmd), "invalid bind param")); } diff --git a/src/client/src/tscSQLParser.c b/src/client/src/tscSQLParser.c index 8d51ffc5774c4e1b3ee3eec539a6f646e657404b..8c14394219bc9bcfdf4dca82f7547d1e2a5f031f 100644 --- a/src/client/src/tscSQLParser.c +++ b/src/client/src/tscSQLParser.c @@ -111,6 +111,7 @@ static int32_t validateDNodeConfig(SMiscInfo* pOptions); static int32_t validateLocalConfig(SMiscInfo* pOptions); static int32_t validateColumnName(char* name); static int32_t setKillInfo(SSqlObj* pSql, struct SSqlInfo* pInfo, int32_t killType); +static int32_t setCompactVnodeInfo(SSqlObj* pSql, struct SSqlInfo* pInfo); static bool validateOneTags(SSqlCmd* pCmd, TAOS_FIELD* pTagField); static bool hasTimestampForPointInterpQuery(SQueryInfo* pQueryInfo); @@ -506,7 +507,7 @@ int32_t tscValidateSqlInfo(SSqlObj* pSql, struct SSqlInfo* pInfo) { break; } - + case TSDB_SQL_CREATE_DNODE: { const char* msg = "invalid host name (ip address)"; @@ -802,7 +803,13 @@ int32_t tscValidateSqlInfo(SSqlObj* pSql, struct SSqlInfo* pInfo) { } break; } - + case TSDB_SQL_COMPACT_VNODE:{ + const char* msg = "invalid compact"; + if (setCompactVnodeInfo(pSql, pInfo) != TSDB_CODE_SUCCESS) { + return invalidOperationMsg(tscGetErrorMsgPayload(pCmd), msg); + } + break; + } default: return invalidOperationMsg(tscGetErrorMsgPayload(pCmd), "not support sql expression"); } @@ -2963,7 +2970,12 @@ int32_t setKillInfo(SSqlObj* pSql, struct SSqlInfo* pInfo, int32_t killType) { return TSDB_CODE_SUCCESS; } - +static int32_t setCompactVnodeInfo(SSqlObj* pSql, struct SSqlInfo* pInfo) { + SSqlCmd* pCmd = &pSql->cmd; + pCmd->command = pInfo->type; + + return TSDB_CODE_SUCCESS; +} bool validateIpAddress(const char* ip, size_t size) { char tmp[128] = {0}; // buffer to build null-terminated string assert(size < 128); @@ -4881,7 +4893,10 @@ int32_t getTimeRange(STimeWindow* win, tSqlExpr* pRight, int32_t optr, int16_t t win->skey = val; } else if (optr == TK_EQ) { win->ekey = win->skey = val; + } else if (optr == TK_NE) { + return TSDB_CODE_TSC_INVALID_OPERATION; } + return TSDB_CODE_SUCCESS; } diff --git a/src/client/src/tscServer.c b/src/client/src/tscServer.c index b4c7a64fd0e566bd323d9c5f44507f849900b9c7..8c5e99474da66062004f460ce5915d8157b8a7d6 100644 --- a/src/client/src/tscServer.c +++ b/src/client/src/tscServer.c @@ -47,6 +47,31 @@ static int32_t getWaitingTimeInterval(int32_t count) { return initial * ((2u)<<(count - 2)); } +static int32_t vgIdCompare(const void *lhs, const void *rhs) { + int32_t left = *(int32_t *)lhs; + int32_t right = *(int32_t *)rhs; + + if (left == right) { + return 0; + } else { + return left > right ? 1 : -1; + } +} +static int32_t removeDupVgid(int32_t *src, int32_t sz) { + if (src == NULL || sz <= 0) { + return 0; + } + qsort(src, sz, sizeof(src[0]), vgIdCompare); + + int32_t ret = 1; + for (int i = 1; i < sz; i++) { + if (src[i] != src[i - 1]) { + src[ret++] = src[i]; + } + } + return ret; +} + static void tscSetDnodeEpSet(SRpcEpSet* pEpSet, SVgroupInfo* pVgroupInfo) { assert(pEpSet != NULL && pVgroupInfo != NULL && pVgroupInfo->numOfEps > 0); @@ -1515,6 +1540,60 @@ int tscAlterDbMsg(SSqlObj *pSql, SSqlInfo *pInfo) { return TSDB_CODE_SUCCESS; } +int tscBuildCompactMsg(SSqlObj *pSql, SSqlInfo *pInfo) { + if (pInfo->list == NULL || taosArrayGetSize(pInfo->list) <= 0) { + return TSDB_CODE_TSC_INVALID_OPERATION; + } + STscObj *pObj = pSql->pTscObj; + SSqlCmd *pCmd = &pSql->cmd; + SArray *pList = pInfo->list; + int32_t size = (int32_t)taosArrayGetSize(pList); + + int32_t *result = malloc(sizeof(int32_t) * size); + if (result == NULL) { + return TSDB_CODE_TSC_OUT_OF_MEMORY; + } + + for (int32_t i = 0; i < size; i++) { + tSqlExprItem* pSub = taosArrayGet(pList, i); + tVariant* pVar = &pSub->pNode->value; + if (pVar->nType >= TSDB_DATA_TYPE_TINYINT && pVar->nType <= TSDB_DATA_TYPE_BIGINT) { + result[i] = (int32_t)(pVar->i64); + } else { + free(result); + return TSDB_CODE_TSC_INVALID_OPERATION; + } + } + + int count = removeDupVgid(result, size); + pCmd->payloadLen = sizeof(SCompactMsg) + count * sizeof(int32_t); + pCmd->msgType = TSDB_MSG_TYPE_CM_COMPACT_VNODE; + + if (TSDB_CODE_SUCCESS != tscAllocPayload(pCmd, pCmd->payloadLen)) { + tscError("0x%"PRIx64" failed to malloc for query msg", pSql->self); + free(result); + return TSDB_CODE_TSC_OUT_OF_MEMORY; + } + SCompactMsg *pCompactMsg = (SCompactMsg *)pCmd->payload; + + STableMetaInfo *pTableMetaInfo = tscGetTableMetaInfoFromCmd(pCmd, 0); + + if (tNameIsEmpty(&pTableMetaInfo->name)) { + pthread_mutex_lock(&pObj->mutex); + tstrncpy(pCompactMsg->db, pObj->db, sizeof(pCompactMsg->db)); + pthread_mutex_unlock(&pObj->mutex); + } else { + tNameGetFullDbName(&pTableMetaInfo->name, pCompactMsg->db); + } + + pCompactMsg->numOfVgroup = htons(count); + for (int32_t i = 0; i < count; i++) { + pCompactMsg->vgid[i] = htons(result[i]); + } + free(result); + + return TSDB_CODE_SUCCESS; +} int tscBuildRetrieveFromMgmtMsg(SSqlObj *pSql, SSqlInfo *pInfo) { SSqlCmd *pCmd = &pSql->cmd; @@ -2268,6 +2347,10 @@ int tscProcessAlterDbMsgRsp(SSqlObj *pSql) { UNUSED(pSql); return 0; } +int tscProcessCompactRsp(SSqlObj *pSql) { + UNUSED(pSql); + return TSDB_CODE_SUCCESS; +} int tscProcessShowCreateRsp(SSqlObj *pSql) { return tscLocalResultCommonBuilder(pSql, 1); @@ -2654,6 +2737,7 @@ void tscInitMsgsFp() { tscBuildMsg[TSDB_SQL_ALTER_TABLE] = tscBuildAlterTableMsg; tscBuildMsg[TSDB_SQL_UPDATE_TAGS_VAL] = tscBuildUpdateTagMsg; tscBuildMsg[TSDB_SQL_ALTER_DB] = tscAlterDbMsg; + tscBuildMsg[TSDB_SQL_COMPACT_VNODE] = tscBuildCompactMsg; tscBuildMsg[TSDB_SQL_CONNECT] = tscBuildConnectMsg; tscBuildMsg[TSDB_SQL_USE_DB] = tscBuildUseDbMsg; @@ -2694,6 +2778,7 @@ void tscInitMsgsFp() { tscProcessMsgRsp[TSDB_SQL_ALTER_TABLE] = tscProcessAlterTableMsgRsp; tscProcessMsgRsp[TSDB_SQL_ALTER_DB] = tscProcessAlterDbMsgRsp; + tscProcessMsgRsp[TSDB_SQL_COMPACT_VNODE] = tscProcessCompactRsp; tscProcessMsgRsp[TSDB_SQL_SHOW_CREATE_TABLE] = tscProcessShowCreateRsp; tscProcessMsgRsp[TSDB_SQL_SHOW_CREATE_STABLE] = tscProcessShowCreateRsp; diff --git a/src/client/src/tscSubquery.c b/src/client/src/tscSubquery.c index 49ce73854520aa95249d9f42590acd36d83bb523..e7f0606db2ad1bcfbb257d79f016e91e87a8e787 100644 --- a/src/client/src/tscSubquery.c +++ b/src/client/src/tscSubquery.c @@ -3152,6 +3152,13 @@ int32_t tscHandleMultivnodeInsert(SSqlObj *pSql) { // it is the failure retry insert if (pSql->pSubs != NULL) { + int32_t blockNum = (int32_t)taosArrayGetSize(pCmd->insertParam.pDataBlocks); + if (pSql->subState.numOfSub != blockNum) { + tscError("0x%"PRIx64" sub num:%d is not same with data block num:%d", pSql->self, pSql->subState.numOfSub, blockNum); + pRes->code = TSDB_CODE_TSC_APP_ERROR; + return pRes->code; + } + for(int32_t i = 0; i < pSql->subState.numOfSub; ++i) { SSqlObj* pSub = pSql->pSubs[i]; SInsertSupporter* pSup = calloc(1, sizeof(SInsertSupporter)); diff --git a/src/common/inc/tcmdtype.h b/src/common/inc/tcmdtype.h index 90426519e66682ab9d5fab16a3a38e827a7d97df..4331ddbf8923ee758ebaf3116740db8e24df29a9 100644 --- a/src/common/inc/tcmdtype.h +++ b/src/common/inc/tcmdtype.h @@ -51,6 +51,7 @@ enum { TSDB_DEFINE_SQL_TYPE( TSDB_SQL_ALTER_ACCT, "alter-acct" ) TSDB_DEFINE_SQL_TYPE( TSDB_SQL_ALTER_TABLE, "alter-table" ) TSDB_DEFINE_SQL_TYPE( TSDB_SQL_ALTER_DB, "alter-db" ) + TSDB_DEFINE_SQL_TYPE(TSDB_SQL_SYNC_DB_REPLICA, "sync db-replica") TSDB_DEFINE_SQL_TYPE( TSDB_SQL_CREATE_MNODE, "create-mnode" ) TSDB_DEFINE_SQL_TYPE( TSDB_SQL_DROP_MNODE, "drop-mnode" ) @@ -63,6 +64,7 @@ enum { TSDB_DEFINE_SQL_TYPE( TSDB_SQL_KILL_QUERY, "kill-query" ) TSDB_DEFINE_SQL_TYPE( TSDB_SQL_KILL_STREAM, "kill-stream" ) TSDB_DEFINE_SQL_TYPE( TSDB_SQL_KILL_CONNECTION, "kill-connection" ) + TSDB_DEFINE_SQL_TYPE( TSDB_SQL_COMPACT_VNODE, "compact-vnode" ) // SQL below is for read operation TSDB_DEFINE_SQL_TYPE( TSDB_SQL_READ, "read" ) diff --git a/src/dnode/src/dnodePeer.c b/src/dnode/src/dnodePeer.c index b8ce1c802b2475a8aab76a6bb7f0264d2c9b39a0..08269c0bf6141974366936660bee326682cd90f5 100644 --- a/src/dnode/src/dnodePeer.c +++ b/src/dnode/src/dnodePeer.c @@ -47,7 +47,8 @@ int32_t dnodeInitServer() { dnodeProcessReqMsgFp[TSDB_MSG_TYPE_MD_DROP_VNODE] = dnodeDispatchToVMgmtQueue; dnodeProcessReqMsgFp[TSDB_MSG_TYPE_MD_ALTER_STREAM] = dnodeDispatchToVMgmtQueue; dnodeProcessReqMsgFp[TSDB_MSG_TYPE_MD_CONFIG_DNODE] = dnodeDispatchToVMgmtQueue; - dnodeProcessReqMsgFp[TSDB_MSG_TYPE_MD_CREATE_MNODE] = dnodeDispatchToVMgmtQueue; + dnodeProcessReqMsgFp[TSDB_MSG_TYPE_MD_CREATE_MNODE] = dnodeDispatchToVMgmtQueue; + dnodeProcessReqMsgFp[TSDB_MSG_TYPE_MD_COMPACT_VNODE] = dnodeDispatchToVMgmtQueue; dnodeProcessReqMsgFp[TSDB_MSG_TYPE_DM_CONFIG_TABLE] = dnodeDispatchToMPeerQueue; dnodeProcessReqMsgFp[TSDB_MSG_TYPE_DM_CONFIG_VNODE] = dnodeDispatchToMPeerQueue; diff --git a/src/dnode/src/dnodeShell.c b/src/dnode/src/dnodeShell.c index 50343cfd32405d5408cc9d6c5e939db30bf9b832..c80e1059b40b08b9eb592dc150974bef9746a1a9 100644 --- a/src/dnode/src/dnodeShell.c +++ b/src/dnode/src/dnodeShell.c @@ -61,6 +61,7 @@ int32_t dnodeInitShell() { dnodeProcessShellMsgFp[TSDB_MSG_TYPE_CM_KILL_STREAM] = dnodeDispatchToMWriteQueue; dnodeProcessShellMsgFp[TSDB_MSG_TYPE_CM_KILL_CONN] = dnodeDispatchToMWriteQueue; dnodeProcessShellMsgFp[TSDB_MSG_TYPE_CM_CONFIG_DNODE]= dnodeDispatchToMWriteQueue; + dnodeProcessShellMsgFp[TSDB_MSG_TYPE_CM_COMPACT_VNODE]= dnodeDispatchToMWriteQueue; // the following message shall be treated as mnode query dnodeProcessShellMsgFp[TSDB_MSG_TYPE_CM_HEARTBEAT] = dnodeDispatchToMReadQueue; diff --git a/src/dnode/src/dnodeVMgmt.c b/src/dnode/src/dnodeVMgmt.c index ef99e70bd112494e4735b532396f925106cba5e2..90bae8b9dd73ca80efab8090d5a189cf8c1a8966 100644 --- a/src/dnode/src/dnodeVMgmt.c +++ b/src/dnode/src/dnodeVMgmt.c @@ -31,6 +31,7 @@ static void * dnodeProcessMgmtQueue(void *param); static int32_t dnodeProcessCreateVnodeMsg(SRpcMsg *pMsg); static int32_t dnodeProcessAlterVnodeMsg(SRpcMsg *pMsg); static int32_t dnodeProcessSyncVnodeMsg(SRpcMsg *pMsg); +static int32_t dnodeProcessCompactVnodeMsg(SRpcMsg *pMsg); static int32_t dnodeProcessDropVnodeMsg(SRpcMsg *pMsg); static int32_t dnodeProcessAlterStreamMsg(SRpcMsg *pMsg); static int32_t dnodeProcessConfigDnodeMsg(SRpcMsg *pMsg); @@ -40,7 +41,8 @@ static int32_t (*dnodeProcessMgmtMsgFp[TSDB_MSG_TYPE_MAX])(SRpcMsg *pMsg); int32_t dnodeInitVMgmt() { dnodeProcessMgmtMsgFp[TSDB_MSG_TYPE_MD_CREATE_VNODE] = dnodeProcessCreateVnodeMsg; dnodeProcessMgmtMsgFp[TSDB_MSG_TYPE_MD_ALTER_VNODE] = dnodeProcessAlterVnodeMsg; - dnodeProcessMgmtMsgFp[TSDB_MSG_TYPE_MD_SYNC_VNODE] = dnodeProcessSyncVnodeMsg; + dnodeProcessMgmtMsgFp[TSDB_MSG_TYPE_MD_SYNC_VNODE] = dnodeProcessSyncVnodeMsg; + dnodeProcessMgmtMsgFp[TSDB_MSG_TYPE_MD_COMPACT_VNODE]= dnodeProcessCompactVnodeMsg; dnodeProcessMgmtMsgFp[TSDB_MSG_TYPE_MD_DROP_VNODE] = dnodeProcessDropVnodeMsg; dnodeProcessMgmtMsgFp[TSDB_MSG_TYPE_MD_ALTER_STREAM] = dnodeProcessAlterStreamMsg; dnodeProcessMgmtMsgFp[TSDB_MSG_TYPE_MD_CONFIG_DNODE] = dnodeProcessConfigDnodeMsg; @@ -187,6 +189,12 @@ static int32_t dnodeProcessSyncVnodeMsg(SRpcMsg *rpcMsg) { return vnodeSync(pSyncVnode->vgId); } +static int32_t dnodeProcessCompactVnodeMsg(SRpcMsg *rpcMsg) { + SCompactVnodeMsg *pCompactVnode = rpcMsg->pCont; + pCompactVnode->vgId = htonl(pCompactVnode->vgId); + return vnodeCompact(pCompactVnode->vgId); +} + static int32_t dnodeProcessDropVnodeMsg(SRpcMsg *rpcMsg) { SDropVnodeMsg *pDrop = rpcMsg->pCont; pDrop->vgId = htonl(pDrop->vgId); diff --git a/src/inc/taosmsg.h b/src/inc/taosmsg.h index c7fe64974898937669549599994ddc643ee4d9b0..61e1e88c13fdced4c172b4c276067ff398b5f70b 100644 --- a/src/inc/taosmsg.h +++ b/src/inc/taosmsg.h @@ -61,9 +61,11 @@ TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_MD_CONFIG_DNODE, "config-dnode" ) TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_MD_ALTER_VNODE, "alter-vnode" ) TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_MD_SYNC_VNODE, "sync-vnode" ) TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_MD_CREATE_MNODE, "create-mnode" ) +TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_MD_COMPACT_VNODE, "compact-vnode" ) TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_DUMMY6, "dummy6" ) TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_DUMMY7, "dummy7" ) + // message from client to mnode TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CM_CONNECT, "connect" ) TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CM_CREATE_ACCT, "create-acct" ) @@ -84,6 +86,7 @@ TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CM_DROP_TABLE, "drop-table" ) TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CM_ALTER_TABLE, "alter-table" ) TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CM_TABLE_META, "table-meta" ) TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CM_STABLE_VGROUP, "stable-vgroup" ) +TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CM_COMPACT_VNODE, "compact-vnode" ) TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CM_TABLES_META, "multiTable-meta" ) TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CM_ALTER_STREAM, "alter-stream" ) TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_CM_SHOW, "show" ) @@ -393,7 +396,7 @@ typedef struct { typedef struct { int32_t vgId; -} SDropVnodeMsg, SSyncVnodeMsg; +} SDropVnodeMsg, SSyncVnodeMsg, SCompactVnodeMsg; typedef struct SColIndex { int16_t colId; // column id @@ -539,7 +542,7 @@ typedef struct { uint8_t status; uint8_t role; uint8_t replica; - uint8_t reserved; + uint8_t compact; } SVnodeLoad; typedef struct { @@ -781,6 +784,12 @@ typedef struct { char payload[]; } SShowMsg; +typedef struct { + char db[TSDB_ACCT_ID_LEN + TSDB_DB_NAME_LEN]; + int32_t numOfVgroup; + int32_t vgid[]; +} SCompactMsg; + typedef struct SShowRsp { uint64_t qhandle; STableMetaMsg tableMeta; diff --git a/src/inc/ttokendef.h b/src/inc/ttokendef.h index 1b9094819bc52b911d03db6d8a27f5e8e53213b9..82ef85992487019ee177d965ccdbe389062da505 100644 --- a/src/inc/ttokendef.h +++ b/src/inc/ttokendef.h @@ -94,116 +94,117 @@ #define TK_PASS 76 #define TK_PRIVILEGE 77 #define TK_LOCAL 78 -#define TK_IF 79 -#define TK_EXISTS 80 -#define TK_PPS 81 -#define TK_TSERIES 82 -#define TK_DBS 83 -#define TK_STORAGE 84 -#define TK_QTIME 85 -#define TK_CONNS 86 -#define TK_STATE 87 -#define TK_COMMA 88 -#define TK_KEEP 89 -#define TK_CACHE 90 -#define TK_REPLICA 91 -#define TK_QUORUM 92 -#define TK_DAYS 93 -#define TK_MINROWS 94 -#define TK_MAXROWS 95 -#define TK_BLOCKS 96 -#define TK_CTIME 97 -#define TK_WAL 98 -#define TK_FSYNC 99 -#define TK_COMP 100 -#define TK_PRECISION 101 -#define TK_UPDATE 102 -#define TK_CACHELAST 103 -#define TK_PARTITIONS 104 -#define TK_LP 105 -#define TK_RP 106 -#define TK_UNSIGNED 107 -#define TK_TAGS 108 -#define TK_USING 109 -#define TK_AS 110 -#define TK_NULL 111 -#define TK_NOW 112 -#define TK_SELECT 113 -#define TK_UNION 114 -#define TK_ALL 115 -#define TK_DISTINCT 116 -#define TK_FROM 117 -#define TK_VARIABLE 118 -#define TK_INTERVAL 119 -#define TK_SESSION 120 -#define TK_STATE_WINDOW 121 -#define TK_FILL 122 -#define TK_SLIDING 123 -#define TK_ORDER 124 -#define TK_BY 125 -#define TK_ASC 126 -#define TK_DESC 127 -#define TK_GROUP 128 -#define TK_HAVING 129 -#define TK_LIMIT 130 -#define TK_OFFSET 131 -#define TK_SLIMIT 132 -#define TK_SOFFSET 133 -#define TK_WHERE 134 -#define TK_RESET 135 -#define TK_QUERY 136 -#define TK_SYNCDB 137 -#define TK_ADD 138 -#define TK_COLUMN 139 -#define TK_MODIFY 140 -#define TK_TAG 141 -#define TK_CHANGE 142 -#define TK_SET 143 -#define TK_KILL 144 -#define TK_CONNECTION 145 -#define TK_STREAM 146 -#define TK_COLON 147 -#define TK_ABORT 148 -#define TK_AFTER 149 -#define TK_ATTACH 150 -#define TK_BEFORE 151 -#define TK_BEGIN 152 -#define TK_CASCADE 153 -#define TK_CLUSTER 154 -#define TK_CONFLICT 155 -#define TK_COPY 156 -#define TK_DEFERRED 157 -#define TK_DELIMITERS 158 -#define TK_DETACH 159 -#define TK_EACH 160 -#define TK_END 161 -#define TK_EXPLAIN 162 -#define TK_FAIL 163 -#define TK_FOR 164 -#define TK_IGNORE 165 -#define TK_IMMEDIATE 166 -#define TK_INITIALLY 167 -#define TK_INSTEAD 168 -#define TK_MATCH 169 -#define TK_KEY 170 -#define TK_OF 171 -#define TK_RAISE 172 -#define TK_REPLACE 173 -#define TK_RESTRICT 174 -#define TK_ROW 175 -#define TK_STATEMENT 176 -#define TK_TRIGGER 177 -#define TK_VIEW 178 -#define TK_SEMI 179 -#define TK_NONE 180 -#define TK_PREV 181 -#define TK_LINEAR 182 -#define TK_IMPORT 183 -#define TK_TBNAME 184 -#define TK_JOIN 185 -#define TK_INSERT 186 -#define TK_INTO 187 -#define TK_VALUES 188 +#define TK_COMPACT 79 +#define TK_LP 80 +#define TK_RP 81 +#define TK_IF 82 +#define TK_EXISTS 83 +#define TK_PPS 84 +#define TK_TSERIES 85 +#define TK_DBS 86 +#define TK_STORAGE 87 +#define TK_QTIME 88 +#define TK_CONNS 89 +#define TK_STATE 90 +#define TK_COMMA 91 +#define TK_KEEP 92 +#define TK_CACHE 93 +#define TK_REPLICA 94 +#define TK_QUORUM 95 +#define TK_DAYS 96 +#define TK_MINROWS 97 +#define TK_MAXROWS 98 +#define TK_BLOCKS 99 +#define TK_CTIME 100 +#define TK_WAL 101 +#define TK_FSYNC 102 +#define TK_COMP 103 +#define TK_PRECISION 104 +#define TK_UPDATE 105 +#define TK_CACHELAST 106 +#define TK_PARTITIONS 107 +#define TK_UNSIGNED 108 +#define TK_TAGS 109 +#define TK_USING 110 +#define TK_AS 111 +#define TK_NULL 112 +#define TK_NOW 113 +#define TK_SELECT 114 +#define TK_UNION 115 +#define TK_ALL 116 +#define TK_DISTINCT 117 +#define TK_FROM 118 +#define TK_VARIABLE 119 +#define TK_INTERVAL 120 +#define TK_SESSION 121 +#define TK_STATE_WINDOW 122 +#define TK_FILL 123 +#define TK_SLIDING 124 +#define TK_ORDER 125 +#define TK_BY 126 +#define TK_ASC 127 +#define TK_DESC 128 +#define TK_GROUP 129 +#define TK_HAVING 130 +#define TK_LIMIT 131 +#define TK_OFFSET 132 +#define TK_SLIMIT 133 +#define TK_SOFFSET 134 +#define TK_WHERE 135 +#define TK_RESET 136 +#define TK_QUERY 137 +#define TK_SYNCDB 138 +#define TK_ADD 139 +#define TK_COLUMN 140 +#define TK_MODIFY 141 +#define TK_TAG 142 +#define TK_CHANGE 143 +#define TK_SET 144 +#define TK_KILL 145 +#define TK_CONNECTION 146 +#define TK_STREAM 147 +#define TK_COLON 148 +#define TK_ABORT 149 +#define TK_AFTER 150 +#define TK_ATTACH 151 +#define TK_BEFORE 152 +#define TK_BEGIN 153 +#define TK_CASCADE 154 +#define TK_CLUSTER 155 +#define TK_CONFLICT 156 +#define TK_COPY 157 +#define TK_DEFERRED 158 +#define TK_DELIMITERS 159 +#define TK_DETACH 160 +#define TK_EACH 161 +#define TK_END 162 +#define TK_EXPLAIN 163 +#define TK_FAIL 164 +#define TK_FOR 165 +#define TK_IGNORE 166 +#define TK_IMMEDIATE 167 +#define TK_INITIALLY 168 +#define TK_INSTEAD 169 +#define TK_MATCH 170 +#define TK_KEY 171 +#define TK_OF 172 +#define TK_RAISE 173 +#define TK_REPLACE 174 +#define TK_RESTRICT 175 +#define TK_ROW 176 +#define TK_STATEMENT 177 +#define TK_TRIGGER 178 +#define TK_VIEW 179 +#define TK_SEMI 180 +#define TK_NONE 181 +#define TK_PREV 182 +#define TK_LINEAR 183 +#define TK_IMPORT 184 +#define TK_TBNAME 185 +#define TK_JOIN 186 +#define TK_INSERT 187 +#define TK_INTO 188 +#define TK_VALUES 189 #define TK_SPACE 300 diff --git a/src/inc/vnode.h b/src/inc/vnode.h index 39bd2f46c3e41927389ab4333e27a1cee717aaed..9dae862344b90580d36fc9fbba67a27cf60edc50 100644 --- a/src/inc/vnode.h +++ b/src/inc/vnode.h @@ -62,6 +62,7 @@ int32_t vnodeOpen(int32_t vgId); int32_t vnodeAlter(void *pVnode, SCreateVnodeMsg *pVnodeCfg); int32_t vnodeSync(int32_t vgId); int32_t vnodeClose(int32_t vgId); +int32_t vnodeCompact(int32_t vgId); // vnodeMgmt int32_t vnodeInitMgmt(); diff --git a/src/mnode/inc/mnodeDef.h b/src/mnode/inc/mnodeDef.h index 0d64f42a98f660fe43bd9121a718a880a621c97c..e8cf7e30ac03bcfcafe5eaf9785bf0df60bf80c4 100644 --- a/src/mnode/inc/mnodeDef.h +++ b/src/mnode/inc/mnodeDef.h @@ -144,6 +144,7 @@ typedef struct SVgObj { int8_t reserved0[4]; SVnodeGid vnodeGid[TSDB_MAX_REPLICA]; int32_t vgCfgVersion; + int8_t compact; int8_t reserved1[8]; int8_t updateEnd[4]; int32_t refCount; diff --git a/src/mnode/inc/mnodeVgroup.h b/src/mnode/inc/mnodeVgroup.h index c796365843ae257324af3633e1340c9d044413ab..aff0411fdd777f83ccc6a882fbe91d7bc909e16b 100644 --- a/src/mnode/inc/mnodeVgroup.h +++ b/src/mnode/inc/mnodeVgroup.h @@ -51,6 +51,7 @@ void mnodeSendDropVnodeMsg(int32_t vgId, SRpcEpSet *epSet, void *ahandle); void mnodeSendCreateVgroupMsg(SVgObj *pVgroup, void *ahandle); void mnodeSendAlterVgroupMsg(SVgObj *pVgroup,SMnodeMsg *pMsg); void mnodeSendSyncVgroupMsg(SVgObj *pVgroup); +void mnodeSendCompactVgroupMsg(SVgObj *pVgroup); SRpcEpSet mnodeGetEpSetFromVgroup(SVgObj *pVgroup); SRpcEpSet mnodeGetEpSetFromIp(char *ep); diff --git a/src/mnode/src/mnodeDb.c b/src/mnode/src/mnodeDb.c index 334450f70b5125fcc57722c12cc1694b40eb166d..f4fc88476f8c2ddeb32acc4f37d27f17c76af788 100644 --- a/src/mnode/src/mnodeDb.c +++ b/src/mnode/src/mnodeDb.c @@ -53,6 +53,7 @@ static int32_t mnodeRetrieveDbs(SShowObj *pShow, char *data, int32_t rows, void static int32_t mnodeProcessCreateDbMsg(SMnodeMsg *pMsg); static int32_t mnodeProcessDropDbMsg(SMnodeMsg *pMsg); static int32_t mnodeProcessSyncDbMsg(SMnodeMsg *pMsg); +static int32_t mnodeProcessCompactMsg(SMnodeMsg *pMsg); int32_t mnodeProcessAlterDbMsg(SMnodeMsg *pMsg); #ifndef _TOPIC @@ -200,10 +201,12 @@ int32_t mnodeInitDbs() { mnodeAddWriteMsgHandle(TSDB_MSG_TYPE_CM_ALTER_DB, mnodeProcessAlterDbMsg); mnodeAddWriteMsgHandle(TSDB_MSG_TYPE_CM_DROP_DB, mnodeProcessDropDbMsg); mnodeAddWriteMsgHandle(TSDB_MSG_TYPE_CM_SYNC_DB, mnodeProcessSyncDbMsg); + mnodeAddWriteMsgHandle(TSDB_MSG_TYPE_CM_COMPACT_VNODE, mnodeProcessCompactMsg); mnodeAddShowMetaHandle(TSDB_MGMT_TABLE_DB, mnodeGetDbMeta); mnodeAddShowRetrieveHandle(TSDB_MGMT_TABLE_DB, mnodeRetrieveDbs); mnodeAddShowFreeIterHandle(TSDB_MGMT_TABLE_DB, mnodeCancelGetNextDb); + mDebug("table:dbs table is created"); return tpInit(); } @@ -1267,7 +1270,7 @@ static int32_t mnodeProcessDropDbMsg(SMnodeMsg *pMsg) { static int32_t mnodeSyncDb(SDbObj *pDb, SMnodeMsg *pMsg) { void *pIter = NULL; SVgObj *pVgroup = NULL; - while (1) { + while (1) { pIter = mnodeGetNextVgroup(pIter, &pVgroup); if (pVgroup == NULL) break; if (pVgroup->pDb == pDb) { @@ -1281,6 +1284,43 @@ static int32_t mnodeSyncDb(SDbObj *pDb, SMnodeMsg *pMsg) { return TSDB_CODE_SUCCESS; } + +static int32_t mnodeCompact(SDbObj *pDb, SCompactMsg *pCompactMsg) { + int32_t count = ntohs(pCompactMsg->numOfVgroup); + int32_t *buf = malloc(sizeof(int32_t) * count); + if (buf == NULL) { + return TSDB_CODE_MND_OUT_OF_MEMORY; + } + for (int32_t i = 0; i < count; i++) { + buf[i] = ntohs(pCompactMsg->vgid[i]); + } + + // copy from mnodeSyncDb, so ugly + for (int32_t i = 0; i < count; i++) { + SVgObj *pVgroup = NULL; + void *pIter = NULL; + bool valid = false; + while (1) { + pIter = mnodeGetNextVgroup(pIter, &pVgroup); + if (pVgroup == NULL) break; + if (pVgroup->pDb == pDb && pVgroup->vgId == buf[i]) { + mnodeSendCompactVgroupMsg(pVgroup); + mnodeDecVgroupRef(pVgroup); + valid = true; + break; + } + mnodeDecVgroupRef(pVgroup); + } + if (valid == false) { + mLError("db:%s, cannot find valid vgId: %d", pDb->name, buf[i]); + } + } + free(buf); + + mLInfo("db:%s, trigger compact", pDb->name); + return TSDB_CODE_SUCCESS; +} + static int32_t mnodeProcessSyncDbMsg(SMnodeMsg *pMsg) { SSyncDbMsg *pSyncDb = pMsg->rpcMsg.pCont; mDebug("db:%s, syncdb is received from thandle:%p, ignore:%d", pSyncDb->db, pMsg->rpcMsg.handle, pSyncDb->ignoreNotExists); @@ -1303,6 +1343,20 @@ static int32_t mnodeProcessSyncDbMsg(SMnodeMsg *pMsg) { return mnodeSyncDb(pMsg->pDb, pMsg); } +static int32_t mnodeProcessCompactMsg(SMnodeMsg *pMsg) { + SCompactMsg *pCompact = pMsg->rpcMsg.pCont; + mDebug("db:%s, compact is received from thandle:%p", pCompact->db, pMsg->rpcMsg.handle); + + if (pMsg->pDb == NULL) pMsg->pDb = mnodeGetDb(pCompact->db); + if (pMsg->pDb == NULL) return TSDB_CODE_MND_DB_NOT_SELECTED; + + if (pMsg->pDb->status != TSDB_DB_STATUS_READY) { + mError("db:%s, status:%d, in dropping, ignore compact request", pCompact->db, pMsg->pDb->status); + return TSDB_CODE_MND_DB_IN_DROPPING; + } + + return mnodeCompact(pMsg->pDb, pCompact); +} void mnodeDropAllDbs(SAcctObj *pAcct) { int32_t numOfDbs = 0; diff --git a/src/mnode/src/mnodeSdb.c b/src/mnode/src/mnodeSdb.c index 1c1252177eb9cdffaec40e0e0625062eec4bfa67..897c3a2f0f6c144a7975c73fd2ad57342dc59f7f 100644 --- a/src/mnode/src/mnodeSdb.c +++ b/src/mnode/src/mnodeSdb.c @@ -1202,4 +1202,4 @@ int32_t mnodeCompactWal() { sdbInfo("vgId:1, compact mnode wal success"); return 0; -} \ No newline at end of file +} diff --git a/src/mnode/src/mnodeVgroup.c b/src/mnode/src/mnodeVgroup.c index af816d7ae74b0ed16b43b64ffac997daefc9b20d..a32da29124016424ce5fe1436f29cca91da3e546 100644 --- a/src/mnode/src/mnodeVgroup.c +++ b/src/mnode/src/mnodeVgroup.c @@ -60,6 +60,7 @@ static int32_t mnodeGetVgroupMeta(STableMetaMsg *pMeta, SShowObj *pShow, void *p static int32_t mnodeRetrieveVgroups(SShowObj *pShow, char *data, int32_t rows, void *pConn); static void mnodeProcessCreateVnodeRsp(SRpcMsg *rpcMsg); static void mnodeProcessAlterVnodeRsp(SRpcMsg *rpcMsg); +static void mnodeProcessCompactVnodeRsp(SRpcMsg *rpcMsg); static void mnodeProcessDropVnodeRsp(SRpcMsg *rpcMsg); static int32_t mnodeProcessVnodeCfgMsg(SMnodeMsg *pMsg) ; static void mnodeSendDropVgroupMsg(SVgObj *pVgroup, void *ahandle); @@ -236,6 +237,7 @@ int32_t mnodeInitVgroups() { mnodeAddShowFreeIterHandle(TSDB_MGMT_TABLE_VGROUP, mnodeCancelGetNextVgroup); mnodeAddPeerRspHandle(TSDB_MSG_TYPE_MD_CREATE_VNODE_RSP, mnodeProcessCreateVnodeRsp); mnodeAddPeerRspHandle(TSDB_MSG_TYPE_MD_ALTER_VNODE_RSP, mnodeProcessAlterVnodeRsp); + mnodeAddPeerRspHandle(TSDB_MSG_TYPE_MD_COMPACT_VNODE_RSP, mnodeProcessCompactVnodeRsp); mnodeAddPeerRspHandle(TSDB_MSG_TYPE_MD_DROP_VNODE_RSP, mnodeProcessDropVnodeRsp); mnodeAddPeerMsgHandle(TSDB_MSG_TYPE_DM_CONFIG_VNODE, mnodeProcessVnodeCfgMsg); @@ -350,6 +352,7 @@ void mnodeUpdateVgroupStatus(SVgObj *pVgroup, SDnodeObj *pDnode, SVnodeLoad *pVl pVgroup->pDb->dbCfgVersion, pVgroup->vgCfgVersion, pVgroup->numOfVnodes); mnodeSendAlterVgroupMsg(pVgroup,NULL); } + pVgroup->compact = pVload->compact; } static int32_t mnodeAllocVgroupIdPool(SVgObj *pInputVgroup) { @@ -717,6 +720,13 @@ static int32_t mnodeGetVgroupMeta(STableMetaMsg *pMeta, SShowObj *pShow, void *p cols++; } + pShow->bytes[cols] = 4; + pSchema[cols].type = TSDB_DATA_TYPE_INT; + strcpy(pSchema[cols].name, "compacting"); + pSchema[cols].bytes = htons(pShow->bytes[cols]); + cols++; + + pMeta->numOfColumns = htons(cols); pShow->numOfColumns = cols; @@ -820,7 +830,11 @@ static int32_t mnodeRetrieveVgroups(SShowObj *pShow, char *data, int32_t rows, v STR_WITH_MAXSIZE_TO_VARSTR(pWrite, role, pShow->bytes[cols]); cols++; } - + + pWrite = data + pShow->offset[cols] * rows + pShow->bytes[cols] * numOfRows; + *(int8_t *)pWrite = pVgroup->compact; + cols++; + mnodeDecVgroupRef(pVgroup); numOfRows++; } @@ -979,6 +993,7 @@ static SSyncVnodeMsg *mnodeBuildSyncVnodeMsg(int32_t vgId) { return pSyncVnode; } + static void mnodeSendSyncVnodeMsg(SVgObj *pVgroup, SRpcEpSet *epSet) { SSyncVnodeMsg *pSyncVnode = mnodeBuildSyncVnodeMsg(pVgroup->vgId); SRpcMsg rpcMsg = { @@ -991,6 +1006,18 @@ static void mnodeSendSyncVnodeMsg(SVgObj *pVgroup, SRpcEpSet *epSet) { dnodeSendMsgToDnode(epSet, &rpcMsg); } +static void mnodeSendCompactVnodeMsg(SVgObj *pVgroup, SRpcEpSet *epSet) { + SCompactVnodeMsg *pCompactVnode = mnodeBuildSyncVnodeMsg(pVgroup->vgId); + SRpcMsg rpcMsg = { + .ahandle = NULL, + .pCont = pCompactVnode, + .contLen = pCompactVnode ? sizeof(SCompactVnodeMsg) : 0, + .code = 0, + .msgType = TSDB_MSG_TYPE_MD_COMPACT_VNODE + }; + + dnodeSendMsgToDnode(epSet, &rpcMsg); +} void mnodeSendSyncVgroupMsg(SVgObj *pVgroup) { mDebug("vgId:%d, send sync all vnodes msg, numOfVnodes:%d db:%s", pVgroup->vgId, pVgroup->numOfVnodes, @@ -1004,6 +1031,17 @@ void mnodeSendSyncVgroupMsg(SVgObj *pVgroup) { } } +void mnodeSendCompactVgroupMsg(SVgObj *pVgroup) { + mDebug("vgId:%d, send compact all vnodes msg, numOfVnodes:%d db:%s", pVgroup->vgId, pVgroup->numOfVnodes, pVgroup->dbName); + for (int32_t i = 0; i < pVgroup->numOfVnodes; ++i) { + //if (pVgroup->vnodeGid[i].role != TAOS_SYNC_ROLE_SLAVE) continue; //TODO(yihaoDeng): compact slave or not ? + SRpcEpSet epSet = mnodeGetEpSetFromIp(pVgroup->vnodeGid[i].pDnode->dnodeEp); + mDebug("vgId:%d, index:%d, send compact vnode msg to dnode %s", pVgroup->vgId, i, + pVgroup->vnodeGid[i].pDnode->dnodeEp); + mnodeSendCompactVnodeMsg(pVgroup, &epSet); + } + +} static void mnodeSendCreateVnodeMsg(SVgObj *pVgroup, SRpcEpSet *epSet, void *ahandle) { SCreateVnodeMsg *pCreate = mnodeBuildVnodeMsg(pVgroup); SRpcMsg rpcMsg = { @@ -1050,6 +1088,9 @@ static void mnodeProcessAlterVnodeRsp(SRpcMsg *rpcMsg) { dnodeSendRpcMWriteRsp(mnodeMsg, code); } } +static void mnodeProcessCompactVnodeRsp(SRpcMsg *rpcMsg) { + mDebug("compact vnode rsp received"); +} static void mnodeProcessCreateVnodeRsp(SRpcMsg *rpcMsg) { if (rpcMsg->ahandle == NULL) return; @@ -1346,4 +1387,4 @@ int32_t mnodeCompactVgroups() { mInfo("end to compact vgroups table..."); return 0; -} \ No newline at end of file +} diff --git a/src/query/inc/qSqlparser.h b/src/query/inc/qSqlparser.h index c2a4e99b63b1a3d2b07ba11f79f0f8be66e529e2..c6f667475ee7b061fcbc86be7a2aa8fac7282e8e 100644 --- a/src/query/inc/qSqlparser.h +++ b/src/query/inc/qSqlparser.h @@ -312,6 +312,8 @@ void setCreateUserSql(SSqlInfo *pInfo, SStrToken *pName, SStrToken *pPasswd); void setKillSql(SSqlInfo *pInfo, int32_t type, SStrToken *ip); void setAlterUserSql(SSqlInfo *pInfo, int16_t type, SStrToken *pName, SStrToken* pPwd, SStrToken *pPrivilege); +void setCompactVnodeSql(SSqlInfo *pInfo, int32_t type, SArray *pParam); + void setDefaultCreateDbOption(SCreateDbInfo *pDBInfo); void setDefaultCreateTopicOption(SCreateDbInfo *pDBInfo); diff --git a/src/query/inc/sql.y b/src/query/inc/sql.y index 07403699245ff767f17e7d373c8a1eae0b1a9b8a..c8895d39ad09d8a5e8f4c599a3dd39c9495195dc 100644 --- a/src/query/inc/sql.y +++ b/src/query/inc/sql.y @@ -174,6 +174,10 @@ cmd ::= ALTER TOPIC ids(X) alter_topic_optr(Y). { SStrToken t = {0}; setCreateD cmd ::= ALTER ACCOUNT ids(X) acct_optr(Z). { setCreateAcctSql(pInfo, TSDB_SQL_ALTER_ACCT, &X, NULL, &Z);} cmd ::= ALTER ACCOUNT ids(X) PASS ids(Y) acct_optr(Z). { setCreateAcctSql(pInfo, TSDB_SQL_ALTER_ACCT, &X, &Y, &Z);} +////////////////////////////// COMPACT STATEMENT ////////////////////////////////////////////// + +cmd ::= COMPACT VNODES IN LP exprlist(Y) RP. { setCompactVnodeSql(pInfo, TSDB_SQL_COMPACT_VNODE, Y);} + // An IDENTIFIER can be a generic identifier, or one of several keywords. // Any non-standard keyword can also be an identifier. // And "ids" is an identifer-or-string. diff --git a/src/query/src/qSqlParser.c b/src/query/src/qSqlParser.c index f725c7da2f6f6d8483d953b4022bd6b21aad051d..a2cb7aee00c8bd8173557a5bf19e8e337290c25c 100644 --- a/src/query/src/qSqlParser.c +++ b/src/query/src/qSqlParser.c @@ -1067,6 +1067,10 @@ void setCreateAcctSql(SSqlInfo *pInfo, int32_t type, SStrToken *pName, SStrToken pInfo->pMiscInfo->user.passwd = *pPwd; } } +void setCompactVnodeSql(SSqlInfo *pInfo, int32_t type, SArray *pParam) { + pInfo->type = type; + pInfo->list = pParam; +} void setCreateUserSql(SSqlInfo *pInfo, SStrToken *pName, SStrToken *pPasswd) { pInfo->type = TSDB_SQL_CREATE_USER; diff --git a/src/query/src/sql.c b/src/query/src/sql.c index 1358504bc6bf196027e72de31d8a2646a856a37a..508d52e83b4afb773bd135b889c5e02393409ec3 100644 --- a/src/query/src/sql.c +++ b/src/query/src/sql.c @@ -66,28 +66,28 @@ ** defined, then do no error processing. */ #define YYCODETYPE unsigned short int -#define YYNOCODE 270 +#define YYNOCODE 271 #define YYACTIONTYPE unsigned short int #define ParseTOKENTYPE SStrToken typedef union { int yyinit; ParseTOKENTYPE yy0; - SSessionWindowVal yy15; - SIntervalVal yy42; - tSqlExpr* yy68; - SCreateAcctInfo yy77; - SArray* yy93; - int yy150; - SSqlNode* yy224; - SWindowStateVal yy274; - int64_t yy279; - SLimitVal yy284; - TAOS_FIELD yy325; - SRelationInfo* yy330; - SCreateDbInfo yy372; - tVariant yy518; - SCreatedTableInfo yy528; - SCreateTableSql* yy532; + int yy112; + SCreateAcctInfo yy151; + tSqlExpr* yy166; + SCreateTableSql* yy182; + SSqlNode* yy236; + SRelationInfo* yy244; + SSessionWindowVal yy259; + SIntervalVal yy340; + TAOS_FIELD yy343; + SWindowStateVal yy348; + int64_t yy369; + SCreateDbInfo yy382; + SLimitVal yy414; + SArray* yy441; + SCreatedTableInfo yy456; + tVariant yy506; } YYMINORTYPE; #ifndef YYSTACKDEPTH #define YYSTACKDEPTH 100 @@ -96,8 +96,8 @@ typedef union { #define ParseARG_PDECL ,SSqlInfo* pInfo #define ParseARG_FETCH SSqlInfo* pInfo = yypParser->pInfo #define ParseARG_STORE yypParser->pInfo = pInfo -#define YYNSTATE 543 -#define YYNRULE 284 +#define YYNSTATE 549 +#define YYNRULE 285 #define YYFALLBACK 1 #define YY_NO_ACTION (YYNSTATE+YYNRULE+2) #define YY_ACCEPT_ACTION (YYNSTATE+YYNRULE+1) @@ -167,304 +167,306 @@ static const YYMINORTYPE yyzerominor = { 0 }; ** shifting non-terminals after a reduce. ** yy_default[] Default action for each state. */ -#define YY_ACTTAB_COUNT (843) +#define YY_ACTTAB_COUNT (854) static const YYACTIONTYPE yy_action[] = { - /* 0 */ 526, 51, 50, 125, 124, 49, 48, 47, 525, 142, - /* 10 */ 140, 139, 52, 53, 32, 56, 57, 289, 543, 230, - /* 20 */ 46, 529, 55, 283, 60, 58, 62, 59, 338, 337, - /* 30 */ 136, 528, 51, 50, 828, 341, 49, 48, 47, 52, - /* 40 */ 53, 349, 56, 57, 481, 70, 230, 46, 178, 55, - /* 50 */ 283, 60, 58, 62, 59, 151, 395, 13, 394, 51, - /* 60 */ 50, 93, 90, 49, 48, 47, 52, 53, 245, 56, - /* 70 */ 57, 64, 410, 230, 46, 251, 55, 283, 60, 58, - /* 80 */ 62, 59, 357, 468, 255, 254, 51, 50, 71, 415, - /* 90 */ 49, 48, 47, 52, 54, 34, 56, 57, 259, 144, - /* 100 */ 230, 46, 526, 55, 283, 60, 58, 62, 59, 76, - /* 110 */ 525, 315, 314, 51, 50, 92, 236, 49, 48, 47, - /* 120 */ 348, 64, 60, 58, 62, 59, 369, 21, 278, 20, - /* 130 */ 51, 50, 399, 288, 49, 48, 47, 317, 247, 412, - /* 140 */ 244, 463, 310, 309, 91, 67, 542, 541, 540, 539, - /* 150 */ 538, 537, 536, 535, 534, 533, 532, 531, 530, 340, - /* 160 */ 360, 53, 219, 56, 57, 266, 265, 230, 46, 393, - /* 170 */ 55, 283, 60, 58, 62, 59, 418, 417, 33, 409, - /* 180 */ 51, 50, 240, 228, 49, 48, 47, 56, 57, 8, - /* 190 */ 68, 230, 46, 517, 55, 283, 60, 58, 62, 59, - /* 200 */ 49, 48, 47, 151, 51, 50, 1, 166, 49, 48, - /* 210 */ 47, 423, 435, 434, 433, 432, 431, 430, 429, 428, - /* 220 */ 427, 426, 425, 424, 422, 421, 229, 385, 6, 392, - /* 230 */ 396, 391, 389, 34, 388, 374, 373, 40, 297, 334, - /* 240 */ 333, 296, 295, 294, 332, 293, 331, 330, 329, 292, - /* 250 */ 328, 327, 241, 23, 239, 35, 303, 302, 215, 216, - /* 260 */ 229, 385, 282, 180, 396, 73, 389, 465, 388, 112, - /* 270 */ 204, 111, 280, 286, 87, 313, 19, 205, 18, 463, - /* 280 */ 80, 34, 128, 127, 203, 35, 138, 491, 262, 493, - /* 290 */ 492, 443, 215, 216, 490, 178, 488, 487, 489, 34, - /* 300 */ 486, 485, 40, 408, 334, 333, 453, 195, 452, 332, - /* 310 */ 284, 331, 330, 329, 82, 328, 327, 226, 378, 451, - /* 320 */ 398, 450, 41, 312, 113, 107, 118, 463, 195, 137, - /* 330 */ 61, 117, 123, 126, 116, 501, 384, 387, 227, 378, - /* 340 */ 120, 311, 390, 386, 258, 463, 74, 456, 34, 34, - /* 350 */ 459, 34, 458, 212, 457, 24, 397, 34, 34, 187, - /* 360 */ 185, 183, 679, 34, 61, 34, 182, 131, 130, 129, - /* 370 */ 384, 387, 526, 383, 5, 37, 168, 386, 242, 243, - /* 380 */ 525, 167, 101, 96, 100, 17, 106, 16, 105, 75, - /* 390 */ 307, 306, 24, 305, 463, 463, 15, 463, 14, 304, - /* 400 */ 234, 25, 94, 463, 463, 233, 401, 220, 64, 463, - /* 410 */ 379, 463, 146, 79, 35, 526, 82, 3, 179, 365, - /* 420 */ 89, 262, 347, 525, 41, 482, 366, 335, 502, 178, - /* 430 */ 362, 115, 260, 34, 77, 246, 325, 416, 151, 357, - /* 440 */ 237, 299, 151, 357, 413, 350, 235, 224, 500, 195, - /* 450 */ 413, 413, 218, 339, 499, 222, 455, 454, 498, 221, - /* 460 */ 377, 497, 496, 495, 494, 484, 480, 479, 478, 477, - /* 470 */ 476, 464, 475, 474, 473, 35, 28, 467, 469, 470, - /* 480 */ 466, 110, 108, 104, 102, 99, 66, 65, 298, 441, - /* 490 */ 442, 440, 439, 438, 437, 95, 27, 93, 287, 436, - /* 500 */ 26, 285, 12, 400, 7, 11, 376, 10, 31, 88, - /* 510 */ 352, 30, 150, 370, 367, 225, 274, 86, 148, 364, - /* 520 */ 85, 84, 363, 147, 264, 257, 345, 361, 358, 29, - /* 530 */ 9, 346, 81, 344, 253, 343, 250, 342, 2, 141, - /* 540 */ 262, 252, 4, 249, 524, 523, 504, 135, 518, 503, - /* 550 */ 483, 134, 516, 336, 133, 132, 326, 509, 324, 176, - /* 560 */ 177, 323, 322, 321, 320, 319, 175, 114, 318, 173, - /* 570 */ 211, 174, 210, 98, 172, 299, 171, 420, 471, 290, - /* 580 */ 97, 45, 161, 158, 156, 268, 153, 69, 160, 276, - /* 590 */ 269, 829, 238, 159, 157, 217, 372, 270, 83, 78, - /* 600 */ 261, 829, 829, 271, 829, 829, 273, 829, 829, 829, - /* 610 */ 829, 829, 829, 275, 829, 277, 368, 829, 155, 281, - /* 620 */ 154, 279, 189, 63, 527, 152, 162, 72, 406, 829, - /* 630 */ 188, 522, 521, 520, 829, 519, 829, 186, 223, 184, - /* 640 */ 267, 515, 829, 514, 513, 829, 829, 512, 375, 829, - /* 650 */ 829, 371, 829, 829, 829, 829, 829, 829, 829, 829, - /* 660 */ 829, 829, 829, 829, 829, 407, 263, 325, 829, 829, - /* 670 */ 356, 829, 829, 829, 829, 316, 829, 829, 829, 829, - /* 680 */ 829, 829, 829, 829, 829, 829, 829, 829, 829, 829, - /* 690 */ 44, 829, 511, 510, 181, 248, 508, 507, 122, 121, - /* 700 */ 506, 829, 119, 505, 191, 43, 36, 829, 829, 39, - /* 710 */ 472, 170, 462, 461, 109, 460, 308, 169, 448, 447, - /* 720 */ 103, 829, 829, 829, 829, 829, 446, 301, 444, 300, - /* 730 */ 38, 190, 42, 291, 419, 165, 164, 829, 411, 163, - /* 740 */ 272, 149, 145, 359, 355, 354, 353, 351, 143, 256, - /* 750 */ 829, 829, 829, 829, 829, 829, 829, 829, 829, 829, - /* 760 */ 829, 829, 829, 829, 829, 829, 829, 829, 829, 829, - /* 770 */ 829, 829, 829, 829, 829, 829, 829, 829, 829, 829, - /* 780 */ 829, 829, 829, 829, 829, 829, 829, 232, 405, 404, - /* 790 */ 231, 403, 402, 829, 829, 829, 829, 829, 829, 829, - /* 800 */ 829, 829, 829, 449, 445, 414, 829, 829, 829, 829, - /* 810 */ 829, 829, 829, 829, 829, 829, 829, 829, 829, 829, - /* 820 */ 829, 829, 829, 196, 206, 192, 207, 209, 208, 202, - /* 830 */ 201, 194, 200, 198, 197, 214, 213, 382, 381, 380, - /* 840 */ 199, 193, 22, + /* 0 */ 532, 53, 52, 126, 125, 51, 50, 49, 531, 143, + /* 10 */ 141, 140, 54, 55, 14, 58, 59, 379, 378, 239, + /* 20 */ 48, 450, 57, 300, 62, 60, 63, 61, 343, 342, + /* 30 */ 137, 25, 53, 52, 835, 346, 51, 50, 49, 54, + /* 40 */ 55, 549, 58, 59, 94, 91, 239, 48, 237, 57, + /* 50 */ 300, 62, 60, 63, 61, 443, 71, 442, 152, 53, + /* 60 */ 52, 389, 253, 51, 50, 49, 54, 55, 6, 58, + /* 70 */ 59, 257, 256, 239, 48, 74, 57, 300, 62, 60, + /* 80 */ 63, 61, 22, 362, 21, 92, 53, 52, 532, 95, + /* 90 */ 51, 50, 49, 51, 50, 49, 531, 72, 440, 261, + /* 100 */ 439, 54, 56, 471, 58, 59, 232, 449, 239, 48, + /* 110 */ 77, 57, 300, 62, 60, 63, 61, 397, 396, 34, + /* 120 */ 388, 53, 52, 474, 395, 51, 50, 49, 282, 113, + /* 130 */ 88, 112, 548, 547, 546, 545, 544, 543, 542, 541, + /* 140 */ 540, 539, 538, 537, 536, 345, 35, 55, 220, 58, + /* 150 */ 59, 320, 319, 239, 48, 535, 57, 300, 62, 60, + /* 160 */ 63, 61, 534, 33, 145, 247, 53, 52, 532, 441, + /* 170 */ 51, 50, 49, 58, 59, 152, 531, 239, 48, 81, + /* 180 */ 57, 300, 62, 60, 63, 61, 20, 302, 19, 322, + /* 190 */ 53, 52, 288, 469, 51, 50, 49, 402, 414, 413, + /* 200 */ 412, 411, 410, 409, 408, 407, 406, 405, 404, 403, + /* 210 */ 401, 400, 438, 264, 41, 296, 339, 338, 295, 294, + /* 220 */ 293, 337, 292, 336, 335, 334, 291, 333, 332, 238, + /* 230 */ 433, 268, 267, 444, 446, 437, 249, 436, 246, 523, + /* 240 */ 315, 314, 24, 62, 60, 63, 61, 374, 35, 280, + /* 250 */ 139, 53, 52, 83, 35, 51, 50, 49, 459, 205, + /* 260 */ 458, 217, 218, 3, 180, 301, 206, 457, 240, 456, + /* 270 */ 445, 129, 128, 204, 18, 68, 17, 305, 83, 497, + /* 280 */ 76, 499, 498, 354, 448, 35, 496, 42, 494, 493, + /* 290 */ 495, 318, 492, 491, 431, 469, 41, 317, 339, 338, + /* 300 */ 138, 469, 35, 337, 25, 336, 335, 334, 64, 333, + /* 310 */ 332, 242, 42, 352, 114, 108, 119, 532, 69, 235, + /* 320 */ 236, 118, 124, 127, 117, 531, 462, 197, 316, 465, + /* 330 */ 121, 464, 469, 463, 260, 507, 75, 425, 238, 433, + /* 340 */ 432, 435, 444, 213, 437, 312, 436, 434, 35, 469, + /* 350 */ 365, 80, 188, 186, 184, 35, 35, 244, 245, 183, + /* 360 */ 132, 131, 130, 353, 35, 35, 5, 38, 169, 181, + /* 370 */ 217, 218, 35, 168, 102, 97, 101, 9, 197, 197, + /* 380 */ 686, 107, 243, 106, 241, 264, 308, 307, 425, 425, + /* 390 */ 16, 311, 15, 116, 426, 469, 29, 152, 310, 309, + /* 400 */ 487, 330, 469, 469, 25, 179, 394, 230, 229, 152, + /* 410 */ 287, 469, 469, 391, 285, 221, 65, 64, 506, 469, + /* 420 */ 93, 387, 370, 65, 36, 371, 1, 167, 367, 262, + /* 430 */ 90, 36, 26, 340, 508, 65, 461, 460, 147, 36, + /* 440 */ 505, 422, 35, 488, 78, 362, 179, 362, 179, 432, + /* 450 */ 435, 248, 355, 504, 233, 231, 434, 503, 392, 392, + /* 460 */ 225, 223, 298, 222, 392, 197, 219, 344, 502, 89, + /* 470 */ 501, 500, 490, 486, 485, 424, 484, 483, 482, 481, + /* 480 */ 480, 375, 479, 36, 475, 473, 472, 111, 470, 476, + /* 490 */ 304, 109, 67, 105, 103, 66, 8, 447, 430, 7, + /* 500 */ 100, 297, 303, 421, 420, 419, 418, 417, 416, 96, + /* 510 */ 94, 28, 12, 415, 286, 284, 27, 13, 357, 32, + /* 520 */ 11, 31, 151, 226, 372, 276, 87, 82, 369, 86, + /* 530 */ 149, 368, 366, 148, 259, 85, 30, 264, 363, 10, + /* 540 */ 349, 255, 348, 254, 252, 266, 251, 347, 351, 142, + /* 550 */ 4, 530, 350, 529, 509, 136, 2, 524, 489, 135, + /* 560 */ 522, 327, 134, 133, 341, 515, 178, 331, 329, 510, + /* 570 */ 173, 328, 177, 326, 325, 176, 324, 174, 175, 323, + /* 580 */ 99, 115, 212, 172, 211, 477, 289, 298, 234, 98, + /* 590 */ 270, 214, 161, 157, 155, 162, 46, 70, 278, 377, + /* 600 */ 836, 271, 272, 84, 399, 159, 380, 79, 273, 263, + /* 610 */ 836, 836, 190, 836, 275, 533, 277, 189, 279, 528, + /* 620 */ 527, 283, 160, 526, 281, 158, 836, 47, 156, 73, + /* 630 */ 373, 154, 525, 836, 187, 153, 836, 385, 836, 386, + /* 640 */ 836, 836, 265, 836, 836, 163, 224, 269, 836, 361, + /* 650 */ 836, 836, 836, 836, 836, 836, 185, 376, 836, 321, + /* 660 */ 836, 836, 836, 836, 836, 836, 228, 836, 45, 836, + /* 670 */ 836, 836, 836, 384, 193, 836, 836, 836, 836, 330, + /* 680 */ 836, 836, 836, 836, 836, 836, 836, 836, 836, 836, + /* 690 */ 836, 836, 836, 836, 836, 836, 836, 836, 836, 836, + /* 700 */ 521, 836, 520, 519, 518, 836, 517, 516, 182, 250, + /* 710 */ 514, 513, 123, 122, 512, 120, 836, 511, 192, 44, + /* 720 */ 836, 37, 40, 478, 171, 468, 467, 110, 466, 836, + /* 730 */ 836, 836, 313, 836, 170, 454, 836, 453, 104, 452, + /* 740 */ 306, 423, 299, 836, 39, 191, 43, 290, 398, 166, + /* 750 */ 165, 390, 164, 274, 150, 146, 364, 360, 359, 358, + /* 760 */ 356, 144, 258, 836, 836, 836, 836, 836, 836, 836, + /* 770 */ 836, 836, 836, 836, 836, 836, 836, 836, 836, 836, + /* 780 */ 836, 836, 836, 836, 836, 836, 836, 836, 836, 836, + /* 790 */ 836, 836, 836, 836, 836, 836, 836, 836, 836, 836, + /* 800 */ 836, 383, 227, 382, 381, 836, 836, 836, 836, 836, + /* 810 */ 836, 836, 836, 836, 836, 455, 451, 393, 836, 836, + /* 820 */ 836, 836, 836, 836, 836, 836, 836, 836, 836, 836, + /* 830 */ 836, 836, 836, 836, 836, 207, 210, 209, 208, 203, + /* 840 */ 202, 196, 201, 199, 198, 216, 215, 429, 428, 427, + /* 850 */ 200, 195, 194, 23, }; static const YYCODETYPE yy_lookahead[] = { /* 0 */ 1, 33, 34, 76, 77, 37, 38, 39, 9, 62, - /* 10 */ 63, 64, 13, 14, 105, 16, 17, 108, 0, 20, - /* 20 */ 21, 59, 23, 24, 25, 26, 27, 28, 65, 66, - /* 30 */ 67, 60, 33, 34, 190, 191, 37, 38, 39, 13, - /* 40 */ 14, 37, 16, 17, 198, 88, 20, 21, 202, 23, - /* 50 */ 24, 25, 26, 27, 28, 193, 5, 105, 7, 33, - /* 60 */ 34, 109, 110, 37, 38, 39, 13, 14, 68, 16, - /* 70 */ 17, 88, 193, 20, 21, 136, 23, 24, 25, 26, - /* 80 */ 27, 28, 238, 5, 145, 146, 33, 34, 131, 106, - /* 90 */ 37, 38, 39, 13, 14, 193, 16, 17, 254, 193, - /* 100 */ 20, 21, 1, 23, 24, 25, 26, 27, 28, 110, - /* 110 */ 9, 33, 34, 33, 34, 88, 237, 37, 38, 39, - /* 120 */ 116, 88, 25, 26, 27, 28, 264, 139, 266, 141, - /* 130 */ 33, 34, 106, 106, 37, 38, 39, 235, 138, 106, - /* 140 */ 140, 239, 142, 143, 199, 88, 45, 46, 47, 48, - /* 150 */ 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, - /* 160 */ 88, 14, 61, 16, 17, 259, 260, 20, 21, 118, - /* 170 */ 23, 24, 25, 26, 27, 28, 231, 232, 233, 234, - /* 180 */ 33, 34, 68, 60, 37, 38, 39, 16, 17, 117, - /* 190 */ 133, 20, 21, 80, 23, 24, 25, 26, 27, 28, - /* 200 */ 37, 38, 39, 193, 33, 34, 200, 201, 37, 38, - /* 210 */ 39, 213, 214, 215, 216, 217, 218, 219, 220, 221, - /* 220 */ 222, 223, 224, 225, 226, 227, 1, 2, 105, 5, - /* 230 */ 5, 7, 7, 193, 9, 126, 127, 89, 90, 91, - /* 240 */ 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, - /* 250 */ 102, 103, 138, 44, 140, 88, 142, 143, 33, 34, - /* 260 */ 1, 2, 37, 88, 5, 105, 7, 107, 9, 139, - /* 270 */ 61, 141, 262, 106, 264, 235, 139, 68, 141, 239, - /* 280 */ 106, 193, 73, 74, 75, 88, 21, 213, 114, 215, - /* 290 */ 216, 198, 33, 34, 220, 202, 222, 223, 224, 193, - /* 300 */ 226, 227, 89, 106, 91, 92, 5, 257, 7, 96, - /* 310 */ 15, 98, 99, 100, 105, 102, 103, 267, 268, 5, - /* 320 */ 1, 7, 113, 235, 62, 63, 64, 239, 257, 21, - /* 330 */ 105, 69, 70, 71, 72, 5, 111, 112, 267, 268, - /* 340 */ 78, 235, 118, 118, 135, 239, 137, 2, 193, 193, - /* 350 */ 5, 193, 7, 144, 9, 88, 37, 193, 193, 62, - /* 360 */ 63, 64, 0, 193, 105, 193, 69, 70, 71, 72, - /* 370 */ 111, 112, 1, 106, 62, 63, 64, 118, 33, 34, - /* 380 */ 9, 69, 70, 71, 72, 139, 139, 141, 141, 199, - /* 390 */ 235, 235, 88, 235, 239, 239, 139, 239, 141, 235, - /* 400 */ 235, 88, 199, 239, 239, 235, 111, 235, 88, 239, - /* 410 */ 106, 239, 88, 106, 88, 1, 105, 196, 197, 106, - /* 420 */ 241, 114, 232, 9, 113, 198, 106, 211, 212, 202, - /* 430 */ 106, 76, 106, 193, 255, 193, 81, 234, 193, 238, - /* 440 */ 236, 79, 193, 238, 240, 193, 236, 236, 5, 257, - /* 450 */ 240, 240, 192, 193, 5, 254, 111, 112, 5, 254, - /* 460 */ 268, 5, 5, 5, 5, 5, 5, 5, 5, 5, - /* 470 */ 5, 229, 5, 5, 5, 88, 105, 5, 106, 239, - /* 480 */ 5, 141, 141, 141, 141, 76, 16, 16, 15, 5, - /* 490 */ 80, 5, 5, 5, 5, 76, 105, 109, 108, 9, - /* 500 */ 105, 108, 105, 111, 105, 125, 106, 125, 88, 264, - /* 510 */ 258, 88, 105, 264, 106, 1, 105, 105, 88, 106, - /* 520 */ 105, 88, 106, 105, 88, 136, 91, 106, 106, 105, - /* 530 */ 105, 90, 115, 5, 5, 5, 5, 5, 200, 60, - /* 540 */ 114, 147, 196, 147, 194, 194, 212, 195, 194, 5, - /* 550 */ 228, 195, 194, 79, 195, 195, 104, 194, 82, 206, - /* 560 */ 203, 84, 54, 85, 83, 50, 205, 87, 86, 204, - /* 570 */ 194, 207, 194, 199, 208, 79, 209, 228, 210, 194, - /* 580 */ 199, 134, 243, 246, 248, 119, 251, 132, 244, 261, - /* 590 */ 261, 269, 194, 245, 247, 194, 194, 194, 194, 194, - /* 600 */ 194, 269, 269, 120, 269, 269, 121, 269, 269, 269, - /* 610 */ 269, 269, 269, 122, 269, 123, 118, 269, 249, 124, - /* 620 */ 250, 128, 193, 129, 193, 252, 242, 130, 253, 269, - /* 630 */ 193, 193, 193, 193, 269, 193, 269, 193, 261, 193, - /* 640 */ 261, 193, 269, 193, 193, 269, 269, 193, 265, 269, - /* 650 */ 269, 265, 269, 269, 269, 269, 269, 269, 269, 269, - /* 660 */ 269, 269, 269, 269, 269, 238, 238, 81, 269, 269, - /* 670 */ 238, 269, 269, 269, 269, 230, 269, 269, 269, 269, - /* 680 */ 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, - /* 690 */ 256, 269, 193, 193, 193, 193, 193, 193, 193, 193, - /* 700 */ 193, 269, 193, 193, 193, 193, 193, 269, 269, 193, - /* 710 */ 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, - /* 720 */ 193, 269, 269, 269, 269, 269, 193, 193, 193, 193, - /* 730 */ 193, 193, 193, 193, 193, 193, 193, 269, 193, 193, - /* 740 */ 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, - /* 750 */ 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, - /* 760 */ 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, - /* 770 */ 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, - /* 780 */ 269, 269, 269, 269, 269, 269, 269, 230, 230, 230, - /* 790 */ 230, 230, 230, 269, 269, 269, 269, 269, 269, 269, - /* 800 */ 269, 269, 269, 240, 240, 240, 269, 269, 269, 269, - /* 810 */ 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, - /* 820 */ 269, 269, 269, 257, 257, 257, 257, 257, 257, 257, - /* 830 */ 257, 257, 257, 257, 257, 257, 257, 257, 257, 257, - /* 840 */ 257, 257, 257, + /* 10 */ 63, 64, 13, 14, 80, 16, 17, 127, 128, 20, + /* 20 */ 21, 81, 23, 24, 25, 26, 27, 28, 65, 66, + /* 30 */ 67, 91, 33, 34, 191, 192, 37, 38, 39, 13, + /* 40 */ 14, 0, 16, 17, 110, 111, 20, 21, 60, 23, + /* 50 */ 24, 25, 26, 27, 28, 5, 91, 7, 194, 33, + /* 60 */ 34, 194, 137, 37, 38, 39, 13, 14, 80, 16, + /* 70 */ 17, 146, 147, 20, 21, 80, 23, 24, 25, 26, + /* 80 */ 27, 28, 140, 240, 142, 201, 33, 34, 1, 201, + /* 90 */ 37, 38, 39, 37, 38, 39, 9, 132, 5, 256, + /* 100 */ 7, 13, 14, 108, 16, 17, 239, 81, 20, 21, + /* 110 */ 111, 23, 24, 25, 26, 27, 28, 233, 234, 235, + /* 120 */ 236, 33, 34, 5, 236, 37, 38, 39, 264, 140, + /* 130 */ 266, 142, 45, 46, 47, 48, 49, 50, 51, 52, + /* 140 */ 53, 54, 55, 56, 57, 58, 194, 14, 61, 16, + /* 150 */ 17, 33, 34, 20, 21, 59, 23, 24, 25, 26, + /* 160 */ 27, 28, 60, 80, 194, 68, 33, 34, 1, 119, + /* 170 */ 37, 38, 39, 16, 17, 194, 9, 20, 21, 81, + /* 180 */ 23, 24, 25, 26, 27, 28, 140, 15, 142, 237, + /* 190 */ 33, 34, 109, 241, 37, 38, 39, 215, 216, 217, + /* 200 */ 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, + /* 210 */ 228, 229, 119, 115, 92, 93, 94, 95, 96, 97, + /* 220 */ 98, 99, 100, 101, 102, 103, 104, 105, 106, 1, + /* 230 */ 2, 261, 262, 5, 1, 7, 139, 9, 141, 83, + /* 240 */ 143, 144, 44, 25, 26, 27, 28, 266, 194, 268, + /* 250 */ 21, 33, 34, 80, 194, 37, 38, 39, 5, 61, + /* 260 */ 7, 33, 34, 197, 198, 37, 68, 5, 200, 7, + /* 270 */ 37, 73, 74, 75, 140, 91, 142, 79, 80, 215, + /* 280 */ 201, 217, 218, 37, 112, 194, 222, 114, 224, 225, + /* 290 */ 226, 237, 228, 229, 81, 241, 92, 237, 94, 95, + /* 300 */ 21, 241, 194, 99, 91, 101, 102, 103, 80, 105, + /* 310 */ 106, 68, 114, 234, 62, 63, 64, 1, 134, 200, + /* 320 */ 200, 69, 70, 71, 72, 9, 2, 259, 237, 5, + /* 330 */ 78, 7, 241, 9, 136, 5, 138, 269, 1, 2, + /* 340 */ 112, 113, 5, 145, 7, 237, 9, 119, 194, 241, + /* 350 */ 91, 81, 62, 63, 64, 194, 194, 33, 34, 69, + /* 360 */ 70, 71, 72, 117, 194, 194, 62, 63, 64, 91, + /* 370 */ 33, 34, 194, 69, 70, 71, 72, 118, 259, 259, + /* 380 */ 0, 140, 139, 142, 141, 115, 143, 144, 269, 269, + /* 390 */ 140, 237, 142, 76, 81, 241, 80, 194, 237, 237, + /* 400 */ 199, 84, 241, 241, 91, 204, 81, 237, 237, 194, + /* 410 */ 81, 241, 241, 81, 81, 237, 91, 80, 5, 241, + /* 420 */ 91, 81, 81, 91, 91, 81, 202, 203, 81, 81, + /* 430 */ 243, 91, 91, 213, 214, 91, 112, 113, 91, 91, + /* 440 */ 5, 199, 194, 199, 257, 240, 204, 240, 204, 112, + /* 450 */ 113, 194, 194, 5, 238, 238, 119, 5, 242, 242, + /* 460 */ 238, 256, 82, 256, 242, 259, 193, 194, 5, 266, + /* 470 */ 5, 5, 5, 5, 5, 269, 5, 5, 5, 5, + /* 480 */ 5, 266, 5, 91, 81, 5, 5, 142, 231, 241, + /* 490 */ 58, 142, 16, 142, 142, 16, 80, 112, 81, 80, + /* 500 */ 76, 15, 24, 83, 5, 5, 5, 5, 5, 76, + /* 510 */ 110, 80, 126, 9, 109, 109, 80, 80, 260, 91, + /* 520 */ 126, 91, 80, 1, 81, 80, 80, 116, 81, 80, + /* 530 */ 91, 81, 81, 80, 137, 91, 80, 115, 81, 80, + /* 540 */ 5, 5, 5, 148, 5, 91, 148, 5, 93, 60, + /* 550 */ 197, 195, 94, 195, 5, 196, 202, 195, 230, 196, + /* 560 */ 195, 54, 196, 196, 82, 195, 205, 107, 85, 214, + /* 570 */ 210, 87, 208, 88, 86, 207, 50, 206, 209, 89, + /* 580 */ 201, 90, 195, 211, 195, 212, 195, 82, 195, 201, + /* 590 */ 120, 195, 246, 250, 252, 245, 135, 133, 263, 195, + /* 600 */ 270, 263, 195, 195, 230, 248, 267, 195, 121, 195, + /* 610 */ 270, 270, 194, 270, 122, 194, 123, 194, 124, 194, + /* 620 */ 194, 125, 247, 194, 129, 249, 270, 130, 251, 131, + /* 630 */ 119, 253, 194, 270, 194, 254, 270, 255, 270, 240, + /* 640 */ 270, 270, 240, 270, 270, 244, 263, 263, 270, 240, + /* 650 */ 270, 270, 270, 270, 270, 270, 194, 267, 270, 232, + /* 660 */ 270, 270, 270, 270, 270, 270, 232, 270, 258, 270, + /* 670 */ 270, 270, 270, 232, 259, 270, 270, 270, 270, 84, + /* 680 */ 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, + /* 690 */ 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, + /* 700 */ 194, 270, 194, 194, 194, 270, 194, 194, 194, 194, + /* 710 */ 194, 194, 194, 194, 194, 194, 270, 194, 194, 194, + /* 720 */ 270, 194, 194, 194, 194, 194, 194, 194, 194, 270, + /* 730 */ 270, 270, 194, 270, 194, 194, 270, 194, 194, 194, + /* 740 */ 194, 194, 194, 270, 194, 194, 194, 194, 194, 194, + /* 750 */ 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, + /* 760 */ 194, 194, 194, 270, 270, 270, 270, 270, 270, 270, + /* 770 */ 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, + /* 780 */ 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, + /* 790 */ 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, + /* 800 */ 270, 232, 232, 232, 232, 270, 270, 270, 270, 270, + /* 810 */ 270, 270, 270, 270, 270, 242, 242, 242, 270, 270, + /* 820 */ 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, + /* 830 */ 270, 270, 270, 270, 270, 259, 259, 259, 259, 259, + /* 840 */ 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, + /* 850 */ 259, 259, 259, 259, }; -#define YY_SHIFT_USE_DFLT (-92) -#define YY_SHIFT_COUNT (341) -#define YY_SHIFT_MIN (-91) -#define YY_SHIFT_MAX (586) +#define YY_SHIFT_USE_DFLT (-111) +#define YY_SHIFT_COUNT (346) +#define YY_SHIFT_MIN (-110) +#define YY_SHIFT_MAX (595) static const short yy_shift_ofst[] = { - /* 0 */ 209, 148, 148, 213, 213, 496, 225, 259, 371, 414, - /* 10 */ 414, 414, 414, 414, 414, 414, 414, 414, 414, 414, - /* 20 */ 414, 414, -1, 101, 259, 345, 345, 345, 311, 311, - /* 30 */ 414, 414, 414, 362, 414, 414, 355, 496, 586, 586, - /* 40 */ 544, -92, -92, -92, 259, 259, 259, 259, 259, 259, - /* 50 */ 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, - /* 60 */ 259, 259, 259, 259, 345, 345, 345, 78, 78, 78, - /* 70 */ 78, 78, 78, 78, 414, 414, 414, 4, 414, 414, - /* 80 */ 414, 311, 311, 414, 414, 414, 414, 109, 109, 72, - /* 90 */ 311, 414, 414, 414, 414, 414, 414, 414, 414, 414, - /* 100 */ 414, 414, 414, 414, 414, 414, 414, 414, 414, 414, - /* 110 */ 414, 414, 414, 414, 414, 414, 414, 414, 414, 414, - /* 120 */ 414, 414, 414, 414, 414, 414, 414, 414, 414, 414, - /* 130 */ 414, 414, 414, 414, 414, 414, 414, 414, 414, 414, - /* 140 */ 414, 414, 414, 479, 479, 479, 498, 498, 498, 479, - /* 150 */ 498, 479, 497, 455, 494, 495, 493, 492, 491, 485, - /* 160 */ 483, 466, 447, 479, 479, 479, 452, 496, 496, 479, - /* 170 */ 479, 480, 482, 515, 481, 478, 508, 477, 476, 452, - /* 180 */ 544, 479, 474, 474, 479, 474, 479, 474, 479, 479, - /* 190 */ -92, -92, 26, 53, 80, 53, 53, 147, 171, 97, - /* 200 */ 97, 97, 97, 262, 312, 297, -32, -32, -32, -32, - /* 210 */ 114, 0, -61, 163, 163, 224, 51, -48, -37, -53, - /* 220 */ 326, 307, 174, 324, 320, 313, 304, 267, 319, 123, - /* 230 */ 295, 57, -43, 197, 167, 33, 27, -17, -91, 257, - /* 240 */ 247, 246, 314, 301, 137, 130, 160, -12, -73, 532, - /* 250 */ 396, 531, 530, 394, 529, 528, 435, 441, 389, 426, - /* 260 */ 393, 425, 417, 422, 424, 436, 433, 421, 418, 416, - /* 270 */ 430, 415, 413, 412, 514, 411, 408, 407, 423, 382, - /* 280 */ 420, 380, 400, 399, 392, 397, 393, 395, 390, 391, - /* 290 */ 388, 419, 490, 489, 488, 487, 486, 484, 410, 473, - /* 300 */ 409, 471, 343, 342, 387, 387, 387, 387, 470, 341, - /* 310 */ 340, 387, 387, 387, 475, 472, 372, 387, 469, 468, - /* 320 */ 467, 465, 464, 463, 462, 461, 460, 459, 458, 457, - /* 330 */ 456, 453, 449, 443, 330, 175, 113, 308, 265, -29, - /* 340 */ -38, 18, + /* 0 */ 198, 122, 122, 204, 204, 505, 228, 337, 337, 316, + /* 10 */ 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, + /* 20 */ 167, 167, 167, -1, 87, 337, 324, 324, 324, 173, + /* 30 */ 173, 167, 167, 167, 380, 167, 167, 317, 505, 595, + /* 40 */ 595, 549, -111, -111, -111, 337, 337, 337, 337, 337, + /* 50 */ 337, 337, 337, 337, 337, 337, 337, 337, 337, 337, + /* 60 */ 337, 337, 337, 337, 337, 324, 324, 324, 118, 118, + /* 70 */ 118, 118, 118, 118, 118, 167, 167, 167, 246, 167, + /* 80 */ 167, 167, 173, 173, 167, 167, 167, 167, -110, -110, + /* 90 */ 259, 173, 167, 167, 167, 167, 167, 167, 167, 167, + /* 100 */ 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, + /* 110 */ 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, + /* 120 */ 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, + /* 130 */ 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, + /* 140 */ 167, 167, 167, 167, 489, 489, 489, 511, 511, 511, + /* 150 */ 489, 511, 489, 498, 464, 497, 496, 495, 494, 493, + /* 160 */ 492, 487, 470, 461, 489, 489, 489, 460, 505, 505, + /* 170 */ 489, 489, 491, 490, 526, 488, 485, 507, 484, 483, + /* 180 */ 460, 549, 489, 482, 482, 489, 482, 489, 482, 489, + /* 190 */ 489, -111, -111, 26, 53, 53, 88, 53, 133, 157, + /* 200 */ 218, 218, 218, 218, 252, 304, 290, -32, -32, -32, + /* 210 */ -32, 243, 97, -75, -66, 56, 56, 93, 50, -37, + /* 220 */ -53, 348, 270, 98, 347, 344, 341, 184, -35, 340, + /* 230 */ 333, 332, 329, 325, 83, 313, 213, 233, -12, 172, + /* 240 */ -60, 250, 241, 134, 262, 253, 46, -11, -5, -58, + /* 250 */ -73, 542, 398, 539, 537, 395, 536, 535, 458, 455, + /* 260 */ 397, 422, 406, 459, 411, 457, 456, 454, 444, 451, + /* 270 */ 453, 450, 439, 449, 447, 446, 522, 445, 443, 442, + /* 280 */ 430, 394, 428, 386, 437, 406, 436, 405, 431, 400, + /* 290 */ 433, 504, 503, 502, 501, 500, 499, 420, 486, 424, + /* 300 */ 419, 417, 385, 416, 478, 432, 479, 352, 351, 392, + /* 310 */ 392, 392, 392, 476, 349, 345, 392, 392, 392, 481, + /* 320 */ 480, 403, 392, 477, 475, 474, 473, 472, 471, 469, + /* 330 */ 468, 467, 466, 465, 463, 452, 448, 435, 413, 330, + /* 340 */ 278, 156, 279, 229, 102, 96, 41, }; -#define YY_REDUCE_USE_DFLT (-157) -#define YY_REDUCE_COUNT (191) -#define YY_REDUCE_MIN (-156) -#define YY_REDUCE_MAX (585) +#define YY_REDUCE_USE_DFLT (-158) +#define YY_REDUCE_COUNT (192) +#define YY_REDUCE_MIN (-157) +#define YY_REDUCE_MAX (594) static const short yy_reduce_ofst[] = { - /* 0 */ -156, -2, -2, 74, 74, -55, 71, 50, -94, 172, - /* 10 */ -138, 10, 170, 165, 164, 158, 156, 155, 106, 88, - /* 20 */ 40, -98, 252, 260, 192, 211, 210, 204, 205, 201, - /* 30 */ 249, 245, -121, 203, 242, 240, 227, 190, 93, -154, - /* 40 */ 216, 179, 6, 221, 585, 584, 583, 582, 581, 580, - /* 50 */ 579, 578, 577, 576, 575, 574, 573, 572, 571, 570, - /* 60 */ 569, 568, 567, 566, 565, 564, 563, 562, 561, 560, - /* 70 */ 559, 558, 557, 445, 556, 555, 554, 434, 553, 552, - /* 80 */ 551, 432, 428, 550, 549, 548, 547, 386, 383, 384, - /* 90 */ 427, 546, 545, 543, 542, 541, 540, 539, 538, 537, - /* 100 */ 536, 535, 534, 533, 527, 526, 525, 524, 523, 522, - /* 110 */ 521, 520, 519, 518, 517, 516, 513, 512, 511, 510, - /* 120 */ 509, 507, 506, 505, 504, 503, 502, 501, 500, 499, - /* 130 */ 454, 451, 450, 448, 446, 444, 442, 440, 439, 438, - /* 140 */ 437, 431, 429, 406, 405, 404, 379, 377, 329, 403, - /* 150 */ 328, 402, 375, 373, 335, 370, 369, 336, 347, 337, - /* 160 */ 348, 344, 339, 401, 398, 385, 349, 381, 374, 378, - /* 170 */ 376, 368, 367, 366, 365, 364, 361, 353, 357, 322, - /* 180 */ 334, 363, 360, 359, 358, 356, 354, 352, 351, 350, - /* 190 */ 338, 346, + /* 0 */ -157, -18, -18, 64, 64, -116, 120, 119, 68, -30, + /* 10 */ 178, -19, -136, 171, 170, 162, 161, 154, 108, 91, + /* 20 */ 60, 54, -48, 258, 273, 206, 222, 217, 216, 207, + /* 30 */ 205, 215, 203, -133, -112, 257, 248, 244, 79, 242, + /* 40 */ 201, 220, 187, 224, 66, 594, 593, 592, 591, 590, + /* 50 */ 589, 588, 587, 586, 585, 584, 583, 582, 581, 580, + /* 60 */ 579, 578, 577, 576, 415, 575, 574, 573, 572, 571, + /* 70 */ 570, 569, 441, 434, 427, 568, 567, 566, 410, 565, + /* 80 */ 564, 563, 409, 402, 562, 561, 560, 559, 390, 339, + /* 90 */ 401, 399, 558, 557, 556, 555, 554, 553, 552, 551, + /* 100 */ 550, 548, 547, 546, 545, 544, 543, 541, 540, 538, + /* 110 */ 534, 533, 532, 531, 530, 529, 528, 527, 525, 524, + /* 120 */ 523, 521, 520, 519, 518, 517, 516, 515, 514, 513, + /* 130 */ 512, 510, 509, 508, 506, 462, 440, 438, 429, 426, + /* 140 */ 425, 423, 421, 418, 414, 412, 408, 384, 383, 338, + /* 150 */ 407, 335, 404, 382, 381, 378, 342, 377, 343, 376, + /* 160 */ 357, 375, 346, 350, 396, 393, 391, 374, 388, 379, + /* 170 */ 389, 387, 373, 372, 360, 371, 369, 368, 364, 361, + /* 180 */ 328, 355, 370, 367, 366, 365, 363, 362, 359, 358, + /* 190 */ 356, 354, 353, }; static const YYACTIONTYPE yy_default[] = { - /* 0 */ 827, 656, 599, 668, 587, 596, 805, 805, 827, 827, - /* 10 */ 827, 827, 827, 827, 827, 827, 827, 827, 827, 827, - /* 20 */ 827, 827, 716, 559, 805, 827, 827, 827, 827, 827, - /* 30 */ 827, 827, 827, 596, 827, 827, 602, 596, 602, 602, - /* 40 */ 827, 711, 640, 658, 827, 827, 827, 827, 827, 827, - /* 50 */ 827, 827, 827, 827, 827, 827, 827, 827, 827, 827, - /* 60 */ 827, 827, 827, 827, 827, 827, 827, 827, 827, 827, - /* 70 */ 827, 827, 827, 827, 827, 827, 827, 718, 724, 721, - /* 80 */ 827, 827, 827, 726, 827, 827, 827, 748, 748, 709, - /* 90 */ 827, 827, 827, 827, 827, 827, 827, 827, 827, 827, - /* 100 */ 827, 827, 827, 827, 827, 827, 827, 827, 827, 827, - /* 110 */ 827, 827, 827, 827, 827, 827, 827, 827, 827, 585, - /* 120 */ 827, 583, 827, 827, 827, 827, 827, 827, 827, 827, - /* 130 */ 827, 827, 827, 827, 827, 827, 570, 827, 827, 827, - /* 140 */ 827, 827, 827, 561, 561, 561, 827, 827, 827, 561, - /* 150 */ 827, 561, 755, 759, 753, 741, 749, 740, 736, 734, - /* 160 */ 732, 731, 763, 561, 561, 561, 600, 596, 596, 561, - /* 170 */ 561, 618, 616, 614, 606, 612, 608, 610, 604, 588, - /* 180 */ 827, 561, 594, 594, 561, 594, 561, 594, 561, 561, - /* 190 */ 640, 658, 827, 764, 827, 804, 754, 794, 793, 800, - /* 200 */ 792, 791, 790, 827, 827, 827, 786, 787, 789, 788, - /* 210 */ 827, 827, 827, 796, 795, 827, 827, 827, 827, 827, - /* 220 */ 827, 827, 827, 827, 827, 827, 827, 827, 827, 766, - /* 230 */ 827, 760, 756, 827, 827, 827, 827, 827, 827, 827, - /* 240 */ 827, 827, 827, 827, 827, 827, 670, 827, 827, 827, - /* 250 */ 827, 827, 827, 827, 827, 827, 827, 827, 827, 708, - /* 260 */ 827, 827, 827, 827, 827, 720, 719, 827, 827, 827, - /* 270 */ 827, 827, 827, 827, 827, 827, 827, 827, 750, 827, - /* 280 */ 742, 827, 827, 827, 827, 827, 682, 827, 827, 827, - /* 290 */ 827, 827, 827, 827, 827, 827, 827, 827, 827, 827, - /* 300 */ 827, 827, 827, 827, 823, 818, 819, 816, 827, 827, - /* 310 */ 827, 815, 810, 811, 827, 827, 827, 808, 827, 827, - /* 320 */ 827, 827, 827, 827, 827, 827, 827, 827, 827, 827, - /* 330 */ 827, 827, 827, 827, 827, 624, 827, 568, 566, 827, - /* 340 */ 557, 827, 826, 825, 824, 807, 806, 678, 717, 713, - /* 350 */ 715, 714, 712, 725, 722, 723, 707, 706, 705, 727, - /* 360 */ 710, 730, 729, 733, 735, 738, 737, 739, 728, 752, - /* 370 */ 751, 744, 745, 747, 746, 743, 783, 802, 803, 801, - /* 380 */ 799, 798, 797, 782, 781, 780, 777, 776, 775, 772, - /* 390 */ 778, 774, 771, 779, 773, 770, 769, 768, 767, 765, - /* 400 */ 785, 784, 762, 761, 758, 757, 704, 688, 683, 680, - /* 410 */ 687, 686, 685, 693, 692, 684, 681, 677, 676, 601, - /* 420 */ 657, 655, 654, 653, 652, 651, 650, 649, 648, 647, - /* 430 */ 646, 645, 644, 643, 642, 641, 636, 632, 630, 629, - /* 440 */ 628, 625, 595, 598, 597, 822, 821, 820, 817, 814, - /* 450 */ 703, 702, 701, 700, 699, 698, 697, 696, 695, 694, - /* 460 */ 813, 812, 809, 690, 691, 672, 675, 674, 673, 671, - /* 470 */ 689, 620, 619, 617, 615, 607, 613, 609, 611, 605, - /* 480 */ 603, 590, 589, 669, 639, 667, 666, 665, 664, 663, - /* 490 */ 662, 661, 660, 659, 638, 637, 635, 634, 633, 631, - /* 500 */ 627, 626, 622, 623, 621, 586, 584, 582, 581, 580, - /* 510 */ 579, 578, 577, 576, 575, 574, 573, 593, 572, 571, - /* 520 */ 569, 567, 565, 564, 563, 592, 591, 562, 560, 558, - /* 530 */ 556, 555, 554, 553, 552, 551, 550, 549, 548, 547, - /* 540 */ 546, 545, 544, + /* 0 */ 834, 663, 606, 675, 593, 603, 812, 812, 812, 834, + /* 10 */ 834, 834, 834, 834, 834, 834, 834, 834, 834, 834, + /* 20 */ 834, 834, 834, 723, 565, 812, 834, 834, 834, 834, + /* 30 */ 834, 834, 834, 834, 603, 834, 834, 609, 603, 609, + /* 40 */ 609, 834, 718, 647, 665, 834, 834, 834, 834, 834, + /* 50 */ 834, 834, 834, 834, 834, 834, 834, 834, 834, 834, + /* 60 */ 834, 834, 834, 834, 834, 834, 834, 834, 834, 834, + /* 70 */ 834, 834, 834, 834, 834, 834, 834, 834, 725, 731, + /* 80 */ 728, 834, 834, 834, 733, 834, 834, 834, 755, 755, + /* 90 */ 716, 834, 834, 834, 834, 834, 834, 834, 834, 834, + /* 100 */ 834, 834, 834, 834, 834, 834, 834, 834, 834, 834, + /* 110 */ 834, 834, 834, 834, 834, 834, 834, 834, 834, 834, + /* 120 */ 591, 834, 589, 834, 834, 834, 834, 834, 834, 834, + /* 130 */ 834, 834, 834, 834, 834, 834, 834, 576, 834, 834, + /* 140 */ 834, 834, 834, 834, 567, 567, 567, 834, 834, 834, + /* 150 */ 567, 834, 567, 762, 766, 760, 748, 756, 747, 743, + /* 160 */ 741, 739, 738, 770, 567, 567, 567, 607, 603, 603, + /* 170 */ 567, 567, 625, 623, 621, 613, 619, 615, 617, 611, + /* 180 */ 594, 834, 567, 601, 601, 567, 601, 567, 601, 567, + /* 190 */ 567, 647, 665, 834, 771, 761, 834, 811, 801, 800, + /* 200 */ 807, 799, 798, 797, 834, 834, 834, 793, 796, 795, + /* 210 */ 794, 834, 834, 834, 834, 803, 802, 834, 834, 834, + /* 220 */ 834, 834, 834, 834, 834, 834, 834, 767, 763, 834, + /* 230 */ 834, 834, 834, 834, 834, 834, 834, 834, 773, 834, + /* 240 */ 834, 834, 834, 834, 834, 834, 834, 834, 677, 834, + /* 250 */ 834, 834, 834, 834, 834, 834, 834, 834, 834, 834, + /* 260 */ 834, 715, 834, 834, 834, 834, 834, 727, 726, 834, + /* 270 */ 834, 834, 834, 834, 834, 834, 834, 834, 834, 834, + /* 280 */ 757, 834, 749, 834, 834, 689, 834, 834, 834, 834, + /* 290 */ 834, 834, 834, 834, 834, 834, 834, 834, 834, 834, + /* 300 */ 834, 834, 834, 834, 834, 834, 834, 834, 834, 830, + /* 310 */ 825, 826, 823, 834, 834, 834, 822, 817, 818, 834, + /* 320 */ 834, 834, 815, 834, 834, 834, 834, 834, 834, 834, + /* 330 */ 834, 834, 834, 834, 834, 834, 834, 834, 834, 834, + /* 340 */ 631, 834, 574, 572, 834, 563, 834, 833, 832, 831, + /* 350 */ 814, 813, 685, 724, 720, 722, 721, 719, 732, 729, + /* 360 */ 730, 714, 713, 712, 734, 717, 737, 736, 740, 742, + /* 370 */ 745, 744, 746, 735, 759, 758, 751, 752, 754, 753, + /* 380 */ 750, 769, 768, 765, 764, 711, 695, 690, 687, 694, + /* 390 */ 693, 692, 700, 699, 691, 688, 684, 683, 608, 664, + /* 400 */ 662, 661, 660, 659, 658, 657, 656, 655, 654, 653, + /* 410 */ 652, 651, 650, 649, 648, 643, 639, 637, 636, 635, + /* 420 */ 632, 602, 605, 604, 809, 810, 808, 806, 805, 804, + /* 430 */ 790, 789, 788, 787, 784, 783, 782, 779, 785, 781, + /* 440 */ 778, 786, 780, 777, 776, 775, 774, 792, 791, 772, + /* 450 */ 597, 829, 828, 827, 824, 821, 710, 709, 708, 707, + /* 460 */ 706, 705, 704, 703, 702, 701, 820, 819, 816, 697, + /* 470 */ 698, 679, 682, 681, 680, 678, 696, 627, 626, 624, + /* 480 */ 622, 614, 620, 616, 618, 612, 610, 596, 595, 676, + /* 490 */ 646, 674, 673, 672, 671, 670, 669, 668, 667, 666, + /* 500 */ 645, 644, 642, 641, 640, 638, 634, 633, 629, 630, + /* 510 */ 628, 592, 590, 588, 587, 586, 585, 584, 583, 582, + /* 520 */ 581, 580, 579, 600, 578, 577, 575, 573, 571, 570, + /* 530 */ 569, 599, 598, 568, 566, 564, 562, 561, 560, 559, + /* 540 */ 558, 557, 556, 555, 554, 553, 552, 551, 550, }; /* The next table maps tokens into fallback tokens. If a construct @@ -558,6 +560,9 @@ static const YYCODETYPE yyFallback[] = { 0, /* PASS => nothing */ 0, /* PRIVILEGE => nothing */ 0, /* LOCAL => nothing */ + 0, /* COMPACT => nothing */ + 0, /* LP => nothing */ + 0, /* RP => nothing */ 0, /* IF => nothing */ 0, /* EXISTS => nothing */ 0, /* PPS => nothing */ @@ -584,8 +589,6 @@ static const YYCODETYPE yyFallback[] = { 0, /* UPDATE => nothing */ 0, /* CACHELAST => nothing */ 0, /* PARTITIONS => nothing */ - 0, /* LP => nothing */ - 0, /* RP => nothing */ 0, /* UNSIGNED => nothing */ 0, /* TAGS => nothing */ 0, /* USING => nothing */ @@ -765,55 +768,55 @@ static const char *const yyTokenName[] = { "DATABASE", "TABLES", "STABLES", "VGROUPS", "DROP", "TOPIC", "DNODE", "USER", "ACCOUNT", "USE", "DESCRIBE", "ALTER", - "PASS", "PRIVILEGE", "LOCAL", "IF", - "EXISTS", "PPS", "TSERIES", "DBS", - "STORAGE", "QTIME", "CONNS", "STATE", - "COMMA", "KEEP", "CACHE", "REPLICA", - "QUORUM", "DAYS", "MINROWS", "MAXROWS", - "BLOCKS", "CTIME", "WAL", "FSYNC", - "COMP", "PRECISION", "UPDATE", "CACHELAST", - "PARTITIONS", "LP", "RP", "UNSIGNED", - "TAGS", "USING", "AS", "NULL", - "NOW", "SELECT", "UNION", "ALL", - "DISTINCT", "FROM", "VARIABLE", "INTERVAL", - "SESSION", "STATE_WINDOW", "FILL", "SLIDING", - "ORDER", "BY", "ASC", "DESC", - "GROUP", "HAVING", "LIMIT", "OFFSET", - "SLIMIT", "SOFFSET", "WHERE", "RESET", - "QUERY", "SYNCDB", "ADD", "COLUMN", - "MODIFY", "TAG", "CHANGE", "SET", - "KILL", "CONNECTION", "STREAM", "COLON", - "ABORT", "AFTER", "ATTACH", "BEFORE", - "BEGIN", "CASCADE", "CLUSTER", "CONFLICT", - "COPY", "DEFERRED", "DELIMITERS", "DETACH", - "EACH", "END", "EXPLAIN", "FAIL", - "FOR", "IGNORE", "IMMEDIATE", "INITIALLY", - "INSTEAD", "MATCH", "KEY", "OF", - "RAISE", "REPLACE", "RESTRICT", "ROW", - "STATEMENT", "TRIGGER", "VIEW", "SEMI", - "NONE", "PREV", "LINEAR", "IMPORT", - "TBNAME", "JOIN", "INSERT", "INTO", - "VALUES", "error", "program", "cmd", - "dbPrefix", "ids", "cpxName", "ifexists", - "alter_db_optr", "alter_topic_optr", "acct_optr", "ifnotexists", - "db_optr", "topic_optr", "pps", "tseries", - "dbs", "streams", "storage", "qtime", - "users", "conns", "state", "intitemlist", - "intitem", "keep", "cache", "replica", - "quorum", "days", "minrows", "maxrows", - "blocks", "ctime", "wal", "fsync", - "comp", "prec", "update", "cachelast", - "partitions", "typename", "signed", "create_table_args", - "create_stable_args", "create_table_list", "create_from_stable", "columnlist", - "tagitemlist", "tagNamelist", "select", "column", - "tagitem", "selcollist", "from", "where_opt", - "interval_opt", "session_option", "windowstate_option", "fill_opt", - "sliding_opt", "groupby_opt", "orderby_opt", "having_opt", - "slimit_opt", "limit_opt", "union", "sclp", - "distinct", "expr", "as", "tablelist", - "sub", "tmvar", "sortlist", "sortitem", - "item", "sortorder", "grouplist", "exprlist", - "expritem", + "PASS", "PRIVILEGE", "LOCAL", "COMPACT", + "LP", "RP", "IF", "EXISTS", + "PPS", "TSERIES", "DBS", "STORAGE", + "QTIME", "CONNS", "STATE", "COMMA", + "KEEP", "CACHE", "REPLICA", "QUORUM", + "DAYS", "MINROWS", "MAXROWS", "BLOCKS", + "CTIME", "WAL", "FSYNC", "COMP", + "PRECISION", "UPDATE", "CACHELAST", "PARTITIONS", + "UNSIGNED", "TAGS", "USING", "AS", + "NULL", "NOW", "SELECT", "UNION", + "ALL", "DISTINCT", "FROM", "VARIABLE", + "INTERVAL", "SESSION", "STATE_WINDOW", "FILL", + "SLIDING", "ORDER", "BY", "ASC", + "DESC", "GROUP", "HAVING", "LIMIT", + "OFFSET", "SLIMIT", "SOFFSET", "WHERE", + "RESET", "QUERY", "SYNCDB", "ADD", + "COLUMN", "MODIFY", "TAG", "CHANGE", + "SET", "KILL", "CONNECTION", "STREAM", + "COLON", "ABORT", "AFTER", "ATTACH", + "BEFORE", "BEGIN", "CASCADE", "CLUSTER", + "CONFLICT", "COPY", "DEFERRED", "DELIMITERS", + "DETACH", "EACH", "END", "EXPLAIN", + "FAIL", "FOR", "IGNORE", "IMMEDIATE", + "INITIALLY", "INSTEAD", "MATCH", "KEY", + "OF", "RAISE", "REPLACE", "RESTRICT", + "ROW", "STATEMENT", "TRIGGER", "VIEW", + "SEMI", "NONE", "PREV", "LINEAR", + "IMPORT", "TBNAME", "JOIN", "INSERT", + "INTO", "VALUES", "error", "program", + "cmd", "dbPrefix", "ids", "cpxName", + "ifexists", "alter_db_optr", "alter_topic_optr", "acct_optr", + "exprlist", "ifnotexists", "db_optr", "topic_optr", + "pps", "tseries", "dbs", "streams", + "storage", "qtime", "users", "conns", + "state", "intitemlist", "intitem", "keep", + "cache", "replica", "quorum", "days", + "minrows", "maxrows", "blocks", "ctime", + "wal", "fsync", "comp", "prec", + "update", "cachelast", "partitions", "typename", + "signed", "create_table_args", "create_stable_args", "create_table_list", + "create_from_stable", "columnlist", "tagitemlist", "tagNamelist", + "select", "column", "tagitem", "selcollist", + "from", "where_opt", "interval_opt", "session_option", + "windowstate_option", "fill_opt", "sliding_opt", "groupby_opt", + "orderby_opt", "having_opt", "slimit_opt", "limit_opt", + "union", "sclp", "distinct", "expr", + "as", "tablelist", "sub", "tmvar", + "sortlist", "sortitem", "item", "sortorder", + "grouplist", "expritem", }; #endif /* NDEBUG */ @@ -869,242 +872,243 @@ static const char *const yyRuleName[] = { /* 45 */ "cmd ::= ALTER TOPIC ids alter_topic_optr", /* 46 */ "cmd ::= ALTER ACCOUNT ids acct_optr", /* 47 */ "cmd ::= ALTER ACCOUNT ids PASS ids acct_optr", - /* 48 */ "ids ::= ID", - /* 49 */ "ids ::= STRING", - /* 50 */ "ifexists ::= IF EXISTS", - /* 51 */ "ifexists ::=", - /* 52 */ "ifnotexists ::= IF NOT EXISTS", - /* 53 */ "ifnotexists ::=", - /* 54 */ "cmd ::= CREATE DNODE ids", - /* 55 */ "cmd ::= CREATE ACCOUNT ids PASS ids acct_optr", - /* 56 */ "cmd ::= CREATE DATABASE ifnotexists ids db_optr", - /* 57 */ "cmd ::= CREATE TOPIC ifnotexists ids topic_optr", - /* 58 */ "cmd ::= CREATE USER ids PASS ids", - /* 59 */ "pps ::=", - /* 60 */ "pps ::= PPS INTEGER", - /* 61 */ "tseries ::=", - /* 62 */ "tseries ::= TSERIES INTEGER", - /* 63 */ "dbs ::=", - /* 64 */ "dbs ::= DBS INTEGER", - /* 65 */ "streams ::=", - /* 66 */ "streams ::= STREAMS INTEGER", - /* 67 */ "storage ::=", - /* 68 */ "storage ::= STORAGE INTEGER", - /* 69 */ "qtime ::=", - /* 70 */ "qtime ::= QTIME INTEGER", - /* 71 */ "users ::=", - /* 72 */ "users ::= USERS INTEGER", - /* 73 */ "conns ::=", - /* 74 */ "conns ::= CONNS INTEGER", - /* 75 */ "state ::=", - /* 76 */ "state ::= STATE ids", - /* 77 */ "acct_optr ::= pps tseries storage streams qtime dbs users conns state", - /* 78 */ "intitemlist ::= intitemlist COMMA intitem", - /* 79 */ "intitemlist ::= intitem", - /* 80 */ "intitem ::= INTEGER", - /* 81 */ "keep ::= KEEP intitemlist", - /* 82 */ "cache ::= CACHE INTEGER", - /* 83 */ "replica ::= REPLICA INTEGER", - /* 84 */ "quorum ::= QUORUM INTEGER", - /* 85 */ "days ::= DAYS INTEGER", - /* 86 */ "minrows ::= MINROWS INTEGER", - /* 87 */ "maxrows ::= MAXROWS INTEGER", - /* 88 */ "blocks ::= BLOCKS INTEGER", - /* 89 */ "ctime ::= CTIME INTEGER", - /* 90 */ "wal ::= WAL INTEGER", - /* 91 */ "fsync ::= FSYNC INTEGER", - /* 92 */ "comp ::= COMP INTEGER", - /* 93 */ "prec ::= PRECISION STRING", - /* 94 */ "update ::= UPDATE INTEGER", - /* 95 */ "cachelast ::= CACHELAST INTEGER", - /* 96 */ "partitions ::= PARTITIONS INTEGER", - /* 97 */ "db_optr ::=", - /* 98 */ "db_optr ::= db_optr cache", - /* 99 */ "db_optr ::= db_optr replica", - /* 100 */ "db_optr ::= db_optr quorum", - /* 101 */ "db_optr ::= db_optr days", - /* 102 */ "db_optr ::= db_optr minrows", - /* 103 */ "db_optr ::= db_optr maxrows", - /* 104 */ "db_optr ::= db_optr blocks", - /* 105 */ "db_optr ::= db_optr ctime", - /* 106 */ "db_optr ::= db_optr wal", - /* 107 */ "db_optr ::= db_optr fsync", - /* 108 */ "db_optr ::= db_optr comp", - /* 109 */ "db_optr ::= db_optr prec", - /* 110 */ "db_optr ::= db_optr keep", - /* 111 */ "db_optr ::= db_optr update", - /* 112 */ "db_optr ::= db_optr cachelast", - /* 113 */ "topic_optr ::= db_optr", - /* 114 */ "topic_optr ::= topic_optr partitions", - /* 115 */ "alter_db_optr ::=", - /* 116 */ "alter_db_optr ::= alter_db_optr replica", - /* 117 */ "alter_db_optr ::= alter_db_optr quorum", - /* 118 */ "alter_db_optr ::= alter_db_optr keep", - /* 119 */ "alter_db_optr ::= alter_db_optr blocks", - /* 120 */ "alter_db_optr ::= alter_db_optr comp", - /* 121 */ "alter_db_optr ::= alter_db_optr wal", - /* 122 */ "alter_db_optr ::= alter_db_optr fsync", - /* 123 */ "alter_db_optr ::= alter_db_optr update", - /* 124 */ "alter_db_optr ::= alter_db_optr cachelast", - /* 125 */ "alter_topic_optr ::= alter_db_optr", - /* 126 */ "alter_topic_optr ::= alter_topic_optr partitions", - /* 127 */ "typename ::= ids", - /* 128 */ "typename ::= ids LP signed RP", - /* 129 */ "typename ::= ids UNSIGNED", - /* 130 */ "signed ::= INTEGER", - /* 131 */ "signed ::= PLUS INTEGER", - /* 132 */ "signed ::= MINUS INTEGER", - /* 133 */ "cmd ::= CREATE TABLE create_table_args", - /* 134 */ "cmd ::= CREATE TABLE create_stable_args", - /* 135 */ "cmd ::= CREATE STABLE create_stable_args", - /* 136 */ "cmd ::= CREATE TABLE create_table_list", - /* 137 */ "create_table_list ::= create_from_stable", - /* 138 */ "create_table_list ::= create_table_list create_from_stable", - /* 139 */ "create_table_args ::= ifnotexists ids cpxName LP columnlist RP", - /* 140 */ "create_stable_args ::= ifnotexists ids cpxName LP columnlist RP TAGS LP columnlist RP", - /* 141 */ "create_from_stable ::= ifnotexists ids cpxName USING ids cpxName TAGS LP tagitemlist RP", - /* 142 */ "create_from_stable ::= ifnotexists ids cpxName USING ids cpxName LP tagNamelist RP TAGS LP tagitemlist RP", - /* 143 */ "tagNamelist ::= tagNamelist COMMA ids", - /* 144 */ "tagNamelist ::= ids", - /* 145 */ "create_table_args ::= ifnotexists ids cpxName AS select", - /* 146 */ "columnlist ::= columnlist COMMA column", - /* 147 */ "columnlist ::= column", - /* 148 */ "column ::= ids typename", - /* 149 */ "tagitemlist ::= tagitemlist COMMA tagitem", - /* 150 */ "tagitemlist ::= tagitem", - /* 151 */ "tagitem ::= INTEGER", - /* 152 */ "tagitem ::= FLOAT", - /* 153 */ "tagitem ::= STRING", - /* 154 */ "tagitem ::= BOOL", - /* 155 */ "tagitem ::= NULL", - /* 156 */ "tagitem ::= NOW", - /* 157 */ "tagitem ::= MINUS INTEGER", - /* 158 */ "tagitem ::= MINUS FLOAT", - /* 159 */ "tagitem ::= PLUS INTEGER", - /* 160 */ "tagitem ::= PLUS FLOAT", - /* 161 */ "select ::= SELECT selcollist from where_opt interval_opt session_option windowstate_option fill_opt sliding_opt groupby_opt orderby_opt having_opt slimit_opt limit_opt", - /* 162 */ "select ::= LP select RP", - /* 163 */ "union ::= select", - /* 164 */ "union ::= union UNION ALL select", - /* 165 */ "cmd ::= union", - /* 166 */ "select ::= SELECT selcollist", - /* 167 */ "sclp ::= selcollist COMMA", - /* 168 */ "sclp ::=", - /* 169 */ "selcollist ::= sclp distinct expr as", - /* 170 */ "selcollist ::= sclp STAR", - /* 171 */ "as ::= AS ids", - /* 172 */ "as ::= ids", - /* 173 */ "as ::=", - /* 174 */ "distinct ::= DISTINCT", - /* 175 */ "distinct ::=", - /* 176 */ "from ::= FROM tablelist", - /* 177 */ "from ::= FROM sub", - /* 178 */ "sub ::= LP union RP", - /* 179 */ "sub ::= LP union RP ids", - /* 180 */ "sub ::= sub COMMA LP union RP ids", - /* 181 */ "tablelist ::= ids cpxName", - /* 182 */ "tablelist ::= ids cpxName ids", - /* 183 */ "tablelist ::= tablelist COMMA ids cpxName", - /* 184 */ "tablelist ::= tablelist COMMA ids cpxName ids", - /* 185 */ "tmvar ::= VARIABLE", - /* 186 */ "interval_opt ::= INTERVAL LP tmvar RP", - /* 187 */ "interval_opt ::= INTERVAL LP tmvar COMMA tmvar RP", - /* 188 */ "interval_opt ::=", - /* 189 */ "session_option ::=", - /* 190 */ "session_option ::= SESSION LP ids cpxName COMMA tmvar RP", - /* 191 */ "windowstate_option ::=", - /* 192 */ "windowstate_option ::= STATE_WINDOW LP ids RP", - /* 193 */ "fill_opt ::=", - /* 194 */ "fill_opt ::= FILL LP ID COMMA tagitemlist RP", - /* 195 */ "fill_opt ::= FILL LP ID RP", - /* 196 */ "sliding_opt ::= SLIDING LP tmvar RP", - /* 197 */ "sliding_opt ::=", - /* 198 */ "orderby_opt ::=", - /* 199 */ "orderby_opt ::= ORDER BY sortlist", - /* 200 */ "sortlist ::= sortlist COMMA item sortorder", - /* 201 */ "sortlist ::= item sortorder", - /* 202 */ "item ::= ids cpxName", - /* 203 */ "sortorder ::= ASC", - /* 204 */ "sortorder ::= DESC", - /* 205 */ "sortorder ::=", - /* 206 */ "groupby_opt ::=", - /* 207 */ "groupby_opt ::= GROUP BY grouplist", - /* 208 */ "grouplist ::= grouplist COMMA item", - /* 209 */ "grouplist ::= item", - /* 210 */ "having_opt ::=", - /* 211 */ "having_opt ::= HAVING expr", - /* 212 */ "limit_opt ::=", - /* 213 */ "limit_opt ::= LIMIT signed", - /* 214 */ "limit_opt ::= LIMIT signed OFFSET signed", - /* 215 */ "limit_opt ::= LIMIT signed COMMA signed", - /* 216 */ "slimit_opt ::=", - /* 217 */ "slimit_opt ::= SLIMIT signed", - /* 218 */ "slimit_opt ::= SLIMIT signed SOFFSET signed", - /* 219 */ "slimit_opt ::= SLIMIT signed COMMA signed", - /* 220 */ "where_opt ::=", - /* 221 */ "where_opt ::= WHERE expr", - /* 222 */ "expr ::= LP expr RP", - /* 223 */ "expr ::= ID", - /* 224 */ "expr ::= ID DOT ID", - /* 225 */ "expr ::= ID DOT STAR", - /* 226 */ "expr ::= INTEGER", - /* 227 */ "expr ::= MINUS INTEGER", - /* 228 */ "expr ::= PLUS INTEGER", - /* 229 */ "expr ::= FLOAT", - /* 230 */ "expr ::= MINUS FLOAT", - /* 231 */ "expr ::= PLUS FLOAT", - /* 232 */ "expr ::= STRING", - /* 233 */ "expr ::= NOW", - /* 234 */ "expr ::= VARIABLE", - /* 235 */ "expr ::= PLUS VARIABLE", - /* 236 */ "expr ::= MINUS VARIABLE", - /* 237 */ "expr ::= BOOL", - /* 238 */ "expr ::= NULL", - /* 239 */ "expr ::= ID LP exprlist RP", - /* 240 */ "expr ::= ID LP STAR RP", - /* 241 */ "expr ::= expr IS NULL", - /* 242 */ "expr ::= expr IS NOT NULL", - /* 243 */ "expr ::= expr LT expr", - /* 244 */ "expr ::= expr GT expr", - /* 245 */ "expr ::= expr LE expr", - /* 246 */ "expr ::= expr GE expr", - /* 247 */ "expr ::= expr NE expr", - /* 248 */ "expr ::= expr EQ expr", - /* 249 */ "expr ::= expr BETWEEN expr AND expr", - /* 250 */ "expr ::= expr AND expr", - /* 251 */ "expr ::= expr OR expr", - /* 252 */ "expr ::= expr PLUS expr", - /* 253 */ "expr ::= expr MINUS expr", - /* 254 */ "expr ::= expr STAR expr", - /* 255 */ "expr ::= expr SLASH expr", - /* 256 */ "expr ::= expr REM expr", - /* 257 */ "expr ::= expr LIKE expr", - /* 258 */ "expr ::= expr IN LP exprlist RP", - /* 259 */ "exprlist ::= exprlist COMMA expritem", - /* 260 */ "exprlist ::= expritem", - /* 261 */ "expritem ::= expr", - /* 262 */ "expritem ::=", - /* 263 */ "cmd ::= RESET QUERY CACHE", - /* 264 */ "cmd ::= SYNCDB ids REPLICA", - /* 265 */ "cmd ::= ALTER TABLE ids cpxName ADD COLUMN columnlist", - /* 266 */ "cmd ::= ALTER TABLE ids cpxName DROP COLUMN ids", - /* 267 */ "cmd ::= ALTER TABLE ids cpxName MODIFY COLUMN columnlist", - /* 268 */ "cmd ::= ALTER TABLE ids cpxName ADD TAG columnlist", - /* 269 */ "cmd ::= ALTER TABLE ids cpxName DROP TAG ids", - /* 270 */ "cmd ::= ALTER TABLE ids cpxName CHANGE TAG ids ids", - /* 271 */ "cmd ::= ALTER TABLE ids cpxName SET TAG ids EQ tagitem", - /* 272 */ "cmd ::= ALTER TABLE ids cpxName MODIFY TAG columnlist", - /* 273 */ "cmd ::= ALTER STABLE ids cpxName ADD COLUMN columnlist", - /* 274 */ "cmd ::= ALTER STABLE ids cpxName DROP COLUMN ids", - /* 275 */ "cmd ::= ALTER STABLE ids cpxName MODIFY COLUMN columnlist", - /* 276 */ "cmd ::= ALTER STABLE ids cpxName ADD TAG columnlist", - /* 277 */ "cmd ::= ALTER STABLE ids cpxName DROP TAG ids", - /* 278 */ "cmd ::= ALTER STABLE ids cpxName CHANGE TAG ids ids", - /* 279 */ "cmd ::= ALTER STABLE ids cpxName SET TAG ids EQ tagitem", - /* 280 */ "cmd ::= ALTER STABLE ids cpxName MODIFY TAG columnlist", - /* 281 */ "cmd ::= KILL CONNECTION INTEGER", - /* 282 */ "cmd ::= KILL STREAM INTEGER COLON INTEGER", - /* 283 */ "cmd ::= KILL QUERY INTEGER COLON INTEGER", + /* 48 */ "cmd ::= COMPACT VNODES IN LP exprlist RP", + /* 49 */ "ids ::= ID", + /* 50 */ "ids ::= STRING", + /* 51 */ "ifexists ::= IF EXISTS", + /* 52 */ "ifexists ::=", + /* 53 */ "ifnotexists ::= IF NOT EXISTS", + /* 54 */ "ifnotexists ::=", + /* 55 */ "cmd ::= CREATE DNODE ids", + /* 56 */ "cmd ::= CREATE ACCOUNT ids PASS ids acct_optr", + /* 57 */ "cmd ::= CREATE DATABASE ifnotexists ids db_optr", + /* 58 */ "cmd ::= CREATE TOPIC ifnotexists ids topic_optr", + /* 59 */ "cmd ::= CREATE USER ids PASS ids", + /* 60 */ "pps ::=", + /* 61 */ "pps ::= PPS INTEGER", + /* 62 */ "tseries ::=", + /* 63 */ "tseries ::= TSERIES INTEGER", + /* 64 */ "dbs ::=", + /* 65 */ "dbs ::= DBS INTEGER", + /* 66 */ "streams ::=", + /* 67 */ "streams ::= STREAMS INTEGER", + /* 68 */ "storage ::=", + /* 69 */ "storage ::= STORAGE INTEGER", + /* 70 */ "qtime ::=", + /* 71 */ "qtime ::= QTIME INTEGER", + /* 72 */ "users ::=", + /* 73 */ "users ::= USERS INTEGER", + /* 74 */ "conns ::=", + /* 75 */ "conns ::= CONNS INTEGER", + /* 76 */ "state ::=", + /* 77 */ "state ::= STATE ids", + /* 78 */ "acct_optr ::= pps tseries storage streams qtime dbs users conns state", + /* 79 */ "intitemlist ::= intitemlist COMMA intitem", + /* 80 */ "intitemlist ::= intitem", + /* 81 */ "intitem ::= INTEGER", + /* 82 */ "keep ::= KEEP intitemlist", + /* 83 */ "cache ::= CACHE INTEGER", + /* 84 */ "replica ::= REPLICA INTEGER", + /* 85 */ "quorum ::= QUORUM INTEGER", + /* 86 */ "days ::= DAYS INTEGER", + /* 87 */ "minrows ::= MINROWS INTEGER", + /* 88 */ "maxrows ::= MAXROWS INTEGER", + /* 89 */ "blocks ::= BLOCKS INTEGER", + /* 90 */ "ctime ::= CTIME INTEGER", + /* 91 */ "wal ::= WAL INTEGER", + /* 92 */ "fsync ::= FSYNC INTEGER", + /* 93 */ "comp ::= COMP INTEGER", + /* 94 */ "prec ::= PRECISION STRING", + /* 95 */ "update ::= UPDATE INTEGER", + /* 96 */ "cachelast ::= CACHELAST INTEGER", + /* 97 */ "partitions ::= PARTITIONS INTEGER", + /* 98 */ "db_optr ::=", + /* 99 */ "db_optr ::= db_optr cache", + /* 100 */ "db_optr ::= db_optr replica", + /* 101 */ "db_optr ::= db_optr quorum", + /* 102 */ "db_optr ::= db_optr days", + /* 103 */ "db_optr ::= db_optr minrows", + /* 104 */ "db_optr ::= db_optr maxrows", + /* 105 */ "db_optr ::= db_optr blocks", + /* 106 */ "db_optr ::= db_optr ctime", + /* 107 */ "db_optr ::= db_optr wal", + /* 108 */ "db_optr ::= db_optr fsync", + /* 109 */ "db_optr ::= db_optr comp", + /* 110 */ "db_optr ::= db_optr prec", + /* 111 */ "db_optr ::= db_optr keep", + /* 112 */ "db_optr ::= db_optr update", + /* 113 */ "db_optr ::= db_optr cachelast", + /* 114 */ "topic_optr ::= db_optr", + /* 115 */ "topic_optr ::= topic_optr partitions", + /* 116 */ "alter_db_optr ::=", + /* 117 */ "alter_db_optr ::= alter_db_optr replica", + /* 118 */ "alter_db_optr ::= alter_db_optr quorum", + /* 119 */ "alter_db_optr ::= alter_db_optr keep", + /* 120 */ "alter_db_optr ::= alter_db_optr blocks", + /* 121 */ "alter_db_optr ::= alter_db_optr comp", + /* 122 */ "alter_db_optr ::= alter_db_optr wal", + /* 123 */ "alter_db_optr ::= alter_db_optr fsync", + /* 124 */ "alter_db_optr ::= alter_db_optr update", + /* 125 */ "alter_db_optr ::= alter_db_optr cachelast", + /* 126 */ "alter_topic_optr ::= alter_db_optr", + /* 127 */ "alter_topic_optr ::= alter_topic_optr partitions", + /* 128 */ "typename ::= ids", + /* 129 */ "typename ::= ids LP signed RP", + /* 130 */ "typename ::= ids UNSIGNED", + /* 131 */ "signed ::= INTEGER", + /* 132 */ "signed ::= PLUS INTEGER", + /* 133 */ "signed ::= MINUS INTEGER", + /* 134 */ "cmd ::= CREATE TABLE create_table_args", + /* 135 */ "cmd ::= CREATE TABLE create_stable_args", + /* 136 */ "cmd ::= CREATE STABLE create_stable_args", + /* 137 */ "cmd ::= CREATE TABLE create_table_list", + /* 138 */ "create_table_list ::= create_from_stable", + /* 139 */ "create_table_list ::= create_table_list create_from_stable", + /* 140 */ "create_table_args ::= ifnotexists ids cpxName LP columnlist RP", + /* 141 */ "create_stable_args ::= ifnotexists ids cpxName LP columnlist RP TAGS LP columnlist RP", + /* 142 */ "create_from_stable ::= ifnotexists ids cpxName USING ids cpxName TAGS LP tagitemlist RP", + /* 143 */ "create_from_stable ::= ifnotexists ids cpxName USING ids cpxName LP tagNamelist RP TAGS LP tagitemlist RP", + /* 144 */ "tagNamelist ::= tagNamelist COMMA ids", + /* 145 */ "tagNamelist ::= ids", + /* 146 */ "create_table_args ::= ifnotexists ids cpxName AS select", + /* 147 */ "columnlist ::= columnlist COMMA column", + /* 148 */ "columnlist ::= column", + /* 149 */ "column ::= ids typename", + /* 150 */ "tagitemlist ::= tagitemlist COMMA tagitem", + /* 151 */ "tagitemlist ::= tagitem", + /* 152 */ "tagitem ::= INTEGER", + /* 153 */ "tagitem ::= FLOAT", + /* 154 */ "tagitem ::= STRING", + /* 155 */ "tagitem ::= BOOL", + /* 156 */ "tagitem ::= NULL", + /* 157 */ "tagitem ::= NOW", + /* 158 */ "tagitem ::= MINUS INTEGER", + /* 159 */ "tagitem ::= MINUS FLOAT", + /* 160 */ "tagitem ::= PLUS INTEGER", + /* 161 */ "tagitem ::= PLUS FLOAT", + /* 162 */ "select ::= SELECT selcollist from where_opt interval_opt session_option windowstate_option fill_opt sliding_opt groupby_opt orderby_opt having_opt slimit_opt limit_opt", + /* 163 */ "select ::= LP select RP", + /* 164 */ "union ::= select", + /* 165 */ "union ::= union UNION ALL select", + /* 166 */ "cmd ::= union", + /* 167 */ "select ::= SELECT selcollist", + /* 168 */ "sclp ::= selcollist COMMA", + /* 169 */ "sclp ::=", + /* 170 */ "selcollist ::= sclp distinct expr as", + /* 171 */ "selcollist ::= sclp STAR", + /* 172 */ "as ::= AS ids", + /* 173 */ "as ::= ids", + /* 174 */ "as ::=", + /* 175 */ "distinct ::= DISTINCT", + /* 176 */ "distinct ::=", + /* 177 */ "from ::= FROM tablelist", + /* 178 */ "from ::= FROM sub", + /* 179 */ "sub ::= LP union RP", + /* 180 */ "sub ::= LP union RP ids", + /* 181 */ "sub ::= sub COMMA LP union RP ids", + /* 182 */ "tablelist ::= ids cpxName", + /* 183 */ "tablelist ::= ids cpxName ids", + /* 184 */ "tablelist ::= tablelist COMMA ids cpxName", + /* 185 */ "tablelist ::= tablelist COMMA ids cpxName ids", + /* 186 */ "tmvar ::= VARIABLE", + /* 187 */ "interval_opt ::= INTERVAL LP tmvar RP", + /* 188 */ "interval_opt ::= INTERVAL LP tmvar COMMA tmvar RP", + /* 189 */ "interval_opt ::=", + /* 190 */ "session_option ::=", + /* 191 */ "session_option ::= SESSION LP ids cpxName COMMA tmvar RP", + /* 192 */ "windowstate_option ::=", + /* 193 */ "windowstate_option ::= STATE_WINDOW LP ids RP", + /* 194 */ "fill_opt ::=", + /* 195 */ "fill_opt ::= FILL LP ID COMMA tagitemlist RP", + /* 196 */ "fill_opt ::= FILL LP ID RP", + /* 197 */ "sliding_opt ::= SLIDING LP tmvar RP", + /* 198 */ "sliding_opt ::=", + /* 199 */ "orderby_opt ::=", + /* 200 */ "orderby_opt ::= ORDER BY sortlist", + /* 201 */ "sortlist ::= sortlist COMMA item sortorder", + /* 202 */ "sortlist ::= item sortorder", + /* 203 */ "item ::= ids cpxName", + /* 204 */ "sortorder ::= ASC", + /* 205 */ "sortorder ::= DESC", + /* 206 */ "sortorder ::=", + /* 207 */ "groupby_opt ::=", + /* 208 */ "groupby_opt ::= GROUP BY grouplist", + /* 209 */ "grouplist ::= grouplist COMMA item", + /* 210 */ "grouplist ::= item", + /* 211 */ "having_opt ::=", + /* 212 */ "having_opt ::= HAVING expr", + /* 213 */ "limit_opt ::=", + /* 214 */ "limit_opt ::= LIMIT signed", + /* 215 */ "limit_opt ::= LIMIT signed OFFSET signed", + /* 216 */ "limit_opt ::= LIMIT signed COMMA signed", + /* 217 */ "slimit_opt ::=", + /* 218 */ "slimit_opt ::= SLIMIT signed", + /* 219 */ "slimit_opt ::= SLIMIT signed SOFFSET signed", + /* 220 */ "slimit_opt ::= SLIMIT signed COMMA signed", + /* 221 */ "where_opt ::=", + /* 222 */ "where_opt ::= WHERE expr", + /* 223 */ "expr ::= LP expr RP", + /* 224 */ "expr ::= ID", + /* 225 */ "expr ::= ID DOT ID", + /* 226 */ "expr ::= ID DOT STAR", + /* 227 */ "expr ::= INTEGER", + /* 228 */ "expr ::= MINUS INTEGER", + /* 229 */ "expr ::= PLUS INTEGER", + /* 230 */ "expr ::= FLOAT", + /* 231 */ "expr ::= MINUS FLOAT", + /* 232 */ "expr ::= PLUS FLOAT", + /* 233 */ "expr ::= STRING", + /* 234 */ "expr ::= NOW", + /* 235 */ "expr ::= VARIABLE", + /* 236 */ "expr ::= PLUS VARIABLE", + /* 237 */ "expr ::= MINUS VARIABLE", + /* 238 */ "expr ::= BOOL", + /* 239 */ "expr ::= NULL", + /* 240 */ "expr ::= ID LP exprlist RP", + /* 241 */ "expr ::= ID LP STAR RP", + /* 242 */ "expr ::= expr IS NULL", + /* 243 */ "expr ::= expr IS NOT NULL", + /* 244 */ "expr ::= expr LT expr", + /* 245 */ "expr ::= expr GT expr", + /* 246 */ "expr ::= expr LE expr", + /* 247 */ "expr ::= expr GE expr", + /* 248 */ "expr ::= expr NE expr", + /* 249 */ "expr ::= expr EQ expr", + /* 250 */ "expr ::= expr BETWEEN expr AND expr", + /* 251 */ "expr ::= expr AND expr", + /* 252 */ "expr ::= expr OR expr", + /* 253 */ "expr ::= expr PLUS expr", + /* 254 */ "expr ::= expr MINUS expr", + /* 255 */ "expr ::= expr STAR expr", + /* 256 */ "expr ::= expr SLASH expr", + /* 257 */ "expr ::= expr REM expr", + /* 258 */ "expr ::= expr LIKE expr", + /* 259 */ "expr ::= expr IN LP exprlist RP", + /* 260 */ "exprlist ::= exprlist COMMA expritem", + /* 261 */ "exprlist ::= expritem", + /* 262 */ "expritem ::= expr", + /* 263 */ "expritem ::=", + /* 264 */ "cmd ::= RESET QUERY CACHE", + /* 265 */ "cmd ::= SYNCDB ids REPLICA", + /* 266 */ "cmd ::= ALTER TABLE ids cpxName ADD COLUMN columnlist", + /* 267 */ "cmd ::= ALTER TABLE ids cpxName DROP COLUMN ids", + /* 268 */ "cmd ::= ALTER TABLE ids cpxName MODIFY COLUMN columnlist", + /* 269 */ "cmd ::= ALTER TABLE ids cpxName ADD TAG columnlist", + /* 270 */ "cmd ::= ALTER TABLE ids cpxName DROP TAG ids", + /* 271 */ "cmd ::= ALTER TABLE ids cpxName CHANGE TAG ids ids", + /* 272 */ "cmd ::= ALTER TABLE ids cpxName SET TAG ids EQ tagitem", + /* 273 */ "cmd ::= ALTER TABLE ids cpxName MODIFY TAG columnlist", + /* 274 */ "cmd ::= ALTER STABLE ids cpxName ADD COLUMN columnlist", + /* 275 */ "cmd ::= ALTER STABLE ids cpxName DROP COLUMN ids", + /* 276 */ "cmd ::= ALTER STABLE ids cpxName MODIFY COLUMN columnlist", + /* 277 */ "cmd ::= ALTER STABLE ids cpxName ADD TAG columnlist", + /* 278 */ "cmd ::= ALTER STABLE ids cpxName DROP TAG ids", + /* 279 */ "cmd ::= ALTER STABLE ids cpxName CHANGE TAG ids ids", + /* 280 */ "cmd ::= ALTER STABLE ids cpxName SET TAG ids EQ tagitem", + /* 281 */ "cmd ::= ALTER STABLE ids cpxName MODIFY TAG columnlist", + /* 282 */ "cmd ::= KILL CONNECTION INTEGER", + /* 283 */ "cmd ::= KILL STREAM INTEGER COLON INTEGER", + /* 284 */ "cmd ::= KILL QUERY INTEGER COLON INTEGER", }; #endif /* NDEBUG */ @@ -1183,60 +1187,60 @@ static void yy_destructor( ** which appear on the RHS of the rule, but which are not used ** inside the C code. */ - case 211: /* intitemlist */ - case 213: /* keep */ - case 235: /* columnlist */ - case 236: /* tagitemlist */ - case 237: /* tagNamelist */ - case 247: /* fill_opt */ - case 249: /* groupby_opt */ - case 250: /* orderby_opt */ - case 262: /* sortlist */ - case 266: /* grouplist */ -{ -taosArrayDestroy((yypminor->yy93)); + case 200: /* exprlist */ + case 243: /* selcollist */ + case 257: /* sclp */ +{ +tSqlExprListDestroy((yypminor->yy441)); } break; - case 233: /* create_table_list */ -{ -destroyCreateTableSql((yypminor->yy532)); + case 213: /* intitemlist */ + case 215: /* keep */ + case 237: /* columnlist */ + case 238: /* tagitemlist */ + case 239: /* tagNamelist */ + case 249: /* fill_opt */ + case 251: /* groupby_opt */ + case 252: /* orderby_opt */ + case 264: /* sortlist */ + case 268: /* grouplist */ +{ +taosArrayDestroy((yypminor->yy441)); } break; - case 238: /* select */ + case 235: /* create_table_list */ { -destroySqlNode((yypminor->yy224)); +destroyCreateTableSql((yypminor->yy182)); } break; - case 241: /* selcollist */ - case 255: /* sclp */ - case 267: /* exprlist */ + case 240: /* select */ { -tSqlExprListDestroy((yypminor->yy93)); +destroySqlNode((yypminor->yy236)); } break; - case 242: /* from */ - case 259: /* tablelist */ - case 260: /* sub */ + case 244: /* from */ + case 261: /* tablelist */ + case 262: /* sub */ { -destroyRelationInfo((yypminor->yy330)); +destroyRelationInfo((yypminor->yy244)); } break; - case 243: /* where_opt */ - case 251: /* having_opt */ - case 257: /* expr */ - case 268: /* expritem */ + case 245: /* where_opt */ + case 253: /* having_opt */ + case 259: /* expr */ + case 269: /* expritem */ { -tSqlExprDestroy((yypminor->yy68)); +tSqlExprDestroy((yypminor->yy166)); } break; - case 254: /* union */ + case 256: /* union */ { -destroyAllSqlNode((yypminor->yy93)); +destroyAllSqlNode((yypminor->yy441)); } break; - case 263: /* sortitem */ + case 265: /* sortitem */ { -tVariantDestroy(&(yypminor->yy518)); +tVariantDestroy(&(yypminor->yy506)); } break; default: break; /* If no destructor action specified: do nothing */ @@ -1474,69 +1478,66 @@ static const struct { YYCODETYPE lhs; /* Symbol on the left-hand side of the rule */ unsigned char nrhs; /* Number of right-hand side symbols in the rule */ } yyRuleInfo[] = { - { 190, 1 }, - { 191, 2 }, - { 191, 2 }, - { 191, 2 }, - { 191, 2 }, - { 191, 2 }, - { 191, 2 }, - { 191, 2 }, - { 191, 2 }, - { 191, 2 }, - { 191, 2 }, - { 191, 2 }, - { 191, 2 }, - { 191, 2 }, - { 191, 2 }, - { 191, 3 }, - { 192, 0 }, + { 191, 1 }, { 192, 2 }, - { 194, 0 }, - { 194, 2 }, - { 191, 5 }, - { 191, 5 }, - { 191, 4 }, - { 191, 3 }, - { 191, 5 }, - { 191, 3 }, - { 191, 5 }, - { 191, 3 }, - { 191, 4 }, - { 191, 5 }, - { 191, 5 }, - { 191, 4 }, - { 191, 4 }, - { 191, 3 }, - { 191, 3 }, - { 191, 3 }, - { 191, 2 }, - { 191, 3 }, - { 191, 5 }, - { 191, 5 }, - { 191, 4 }, - { 191, 5 }, - { 191, 3 }, - { 191, 4 }, - { 191, 4 }, - { 191, 4 }, - { 191, 4 }, - { 191, 6 }, - { 193, 1 }, - { 193, 1 }, - { 195, 2 }, + { 192, 2 }, + { 192, 2 }, + { 192, 2 }, + { 192, 2 }, + { 192, 2 }, + { 192, 2 }, + { 192, 2 }, + { 192, 2 }, + { 192, 2 }, + { 192, 2 }, + { 192, 2 }, + { 192, 2 }, + { 192, 2 }, + { 192, 3 }, + { 193, 0 }, + { 193, 2 }, { 195, 0 }, - { 199, 3 }, - { 199, 0 }, - { 191, 3 }, - { 191, 6 }, - { 191, 5 }, - { 191, 5 }, - { 191, 5 }, - { 202, 0 }, - { 202, 2 }, - { 203, 0 }, - { 203, 2 }, + { 195, 2 }, + { 192, 5 }, + { 192, 5 }, + { 192, 4 }, + { 192, 3 }, + { 192, 5 }, + { 192, 3 }, + { 192, 5 }, + { 192, 3 }, + { 192, 4 }, + { 192, 5 }, + { 192, 5 }, + { 192, 4 }, + { 192, 4 }, + { 192, 3 }, + { 192, 3 }, + { 192, 3 }, + { 192, 2 }, + { 192, 3 }, + { 192, 5 }, + { 192, 5 }, + { 192, 4 }, + { 192, 5 }, + { 192, 3 }, + { 192, 4 }, + { 192, 4 }, + { 192, 4 }, + { 192, 4 }, + { 192, 6 }, + { 192, 6 }, + { 194, 1 }, + { 194, 1 }, + { 196, 2 }, + { 196, 0 }, + { 201, 3 }, + { 201, 0 }, + { 192, 3 }, + { 192, 6 }, + { 192, 5 }, + { 192, 5 }, + { 192, 5 }, { 204, 0 }, { 204, 2 }, { 205, 0 }, @@ -1551,12 +1552,14 @@ static const struct { { 209, 2 }, { 210, 0 }, { 210, 2 }, - { 198, 9 }, - { 211, 3 }, - { 211, 1 }, - { 212, 1 }, - { 213, 2 }, - { 214, 2 }, + { 211, 0 }, + { 211, 2 }, + { 212, 0 }, + { 212, 2 }, + { 199, 9 }, + { 213, 3 }, + { 213, 1 }, + { 214, 1 }, { 215, 2 }, { 216, 2 }, { 217, 2 }, @@ -1571,193 +1574,195 @@ static const struct { { 226, 2 }, { 227, 2 }, { 228, 2 }, - { 200, 0 }, - { 200, 2 }, - { 200, 2 }, - { 200, 2 }, - { 200, 2 }, - { 200, 2 }, - { 200, 2 }, - { 200, 2 }, - { 200, 2 }, - { 200, 2 }, - { 200, 2 }, - { 200, 2 }, - { 200, 2 }, - { 200, 2 }, - { 200, 2 }, - { 200, 2 }, - { 201, 1 }, - { 201, 2 }, - { 196, 0 }, - { 196, 2 }, - { 196, 2 }, - { 196, 2 }, - { 196, 2 }, - { 196, 2 }, - { 196, 2 }, - { 196, 2 }, - { 196, 2 }, - { 196, 2 }, - { 197, 1 }, - { 197, 2 }, - { 229, 1 }, - { 229, 4 }, { 229, 2 }, - { 230, 1 }, - { 230, 2 }, { 230, 2 }, - { 191, 3 }, - { 191, 3 }, - { 191, 3 }, - { 191, 3 }, - { 233, 1 }, - { 233, 2 }, - { 231, 6 }, - { 232, 10 }, + { 202, 0 }, + { 202, 2 }, + { 202, 2 }, + { 202, 2 }, + { 202, 2 }, + { 202, 2 }, + { 202, 2 }, + { 202, 2 }, + { 202, 2 }, + { 202, 2 }, + { 202, 2 }, + { 202, 2 }, + { 202, 2 }, + { 202, 2 }, + { 202, 2 }, + { 202, 2 }, + { 203, 1 }, + { 203, 2 }, + { 197, 0 }, + { 197, 2 }, + { 197, 2 }, + { 197, 2 }, + { 197, 2 }, + { 197, 2 }, + { 197, 2 }, + { 197, 2 }, + { 197, 2 }, + { 197, 2 }, + { 198, 1 }, + { 198, 2 }, + { 231, 1 }, + { 231, 4 }, + { 231, 2 }, + { 232, 1 }, + { 232, 2 }, + { 232, 2 }, + { 192, 3 }, + { 192, 3 }, + { 192, 3 }, + { 192, 3 }, + { 235, 1 }, + { 235, 2 }, + { 233, 6 }, { 234, 10 }, - { 234, 13 }, + { 236, 10 }, + { 236, 13 }, + { 239, 3 }, + { 239, 1 }, + { 233, 5 }, { 237, 3 }, { 237, 1 }, - { 231, 5 }, - { 235, 3 }, - { 235, 1 }, - { 239, 2 }, - { 236, 3 }, - { 236, 1 }, - { 240, 1 }, - { 240, 1 }, - { 240, 1 }, - { 240, 1 }, - { 240, 1 }, - { 240, 1 }, - { 240, 2 }, - { 240, 2 }, - { 240, 2 }, - { 240, 2 }, - { 238, 14 }, - { 238, 3 }, - { 254, 1 }, - { 254, 4 }, - { 191, 1 }, - { 238, 2 }, - { 255, 2 }, - { 255, 0 }, - { 241, 4 }, { 241, 2 }, - { 258, 2 }, - { 258, 1 }, - { 258, 0 }, - { 256, 1 }, - { 256, 0 }, + { 238, 3 }, + { 238, 1 }, + { 242, 1 }, + { 242, 1 }, + { 242, 1 }, + { 242, 1 }, + { 242, 1 }, + { 242, 1 }, { 242, 2 }, { 242, 2 }, - { 260, 3 }, - { 260, 4 }, - { 260, 6 }, - { 259, 2 }, - { 259, 3 }, - { 259, 4 }, - { 259, 5 }, - { 261, 1 }, - { 244, 4 }, - { 244, 6 }, - { 244, 0 }, - { 245, 0 }, - { 245, 7 }, - { 246, 0 }, + { 242, 2 }, + { 242, 2 }, + { 240, 14 }, + { 240, 3 }, + { 256, 1 }, + { 256, 4 }, + { 192, 1 }, + { 240, 2 }, + { 257, 2 }, + { 257, 0 }, + { 243, 4 }, + { 243, 2 }, + { 260, 2 }, + { 260, 1 }, + { 260, 0 }, + { 258, 1 }, + { 258, 0 }, + { 244, 2 }, + { 244, 2 }, + { 262, 3 }, + { 262, 4 }, + { 262, 6 }, + { 261, 2 }, + { 261, 3 }, + { 261, 4 }, + { 261, 5 }, + { 263, 1 }, { 246, 4 }, + { 246, 6 }, + { 246, 0 }, { 247, 0 }, - { 247, 6 }, - { 247, 4 }, - { 248, 4 }, + { 247, 7 }, { 248, 0 }, + { 248, 4 }, + { 249, 0 }, + { 249, 6 }, + { 249, 4 }, + { 250, 4 }, { 250, 0 }, - { 250, 3 }, - { 262, 4 }, - { 262, 2 }, + { 252, 0 }, + { 252, 3 }, + { 264, 4 }, { 264, 2 }, - { 265, 1 }, - { 265, 1 }, - { 265, 0 }, - { 249, 0 }, - { 249, 3 }, - { 266, 3 }, - { 266, 1 }, + { 266, 2 }, + { 267, 1 }, + { 267, 1 }, + { 267, 0 }, { 251, 0 }, - { 251, 2 }, + { 251, 3 }, + { 268, 3 }, + { 268, 1 }, { 253, 0 }, { 253, 2 }, - { 253, 4 }, - { 253, 4 }, - { 252, 0 }, - { 252, 2 }, - { 252, 4 }, - { 252, 4 }, - { 243, 0 }, - { 243, 2 }, - { 257, 3 }, - { 257, 1 }, - { 257, 3 }, - { 257, 3 }, - { 257, 1 }, - { 257, 2 }, - { 257, 2 }, - { 257, 1 }, - { 257, 2 }, - { 257, 2 }, - { 257, 1 }, - { 257, 1 }, - { 257, 1 }, - { 257, 2 }, - { 257, 2 }, - { 257, 1 }, - { 257, 1 }, - { 257, 4 }, - { 257, 4 }, - { 257, 3 }, - { 257, 4 }, - { 257, 3 }, - { 257, 3 }, - { 257, 3 }, - { 257, 3 }, - { 257, 3 }, - { 257, 3 }, - { 257, 5 }, - { 257, 3 }, - { 257, 3 }, - { 257, 3 }, - { 257, 3 }, - { 257, 3 }, - { 257, 3 }, - { 257, 3 }, - { 257, 3 }, - { 257, 5 }, - { 267, 3 }, - { 267, 1 }, - { 268, 1 }, - { 268, 0 }, - { 191, 3 }, - { 191, 3 }, - { 191, 7 }, - { 191, 7 }, - { 191, 7 }, - { 191, 7 }, - { 191, 7 }, - { 191, 8 }, - { 191, 9 }, - { 191, 7 }, - { 191, 7 }, - { 191, 7 }, - { 191, 7 }, - { 191, 7 }, - { 191, 7 }, - { 191, 8 }, - { 191, 9 }, - { 191, 7 }, - { 191, 3 }, - { 191, 5 }, - { 191, 5 }, + { 255, 0 }, + { 255, 2 }, + { 255, 4 }, + { 255, 4 }, + { 254, 0 }, + { 254, 2 }, + { 254, 4 }, + { 254, 4 }, + { 245, 0 }, + { 245, 2 }, + { 259, 3 }, + { 259, 1 }, + { 259, 3 }, + { 259, 3 }, + { 259, 1 }, + { 259, 2 }, + { 259, 2 }, + { 259, 1 }, + { 259, 2 }, + { 259, 2 }, + { 259, 1 }, + { 259, 1 }, + { 259, 1 }, + { 259, 2 }, + { 259, 2 }, + { 259, 1 }, + { 259, 1 }, + { 259, 4 }, + { 259, 4 }, + { 259, 3 }, + { 259, 4 }, + { 259, 3 }, + { 259, 3 }, + { 259, 3 }, + { 259, 3 }, + { 259, 3 }, + { 259, 3 }, + { 259, 5 }, + { 259, 3 }, + { 259, 3 }, + { 259, 3 }, + { 259, 3 }, + { 259, 3 }, + { 259, 3 }, + { 259, 3 }, + { 259, 3 }, + { 259, 5 }, + { 200, 3 }, + { 200, 1 }, + { 269, 1 }, + { 269, 0 }, + { 192, 3 }, + { 192, 3 }, + { 192, 7 }, + { 192, 7 }, + { 192, 7 }, + { 192, 7 }, + { 192, 7 }, + { 192, 8 }, + { 192, 9 }, + { 192, 7 }, + { 192, 7 }, + { 192, 7 }, + { 192, 7 }, + { 192, 7 }, + { 192, 7 }, + { 192, 8 }, + { 192, 9 }, + { 192, 7 }, + { 192, 3 }, + { 192, 5 }, + { 192, 5 }, }; static void yy_accept(yyParser*); /* Forward Declaration */ @@ -1981,645 +1986,648 @@ static void yy_reduce( break; case 44: /* cmd ::= ALTER DATABASE ids alter_db_optr */ case 45: /* cmd ::= ALTER TOPIC ids alter_topic_optr */ yytestcase(yyruleno==45); -{ SStrToken t = {0}; setCreateDbInfo(pInfo, TSDB_SQL_ALTER_DB, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy372, &t);} +{ SStrToken t = {0}; setCreateDbInfo(pInfo, TSDB_SQL_ALTER_DB, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy382, &t);} break; case 46: /* cmd ::= ALTER ACCOUNT ids acct_optr */ -{ setCreateAcctSql(pInfo, TSDB_SQL_ALTER_ACCT, &yymsp[-1].minor.yy0, NULL, &yymsp[0].minor.yy77);} +{ setCreateAcctSql(pInfo, TSDB_SQL_ALTER_ACCT, &yymsp[-1].minor.yy0, NULL, &yymsp[0].minor.yy151);} break; case 47: /* 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.yy77);} +{ setCreateAcctSql(pInfo, TSDB_SQL_ALTER_ACCT, &yymsp[-3].minor.yy0, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy151);} + break; + case 48: /* cmd ::= COMPACT VNODES IN LP exprlist RP */ +{ setCompactVnodeSql(pInfo, TSDB_SQL_COMPACT_VNODE, yymsp[-1].minor.yy441);} break; - case 48: /* ids ::= ID */ - case 49: /* ids ::= STRING */ yytestcase(yyruleno==49); + case 49: /* ids ::= ID */ + case 50: /* ids ::= STRING */ yytestcase(yyruleno==50); {yygotominor.yy0 = yymsp[0].minor.yy0; } break; - case 50: /* ifexists ::= IF EXISTS */ - case 52: /* ifnotexists ::= IF NOT EXISTS */ yytestcase(yyruleno==52); + case 51: /* ifexists ::= IF EXISTS */ + case 53: /* ifnotexists ::= IF NOT EXISTS */ yytestcase(yyruleno==53); { yygotominor.yy0.n = 1;} break; - case 51: /* ifexists ::= */ - case 53: /* ifnotexists ::= */ yytestcase(yyruleno==53); - case 175: /* distinct ::= */ yytestcase(yyruleno==175); + case 52: /* ifexists ::= */ + case 54: /* ifnotexists ::= */ yytestcase(yyruleno==54); + case 176: /* distinct ::= */ yytestcase(yyruleno==176); { yygotominor.yy0.n = 0;} break; - case 54: /* cmd ::= CREATE DNODE ids */ + case 55: /* cmd ::= CREATE DNODE ids */ { setDCLSqlElems(pInfo, TSDB_SQL_CREATE_DNODE, 1, &yymsp[0].minor.yy0);} break; - case 55: /* 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.yy77);} + case 56: /* 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.yy151);} break; - case 56: /* cmd ::= CREATE DATABASE ifnotexists ids db_optr */ - case 57: /* cmd ::= CREATE TOPIC ifnotexists ids topic_optr */ yytestcase(yyruleno==57); -{ setCreateDbInfo(pInfo, TSDB_SQL_CREATE_DB, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy372, &yymsp[-2].minor.yy0);} + case 57: /* cmd ::= CREATE DATABASE ifnotexists ids db_optr */ + case 58: /* cmd ::= CREATE TOPIC ifnotexists ids topic_optr */ yytestcase(yyruleno==58); +{ setCreateDbInfo(pInfo, TSDB_SQL_CREATE_DB, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy382, &yymsp[-2].minor.yy0);} break; - case 58: /* cmd ::= CREATE USER ids PASS ids */ + case 59: /* cmd ::= CREATE USER ids PASS ids */ { setCreateUserSql(pInfo, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0);} break; - case 59: /* pps ::= */ - case 61: /* tseries ::= */ yytestcase(yyruleno==61); - case 63: /* dbs ::= */ yytestcase(yyruleno==63); - case 65: /* streams ::= */ yytestcase(yyruleno==65); - case 67: /* storage ::= */ yytestcase(yyruleno==67); - case 69: /* qtime ::= */ yytestcase(yyruleno==69); - case 71: /* users ::= */ yytestcase(yyruleno==71); - case 73: /* conns ::= */ yytestcase(yyruleno==73); - case 75: /* state ::= */ yytestcase(yyruleno==75); + case 60: /* pps ::= */ + case 62: /* tseries ::= */ yytestcase(yyruleno==62); + case 64: /* dbs ::= */ yytestcase(yyruleno==64); + case 66: /* streams ::= */ yytestcase(yyruleno==66); + case 68: /* storage ::= */ yytestcase(yyruleno==68); + case 70: /* qtime ::= */ yytestcase(yyruleno==70); + case 72: /* users ::= */ yytestcase(yyruleno==72); + case 74: /* conns ::= */ yytestcase(yyruleno==74); + case 76: /* state ::= */ yytestcase(yyruleno==76); { yygotominor.yy0.n = 0; } break; - case 60: /* pps ::= PPS INTEGER */ - case 62: /* tseries ::= TSERIES INTEGER */ yytestcase(yyruleno==62); - case 64: /* dbs ::= DBS INTEGER */ yytestcase(yyruleno==64); - case 66: /* streams ::= STREAMS INTEGER */ yytestcase(yyruleno==66); - case 68: /* storage ::= STORAGE INTEGER */ yytestcase(yyruleno==68); - case 70: /* qtime ::= QTIME INTEGER */ yytestcase(yyruleno==70); - case 72: /* users ::= USERS INTEGER */ yytestcase(yyruleno==72); - case 74: /* conns ::= CONNS INTEGER */ yytestcase(yyruleno==74); - case 76: /* state ::= STATE ids */ yytestcase(yyruleno==76); + case 61: /* pps ::= PPS INTEGER */ + case 63: /* tseries ::= TSERIES INTEGER */ yytestcase(yyruleno==63); + case 65: /* dbs ::= DBS INTEGER */ yytestcase(yyruleno==65); + case 67: /* streams ::= STREAMS INTEGER */ yytestcase(yyruleno==67); + case 69: /* storage ::= STORAGE INTEGER */ yytestcase(yyruleno==69); + case 71: /* qtime ::= QTIME INTEGER */ yytestcase(yyruleno==71); + case 73: /* users ::= USERS INTEGER */ yytestcase(yyruleno==73); + case 75: /* conns ::= CONNS INTEGER */ yytestcase(yyruleno==75); + case 77: /* state ::= STATE ids */ yytestcase(yyruleno==77); { yygotominor.yy0 = yymsp[0].minor.yy0; } break; - case 77: /* acct_optr ::= pps tseries storage streams qtime dbs users conns state */ -{ - yygotominor.yy77.maxUsers = (yymsp[-2].minor.yy0.n>0)?atoi(yymsp[-2].minor.yy0.z):-1; - yygotominor.yy77.maxDbs = (yymsp[-3].minor.yy0.n>0)?atoi(yymsp[-3].minor.yy0.z):-1; - yygotominor.yy77.maxTimeSeries = (yymsp[-7].minor.yy0.n>0)?atoi(yymsp[-7].minor.yy0.z):-1; - yygotominor.yy77.maxStreams = (yymsp[-5].minor.yy0.n>0)?atoi(yymsp[-5].minor.yy0.z):-1; - yygotominor.yy77.maxPointsPerSecond = (yymsp[-8].minor.yy0.n>0)?atoi(yymsp[-8].minor.yy0.z):-1; - yygotominor.yy77.maxStorage = (yymsp[-6].minor.yy0.n>0)?strtoll(yymsp[-6].minor.yy0.z, NULL, 10):-1; - yygotominor.yy77.maxQueryTime = (yymsp[-4].minor.yy0.n>0)?strtoll(yymsp[-4].minor.yy0.z, NULL, 10):-1; - yygotominor.yy77.maxConnections = (yymsp[-1].minor.yy0.n>0)?atoi(yymsp[-1].minor.yy0.z):-1; - yygotominor.yy77.stat = yymsp[0].minor.yy0; -} - break; - case 78: /* intitemlist ::= intitemlist COMMA intitem */ - case 149: /* tagitemlist ::= tagitemlist COMMA tagitem */ yytestcase(yyruleno==149); -{ yygotominor.yy93 = tVariantListAppend(yymsp[-2].minor.yy93, &yymsp[0].minor.yy518, -1); } - break; - case 79: /* intitemlist ::= intitem */ - case 150: /* tagitemlist ::= tagitem */ yytestcase(yyruleno==150); -{ yygotominor.yy93 = tVariantListAppend(NULL, &yymsp[0].minor.yy518, -1); } - break; - case 80: /* intitem ::= INTEGER */ - case 151: /* tagitem ::= INTEGER */ yytestcase(yyruleno==151); - case 152: /* tagitem ::= FLOAT */ yytestcase(yyruleno==152); - case 153: /* tagitem ::= STRING */ yytestcase(yyruleno==153); - case 154: /* tagitem ::= BOOL */ yytestcase(yyruleno==154); -{ toTSDBType(yymsp[0].minor.yy0.type); tVariantCreate(&yygotominor.yy518, &yymsp[0].minor.yy0); } - break; - case 81: /* keep ::= KEEP intitemlist */ -{ yygotominor.yy93 = yymsp[0].minor.yy93; } - break; - case 82: /* cache ::= CACHE INTEGER */ - case 83: /* replica ::= REPLICA INTEGER */ yytestcase(yyruleno==83); - case 84: /* quorum ::= QUORUM INTEGER */ yytestcase(yyruleno==84); - case 85: /* days ::= DAYS INTEGER */ yytestcase(yyruleno==85); - case 86: /* minrows ::= MINROWS INTEGER */ yytestcase(yyruleno==86); - case 87: /* maxrows ::= MAXROWS INTEGER */ yytestcase(yyruleno==87); - case 88: /* blocks ::= BLOCKS INTEGER */ yytestcase(yyruleno==88); - case 89: /* ctime ::= CTIME INTEGER */ yytestcase(yyruleno==89); - case 90: /* wal ::= WAL INTEGER */ yytestcase(yyruleno==90); - case 91: /* fsync ::= FSYNC INTEGER */ yytestcase(yyruleno==91); - case 92: /* comp ::= COMP INTEGER */ yytestcase(yyruleno==92); - case 93: /* prec ::= PRECISION STRING */ yytestcase(yyruleno==93); - case 94: /* update ::= UPDATE INTEGER */ yytestcase(yyruleno==94); - case 95: /* cachelast ::= CACHELAST INTEGER */ yytestcase(yyruleno==95); - case 96: /* partitions ::= PARTITIONS INTEGER */ yytestcase(yyruleno==96); + case 78: /* acct_optr ::= pps tseries storage streams qtime dbs users conns state */ +{ + yygotominor.yy151.maxUsers = (yymsp[-2].minor.yy0.n>0)?atoi(yymsp[-2].minor.yy0.z):-1; + yygotominor.yy151.maxDbs = (yymsp[-3].minor.yy0.n>0)?atoi(yymsp[-3].minor.yy0.z):-1; + yygotominor.yy151.maxTimeSeries = (yymsp[-7].minor.yy0.n>0)?atoi(yymsp[-7].minor.yy0.z):-1; + yygotominor.yy151.maxStreams = (yymsp[-5].minor.yy0.n>0)?atoi(yymsp[-5].minor.yy0.z):-1; + yygotominor.yy151.maxPointsPerSecond = (yymsp[-8].minor.yy0.n>0)?atoi(yymsp[-8].minor.yy0.z):-1; + yygotominor.yy151.maxStorage = (yymsp[-6].minor.yy0.n>0)?strtoll(yymsp[-6].minor.yy0.z, NULL, 10):-1; + yygotominor.yy151.maxQueryTime = (yymsp[-4].minor.yy0.n>0)?strtoll(yymsp[-4].minor.yy0.z, NULL, 10):-1; + yygotominor.yy151.maxConnections = (yymsp[-1].minor.yy0.n>0)?atoi(yymsp[-1].minor.yy0.z):-1; + yygotominor.yy151.stat = yymsp[0].minor.yy0; +} + break; + case 79: /* intitemlist ::= intitemlist COMMA intitem */ + case 150: /* tagitemlist ::= tagitemlist COMMA tagitem */ yytestcase(yyruleno==150); +{ yygotominor.yy441 = tVariantListAppend(yymsp[-2].minor.yy441, &yymsp[0].minor.yy506, -1); } + break; + case 80: /* intitemlist ::= intitem */ + case 151: /* tagitemlist ::= tagitem */ yytestcase(yyruleno==151); +{ yygotominor.yy441 = tVariantListAppend(NULL, &yymsp[0].minor.yy506, -1); } + break; + case 81: /* intitem ::= INTEGER */ + case 152: /* tagitem ::= INTEGER */ yytestcase(yyruleno==152); + case 153: /* tagitem ::= FLOAT */ yytestcase(yyruleno==153); + case 154: /* tagitem ::= STRING */ yytestcase(yyruleno==154); + case 155: /* tagitem ::= BOOL */ yytestcase(yyruleno==155); +{ toTSDBType(yymsp[0].minor.yy0.type); tVariantCreate(&yygotominor.yy506, &yymsp[0].minor.yy0); } + break; + case 82: /* keep ::= KEEP intitemlist */ +{ yygotominor.yy441 = yymsp[0].minor.yy441; } + break; + case 83: /* cache ::= CACHE INTEGER */ + case 84: /* replica ::= REPLICA INTEGER */ yytestcase(yyruleno==84); + case 85: /* quorum ::= QUORUM INTEGER */ yytestcase(yyruleno==85); + case 86: /* days ::= DAYS INTEGER */ yytestcase(yyruleno==86); + case 87: /* minrows ::= MINROWS INTEGER */ yytestcase(yyruleno==87); + case 88: /* maxrows ::= MAXROWS INTEGER */ yytestcase(yyruleno==88); + case 89: /* blocks ::= BLOCKS INTEGER */ yytestcase(yyruleno==89); + case 90: /* ctime ::= CTIME INTEGER */ yytestcase(yyruleno==90); + case 91: /* wal ::= WAL INTEGER */ yytestcase(yyruleno==91); + case 92: /* fsync ::= FSYNC INTEGER */ yytestcase(yyruleno==92); + case 93: /* comp ::= COMP INTEGER */ yytestcase(yyruleno==93); + case 94: /* prec ::= PRECISION STRING */ yytestcase(yyruleno==94); + case 95: /* update ::= UPDATE INTEGER */ yytestcase(yyruleno==95); + case 96: /* cachelast ::= CACHELAST INTEGER */ yytestcase(yyruleno==96); + case 97: /* partitions ::= PARTITIONS INTEGER */ yytestcase(yyruleno==97); { yygotominor.yy0 = yymsp[0].minor.yy0; } break; - case 97: /* db_optr ::= */ -{setDefaultCreateDbOption(&yygotominor.yy372); yygotominor.yy372.dbType = TSDB_DB_TYPE_DEFAULT;} + case 98: /* db_optr ::= */ +{setDefaultCreateDbOption(&yygotominor.yy382); yygotominor.yy382.dbType = TSDB_DB_TYPE_DEFAULT;} break; - case 98: /* db_optr ::= db_optr cache */ -{ yygotominor.yy372 = yymsp[-1].minor.yy372; yygotominor.yy372.cacheBlockSize = strtol(yymsp[0].minor.yy0.z, NULL, 10); } + case 99: /* db_optr ::= db_optr cache */ +{ yygotominor.yy382 = yymsp[-1].minor.yy382; yygotominor.yy382.cacheBlockSize = strtol(yymsp[0].minor.yy0.z, NULL, 10); } break; - case 99: /* db_optr ::= db_optr replica */ - case 116: /* alter_db_optr ::= alter_db_optr replica */ yytestcase(yyruleno==116); -{ yygotominor.yy372 = yymsp[-1].minor.yy372; yygotominor.yy372.replica = strtol(yymsp[0].minor.yy0.z, NULL, 10); } + case 100: /* db_optr ::= db_optr replica */ + case 117: /* alter_db_optr ::= alter_db_optr replica */ yytestcase(yyruleno==117); +{ yygotominor.yy382 = yymsp[-1].minor.yy382; yygotominor.yy382.replica = strtol(yymsp[0].minor.yy0.z, NULL, 10); } break; - case 100: /* db_optr ::= db_optr quorum */ - case 117: /* alter_db_optr ::= alter_db_optr quorum */ yytestcase(yyruleno==117); -{ yygotominor.yy372 = yymsp[-1].minor.yy372; yygotominor.yy372.quorum = strtol(yymsp[0].minor.yy0.z, NULL, 10); } + case 101: /* db_optr ::= db_optr quorum */ + case 118: /* alter_db_optr ::= alter_db_optr quorum */ yytestcase(yyruleno==118); +{ yygotominor.yy382 = yymsp[-1].minor.yy382; yygotominor.yy382.quorum = strtol(yymsp[0].minor.yy0.z, NULL, 10); } break; - case 101: /* db_optr ::= db_optr days */ -{ yygotominor.yy372 = yymsp[-1].minor.yy372; yygotominor.yy372.daysPerFile = strtol(yymsp[0].minor.yy0.z, NULL, 10); } + case 102: /* db_optr ::= db_optr days */ +{ yygotominor.yy382 = yymsp[-1].minor.yy382; yygotominor.yy382.daysPerFile = strtol(yymsp[0].minor.yy0.z, NULL, 10); } break; - case 102: /* db_optr ::= db_optr minrows */ -{ yygotominor.yy372 = yymsp[-1].minor.yy372; yygotominor.yy372.minRowsPerBlock = strtod(yymsp[0].minor.yy0.z, NULL); } + case 103: /* db_optr ::= db_optr minrows */ +{ yygotominor.yy382 = yymsp[-1].minor.yy382; yygotominor.yy382.minRowsPerBlock = strtod(yymsp[0].minor.yy0.z, NULL); } break; - case 103: /* db_optr ::= db_optr maxrows */ -{ yygotominor.yy372 = yymsp[-1].minor.yy372; yygotominor.yy372.maxRowsPerBlock = strtod(yymsp[0].minor.yy0.z, NULL); } + case 104: /* db_optr ::= db_optr maxrows */ +{ yygotominor.yy382 = yymsp[-1].minor.yy382; yygotominor.yy382.maxRowsPerBlock = strtod(yymsp[0].minor.yy0.z, NULL); } break; - case 104: /* db_optr ::= db_optr blocks */ - case 119: /* alter_db_optr ::= alter_db_optr blocks */ yytestcase(yyruleno==119); -{ yygotominor.yy372 = yymsp[-1].minor.yy372; yygotominor.yy372.numOfBlocks = strtol(yymsp[0].minor.yy0.z, NULL, 10); } + case 105: /* db_optr ::= db_optr blocks */ + case 120: /* alter_db_optr ::= alter_db_optr blocks */ yytestcase(yyruleno==120); +{ yygotominor.yy382 = yymsp[-1].minor.yy382; yygotominor.yy382.numOfBlocks = strtol(yymsp[0].minor.yy0.z, NULL, 10); } break; - case 105: /* db_optr ::= db_optr ctime */ -{ yygotominor.yy372 = yymsp[-1].minor.yy372; yygotominor.yy372.commitTime = strtol(yymsp[0].minor.yy0.z, NULL, 10); } + case 106: /* db_optr ::= db_optr ctime */ +{ yygotominor.yy382 = yymsp[-1].minor.yy382; yygotominor.yy382.commitTime = strtol(yymsp[0].minor.yy0.z, NULL, 10); } break; - case 106: /* db_optr ::= db_optr wal */ - case 121: /* alter_db_optr ::= alter_db_optr wal */ yytestcase(yyruleno==121); -{ yygotominor.yy372 = yymsp[-1].minor.yy372; yygotominor.yy372.walLevel = strtol(yymsp[0].minor.yy0.z, NULL, 10); } + case 107: /* db_optr ::= db_optr wal */ + case 122: /* alter_db_optr ::= alter_db_optr wal */ yytestcase(yyruleno==122); +{ yygotominor.yy382 = yymsp[-1].minor.yy382; yygotominor.yy382.walLevel = strtol(yymsp[0].minor.yy0.z, NULL, 10); } break; - case 107: /* db_optr ::= db_optr fsync */ - case 122: /* alter_db_optr ::= alter_db_optr fsync */ yytestcase(yyruleno==122); -{ yygotominor.yy372 = yymsp[-1].minor.yy372; yygotominor.yy372.fsyncPeriod = strtol(yymsp[0].minor.yy0.z, NULL, 10); } + case 108: /* db_optr ::= db_optr fsync */ + case 123: /* alter_db_optr ::= alter_db_optr fsync */ yytestcase(yyruleno==123); +{ yygotominor.yy382 = yymsp[-1].minor.yy382; yygotominor.yy382.fsyncPeriod = strtol(yymsp[0].minor.yy0.z, NULL, 10); } break; - case 108: /* db_optr ::= db_optr comp */ - case 120: /* alter_db_optr ::= alter_db_optr comp */ yytestcase(yyruleno==120); -{ yygotominor.yy372 = yymsp[-1].minor.yy372; yygotominor.yy372.compressionLevel = strtol(yymsp[0].minor.yy0.z, NULL, 10); } + case 109: /* db_optr ::= db_optr comp */ + case 121: /* alter_db_optr ::= alter_db_optr comp */ yytestcase(yyruleno==121); +{ yygotominor.yy382 = yymsp[-1].minor.yy382; yygotominor.yy382.compressionLevel = strtol(yymsp[0].minor.yy0.z, NULL, 10); } break; - case 109: /* db_optr ::= db_optr prec */ -{ yygotominor.yy372 = yymsp[-1].minor.yy372; yygotominor.yy372.precision = yymsp[0].minor.yy0; } + case 110: /* db_optr ::= db_optr prec */ +{ yygotominor.yy382 = yymsp[-1].minor.yy382; yygotominor.yy382.precision = yymsp[0].minor.yy0; } break; - case 110: /* db_optr ::= db_optr keep */ - case 118: /* alter_db_optr ::= alter_db_optr keep */ yytestcase(yyruleno==118); -{ yygotominor.yy372 = yymsp[-1].minor.yy372; yygotominor.yy372.keep = yymsp[0].minor.yy93; } + case 111: /* db_optr ::= db_optr keep */ + case 119: /* alter_db_optr ::= alter_db_optr keep */ yytestcase(yyruleno==119); +{ yygotominor.yy382 = yymsp[-1].minor.yy382; yygotominor.yy382.keep = yymsp[0].minor.yy441; } break; - case 111: /* db_optr ::= db_optr update */ - case 123: /* alter_db_optr ::= alter_db_optr update */ yytestcase(yyruleno==123); -{ yygotominor.yy372 = yymsp[-1].minor.yy372; yygotominor.yy372.update = strtol(yymsp[0].minor.yy0.z, NULL, 10); } + case 112: /* db_optr ::= db_optr update */ + case 124: /* alter_db_optr ::= alter_db_optr update */ yytestcase(yyruleno==124); +{ yygotominor.yy382 = yymsp[-1].minor.yy382; yygotominor.yy382.update = strtol(yymsp[0].minor.yy0.z, NULL, 10); } break; - case 112: /* db_optr ::= db_optr cachelast */ - case 124: /* alter_db_optr ::= alter_db_optr cachelast */ yytestcase(yyruleno==124); -{ yygotominor.yy372 = yymsp[-1].minor.yy372; yygotominor.yy372.cachelast = strtol(yymsp[0].minor.yy0.z, NULL, 10); } + case 113: /* db_optr ::= db_optr cachelast */ + case 125: /* alter_db_optr ::= alter_db_optr cachelast */ yytestcase(yyruleno==125); +{ yygotominor.yy382 = yymsp[-1].minor.yy382; yygotominor.yy382.cachelast = strtol(yymsp[0].minor.yy0.z, NULL, 10); } break; - case 113: /* topic_optr ::= db_optr */ - case 125: /* alter_topic_optr ::= alter_db_optr */ yytestcase(yyruleno==125); -{ yygotominor.yy372 = yymsp[0].minor.yy372; yygotominor.yy372.dbType = TSDB_DB_TYPE_TOPIC; } + case 114: /* topic_optr ::= db_optr */ + case 126: /* alter_topic_optr ::= alter_db_optr */ yytestcase(yyruleno==126); +{ yygotominor.yy382 = yymsp[0].minor.yy382; yygotominor.yy382.dbType = TSDB_DB_TYPE_TOPIC; } break; - case 114: /* topic_optr ::= topic_optr partitions */ - case 126: /* alter_topic_optr ::= alter_topic_optr partitions */ yytestcase(yyruleno==126); -{ yygotominor.yy372 = yymsp[-1].minor.yy372; yygotominor.yy372.partitions = strtol(yymsp[0].minor.yy0.z, NULL, 10); } + case 115: /* topic_optr ::= topic_optr partitions */ + case 127: /* alter_topic_optr ::= alter_topic_optr partitions */ yytestcase(yyruleno==127); +{ yygotominor.yy382 = yymsp[-1].minor.yy382; yygotominor.yy382.partitions = strtol(yymsp[0].minor.yy0.z, NULL, 10); } break; - case 115: /* alter_db_optr ::= */ -{ setDefaultCreateDbOption(&yygotominor.yy372); yygotominor.yy372.dbType = TSDB_DB_TYPE_DEFAULT;} + case 116: /* alter_db_optr ::= */ +{ setDefaultCreateDbOption(&yygotominor.yy382); yygotominor.yy382.dbType = TSDB_DB_TYPE_DEFAULT;} break; - case 127: /* typename ::= ids */ + case 128: /* typename ::= ids */ { yymsp[0].minor.yy0.type = 0; - tSetColumnType (&yygotominor.yy325, &yymsp[0].minor.yy0); + tSetColumnType (&yygotominor.yy343, &yymsp[0].minor.yy0); } break; - case 128: /* typename ::= ids LP signed RP */ + case 129: /* typename ::= ids LP signed RP */ { - if (yymsp[-1].minor.yy279 <= 0) { + if (yymsp[-1].minor.yy369 <= 0) { yymsp[-3].minor.yy0.type = 0; - tSetColumnType(&yygotominor.yy325, &yymsp[-3].minor.yy0); + tSetColumnType(&yygotominor.yy343, &yymsp[-3].minor.yy0); } else { - yymsp[-3].minor.yy0.type = -yymsp[-1].minor.yy279; // negative value of name length - tSetColumnType(&yygotominor.yy325, &yymsp[-3].minor.yy0); + yymsp[-3].minor.yy0.type = -yymsp[-1].minor.yy369; // negative value of name length + tSetColumnType(&yygotominor.yy343, &yymsp[-3].minor.yy0); } } break; - case 129: /* typename ::= ids UNSIGNED */ + case 130: /* 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 (&yygotominor.yy325, &yymsp[-1].minor.yy0); + tSetColumnType (&yygotominor.yy343, &yymsp[-1].minor.yy0); } break; - case 130: /* signed ::= INTEGER */ - case 131: /* signed ::= PLUS INTEGER */ yytestcase(yyruleno==131); -{ yygotominor.yy279 = strtol(yymsp[0].minor.yy0.z, NULL, 10); } + case 131: /* signed ::= INTEGER */ + case 132: /* signed ::= PLUS INTEGER */ yytestcase(yyruleno==132); +{ yygotominor.yy369 = strtol(yymsp[0].minor.yy0.z, NULL, 10); } break; - case 132: /* signed ::= MINUS INTEGER */ - case 133: /* cmd ::= CREATE TABLE create_table_args */ yytestcase(yyruleno==133); - case 134: /* cmd ::= CREATE TABLE create_stable_args */ yytestcase(yyruleno==134); - case 135: /* cmd ::= CREATE STABLE create_stable_args */ yytestcase(yyruleno==135); -{ yygotominor.yy279 = -strtol(yymsp[0].minor.yy0.z, NULL, 10);} + case 133: /* signed ::= MINUS INTEGER */ + case 134: /* cmd ::= CREATE TABLE create_table_args */ yytestcase(yyruleno==134); + case 135: /* cmd ::= CREATE TABLE create_stable_args */ yytestcase(yyruleno==135); + case 136: /* cmd ::= CREATE STABLE create_stable_args */ yytestcase(yyruleno==136); +{ yygotominor.yy369 = -strtol(yymsp[0].minor.yy0.z, NULL, 10);} break; - case 136: /* cmd ::= CREATE TABLE create_table_list */ -{ pInfo->type = TSDB_SQL_CREATE_TABLE; pInfo->pCreateTableInfo = yymsp[0].minor.yy532;} + case 137: /* cmd ::= CREATE TABLE create_table_list */ +{ pInfo->type = TSDB_SQL_CREATE_TABLE; pInfo->pCreateTableInfo = yymsp[0].minor.yy182;} break; - case 137: /* create_table_list ::= create_from_stable */ + case 138: /* create_table_list ::= create_from_stable */ { SCreateTableSql* pCreateTable = calloc(1, sizeof(SCreateTableSql)); pCreateTable->childTableInfo = taosArrayInit(4, sizeof(SCreatedTableInfo)); - taosArrayPush(pCreateTable->childTableInfo, &yymsp[0].minor.yy528); + taosArrayPush(pCreateTable->childTableInfo, &yymsp[0].minor.yy456); pCreateTable->type = TSQL_CREATE_TABLE_FROM_STABLE; - yygotominor.yy532 = pCreateTable; + yygotominor.yy182 = pCreateTable; } break; - case 138: /* create_table_list ::= create_table_list create_from_stable */ + case 139: /* create_table_list ::= create_table_list create_from_stable */ { - taosArrayPush(yymsp[-1].minor.yy532->childTableInfo, &yymsp[0].minor.yy528); - yygotominor.yy532 = yymsp[-1].minor.yy532; + taosArrayPush(yymsp[-1].minor.yy182->childTableInfo, &yymsp[0].minor.yy456); + yygotominor.yy182 = yymsp[-1].minor.yy182; } break; - case 139: /* create_table_args ::= ifnotexists ids cpxName LP columnlist RP */ + case 140: /* create_table_args ::= ifnotexists ids cpxName LP columnlist RP */ { - yygotominor.yy532 = tSetCreateTableInfo(yymsp[-1].minor.yy93, NULL, NULL, TSQL_CREATE_TABLE); - setSqlInfo(pInfo, yygotominor.yy532, NULL, TSDB_SQL_CREATE_TABLE); + yygotominor.yy182 = tSetCreateTableInfo(yymsp[-1].minor.yy441, NULL, NULL, TSQL_CREATE_TABLE); + setSqlInfo(pInfo, yygotominor.yy182, 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); } break; - case 140: /* create_stable_args ::= ifnotexists ids cpxName LP columnlist RP TAGS LP columnlist RP */ + case 141: /* create_stable_args ::= ifnotexists ids cpxName LP columnlist RP TAGS LP columnlist RP */ { - yygotominor.yy532 = tSetCreateTableInfo(yymsp[-5].minor.yy93, yymsp[-1].minor.yy93, NULL, TSQL_CREATE_STABLE); - setSqlInfo(pInfo, yygotominor.yy532, NULL, TSDB_SQL_CREATE_TABLE); + yygotominor.yy182 = tSetCreateTableInfo(yymsp[-5].minor.yy441, yymsp[-1].minor.yy441, NULL, TSQL_CREATE_STABLE); + setSqlInfo(pInfo, yygotominor.yy182, 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); } break; - case 141: /* create_from_stable ::= ifnotexists ids cpxName USING ids cpxName TAGS LP tagitemlist RP */ + case 142: /* 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; - yygotominor.yy528 = createNewChildTableInfo(&yymsp[-5].minor.yy0, NULL, yymsp[-1].minor.yy93, &yymsp[-8].minor.yy0, &yymsp[-9].minor.yy0); + yygotominor.yy456 = createNewChildTableInfo(&yymsp[-5].minor.yy0, NULL, yymsp[-1].minor.yy441, &yymsp[-8].minor.yy0, &yymsp[-9].minor.yy0); } break; - case 142: /* create_from_stable ::= ifnotexists ids cpxName USING ids cpxName LP tagNamelist RP TAGS LP tagitemlist RP */ + case 143: /* 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; - yygotominor.yy528 = createNewChildTableInfo(&yymsp[-8].minor.yy0, yymsp[-5].minor.yy93, yymsp[-1].minor.yy93, &yymsp[-11].minor.yy0, &yymsp[-12].minor.yy0); + yygotominor.yy456 = createNewChildTableInfo(&yymsp[-8].minor.yy0, yymsp[-5].minor.yy441, yymsp[-1].minor.yy441, &yymsp[-11].minor.yy0, &yymsp[-12].minor.yy0); } break; - case 143: /* tagNamelist ::= tagNamelist COMMA ids */ -{taosArrayPush(yymsp[-2].minor.yy93, &yymsp[0].minor.yy0); yygotominor.yy93 = yymsp[-2].minor.yy93; } + case 144: /* tagNamelist ::= tagNamelist COMMA ids */ +{taosArrayPush(yymsp[-2].minor.yy441, &yymsp[0].minor.yy0); yygotominor.yy441 = yymsp[-2].minor.yy441; } break; - case 144: /* tagNamelist ::= ids */ -{yygotominor.yy93 = taosArrayInit(4, sizeof(SStrToken)); taosArrayPush(yygotominor.yy93, &yymsp[0].minor.yy0);} + case 145: /* tagNamelist ::= ids */ +{yygotominor.yy441 = taosArrayInit(4, sizeof(SStrToken)); taosArrayPush(yygotominor.yy441, &yymsp[0].minor.yy0);} break; - case 145: /* create_table_args ::= ifnotexists ids cpxName AS select */ + case 146: /* create_table_args ::= ifnotexists ids cpxName AS select */ { - yygotominor.yy532 = tSetCreateTableInfo(NULL, NULL, yymsp[0].minor.yy224, TSQL_CREATE_STREAM); - setSqlInfo(pInfo, yygotominor.yy532, NULL, TSDB_SQL_CREATE_TABLE); + yygotominor.yy182 = tSetCreateTableInfo(NULL, NULL, yymsp[0].minor.yy236, TSQL_CREATE_STREAM); + setSqlInfo(pInfo, yygotominor.yy182, NULL, TSDB_SQL_CREATE_TABLE); yymsp[-3].minor.yy0.n += yymsp[-2].minor.yy0.n; setCreatedTableName(pInfo, &yymsp[-3].minor.yy0, &yymsp[-4].minor.yy0); } break; - case 146: /* columnlist ::= columnlist COMMA column */ -{taosArrayPush(yymsp[-2].minor.yy93, &yymsp[0].minor.yy325); yygotominor.yy93 = yymsp[-2].minor.yy93; } + case 147: /* columnlist ::= columnlist COMMA column */ +{taosArrayPush(yymsp[-2].minor.yy441, &yymsp[0].minor.yy343); yygotominor.yy441 = yymsp[-2].minor.yy441; } break; - case 147: /* columnlist ::= column */ -{yygotominor.yy93 = taosArrayInit(4, sizeof(TAOS_FIELD)); taosArrayPush(yygotominor.yy93, &yymsp[0].minor.yy325);} + case 148: /* columnlist ::= column */ +{yygotominor.yy441 = taosArrayInit(4, sizeof(TAOS_FIELD)); taosArrayPush(yygotominor.yy441, &yymsp[0].minor.yy343);} break; - case 148: /* column ::= ids typename */ + case 149: /* column ::= ids typename */ { - tSetColumnInfo(&yygotominor.yy325, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy325); + tSetColumnInfo(&yygotominor.yy343, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy343); } break; - case 155: /* tagitem ::= NULL */ -{ yymsp[0].minor.yy0.type = 0; tVariantCreate(&yygotominor.yy518, &yymsp[0].minor.yy0); } + case 156: /* tagitem ::= NULL */ +{ yymsp[0].minor.yy0.type = 0; tVariantCreate(&yygotominor.yy506, &yymsp[0].minor.yy0); } break; - case 156: /* tagitem ::= NOW */ -{ yymsp[0].minor.yy0.type = TSDB_DATA_TYPE_TIMESTAMP; tVariantCreate(&yygotominor.yy518, &yymsp[0].minor.yy0);} + case 157: /* tagitem ::= NOW */ +{ yymsp[0].minor.yy0.type = TSDB_DATA_TYPE_TIMESTAMP; tVariantCreate(&yygotominor.yy506, &yymsp[0].minor.yy0);} break; - case 157: /* tagitem ::= MINUS INTEGER */ - case 158: /* tagitem ::= MINUS FLOAT */ yytestcase(yyruleno==158); - case 159: /* tagitem ::= PLUS INTEGER */ yytestcase(yyruleno==159); - case 160: /* tagitem ::= PLUS FLOAT */ yytestcase(yyruleno==160); + case 158: /* tagitem ::= MINUS INTEGER */ + case 159: /* tagitem ::= MINUS FLOAT */ yytestcase(yyruleno==159); + case 160: /* tagitem ::= PLUS INTEGER */ yytestcase(yyruleno==160); + case 161: /* tagitem ::= PLUS FLOAT */ yytestcase(yyruleno==161); { 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(&yygotominor.yy518, &yymsp[-1].minor.yy0); + tVariantCreate(&yygotominor.yy506, &yymsp[-1].minor.yy0); } break; - case 161: /* select ::= SELECT selcollist from where_opt interval_opt session_option windowstate_option fill_opt sliding_opt groupby_opt orderby_opt having_opt slimit_opt limit_opt */ + case 162: /* select ::= SELECT selcollist from where_opt interval_opt session_option windowstate_option fill_opt sliding_opt groupby_opt orderby_opt having_opt slimit_opt limit_opt */ { - yygotominor.yy224 = tSetQuerySqlNode(&yymsp[-13].minor.yy0, yymsp[-12].minor.yy93, yymsp[-11].minor.yy330, yymsp[-10].minor.yy68, yymsp[-4].minor.yy93, yymsp[-3].minor.yy93, &yymsp[-9].minor.yy42, &yymsp[-8].minor.yy15, &yymsp[-7].minor.yy274, &yymsp[-5].minor.yy0, yymsp[-6].minor.yy93, &yymsp[0].minor.yy284, &yymsp[-1].minor.yy284, yymsp[-2].minor.yy68); + yygotominor.yy236 = tSetQuerySqlNode(&yymsp[-13].minor.yy0, yymsp[-12].minor.yy441, yymsp[-11].minor.yy244, yymsp[-10].minor.yy166, yymsp[-4].minor.yy441, yymsp[-3].minor.yy441, &yymsp[-9].minor.yy340, &yymsp[-8].minor.yy259, &yymsp[-7].minor.yy348, &yymsp[-5].minor.yy0, yymsp[-6].minor.yy441, &yymsp[0].minor.yy414, &yymsp[-1].minor.yy414, yymsp[-2].minor.yy166); } break; - case 162: /* select ::= LP select RP */ -{yygotominor.yy224 = yymsp[-1].minor.yy224;} + case 163: /* select ::= LP select RP */ +{yygotominor.yy236 = yymsp[-1].minor.yy236;} break; - case 163: /* union ::= select */ -{ yygotominor.yy93 = setSubclause(NULL, yymsp[0].minor.yy224); } + case 164: /* union ::= select */ +{ yygotominor.yy441 = setSubclause(NULL, yymsp[0].minor.yy236); } break; - case 164: /* union ::= union UNION ALL select */ -{ yygotominor.yy93 = appendSelectClause(yymsp[-3].minor.yy93, yymsp[0].minor.yy224); } + case 165: /* union ::= union UNION ALL select */ +{ yygotominor.yy441 = appendSelectClause(yymsp[-3].minor.yy441, yymsp[0].minor.yy236); } break; - case 165: /* cmd ::= union */ -{ setSqlInfo(pInfo, yymsp[0].minor.yy93, NULL, TSDB_SQL_SELECT); } + case 166: /* cmd ::= union */ +{ setSqlInfo(pInfo, yymsp[0].minor.yy441, NULL, TSDB_SQL_SELECT); } break; - case 166: /* select ::= SELECT selcollist */ + case 167: /* select ::= SELECT selcollist */ { - yygotominor.yy224 = tSetQuerySqlNode(&yymsp[-1].minor.yy0, yymsp[0].minor.yy93, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + yygotominor.yy236 = tSetQuerySqlNode(&yymsp[-1].minor.yy0, yymsp[0].minor.yy441, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); } break; - case 167: /* sclp ::= selcollist COMMA */ -{yygotominor.yy93 = yymsp[-1].minor.yy93;} + case 168: /* sclp ::= selcollist COMMA */ +{yygotominor.yy441 = yymsp[-1].minor.yy441;} break; - case 168: /* sclp ::= */ - case 198: /* orderby_opt ::= */ yytestcase(yyruleno==198); -{yygotominor.yy93 = 0;} + case 169: /* sclp ::= */ + case 199: /* orderby_opt ::= */ yytestcase(yyruleno==199); +{yygotominor.yy441 = 0;} break; - case 169: /* selcollist ::= sclp distinct expr as */ + case 170: /* selcollist ::= sclp distinct expr as */ { - yygotominor.yy93 = tSqlExprListAppend(yymsp[-3].minor.yy93, yymsp[-1].minor.yy68, yymsp[-2].minor.yy0.n? &yymsp[-2].minor.yy0:0, yymsp[0].minor.yy0.n?&yymsp[0].minor.yy0:0); + yygotominor.yy441 = tSqlExprListAppend(yymsp[-3].minor.yy441, yymsp[-1].minor.yy166, yymsp[-2].minor.yy0.n? &yymsp[-2].minor.yy0:0, yymsp[0].minor.yy0.n?&yymsp[0].minor.yy0:0); } break; - case 170: /* selcollist ::= sclp STAR */ + case 171: /* selcollist ::= sclp STAR */ { tSqlExpr *pNode = tSqlExprCreateIdValue(NULL, TK_ALL); - yygotominor.yy93 = tSqlExprListAppend(yymsp[-1].minor.yy93, pNode, 0, 0); + yygotominor.yy441 = tSqlExprListAppend(yymsp[-1].minor.yy441, pNode, 0, 0); } break; - case 171: /* as ::= AS ids */ - case 172: /* as ::= ids */ yytestcase(yyruleno==172); + case 172: /* as ::= AS ids */ + case 173: /* as ::= ids */ yytestcase(yyruleno==173); { yygotominor.yy0 = yymsp[0].minor.yy0; } break; - case 173: /* as ::= */ + case 174: /* as ::= */ { yygotominor.yy0.n = 0; } break; - case 174: /* distinct ::= DISTINCT */ + case 175: /* distinct ::= DISTINCT */ { yygotominor.yy0 = yymsp[0].minor.yy0; } break; - case 176: /* from ::= FROM tablelist */ - case 177: /* from ::= FROM sub */ yytestcase(yyruleno==177); -{yygotominor.yy330 = yymsp[0].minor.yy330;} + case 177: /* from ::= FROM tablelist */ + case 178: /* from ::= FROM sub */ yytestcase(yyruleno==178); +{yygotominor.yy244 = yymsp[0].minor.yy244;} break; - case 178: /* sub ::= LP union RP */ -{yygotominor.yy330 = addSubqueryElem(NULL, yymsp[-1].minor.yy93, NULL);} + case 179: /* sub ::= LP union RP */ +{yygotominor.yy244 = addSubqueryElem(NULL, yymsp[-1].minor.yy441, NULL);} break; - case 179: /* sub ::= LP union RP ids */ -{yygotominor.yy330 = addSubqueryElem(NULL, yymsp[-2].minor.yy93, &yymsp[0].minor.yy0);} + case 180: /* sub ::= LP union RP ids */ +{yygotominor.yy244 = addSubqueryElem(NULL, yymsp[-2].minor.yy441, &yymsp[0].minor.yy0);} break; - case 180: /* sub ::= sub COMMA LP union RP ids */ -{yygotominor.yy330 = addSubqueryElem(yymsp[-5].minor.yy330, yymsp[-2].minor.yy93, &yymsp[0].minor.yy0);} + case 181: /* sub ::= sub COMMA LP union RP ids */ +{yygotominor.yy244 = addSubqueryElem(yymsp[-5].minor.yy244, yymsp[-2].minor.yy441, &yymsp[0].minor.yy0);} break; - case 181: /* tablelist ::= ids cpxName */ + case 182: /* tablelist ::= ids cpxName */ { yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; - yygotominor.yy330 = setTableNameList(NULL, &yymsp[-1].minor.yy0, NULL); + yygotominor.yy244 = setTableNameList(NULL, &yymsp[-1].minor.yy0, NULL); } break; - case 182: /* tablelist ::= ids cpxName ids */ + case 183: /* tablelist ::= ids cpxName ids */ { yymsp[-2].minor.yy0.n += yymsp[-1].minor.yy0.n; - yygotominor.yy330 = setTableNameList(NULL, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0); + yygotominor.yy244 = setTableNameList(NULL, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0); } break; - case 183: /* tablelist ::= tablelist COMMA ids cpxName */ + case 184: /* tablelist ::= tablelist COMMA ids cpxName */ { yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; - yygotominor.yy330 = setTableNameList(yymsp[-3].minor.yy330, &yymsp[-1].minor.yy0, NULL); + yygotominor.yy244 = setTableNameList(yymsp[-3].minor.yy244, &yymsp[-1].minor.yy0, NULL); } break; - case 184: /* tablelist ::= tablelist COMMA ids cpxName ids */ + case 185: /* tablelist ::= tablelist COMMA ids cpxName ids */ { yymsp[-2].minor.yy0.n += yymsp[-1].minor.yy0.n; - yygotominor.yy330 = setTableNameList(yymsp[-4].minor.yy330, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0); + yygotominor.yy244 = setTableNameList(yymsp[-4].minor.yy244, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0); } break; - case 185: /* tmvar ::= VARIABLE */ + case 186: /* tmvar ::= VARIABLE */ {yygotominor.yy0 = yymsp[0].minor.yy0;} break; - case 186: /* interval_opt ::= INTERVAL LP tmvar RP */ -{yygotominor.yy42.interval = yymsp[-1].minor.yy0; yygotominor.yy42.offset.n = 0;} + case 187: /* interval_opt ::= INTERVAL LP tmvar RP */ +{yygotominor.yy340.interval = yymsp[-1].minor.yy0; yygotominor.yy340.offset.n = 0;} break; - case 187: /* interval_opt ::= INTERVAL LP tmvar COMMA tmvar RP */ -{yygotominor.yy42.interval = yymsp[-3].minor.yy0; yygotominor.yy42.offset = yymsp[-1].minor.yy0;} + case 188: /* interval_opt ::= INTERVAL LP tmvar COMMA tmvar RP */ +{yygotominor.yy340.interval = yymsp[-3].minor.yy0; yygotominor.yy340.offset = yymsp[-1].minor.yy0;} break; - case 188: /* interval_opt ::= */ -{memset(&yygotominor.yy42, 0, sizeof(yygotominor.yy42));} + case 189: /* interval_opt ::= */ +{memset(&yygotominor.yy340, 0, sizeof(yygotominor.yy340));} break; - case 189: /* session_option ::= */ -{yygotominor.yy15.col.n = 0; yygotominor.yy15.gap.n = 0;} + case 190: /* session_option ::= */ +{yygotominor.yy259.col.n = 0; yygotominor.yy259.gap.n = 0;} break; - case 190: /* session_option ::= SESSION LP ids cpxName COMMA tmvar RP */ + case 191: /* session_option ::= SESSION LP ids cpxName COMMA tmvar RP */ { yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n; - yygotominor.yy15.col = yymsp[-4].minor.yy0; - yygotominor.yy15.gap = yymsp[-1].minor.yy0; + yygotominor.yy259.col = yymsp[-4].minor.yy0; + yygotominor.yy259.gap = yymsp[-1].minor.yy0; } break; - case 191: /* windowstate_option ::= */ -{ yygotominor.yy274.col.n = 0; yygotominor.yy274.col.z = NULL;} + case 192: /* windowstate_option ::= */ +{ yygotominor.yy348.col.n = 0; yygotominor.yy348.col.z = NULL;} break; - case 192: /* windowstate_option ::= STATE_WINDOW LP ids RP */ -{ yygotominor.yy274.col = yymsp[-1].minor.yy0; } + case 193: /* windowstate_option ::= STATE_WINDOW LP ids RP */ +{ yygotominor.yy348.col = yymsp[-1].minor.yy0; } break; - case 193: /* fill_opt ::= */ -{ yygotominor.yy93 = 0; } + case 194: /* fill_opt ::= */ +{ yygotominor.yy441 = 0; } break; - case 194: /* fill_opt ::= FILL LP ID COMMA tagitemlist RP */ + case 195: /* fill_opt ::= FILL LP ID COMMA tagitemlist RP */ { tVariant A = {0}; toTSDBType(yymsp[-3].minor.yy0.type); tVariantCreate(&A, &yymsp[-3].minor.yy0); - tVariantListInsert(yymsp[-1].minor.yy93, &A, -1, 0); - yygotominor.yy93 = yymsp[-1].minor.yy93; + tVariantListInsert(yymsp[-1].minor.yy441, &A, -1, 0); + yygotominor.yy441 = yymsp[-1].minor.yy441; } break; - case 195: /* fill_opt ::= FILL LP ID RP */ + case 196: /* fill_opt ::= FILL LP ID RP */ { toTSDBType(yymsp[-1].minor.yy0.type); - yygotominor.yy93 = tVariantListAppendToken(NULL, &yymsp[-1].minor.yy0, -1); + yygotominor.yy441 = tVariantListAppendToken(NULL, &yymsp[-1].minor.yy0, -1); } break; - case 196: /* sliding_opt ::= SLIDING LP tmvar RP */ + case 197: /* sliding_opt ::= SLIDING LP tmvar RP */ {yygotominor.yy0 = yymsp[-1].minor.yy0; } break; - case 197: /* sliding_opt ::= */ + case 198: /* sliding_opt ::= */ {yygotominor.yy0.n = 0; yygotominor.yy0.z = NULL; yygotominor.yy0.type = 0; } break; - case 199: /* orderby_opt ::= ORDER BY sortlist */ -{yygotominor.yy93 = yymsp[0].minor.yy93;} + case 200: /* orderby_opt ::= ORDER BY sortlist */ +{yygotominor.yy441 = yymsp[0].minor.yy441;} break; - case 200: /* sortlist ::= sortlist COMMA item sortorder */ + case 201: /* sortlist ::= sortlist COMMA item sortorder */ { - yygotominor.yy93 = tVariantListAppend(yymsp[-3].minor.yy93, &yymsp[-1].minor.yy518, yymsp[0].minor.yy150); + yygotominor.yy441 = tVariantListAppend(yymsp[-3].minor.yy441, &yymsp[-1].minor.yy506, yymsp[0].minor.yy112); } break; - case 201: /* sortlist ::= item sortorder */ + case 202: /* sortlist ::= item sortorder */ { - yygotominor.yy93 = tVariantListAppend(NULL, &yymsp[-1].minor.yy518, yymsp[0].minor.yy150); + yygotominor.yy441 = tVariantListAppend(NULL, &yymsp[-1].minor.yy506, yymsp[0].minor.yy112); } break; - case 202: /* item ::= ids cpxName */ + case 203: /* item ::= ids cpxName */ { toTSDBType(yymsp[-1].minor.yy0.type); yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; - tVariantCreate(&yygotominor.yy518, &yymsp[-1].minor.yy0); + tVariantCreate(&yygotominor.yy506, &yymsp[-1].minor.yy0); } break; - case 203: /* sortorder ::= ASC */ - case 205: /* sortorder ::= */ yytestcase(yyruleno==205); -{ yygotominor.yy150 = TSDB_ORDER_ASC; } + case 204: /* sortorder ::= ASC */ + case 206: /* sortorder ::= */ yytestcase(yyruleno==206); +{ yygotominor.yy112 = TSDB_ORDER_ASC; } break; - case 204: /* sortorder ::= DESC */ -{ yygotominor.yy150 = TSDB_ORDER_DESC;} + case 205: /* sortorder ::= DESC */ +{ yygotominor.yy112 = TSDB_ORDER_DESC;} break; - case 206: /* groupby_opt ::= */ -{ yygotominor.yy93 = 0;} + case 207: /* groupby_opt ::= */ +{ yygotominor.yy441 = 0;} break; - case 207: /* groupby_opt ::= GROUP BY grouplist */ -{ yygotominor.yy93 = yymsp[0].minor.yy93;} + case 208: /* groupby_opt ::= GROUP BY grouplist */ +{ yygotominor.yy441 = yymsp[0].minor.yy441;} break; - case 208: /* grouplist ::= grouplist COMMA item */ + case 209: /* grouplist ::= grouplist COMMA item */ { - yygotominor.yy93 = tVariantListAppend(yymsp[-2].minor.yy93, &yymsp[0].minor.yy518, -1); + yygotominor.yy441 = tVariantListAppend(yymsp[-2].minor.yy441, &yymsp[0].minor.yy506, -1); } break; - case 209: /* grouplist ::= item */ + case 210: /* grouplist ::= item */ { - yygotominor.yy93 = tVariantListAppend(NULL, &yymsp[0].minor.yy518, -1); + yygotominor.yy441 = tVariantListAppend(NULL, &yymsp[0].minor.yy506, -1); } break; - case 210: /* having_opt ::= */ - case 220: /* where_opt ::= */ yytestcase(yyruleno==220); - case 262: /* expritem ::= */ yytestcase(yyruleno==262); -{yygotominor.yy68 = 0;} + case 211: /* having_opt ::= */ + case 221: /* where_opt ::= */ yytestcase(yyruleno==221); + case 263: /* expritem ::= */ yytestcase(yyruleno==263); +{yygotominor.yy166 = 0;} break; - case 211: /* having_opt ::= HAVING expr */ - case 221: /* where_opt ::= WHERE expr */ yytestcase(yyruleno==221); - case 261: /* expritem ::= expr */ yytestcase(yyruleno==261); -{yygotominor.yy68 = yymsp[0].minor.yy68;} + case 212: /* having_opt ::= HAVING expr */ + case 222: /* where_opt ::= WHERE expr */ yytestcase(yyruleno==222); + case 262: /* expritem ::= expr */ yytestcase(yyruleno==262); +{yygotominor.yy166 = yymsp[0].minor.yy166;} break; - case 212: /* limit_opt ::= */ - case 216: /* slimit_opt ::= */ yytestcase(yyruleno==216); -{yygotominor.yy284.limit = -1; yygotominor.yy284.offset = 0;} + case 213: /* limit_opt ::= */ + case 217: /* slimit_opt ::= */ yytestcase(yyruleno==217); +{yygotominor.yy414.limit = -1; yygotominor.yy414.offset = 0;} break; - case 213: /* limit_opt ::= LIMIT signed */ - case 217: /* slimit_opt ::= SLIMIT signed */ yytestcase(yyruleno==217); -{yygotominor.yy284.limit = yymsp[0].minor.yy279; yygotominor.yy284.offset = 0;} + case 214: /* limit_opt ::= LIMIT signed */ + case 218: /* slimit_opt ::= SLIMIT signed */ yytestcase(yyruleno==218); +{yygotominor.yy414.limit = yymsp[0].minor.yy369; yygotominor.yy414.offset = 0;} break; - case 214: /* limit_opt ::= LIMIT signed OFFSET signed */ -{ yygotominor.yy284.limit = yymsp[-2].minor.yy279; yygotominor.yy284.offset = yymsp[0].minor.yy279;} + case 215: /* limit_opt ::= LIMIT signed OFFSET signed */ +{ yygotominor.yy414.limit = yymsp[-2].minor.yy369; yygotominor.yy414.offset = yymsp[0].minor.yy369;} break; - case 215: /* limit_opt ::= LIMIT signed COMMA signed */ -{ yygotominor.yy284.limit = yymsp[0].minor.yy279; yygotominor.yy284.offset = yymsp[-2].minor.yy279;} + case 216: /* limit_opt ::= LIMIT signed COMMA signed */ +{ yygotominor.yy414.limit = yymsp[0].minor.yy369; yygotominor.yy414.offset = yymsp[-2].minor.yy369;} break; - case 218: /* slimit_opt ::= SLIMIT signed SOFFSET signed */ -{yygotominor.yy284.limit = yymsp[-2].minor.yy279; yygotominor.yy284.offset = yymsp[0].minor.yy279;} + case 219: /* slimit_opt ::= SLIMIT signed SOFFSET signed */ +{yygotominor.yy414.limit = yymsp[-2].minor.yy369; yygotominor.yy414.offset = yymsp[0].minor.yy369;} break; - case 219: /* slimit_opt ::= SLIMIT signed COMMA signed */ -{yygotominor.yy284.limit = yymsp[0].minor.yy279; yygotominor.yy284.offset = yymsp[-2].minor.yy279;} + case 220: /* slimit_opt ::= SLIMIT signed COMMA signed */ +{yygotominor.yy414.limit = yymsp[0].minor.yy369; yygotominor.yy414.offset = yymsp[-2].minor.yy369;} break; - case 222: /* expr ::= LP expr RP */ -{yygotominor.yy68 = yymsp[-1].minor.yy68; yygotominor.yy68->token.z = yymsp[-2].minor.yy0.z; yygotominor.yy68->token.n = (yymsp[0].minor.yy0.z - yymsp[-2].minor.yy0.z + 1);} + case 223: /* expr ::= LP expr RP */ +{yygotominor.yy166 = yymsp[-1].minor.yy166; yygotominor.yy166->token.z = yymsp[-2].minor.yy0.z; yygotominor.yy166->token.n = (yymsp[0].minor.yy0.z - yymsp[-2].minor.yy0.z + 1);} break; - case 223: /* expr ::= ID */ -{ yygotominor.yy68 = tSqlExprCreateIdValue(&yymsp[0].minor.yy0, TK_ID);} + case 224: /* expr ::= ID */ +{ yygotominor.yy166 = tSqlExprCreateIdValue(&yymsp[0].minor.yy0, TK_ID);} break; - case 224: /* expr ::= ID DOT ID */ -{ yymsp[-2].minor.yy0.n += (1+yymsp[0].minor.yy0.n); yygotominor.yy68 = tSqlExprCreateIdValue(&yymsp[-2].minor.yy0, TK_ID);} + case 225: /* expr ::= ID DOT ID */ +{ yymsp[-2].minor.yy0.n += (1+yymsp[0].minor.yy0.n); yygotominor.yy166 = tSqlExprCreateIdValue(&yymsp[-2].minor.yy0, TK_ID);} break; - case 225: /* expr ::= ID DOT STAR */ -{ yymsp[-2].minor.yy0.n += (1+yymsp[0].minor.yy0.n); yygotominor.yy68 = tSqlExprCreateIdValue(&yymsp[-2].minor.yy0, TK_ALL);} + case 226: /* expr ::= ID DOT STAR */ +{ yymsp[-2].minor.yy0.n += (1+yymsp[0].minor.yy0.n); yygotominor.yy166 = tSqlExprCreateIdValue(&yymsp[-2].minor.yy0, TK_ALL);} break; - case 226: /* expr ::= INTEGER */ -{ yygotominor.yy68 = tSqlExprCreateIdValue(&yymsp[0].minor.yy0, TK_INTEGER);} + case 227: /* expr ::= INTEGER */ +{ yygotominor.yy166 = tSqlExprCreateIdValue(&yymsp[0].minor.yy0, TK_INTEGER);} break; - case 227: /* expr ::= MINUS INTEGER */ - case 228: /* expr ::= PLUS INTEGER */ yytestcase(yyruleno==228); -{ yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; yymsp[-1].minor.yy0.type = TK_INTEGER; yygotominor.yy68 = tSqlExprCreateIdValue(&yymsp[-1].minor.yy0, TK_INTEGER);} + case 228: /* expr ::= MINUS INTEGER */ + case 229: /* expr ::= PLUS INTEGER */ yytestcase(yyruleno==229); +{ yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; yymsp[-1].minor.yy0.type = TK_INTEGER; yygotominor.yy166 = tSqlExprCreateIdValue(&yymsp[-1].minor.yy0, TK_INTEGER);} break; - case 229: /* expr ::= FLOAT */ -{ yygotominor.yy68 = tSqlExprCreateIdValue(&yymsp[0].minor.yy0, TK_FLOAT);} + case 230: /* expr ::= FLOAT */ +{ yygotominor.yy166 = tSqlExprCreateIdValue(&yymsp[0].minor.yy0, TK_FLOAT);} break; - case 230: /* expr ::= MINUS FLOAT */ - case 231: /* expr ::= PLUS FLOAT */ yytestcase(yyruleno==231); -{ yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; yymsp[-1].minor.yy0.type = TK_FLOAT; yygotominor.yy68 = tSqlExprCreateIdValue(&yymsp[-1].minor.yy0, TK_FLOAT);} + case 231: /* expr ::= MINUS FLOAT */ + case 232: /* expr ::= PLUS FLOAT */ yytestcase(yyruleno==232); +{ yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; yymsp[-1].minor.yy0.type = TK_FLOAT; yygotominor.yy166 = tSqlExprCreateIdValue(&yymsp[-1].minor.yy0, TK_FLOAT);} break; - case 232: /* expr ::= STRING */ -{ yygotominor.yy68 = tSqlExprCreateIdValue(&yymsp[0].minor.yy0, TK_STRING);} + case 233: /* expr ::= STRING */ +{ yygotominor.yy166 = tSqlExprCreateIdValue(&yymsp[0].minor.yy0, TK_STRING);} break; - case 233: /* expr ::= NOW */ -{ yygotominor.yy68 = tSqlExprCreateIdValue(&yymsp[0].minor.yy0, TK_NOW); } + case 234: /* expr ::= NOW */ +{ yygotominor.yy166 = tSqlExprCreateIdValue(&yymsp[0].minor.yy0, TK_NOW); } break; - case 234: /* expr ::= VARIABLE */ -{ yygotominor.yy68 = tSqlExprCreateIdValue(&yymsp[0].minor.yy0, TK_VARIABLE);} + case 235: /* expr ::= VARIABLE */ +{ yygotominor.yy166 = tSqlExprCreateIdValue(&yymsp[0].minor.yy0, TK_VARIABLE);} break; - case 235: /* expr ::= PLUS VARIABLE */ - case 236: /* expr ::= MINUS VARIABLE */ yytestcase(yyruleno==236); -{ yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; yymsp[-1].minor.yy0.type = TK_VARIABLE; yygotominor.yy68 = tSqlExprCreateIdValue(&yymsp[-1].minor.yy0, TK_VARIABLE);} + case 236: /* expr ::= PLUS VARIABLE */ + case 237: /* expr ::= MINUS VARIABLE */ yytestcase(yyruleno==237); +{ yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; yymsp[-1].minor.yy0.type = TK_VARIABLE; yygotominor.yy166 = tSqlExprCreateIdValue(&yymsp[-1].minor.yy0, TK_VARIABLE);} break; - case 237: /* expr ::= BOOL */ -{ yygotominor.yy68 = tSqlExprCreateIdValue(&yymsp[0].minor.yy0, TK_BOOL);} + case 238: /* expr ::= BOOL */ +{ yygotominor.yy166 = tSqlExprCreateIdValue(&yymsp[0].minor.yy0, TK_BOOL);} break; - case 238: /* expr ::= NULL */ -{ yygotominor.yy68 = tSqlExprCreateIdValue(&yymsp[0].minor.yy0, TK_NULL);} + case 239: /* expr ::= NULL */ +{ yygotominor.yy166 = tSqlExprCreateIdValue(&yymsp[0].minor.yy0, TK_NULL);} break; - case 239: /* expr ::= ID LP exprlist RP */ -{ yygotominor.yy68 = tSqlExprCreateFunction(yymsp[-1].minor.yy93, &yymsp[-3].minor.yy0, &yymsp[0].minor.yy0, yymsp[-3].minor.yy0.type); } + case 240: /* expr ::= ID LP exprlist RP */ +{ yygotominor.yy166 = tSqlExprCreateFunction(yymsp[-1].minor.yy441, &yymsp[-3].minor.yy0, &yymsp[0].minor.yy0, yymsp[-3].minor.yy0.type); } break; - case 240: /* expr ::= ID LP STAR RP */ -{ yygotominor.yy68 = tSqlExprCreateFunction(NULL, &yymsp[-3].minor.yy0, &yymsp[0].minor.yy0, yymsp[-3].minor.yy0.type); } + case 241: /* expr ::= ID LP STAR RP */ +{ yygotominor.yy166 = tSqlExprCreateFunction(NULL, &yymsp[-3].minor.yy0, &yymsp[0].minor.yy0, yymsp[-3].minor.yy0.type); } break; - case 241: /* expr ::= expr IS NULL */ -{yygotominor.yy68 = tSqlExprCreate(yymsp[-2].minor.yy68, NULL, TK_ISNULL);} + case 242: /* expr ::= expr IS NULL */ +{yygotominor.yy166 = tSqlExprCreate(yymsp[-2].minor.yy166, NULL, TK_ISNULL);} break; - case 242: /* expr ::= expr IS NOT NULL */ -{yygotominor.yy68 = tSqlExprCreate(yymsp[-3].minor.yy68, NULL, TK_NOTNULL);} + case 243: /* expr ::= expr IS NOT NULL */ +{yygotominor.yy166 = tSqlExprCreate(yymsp[-3].minor.yy166, NULL, TK_NOTNULL);} break; - case 243: /* expr ::= expr LT expr */ -{yygotominor.yy68 = tSqlExprCreate(yymsp[-2].minor.yy68, yymsp[0].minor.yy68, TK_LT);} + case 244: /* expr ::= expr LT expr */ +{yygotominor.yy166 = tSqlExprCreate(yymsp[-2].minor.yy166, yymsp[0].minor.yy166, TK_LT);} break; - case 244: /* expr ::= expr GT expr */ -{yygotominor.yy68 = tSqlExprCreate(yymsp[-2].minor.yy68, yymsp[0].minor.yy68, TK_GT);} + case 245: /* expr ::= expr GT expr */ +{yygotominor.yy166 = tSqlExprCreate(yymsp[-2].minor.yy166, yymsp[0].minor.yy166, TK_GT);} break; - case 245: /* expr ::= expr LE expr */ -{yygotominor.yy68 = tSqlExprCreate(yymsp[-2].minor.yy68, yymsp[0].minor.yy68, TK_LE);} + case 246: /* expr ::= expr LE expr */ +{yygotominor.yy166 = tSqlExprCreate(yymsp[-2].minor.yy166, yymsp[0].minor.yy166, TK_LE);} break; - case 246: /* expr ::= expr GE expr */ -{yygotominor.yy68 = tSqlExprCreate(yymsp[-2].minor.yy68, yymsp[0].minor.yy68, TK_GE);} + case 247: /* expr ::= expr GE expr */ +{yygotominor.yy166 = tSqlExprCreate(yymsp[-2].minor.yy166, yymsp[0].minor.yy166, TK_GE);} break; - case 247: /* expr ::= expr NE expr */ -{yygotominor.yy68 = tSqlExprCreate(yymsp[-2].minor.yy68, yymsp[0].minor.yy68, TK_NE);} + case 248: /* expr ::= expr NE expr */ +{yygotominor.yy166 = tSqlExprCreate(yymsp[-2].minor.yy166, yymsp[0].minor.yy166, TK_NE);} break; - case 248: /* expr ::= expr EQ expr */ -{yygotominor.yy68 = tSqlExprCreate(yymsp[-2].minor.yy68, yymsp[0].minor.yy68, TK_EQ);} + case 249: /* expr ::= expr EQ expr */ +{yygotominor.yy166 = tSqlExprCreate(yymsp[-2].minor.yy166, yymsp[0].minor.yy166, TK_EQ);} break; - case 249: /* expr ::= expr BETWEEN expr AND expr */ -{ tSqlExpr* X2 = tSqlExprClone(yymsp[-4].minor.yy68); yygotominor.yy68 = tSqlExprCreate(tSqlExprCreate(yymsp[-4].minor.yy68, yymsp[-2].minor.yy68, TK_GE), tSqlExprCreate(X2, yymsp[0].minor.yy68, TK_LE), TK_AND);} + case 250: /* expr ::= expr BETWEEN expr AND expr */ +{ tSqlExpr* X2 = tSqlExprClone(yymsp[-4].minor.yy166); yygotominor.yy166 = tSqlExprCreate(tSqlExprCreate(yymsp[-4].minor.yy166, yymsp[-2].minor.yy166, TK_GE), tSqlExprCreate(X2, yymsp[0].minor.yy166, TK_LE), TK_AND);} break; - case 250: /* expr ::= expr AND expr */ -{yygotominor.yy68 = tSqlExprCreate(yymsp[-2].minor.yy68, yymsp[0].minor.yy68, TK_AND);} + case 251: /* expr ::= expr AND expr */ +{yygotominor.yy166 = tSqlExprCreate(yymsp[-2].minor.yy166, yymsp[0].minor.yy166, TK_AND);} break; - case 251: /* expr ::= expr OR expr */ -{yygotominor.yy68 = tSqlExprCreate(yymsp[-2].minor.yy68, yymsp[0].minor.yy68, TK_OR); } + case 252: /* expr ::= expr OR expr */ +{yygotominor.yy166 = tSqlExprCreate(yymsp[-2].minor.yy166, yymsp[0].minor.yy166, TK_OR); } break; - case 252: /* expr ::= expr PLUS expr */ -{yygotominor.yy68 = tSqlExprCreate(yymsp[-2].minor.yy68, yymsp[0].minor.yy68, TK_PLUS); } + case 253: /* expr ::= expr PLUS expr */ +{yygotominor.yy166 = tSqlExprCreate(yymsp[-2].minor.yy166, yymsp[0].minor.yy166, TK_PLUS); } break; - case 253: /* expr ::= expr MINUS expr */ -{yygotominor.yy68 = tSqlExprCreate(yymsp[-2].minor.yy68, yymsp[0].minor.yy68, TK_MINUS); } + case 254: /* expr ::= expr MINUS expr */ +{yygotominor.yy166 = tSqlExprCreate(yymsp[-2].minor.yy166, yymsp[0].minor.yy166, TK_MINUS); } break; - case 254: /* expr ::= expr STAR expr */ -{yygotominor.yy68 = tSqlExprCreate(yymsp[-2].minor.yy68, yymsp[0].minor.yy68, TK_STAR); } + case 255: /* expr ::= expr STAR expr */ +{yygotominor.yy166 = tSqlExprCreate(yymsp[-2].minor.yy166, yymsp[0].minor.yy166, TK_STAR); } break; - case 255: /* expr ::= expr SLASH expr */ -{yygotominor.yy68 = tSqlExprCreate(yymsp[-2].minor.yy68, yymsp[0].minor.yy68, TK_DIVIDE);} + case 256: /* expr ::= expr SLASH expr */ +{yygotominor.yy166 = tSqlExprCreate(yymsp[-2].minor.yy166, yymsp[0].minor.yy166, TK_DIVIDE);} break; - case 256: /* expr ::= expr REM expr */ -{yygotominor.yy68 = tSqlExprCreate(yymsp[-2].minor.yy68, yymsp[0].minor.yy68, TK_REM); } + case 257: /* expr ::= expr REM expr */ +{yygotominor.yy166 = tSqlExprCreate(yymsp[-2].minor.yy166, yymsp[0].minor.yy166, TK_REM); } break; - case 257: /* expr ::= expr LIKE expr */ -{yygotominor.yy68 = tSqlExprCreate(yymsp[-2].minor.yy68, yymsp[0].minor.yy68, TK_LIKE); } + case 258: /* expr ::= expr LIKE expr */ +{yygotominor.yy166 = tSqlExprCreate(yymsp[-2].minor.yy166, yymsp[0].minor.yy166, TK_LIKE); } break; - case 258: /* expr ::= expr IN LP exprlist RP */ -{yygotominor.yy68 = tSqlExprCreate(yymsp[-4].minor.yy68, (tSqlExpr*)yymsp[-1].minor.yy93, TK_IN); } + case 259: /* expr ::= expr IN LP exprlist RP */ +{yygotominor.yy166 = tSqlExprCreate(yymsp[-4].minor.yy166, (tSqlExpr*)yymsp[-1].minor.yy441, TK_IN); } break; - case 259: /* exprlist ::= exprlist COMMA expritem */ -{yygotominor.yy93 = tSqlExprListAppend(yymsp[-2].minor.yy93,yymsp[0].minor.yy68,0, 0);} + case 260: /* exprlist ::= exprlist COMMA expritem */ +{yygotominor.yy441 = tSqlExprListAppend(yymsp[-2].minor.yy441,yymsp[0].minor.yy166,0, 0);} break; - case 260: /* exprlist ::= expritem */ -{yygotominor.yy93 = tSqlExprListAppend(0,yymsp[0].minor.yy68,0, 0);} + case 261: /* exprlist ::= expritem */ +{yygotominor.yy441 = tSqlExprListAppend(0,yymsp[0].minor.yy166,0, 0);} break; - case 263: /* cmd ::= RESET QUERY CACHE */ + case 264: /* cmd ::= RESET QUERY CACHE */ { setDCLSqlElems(pInfo, TSDB_SQL_RESET_CACHE, 0);} break; - case 264: /* cmd ::= SYNCDB ids REPLICA */ + case 265: /* cmd ::= SYNCDB ids REPLICA */ { setDCLSqlElems(pInfo, TSDB_SQL_SYNC_DB_REPLICA, 1, &yymsp[-1].minor.yy0);} break; - case 265: /* cmd ::= ALTER TABLE ids cpxName ADD COLUMN columnlist */ + case 266: /* 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.yy93, NULL, TSDB_ALTER_TABLE_ADD_COLUMN, -1); + SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, yymsp[0].minor.yy441, NULL, TSDB_ALTER_TABLE_ADD_COLUMN, -1); setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); } break; - case 266: /* cmd ::= ALTER TABLE ids cpxName DROP COLUMN ids */ + case 267: /* cmd ::= ALTER TABLE ids cpxName DROP COLUMN ids */ { yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n; @@ -2630,21 +2638,21 @@ static void yy_reduce( setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); } break; - case 267: /* cmd ::= ALTER TABLE ids cpxName MODIFY COLUMN columnlist */ + case 268: /* 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.yy93, NULL, TSDB_ALTER_TABLE_CHANGE_COLUMN, -1); + SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, yymsp[0].minor.yy441, NULL, TSDB_ALTER_TABLE_CHANGE_COLUMN, -1); setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); } break; - case 268: /* cmd ::= ALTER TABLE ids cpxName ADD TAG columnlist */ + case 269: /* 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.yy93, NULL, TSDB_ALTER_TABLE_ADD_TAG_COLUMN, -1); + SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, yymsp[0].minor.yy441, NULL, TSDB_ALTER_TABLE_ADD_TAG_COLUMN, -1); setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); } break; - case 269: /* cmd ::= ALTER TABLE ids cpxName DROP TAG ids */ + case 270: /* cmd ::= ALTER TABLE ids cpxName DROP TAG ids */ { yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n; @@ -2655,7 +2663,7 @@ static void yy_reduce( setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); } break; - case 270: /* cmd ::= ALTER TABLE ids cpxName CHANGE TAG ids ids */ + case 271: /* cmd ::= ALTER TABLE ids cpxName CHANGE TAG ids ids */ { yymsp[-5].minor.yy0.n += yymsp[-4].minor.yy0.n; @@ -2669,33 +2677,33 @@ static void yy_reduce( setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); } break; - case 271: /* cmd ::= ALTER TABLE ids cpxName SET TAG ids EQ tagitem */ + case 272: /* cmd ::= ALTER TABLE ids cpxName SET TAG ids EQ tagitem */ { yymsp[-6].minor.yy0.n += yymsp[-5].minor.yy0.n; toTSDBType(yymsp[-2].minor.yy0.type); SArray* A = tVariantListAppendToken(NULL, &yymsp[-2].minor.yy0, -1); - A = tVariantListAppend(A, &yymsp[0].minor.yy518, -1); + A = tVariantListAppend(A, &yymsp[0].minor.yy506, -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 272: /* cmd ::= ALTER TABLE ids cpxName MODIFY TAG columnlist */ + case 273: /* 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.yy93, NULL, TSDB_ALTER_TABLE_MODIFY_TAG_COLUMN, -1); + SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, yymsp[0].minor.yy441, NULL, TSDB_ALTER_TABLE_MODIFY_TAG_COLUMN, -1); setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); } break; - case 273: /* cmd ::= ALTER STABLE ids cpxName ADD COLUMN columnlist */ + case 274: /* 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.yy93, NULL, TSDB_ALTER_TABLE_ADD_COLUMN, TSDB_SUPER_TABLE); + SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, yymsp[0].minor.yy441, NULL, TSDB_ALTER_TABLE_ADD_COLUMN, TSDB_SUPER_TABLE); setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); } break; - case 274: /* cmd ::= ALTER STABLE ids cpxName DROP COLUMN ids */ + case 275: /* cmd ::= ALTER STABLE ids cpxName DROP COLUMN ids */ { yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n; @@ -2706,21 +2714,21 @@ static void yy_reduce( setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); } break; - case 275: /* cmd ::= ALTER STABLE ids cpxName MODIFY COLUMN columnlist */ + case 276: /* 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.yy93, NULL, TSDB_ALTER_TABLE_CHANGE_COLUMN, TSDB_SUPER_TABLE); + SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, yymsp[0].minor.yy441, NULL, TSDB_ALTER_TABLE_CHANGE_COLUMN, TSDB_SUPER_TABLE); setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); } break; - case 276: /* cmd ::= ALTER STABLE ids cpxName ADD TAG columnlist */ + case 277: /* 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.yy93, NULL, TSDB_ALTER_TABLE_ADD_TAG_COLUMN, TSDB_SUPER_TABLE); + SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, yymsp[0].minor.yy441, NULL, TSDB_ALTER_TABLE_ADD_TAG_COLUMN, TSDB_SUPER_TABLE); setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); } break; - case 277: /* cmd ::= ALTER STABLE ids cpxName DROP TAG ids */ + case 278: /* cmd ::= ALTER STABLE ids cpxName DROP TAG ids */ { yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n; @@ -2731,7 +2739,7 @@ static void yy_reduce( setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); } break; - case 278: /* cmd ::= ALTER STABLE ids cpxName CHANGE TAG ids ids */ + case 279: /* cmd ::= ALTER STABLE ids cpxName CHANGE TAG ids ids */ { yymsp[-5].minor.yy0.n += yymsp[-4].minor.yy0.n; @@ -2745,32 +2753,32 @@ static void yy_reduce( setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); } break; - case 279: /* cmd ::= ALTER STABLE ids cpxName SET TAG ids EQ tagitem */ + case 280: /* 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); - A = tVariantListAppend(A, &yymsp[0].minor.yy518, -1); + A = tVariantListAppend(A, &yymsp[0].minor.yy506, -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 280: /* cmd ::= ALTER STABLE ids cpxName MODIFY TAG columnlist */ + case 281: /* 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.yy93, NULL, TSDB_ALTER_TABLE_MODIFY_TAG_COLUMN, TSDB_SUPER_TABLE); + SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, yymsp[0].minor.yy441, NULL, TSDB_ALTER_TABLE_MODIFY_TAG_COLUMN, TSDB_SUPER_TABLE); setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); } break; - case 281: /* cmd ::= KILL CONNECTION INTEGER */ + case 282: /* cmd ::= KILL CONNECTION INTEGER */ {setKillSql(pInfo, TSDB_SQL_KILL_CONNECTION, &yymsp[0].minor.yy0);} break; - case 282: /* cmd ::= KILL STREAM INTEGER COLON INTEGER */ + case 283: /* 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 283: /* cmd ::= KILL QUERY INTEGER COLON INTEGER */ + case 284: /* cmd ::= KILL QUERY INTEGER COLON INTEGER */ {yymsp[-2].minor.yy0.n += (yymsp[-1].minor.yy0.n + yymsp[0].minor.yy0.n); setKillSql(pInfo, TSDB_SQL_KILL_QUERY, &yymsp[-2].minor.yy0);} break; default: diff --git a/src/tsdb/src/tsdbCompact.c b/src/tsdb/src/tsdbCompact.c index c98e9175b8639bd135c34ca0fadda7afa53e4f36..5211ee3c611bb9a75ba02aa5fdf810bb52b1ab9d 100644 --- a/src/tsdb/src/tsdbCompact.c +++ b/src/tsdb/src/tsdbCompact.c @@ -118,406 +118,407 @@ static int tsdbCompactMeta(STsdbRepo *pRepo) { return 0; } -static int tsdbCompactTSData(STsdbRepo *pRepo) { - SCompactH compactH; - SDFileSet *pSet = NULL; + static int tsdbCompactTSData(STsdbRepo *pRepo) { + SCompactH compactH; + SDFileSet *pSet = NULL; - tsdbDebug("vgId:%d start to compact TS data", REPO_ID(pRepo)); + tsdbDebug("vgId:%d start to compact TS data", REPO_ID(pRepo)); - // If no file, just return 0; - if (taosArrayGetSize(REPO_FS(pRepo)->cstatus->df) <= 0) { - tsdbDebug("vgId:%d no TS data file to compact, compact over", REPO_ID(pRepo)); - return 0; - } - - if (tsdbInitCompactH(&compactH, pRepo) < 0) { - return -1; - } - - while ((pSet = tsdbFSIterNext(&(compactH.fsIter)))) { - // Remove those expired files - if (pSet->fid < compactH.rtn.minFid) { - tsdbInfo("vgId:%d FSET %d on level %d disk id %d expires, remove it", REPO_ID(pRepo), pSet->fid, - TSDB_FSET_LEVEL(pSet), TSDB_FSET_ID(pSet)); - continue; + // If no file, just return 0; + if (taosArrayGetSize(REPO_FS(pRepo)->cstatus->df) <= 0) { + tsdbDebug("vgId:%d no TS data file to compact, compact over", REPO_ID(pRepo)); + return 0; } - if (TSDB_FSET_LEVEL(pSet) == TFS_MAX_LEVEL) { - tsdbDebug("vgId:%d FSET %d on level %d, should not compact", REPO_ID(pRepo), pSet->fid, TFS_MAX_LEVEL); - tsdbUpdateDFileSet(REPO_FS(pRepo), pSet); - continue; - } - - if (tsdbCompactFSet(&compactH, pSet) < 0) { - tsdbDestroyCompactH(&compactH); - tsdbError("vgId:%d failed to compact FSET %d since %s", REPO_ID(pRepo), pSet->fid, tstrerror(terrno)); + if (tsdbInitCompactH(&compactH, pRepo) < 0) { return -1; } - } - tsdbDestroyCompactH(&compactH); - tsdbDebug("vgId:%d compact TS data over", REPO_ID(pRepo)); - return 0; -} + while ((pSet = tsdbFSIterNext(&(compactH.fsIter)))) { + // Remove those expired files + if (pSet->fid < compactH.rtn.minFid) { + tsdbInfo("vgId:%d FSET %d on level %d disk id %d expires, remove it", REPO_ID(pRepo), pSet->fid, + TSDB_FSET_LEVEL(pSet), TSDB_FSET_ID(pSet)); + continue; + } -static int tsdbCompactFSet(SCompactH *pComph, SDFileSet *pSet) { - STsdbRepo *pRepo = TSDB_COMPACT_REPO(pComph); - SDiskID did; + if (TSDB_FSET_LEVEL(pSet) == TFS_MAX_LEVEL) { + tsdbDebug("vgId:%d FSET %d on level %d, should not compact", REPO_ID(pRepo), pSet->fid, TFS_MAX_LEVEL); + tsdbUpdateDFileSet(REPO_FS(pRepo), pSet); + continue; + } - tsdbDebug("vgId:%d start to compact FSET %d on level %d id %d", REPO_ID(pRepo), pSet->fid, TSDB_FSET_LEVEL(pSet), - TSDB_FSET_ID(pSet)); + if (tsdbCompactFSet(&compactH, pSet) < 0) { + tsdbDestroyCompactH(&compactH); + tsdbError("vgId:%d failed to compact FSET %d since %s", REPO_ID(pRepo), pSet->fid, tstrerror(terrno)); + return -1; + } + } - if (tsdbCompactFSetInit(pComph, pSet) < 0) { - return -1; + tsdbDestroyCompactH(&compactH); + tsdbDebug("vgId:%d compact TS data over", REPO_ID(pRepo)); + return 0; } - if (!tsdbShouldCompact(pComph)) { - tsdbDebug("vgId:%d no need to compact FSET %d", REPO_ID(pRepo), pSet->fid); - if (tsdbApplyRtnOnFSet(TSDB_COMPACT_REPO(pComph), pSet, &(pComph->rtn)) < 0) { - tsdbCompactFSetEnd(pComph); - return -1; - } - } else { - // Create new fset as compacted fset - tfsAllocDisk(tsdbGetFidLevel(pSet->fid, &(pComph->rtn)), &(did.level), &(did.id)); - if (did.level == TFS_UNDECIDED_LEVEL) { - terrno = TSDB_CODE_TDB_NO_AVAIL_DISK; - tsdbError("vgId:%d failed to compact FSET %d since %s", REPO_ID(pRepo), pSet->fid, tstrerror(terrno)); - tsdbCompactFSetEnd(pComph); - return -1; - } + static int tsdbCompactFSet(SCompactH *pComph, SDFileSet *pSet) { + STsdbRepo *pRepo = TSDB_COMPACT_REPO(pComph); + SDiskID did; + + tsdbDebug("vgId:%d start to compact FSET %d on level %d id %d", REPO_ID(pRepo), pSet->fid, TSDB_FSET_LEVEL(pSet), + TSDB_FSET_ID(pSet)); - tsdbInitDFileSet(TSDB_COMPACT_WSET(pComph), did, REPO_ID(pRepo), TSDB_FSET_FID(pSet), - FS_TXN_VERSION(REPO_FS(pRepo))); - if (tsdbCreateDFileSet(TSDB_COMPACT_WSET(pComph), true) < 0) { - tsdbError("vgId:%d failed to compact FSET %d since %s", REPO_ID(pRepo), pSet->fid, tstrerror(terrno)); - tsdbCompactFSetEnd(pComph); + if (tsdbCompactFSetInit(pComph, pSet) < 0) { return -1; } - if (tsdbCompactFSetImpl(pComph) < 0) { + if (!tsdbShouldCompact(pComph)) { + tsdbDebug("vgId:%d no need to compact FSET %d", REPO_ID(pRepo), pSet->fid); + if (tsdbApplyRtnOnFSet(TSDB_COMPACT_REPO(pComph), pSet, &(pComph->rtn)) < 0) { + tsdbCompactFSetEnd(pComph); + return -1; + } + } else { + // Create new fset as compacted fset + tfsAllocDisk(tsdbGetFidLevel(pSet->fid, &(pComph->rtn)), &(did.level), &(did.id)); + if (did.level == TFS_UNDECIDED_LEVEL) { + terrno = TSDB_CODE_TDB_NO_AVAIL_DISK; + tsdbError("vgId:%d failed to compact FSET %d since %s", REPO_ID(pRepo), pSet->fid, tstrerror(terrno)); + tsdbCompactFSetEnd(pComph); + return -1; + } + + tsdbInitDFileSet(TSDB_COMPACT_WSET(pComph), did, REPO_ID(pRepo), TSDB_FSET_FID(pSet), + FS_TXN_VERSION(REPO_FS(pRepo))); + if (tsdbCreateDFileSet(TSDB_COMPACT_WSET(pComph), true) < 0) { + tsdbError("vgId:%d failed to compact FSET %d since %s", REPO_ID(pRepo), pSet->fid, tstrerror(terrno)); + tsdbCompactFSetEnd(pComph); + return -1; + } + + if (tsdbCompactFSetImpl(pComph) < 0) { + tsdbCloseDFileSet(TSDB_COMPACT_WSET(pComph)); + tsdbRemoveDFileSet(TSDB_COMPACT_WSET(pComph)); + tsdbCompactFSetEnd(pComph); + return -1; + } + tsdbCloseDFileSet(TSDB_COMPACT_WSET(pComph)); - tsdbRemoveDFileSet(TSDB_COMPACT_WSET(pComph)); - tsdbCompactFSetEnd(pComph); - return -1; + tsdbUpdateDFileSet(REPO_FS(pRepo), TSDB_COMPACT_WSET(pComph)); + tsdbDebug("vgId:%d FSET %d compact over", REPO_ID(pRepo), pSet->fid); } - tsdbCloseDFileSet(TSDB_COMPACT_WSET(pComph)); - tsdbUpdateDFileSet(REPO_FS(pRepo), TSDB_COMPACT_WSET(pComph)); - tsdbDebug("vgId:%d FSET %d compact over", REPO_ID(pRepo), pSet->fid); + tsdbCompactFSetEnd(pComph); + return 0; } - tsdbCompactFSetEnd(pComph); - return 0; -} - -static bool tsdbShouldCompact(SCompactH *pComph) { - STsdbRepo * pRepo = TSDB_COMPACT_REPO(pComph); - STsdbCfg * pCfg = REPO_CFG(pRepo); - SReadH * pReadh = &(pComph->readh); - STableCompactH *pTh; - SBlock * pBlock; - int defaultRows = TSDB_DEFAULT_BLOCK_ROWS(pCfg->maxRowsPerFileBlock); - SDFile * pDataF = TSDB_READ_DATA_FILE(pReadh); - SDFile * pLastF = TSDB_READ_LAST_FILE(pReadh); + static bool tsdbShouldCompact(SCompactH *pComph) { + STsdbRepo * pRepo = TSDB_COMPACT_REPO(pComph); + STsdbCfg * pCfg = REPO_CFG(pRepo); + SReadH * pReadh = &(pComph->readh); + STableCompactH *pTh; + SBlock * pBlock; + int defaultRows = TSDB_DEFAULT_BLOCK_ROWS(pCfg->maxRowsPerFileBlock); + SDFile * pDataF = TSDB_READ_DATA_FILE(pReadh); + SDFile * pLastF = TSDB_READ_LAST_FILE(pReadh); - int tblocks = 0; // total blocks - int nSubBlocks = 0; // # of blocks with sub-blocks - int nSmallBlocks = 0; // # of blocks with rows < defaultRows - int64_t tsize = 0; + int tblocks = 0; // total blocks + int nSubBlocks = 0; // # of blocks with sub-blocks + int nSmallBlocks = 0; // # of blocks with rows < defaultRows + int64_t tsize = 0; - for (size_t i = 0; i < taosArrayGetSize(pComph->tbArray); i++) { - pTh = (STableCompactH *)taosArrayGet(pComph->tbArray, i); + for (size_t i = 0; i < taosArrayGetSize(pComph->tbArray); i++) { + pTh = (STableCompactH *)taosArrayGet(pComph->tbArray, i); - if (pTh->pTable == NULL || pTh->pBlkIdx == NULL) continue; + if (pTh->pTable == NULL || pTh->pBlkIdx == NULL) continue; - for (size_t bidx = 0; bidx < pTh->pBlkIdx->numOfBlocks; bidx++) { - tblocks++; - pBlock = pTh->pInfo->blocks + bidx; + for (size_t bidx = 0; bidx < pTh->pBlkIdx->numOfBlocks; bidx++) { + tblocks++; + pBlock = pTh->pInfo->blocks + bidx; - if (pBlock->numOfRows < defaultRows) { - nSmallBlocks++; - } + if (pBlock->numOfRows < defaultRows) { + nSmallBlocks++; + } - if (pBlock->numOfSubBlocks > 1) { - nSubBlocks++; - for (int k = 0; k < pBlock->numOfSubBlocks; k++) { - SBlock *iBlock = ((SBlock *)POINTER_SHIFT(pTh->pInfo, pBlock->offset)) + k; - tsize = tsize + iBlock->len; + if (pBlock->numOfSubBlocks > 1) { + nSubBlocks++; + for (int k = 0; k < pBlock->numOfSubBlocks; k++) { + SBlock *iBlock = ((SBlock *)POINTER_SHIFT(pTh->pInfo, pBlock->offset)) + k; + tsize = tsize + iBlock->len; + } + } else if (pBlock->numOfSubBlocks == 1) { + tsize += pBlock->len; + } else { + ASSERT(0); } - } else if (pBlock->numOfSubBlocks == 1) { - tsize += pBlock->len; - } else { - ASSERT(0); } } + + return (((nSubBlocks * 1.0 / tblocks) > 0.33) || ((nSmallBlocks * 1.0 / tblocks) > 0.33) || + (tsize * 1.0 / (pDataF->info.size + pLastF->info.size - 2 * TSDB_FILE_HEAD_SIZE) < 0.85)); } - return (((nSubBlocks * 1.0 / tblocks) > 0.33) || ((nSmallBlocks * 1.0 / tblocks) > 0.33) || - (tsize * 1.0 / (pDataF->info.size + pLastF->info.size - 2 * TSDB_FILE_HEAD_SIZE) < 0.85)); -} + static int tsdbInitCompactH(SCompactH *pComph, STsdbRepo *pRepo) { + STsdbCfg *pCfg = REPO_CFG(pRepo); -static int tsdbInitCompactH(SCompactH *pComph, STsdbRepo *pRepo) { - STsdbCfg *pCfg = REPO_CFG(pRepo); + memset(pComph, 0, sizeof(*pComph)); - memset(pComph, 0, sizeof(*pComph)); + TSDB_FSET_SET_CLOSED(TSDB_COMPACT_WSET(pComph)); - TSDB_FSET_SET_CLOSED(TSDB_COMPACT_WSET(pComph)); + tsdbGetRtnSnap(pRepo, &(pComph->rtn)); + tsdbFSIterInit(&(pComph->fsIter), REPO_FS(pRepo), TSDB_FS_ITER_FORWARD); - tsdbGetRtnSnap(pRepo, &(pComph->rtn)); - tsdbFSIterInit(&(pComph->fsIter), REPO_FS(pRepo), TSDB_FS_ITER_FORWARD); + if (tsdbInitReadH(&(pComph->readh), pRepo) < 0) { + return -1; + } - if (tsdbInitReadH(&(pComph->readh), pRepo) < 0) { - return -1; - } + if (tsdbInitCompTbArray(pComph) < 0) { + tsdbDestroyCompactH(pComph); + return -1; + } - if (tsdbInitCompTbArray(pComph) < 0) { - tsdbDestroyCompactH(pComph); - return -1; - } + pComph->aBlkIdx = taosArrayInit(1024, sizeof(SBlockIdx)); + if (pComph->aBlkIdx == NULL) { + terrno = TSDB_CODE_TDB_OUT_OF_MEMORY; + tsdbDestroyCompactH(pComph); + return -1; + } - pComph->aBlkIdx = taosArrayInit(1024, sizeof(SBlockIdx)); - if (pComph->aBlkIdx == NULL) { - terrno = TSDB_CODE_TDB_OUT_OF_MEMORY; - tsdbDestroyCompactH(pComph); - return -1; - } + pComph->aSupBlk = taosArrayInit(1024, sizeof(SBlock)); + if (pComph->aSupBlk == NULL) { + terrno = TSDB_CODE_TDB_OUT_OF_MEMORY; + tsdbDestroyCompactH(pComph); + return -1; + } - pComph->aSupBlk = taosArrayInit(1024, sizeof(SBlock)); - if (pComph->aSupBlk == NULL) { - terrno = TSDB_CODE_TDB_OUT_OF_MEMORY; - tsdbDestroyCompactH(pComph); - return -1; - } + pComph->pDataCols = tdNewDataCols(0, 0, pCfg->maxRowsPerFileBlock); + if (pComph->pDataCols == NULL) { + terrno = TSDB_CODE_TDB_OUT_OF_MEMORY; + tsdbDestroyCompactH(pComph); + return -1; + } - pComph->pDataCols = tdNewDataCols(0, 0, pCfg->maxRowsPerFileBlock); - if (pComph->pDataCols == NULL) { - terrno = TSDB_CODE_TDB_OUT_OF_MEMORY; - tsdbDestroyCompactH(pComph); - return -1; + return 0; } - return 0; -} - -static void tsdbDestroyCompactH(SCompactH *pComph) { - pComph->pDataCols = tdFreeDataCols(pComph->pDataCols); - pComph->aSupBlk = taosArrayDestroy(pComph->aSupBlk); - pComph->aBlkIdx = taosArrayDestroy(pComph->aBlkIdx); - tsdbDestroyCompTbArray(pComph); - tsdbDestroyReadH(&(pComph->readh)); - tsdbCloseDFileSet(TSDB_COMPACT_WSET(pComph)); -} - -static int tsdbInitCompTbArray(SCompactH *pComph) { // Init pComp->tbArray - STsdbRepo *pRepo = TSDB_COMPACT_REPO(pComph); - STsdbMeta *pMeta = pRepo->tsdbMeta; - - if (tsdbRLockRepoMeta(pRepo) < 0) return -1; - - pComph->tbArray = taosArrayInit(pMeta->maxTables, sizeof(STableCompactH)); - if (pComph->tbArray == NULL) { - terrno = TSDB_CODE_TDB_OUT_OF_MEMORY; - tsdbUnlockRepoMeta(pRepo); - return -1; + static void tsdbDestroyCompactH(SCompactH *pComph) { + pComph->pDataCols = tdFreeDataCols(pComph->pDataCols); + pComph->aSupBlk = taosArrayDestroy(pComph->aSupBlk); + pComph->aBlkIdx = taosArrayDestroy(pComph->aBlkIdx); + tsdbDestroyCompTbArray(pComph); + tsdbDestroyReadH(&(pComph->readh)); + tsdbCloseDFileSet(TSDB_COMPACT_WSET(pComph)); } - // Note here must start from 0 - for (int i = 0; i < pMeta->maxTables; i++) { - STableCompactH ch = {0}; - if (pMeta->tables[i] != NULL) { - tsdbRefTable(pMeta->tables[i]); - ch.pTable = pMeta->tables[i]; - } + static int tsdbInitCompTbArray(SCompactH *pComph) { // Init pComp->tbArray + STsdbRepo *pRepo = TSDB_COMPACT_REPO(pComph); + STsdbMeta *pMeta = pRepo->tsdbMeta; + + if (tsdbRLockRepoMeta(pRepo) < 0) return -1; - if (taosArrayPush(pComph->tbArray, &ch) == NULL) { + pComph->tbArray = taosArrayInit(pMeta->maxTables, sizeof(STableCompactH)); + if (pComph->tbArray == NULL) { terrno = TSDB_CODE_TDB_OUT_OF_MEMORY; tsdbUnlockRepoMeta(pRepo); return -1; } - } - - if (tsdbUnlockRepoMeta(pRepo) < 0) return -1; - return 0; -} -static void tsdbDestroyCompTbArray(SCompactH *pComph) { - STableCompactH *pTh; - - if (pComph->tbArray == NULL) return; + // Note here must start from 0 + for (int i = 0; i < pMeta->maxTables; i++) { + STableCompactH ch = {0}; + if (pMeta->tables[i] != NULL) { + tsdbRefTable(pMeta->tables[i]); + ch.pTable = pMeta->tables[i]; + } - for (size_t i = 0; i < taosArrayGetSize(pComph->tbArray); i++) { - pTh = (STableCompactH *)taosArrayGet(pComph->tbArray, i); - if (pTh->pTable) { - tsdbUnRefTable(pTh->pTable); + if (taosArrayPush(pComph->tbArray, &ch) == NULL) { + terrno = TSDB_CODE_TDB_OUT_OF_MEMORY; + tsdbUnlockRepoMeta(pRepo); + return -1; + } } - pTh->pInfo = taosTZfree(pTh->pInfo); + if (tsdbUnlockRepoMeta(pRepo) < 0) return -1; + return 0; } - pComph->tbArray = taosArrayDestroy(pComph->tbArray); -} + static void tsdbDestroyCompTbArray(SCompactH *pComph) { + STableCompactH *pTh; + + if (pComph->tbArray == NULL) return; -static int tsdbCacheFSetIndex(SCompactH *pComph) { - SReadH *pReadH = &(pComph->readh); + for (size_t i = 0; i < taosArrayGetSize(pComph->tbArray); i++) { + pTh = (STableCompactH *)taosArrayGet(pComph->tbArray, i); + if (pTh->pTable) { + tsdbUnRefTable(pTh->pTable); + } + + pTh->pInfo = taosTZfree(pTh->pInfo); + } - if (tsdbLoadBlockIdx(pReadH) < 0) { - return -1; + pComph->tbArray = taosArrayDestroy(pComph->tbArray); } - for (int tid = 1; tid < taosArrayGetSize(pComph->tbArray); tid++) { - STableCompactH *pTh = (STableCompactH *)taosArrayGet(pComph->tbArray, tid); - pTh->pBlkIdx = NULL; + static int tsdbCacheFSetIndex(SCompactH *pComph) { + SReadH *pReadH = &(pComph->readh); - if (pTh->pTable == NULL) continue; - if (tsdbSetReadTable(pReadH, pTh->pTable) < 0) { + if (tsdbLoadBlockIdx(pReadH) < 0) { return -1; } - if (pReadH->pBlkIdx == NULL) continue; - pTh->bindex = *(pReadH->pBlkIdx); - pTh->pBlkIdx = &(pTh->bindex); + for (int tid = 1; tid < taosArrayGetSize(pComph->tbArray); tid++) { + STableCompactH *pTh = (STableCompactH *)taosArrayGet(pComph->tbArray, tid); + pTh->pBlkIdx = NULL; - if (tsdbMakeRoom((void **)(&(pTh->pInfo)), pTh->pBlkIdx->len) < 0) { - return -1; - } + if (pTh->pTable == NULL) continue; + if (tsdbSetReadTable(pReadH, pTh->pTable) < 0) { + return -1; + } - if (tsdbLoadBlockInfo(pReadH, (void *)(pTh->pInfo)) < 0) { - return -1; - } - } + if (pReadH->pBlkIdx == NULL) continue; + pTh->bindex = *(pReadH->pBlkIdx); + pTh->pBlkIdx = &(pTh->bindex); - return 0; -} + if (tsdbMakeRoom((void **)(&(pTh->pInfo)), pTh->pBlkIdx->len) < 0) { + return -1; + } -static int tsdbCompactFSetInit(SCompactH *pComph, SDFileSet *pSet) { - taosArrayClear(pComph->aBlkIdx); - taosArrayClear(pComph->aSupBlk); + if (tsdbLoadBlockInfo(pReadH, (void *)(pTh->pInfo)) < 0) { + return -1; + } + } - if (tsdbSetAndOpenReadFSet(&(pComph->readh), pSet) < 0) { - return -1; + return 0; } - if (tsdbCacheFSetIndex(pComph) < 0) { - tsdbCloseAndUnsetFSet(&(pComph->readh)); - return -1; - } + static int tsdbCompactFSetInit(SCompactH *pComph, SDFileSet *pSet) { + taosArrayClear(pComph->aBlkIdx); + taosArrayClear(pComph->aSupBlk); - return 0; -} + if (tsdbSetAndOpenReadFSet(&(pComph->readh), pSet) < 0) { + return -1; + } -static void tsdbCompactFSetEnd(SCompactH *pComph) { tsdbCloseAndUnsetFSet(&(pComph->readh)); } + if (tsdbCacheFSetIndex(pComph) < 0) { + tsdbCloseAndUnsetFSet(&(pComph->readh)); + return -1; + } -static int tsdbCompactFSetImpl(SCompactH *pComph) { - STsdbRepo *pRepo = TSDB_COMPACT_REPO(pComph); - STsdbCfg * pCfg = REPO_CFG(pRepo); - SReadH * pReadh = &(pComph->readh); - SBlockIdx blkIdx; - void ** ppBuf = &(TSDB_COMPACT_BUF(pComph)); - void ** ppCBuf = &(TSDB_COMPACT_COMP_BUF(pComph)); - int defaultRows = TSDB_DEFAULT_BLOCK_ROWS(pCfg->maxRowsPerFileBlock); + return 0; + } - taosArrayClear(pComph->aBlkIdx); + static void tsdbCompactFSetEnd(SCompactH *pComph) { tsdbCloseAndUnsetFSet(&(pComph->readh)); } - for (int tid = 1; tid < taosArrayGetSize(pComph->tbArray); tid++) { - STableCompactH *pTh = (STableCompactH *)taosArrayGet(pComph->tbArray, tid); - STSchema * pSchema; + static int tsdbCompactFSetImpl(SCompactH *pComph) { + STsdbRepo *pRepo = TSDB_COMPACT_REPO(pComph); + STsdbCfg * pCfg = REPO_CFG(pRepo); + SReadH * pReadh = &(pComph->readh); + SBlockIdx blkIdx; + void ** ppBuf = &(TSDB_COMPACT_BUF(pComph)); + void ** ppCBuf = &(TSDB_COMPACT_COMP_BUF(pComph)); + int defaultRows = TSDB_DEFAULT_BLOCK_ROWS(pCfg->maxRowsPerFileBlock); - if (pTh->pTable == NULL || pTh->pBlkIdx == NULL) continue; + taosArrayClear(pComph->aBlkIdx); - pSchema = tsdbGetTableSchemaImpl(pTh->pTable, true, true, -1); - taosArrayClear(pComph->aSupBlk); - if ((tdInitDataCols(pComph->pDataCols, pSchema) < 0) || (tdInitDataCols(pReadh->pDCols[0], pSchema) < 0) || - (tdInitDataCols(pReadh->pDCols[1], pSchema) < 0)) { - terrno = TSDB_CODE_TDB_OUT_OF_MEMORY; - return -1; - } - tdFreeSchema(pSchema); + for (int tid = 1; tid < taosArrayGetSize(pComph->tbArray); tid++) { + STableCompactH *pTh = (STableCompactH *)taosArrayGet(pComph->tbArray, tid); + STSchema * pSchema; - // Loop to compact each block data - for (int i = 0; i < pTh->pBlkIdx->numOfBlocks; i++) { - SBlock *pBlock = pTh->pInfo->blocks + i; + if (pTh->pTable == NULL || pTh->pBlkIdx == NULL) continue; - // Load the block data - if (tsdbLoadBlockData(pReadh, pBlock, pTh->pInfo) < 0) { + pSchema = tsdbGetTableSchemaImpl(pTh->pTable, true, true, -1); + taosArrayClear(pComph->aSupBlk); + if ((tdInitDataCols(pComph->pDataCols, pSchema) < 0) || (tdInitDataCols(pReadh->pDCols[0], pSchema) < 0) || + (tdInitDataCols(pReadh->pDCols[1], pSchema) < 0)) { + terrno = TSDB_CODE_TDB_OUT_OF_MEMORY; return -1; } + tdFreeSchema(pSchema); + + // Loop to compact each block data + for (int i = 0; i < pTh->pBlkIdx->numOfBlocks; i++) { + SBlock *pBlock = pTh->pInfo->blocks + i; - // Merge pComph->pDataCols and pReadh->pDCols[0] and write data to file - if (pComph->pDataCols->numOfRows == 0 && pBlock->numOfRows >= defaultRows) { - if (tsdbWriteBlockToRightFile(pComph, pTh->pTable, pReadh->pDCols[0], ppBuf, ppCBuf) < 0) { + // Load the block data + if (tsdbLoadBlockData(pReadh, pBlock, pTh->pInfo) < 0) { return -1; } - } else { - int ridx = 0; - while (true) { - if (pReadh->pDCols[0]->numOfRows - ridx == 0) break; - int rowsToMerge = MIN(pReadh->pDCols[0]->numOfRows - ridx, defaultRows - pComph->pDataCols->numOfRows); + // Merge pComph->pDataCols and pReadh->pDCols[0] and write data to file + if (pComph->pDataCols->numOfRows == 0 && pBlock->numOfRows >= defaultRows) { + if (tsdbWriteBlockToRightFile(pComph, pTh->pTable, pReadh->pDCols[0], ppBuf, ppCBuf) < 0) { + return -1; + } + } else { + int ridx = 0; - tdMergeDataCols(pComph->pDataCols, pReadh->pDCols[0], rowsToMerge, &ridx); + while (true) { + if (pReadh->pDCols[0]->numOfRows - ridx == 0) break; + int rowsToMerge = MIN(pReadh->pDCols[0]->numOfRows - ridx, defaultRows - pComph->pDataCols->numOfRows); - if (pComph->pDataCols->numOfRows < defaultRows) { - break; - } + tdMergeDataCols(pComph->pDataCols, pReadh->pDCols[0], rowsToMerge, &ridx); - if (tsdbWriteBlockToRightFile(pComph, pTh->pTable, pComph->pDataCols, ppBuf, ppCBuf) < 0) { - return -1; + if (pComph->pDataCols->numOfRows < defaultRows) { + break; + } + + if (tsdbWriteBlockToRightFile(pComph, pTh->pTable, pComph->pDataCols, ppBuf, ppCBuf) < 0) { + return -1; + } + tdResetDataCols(pComph->pDataCols); } - tdResetDataCols(pComph->pDataCols); } } + + if (pComph->pDataCols->numOfRows > 0 && + tsdbWriteBlockToRightFile(pComph, pTh->pTable, pComph->pDataCols, ppBuf, ppCBuf) < 0) { + return -1; + } + + if (tsdbWriteBlockInfoImpl(TSDB_COMPACT_HEAD_FILE(pComph), pTh->pTable, pComph->aSupBlk, NULL, ppBuf, &blkIdx) < + 0) { + return -1; + } + + if ((blkIdx.numOfBlocks > 0) && (taosArrayPush(pComph->aBlkIdx, (void *)(&blkIdx)) == NULL)) { + terrno = TSDB_CODE_TDB_OUT_OF_MEMORY; + return -1; + } } - if (pComph->pDataCols->numOfRows > 0 && - tsdbWriteBlockToRightFile(pComph, pTh->pTable, pComph->pDataCols, ppBuf, ppCBuf) < 0) { + if (tsdbWriteBlockIdx(TSDB_COMPACT_HEAD_FILE(pComph), pComph->aBlkIdx, ppBuf) < 0) { return -1; } - if (tsdbWriteBlockInfoImpl(TSDB_COMPACT_HEAD_FILE(pComph), pTh->pTable, pComph->aSupBlk, NULL, ppBuf, &blkIdx) < - 0) { + return 0; + } + + static int tsdbWriteBlockToRightFile(SCompactH *pComph, STable *pTable, SDataCols *pDataCols, void **ppBuf, + void **ppCBuf) { + STsdbRepo *pRepo = TSDB_COMPACT_REPO(pComph); + STsdbCfg * pCfg = REPO_CFG(pRepo); + SDFile * pDFile; + bool isLast; + SBlock block; + + ASSERT(pDataCols->numOfRows > 0); + + if (pDataCols->numOfRows < pCfg->minRowsPerFileBlock) { + pDFile = TSDB_COMPACT_LAST_FILE(pComph); + isLast = true; + } else { + pDFile = TSDB_COMPACT_DATA_FILE(pComph); + isLast = false; + } + + if (tsdbWriteBlockImpl(pRepo, pTable, pDFile, pDataCols, &block, isLast, true, ppBuf, ppCBuf) < 0) { return -1; } - if ((blkIdx.numOfBlocks > 0) && (taosArrayPush(pComph->aBlkIdx, (void *)(&blkIdx)) == NULL)) { + if (taosArrayPush(pComph->aSupBlk, (void *)(&block)) == NULL) { terrno = TSDB_CODE_TDB_OUT_OF_MEMORY; return -1; } - } - - if (tsdbWriteBlockIdx(TSDB_COMPACT_HEAD_FILE(pComph), pComph->aBlkIdx, ppBuf) < 0) { - return -1; - } - return 0; + return 0; } -static int tsdbWriteBlockToRightFile(SCompactH *pComph, STable *pTable, SDataCols *pDataCols, void **ppBuf, - void **ppCBuf) { - STsdbRepo *pRepo = TSDB_COMPACT_REPO(pComph); - STsdbCfg * pCfg = REPO_CFG(pRepo); - SDFile * pDFile; - bool isLast; - SBlock block; - - ASSERT(pDataCols->numOfRows > 0); - - if (pDataCols->numOfRows < pCfg->minRowsPerFileBlock) { - pDFile = TSDB_COMPACT_LAST_FILE(pComph); - isLast = true; - } else { - pDFile = TSDB_COMPACT_DATA_FILE(pComph); - isLast = false; - } - - if (tsdbWriteBlockImpl(pRepo, pTable, pDFile, pDataCols, &block, isLast, true, ppBuf, ppCBuf) < 0) { - return -1; - } - - if (taosArrayPush(pComph->aSupBlk, (void *)(&block)) == NULL) { - terrno = TSDB_CODE_TDB_OUT_OF_MEMORY; - return -1; - } - - return 0; -} diff --git a/src/util/src/ttokenizer.c b/src/util/src/ttokenizer.c index 62389f191fe5d48933f040d4dca136204a1b9f51..88c2a3369bb101ce6b7ae6d72fa1a7973ca732e4 100644 --- a/src/util/src/ttokenizer.c +++ b/src/util/src/ttokenizer.c @@ -219,6 +219,7 @@ static SKeyword keywordTable[] = { {"PARTITIONS", TK_PARTITIONS}, {"TOPIC", TK_TOPIC}, {"TOPICS", TK_TOPICS}, + {"COMPACT", TK_COMPACT}, {"MODIFY", TK_MODIFY} }; diff --git a/src/vnode/src/vnodeMain.c b/src/vnode/src/vnodeMain.c index fdf215a966582254978daf5997234efa9d2cfb8b..074f0f681faaa89ccf7a14da0da43774a76d647b 100644 --- a/src/vnode/src/vnodeMain.c +++ b/src/vnode/src/vnodeMain.c @@ -114,6 +114,7 @@ int32_t vnodeSync(int32_t vgId) { return TSDB_CODE_SUCCESS; } + int32_t vnodeDrop(int32_t vgId) { SVnodeObj *pVnode = vnodeAcquire(vgId); if (pVnode == NULL) { @@ -133,6 +134,19 @@ int32_t vnodeDrop(int32_t vgId) { return TSDB_CODE_SUCCESS; } +int32_t vnodeCompact(int32_t vgId) { + void *pVnode = vnodeAcquire(vgId); + if (pVnode != NULL) { + vDebug("vgId:%d, compact vnode msg is received", vgId); + //not care success or not + tsdbCompact(((SVnodeObj*)pVnode)->tsdb); + vnodeRelease(pVnode); + } else { + vInfo("vgId:%d, vnode not exist, can't compact it", vgId); + return TSDB_CODE_VND_INVALID_VGROUP_ID; + } + return TSDB_CODE_SUCCESS; +} static int32_t vnodeAlterImp(SVnodeObj *pVnode, SCreateVnodeMsg *pVnodeCfg) { STsdbCfg tsdbCfg = pVnode->tsdbCfg; diff --git a/src/vnode/src/vnodeMgmt.c b/src/vnode/src/vnodeMgmt.c index 7e6022fc872c3a2221514169ab00874011dc3cb9..5a0bafe82301d568da20cd45b0daeeb37995127d 100644 --- a/src/vnode/src/vnodeMgmt.c +++ b/src/vnode/src/vnodeMgmt.c @@ -148,6 +148,7 @@ static void vnodeBuildVloadMsg(SVnodeObj *pVnode, SStatusMsg *pStatus) { pLoad->status = pVnode->status; pLoad->role = pVnode->role; pLoad->replica = pVnode->syncCfg.replica; + pLoad->compact = (pVnode->tsdb != NULL) && tsdbInCompact(pVnode->tsdb) ? 1 : 0; } int32_t vnodeGetVnodeList(int32_t vnodeList[], int32_t *numOfVnodes) { diff --git a/tests/pytest/query/filter.py b/tests/pytest/query/filter.py index 6d2ffbc8b10992628fec381e60fd11a68c69fe27..2d60fdcd7fc85ad57ba1ec5f7df8603ab76967c8 100644 --- a/tests/pytest/query/filter.py +++ b/tests/pytest/query/filter.py @@ -91,8 +91,8 @@ class TDTestCase: tdSql.query("select * from db.st where name = 1231231") tdSql.checkRows(0) - # <> for timestamp type - tdSql.query("select * from db.st where ts <> '2020-05-13 10:00:00.002'") + # <> for timestamp type not supported on primary timestamp + tdSql.error("select * from db.st where ts <> '2020-05-13 10:00:00.002'") # tdSql.checkRows(4) # <> for numeric type diff --git a/tests/pytest/query/querySecondtscolumnTowherenow.py b/tests/pytest/query/querySecondtscolumnTowherenow.py index dfc18d99a60146b416dab1e8d9f7f2417be4d00c..dae50abdf09b68c2815c43bccdf2faa8cb8b5316 100644 --- a/tests/pytest/query/querySecondtscolumnTowherenow.py +++ b/tests/pytest/query/querySecondtscolumnTowherenow.py @@ -58,8 +58,8 @@ class TDTestCase: ts_len4 = len(tdSql.cursor.fetchall()) tdSql.execute("select * from t2ts1 where ts = now") ts_len5 = len(tdSql.cursor.fetchall()) - tdSql.execute("select * from t2ts1 where ts <> now") - ts_len6 = len(tdSql.cursor.fetchall()) + # tdSql.execute("select * from t2ts1 where ts <> now") + ts_len6 = 3 tdSql.execute("select * from t2ts1 where ts between 0 and now") ts_len7 = len(tdSql.cursor.fetchall()) tdSql.execute("select * from t2ts1 where ts between now and now+100d") diff --git a/tests/script/general/parser/timestamp_query.sim b/tests/script/general/parser/timestamp_query.sim index 4e553c73f41cc9d28025c5de08935af02ee10335..3f6a1af4bc552d0bb54aedcb086e035c3b73bfd2 100644 --- a/tests/script/general/parser/timestamp_query.sim +++ b/tests/script/general/parser/timestamp_query.sim @@ -24,6 +24,8 @@ $tsu = $tsu + $ts0 print ==================>issue #3481, normal column not allowed, sql_error select ts,c1,min(c2) from ts_stb0 +print ==================>issue #4681, not equal operator on primary timestamp not allowed +sql_error select * from ts_stb0 where ts <> $ts0 ##### select from supertable $tb = $tbPrefix . 0 @@ -51,4 +53,4 @@ sql select first(c1), last(c1), (1537325400 - 1537146000)/(5*60) v from $tb wher if $data13 != 598.000000000 then print expect 598.000000000, actual $data03 return -1 -endi \ No newline at end of file +endi