diff --git a/src/client/src/tscSQLParser.c b/src/client/src/tscSQLParser.c index 6109324798dbd294cf5c31e4e7572ce7476c98a2..4e3951ab6be80c0bbe463ed7a981ee83c5fe3d22 100644 --- a/src/client/src/tscSQLParser.c +++ b/src/client/src/tscSQLParser.c @@ -1081,12 +1081,13 @@ int32_t validateIntervalNode(SSqlObj* pSql, SQueryInfo* pQueryInfo, SSqlNode* pS const char* msg1 = "sliding cannot be used without interval"; const char* msg2 = "interval cannot be less than 1 us"; const char* msg3 = "interval value is too small"; + const char* msg4 = "only point interpolation query requires keyword EVERY"; SSqlCmd* pCmd = &pSql->cmd; STableMetaInfo* pTableMetaInfo = tscGetMetaInfo(pQueryInfo, 0); STableComInfo tinfo = tscGetTableInfo(pTableMetaInfo->pTableMeta); - + if (!TPARSER_HAS_TOKEN(pSqlNode->interval.interval)) { if (TPARSER_HAS_TOKEN(pSqlNode->sliding)) { return invalidOperationMsg(tscGetErrorMsgPayload(pCmd), msg1); @@ -1112,7 +1113,6 @@ int32_t validateIntervalNode(SSqlObj* pSql, SQueryInfo* pQueryInfo, SSqlNode* pS } if (pQueryInfo->interval.intervalUnit != 'n' && pQueryInfo->interval.intervalUnit != 'y') { - // interval cannot be less than 10 milliseconds if (convertTimePrecision(pQueryInfo->interval.interval, tinfo.precision, TSDB_TIME_PRECISION_MICRO) < tsMinIntervalTime) { return invalidOperationMsg(tscGetErrorMsgPayload(pCmd), msg2); @@ -1127,9 +1127,15 @@ int32_t validateIntervalNode(SSqlObj* pSql, SQueryInfo* pQueryInfo, SSqlNode* pS return TSDB_CODE_TSC_INVALID_OPERATION; } + bool interpQuery = tscIsPointInterpQuery(pQueryInfo); + if ((pSqlNode->interval.token == TK_EVERY && (!interpQuery)) || (pSqlNode->interval.token == TK_INTERVAL && interpQuery)) { + return invalidOperationMsg(tscGetErrorMsgPayload(pCmd), msg4); + } + // The following part is used to check for the invalid query expression. return checkInvalidExprForTimeWindow(pCmd, pQueryInfo); } + static int32_t validateStateWindowNode(SSqlCmd* pCmd, SQueryInfo* pQueryInfo, SSqlNode* pSqlNode, bool isStable) { const char* msg1 = "invalid column name"; diff --git a/src/inc/ttokendef.h b/src/inc/ttokendef.h index dc921eed1fcd6baf25b5ffd4632b88a80a90615e..3d35a51006b9742528fc07fb2ec91e9cd6fa38db 100644 --- a/src/inc/ttokendef.h +++ b/src/inc/ttokendef.h @@ -141,75 +141,76 @@ #define TK_FROM 123 #define TK_VARIABLE 124 #define TK_INTERVAL 125 -#define TK_SESSION 126 -#define TK_STATE_WINDOW 127 -#define TK_FILL 128 -#define TK_SLIDING 129 -#define TK_ORDER 130 -#define TK_BY 131 -#define TK_ASC 132 -#define TK_GROUP 133 -#define TK_HAVING 134 -#define TK_LIMIT 135 -#define TK_OFFSET 136 -#define TK_SLIMIT 137 -#define TK_SOFFSET 138 -#define TK_WHERE 139 -#define TK_RESET 140 -#define TK_QUERY 141 -#define TK_SYNCDB 142 -#define TK_ADD 143 -#define TK_COLUMN 144 -#define TK_MODIFY 145 -#define TK_TAG 146 -#define TK_CHANGE 147 -#define TK_SET 148 -#define TK_KILL 149 -#define TK_CONNECTION 150 -#define TK_STREAM 151 -#define TK_COLON 152 -#define TK_ABORT 153 -#define TK_AFTER 154 -#define TK_ATTACH 155 -#define TK_BEFORE 156 -#define TK_BEGIN 157 -#define TK_CASCADE 158 -#define TK_CLUSTER 159 -#define TK_CONFLICT 160 -#define TK_COPY 161 -#define TK_DEFERRED 162 -#define TK_DELIMITERS 163 -#define TK_DETACH 164 -#define TK_EACH 165 -#define TK_END 166 -#define TK_EXPLAIN 167 -#define TK_FAIL 168 -#define TK_FOR 169 -#define TK_IGNORE 170 -#define TK_IMMEDIATE 171 -#define TK_INITIALLY 172 -#define TK_INSTEAD 173 -#define TK_MATCH 174 -#define TK_KEY 175 -#define TK_OF 176 -#define TK_RAISE 177 -#define TK_REPLACE 178 -#define TK_RESTRICT 179 -#define TK_ROW 180 -#define TK_STATEMENT 181 -#define TK_TRIGGER 182 -#define TK_VIEW 183 -#define TK_IPTOKEN 184 -#define TK_SEMI 185 -#define TK_NONE 186 -#define TK_PREV 187 -#define TK_LINEAR 188 -#define TK_IMPORT 189 -#define TK_TBNAME 190 -#define TK_JOIN 191 -#define TK_INSERT 192 -#define TK_INTO 193 -#define TK_VALUES 194 +#define TK_EVERY 126 +#define TK_SESSION 127 +#define TK_STATE_WINDOW 128 +#define TK_FILL 129 +#define TK_SLIDING 130 +#define TK_ORDER 131 +#define TK_BY 132 +#define TK_ASC 133 +#define TK_GROUP 134 +#define TK_HAVING 135 +#define TK_LIMIT 136 +#define TK_OFFSET 137 +#define TK_SLIMIT 138 +#define TK_SOFFSET 139 +#define TK_WHERE 140 +#define TK_RESET 141 +#define TK_QUERY 142 +#define TK_SYNCDB 143 +#define TK_ADD 144 +#define TK_COLUMN 145 +#define TK_MODIFY 146 +#define TK_TAG 147 +#define TK_CHANGE 148 +#define TK_SET 149 +#define TK_KILL 150 +#define TK_CONNECTION 151 +#define TK_STREAM 152 +#define TK_COLON 153 +#define TK_ABORT 154 +#define TK_AFTER 155 +#define TK_ATTACH 156 +#define TK_BEFORE 157 +#define TK_BEGIN 158 +#define TK_CASCADE 159 +#define TK_CLUSTER 160 +#define TK_CONFLICT 161 +#define TK_COPY 162 +#define TK_DEFERRED 163 +#define TK_DELIMITERS 164 +#define TK_DETACH 165 +#define TK_EACH 166 +#define TK_END 167 +#define TK_EXPLAIN 168 +#define TK_FAIL 169 +#define TK_FOR 170 +#define TK_IGNORE 171 +#define TK_IMMEDIATE 172 +#define TK_INITIALLY 173 +#define TK_INSTEAD 174 +#define TK_MATCH 175 +#define TK_KEY 176 +#define TK_OF 177 +#define TK_RAISE 178 +#define TK_REPLACE 179 +#define TK_RESTRICT 180 +#define TK_ROW 181 +#define TK_STATEMENT 182 +#define TK_TRIGGER 183 +#define TK_VIEW 184 +#define TK_IPTOKEN 185 +#define TK_SEMI 186 +#define TK_NONE 187 +#define TK_PREV 188 +#define TK_LINEAR 189 +#define TK_IMPORT 190 +#define TK_TBNAME 191 +#define TK_JOIN 192 +#define TK_INSERT 193 +#define TK_INTO 194 +#define TK_VALUES 195 #define TK_SPACE 300 diff --git a/src/query/inc/qSqlparser.h b/src/query/inc/qSqlparser.h index 531ff06565dba837c696c6069d409ccf536cbe8c..c231c90996e00d84a70c7141eac69c5a59e20254 100644 --- a/src/query/inc/qSqlparser.h +++ b/src/query/inc/qSqlparser.h @@ -80,6 +80,7 @@ typedef struct tVariantListItem { } tVariantListItem; typedef struct SIntervalVal { + int32_t token; SStrToken interval; SStrToken offset; } SIntervalVal; diff --git a/src/query/inc/sql.y b/src/query/inc/sql.y index 212095b52e22e82cb294dab447dac113be219583..8466b7262ab43e49496b078dd3ca25985fe6605a 100644 --- a/src/query/inc/sql.y +++ b/src/query/inc/sql.y @@ -482,7 +482,7 @@ tagitem(A) ::= PLUS(X) FLOAT(Y). { //////////////////////// The SELECT statement ///////////////////////////////// %type select {SSqlNode*} %destructor select {destroySqlNode($$);} -select(A) ::= SELECT(T) selcollist(W) from(X) where_opt(Y) interval_opt(K) sliding_opt(S) session_option(H) windowstate_option(D) fill_opt(F)groupby_opt(P) having_opt(N) orderby_opt(Z) slimit_opt(G) limit_opt(L). { +select(A) ::= SELECT(T) selcollist(W) from(X) where_opt(Y) interval_option(K) sliding_opt(S) session_option(H) windowstate_option(D) fill_opt(F)groupby_opt(P) having_opt(N) orderby_opt(Z) slimit_opt(G) limit_opt(L). { A = tSetQuerySqlNode(&T, W, X, Y, P, Z, &K, &H, &D, &S, F, &L, &G, N); } @@ -572,10 +572,14 @@ tablelist(A) ::= tablelist(Y) COMMA ids(X) cpxName(Z) ids(F). { %type tmvar {SStrToken} tmvar(A) ::= VARIABLE(X). {A = X;} -%type interval_opt {SIntervalVal} -interval_opt(N) ::= INTERVAL LP tmvar(E) RP. {N.interval = E; N.offset.n = 0;} -interval_opt(N) ::= INTERVAL LP tmvar(E) COMMA tmvar(X) RP. {N.interval = E; N.offset = X;} -interval_opt(N) ::= . {memset(&N, 0, sizeof(N));} +%type interval_option {SIntervalVal} +interval_option(N) ::= intervalKey(A) LP tmvar(E) RP. {N.interval = E; N.offset.n = 0; N.token = A;} +interval_option(N) ::= intervalKey(A) LP tmvar(E) COMMA tmvar(X) RP. {N.interval = E; N.offset = X; N.token = A;} +interval_option(N) ::= . {memset(&N, 0, sizeof(N));} + +%type intervalKey {int32_t} +intervalKey(A) ::= INTERVAL. {A = TK_INTERVAL;} +intervalKey(A) ::= EVERY. {A = TK_EVERY; } %type session_option {SSessionWindowVal} session_option(X) ::= . {X.col.n = 0; X.gap.n = 0;} @@ -584,6 +588,7 @@ session_option(X) ::= SESSION LP ids(V) cpxName(Z) COMMA tmvar(Y) RP. { X.col = V; X.gap = Y; } + %type windowstate_option {SWindowStateVal} windowstate_option(X) ::= . { X.col.n = 0; X.col.z = NULL;} windowstate_option(X) ::= STATE_WINDOW LP ids(V) RP. { X.col = V; } diff --git a/src/query/src/qExecutor.c b/src/query/src/qExecutor.c index 6dc6c6b490f4b1cf7ec4bab727988ae0f3ed87ac..700cf17fd38f69d4f2363174109c3217891a3e26 100644 --- a/src/query/src/qExecutor.c +++ b/src/query/src/qExecutor.c @@ -230,6 +230,12 @@ static void destroyStateWindowOperatorInfo(void* param, int32_t numOfOutput); static void destroyAggOperatorInfo(void* param, int32_t numOfOutput); static void destroyOperatorInfo(SOperatorInfo* pOperator); +static void doSetOperatorCompleted(SOperatorInfo* pOperator) { + pOperator->status = OP_EXEC_DONE; + if (pOperator->pRuntimeEnv != NULL) { + setQueryStatus(pOperator->pRuntimeEnv, QUERY_COMPLETED); + } +} static int32_t doCopyToSDataBlock(SQueryRuntimeEnv* pRuntimeEnv, SGroupResInfo* pGroupResInfo, int32_t orderType, SSDataBlock* pBlock); @@ -5517,8 +5523,7 @@ static SSDataBlock* doSort(void* param, bool* newgroup) { // start to flush data into disk and try do multiway merge sort if (pBlock == NULL) { - setQueryStatus(pOperator->pRuntimeEnv, QUERY_COMPLETED); - pOperator->status = OP_EXEC_DONE; + doSetOperatorCompleted(pOperator); break; } @@ -5629,8 +5634,7 @@ static SSDataBlock* doAggregate(void* param, bool* newgroup) { doAggregateImpl(pOperator, pQueryAttr->window.skey, pInfo->pCtx, pBlock); } - pOperator->status = OP_EXEC_DONE; - setQueryStatus(pRuntimeEnv, QUERY_COMPLETED); + doSetOperatorCompleted(pOperator); finalizeQueryResult(pOperator, pInfo->pCtx, &pInfo->resultRowInfo, pInfo->rowCellInfoOffset); pInfo->pRes->info.rows = getNumOfResult(pRuntimeEnv, pInfo->pCtx, pOperator->numOfOutput); @@ -5706,7 +5710,7 @@ static SSDataBlock* doSTableAggregate(void* param, bool* newgroup) { toSSDataBlock(&pRuntimeEnv->groupResInfo, pRuntimeEnv, pInfo->pRes); if (pInfo->pRes->info.rows == 0 || !hasRemainDataInCurrentGroup(&pRuntimeEnv->groupResInfo)) { - pOperator->status = OP_EXEC_DONE; + doSetOperatorCompleted(pOperator); } return pInfo->pRes; @@ -5824,8 +5828,7 @@ static SSDataBlock* doLimit(void* param, bool* newgroup) { publishOperatorProfEvent(pOperator->upstream[0], QUERY_PROF_AFTER_OPERATOR_EXEC); if (pBlock == NULL) { - setQueryStatus(pOperator->pRuntimeEnv, QUERY_COMPLETED); - pOperator->status = OP_EXEC_DONE; + doSetOperatorCompleted(pOperator); return NULL; } @@ -5853,8 +5856,7 @@ static SSDataBlock* doLimit(void* param, bool* newgroup) { pBlock->info.rows = (int32_t)(pInfo->limit - pInfo->total); pInfo->total = pInfo->limit; - setQueryStatus(pOperator->pRuntimeEnv, QUERY_COMPLETED); - pOperator->status = OP_EXEC_DONE; + doSetOperatorCompleted(pOperator); } else { pInfo->total += pBlock->info.rows; } @@ -5889,8 +5891,7 @@ static SSDataBlock* doFilter(void* param, bool* newgroup) { } } - setQueryStatus(pRuntimeEnv, QUERY_COMPLETED); - pOperator->status = OP_EXEC_DONE; + doSetOperatorCompleted(pOperator); return NULL; } @@ -5905,9 +5906,8 @@ static SSDataBlock* doIntervalAgg(void* param, bool* newgroup) { SQueryRuntimeEnv* pRuntimeEnv = pOperator->pRuntimeEnv; if (pOperator->status == OP_RES_TO_RETURN) { toSSDataBlock(&pRuntimeEnv->groupResInfo, pRuntimeEnv, pIntervalInfo->pRes); - if (pIntervalInfo->pRes->info.rows == 0 || !hasRemainDataInCurrentGroup(&pRuntimeEnv->groupResInfo)) { - pOperator->status = OP_EXEC_DONE; + doSetOperatorCompleted(pOperator); } return pIntervalInfo->pRes; @@ -5948,7 +5948,7 @@ static SSDataBlock* doIntervalAgg(void* param, bool* newgroup) { toSSDataBlock(&pRuntimeEnv->groupResInfo, pRuntimeEnv, pIntervalInfo->pRes); if (pIntervalInfo->pRes->info.rows == 0 || !hasRemainDataInCurrentGroup(&pRuntimeEnv->groupResInfo)) { - pOperator->status = OP_EXEC_DONE; + doSetOperatorCompleted(pOperator); } return pIntervalInfo->pRes->info.rows == 0? NULL:pIntervalInfo->pRes; @@ -5967,7 +5967,7 @@ static SSDataBlock* doAllIntervalAgg(void* param, bool* newgroup) { toSSDataBlock(&pRuntimeEnv->groupResInfo, pRuntimeEnv, pIntervalInfo->pRes); if (pIntervalInfo->pRes->info.rows == 0 || !hasRemainDataInCurrentGroup(&pRuntimeEnv->groupResInfo)) { - pOperator->status = OP_EXEC_DONE; + doSetOperatorCompleted(pOperator); } return pIntervalInfo->pRes; @@ -6025,9 +6025,10 @@ static SSDataBlock* doSTableIntervalAgg(void* param, bool* newgroup) { if (pOperator->status == OP_RES_TO_RETURN) { int64_t st = taosGetTimestampUs(); + copyToSDataBlock(pRuntimeEnv, 3000, pIntervalInfo->pRes, pIntervalInfo->rowCellInfoOffset); if (pIntervalInfo->pRes->info.rows == 0 || !hasRemainData(&pRuntimeEnv->groupResInfo)) { - pOperator->status = OP_EXEC_DONE; + doSetOperatorCompleted(pOperator); } SQInfo* pQInfo = pRuntimeEnv->qinfo; @@ -7286,13 +7287,11 @@ static SSDataBlock* hashDistinct(void* param, bool* newgroup) { publishOperatorProfEvent(pOperator->upstream[0], QUERY_PROF_AFTER_OPERATOR_EXEC); if (pBlock == NULL) { - setQueryStatus(pOperator->pRuntimeEnv, QUERY_COMPLETED); - pOperator->status = OP_EXEC_DONE; + doSetOperatorCompleted(pOperator); break; } if (!initMultiDistinctInfo(pInfo, pOperator, pBlock)) { - setQueryStatus(pOperator->pRuntimeEnv, QUERY_COMPLETED); - pOperator->status = OP_EXEC_DONE; + doSetOperatorCompleted(pOperator); break; } // ensure result output buf diff --git a/src/query/src/qSqlParser.c b/src/query/src/qSqlParser.c index 011892fe93f3dc941b17ef7b22313c11fca23d74..d156230efbc75c46205637747bb58f86d13763fe 100644 --- a/src/query/src/qSqlParser.c +++ b/src/query/src/qSqlParser.c @@ -766,7 +766,7 @@ SSqlNode *tSetQuerySqlNode(SStrToken *pSelectToken, SArray *pSelNodeList, SRelat pSqlNode->pSortOrder = pSortOrder; pSqlNode->pWhere = pWhere; pSqlNode->fillType = pFill; - pSqlNode->pHaving = pHaving; + pSqlNode->pHaving = pHaving; if (pLimit != NULL) { pSqlNode->limit = *pLimit; diff --git a/src/query/src/sql.c b/src/query/src/sql.c index 598d3fcf3cb24f0b3a6e18178a6c74df1675624c..16bb4e49a80fa7a263b7c6e0446cb4aa328343bb 100644 --- a/src/query/src/sql.c +++ b/src/query/src/sql.c @@ -1,5 +1,3 @@ -/* This file is automatically generated by Lemon from input grammar -** source file "src/query/inc/sql.y". */ /* ** 2000-05-29 ** @@ -24,8 +22,8 @@ ** The following is the concatenation of all %include directives from the ** input grammar file: */ +#include /************ Begin %include sections from the grammar ************************/ -#line 23 "src/query/inc/sql.y" #include #include @@ -38,207 +36,12 @@ #include "ttokendef.h" #include "tutil.h" #include "tvariant.h" -#line 42 "src/query/inc/sql.c" /**************** End of %include directives **********************************/ -/* These constants specify the various numeric values for terminal symbols. -***************** Begin token definitions *************************************/ -#ifndef TK_ID -#define TK_ID 1 -#define TK_BOOL 2 -#define TK_TINYINT 3 -#define TK_SMALLINT 4 -#define TK_INTEGER 5 -#define TK_BIGINT 6 -#define TK_FLOAT 7 -#define TK_DOUBLE 8 -#define TK_STRING 9 -#define TK_TIMESTAMP 10 -#define TK_BINARY 11 -#define TK_NCHAR 12 -#define TK_OR 13 -#define TK_AND 14 -#define TK_NOT 15 -#define TK_EQ 16 -#define TK_NE 17 -#define TK_ISNULL 18 -#define TK_NOTNULL 19 -#define TK_IS 20 -#define TK_LIKE 21 -#define TK_GLOB 22 -#define TK_BETWEEN 23 -#define TK_IN 24 -#define TK_GT 25 -#define TK_GE 26 -#define TK_LT 27 -#define TK_LE 28 -#define TK_BITAND 29 -#define TK_BITOR 30 -#define TK_LSHIFT 31 -#define TK_RSHIFT 32 -#define TK_PLUS 33 -#define TK_MINUS 34 -#define TK_DIVIDE 35 -#define TK_TIMES 36 -#define TK_STAR 37 -#define TK_SLASH 38 -#define TK_REM 39 -#define TK_CONCAT 40 -#define TK_UMINUS 41 -#define TK_UPLUS 42 -#define TK_BITNOT 43 -#define TK_SHOW 44 -#define TK_DATABASES 45 -#define TK_TOPICS 46 -#define TK_FUNCTIONS 47 -#define TK_MNODES 48 -#define TK_DNODES 49 -#define TK_ACCOUNTS 50 -#define TK_USERS 51 -#define TK_MODULES 52 -#define TK_QUERIES 53 -#define TK_CONNECTIONS 54 -#define TK_STREAMS 55 -#define TK_VARIABLES 56 -#define TK_SCORES 57 -#define TK_GRANTS 58 -#define TK_VNODES 59 -#define TK_DOT 60 -#define TK_CREATE 61 -#define TK_TABLE 62 -#define TK_STABLE 63 -#define TK_DATABASE 64 -#define TK_TABLES 65 -#define TK_STABLES 66 -#define TK_VGROUPS 67 -#define TK_DROP 68 -#define TK_TOPIC 69 -#define TK_FUNCTION 70 -#define TK_DNODE 71 -#define TK_USER 72 -#define TK_ACCOUNT 73 -#define TK_USE 74 -#define TK_DESCRIBE 75 -#define TK_DESC 76 -#define TK_ALTER 77 -#define TK_PASS 78 -#define TK_PRIVILEGE 79 -#define TK_LOCAL 80 -#define TK_COMPACT 81 -#define TK_LP 82 -#define TK_RP 83 -#define TK_IF 84 -#define TK_EXISTS 85 -#define TK_AS 86 -#define TK_OUTPUTTYPE 87 -#define TK_AGGREGATE 88 -#define TK_BUFSIZE 89 -#define TK_PPS 90 -#define TK_TSERIES 91 -#define TK_DBS 92 -#define TK_STORAGE 93 -#define TK_QTIME 94 -#define TK_CONNS 95 -#define TK_STATE 96 -#define TK_COMMA 97 -#define TK_KEEP 98 -#define TK_CACHE 99 -#define TK_REPLICA 100 -#define TK_QUORUM 101 -#define TK_DAYS 102 -#define TK_MINROWS 103 -#define TK_MAXROWS 104 -#define TK_BLOCKS 105 -#define TK_CTIME 106 -#define TK_WAL 107 -#define TK_FSYNC 108 -#define TK_COMP 109 -#define TK_PRECISION 110 -#define TK_UPDATE 111 -#define TK_CACHELAST 112 -#define TK_PARTITIONS 113 -#define TK_UNSIGNED 114 -#define TK_TAGS 115 -#define TK_USING 116 -#define TK_NULL 117 -#define TK_NOW 118 -#define TK_SELECT 119 -#define TK_UNION 120 -#define TK_ALL 121 -#define TK_DISTINCT 122 -#define TK_FROM 123 -#define TK_VARIABLE 124 -#define TK_INTERVAL 125 -#define TK_SESSION 126 -#define TK_STATE_WINDOW 127 -#define TK_FILL 128 -#define TK_SLIDING 129 -#define TK_ORDER 130 -#define TK_BY 131 -#define TK_ASC 132 -#define TK_GROUP 133 -#define TK_HAVING 134 -#define TK_LIMIT 135 -#define TK_OFFSET 136 -#define TK_SLIMIT 137 -#define TK_SOFFSET 138 -#define TK_WHERE 139 -#define TK_RESET 140 -#define TK_QUERY 141 -#define TK_SYNCDB 142 -#define TK_ADD 143 -#define TK_COLUMN 144 -#define TK_MODIFY 145 -#define TK_TAG 146 -#define TK_CHANGE 147 -#define TK_SET 148 -#define TK_KILL 149 -#define TK_CONNECTION 150 -#define TK_STREAM 151 -#define TK_COLON 152 -#define TK_ABORT 153 -#define TK_AFTER 154 -#define TK_ATTACH 155 -#define TK_BEFORE 156 -#define TK_BEGIN 157 -#define TK_CASCADE 158 -#define TK_CLUSTER 159 -#define TK_CONFLICT 160 -#define TK_COPY 161 -#define TK_DEFERRED 162 -#define TK_DELIMITERS 163 -#define TK_DETACH 164 -#define TK_EACH 165 -#define TK_END 166 -#define TK_EXPLAIN 167 -#define TK_FAIL 168 -#define TK_FOR 169 -#define TK_IGNORE 170 -#define TK_IMMEDIATE 171 -#define TK_INITIALLY 172 -#define TK_INSTEAD 173 -#define TK_MATCH 174 -#define TK_KEY 175 -#define TK_OF 176 -#define TK_RAISE 177 -#define TK_REPLACE 178 -#define TK_RESTRICT 179 -#define TK_ROW 180 -#define TK_STATEMENT 181 -#define TK_TRIGGER 182 -#define TK_VIEW 183 -#define TK_IPTOKEN 184 -#define TK_SEMI 185 -#define TK_NONE 186 -#define TK_PREV 187 -#define TK_LINEAR 188 -#define TK_IMPORT 189 -#define TK_TBNAME 190 -#define TK_JOIN 191 -#define TK_INSERT 192 -#define TK_INTO 193 -#define TK_VALUES 194 -#endif -/**************** End token definitions ***************************************/ +/* These constants specify the various numeric values for terminal symbols +** in a format understandable to "makeheaders". This section is blank unless +** "lemon" is run with the "-m" command-line option. +***************** Begin makeheaders token definitions *************************/ +/**************** End makeheaders token definitions ***************************/ /* The next sections is a series of control #defines. ** various aspects of the generated parser. @@ -273,10 +76,8 @@ ** zero the stack is dynamically sized using realloc() ** ParseARG_SDECL A static variable declaration for the %extra_argument ** ParseARG_PDECL A parameter declaration for the %extra_argument -** ParseARG_PARAM Code to pass %extra_argument as a subroutine parameter ** ParseARG_STORE Code to store %extra_argument into yypParser ** ParseARG_FETCH Code to extract %extra_argument from yypParser -** ParseCTX_* As ParseARG_ except for %extra_context ** YYERRORSYMBOL is the code number of the error symbol. If not ** defined, then do no error processing. ** YYNSTATE the combined number of states. @@ -296,57 +97,50 @@ #endif /************* Begin control #defines *****************************************/ #define YYCODETYPE unsigned short int -#define YYNOCODE 275 +#define YYNOCODE 279 #define YYACTIONTYPE unsigned short int #define ParseTOKENTYPE SStrToken typedef union { int yyinit; ParseTOKENTYPE yy0; - SSessionWindowVal yy39; - SCreateDbInfo yy42; - int yy43; - tSqlExpr* yy46; - SCreatedTableInfo yy96; - SArray* yy131; - TAOS_FIELD yy163; - SSqlNode* yy256; - SCreateTableSql* yy272; - SLimitVal yy284; - SCreateAcctInfo yy341; - int64_t yy459; - tVariant yy516; - SIntervalVal yy530; - SWindowStateVal yy538; - SRelationInfo* yy544; + SRelationInfo* yy8; + SWindowStateVal yy40; + SSqlNode* yy56; + SCreateDbInfo yy90; + int yy96; + int32_t yy104; + SSessionWindowVal yy147; + SCreatedTableInfo yy152; + SLimitVal yy166; + SCreateAcctInfo yy171; + TAOS_FIELD yy183; + int64_t yy325; + SIntervalVal yy400; + SArray* yy421; + tVariant yy430; + SCreateTableSql* yy438; + tSqlExpr* yy439; } YYMINORTYPE; #ifndef YYSTACKDEPTH #define YYSTACKDEPTH 100 #endif #define ParseARG_SDECL SSqlInfo* pInfo; #define ParseARG_PDECL ,SSqlInfo* pInfo -#define ParseARG_PARAM ,pInfo -#define ParseARG_FETCH SSqlInfo* pInfo=yypParser->pInfo; -#define ParseARG_STORE yypParser->pInfo=pInfo; -#define ParseCTX_SDECL -#define ParseCTX_PDECL -#define ParseCTX_PARAM -#define ParseCTX_FETCH -#define ParseCTX_STORE +#define ParseARG_FETCH SSqlInfo* pInfo = yypParser->pInfo +#define ParseARG_STORE yypParser->pInfo = pInfo #define YYFALLBACK 1 #define YYNSTATE 364 -#define YYNRULE 290 -#define YYNRULE_WITH_ACTION 290 -#define YYNTOKEN 195 +#define YYNRULE 292 +#define YYNTOKEN 196 #define YY_MAX_SHIFT 363 -#define YY_MIN_SHIFTREDUCE 570 -#define YY_MAX_SHIFTREDUCE 859 -#define YY_ERROR_ACTION 860 -#define YY_ACCEPT_ACTION 861 -#define YY_NO_ACTION 862 -#define YY_MIN_REDUCE 863 -#define YY_MAX_REDUCE 1152 +#define YY_MIN_SHIFTREDUCE 572 +#define YY_MAX_SHIFTREDUCE 863 +#define YY_ERROR_ACTION 864 +#define YY_ACCEPT_ACTION 865 +#define YY_NO_ACTION 866 +#define YY_MIN_REDUCE 867 +#define YY_MAX_REDUCE 1158 /************* End control #defines *******************************************/ -#define YY_NLOOKAHEAD ((int)(sizeof(yy_lookahead)/sizeof(yy_lookahead[0]))) /* Define the yytestcase() macro to be a no-op if is not already defined ** otherwise. @@ -411,289 +205,289 @@ typedef union { ** yy_default[] Default action for each state. ** *********** Begin parsing tables **********************************************/ -#define YY_ACTTAB_COUNT (757) +#define YY_ACTTAB_COUNT (759) static const YYACTIONTYPE yy_action[] = { - /* 0 */ 912, 622, 237, 622, 362, 231, 1019, 190, 209, 623, - /* 10 */ 248, 623, 154, 56, 57, 1041, 60, 61, 1128, 161, - /* 20 */ 251, 50, 622, 59, 320, 64, 62, 65, 63, 989, - /* 30 */ 623, 987, 988, 55, 54, 161, 990, 53, 52, 51, - /* 40 */ 991, 243, 992, 993, 658, 1019, 161, 571, 572, 573, - /* 50 */ 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, - /* 60 */ 584, 152, 245, 232, 56, 57, 1019, 60, 61, 1005, - /* 70 */ 209, 251, 50, 23, 59, 320, 64, 62, 65, 63, - /* 80 */ 1129, 280, 279, 1038, 55, 54, 79, 85, 53, 52, - /* 90 */ 51, 56, 57, 1077, 60, 61, 318, 1032, 251, 50, - /* 100 */ 37, 59, 320, 64, 62, 65, 63, 294, 706, 90, - /* 110 */ 97, 55, 54, 234, 800, 53, 52, 51, 56, 58, - /* 120 */ 91, 60, 61, 350, 44, 251, 50, 94, 59, 320, - /* 130 */ 64, 62, 65, 63, 798, 206, 340, 339, 55, 54, - /* 140 */ 358, 950, 53, 52, 51, 57, 1007, 60, 61, 1015, - /* 150 */ 801, 251, 50, 318, 59, 320, 64, 62, 65, 63, - /* 160 */ 1002, 1003, 34, 1006, 55, 54, 861, 363, 53, 52, - /* 170 */ 51, 43, 316, 357, 356, 315, 314, 313, 355, 312, - /* 180 */ 311, 310, 354, 309, 353, 352, 981, 969, 970, 971, - /* 190 */ 972, 973, 974, 975, 976, 977, 978, 979, 980, 982, - /* 200 */ 983, 60, 61, 24, 33, 251, 50, 622, 59, 320, - /* 210 */ 64, 62, 65, 63, 92, 623, 1032, 14, 55, 54, - /* 220 */ 212, 93, 53, 52, 51, 55, 54, 218, 80, 53, - /* 230 */ 52, 51, 273, 136, 135, 134, 217, 300, 250, 813, - /* 240 */ 325, 85, 802, 922, 805, 37, 808, 207, 250, 813, - /* 250 */ 190, 96, 802, 247, 805, 213, 808, 5, 40, 180, - /* 260 */ 252, 37, 260, 161, 179, 103, 108, 99, 107, 37, - /* 270 */ 229, 230, 254, 176, 321, 361, 360, 145, 44, 1032, - /* 280 */ 229, 230, 1125, 305, 64, 62, 65, 63, 29, 804, - /* 290 */ 233, 807, 55, 54, 1016, 235, 53, 52, 51, 272, - /* 300 */ 730, 77, 259, 727, 78, 728, 241, 729, 225, 803, - /* 310 */ 1016, 806, 1088, 209, 242, 120, 114, 125, 1016, 66, - /* 320 */ 209, 913, 124, 1129, 130, 133, 123, 37, 190, 66, - /* 330 */ 1129, 256, 257, 127, 200, 198, 196, 1078, 1004, 292, - /* 340 */ 37, 195, 140, 139, 138, 137, 37, 255, 746, 253, - /* 350 */ 1013, 328, 327, 37, 814, 809, 43, 73, 357, 356, - /* 360 */ 37, 810, 37, 355, 814, 809, 122, 354, 37, 353, - /* 370 */ 352, 810, 329, 37, 265, 780, 1016, 261, 350, 258, - /* 380 */ 322, 335, 334, 269, 268, 330, 151, 149, 148, 1016, - /* 390 */ 260, 331, 53, 52, 51, 1016, 74, 244, 332, 260, - /* 400 */ 743, 177, 1016, 1, 178, 336, 82, 337, 811, 1016, - /* 410 */ 1017, 1016, 83, 338, 70, 731, 732, 1016, 342, 3, - /* 420 */ 191, 274, 1016, 762, 770, 771, 9, 716, 812, 249, - /* 430 */ 297, 779, 718, 750, 299, 38, 717, 156, 67, 26, - /* 440 */ 834, 38, 815, 276, 38, 621, 67, 1124, 95, 276, - /* 450 */ 67, 6, 76, 1123, 25, 71, 25, 1087, 16, 25, - /* 460 */ 15, 1018, 113, 18, 112, 17, 735, 227, 736, 733, - /* 470 */ 20, 734, 19, 228, 119, 22, 118, 21, 132, 131, - /* 480 */ 210, 211, 817, 214, 705, 208, 215, 216, 220, 221, - /* 490 */ 222, 219, 205, 1148, 239, 1140, 1033, 270, 1084, 1083, - /* 500 */ 240, 341, 153, 1040, 47, 1051, 1048, 1049, 1070, 1053, - /* 510 */ 277, 1069, 155, 160, 1014, 172, 150, 288, 173, 1012, - /* 520 */ 281, 306, 174, 236, 175, 927, 163, 1030, 166, 302, - /* 530 */ 303, 304, 307, 308, 45, 761, 203, 162, 283, 285, - /* 540 */ 41, 293, 319, 921, 75, 326, 295, 1147, 49, 110, - /* 550 */ 72, 1146, 164, 1143, 291, 181, 289, 333, 1139, 287, - /* 560 */ 116, 1138, 48, 1135, 182, 947, 284, 167, 42, 39, - /* 570 */ 46, 204, 909, 126, 907, 128, 129, 905, 904, 262, - /* 580 */ 193, 194, 901, 900, 899, 898, 897, 896, 895, 197, - /* 590 */ 199, 892, 890, 888, 886, 201, 883, 282, 202, 879, - /* 600 */ 351, 121, 275, 81, 86, 286, 1071, 343, 344, 345, - /* 610 */ 346, 347, 348, 349, 359, 859, 264, 226, 263, 246, - /* 620 */ 301, 858, 267, 857, 840, 839, 266, 223, 276, 271, - /* 630 */ 224, 926, 104, 925, 10, 105, 296, 738, 278, 84, - /* 640 */ 903, 30, 87, 763, 157, 902, 772, 141, 142, 894, - /* 650 */ 185, 184, 948, 183, 186, 187, 189, 188, 143, 893, - /* 660 */ 2, 985, 144, 158, 949, 168, 165, 169, 170, 171, - /* 670 */ 885, 4, 884, 766, 159, 88, 995, 768, 89, 238, - /* 680 */ 290, 31, 11, 32, 12, 13, 27, 298, 28, 96, - /* 690 */ 98, 101, 35, 100, 636, 36, 671, 669, 668, 102, - /* 700 */ 667, 665, 664, 663, 660, 626, 317, 106, 7, 818, - /* 710 */ 816, 324, 8, 109, 323, 111, 68, 69, 708, 38, - /* 720 */ 115, 117, 707, 704, 652, 650, 642, 648, 644, 646, - /* 730 */ 640, 638, 674, 673, 672, 670, 666, 662, 661, 192, - /* 740 */ 624, 588, 863, 862, 862, 862, 862, 862, 862, 862, - /* 750 */ 862, 862, 862, 862, 862, 146, 147, + /* 0 */ 171, 624, 248, 624, 624, 23, 362, 231, 162, 625, + /* 10 */ 247, 625, 625, 57, 58, 206, 61, 62, 282, 1045, + /* 20 */ 251, 51, 252, 60, 320, 65, 63, 66, 64, 993, + /* 30 */ 209, 991, 992, 56, 55, 162, 994, 54, 53, 52, + /* 40 */ 995, 1134, 996, 997, 155, 660, 79, 573, 574, 575, + /* 50 */ 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, + /* 60 */ 586, 153, 209, 232, 57, 58, 207, 61, 62, 1009, + /* 70 */ 209, 251, 51, 1135, 60, 320, 65, 63, 66, 64, + /* 80 */ 1008, 1135, 209, 1083, 56, 55, 80, 1042, 54, 53, + /* 90 */ 52, 57, 58, 1135, 61, 62, 237, 318, 251, 51, + /* 100 */ 1023, 60, 320, 65, 63, 66, 64, 708, 294, 86, + /* 110 */ 91, 56, 55, 280, 279, 54, 53, 52, 57, 59, + /* 120 */ 243, 61, 62, 350, 1023, 251, 51, 95, 60, 320, + /* 130 */ 65, 63, 66, 64, 802, 340, 339, 245, 56, 55, + /* 140 */ 213, 1023, 54, 53, 52, 58, 45, 61, 62, 767, + /* 150 */ 768, 251, 51, 318, 60, 320, 65, 63, 66, 64, + /* 160 */ 1006, 1007, 35, 1010, 56, 55, 865, 363, 54, 53, + /* 170 */ 52, 44, 316, 357, 356, 315, 314, 313, 355, 312, + /* 180 */ 311, 310, 354, 309, 353, 352, 985, 973, 974, 975, + /* 190 */ 976, 977, 978, 979, 980, 981, 982, 983, 984, 986, + /* 200 */ 987, 61, 62, 24, 1131, 251, 51, 624, 60, 320, + /* 210 */ 65, 63, 66, 64, 162, 625, 1036, 98, 56, 55, + /* 220 */ 212, 1036, 54, 53, 52, 56, 55, 218, 38, 54, + /* 230 */ 53, 52, 273, 137, 136, 135, 217, 234, 250, 817, + /* 240 */ 325, 86, 806, 1017, 809, 16, 812, 15, 250, 817, + /* 250 */ 123, 265, 806, 1011, 809, 748, 812, 5, 41, 180, + /* 260 */ 269, 268, 350, 1130, 179, 104, 109, 100, 108, 916, + /* 270 */ 229, 230, 1129, 233, 321, 227, 190, 1020, 45, 1036, + /* 280 */ 229, 230, 38, 305, 65, 63, 66, 64, 29, 1084, + /* 290 */ 244, 292, 56, 55, 260, 235, 54, 53, 52, 254, + /* 300 */ 272, 732, 78, 162, 729, 176, 730, 259, 731, 225, + /* 310 */ 260, 54, 53, 52, 228, 200, 198, 196, 808, 67, + /* 320 */ 811, 177, 195, 141, 140, 139, 138, 241, 807, 67, + /* 330 */ 810, 1020, 256, 257, 121, 115, 126, 152, 150, 149, + /* 340 */ 752, 125, 260, 131, 134, 124, 38, 38, 38, 361, + /* 350 */ 360, 146, 128, 1021, 818, 813, 44, 38, 357, 356, + /* 360 */ 38, 814, 38, 355, 818, 813, 1022, 354, 93, 353, + /* 370 */ 352, 814, 784, 38, 38, 255, 38, 253, 92, 328, + /* 380 */ 327, 38, 81, 261, 926, 258, 322, 335, 334, 745, + /* 390 */ 14, 190, 242, 329, 94, 1019, 1020, 1020, 71, 358, + /* 400 */ 954, 917, 330, 3, 191, 331, 1020, 332, 190, 1020, + /* 410 */ 34, 1020, 1, 178, 274, 9, 733, 734, 336, 337, + /* 420 */ 83, 338, 1020, 1020, 97, 1020, 342, 84, 39, 783, + /* 430 */ 1020, 764, 774, 74, 775, 718, 297, 815, 720, 299, + /* 440 */ 72, 719, 838, 300, 819, 157, 68, 816, 26, 39, + /* 450 */ 39, 804, 68, 96, 249, 68, 25, 276, 25, 114, + /* 460 */ 623, 113, 77, 18, 276, 17, 737, 735, 738, 736, + /* 470 */ 20, 210, 19, 75, 25, 120, 6, 119, 22, 211, + /* 480 */ 21, 133, 132, 214, 1154, 208, 215, 805, 821, 216, + /* 490 */ 220, 221, 222, 219, 707, 205, 1094, 1146, 48, 1093, + /* 500 */ 239, 1090, 1089, 240, 341, 270, 154, 1076, 1044, 1055, + /* 510 */ 1052, 1053, 151, 1037, 277, 1057, 156, 1075, 161, 288, + /* 520 */ 172, 173, 275, 1018, 281, 1016, 174, 168, 175, 165, + /* 530 */ 1034, 931, 763, 302, 303, 169, 167, 304, 307, 308, + /* 540 */ 46, 203, 42, 236, 319, 925, 326, 283, 285, 1153, + /* 550 */ 76, 73, 163, 111, 295, 164, 1152, 50, 293, 1149, + /* 560 */ 166, 181, 333, 1145, 117, 1144, 1141, 182, 951, 43, + /* 570 */ 291, 40, 47, 204, 913, 127, 289, 911, 129, 284, + /* 580 */ 130, 909, 908, 262, 193, 194, 905, 904, 903, 902, + /* 590 */ 901, 900, 899, 287, 197, 199, 896, 894, 892, 890, + /* 600 */ 201, 887, 306, 202, 883, 49, 351, 82, 87, 343, + /* 610 */ 286, 1077, 122, 344, 345, 346, 226, 246, 301, 347, + /* 620 */ 348, 349, 359, 863, 263, 264, 862, 223, 105, 930, + /* 630 */ 929, 224, 106, 266, 267, 861, 844, 271, 907, 843, + /* 640 */ 906, 296, 142, 276, 143, 185, 184, 952, 183, 186, + /* 650 */ 187, 189, 188, 144, 898, 897, 953, 145, 989, 889, + /* 660 */ 888, 10, 85, 740, 33, 170, 4, 30, 2, 278, + /* 670 */ 88, 999, 765, 158, 160, 776, 159, 238, 770, 89, + /* 680 */ 31, 772, 90, 290, 11, 32, 12, 13, 27, 298, + /* 690 */ 28, 97, 99, 102, 36, 101, 638, 37, 103, 673, + /* 700 */ 671, 670, 669, 667, 666, 665, 662, 628, 317, 107, + /* 710 */ 7, 323, 324, 822, 110, 820, 8, 112, 69, 70, + /* 720 */ 710, 39, 709, 116, 706, 118, 654, 652, 644, 650, + /* 730 */ 646, 648, 642, 640, 676, 675, 674, 672, 668, 664, + /* 740 */ 663, 192, 626, 590, 867, 866, 866, 866, 866, 866, + /* 750 */ 866, 866, 866, 866, 866, 866, 866, 147, 148, }; static const YYCODETYPE yy_lookahead[] = { - /* 0 */ 203, 1, 243, 1, 197, 198, 247, 210, 264, 9, - /* 10 */ 204, 9, 197, 13, 14, 197, 16, 17, 274, 197, - /* 20 */ 20, 21, 1, 23, 24, 25, 26, 27, 28, 221, - /* 30 */ 9, 223, 224, 33, 34, 197, 228, 37, 38, 39, - /* 40 */ 232, 243, 234, 235, 5, 247, 197, 45, 46, 47, + /* 0 */ 253, 1, 206, 1, 1, 266, 199, 200, 199, 9, + /* 10 */ 206, 9, 9, 13, 14, 266, 16, 17, 271, 199, + /* 20 */ 20, 21, 206, 23, 24, 25, 26, 27, 28, 223, + /* 30 */ 266, 225, 226, 33, 34, 199, 230, 37, 38, 39, + /* 40 */ 234, 277, 236, 237, 199, 5, 207, 45, 46, 47, /* 50 */ 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, - /* 60 */ 58, 59, 243, 61, 13, 14, 247, 16, 17, 0, - /* 70 */ 264, 20, 21, 264, 23, 24, 25, 26, 27, 28, - /* 80 */ 274, 266, 267, 265, 33, 34, 86, 82, 37, 38, - /* 90 */ 39, 13, 14, 271, 16, 17, 84, 245, 20, 21, - /* 100 */ 197, 23, 24, 25, 26, 27, 28, 269, 5, 271, - /* 110 */ 205, 33, 34, 261, 1, 37, 38, 39, 13, 14, - /* 120 */ 271, 16, 17, 90, 119, 20, 21, 205, 23, 24, - /* 130 */ 25, 26, 27, 28, 83, 264, 33, 34, 33, 34, - /* 140 */ 219, 220, 37, 38, 39, 14, 241, 16, 17, 246, - /* 150 */ 37, 20, 21, 84, 23, 24, 25, 26, 27, 28, - /* 160 */ 238, 239, 240, 241, 33, 34, 195, 196, 37, 38, + /* 60 */ 58, 59, 266, 61, 13, 14, 266, 16, 17, 0, + /* 70 */ 266, 20, 21, 277, 23, 24, 25, 26, 27, 28, + /* 80 */ 241, 277, 266, 274, 33, 34, 86, 267, 37, 38, + /* 90 */ 39, 13, 14, 277, 16, 17, 245, 84, 20, 21, + /* 100 */ 249, 23, 24, 25, 26, 27, 28, 5, 272, 82, + /* 110 */ 274, 33, 34, 268, 269, 37, 38, 39, 13, 14, + /* 120 */ 245, 16, 17, 90, 249, 20, 21, 207, 23, 24, + /* 130 */ 25, 26, 27, 28, 83, 33, 34, 245, 33, 34, + /* 140 */ 266, 249, 37, 38, 39, 14, 119, 16, 17, 125, + /* 150 */ 126, 20, 21, 84, 23, 24, 25, 26, 27, 28, + /* 160 */ 240, 241, 242, 243, 33, 34, 197, 198, 37, 38, /* 170 */ 39, 98, 99, 100, 101, 102, 103, 104, 105, 106, - /* 180 */ 107, 108, 109, 110, 111, 112, 221, 222, 223, 224, - /* 190 */ 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, - /* 200 */ 235, 16, 17, 44, 82, 20, 21, 1, 23, 24, - /* 210 */ 25, 26, 27, 28, 248, 9, 245, 82, 33, 34, - /* 220 */ 61, 86, 37, 38, 39, 33, 34, 68, 262, 37, - /* 230 */ 38, 39, 261, 74, 75, 76, 77, 115, 1, 2, - /* 240 */ 81, 82, 5, 203, 7, 197, 9, 264, 1, 2, - /* 250 */ 210, 116, 5, 204, 7, 264, 9, 62, 63, 64, - /* 260 */ 204, 197, 197, 197, 69, 70, 71, 72, 73, 197, - /* 270 */ 33, 34, 68, 208, 37, 65, 66, 67, 119, 245, - /* 280 */ 33, 34, 264, 88, 25, 26, 27, 28, 82, 5, - /* 290 */ 242, 7, 33, 34, 246, 261, 37, 38, 39, 140, - /* 300 */ 2, 142, 68, 5, 205, 7, 242, 9, 149, 5, - /* 310 */ 246, 7, 237, 264, 242, 62, 63, 64, 246, 82, - /* 320 */ 264, 203, 69, 274, 71, 72, 73, 197, 210, 82, - /* 330 */ 274, 33, 34, 80, 62, 63, 64, 271, 239, 273, - /* 340 */ 197, 69, 70, 71, 72, 73, 197, 143, 37, 145, - /* 350 */ 197, 147, 148, 197, 117, 118, 98, 97, 100, 101, - /* 360 */ 197, 124, 197, 105, 117, 118, 78, 109, 197, 111, - /* 370 */ 112, 124, 242, 197, 141, 76, 246, 143, 90, 145, - /* 380 */ 15, 147, 148, 150, 151, 242, 62, 63, 64, 246, - /* 390 */ 197, 242, 37, 38, 39, 246, 136, 244, 242, 197, - /* 400 */ 97, 208, 246, 206, 207, 242, 83, 242, 124, 246, - /* 410 */ 208, 246, 83, 242, 97, 117, 118, 246, 242, 201, - /* 420 */ 202, 83, 246, 83, 83, 83, 123, 83, 124, 60, - /* 430 */ 83, 132, 83, 122, 83, 97, 83, 97, 97, 97, - /* 440 */ 83, 97, 83, 120, 97, 83, 97, 264, 97, 120, - /* 450 */ 97, 82, 82, 264, 97, 138, 97, 237, 144, 97, - /* 460 */ 146, 247, 144, 144, 146, 146, 5, 264, 7, 5, - /* 470 */ 144, 7, 146, 264, 144, 144, 146, 146, 78, 79, - /* 480 */ 264, 264, 117, 264, 114, 264, 264, 264, 264, 264, - /* 490 */ 264, 264, 264, 247, 237, 247, 245, 197, 237, 237, - /* 500 */ 237, 237, 197, 197, 263, 197, 197, 197, 272, 197, - /* 510 */ 245, 272, 197, 197, 245, 249, 60, 197, 197, 197, - /* 520 */ 268, 89, 197, 268, 197, 197, 258, 260, 255, 197, - /* 530 */ 197, 197, 197, 197, 197, 124, 197, 259, 268, 268, - /* 540 */ 197, 133, 197, 197, 135, 197, 130, 197, 134, 197, - /* 550 */ 137, 197, 257, 197, 128, 197, 127, 197, 197, 126, - /* 560 */ 197, 197, 139, 197, 197, 197, 129, 254, 197, 197, - /* 570 */ 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, - /* 580 */ 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, - /* 590 */ 197, 197, 197, 197, 197, 197, 197, 125, 197, 197, - /* 600 */ 113, 96, 199, 199, 199, 199, 199, 95, 51, 92, - /* 610 */ 94, 55, 93, 91, 84, 5, 5, 199, 152, 199, - /* 620 */ 199, 5, 5, 5, 100, 99, 152, 199, 120, 141, - /* 630 */ 199, 209, 205, 209, 82, 205, 115, 83, 97, 121, - /* 640 */ 199, 82, 97, 83, 82, 199, 83, 200, 200, 199, - /* 650 */ 212, 216, 218, 217, 215, 213, 211, 214, 200, 199, - /* 660 */ 206, 236, 200, 82, 220, 253, 256, 252, 251, 250, - /* 670 */ 199, 201, 199, 83, 97, 82, 236, 83, 82, 1, - /* 680 */ 82, 97, 131, 97, 131, 82, 82, 115, 82, 116, - /* 690 */ 78, 70, 87, 86, 5, 87, 9, 5, 5, 86, - /* 700 */ 5, 5, 5, 5, 5, 85, 15, 78, 82, 117, - /* 710 */ 83, 59, 82, 146, 24, 146, 16, 16, 5, 97, - /* 720 */ 146, 146, 5, 83, 5, 5, 5, 5, 5, 5, - /* 730 */ 5, 5, 5, 5, 5, 5, 5, 5, 5, 97, - /* 740 */ 85, 60, 0, 275, 275, 275, 275, 275, 275, 275, - /* 750 */ 275, 275, 275, 275, 275, 21, 21, 275, 275, 275, - /* 760 */ 275, 275, 275, 275, 275, 275, 275, 275, 275, 275, - /* 770 */ 275, 275, 275, 275, 275, 275, 275, 275, 275, 275, - /* 780 */ 275, 275, 275, 275, 275, 275, 275, 275, 275, 275, - /* 790 */ 275, 275, 275, 275, 275, 275, 275, 275, 275, 275, - /* 800 */ 275, 275, 275, 275, 275, 275, 275, 275, 275, 275, - /* 810 */ 275, 275, 275, 275, 275, 275, 275, 275, 275, 275, - /* 820 */ 275, 275, 275, 275, 275, 275, 275, 275, 275, 275, - /* 830 */ 275, 275, 275, 275, 275, 275, 275, 275, 275, 275, - /* 840 */ 275, 275, 275, 275, 275, 275, 275, 275, 275, 275, - /* 850 */ 275, 275, 275, 275, 275, 275, 275, 275, 275, 275, - /* 860 */ 275, 275, 275, 275, 275, 275, 275, 275, 275, 275, - /* 870 */ 275, 275, 275, 275, 275, 275, 275, 275, 275, 275, - /* 880 */ 275, 275, 275, 275, 275, 275, 275, 275, 275, 275, - /* 890 */ 275, 275, 275, 275, 275, 275, 275, 275, 275, 275, - /* 900 */ 275, 275, 275, 275, 275, 275, 275, 275, 275, 275, - /* 910 */ 275, 275, 275, 275, 275, 275, 275, 275, 275, 275, - /* 920 */ 275, 275, 275, 275, 275, 275, 275, 275, 275, 275, - /* 930 */ 275, 275, 275, 275, 275, 275, 275, 275, 275, 275, - /* 940 */ 275, 275, 275, 275, 275, 275, 275, 275, 275, 275, - /* 950 */ 275, 275, + /* 180 */ 107, 108, 109, 110, 111, 112, 223, 224, 225, 226, + /* 190 */ 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, + /* 200 */ 237, 16, 17, 44, 266, 20, 21, 1, 23, 24, + /* 210 */ 25, 26, 27, 28, 199, 9, 247, 207, 33, 34, + /* 220 */ 61, 247, 37, 38, 39, 33, 34, 68, 199, 37, + /* 230 */ 38, 39, 263, 74, 75, 76, 77, 263, 1, 2, + /* 240 */ 81, 82, 5, 199, 7, 145, 9, 147, 1, 2, + /* 250 */ 78, 142, 5, 243, 7, 37, 9, 62, 63, 64, + /* 260 */ 151, 152, 90, 266, 69, 70, 71, 72, 73, 205, + /* 270 */ 33, 34, 266, 244, 37, 266, 212, 248, 119, 247, + /* 280 */ 33, 34, 199, 88, 25, 26, 27, 28, 82, 274, + /* 290 */ 246, 276, 33, 34, 199, 263, 37, 38, 39, 68, + /* 300 */ 141, 2, 143, 199, 5, 210, 7, 68, 9, 150, + /* 310 */ 199, 37, 38, 39, 266, 62, 63, 64, 5, 82, + /* 320 */ 7, 210, 69, 70, 71, 72, 73, 244, 5, 82, + /* 330 */ 7, 248, 33, 34, 62, 63, 64, 62, 63, 64, + /* 340 */ 122, 69, 199, 71, 72, 73, 199, 199, 199, 65, + /* 350 */ 66, 67, 80, 210, 117, 118, 98, 199, 100, 101, + /* 360 */ 199, 124, 199, 105, 117, 118, 249, 109, 250, 111, + /* 370 */ 112, 124, 76, 199, 199, 144, 199, 146, 274, 148, + /* 380 */ 149, 199, 264, 144, 205, 146, 15, 148, 149, 97, + /* 390 */ 82, 212, 244, 244, 86, 248, 248, 248, 97, 221, + /* 400 */ 222, 205, 244, 203, 204, 244, 248, 244, 212, 248, + /* 410 */ 82, 248, 208, 209, 83, 123, 117, 118, 244, 244, + /* 420 */ 83, 244, 248, 248, 116, 248, 244, 83, 97, 133, + /* 430 */ 248, 83, 83, 97, 83, 83, 83, 124, 83, 83, + /* 440 */ 139, 83, 83, 115, 83, 97, 97, 124, 97, 97, + /* 450 */ 97, 1, 97, 97, 60, 97, 97, 120, 97, 145, + /* 460 */ 83, 147, 82, 145, 120, 147, 5, 5, 7, 7, + /* 470 */ 145, 266, 147, 137, 97, 145, 82, 147, 145, 266, + /* 480 */ 147, 78, 79, 266, 249, 266, 266, 37, 117, 266, + /* 490 */ 266, 266, 266, 266, 114, 266, 239, 249, 265, 239, + /* 500 */ 239, 239, 239, 239, 239, 199, 199, 275, 199, 199, + /* 510 */ 199, 199, 60, 247, 247, 199, 199, 275, 199, 199, + /* 520 */ 251, 199, 201, 247, 270, 199, 199, 256, 199, 259, + /* 530 */ 262, 199, 124, 199, 199, 255, 257, 199, 199, 199, + /* 540 */ 199, 199, 199, 270, 199, 199, 199, 270, 270, 199, + /* 550 */ 136, 138, 261, 199, 131, 260, 199, 135, 134, 199, + /* 560 */ 258, 199, 199, 199, 199, 199, 199, 199, 199, 199, + /* 570 */ 129, 199, 199, 199, 199, 199, 128, 199, 199, 130, + /* 580 */ 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, + /* 590 */ 199, 199, 199, 127, 199, 199, 199, 199, 199, 199, + /* 600 */ 199, 199, 89, 199, 199, 140, 113, 201, 201, 95, + /* 610 */ 201, 201, 96, 51, 92, 94, 201, 201, 201, 55, + /* 620 */ 93, 91, 84, 5, 153, 5, 5, 201, 207, 211, + /* 630 */ 211, 201, 207, 153, 5, 5, 100, 142, 201, 99, + /* 640 */ 201, 115, 202, 120, 202, 214, 218, 220, 219, 217, + /* 650 */ 215, 213, 216, 202, 201, 201, 222, 202, 238, 201, + /* 660 */ 201, 82, 121, 83, 252, 254, 203, 82, 208, 97, + /* 670 */ 97, 238, 83, 82, 97, 83, 82, 1, 83, 82, + /* 680 */ 97, 83, 82, 82, 132, 97, 132, 82, 82, 115, + /* 690 */ 82, 116, 78, 70, 87, 86, 5, 87, 86, 9, + /* 700 */ 5, 5, 5, 5, 5, 5, 5, 85, 15, 78, + /* 710 */ 82, 24, 59, 117, 147, 83, 82, 147, 16, 16, + /* 720 */ 5, 97, 5, 147, 83, 147, 5, 5, 5, 5, + /* 730 */ 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, + /* 740 */ 5, 97, 85, 60, 0, 278, 278, 278, 278, 278, + /* 750 */ 278, 278, 278, 278, 278, 278, 278, 21, 21, 278, + /* 760 */ 278, 278, 278, 278, 278, 278, 278, 278, 278, 278, + /* 770 */ 278, 278, 278, 278, 278, 278, 278, 278, 278, 278, + /* 780 */ 278, 278, 278, 278, 278, 278, 278, 278, 278, 278, + /* 790 */ 278, 278, 278, 278, 278, 278, 278, 278, 278, 278, + /* 800 */ 278, 278, 278, 278, 278, 278, 278, 278, 278, 278, + /* 810 */ 278, 278, 278, 278, 278, 278, 278, 278, 278, 278, + /* 820 */ 278, 278, 278, 278, 278, 278, 278, 278, 278, 278, + /* 830 */ 278, 278, 278, 278, 278, 278, 278, 278, 278, 278, + /* 840 */ 278, 278, 278, 278, 278, 278, 278, 278, 278, 278, + /* 850 */ 278, 278, 278, 278, 278, 278, 278, 278, 278, 278, + /* 860 */ 278, 278, 278, 278, 278, 278, 278, 278, 278, 278, + /* 870 */ 278, 278, 278, 278, 278, 278, 278, 278, 278, 278, + /* 880 */ 278, 278, 278, 278, 278, 278, 278, 278, 278, 278, + /* 890 */ 278, 278, 278, 278, 278, 278, 278, 278, 278, 278, + /* 900 */ 278, 278, 278, 278, 278, 278, 278, 278, 278, 278, + /* 910 */ 278, 278, 278, 278, 278, 278, 278, 278, 278, 278, + /* 920 */ 278, 278, 278, 278, 278, 278, 278, 278, 278, 278, + /* 930 */ 278, 278, 278, 278, 278, 278, 278, 278, 278, 278, + /* 940 */ 278, 278, 278, 278, 278, 278, 278, 278, 278, 278, + /* 950 */ 278, 278, 278, 278, 278, }; #define YY_SHIFT_COUNT (363) #define YY_SHIFT_MIN (0) -#define YY_SHIFT_MAX (742) +#define YY_SHIFT_MAX (744) static const unsigned short int yy_shift_ofst[] = { - /* 0 */ 159, 73, 73, 258, 258, 12, 237, 247, 247, 206, - /* 10 */ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, - /* 20 */ 21, 21, 21, 0, 2, 247, 298, 298, 298, 5, - /* 30 */ 5, 21, 21, 21, 69, 21, 21, 21, 21, 288, - /* 40 */ 12, 33, 33, 39, 757, 757, 757, 247, 247, 247, + /* 0 */ 159, 73, 73, 258, 258, 13, 237, 247, 247, 206, + /* 10 */ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + /* 20 */ 3, 3, 3, 0, 2, 247, 299, 299, 299, 27, + /* 30 */ 27, 3, 3, 24, 3, 69, 3, 3, 3, 3, + /* 40 */ 172, 13, 33, 33, 40, 759, 759, 759, 247, 247, /* 50 */ 247, 247, 247, 247, 247, 247, 247, 247, 247, 247, - /* 60 */ 247, 247, 247, 247, 247, 247, 247, 298, 298, 298, - /* 70 */ 103, 103, 103, 103, 103, 103, 103, 21, 21, 21, - /* 80 */ 311, 21, 21, 21, 5, 5, 21, 21, 21, 21, - /* 90 */ 299, 299, 303, 5, 21, 21, 21, 21, 21, 21, - /* 100 */ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, - /* 110 */ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, - /* 120 */ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, - /* 130 */ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, - /* 140 */ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, - /* 150 */ 21, 21, 21, 456, 456, 456, 411, 411, 411, 411, - /* 160 */ 456, 456, 409, 413, 416, 414, 408, 426, 429, 433, - /* 170 */ 437, 472, 423, 456, 456, 456, 432, 432, 487, 12, - /* 180 */ 12, 456, 456, 505, 512, 557, 517, 516, 556, 519, - /* 190 */ 522, 487, 39, 456, 456, 530, 530, 456, 530, 456, - /* 200 */ 530, 456, 456, 757, 757, 51, 78, 78, 105, 78, - /* 210 */ 131, 185, 195, 259, 259, 259, 259, 253, 272, 192, - /* 220 */ 192, 192, 192, 204, 234, 233, 135, 355, 355, 284, - /* 230 */ 304, 210, 324, 338, 323, 329, 340, 341, 342, 317, - /* 240 */ 260, 344, 347, 349, 351, 353, 122, 357, 359, 113, - /* 250 */ 369, 365, 362, 314, 318, 319, 461, 464, 326, 330, - /* 260 */ 370, 331, 400, 610, 466, 611, 616, 474, 617, 618, - /* 270 */ 524, 526, 488, 508, 521, 552, 518, 554, 559, 541, - /* 280 */ 545, 560, 562, 563, 581, 590, 577, 593, 594, 596, - /* 290 */ 678, 598, 584, 551, 586, 553, 603, 521, 604, 572, - /* 300 */ 606, 573, 612, 605, 607, 621, 689, 608, 613, 687, - /* 310 */ 692, 693, 695, 696, 697, 698, 699, 620, 691, 629, - /* 320 */ 626, 627, 592, 630, 690, 652, 700, 567, 569, 622, - /* 330 */ 622, 622, 622, 701, 574, 575, 622, 622, 622, 713, - /* 340 */ 717, 640, 622, 719, 720, 721, 722, 723, 724, 725, - /* 350 */ 726, 727, 728, 729, 730, 731, 732, 733, 642, 655, - /* 360 */ 734, 735, 681, 742, + /* 60 */ 247, 247, 247, 247, 247, 247, 247, 247, 299, 299, + /* 70 */ 299, 102, 102, 102, 102, 102, 102, 102, 3, 3, + /* 80 */ 3, 218, 3, 3, 3, 27, 27, 3, 3, 3, + /* 90 */ 3, 296, 296, 292, 27, 3, 3, 3, 3, 3, + /* 100 */ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + /* 110 */ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + /* 120 */ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + /* 130 */ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + /* 140 */ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + /* 150 */ 3, 3, 3, 3, 452, 452, 452, 408, 408, 408, + /* 160 */ 408, 452, 452, 414, 413, 423, 422, 424, 441, 448, + /* 170 */ 466, 449, 465, 452, 452, 452, 513, 513, 493, 13, + /* 180 */ 13, 452, 452, 516, 514, 562, 522, 521, 564, 527, + /* 190 */ 530, 493, 40, 452, 452, 538, 538, 452, 538, 452, + /* 200 */ 538, 452, 452, 759, 759, 51, 78, 78, 105, 78, + /* 210 */ 131, 185, 195, 259, 259, 259, 259, 272, 253, 192, + /* 220 */ 192, 192, 192, 231, 239, 109, 308, 274, 274, 313, + /* 230 */ 323, 284, 275, 331, 337, 344, 348, 349, 351, 301, + /* 240 */ 336, 352, 353, 355, 356, 358, 328, 359, 361, 450, + /* 250 */ 394, 371, 377, 100, 314, 318, 461, 462, 325, 330, + /* 260 */ 380, 333, 403, 618, 471, 620, 621, 480, 629, 630, + /* 270 */ 536, 540, 495, 523, 526, 579, 541, 580, 585, 572, + /* 280 */ 573, 589, 591, 592, 594, 595, 577, 597, 598, 600, + /* 290 */ 676, 601, 583, 552, 588, 554, 605, 526, 606, 574, + /* 300 */ 608, 575, 614, 607, 609, 623, 691, 610, 612, 690, + /* 310 */ 695, 696, 697, 698, 699, 700, 701, 622, 693, 631, + /* 320 */ 628, 632, 596, 634, 687, 653, 702, 567, 570, 624, + /* 330 */ 624, 624, 624, 703, 576, 578, 624, 624, 624, 715, + /* 340 */ 717, 641, 624, 721, 722, 723, 724, 725, 726, 727, + /* 350 */ 728, 729, 730, 731, 732, 733, 734, 735, 644, 657, + /* 360 */ 736, 737, 683, 744, }; #define YY_REDUCE_COUNT (204) -#define YY_REDUCE_MIN (-256) -#define YY_REDUCE_MAX (473) +#define YY_REDUCE_MIN (-261) +#define YY_REDUCE_MAX (463) static const short yy_reduce_ofst[] = { - /* 0 */ -29, -35, -35, -192, -192, -78, -194, 49, 56, -185, - /* 10 */ 48, 66, -162, 64, 72, 130, 143, 149, 156, 163, - /* 20 */ 165, 171, 176, -182, -193, -256, -241, -202, -181, -148, - /* 30 */ 34, -178, -151, 153, -95, 65, 193, 202, -97, -203, - /* 40 */ 99, 40, 118, -79, -34, 197, 218, -191, -129, -17, - /* 50 */ -9, 18, 183, 189, 203, 209, 216, 217, 219, 221, - /* 60 */ 222, 223, 224, 225, 226, 227, 228, 214, 246, 248, - /* 70 */ 75, 220, 257, 261, 262, 263, 264, 300, 305, 306, - /* 80 */ 241, 308, 309, 310, 251, 265, 312, 315, 316, 320, - /* 90 */ 236, 239, 266, 269, 321, 322, 325, 327, 328, 332, - /* 100 */ 333, 334, 335, 336, 337, 339, 343, 345, 346, 348, - /* 110 */ 350, 352, 354, 356, 358, 360, 361, 363, 364, 366, - /* 120 */ 367, 368, 371, 372, 373, 374, 375, 376, 377, 378, - /* 130 */ 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, - /* 140 */ 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, - /* 150 */ 399, 401, 402, 403, 404, 405, 252, 255, 270, 271, - /* 160 */ 406, 407, 267, 278, 268, 295, 410, 273, 313, 412, - /* 170 */ 415, 417, 419, 418, 420, 421, 422, 424, 425, 427, - /* 180 */ 430, 428, 431, 434, 436, 435, 438, 439, 442, 443, - /* 190 */ 445, 440, 444, 441, 446, 447, 448, 450, 458, 460, - /* 200 */ 462, 471, 473, 454, 470, + /* 0 */ -31, -37, -37, -194, -194, -80, -204, -196, -184, -155, + /* 10 */ 29, 15, -164, 83, 148, 149, 158, 161, 163, 174, + /* 20 */ 175, 177, 182, -180, -193, -236, -149, -125, -108, -26, + /* 30 */ 32, -191, 104, -253, 44, 10, 95, 111, 143, 147, + /* 40 */ 64, -161, 179, 196, 178, 118, 204, 200, -261, -251, + /* 50 */ -200, -126, -62, -3, 6, 9, 48, 205, 213, 217, + /* 60 */ 219, 220, 223, 224, 225, 226, 227, 229, 117, 235, + /* 70 */ 248, 257, 260, 261, 262, 263, 264, 265, 306, 307, + /* 80 */ 309, 233, 310, 311, 312, 266, 267, 316, 317, 319, + /* 90 */ 320, 232, 242, 269, 276, 322, 326, 327, 329, 332, + /* 100 */ 334, 335, 338, 339, 340, 341, 342, 343, 345, 346, + /* 110 */ 347, 350, 354, 357, 360, 362, 363, 364, 365, 366, + /* 120 */ 367, 368, 369, 370, 372, 373, 374, 375, 376, 378, + /* 130 */ 379, 381, 382, 383, 384, 385, 386, 387, 388, 389, + /* 140 */ 390, 391, 392, 393, 395, 396, 397, 398, 399, 400, + /* 150 */ 401, 402, 404, 405, 321, 406, 407, 254, 273, 277, + /* 160 */ 278, 409, 410, 268, 291, 295, 270, 302, 279, 271, + /* 170 */ 280, 411, 412, 415, 416, 417, 418, 419, 420, 421, + /* 180 */ 425, 426, 430, 427, 429, 428, 431, 432, 435, 436, + /* 190 */ 438, 433, 434, 437, 439, 440, 442, 453, 451, 454, + /* 200 */ 455, 458, 459, 460, 463, }; static const YYACTIONTYPE yy_default[] = { - /* 0 */ 860, 984, 923, 994, 910, 920, 1131, 1131, 1131, 860, - /* 10 */ 860, 860, 860, 860, 860, 860, 860, 860, 860, 860, - /* 20 */ 860, 860, 860, 1042, 880, 1131, 860, 860, 860, 860, - /* 30 */ 860, 860, 860, 860, 920, 860, 860, 860, 860, 930, - /* 40 */ 920, 930, 930, 860, 1037, 968, 986, 860, 860, 860, - /* 50 */ 860, 860, 860, 860, 860, 860, 860, 860, 860, 860, - /* 60 */ 860, 860, 860, 860, 860, 860, 860, 860, 860, 860, - /* 70 */ 860, 860, 860, 860, 860, 860, 860, 860, 860, 860, - /* 80 */ 1044, 1050, 1047, 860, 860, 860, 1052, 860, 860, 860, - /* 90 */ 1074, 1074, 1035, 860, 860, 860, 860, 860, 860, 860, - /* 100 */ 860, 860, 860, 860, 860, 860, 860, 860, 860, 860, - /* 110 */ 860, 860, 860, 860, 860, 860, 860, 860, 860, 860, - /* 120 */ 860, 860, 860, 860, 860, 860, 908, 860, 906, 860, - /* 130 */ 860, 860, 860, 860, 860, 860, 860, 860, 860, 860, - /* 140 */ 860, 860, 860, 860, 860, 891, 860, 860, 860, 860, - /* 150 */ 860, 860, 878, 882, 882, 882, 860, 860, 860, 860, - /* 160 */ 882, 882, 1081, 1085, 1067, 1079, 1075, 1062, 1060, 1058, - /* 170 */ 1066, 1057, 1089, 882, 882, 882, 928, 928, 924, 920, - /* 180 */ 920, 882, 882, 946, 944, 942, 934, 940, 936, 938, - /* 190 */ 932, 911, 860, 882, 882, 918, 918, 882, 918, 882, - /* 200 */ 918, 882, 882, 968, 986, 860, 1090, 1080, 860, 1130, - /* 210 */ 1120, 1119, 860, 1126, 1118, 1117, 1116, 860, 860, 1112, - /* 220 */ 1115, 1114, 1113, 860, 860, 860, 860, 1122, 1121, 860, - /* 230 */ 860, 860, 860, 860, 860, 860, 860, 860, 860, 1086, - /* 240 */ 1082, 860, 860, 860, 860, 860, 860, 860, 860, 860, - /* 250 */ 1092, 860, 860, 860, 860, 860, 860, 860, 860, 860, - /* 260 */ 996, 860, 860, 860, 860, 860, 860, 860, 860, 860, - /* 270 */ 860, 860, 860, 1034, 860, 860, 860, 860, 860, 1046, - /* 280 */ 1045, 860, 860, 860, 860, 860, 860, 860, 860, 860, - /* 290 */ 860, 860, 1076, 860, 1068, 860, 860, 1008, 860, 860, - /* 300 */ 860, 860, 860, 860, 860, 860, 860, 860, 860, 860, - /* 310 */ 860, 860, 860, 860, 860, 860, 860, 860, 860, 860, - /* 320 */ 860, 860, 860, 860, 860, 860, 860, 860, 860, 1149, - /* 330 */ 1144, 1145, 1142, 860, 860, 860, 1141, 1136, 1137, 860, - /* 340 */ 860, 860, 1134, 860, 860, 860, 860, 860, 860, 860, - /* 350 */ 860, 860, 860, 860, 860, 860, 860, 860, 952, 860, - /* 360 */ 889, 887, 860, 860, + /* 0 */ 864, 988, 927, 998, 914, 924, 1137, 1137, 1137, 864, + /* 10 */ 864, 864, 864, 864, 864, 864, 864, 864, 864, 864, + /* 20 */ 864, 864, 864, 1046, 884, 1137, 864, 864, 864, 864, + /* 30 */ 864, 864, 864, 1061, 864, 924, 864, 864, 864, 864, + /* 40 */ 934, 924, 934, 934, 864, 1041, 972, 990, 864, 864, + /* 50 */ 864, 864, 864, 864, 864, 864, 864, 864, 864, 864, + /* 60 */ 864, 864, 864, 864, 864, 864, 864, 864, 864, 864, + /* 70 */ 864, 864, 864, 864, 864, 864, 864, 864, 864, 864, + /* 80 */ 864, 1048, 1054, 1051, 864, 864, 864, 1056, 864, 864, + /* 90 */ 864, 1080, 1080, 1039, 864, 864, 864, 864, 864, 864, + /* 100 */ 864, 864, 864, 864, 864, 864, 864, 864, 864, 864, + /* 110 */ 864, 864, 864, 864, 864, 864, 864, 864, 864, 864, + /* 120 */ 864, 864, 864, 864, 864, 864, 864, 912, 864, 910, + /* 130 */ 864, 864, 864, 864, 864, 864, 864, 864, 864, 864, + /* 140 */ 864, 864, 864, 864, 864, 864, 895, 864, 864, 864, + /* 150 */ 864, 864, 864, 882, 886, 886, 886, 864, 864, 864, + /* 160 */ 864, 886, 886, 1087, 1091, 1073, 1085, 1081, 1068, 1066, + /* 170 */ 1064, 1072, 1095, 886, 886, 886, 932, 932, 928, 924, + /* 180 */ 924, 886, 886, 950, 948, 946, 938, 944, 940, 942, + /* 190 */ 936, 915, 864, 886, 886, 922, 922, 886, 922, 886, + /* 200 */ 922, 886, 886, 972, 990, 864, 1096, 1086, 864, 1136, + /* 210 */ 1126, 1125, 864, 1132, 1124, 1123, 1122, 864, 864, 1118, + /* 220 */ 1121, 1120, 1119, 864, 864, 864, 864, 1128, 1127, 864, + /* 230 */ 864, 864, 864, 864, 864, 864, 864, 864, 864, 1092, + /* 240 */ 1088, 864, 864, 864, 864, 864, 864, 864, 864, 864, + /* 250 */ 1098, 864, 864, 864, 864, 864, 864, 864, 864, 864, + /* 260 */ 1000, 864, 864, 864, 864, 864, 864, 864, 864, 864, + /* 270 */ 864, 864, 864, 1038, 864, 864, 864, 864, 864, 1050, + /* 280 */ 1049, 864, 864, 864, 864, 864, 864, 864, 864, 864, + /* 290 */ 864, 864, 1082, 864, 1074, 864, 864, 1012, 864, 864, + /* 300 */ 864, 864, 864, 864, 864, 864, 864, 864, 864, 864, + /* 310 */ 864, 864, 864, 864, 864, 864, 864, 864, 864, 864, + /* 320 */ 864, 864, 864, 864, 864, 864, 864, 864, 864, 1155, + /* 330 */ 1150, 1151, 1148, 864, 864, 864, 1147, 1142, 1143, 864, + /* 340 */ 864, 864, 1140, 864, 864, 864, 864, 864, 864, 864, + /* 350 */ 864, 864, 864, 864, 864, 864, 864, 864, 956, 864, + /* 360 */ 893, 891, 864, 864, }; /********** End of lemon-generated parsing tables *****************************/ @@ -839,6 +633,7 @@ static const YYCODETYPE yyFallback[] = { 0, /* FROM => nothing */ 0, /* VARIABLE => nothing */ 0, /* INTERVAL => nothing */ + 0, /* EVERY => nothing */ 0, /* SESSION => nothing */ 0, /* STATE_WINDOW => nothing */ 0, /* FILL => nothing */ @@ -947,7 +742,6 @@ struct yyParser { int yyerrcnt; /* Shifts left before out of the error */ #endif ParseARG_SDECL /* A place to hold %extra_argument */ - ParseCTX_SDECL /* A place to hold %extra_context */ #if YYSTACKDEPTH<=0 int yystksz; /* Current side of the stack */ yyStackEntry *yystack; /* The parser's stack */ @@ -961,7 +755,6 @@ typedef struct yyParser yyParser; #ifndef NDEBUG #include -#include static FILE *yyTraceFILE = 0; static char *yyTracePrompt = 0; #endif /* NDEBUG */ @@ -1122,155 +915,158 @@ static const char *const yyTokenName[] = { /* 123 */ "FROM", /* 124 */ "VARIABLE", /* 125 */ "INTERVAL", - /* 126 */ "SESSION", - /* 127 */ "STATE_WINDOW", - /* 128 */ "FILL", - /* 129 */ "SLIDING", - /* 130 */ "ORDER", - /* 131 */ "BY", - /* 132 */ "ASC", - /* 133 */ "GROUP", - /* 134 */ "HAVING", - /* 135 */ "LIMIT", - /* 136 */ "OFFSET", - /* 137 */ "SLIMIT", - /* 138 */ "SOFFSET", - /* 139 */ "WHERE", - /* 140 */ "RESET", - /* 141 */ "QUERY", - /* 142 */ "SYNCDB", - /* 143 */ "ADD", - /* 144 */ "COLUMN", - /* 145 */ "MODIFY", - /* 146 */ "TAG", - /* 147 */ "CHANGE", - /* 148 */ "SET", - /* 149 */ "KILL", - /* 150 */ "CONNECTION", - /* 151 */ "STREAM", - /* 152 */ "COLON", - /* 153 */ "ABORT", - /* 154 */ "AFTER", - /* 155 */ "ATTACH", - /* 156 */ "BEFORE", - /* 157 */ "BEGIN", - /* 158 */ "CASCADE", - /* 159 */ "CLUSTER", - /* 160 */ "CONFLICT", - /* 161 */ "COPY", - /* 162 */ "DEFERRED", - /* 163 */ "DELIMITERS", - /* 164 */ "DETACH", - /* 165 */ "EACH", - /* 166 */ "END", - /* 167 */ "EXPLAIN", - /* 168 */ "FAIL", - /* 169 */ "FOR", - /* 170 */ "IGNORE", - /* 171 */ "IMMEDIATE", - /* 172 */ "INITIALLY", - /* 173 */ "INSTEAD", - /* 174 */ "MATCH", - /* 175 */ "KEY", - /* 176 */ "OF", - /* 177 */ "RAISE", - /* 178 */ "REPLACE", - /* 179 */ "RESTRICT", - /* 180 */ "ROW", - /* 181 */ "STATEMENT", - /* 182 */ "TRIGGER", - /* 183 */ "VIEW", - /* 184 */ "IPTOKEN", - /* 185 */ "SEMI", - /* 186 */ "NONE", - /* 187 */ "PREV", - /* 188 */ "LINEAR", - /* 189 */ "IMPORT", - /* 190 */ "TBNAME", - /* 191 */ "JOIN", - /* 192 */ "INSERT", - /* 193 */ "INTO", - /* 194 */ "VALUES", - /* 195 */ "program", - /* 196 */ "cmd", - /* 197 */ "ids", - /* 198 */ "dbPrefix", - /* 199 */ "cpxName", - /* 200 */ "ifexists", - /* 201 */ "alter_db_optr", - /* 202 */ "alter_topic_optr", - /* 203 */ "acct_optr", - /* 204 */ "exprlist", - /* 205 */ "ifnotexists", - /* 206 */ "db_optr", - /* 207 */ "topic_optr", - /* 208 */ "typename", - /* 209 */ "bufsize", - /* 210 */ "pps", - /* 211 */ "tseries", - /* 212 */ "dbs", - /* 213 */ "streams", - /* 214 */ "storage", - /* 215 */ "qtime", - /* 216 */ "users", - /* 217 */ "conns", - /* 218 */ "state", - /* 219 */ "intitemlist", - /* 220 */ "intitem", - /* 221 */ "keep", - /* 222 */ "cache", - /* 223 */ "replica", - /* 224 */ "quorum", - /* 225 */ "days", - /* 226 */ "minrows", - /* 227 */ "maxrows", - /* 228 */ "blocks", - /* 229 */ "ctime", - /* 230 */ "wal", - /* 231 */ "fsync", - /* 232 */ "comp", - /* 233 */ "prec", - /* 234 */ "update", - /* 235 */ "cachelast", - /* 236 */ "partitions", - /* 237 */ "signed", - /* 238 */ "create_table_args", - /* 239 */ "create_stable_args", - /* 240 */ "create_table_list", - /* 241 */ "create_from_stable", - /* 242 */ "columnlist", - /* 243 */ "tagitemlist", - /* 244 */ "tagNamelist", - /* 245 */ "select", - /* 246 */ "column", - /* 247 */ "tagitem", - /* 248 */ "selcollist", - /* 249 */ "from", - /* 250 */ "where_opt", - /* 251 */ "interval_opt", - /* 252 */ "sliding_opt", - /* 253 */ "session_option", - /* 254 */ "windowstate_option", - /* 255 */ "fill_opt", - /* 256 */ "groupby_opt", - /* 257 */ "having_opt", - /* 258 */ "orderby_opt", - /* 259 */ "slimit_opt", - /* 260 */ "limit_opt", - /* 261 */ "union", - /* 262 */ "sclp", - /* 263 */ "distinct", - /* 264 */ "expr", - /* 265 */ "as", - /* 266 */ "tablelist", - /* 267 */ "sub", - /* 268 */ "tmvar", - /* 269 */ "sortlist", - /* 270 */ "sortitem", - /* 271 */ "item", - /* 272 */ "sortorder", - /* 273 */ "grouplist", - /* 274 */ "expritem", + /* 126 */ "EVERY", + /* 127 */ "SESSION", + /* 128 */ "STATE_WINDOW", + /* 129 */ "FILL", + /* 130 */ "SLIDING", + /* 131 */ "ORDER", + /* 132 */ "BY", + /* 133 */ "ASC", + /* 134 */ "GROUP", + /* 135 */ "HAVING", + /* 136 */ "LIMIT", + /* 137 */ "OFFSET", + /* 138 */ "SLIMIT", + /* 139 */ "SOFFSET", + /* 140 */ "WHERE", + /* 141 */ "RESET", + /* 142 */ "QUERY", + /* 143 */ "SYNCDB", + /* 144 */ "ADD", + /* 145 */ "COLUMN", + /* 146 */ "MODIFY", + /* 147 */ "TAG", + /* 148 */ "CHANGE", + /* 149 */ "SET", + /* 150 */ "KILL", + /* 151 */ "CONNECTION", + /* 152 */ "STREAM", + /* 153 */ "COLON", + /* 154 */ "ABORT", + /* 155 */ "AFTER", + /* 156 */ "ATTACH", + /* 157 */ "BEFORE", + /* 158 */ "BEGIN", + /* 159 */ "CASCADE", + /* 160 */ "CLUSTER", + /* 161 */ "CONFLICT", + /* 162 */ "COPY", + /* 163 */ "DEFERRED", + /* 164 */ "DELIMITERS", + /* 165 */ "DETACH", + /* 166 */ "EACH", + /* 167 */ "END", + /* 168 */ "EXPLAIN", + /* 169 */ "FAIL", + /* 170 */ "FOR", + /* 171 */ "IGNORE", + /* 172 */ "IMMEDIATE", + /* 173 */ "INITIALLY", + /* 174 */ "INSTEAD", + /* 175 */ "MATCH", + /* 176 */ "KEY", + /* 177 */ "OF", + /* 178 */ "RAISE", + /* 179 */ "REPLACE", + /* 180 */ "RESTRICT", + /* 181 */ "ROW", + /* 182 */ "STATEMENT", + /* 183 */ "TRIGGER", + /* 184 */ "VIEW", + /* 185 */ "IPTOKEN", + /* 186 */ "SEMI", + /* 187 */ "NONE", + /* 188 */ "PREV", + /* 189 */ "LINEAR", + /* 190 */ "IMPORT", + /* 191 */ "TBNAME", + /* 192 */ "JOIN", + /* 193 */ "INSERT", + /* 194 */ "INTO", + /* 195 */ "VALUES", + /* 196 */ "error", + /* 197 */ "program", + /* 198 */ "cmd", + /* 199 */ "ids", + /* 200 */ "dbPrefix", + /* 201 */ "cpxName", + /* 202 */ "ifexists", + /* 203 */ "alter_db_optr", + /* 204 */ "alter_topic_optr", + /* 205 */ "acct_optr", + /* 206 */ "exprlist", + /* 207 */ "ifnotexists", + /* 208 */ "db_optr", + /* 209 */ "topic_optr", + /* 210 */ "typename", + /* 211 */ "bufsize", + /* 212 */ "pps", + /* 213 */ "tseries", + /* 214 */ "dbs", + /* 215 */ "streams", + /* 216 */ "storage", + /* 217 */ "qtime", + /* 218 */ "users", + /* 219 */ "conns", + /* 220 */ "state", + /* 221 */ "intitemlist", + /* 222 */ "intitem", + /* 223 */ "keep", + /* 224 */ "cache", + /* 225 */ "replica", + /* 226 */ "quorum", + /* 227 */ "days", + /* 228 */ "minrows", + /* 229 */ "maxrows", + /* 230 */ "blocks", + /* 231 */ "ctime", + /* 232 */ "wal", + /* 233 */ "fsync", + /* 234 */ "comp", + /* 235 */ "prec", + /* 236 */ "update", + /* 237 */ "cachelast", + /* 238 */ "partitions", + /* 239 */ "signed", + /* 240 */ "create_table_args", + /* 241 */ "create_stable_args", + /* 242 */ "create_table_list", + /* 243 */ "create_from_stable", + /* 244 */ "columnlist", + /* 245 */ "tagitemlist", + /* 246 */ "tagNamelist", + /* 247 */ "select", + /* 248 */ "column", + /* 249 */ "tagitem", + /* 250 */ "selcollist", + /* 251 */ "from", + /* 252 */ "where_opt", + /* 253 */ "interval_option", + /* 254 */ "sliding_opt", + /* 255 */ "session_option", + /* 256 */ "windowstate_option", + /* 257 */ "fill_opt", + /* 258 */ "groupby_opt", + /* 259 */ "having_opt", + /* 260 */ "orderby_opt", + /* 261 */ "slimit_opt", + /* 262 */ "limit_opt", + /* 263 */ "union", + /* 264 */ "sclp", + /* 265 */ "distinct", + /* 266 */ "expr", + /* 267 */ "as", + /* 268 */ "tablelist", + /* 269 */ "sub", + /* 270 */ "tmvar", + /* 271 */ "intervalKey", + /* 272 */ "sortlist", + /* 273 */ "sortitem", + /* 274 */ "item", + /* 275 */ "sortorder", + /* 276 */ "grouplist", + /* 277 */ "expritem", }; #endif /* defined(YYCOVERAGE) || !defined(NDEBUG) */ @@ -1445,7 +1241,7 @@ static const char *const yyRuleName[] = { /* 164 */ "tagitem ::= MINUS FLOAT", /* 165 */ "tagitem ::= PLUS INTEGER", /* 166 */ "tagitem ::= PLUS FLOAT", - /* 167 */ "select ::= SELECT selcollist from where_opt interval_opt sliding_opt session_option windowstate_option fill_opt groupby_opt having_opt orderby_opt slimit_opt limit_opt", + /* 167 */ "select ::= SELECT selcollist from where_opt interval_option sliding_opt session_option windowstate_option fill_opt groupby_opt having_opt orderby_opt slimit_opt limit_opt", /* 168 */ "select ::= LP select RP", /* 169 */ "union ::= select", /* 170 */ "union ::= union UNION ALL select", @@ -1470,104 +1266,106 @@ static const char *const yyRuleName[] = { /* 189 */ "tablelist ::= tablelist COMMA ids cpxName", /* 190 */ "tablelist ::= tablelist COMMA ids cpxName ids", /* 191 */ "tmvar ::= VARIABLE", - /* 192 */ "interval_opt ::= INTERVAL LP tmvar RP", - /* 193 */ "interval_opt ::= INTERVAL LP tmvar COMMA tmvar RP", - /* 194 */ "interval_opt ::=", - /* 195 */ "session_option ::=", - /* 196 */ "session_option ::= SESSION LP ids cpxName COMMA tmvar RP", - /* 197 */ "windowstate_option ::=", - /* 198 */ "windowstate_option ::= STATE_WINDOW LP ids RP", - /* 199 */ "fill_opt ::=", - /* 200 */ "fill_opt ::= FILL LP ID COMMA tagitemlist RP", - /* 201 */ "fill_opt ::= FILL LP ID RP", - /* 202 */ "sliding_opt ::= SLIDING LP tmvar RP", - /* 203 */ "sliding_opt ::=", - /* 204 */ "orderby_opt ::=", - /* 205 */ "orderby_opt ::= ORDER BY sortlist", - /* 206 */ "sortlist ::= sortlist COMMA item sortorder", - /* 207 */ "sortlist ::= item sortorder", - /* 208 */ "item ::= ids cpxName", - /* 209 */ "sortorder ::= ASC", - /* 210 */ "sortorder ::= DESC", - /* 211 */ "sortorder ::=", - /* 212 */ "groupby_opt ::=", - /* 213 */ "groupby_opt ::= GROUP BY grouplist", - /* 214 */ "grouplist ::= grouplist COMMA item", - /* 215 */ "grouplist ::= item", - /* 216 */ "having_opt ::=", - /* 217 */ "having_opt ::= HAVING expr", - /* 218 */ "limit_opt ::=", - /* 219 */ "limit_opt ::= LIMIT signed", - /* 220 */ "limit_opt ::= LIMIT signed OFFSET signed", - /* 221 */ "limit_opt ::= LIMIT signed COMMA signed", - /* 222 */ "slimit_opt ::=", - /* 223 */ "slimit_opt ::= SLIMIT signed", - /* 224 */ "slimit_opt ::= SLIMIT signed SOFFSET signed", - /* 225 */ "slimit_opt ::= SLIMIT signed COMMA signed", - /* 226 */ "where_opt ::=", - /* 227 */ "where_opt ::= WHERE expr", - /* 228 */ "expr ::= LP expr RP", - /* 229 */ "expr ::= ID", - /* 230 */ "expr ::= ID DOT ID", - /* 231 */ "expr ::= ID DOT STAR", - /* 232 */ "expr ::= INTEGER", - /* 233 */ "expr ::= MINUS INTEGER", - /* 234 */ "expr ::= PLUS INTEGER", - /* 235 */ "expr ::= FLOAT", - /* 236 */ "expr ::= MINUS FLOAT", - /* 237 */ "expr ::= PLUS FLOAT", - /* 238 */ "expr ::= STRING", - /* 239 */ "expr ::= NOW", - /* 240 */ "expr ::= VARIABLE", - /* 241 */ "expr ::= PLUS VARIABLE", - /* 242 */ "expr ::= MINUS VARIABLE", - /* 243 */ "expr ::= BOOL", - /* 244 */ "expr ::= NULL", - /* 245 */ "expr ::= ID LP exprlist RP", - /* 246 */ "expr ::= ID LP STAR RP", - /* 247 */ "expr ::= expr IS NULL", - /* 248 */ "expr ::= expr IS NOT NULL", - /* 249 */ "expr ::= expr LT expr", - /* 250 */ "expr ::= expr GT expr", - /* 251 */ "expr ::= expr LE expr", - /* 252 */ "expr ::= expr GE expr", - /* 253 */ "expr ::= expr NE expr", - /* 254 */ "expr ::= expr EQ expr", - /* 255 */ "expr ::= expr BETWEEN expr AND expr", - /* 256 */ "expr ::= expr AND expr", - /* 257 */ "expr ::= expr OR expr", - /* 258 */ "expr ::= expr PLUS expr", - /* 259 */ "expr ::= expr MINUS expr", - /* 260 */ "expr ::= expr STAR expr", - /* 261 */ "expr ::= expr SLASH expr", - /* 262 */ "expr ::= expr REM expr", - /* 263 */ "expr ::= expr LIKE expr", - /* 264 */ "expr ::= expr IN LP exprlist RP", - /* 265 */ "exprlist ::= exprlist COMMA expritem", - /* 266 */ "exprlist ::= expritem", - /* 267 */ "expritem ::= expr", - /* 268 */ "expritem ::=", - /* 269 */ "cmd ::= RESET QUERY CACHE", - /* 270 */ "cmd ::= SYNCDB ids REPLICA", - /* 271 */ "cmd ::= ALTER TABLE ids cpxName ADD COLUMN columnlist", - /* 272 */ "cmd ::= ALTER TABLE ids cpxName DROP COLUMN ids", - /* 273 */ "cmd ::= ALTER TABLE ids cpxName MODIFY COLUMN columnlist", - /* 274 */ "cmd ::= ALTER TABLE ids cpxName ADD TAG columnlist", - /* 275 */ "cmd ::= ALTER TABLE ids cpxName DROP TAG ids", - /* 276 */ "cmd ::= ALTER TABLE ids cpxName CHANGE TAG ids ids", - /* 277 */ "cmd ::= ALTER TABLE ids cpxName SET TAG ids EQ tagitem", - /* 278 */ "cmd ::= ALTER TABLE ids cpxName MODIFY TAG columnlist", - /* 279 */ "cmd ::= ALTER STABLE ids cpxName ADD COLUMN columnlist", - /* 280 */ "cmd ::= ALTER STABLE ids cpxName DROP COLUMN ids", - /* 281 */ "cmd ::= ALTER STABLE ids cpxName MODIFY COLUMN columnlist", - /* 282 */ "cmd ::= ALTER STABLE ids cpxName ADD TAG columnlist", - /* 283 */ "cmd ::= ALTER STABLE ids cpxName DROP TAG ids", - /* 284 */ "cmd ::= ALTER STABLE ids cpxName CHANGE TAG ids ids", - /* 285 */ "cmd ::= ALTER STABLE ids cpxName SET TAG ids EQ tagitem", - /* 286 */ "cmd ::= ALTER STABLE ids cpxName MODIFY TAG columnlist", - /* 287 */ "cmd ::= KILL CONNECTION INTEGER", - /* 288 */ "cmd ::= KILL STREAM INTEGER COLON INTEGER", - /* 289 */ "cmd ::= KILL QUERY INTEGER COLON INTEGER", + /* 192 */ "interval_option ::= intervalKey LP tmvar RP", + /* 193 */ "interval_option ::= intervalKey LP tmvar COMMA tmvar RP", + /* 194 */ "interval_option ::=", + /* 195 */ "intervalKey ::= INTERVAL", + /* 196 */ "intervalKey ::= EVERY", + /* 197 */ "session_option ::=", + /* 198 */ "session_option ::= SESSION LP ids cpxName COMMA tmvar RP", + /* 199 */ "windowstate_option ::=", + /* 200 */ "windowstate_option ::= STATE_WINDOW LP ids RP", + /* 201 */ "fill_opt ::=", + /* 202 */ "fill_opt ::= FILL LP ID COMMA tagitemlist RP", + /* 203 */ "fill_opt ::= FILL LP ID RP", + /* 204 */ "sliding_opt ::= SLIDING LP tmvar RP", + /* 205 */ "sliding_opt ::=", + /* 206 */ "orderby_opt ::=", + /* 207 */ "orderby_opt ::= ORDER BY sortlist", + /* 208 */ "sortlist ::= sortlist COMMA item sortorder", + /* 209 */ "sortlist ::= item sortorder", + /* 210 */ "item ::= ids cpxName", + /* 211 */ "sortorder ::= ASC", + /* 212 */ "sortorder ::= DESC", + /* 213 */ "sortorder ::=", + /* 214 */ "groupby_opt ::=", + /* 215 */ "groupby_opt ::= GROUP BY grouplist", + /* 216 */ "grouplist ::= grouplist COMMA item", + /* 217 */ "grouplist ::= item", + /* 218 */ "having_opt ::=", + /* 219 */ "having_opt ::= HAVING expr", + /* 220 */ "limit_opt ::=", + /* 221 */ "limit_opt ::= LIMIT signed", + /* 222 */ "limit_opt ::= LIMIT signed OFFSET signed", + /* 223 */ "limit_opt ::= LIMIT signed COMMA signed", + /* 224 */ "slimit_opt ::=", + /* 225 */ "slimit_opt ::= SLIMIT signed", + /* 226 */ "slimit_opt ::= SLIMIT signed SOFFSET signed", + /* 227 */ "slimit_opt ::= SLIMIT signed COMMA signed", + /* 228 */ "where_opt ::=", + /* 229 */ "where_opt ::= WHERE expr", + /* 230 */ "expr ::= LP expr RP", + /* 231 */ "expr ::= ID", + /* 232 */ "expr ::= ID DOT ID", + /* 233 */ "expr ::= ID DOT STAR", + /* 234 */ "expr ::= INTEGER", + /* 235 */ "expr ::= MINUS INTEGER", + /* 236 */ "expr ::= PLUS INTEGER", + /* 237 */ "expr ::= FLOAT", + /* 238 */ "expr ::= MINUS FLOAT", + /* 239 */ "expr ::= PLUS FLOAT", + /* 240 */ "expr ::= STRING", + /* 241 */ "expr ::= NOW", + /* 242 */ "expr ::= VARIABLE", + /* 243 */ "expr ::= PLUS VARIABLE", + /* 244 */ "expr ::= MINUS VARIABLE", + /* 245 */ "expr ::= BOOL", + /* 246 */ "expr ::= NULL", + /* 247 */ "expr ::= ID LP exprlist RP", + /* 248 */ "expr ::= ID LP STAR RP", + /* 249 */ "expr ::= expr IS NULL", + /* 250 */ "expr ::= expr IS NOT NULL", + /* 251 */ "expr ::= expr LT expr", + /* 252 */ "expr ::= expr GT expr", + /* 253 */ "expr ::= expr LE expr", + /* 254 */ "expr ::= expr GE expr", + /* 255 */ "expr ::= expr NE expr", + /* 256 */ "expr ::= expr EQ expr", + /* 257 */ "expr ::= expr BETWEEN expr AND expr", + /* 258 */ "expr ::= expr AND expr", + /* 259 */ "expr ::= expr OR expr", + /* 260 */ "expr ::= expr PLUS expr", + /* 261 */ "expr ::= expr MINUS expr", + /* 262 */ "expr ::= expr STAR expr", + /* 263 */ "expr ::= expr SLASH expr", + /* 264 */ "expr ::= expr REM expr", + /* 265 */ "expr ::= expr LIKE expr", + /* 266 */ "expr ::= expr IN LP exprlist RP", + /* 267 */ "exprlist ::= exprlist COMMA expritem", + /* 268 */ "exprlist ::= expritem", + /* 269 */ "expritem ::= expr", + /* 270 */ "expritem ::=", + /* 271 */ "cmd ::= RESET QUERY CACHE", + /* 272 */ "cmd ::= SYNCDB ids REPLICA", + /* 273 */ "cmd ::= ALTER TABLE ids cpxName ADD COLUMN columnlist", + /* 274 */ "cmd ::= ALTER TABLE ids cpxName DROP COLUMN ids", + /* 275 */ "cmd ::= ALTER TABLE ids cpxName MODIFY COLUMN columnlist", + /* 276 */ "cmd ::= ALTER TABLE ids cpxName ADD TAG columnlist", + /* 277 */ "cmd ::= ALTER TABLE ids cpxName DROP TAG ids", + /* 278 */ "cmd ::= ALTER TABLE ids cpxName CHANGE TAG ids ids", + /* 279 */ "cmd ::= ALTER TABLE ids cpxName SET TAG ids EQ tagitem", + /* 280 */ "cmd ::= ALTER TABLE ids cpxName MODIFY TAG columnlist", + /* 281 */ "cmd ::= ALTER STABLE ids cpxName ADD COLUMN columnlist", + /* 282 */ "cmd ::= ALTER STABLE ids cpxName DROP COLUMN ids", + /* 283 */ "cmd ::= ALTER STABLE ids cpxName MODIFY COLUMN columnlist", + /* 284 */ "cmd ::= ALTER STABLE ids cpxName ADD TAG columnlist", + /* 285 */ "cmd ::= ALTER STABLE ids cpxName DROP TAG ids", + /* 286 */ "cmd ::= ALTER STABLE ids cpxName CHANGE TAG ids ids", + /* 287 */ "cmd ::= ALTER STABLE ids cpxName SET TAG ids EQ tagitem", + /* 288 */ "cmd ::= ALTER STABLE ids cpxName MODIFY TAG columnlist", + /* 289 */ "cmd ::= KILL CONNECTION INTEGER", + /* 290 */ "cmd ::= KILL STREAM INTEGER COLON INTEGER", + /* 291 */ "cmd ::= KILL QUERY INTEGER COLON INTEGER", }; #endif /* NDEBUG */ @@ -1616,29 +1414,28 @@ static int yyGrowStack(yyParser *p){ /* Initialize a new parser that has already been allocated. */ -void ParseInit(void *yypRawParser ParseCTX_PDECL){ - yyParser *yypParser = (yyParser*)yypRawParser; - ParseCTX_STORE +void ParseInit(void *yypParser){ + yyParser *pParser = (yyParser*)yypParser; #ifdef YYTRACKMAXSTACKDEPTH - yypParser->yyhwm = 0; + pParser->yyhwm = 0; #endif #if YYSTACKDEPTH<=0 - yypParser->yytos = NULL; - yypParser->yystack = NULL; - yypParser->yystksz = 0; - if( yyGrowStack(yypParser) ){ - yypParser->yystack = &yypParser->yystk0; - yypParser->yystksz = 1; + pParser->yytos = NULL; + pParser->yystack = NULL; + pParser->yystksz = 0; + if( yyGrowStack(pParser) ){ + pParser->yystack = &pParser->yystk0; + pParser->yystksz = 1; } #endif #ifndef YYNOERRORRECOVERY - yypParser->yyerrcnt = -1; + pParser->yyerrcnt = -1; #endif - yypParser->yytos = yypParser->yystack; - yypParser->yystack[0].stateno = 0; - yypParser->yystack[0].major = 0; + pParser->yytos = pParser->yystack; + pParser->yystack[0].stateno = 0; + pParser->yystack[0].major = 0; #if YYSTACKDEPTH>0 - yypParser->yystackEnd = &yypParser->yystack[YYSTACKDEPTH-1]; + pParser->yystackEnd = &pParser->yystack[YYSTACKDEPTH-1]; #endif } @@ -1655,14 +1452,11 @@ void ParseInit(void *yypRawParser ParseCTX_PDECL){ ** A pointer to a parser. This pointer is used in subsequent calls ** to Parse and ParseFree. */ -void *ParseAlloc(void *(*mallocProc)(YYMALLOCARGTYPE) ParseCTX_PDECL){ - yyParser *yypParser; - yypParser = (yyParser*)(*mallocProc)( (YYMALLOCARGTYPE)sizeof(yyParser) ); - if( yypParser ){ - ParseCTX_STORE - ParseInit(yypParser ParseCTX_PARAM); - } - return (void*)yypParser; +void *ParseAlloc(void *(*mallocProc)(YYMALLOCARGTYPE)){ + yyParser *pParser; + pParser = (yyParser*)(*mallocProc)( (YYMALLOCARGTYPE)sizeof(yyParser) ); + if( pParser ) ParseInit(pParser); + return pParser; } #endif /* Parse_ENGINEALWAYSONSTACK */ @@ -1679,8 +1473,7 @@ static void yy_destructor( YYCODETYPE yymajor, /* Type code for object to destroy */ YYMINORTYPE *yypminor /* The object to be destroyed */ ){ - ParseARG_FETCH - ParseCTX_FETCH + ParseARG_FETCH; switch( yymajor ){ /* Here is inserted the actions which take place when a ** terminal or non-terminal is destroyed. This can happen @@ -1693,76 +1486,60 @@ static void yy_destructor( ** inside the C code. */ /********* Begin destructor definitions ***************************************/ - case 204: /* exprlist */ - case 248: /* selcollist */ - case 262: /* sclp */ + case 206: /* exprlist */ + case 250: /* selcollist */ + case 264: /* sclp */ { -#line 753 "src/query/inc/sql.y" -tSqlExprListDestroy((yypminor->yy131)); -#line 1702 "src/query/inc/sql.c" +tSqlExprListDestroy((yypminor->yy421)); } break; - case 219: /* intitemlist */ - case 221: /* keep */ - case 242: /* columnlist */ - case 243: /* tagitemlist */ - case 244: /* tagNamelist */ - case 255: /* fill_opt */ - case 256: /* groupby_opt */ - case 258: /* orderby_opt */ - case 269: /* sortlist */ - case 273: /* grouplist */ -{ -#line 256 "src/query/inc/sql.y" -taosArrayDestroy((yypminor->yy131)); -#line 1718 "src/query/inc/sql.c" + case 221: /* intitemlist */ + case 223: /* keep */ + case 244: /* columnlist */ + case 245: /* tagitemlist */ + case 246: /* tagNamelist */ + case 257: /* fill_opt */ + case 258: /* groupby_opt */ + case 260: /* orderby_opt */ + case 272: /* sortlist */ + case 276: /* grouplist */ +{ +taosArrayDestroy((yypminor->yy421)); } break; - case 240: /* create_table_list */ + case 242: /* create_table_list */ { -#line 364 "src/query/inc/sql.y" -destroyCreateTableSql((yypminor->yy272)); -#line 1725 "src/query/inc/sql.c" +destroyCreateTableSql((yypminor->yy438)); } break; - case 245: /* select */ + case 247: /* select */ { -#line 484 "src/query/inc/sql.y" -destroySqlNode((yypminor->yy256)); -#line 1732 "src/query/inc/sql.c" +destroySqlNode((yypminor->yy56)); } break; - case 249: /* from */ - case 266: /* tablelist */ - case 267: /* sub */ + case 251: /* from */ + case 268: /* tablelist */ + case 269: /* sub */ { -#line 539 "src/query/inc/sql.y" -destroyRelationInfo((yypminor->yy544)); -#line 1741 "src/query/inc/sql.c" +destroyRelationInfo((yypminor->yy8)); } break; - case 250: /* where_opt */ - case 257: /* having_opt */ - case 264: /* expr */ - case 274: /* expritem */ + case 252: /* where_opt */ + case 259: /* having_opt */ + case 266: /* expr */ + case 277: /* expritem */ { -#line 686 "src/query/inc/sql.y" -tSqlExprDestroy((yypminor->yy46)); -#line 1751 "src/query/inc/sql.c" +tSqlExprDestroy((yypminor->yy439)); } break; - case 261: /* union */ + case 263: /* union */ { -#line 492 "src/query/inc/sql.y" -destroyAllSqlNode((yypminor->yy131)); -#line 1758 "src/query/inc/sql.c" +destroyAllSqlNode((yypminor->yy421)); } break; - case 270: /* sortitem */ + case 273: /* sortitem */ { -#line 619 "src/query/inc/sql.y" -tVariantDestroy(&(yypminor->yy516)); -#line 1765 "src/query/inc/sql.c" +tVariantDestroy(&(yypminor->yy430)); } break; /********* End destructor definitions *****************************************/ @@ -1874,12 +1651,13 @@ int ParseCoverage(FILE *out){ ** Find the appropriate action for a parser given the terminal ** look-ahead token iLookAhead. */ -static YYACTIONTYPE yy_find_shift_action( - YYCODETYPE iLookAhead, /* The look-ahead token */ - YYACTIONTYPE stateno /* Current state number */ +static unsigned int yy_find_shift_action( + yyParser *pParser, /* The parser */ + YYCODETYPE iLookAhead /* The look-ahead token */ ){ int i; - + int stateno = pParser->yytos->stateno; + if( stateno>YY_MAX_SHIFT ) return stateno; assert( stateno <= YY_SHIFT_COUNT ); #if defined(YYCOVERAGE) @@ -1887,19 +1665,15 @@ static YYACTIONTYPE yy_find_shift_action( #endif do{ i = yy_shift_ofst[stateno]; - assert( i>=0 ); - assert( i<=YY_ACTTAB_COUNT ); - assert( i+YYNTOKEN<=(int)YY_NLOOKAHEAD ); + assert( i>=0 && i+YYNTOKEN<=sizeof(yy_lookahead)/sizeof(yy_lookahead[0]) ); assert( iLookAhead!=YYNOCODE ); assert( iLookAhead < YYNTOKEN ); i += iLookAhead; - assert( i<(int)YY_NLOOKAHEAD ); if( yy_lookahead[i]!=iLookAhead ){ #ifdef YYFALLBACK YYCODETYPE iFallback; /* Fallback token */ - assert( iLookAhead %s\n", @@ -1914,8 +1688,15 @@ static YYACTIONTYPE yy_find_shift_action( #ifdef YYWILDCARD { int j = i - iLookAhead + YYWILDCARD; - assert( j<(int)(sizeof(yy_lookahead)/sizeof(yy_lookahead[0])) ); - if( yy_lookahead[j]==YYWILDCARD && iLookAhead>0 ){ + if( +#if YY_SHIFT_MIN+YYWILDCARD<0 + j>=0 && +#endif +#if YY_SHIFT_MAX+YYWILDCARD>=YY_ACTTAB_COUNT + j0 + ){ #ifndef NDEBUG if( yyTraceFILE ){ fprintf(yyTraceFILE, "%sWILDCARD %s => %s\n", @@ -1929,7 +1710,6 @@ static YYACTIONTYPE yy_find_shift_action( #endif /* YYWILDCARD */ return yy_default[stateno]; }else{ - assert( i>=0 && i<(int)(sizeof(yy_action)/sizeof(yy_action[0])) ); return yy_action[i]; } }while(1); @@ -1939,8 +1719,8 @@ static YYACTIONTYPE yy_find_shift_action( ** Find the appropriate action for a parser given the non-terminal ** look-ahead token iLookAhead. */ -static YYACTIONTYPE yy_find_reduce_action( - YYACTIONTYPE stateno, /* Current state number */ +static int yy_find_reduce_action( + int stateno, /* Current state number */ YYCODETYPE iLookAhead /* The look-ahead token */ ){ int i; @@ -1969,8 +1749,7 @@ static YYACTIONTYPE yy_find_reduce_action( ** The following routine is called if the stack overflows. */ static void yyStackOverflow(yyParser *yypParser){ - ParseARG_FETCH - ParseCTX_FETCH + ParseARG_FETCH; #ifndef NDEBUG if( yyTraceFILE ){ fprintf(yyTraceFILE,"%sStack Overflow!\n",yyTracePrompt); @@ -1981,8 +1760,7 @@ static void yyStackOverflow(yyParser *yypParser){ ** stack every overflows */ /******** Begin %stack_overflow code ******************************************/ /******** End %stack_overflow code ********************************************/ - ParseARG_STORE /* Suppress warning about unused %extra_argument var */ - ParseCTX_STORE + ParseARG_STORE; /* Suppress warning about unused %extra_argument var */ } /* @@ -2011,8 +1789,8 @@ static void yyTraceShift(yyParser *yypParser, int yyNewState, const char *zTag){ */ static void yy_shift( yyParser *yypParser, /* The parser to be shifted */ - YYACTIONTYPE yyNewState, /* The new state to shift in */ - YYCODETYPE yyMajor, /* The major token to shift in */ + int yyNewState, /* The new state to shift in */ + int yyMajor, /* The major token to shift in */ ParseTOKENTYPE yyMinor /* The minor token to shift in */ ){ yyStackEntry *yytos; @@ -2042,600 +1820,311 @@ static void yy_shift( yyNewState += YY_MIN_REDUCE - YY_MIN_SHIFTREDUCE; } yytos = yypParser->yytos; - yytos->stateno = yyNewState; - yytos->major = yyMajor; + yytos->stateno = (YYACTIONTYPE)yyNewState; + yytos->major = (YYCODETYPE)yyMajor; yytos->minor.yy0 = yyMinor; yyTraceShift(yypParser, yyNewState, "Shift"); } -/* For rule J, yyRuleInfoLhs[J] contains the symbol on the left-hand side -** of that rule */ -static const YYCODETYPE yyRuleInfoLhs[] = { - 195, /* (0) program ::= cmd */ - 196, /* (1) cmd ::= SHOW DATABASES */ - 196, /* (2) cmd ::= SHOW TOPICS */ - 196, /* (3) cmd ::= SHOW FUNCTIONS */ - 196, /* (4) cmd ::= SHOW MNODES */ - 196, /* (5) cmd ::= SHOW DNODES */ - 196, /* (6) cmd ::= SHOW ACCOUNTS */ - 196, /* (7) cmd ::= SHOW USERS */ - 196, /* (8) cmd ::= SHOW MODULES */ - 196, /* (9) cmd ::= SHOW QUERIES */ - 196, /* (10) cmd ::= SHOW CONNECTIONS */ - 196, /* (11) cmd ::= SHOW STREAMS */ - 196, /* (12) cmd ::= SHOW VARIABLES */ - 196, /* (13) cmd ::= SHOW SCORES */ - 196, /* (14) cmd ::= SHOW GRANTS */ - 196, /* (15) cmd ::= SHOW VNODES */ - 196, /* (16) cmd ::= SHOW VNODES ids */ - 198, /* (17) dbPrefix ::= */ - 198, /* (18) dbPrefix ::= ids DOT */ - 199, /* (19) cpxName ::= */ - 199, /* (20) cpxName ::= DOT ids */ - 196, /* (21) cmd ::= SHOW CREATE TABLE ids cpxName */ - 196, /* (22) cmd ::= SHOW CREATE STABLE ids cpxName */ - 196, /* (23) cmd ::= SHOW CREATE DATABASE ids */ - 196, /* (24) cmd ::= SHOW dbPrefix TABLES */ - 196, /* (25) cmd ::= SHOW dbPrefix TABLES LIKE ids */ - 196, /* (26) cmd ::= SHOW dbPrefix STABLES */ - 196, /* (27) cmd ::= SHOW dbPrefix STABLES LIKE ids */ - 196, /* (28) cmd ::= SHOW dbPrefix VGROUPS */ - 196, /* (29) cmd ::= SHOW dbPrefix VGROUPS ids */ - 196, /* (30) cmd ::= DROP TABLE ifexists ids cpxName */ - 196, /* (31) cmd ::= DROP STABLE ifexists ids cpxName */ - 196, /* (32) cmd ::= DROP DATABASE ifexists ids */ - 196, /* (33) cmd ::= DROP TOPIC ifexists ids */ - 196, /* (34) cmd ::= DROP FUNCTION ids */ - 196, /* (35) cmd ::= DROP DNODE ids */ - 196, /* (36) cmd ::= DROP USER ids */ - 196, /* (37) cmd ::= DROP ACCOUNT ids */ - 196, /* (38) cmd ::= USE ids */ - 196, /* (39) cmd ::= DESCRIBE ids cpxName */ - 196, /* (40) cmd ::= DESC ids cpxName */ - 196, /* (41) cmd ::= ALTER USER ids PASS ids */ - 196, /* (42) cmd ::= ALTER USER ids PRIVILEGE ids */ - 196, /* (43) cmd ::= ALTER DNODE ids ids */ - 196, /* (44) cmd ::= ALTER DNODE ids ids ids */ - 196, /* (45) cmd ::= ALTER LOCAL ids */ - 196, /* (46) cmd ::= ALTER LOCAL ids ids */ - 196, /* (47) cmd ::= ALTER DATABASE ids alter_db_optr */ - 196, /* (48) cmd ::= ALTER TOPIC ids alter_topic_optr */ - 196, /* (49) cmd ::= ALTER ACCOUNT ids acct_optr */ - 196, /* (50) cmd ::= ALTER ACCOUNT ids PASS ids acct_optr */ - 196, /* (51) cmd ::= COMPACT VNODES IN LP exprlist RP */ - 197, /* (52) ids ::= ID */ - 197, /* (53) ids ::= STRING */ - 200, /* (54) ifexists ::= IF EXISTS */ - 200, /* (55) ifexists ::= */ - 205, /* (56) ifnotexists ::= IF NOT EXISTS */ - 205, /* (57) ifnotexists ::= */ - 196, /* (58) cmd ::= CREATE DNODE ids */ - 196, /* (59) cmd ::= CREATE ACCOUNT ids PASS ids acct_optr */ - 196, /* (60) cmd ::= CREATE DATABASE ifnotexists ids db_optr */ - 196, /* (61) cmd ::= CREATE TOPIC ifnotexists ids topic_optr */ - 196, /* (62) cmd ::= CREATE FUNCTION ids AS ids OUTPUTTYPE typename bufsize */ - 196, /* (63) cmd ::= CREATE AGGREGATE FUNCTION ids AS ids OUTPUTTYPE typename bufsize */ - 196, /* (64) cmd ::= CREATE USER ids PASS ids */ - 209, /* (65) bufsize ::= */ - 209, /* (66) bufsize ::= BUFSIZE INTEGER */ - 210, /* (67) pps ::= */ - 210, /* (68) pps ::= PPS INTEGER */ - 211, /* (69) tseries ::= */ - 211, /* (70) tseries ::= TSERIES INTEGER */ - 212, /* (71) dbs ::= */ - 212, /* (72) dbs ::= DBS INTEGER */ - 213, /* (73) streams ::= */ - 213, /* (74) streams ::= STREAMS INTEGER */ - 214, /* (75) storage ::= */ - 214, /* (76) storage ::= STORAGE INTEGER */ - 215, /* (77) qtime ::= */ - 215, /* (78) qtime ::= QTIME INTEGER */ - 216, /* (79) users ::= */ - 216, /* (80) users ::= USERS INTEGER */ - 217, /* (81) conns ::= */ - 217, /* (82) conns ::= CONNS INTEGER */ - 218, /* (83) state ::= */ - 218, /* (84) state ::= STATE ids */ - 203, /* (85) acct_optr ::= pps tseries storage streams qtime dbs users conns state */ - 219, /* (86) intitemlist ::= intitemlist COMMA intitem */ - 219, /* (87) intitemlist ::= intitem */ - 220, /* (88) intitem ::= INTEGER */ - 221, /* (89) keep ::= KEEP intitemlist */ - 222, /* (90) cache ::= CACHE INTEGER */ - 223, /* (91) replica ::= REPLICA INTEGER */ - 224, /* (92) quorum ::= QUORUM INTEGER */ - 225, /* (93) days ::= DAYS INTEGER */ - 226, /* (94) minrows ::= MINROWS INTEGER */ - 227, /* (95) maxrows ::= MAXROWS INTEGER */ - 228, /* (96) blocks ::= BLOCKS INTEGER */ - 229, /* (97) ctime ::= CTIME INTEGER */ - 230, /* (98) wal ::= WAL INTEGER */ - 231, /* (99) fsync ::= FSYNC INTEGER */ - 232, /* (100) comp ::= COMP INTEGER */ - 233, /* (101) prec ::= PRECISION STRING */ - 234, /* (102) update ::= UPDATE INTEGER */ - 235, /* (103) cachelast ::= CACHELAST INTEGER */ - 236, /* (104) partitions ::= PARTITIONS INTEGER */ - 206, /* (105) db_optr ::= */ - 206, /* (106) db_optr ::= db_optr cache */ - 206, /* (107) db_optr ::= db_optr replica */ - 206, /* (108) db_optr ::= db_optr quorum */ - 206, /* (109) db_optr ::= db_optr days */ - 206, /* (110) db_optr ::= db_optr minrows */ - 206, /* (111) db_optr ::= db_optr maxrows */ - 206, /* (112) db_optr ::= db_optr blocks */ - 206, /* (113) db_optr ::= db_optr ctime */ - 206, /* (114) db_optr ::= db_optr wal */ - 206, /* (115) db_optr ::= db_optr fsync */ - 206, /* (116) db_optr ::= db_optr comp */ - 206, /* (117) db_optr ::= db_optr prec */ - 206, /* (118) db_optr ::= db_optr keep */ - 206, /* (119) db_optr ::= db_optr update */ - 206, /* (120) db_optr ::= db_optr cachelast */ - 207, /* (121) topic_optr ::= db_optr */ - 207, /* (122) topic_optr ::= topic_optr partitions */ - 201, /* (123) alter_db_optr ::= */ - 201, /* (124) alter_db_optr ::= alter_db_optr replica */ - 201, /* (125) alter_db_optr ::= alter_db_optr quorum */ - 201, /* (126) alter_db_optr ::= alter_db_optr keep */ - 201, /* (127) alter_db_optr ::= alter_db_optr blocks */ - 201, /* (128) alter_db_optr ::= alter_db_optr comp */ - 201, /* (129) alter_db_optr ::= alter_db_optr update */ - 201, /* (130) alter_db_optr ::= alter_db_optr cachelast */ - 202, /* (131) alter_topic_optr ::= alter_db_optr */ - 202, /* (132) alter_topic_optr ::= alter_topic_optr partitions */ - 208, /* (133) typename ::= ids */ - 208, /* (134) typename ::= ids LP signed RP */ - 208, /* (135) typename ::= ids UNSIGNED */ - 237, /* (136) signed ::= INTEGER */ - 237, /* (137) signed ::= PLUS INTEGER */ - 237, /* (138) signed ::= MINUS INTEGER */ - 196, /* (139) cmd ::= CREATE TABLE create_table_args */ - 196, /* (140) cmd ::= CREATE TABLE create_stable_args */ - 196, /* (141) cmd ::= CREATE STABLE create_stable_args */ - 196, /* (142) cmd ::= CREATE TABLE create_table_list */ - 240, /* (143) create_table_list ::= create_from_stable */ - 240, /* (144) create_table_list ::= create_table_list create_from_stable */ - 238, /* (145) create_table_args ::= ifnotexists ids cpxName LP columnlist RP */ - 239, /* (146) create_stable_args ::= ifnotexists ids cpxName LP columnlist RP TAGS LP columnlist RP */ - 241, /* (147) create_from_stable ::= ifnotexists ids cpxName USING ids cpxName TAGS LP tagitemlist RP */ - 241, /* (148) create_from_stable ::= ifnotexists ids cpxName USING ids cpxName LP tagNamelist RP TAGS LP tagitemlist RP */ - 244, /* (149) tagNamelist ::= tagNamelist COMMA ids */ - 244, /* (150) tagNamelist ::= ids */ - 238, /* (151) create_table_args ::= ifnotexists ids cpxName AS select */ - 242, /* (152) columnlist ::= columnlist COMMA column */ - 242, /* (153) columnlist ::= column */ - 246, /* (154) column ::= ids typename */ - 243, /* (155) tagitemlist ::= tagitemlist COMMA tagitem */ - 243, /* (156) tagitemlist ::= tagitem */ - 247, /* (157) tagitem ::= INTEGER */ - 247, /* (158) tagitem ::= FLOAT */ - 247, /* (159) tagitem ::= STRING */ - 247, /* (160) tagitem ::= BOOL */ - 247, /* (161) tagitem ::= NULL */ - 247, /* (162) tagitem ::= NOW */ - 247, /* (163) tagitem ::= MINUS INTEGER */ - 247, /* (164) tagitem ::= MINUS FLOAT */ - 247, /* (165) tagitem ::= PLUS INTEGER */ - 247, /* (166) tagitem ::= PLUS FLOAT */ - 245, /* (167) select ::= SELECT selcollist from where_opt interval_opt sliding_opt session_option windowstate_option fill_opt groupby_opt having_opt orderby_opt slimit_opt limit_opt */ - 245, /* (168) select ::= LP select RP */ - 261, /* (169) union ::= select */ - 261, /* (170) union ::= union UNION ALL select */ - 196, /* (171) cmd ::= union */ - 245, /* (172) select ::= SELECT selcollist */ - 262, /* (173) sclp ::= selcollist COMMA */ - 262, /* (174) sclp ::= */ - 248, /* (175) selcollist ::= sclp distinct expr as */ - 248, /* (176) selcollist ::= sclp STAR */ - 265, /* (177) as ::= AS ids */ - 265, /* (178) as ::= ids */ - 265, /* (179) as ::= */ - 263, /* (180) distinct ::= DISTINCT */ - 263, /* (181) distinct ::= */ - 249, /* (182) from ::= FROM tablelist */ - 249, /* (183) from ::= FROM sub */ - 267, /* (184) sub ::= LP union RP */ - 267, /* (185) sub ::= LP union RP ids */ - 267, /* (186) sub ::= sub COMMA LP union RP ids */ - 266, /* (187) tablelist ::= ids cpxName */ - 266, /* (188) tablelist ::= ids cpxName ids */ - 266, /* (189) tablelist ::= tablelist COMMA ids cpxName */ - 266, /* (190) tablelist ::= tablelist COMMA ids cpxName ids */ - 268, /* (191) tmvar ::= VARIABLE */ - 251, /* (192) interval_opt ::= INTERVAL LP tmvar RP */ - 251, /* (193) interval_opt ::= INTERVAL LP tmvar COMMA tmvar RP */ - 251, /* (194) interval_opt ::= */ - 253, /* (195) session_option ::= */ - 253, /* (196) session_option ::= SESSION LP ids cpxName COMMA tmvar RP */ - 254, /* (197) windowstate_option ::= */ - 254, /* (198) windowstate_option ::= STATE_WINDOW LP ids RP */ - 255, /* (199) fill_opt ::= */ - 255, /* (200) fill_opt ::= FILL LP ID COMMA tagitemlist RP */ - 255, /* (201) fill_opt ::= FILL LP ID RP */ - 252, /* (202) sliding_opt ::= SLIDING LP tmvar RP */ - 252, /* (203) sliding_opt ::= */ - 258, /* (204) orderby_opt ::= */ - 258, /* (205) orderby_opt ::= ORDER BY sortlist */ - 269, /* (206) sortlist ::= sortlist COMMA item sortorder */ - 269, /* (207) sortlist ::= item sortorder */ - 271, /* (208) item ::= ids cpxName */ - 272, /* (209) sortorder ::= ASC */ - 272, /* (210) sortorder ::= DESC */ - 272, /* (211) sortorder ::= */ - 256, /* (212) groupby_opt ::= */ - 256, /* (213) groupby_opt ::= GROUP BY grouplist */ - 273, /* (214) grouplist ::= grouplist COMMA item */ - 273, /* (215) grouplist ::= item */ - 257, /* (216) having_opt ::= */ - 257, /* (217) having_opt ::= HAVING expr */ - 260, /* (218) limit_opt ::= */ - 260, /* (219) limit_opt ::= LIMIT signed */ - 260, /* (220) limit_opt ::= LIMIT signed OFFSET signed */ - 260, /* (221) limit_opt ::= LIMIT signed COMMA signed */ - 259, /* (222) slimit_opt ::= */ - 259, /* (223) slimit_opt ::= SLIMIT signed */ - 259, /* (224) slimit_opt ::= SLIMIT signed SOFFSET signed */ - 259, /* (225) slimit_opt ::= SLIMIT signed COMMA signed */ - 250, /* (226) where_opt ::= */ - 250, /* (227) where_opt ::= WHERE expr */ - 264, /* (228) expr ::= LP expr RP */ - 264, /* (229) expr ::= ID */ - 264, /* (230) expr ::= ID DOT ID */ - 264, /* (231) expr ::= ID DOT STAR */ - 264, /* (232) expr ::= INTEGER */ - 264, /* (233) expr ::= MINUS INTEGER */ - 264, /* (234) expr ::= PLUS INTEGER */ - 264, /* (235) expr ::= FLOAT */ - 264, /* (236) expr ::= MINUS FLOAT */ - 264, /* (237) expr ::= PLUS FLOAT */ - 264, /* (238) expr ::= STRING */ - 264, /* (239) expr ::= NOW */ - 264, /* (240) expr ::= VARIABLE */ - 264, /* (241) expr ::= PLUS VARIABLE */ - 264, /* (242) expr ::= MINUS VARIABLE */ - 264, /* (243) expr ::= BOOL */ - 264, /* (244) expr ::= NULL */ - 264, /* (245) expr ::= ID LP exprlist RP */ - 264, /* (246) expr ::= ID LP STAR RP */ - 264, /* (247) expr ::= expr IS NULL */ - 264, /* (248) expr ::= expr IS NOT NULL */ - 264, /* (249) expr ::= expr LT expr */ - 264, /* (250) expr ::= expr GT expr */ - 264, /* (251) expr ::= expr LE expr */ - 264, /* (252) expr ::= expr GE expr */ - 264, /* (253) expr ::= expr NE expr */ - 264, /* (254) expr ::= expr EQ expr */ - 264, /* (255) expr ::= expr BETWEEN expr AND expr */ - 264, /* (256) expr ::= expr AND expr */ - 264, /* (257) expr ::= expr OR expr */ - 264, /* (258) expr ::= expr PLUS expr */ - 264, /* (259) expr ::= expr MINUS expr */ - 264, /* (260) expr ::= expr STAR expr */ - 264, /* (261) expr ::= expr SLASH expr */ - 264, /* (262) expr ::= expr REM expr */ - 264, /* (263) expr ::= expr LIKE expr */ - 264, /* (264) expr ::= expr IN LP exprlist RP */ - 204, /* (265) exprlist ::= exprlist COMMA expritem */ - 204, /* (266) exprlist ::= expritem */ - 274, /* (267) expritem ::= expr */ - 274, /* (268) expritem ::= */ - 196, /* (269) cmd ::= RESET QUERY CACHE */ - 196, /* (270) cmd ::= SYNCDB ids REPLICA */ - 196, /* (271) cmd ::= ALTER TABLE ids cpxName ADD COLUMN columnlist */ - 196, /* (272) cmd ::= ALTER TABLE ids cpxName DROP COLUMN ids */ - 196, /* (273) cmd ::= ALTER TABLE ids cpxName MODIFY COLUMN columnlist */ - 196, /* (274) cmd ::= ALTER TABLE ids cpxName ADD TAG columnlist */ - 196, /* (275) cmd ::= ALTER TABLE ids cpxName DROP TAG ids */ - 196, /* (276) cmd ::= ALTER TABLE ids cpxName CHANGE TAG ids ids */ - 196, /* (277) cmd ::= ALTER TABLE ids cpxName SET TAG ids EQ tagitem */ - 196, /* (278) cmd ::= ALTER TABLE ids cpxName MODIFY TAG columnlist */ - 196, /* (279) cmd ::= ALTER STABLE ids cpxName ADD COLUMN columnlist */ - 196, /* (280) cmd ::= ALTER STABLE ids cpxName DROP COLUMN ids */ - 196, /* (281) cmd ::= ALTER STABLE ids cpxName MODIFY COLUMN columnlist */ - 196, /* (282) cmd ::= ALTER STABLE ids cpxName ADD TAG columnlist */ - 196, /* (283) cmd ::= ALTER STABLE ids cpxName DROP TAG ids */ - 196, /* (284) cmd ::= ALTER STABLE ids cpxName CHANGE TAG ids ids */ - 196, /* (285) cmd ::= ALTER STABLE ids cpxName SET TAG ids EQ tagitem */ - 196, /* (286) cmd ::= ALTER STABLE ids cpxName MODIFY TAG columnlist */ - 196, /* (287) cmd ::= KILL CONNECTION INTEGER */ - 196, /* (288) cmd ::= KILL STREAM INTEGER COLON INTEGER */ - 196, /* (289) cmd ::= KILL QUERY INTEGER COLON INTEGER */ -}; - -/* For rule J, yyRuleInfoNRhs[J] contains the negative of the number -** of symbols on the right-hand side of that rule. */ -static const signed char yyRuleInfoNRhs[] = { - -1, /* (0) program ::= cmd */ - -2, /* (1) cmd ::= SHOW DATABASES */ - -2, /* (2) cmd ::= SHOW TOPICS */ - -2, /* (3) cmd ::= SHOW FUNCTIONS */ - -2, /* (4) cmd ::= SHOW MNODES */ - -2, /* (5) cmd ::= SHOW DNODES */ - -2, /* (6) cmd ::= SHOW ACCOUNTS */ - -2, /* (7) cmd ::= SHOW USERS */ - -2, /* (8) cmd ::= SHOW MODULES */ - -2, /* (9) cmd ::= SHOW QUERIES */ - -2, /* (10) cmd ::= SHOW CONNECTIONS */ - -2, /* (11) cmd ::= SHOW STREAMS */ - -2, /* (12) cmd ::= SHOW VARIABLES */ - -2, /* (13) cmd ::= SHOW SCORES */ - -2, /* (14) cmd ::= SHOW GRANTS */ - -2, /* (15) cmd ::= SHOW VNODES */ - -3, /* (16) cmd ::= SHOW VNODES ids */ - 0, /* (17) dbPrefix ::= */ - -2, /* (18) dbPrefix ::= ids DOT */ - 0, /* (19) cpxName ::= */ - -2, /* (20) cpxName ::= DOT ids */ - -5, /* (21) cmd ::= SHOW CREATE TABLE ids cpxName */ - -5, /* (22) cmd ::= SHOW CREATE STABLE ids cpxName */ - -4, /* (23) cmd ::= SHOW CREATE DATABASE ids */ - -3, /* (24) cmd ::= SHOW dbPrefix TABLES */ - -5, /* (25) cmd ::= SHOW dbPrefix TABLES LIKE ids */ - -3, /* (26) cmd ::= SHOW dbPrefix STABLES */ - -5, /* (27) cmd ::= SHOW dbPrefix STABLES LIKE ids */ - -3, /* (28) cmd ::= SHOW dbPrefix VGROUPS */ - -4, /* (29) cmd ::= SHOW dbPrefix VGROUPS ids */ - -5, /* (30) cmd ::= DROP TABLE ifexists ids cpxName */ - -5, /* (31) cmd ::= DROP STABLE ifexists ids cpxName */ - -4, /* (32) cmd ::= DROP DATABASE ifexists ids */ - -4, /* (33) cmd ::= DROP TOPIC ifexists ids */ - -3, /* (34) cmd ::= DROP FUNCTION ids */ - -3, /* (35) cmd ::= DROP DNODE ids */ - -3, /* (36) cmd ::= DROP USER ids */ - -3, /* (37) cmd ::= DROP ACCOUNT ids */ - -2, /* (38) cmd ::= USE ids */ - -3, /* (39) cmd ::= DESCRIBE ids cpxName */ - -3, /* (40) cmd ::= DESC ids cpxName */ - -5, /* (41) cmd ::= ALTER USER ids PASS ids */ - -5, /* (42) cmd ::= ALTER USER ids PRIVILEGE ids */ - -4, /* (43) cmd ::= ALTER DNODE ids ids */ - -5, /* (44) cmd ::= ALTER DNODE ids ids ids */ - -3, /* (45) cmd ::= ALTER LOCAL ids */ - -4, /* (46) cmd ::= ALTER LOCAL ids ids */ - -4, /* (47) cmd ::= ALTER DATABASE ids alter_db_optr */ - -4, /* (48) cmd ::= ALTER TOPIC ids alter_topic_optr */ - -4, /* (49) cmd ::= ALTER ACCOUNT ids acct_optr */ - -6, /* (50) cmd ::= ALTER ACCOUNT ids PASS ids acct_optr */ - -6, /* (51) cmd ::= COMPACT VNODES IN LP exprlist RP */ - -1, /* (52) ids ::= ID */ - -1, /* (53) ids ::= STRING */ - -2, /* (54) ifexists ::= IF EXISTS */ - 0, /* (55) ifexists ::= */ - -3, /* (56) ifnotexists ::= IF NOT EXISTS */ - 0, /* (57) ifnotexists ::= */ - -3, /* (58) cmd ::= CREATE DNODE ids */ - -6, /* (59) cmd ::= CREATE ACCOUNT ids PASS ids acct_optr */ - -5, /* (60) cmd ::= CREATE DATABASE ifnotexists ids db_optr */ - -5, /* (61) cmd ::= CREATE TOPIC ifnotexists ids topic_optr */ - -8, /* (62) cmd ::= CREATE FUNCTION ids AS ids OUTPUTTYPE typename bufsize */ - -9, /* (63) cmd ::= CREATE AGGREGATE FUNCTION ids AS ids OUTPUTTYPE typename bufsize */ - -5, /* (64) cmd ::= CREATE USER ids PASS ids */ - 0, /* (65) bufsize ::= */ - -2, /* (66) bufsize ::= BUFSIZE INTEGER */ - 0, /* (67) pps ::= */ - -2, /* (68) pps ::= PPS INTEGER */ - 0, /* (69) tseries ::= */ - -2, /* (70) tseries ::= TSERIES INTEGER */ - 0, /* (71) dbs ::= */ - -2, /* (72) dbs ::= DBS INTEGER */ - 0, /* (73) streams ::= */ - -2, /* (74) streams ::= STREAMS INTEGER */ - 0, /* (75) storage ::= */ - -2, /* (76) storage ::= STORAGE INTEGER */ - 0, /* (77) qtime ::= */ - -2, /* (78) qtime ::= QTIME INTEGER */ - 0, /* (79) users ::= */ - -2, /* (80) users ::= USERS INTEGER */ - 0, /* (81) conns ::= */ - -2, /* (82) conns ::= CONNS INTEGER */ - 0, /* (83) state ::= */ - -2, /* (84) state ::= STATE ids */ - -9, /* (85) acct_optr ::= pps tseries storage streams qtime dbs users conns state */ - -3, /* (86) intitemlist ::= intitemlist COMMA intitem */ - -1, /* (87) intitemlist ::= intitem */ - -1, /* (88) intitem ::= INTEGER */ - -2, /* (89) keep ::= KEEP intitemlist */ - -2, /* (90) cache ::= CACHE INTEGER */ - -2, /* (91) replica ::= REPLICA INTEGER */ - -2, /* (92) quorum ::= QUORUM INTEGER */ - -2, /* (93) days ::= DAYS INTEGER */ - -2, /* (94) minrows ::= MINROWS INTEGER */ - -2, /* (95) maxrows ::= MAXROWS INTEGER */ - -2, /* (96) blocks ::= BLOCKS INTEGER */ - -2, /* (97) ctime ::= CTIME INTEGER */ - -2, /* (98) wal ::= WAL INTEGER */ - -2, /* (99) fsync ::= FSYNC INTEGER */ - -2, /* (100) comp ::= COMP INTEGER */ - -2, /* (101) prec ::= PRECISION STRING */ - -2, /* (102) update ::= UPDATE INTEGER */ - -2, /* (103) cachelast ::= CACHELAST INTEGER */ - -2, /* (104) partitions ::= PARTITIONS INTEGER */ - 0, /* (105) db_optr ::= */ - -2, /* (106) db_optr ::= db_optr cache */ - -2, /* (107) db_optr ::= db_optr replica */ - -2, /* (108) db_optr ::= db_optr quorum */ - -2, /* (109) db_optr ::= db_optr days */ - -2, /* (110) db_optr ::= db_optr minrows */ - -2, /* (111) db_optr ::= db_optr maxrows */ - -2, /* (112) db_optr ::= db_optr blocks */ - -2, /* (113) db_optr ::= db_optr ctime */ - -2, /* (114) db_optr ::= db_optr wal */ - -2, /* (115) db_optr ::= db_optr fsync */ - -2, /* (116) db_optr ::= db_optr comp */ - -2, /* (117) db_optr ::= db_optr prec */ - -2, /* (118) db_optr ::= db_optr keep */ - -2, /* (119) db_optr ::= db_optr update */ - -2, /* (120) db_optr ::= db_optr cachelast */ - -1, /* (121) topic_optr ::= db_optr */ - -2, /* (122) topic_optr ::= topic_optr partitions */ - 0, /* (123) alter_db_optr ::= */ - -2, /* (124) alter_db_optr ::= alter_db_optr replica */ - -2, /* (125) alter_db_optr ::= alter_db_optr quorum */ - -2, /* (126) alter_db_optr ::= alter_db_optr keep */ - -2, /* (127) alter_db_optr ::= alter_db_optr blocks */ - -2, /* (128) alter_db_optr ::= alter_db_optr comp */ - -2, /* (129) alter_db_optr ::= alter_db_optr update */ - -2, /* (130) alter_db_optr ::= alter_db_optr cachelast */ - -1, /* (131) alter_topic_optr ::= alter_db_optr */ - -2, /* (132) alter_topic_optr ::= alter_topic_optr partitions */ - -1, /* (133) typename ::= ids */ - -4, /* (134) typename ::= ids LP signed RP */ - -2, /* (135) typename ::= ids UNSIGNED */ - -1, /* (136) signed ::= INTEGER */ - -2, /* (137) signed ::= PLUS INTEGER */ - -2, /* (138) signed ::= MINUS INTEGER */ - -3, /* (139) cmd ::= CREATE TABLE create_table_args */ - -3, /* (140) cmd ::= CREATE TABLE create_stable_args */ - -3, /* (141) cmd ::= CREATE STABLE create_stable_args */ - -3, /* (142) cmd ::= CREATE TABLE create_table_list */ - -1, /* (143) create_table_list ::= create_from_stable */ - -2, /* (144) create_table_list ::= create_table_list create_from_stable */ - -6, /* (145) create_table_args ::= ifnotexists ids cpxName LP columnlist RP */ - -10, /* (146) create_stable_args ::= ifnotexists ids cpxName LP columnlist RP TAGS LP columnlist RP */ - -10, /* (147) create_from_stable ::= ifnotexists ids cpxName USING ids cpxName TAGS LP tagitemlist RP */ - -13, /* (148) create_from_stable ::= ifnotexists ids cpxName USING ids cpxName LP tagNamelist RP TAGS LP tagitemlist RP */ - -3, /* (149) tagNamelist ::= tagNamelist COMMA ids */ - -1, /* (150) tagNamelist ::= ids */ - -5, /* (151) create_table_args ::= ifnotexists ids cpxName AS select */ - -3, /* (152) columnlist ::= columnlist COMMA column */ - -1, /* (153) columnlist ::= column */ - -2, /* (154) column ::= ids typename */ - -3, /* (155) tagitemlist ::= tagitemlist COMMA tagitem */ - -1, /* (156) tagitemlist ::= tagitem */ - -1, /* (157) tagitem ::= INTEGER */ - -1, /* (158) tagitem ::= FLOAT */ - -1, /* (159) tagitem ::= STRING */ - -1, /* (160) tagitem ::= BOOL */ - -1, /* (161) tagitem ::= NULL */ - -1, /* (162) tagitem ::= NOW */ - -2, /* (163) tagitem ::= MINUS INTEGER */ - -2, /* (164) tagitem ::= MINUS FLOAT */ - -2, /* (165) tagitem ::= PLUS INTEGER */ - -2, /* (166) tagitem ::= PLUS FLOAT */ - -14, /* (167) select ::= SELECT selcollist from where_opt interval_opt sliding_opt session_option windowstate_option fill_opt groupby_opt having_opt orderby_opt slimit_opt limit_opt */ - -3, /* (168) select ::= LP select RP */ - -1, /* (169) union ::= select */ - -4, /* (170) union ::= union UNION ALL select */ - -1, /* (171) cmd ::= union */ - -2, /* (172) select ::= SELECT selcollist */ - -2, /* (173) sclp ::= selcollist COMMA */ - 0, /* (174) sclp ::= */ - -4, /* (175) selcollist ::= sclp distinct expr as */ - -2, /* (176) selcollist ::= sclp STAR */ - -2, /* (177) as ::= AS ids */ - -1, /* (178) as ::= ids */ - 0, /* (179) as ::= */ - -1, /* (180) distinct ::= DISTINCT */ - 0, /* (181) distinct ::= */ - -2, /* (182) from ::= FROM tablelist */ - -2, /* (183) from ::= FROM sub */ - -3, /* (184) sub ::= LP union RP */ - -4, /* (185) sub ::= LP union RP ids */ - -6, /* (186) sub ::= sub COMMA LP union RP ids */ - -2, /* (187) tablelist ::= ids cpxName */ - -3, /* (188) tablelist ::= ids cpxName ids */ - -4, /* (189) tablelist ::= tablelist COMMA ids cpxName */ - -5, /* (190) tablelist ::= tablelist COMMA ids cpxName ids */ - -1, /* (191) tmvar ::= VARIABLE */ - -4, /* (192) interval_opt ::= INTERVAL LP tmvar RP */ - -6, /* (193) interval_opt ::= INTERVAL LP tmvar COMMA tmvar RP */ - 0, /* (194) interval_opt ::= */ - 0, /* (195) session_option ::= */ - -7, /* (196) session_option ::= SESSION LP ids cpxName COMMA tmvar RP */ - 0, /* (197) windowstate_option ::= */ - -4, /* (198) windowstate_option ::= STATE_WINDOW LP ids RP */ - 0, /* (199) fill_opt ::= */ - -6, /* (200) fill_opt ::= FILL LP ID COMMA tagitemlist RP */ - -4, /* (201) fill_opt ::= FILL LP ID RP */ - -4, /* (202) sliding_opt ::= SLIDING LP tmvar RP */ - 0, /* (203) sliding_opt ::= */ - 0, /* (204) orderby_opt ::= */ - -3, /* (205) orderby_opt ::= ORDER BY sortlist */ - -4, /* (206) sortlist ::= sortlist COMMA item sortorder */ - -2, /* (207) sortlist ::= item sortorder */ - -2, /* (208) item ::= ids cpxName */ - -1, /* (209) sortorder ::= ASC */ - -1, /* (210) sortorder ::= DESC */ - 0, /* (211) sortorder ::= */ - 0, /* (212) groupby_opt ::= */ - -3, /* (213) groupby_opt ::= GROUP BY grouplist */ - -3, /* (214) grouplist ::= grouplist COMMA item */ - -1, /* (215) grouplist ::= item */ - 0, /* (216) having_opt ::= */ - -2, /* (217) having_opt ::= HAVING expr */ - 0, /* (218) limit_opt ::= */ - -2, /* (219) limit_opt ::= LIMIT signed */ - -4, /* (220) limit_opt ::= LIMIT signed OFFSET signed */ - -4, /* (221) limit_opt ::= LIMIT signed COMMA signed */ - 0, /* (222) slimit_opt ::= */ - -2, /* (223) slimit_opt ::= SLIMIT signed */ - -4, /* (224) slimit_opt ::= SLIMIT signed SOFFSET signed */ - -4, /* (225) slimit_opt ::= SLIMIT signed COMMA signed */ - 0, /* (226) where_opt ::= */ - -2, /* (227) where_opt ::= WHERE expr */ - -3, /* (228) expr ::= LP expr RP */ - -1, /* (229) expr ::= ID */ - -3, /* (230) expr ::= ID DOT ID */ - -3, /* (231) expr ::= ID DOT STAR */ - -1, /* (232) expr ::= INTEGER */ - -2, /* (233) expr ::= MINUS INTEGER */ - -2, /* (234) expr ::= PLUS INTEGER */ - -1, /* (235) expr ::= FLOAT */ - -2, /* (236) expr ::= MINUS FLOAT */ - -2, /* (237) expr ::= PLUS FLOAT */ - -1, /* (238) expr ::= STRING */ - -1, /* (239) expr ::= NOW */ - -1, /* (240) expr ::= VARIABLE */ - -2, /* (241) expr ::= PLUS VARIABLE */ - -2, /* (242) expr ::= MINUS VARIABLE */ - -1, /* (243) expr ::= BOOL */ - -1, /* (244) expr ::= NULL */ - -4, /* (245) expr ::= ID LP exprlist RP */ - -4, /* (246) expr ::= ID LP STAR RP */ - -3, /* (247) expr ::= expr IS NULL */ - -4, /* (248) expr ::= expr IS NOT NULL */ - -3, /* (249) expr ::= expr LT expr */ - -3, /* (250) expr ::= expr GT expr */ - -3, /* (251) expr ::= expr LE expr */ - -3, /* (252) expr ::= expr GE expr */ - -3, /* (253) expr ::= expr NE expr */ - -3, /* (254) expr ::= expr EQ expr */ - -5, /* (255) expr ::= expr BETWEEN expr AND expr */ - -3, /* (256) expr ::= expr AND expr */ - -3, /* (257) expr ::= expr OR expr */ - -3, /* (258) expr ::= expr PLUS expr */ - -3, /* (259) expr ::= expr MINUS expr */ - -3, /* (260) expr ::= expr STAR expr */ - -3, /* (261) expr ::= expr SLASH expr */ - -3, /* (262) expr ::= expr REM expr */ - -3, /* (263) expr ::= expr LIKE expr */ - -5, /* (264) expr ::= expr IN LP exprlist RP */ - -3, /* (265) exprlist ::= exprlist COMMA expritem */ - -1, /* (266) exprlist ::= expritem */ - -1, /* (267) expritem ::= expr */ - 0, /* (268) expritem ::= */ - -3, /* (269) cmd ::= RESET QUERY CACHE */ - -3, /* (270) cmd ::= SYNCDB ids REPLICA */ - -7, /* (271) cmd ::= ALTER TABLE ids cpxName ADD COLUMN columnlist */ - -7, /* (272) cmd ::= ALTER TABLE ids cpxName DROP COLUMN ids */ - -7, /* (273) cmd ::= ALTER TABLE ids cpxName MODIFY COLUMN columnlist */ - -7, /* (274) cmd ::= ALTER TABLE ids cpxName ADD TAG columnlist */ - -7, /* (275) cmd ::= ALTER TABLE ids cpxName DROP TAG ids */ - -8, /* (276) cmd ::= ALTER TABLE ids cpxName CHANGE TAG ids ids */ - -9, /* (277) cmd ::= ALTER TABLE ids cpxName SET TAG ids EQ tagitem */ - -7, /* (278) cmd ::= ALTER TABLE ids cpxName MODIFY TAG columnlist */ - -7, /* (279) cmd ::= ALTER STABLE ids cpxName ADD COLUMN columnlist */ - -7, /* (280) cmd ::= ALTER STABLE ids cpxName DROP COLUMN ids */ - -7, /* (281) cmd ::= ALTER STABLE ids cpxName MODIFY COLUMN columnlist */ - -7, /* (282) cmd ::= ALTER STABLE ids cpxName ADD TAG columnlist */ - -7, /* (283) cmd ::= ALTER STABLE ids cpxName DROP TAG ids */ - -8, /* (284) cmd ::= ALTER STABLE ids cpxName CHANGE TAG ids ids */ - -9, /* (285) cmd ::= ALTER STABLE ids cpxName SET TAG ids EQ tagitem */ - -7, /* (286) cmd ::= ALTER STABLE ids cpxName MODIFY TAG columnlist */ - -3, /* (287) cmd ::= KILL CONNECTION INTEGER */ - -5, /* (288) cmd ::= KILL STREAM INTEGER COLON INTEGER */ - -5, /* (289) cmd ::= KILL QUERY INTEGER COLON INTEGER */ +/* The following table contains information about every rule that +** is used during the reduce. +*/ +static const struct { + YYCODETYPE lhs; /* Symbol on the left-hand side of the rule */ + signed char nrhs; /* Negative of the number of RHS symbols in the rule */ +} yyRuleInfo[] = { + { 197, -1 }, /* (0) program ::= cmd */ + { 198, -2 }, /* (1) cmd ::= SHOW DATABASES */ + { 198, -2 }, /* (2) cmd ::= SHOW TOPICS */ + { 198, -2 }, /* (3) cmd ::= SHOW FUNCTIONS */ + { 198, -2 }, /* (4) cmd ::= SHOW MNODES */ + { 198, -2 }, /* (5) cmd ::= SHOW DNODES */ + { 198, -2 }, /* (6) cmd ::= SHOW ACCOUNTS */ + { 198, -2 }, /* (7) cmd ::= SHOW USERS */ + { 198, -2 }, /* (8) cmd ::= SHOW MODULES */ + { 198, -2 }, /* (9) cmd ::= SHOW QUERIES */ + { 198, -2 }, /* (10) cmd ::= SHOW CONNECTIONS */ + { 198, -2 }, /* (11) cmd ::= SHOW STREAMS */ + { 198, -2 }, /* (12) cmd ::= SHOW VARIABLES */ + { 198, -2 }, /* (13) cmd ::= SHOW SCORES */ + { 198, -2 }, /* (14) cmd ::= SHOW GRANTS */ + { 198, -2 }, /* (15) cmd ::= SHOW VNODES */ + { 198, -3 }, /* (16) cmd ::= SHOW VNODES ids */ + { 200, 0 }, /* (17) dbPrefix ::= */ + { 200, -2 }, /* (18) dbPrefix ::= ids DOT */ + { 201, 0 }, /* (19) cpxName ::= */ + { 201, -2 }, /* (20) cpxName ::= DOT ids */ + { 198, -5 }, /* (21) cmd ::= SHOW CREATE TABLE ids cpxName */ + { 198, -5 }, /* (22) cmd ::= SHOW CREATE STABLE ids cpxName */ + { 198, -4 }, /* (23) cmd ::= SHOW CREATE DATABASE ids */ + { 198, -3 }, /* (24) cmd ::= SHOW dbPrefix TABLES */ + { 198, -5 }, /* (25) cmd ::= SHOW dbPrefix TABLES LIKE ids */ + { 198, -3 }, /* (26) cmd ::= SHOW dbPrefix STABLES */ + { 198, -5 }, /* (27) cmd ::= SHOW dbPrefix STABLES LIKE ids */ + { 198, -3 }, /* (28) cmd ::= SHOW dbPrefix VGROUPS */ + { 198, -4 }, /* (29) cmd ::= SHOW dbPrefix VGROUPS ids */ + { 198, -5 }, /* (30) cmd ::= DROP TABLE ifexists ids cpxName */ + { 198, -5 }, /* (31) cmd ::= DROP STABLE ifexists ids cpxName */ + { 198, -4 }, /* (32) cmd ::= DROP DATABASE ifexists ids */ + { 198, -4 }, /* (33) cmd ::= DROP TOPIC ifexists ids */ + { 198, -3 }, /* (34) cmd ::= DROP FUNCTION ids */ + { 198, -3 }, /* (35) cmd ::= DROP DNODE ids */ + { 198, -3 }, /* (36) cmd ::= DROP USER ids */ + { 198, -3 }, /* (37) cmd ::= DROP ACCOUNT ids */ + { 198, -2 }, /* (38) cmd ::= USE ids */ + { 198, -3 }, /* (39) cmd ::= DESCRIBE ids cpxName */ + { 198, -3 }, /* (40) cmd ::= DESC ids cpxName */ + { 198, -5 }, /* (41) cmd ::= ALTER USER ids PASS ids */ + { 198, -5 }, /* (42) cmd ::= ALTER USER ids PRIVILEGE ids */ + { 198, -4 }, /* (43) cmd ::= ALTER DNODE ids ids */ + { 198, -5 }, /* (44) cmd ::= ALTER DNODE ids ids ids */ + { 198, -3 }, /* (45) cmd ::= ALTER LOCAL ids */ + { 198, -4 }, /* (46) cmd ::= ALTER LOCAL ids ids */ + { 198, -4 }, /* (47) cmd ::= ALTER DATABASE ids alter_db_optr */ + { 198, -4 }, /* (48) cmd ::= ALTER TOPIC ids alter_topic_optr */ + { 198, -4 }, /* (49) cmd ::= ALTER ACCOUNT ids acct_optr */ + { 198, -6 }, /* (50) cmd ::= ALTER ACCOUNT ids PASS ids acct_optr */ + { 198, -6 }, /* (51) cmd ::= COMPACT VNODES IN LP exprlist RP */ + { 199, -1 }, /* (52) ids ::= ID */ + { 199, -1 }, /* (53) ids ::= STRING */ + { 202, -2 }, /* (54) ifexists ::= IF EXISTS */ + { 202, 0 }, /* (55) ifexists ::= */ + { 207, -3 }, /* (56) ifnotexists ::= IF NOT EXISTS */ + { 207, 0 }, /* (57) ifnotexists ::= */ + { 198, -3 }, /* (58) cmd ::= CREATE DNODE ids */ + { 198, -6 }, /* (59) cmd ::= CREATE ACCOUNT ids PASS ids acct_optr */ + { 198, -5 }, /* (60) cmd ::= CREATE DATABASE ifnotexists ids db_optr */ + { 198, -5 }, /* (61) cmd ::= CREATE TOPIC ifnotexists ids topic_optr */ + { 198, -8 }, /* (62) cmd ::= CREATE FUNCTION ids AS ids OUTPUTTYPE typename bufsize */ + { 198, -9 }, /* (63) cmd ::= CREATE AGGREGATE FUNCTION ids AS ids OUTPUTTYPE typename bufsize */ + { 198, -5 }, /* (64) cmd ::= CREATE USER ids PASS ids */ + { 211, 0 }, /* (65) bufsize ::= */ + { 211, -2 }, /* (66) bufsize ::= BUFSIZE INTEGER */ + { 212, 0 }, /* (67) pps ::= */ + { 212, -2 }, /* (68) pps ::= PPS INTEGER */ + { 213, 0 }, /* (69) tseries ::= */ + { 213, -2 }, /* (70) tseries ::= TSERIES INTEGER */ + { 214, 0 }, /* (71) dbs ::= */ + { 214, -2 }, /* (72) dbs ::= DBS INTEGER */ + { 215, 0 }, /* (73) streams ::= */ + { 215, -2 }, /* (74) streams ::= STREAMS INTEGER */ + { 216, 0 }, /* (75) storage ::= */ + { 216, -2 }, /* (76) storage ::= STORAGE INTEGER */ + { 217, 0 }, /* (77) qtime ::= */ + { 217, -2 }, /* (78) qtime ::= QTIME INTEGER */ + { 218, 0 }, /* (79) users ::= */ + { 218, -2 }, /* (80) users ::= USERS INTEGER */ + { 219, 0 }, /* (81) conns ::= */ + { 219, -2 }, /* (82) conns ::= CONNS INTEGER */ + { 220, 0 }, /* (83) state ::= */ + { 220, -2 }, /* (84) state ::= STATE ids */ + { 205, -9 }, /* (85) acct_optr ::= pps tseries storage streams qtime dbs users conns state */ + { 221, -3 }, /* (86) intitemlist ::= intitemlist COMMA intitem */ + { 221, -1 }, /* (87) intitemlist ::= intitem */ + { 222, -1 }, /* (88) intitem ::= INTEGER */ + { 223, -2 }, /* (89) keep ::= KEEP intitemlist */ + { 224, -2 }, /* (90) cache ::= CACHE INTEGER */ + { 225, -2 }, /* (91) replica ::= REPLICA INTEGER */ + { 226, -2 }, /* (92) quorum ::= QUORUM INTEGER */ + { 227, -2 }, /* (93) days ::= DAYS INTEGER */ + { 228, -2 }, /* (94) minrows ::= MINROWS INTEGER */ + { 229, -2 }, /* (95) maxrows ::= MAXROWS INTEGER */ + { 230, -2 }, /* (96) blocks ::= BLOCKS INTEGER */ + { 231, -2 }, /* (97) ctime ::= CTIME INTEGER */ + { 232, -2 }, /* (98) wal ::= WAL INTEGER */ + { 233, -2 }, /* (99) fsync ::= FSYNC INTEGER */ + { 234, -2 }, /* (100) comp ::= COMP INTEGER */ + { 235, -2 }, /* (101) prec ::= PRECISION STRING */ + { 236, -2 }, /* (102) update ::= UPDATE INTEGER */ + { 237, -2 }, /* (103) cachelast ::= CACHELAST INTEGER */ + { 238, -2 }, /* (104) partitions ::= PARTITIONS INTEGER */ + { 208, 0 }, /* (105) db_optr ::= */ + { 208, -2 }, /* (106) db_optr ::= db_optr cache */ + { 208, -2 }, /* (107) db_optr ::= db_optr replica */ + { 208, -2 }, /* (108) db_optr ::= db_optr quorum */ + { 208, -2 }, /* (109) db_optr ::= db_optr days */ + { 208, -2 }, /* (110) db_optr ::= db_optr minrows */ + { 208, -2 }, /* (111) db_optr ::= db_optr maxrows */ + { 208, -2 }, /* (112) db_optr ::= db_optr blocks */ + { 208, -2 }, /* (113) db_optr ::= db_optr ctime */ + { 208, -2 }, /* (114) db_optr ::= db_optr wal */ + { 208, -2 }, /* (115) db_optr ::= db_optr fsync */ + { 208, -2 }, /* (116) db_optr ::= db_optr comp */ + { 208, -2 }, /* (117) db_optr ::= db_optr prec */ + { 208, -2 }, /* (118) db_optr ::= db_optr keep */ + { 208, -2 }, /* (119) db_optr ::= db_optr update */ + { 208, -2 }, /* (120) db_optr ::= db_optr cachelast */ + { 209, -1 }, /* (121) topic_optr ::= db_optr */ + { 209, -2 }, /* (122) topic_optr ::= topic_optr partitions */ + { 203, 0 }, /* (123) alter_db_optr ::= */ + { 203, -2 }, /* (124) alter_db_optr ::= alter_db_optr replica */ + { 203, -2 }, /* (125) alter_db_optr ::= alter_db_optr quorum */ + { 203, -2 }, /* (126) alter_db_optr ::= alter_db_optr keep */ + { 203, -2 }, /* (127) alter_db_optr ::= alter_db_optr blocks */ + { 203, -2 }, /* (128) alter_db_optr ::= alter_db_optr comp */ + { 203, -2 }, /* (129) alter_db_optr ::= alter_db_optr update */ + { 203, -2 }, /* (130) alter_db_optr ::= alter_db_optr cachelast */ + { 204, -1 }, /* (131) alter_topic_optr ::= alter_db_optr */ + { 204, -2 }, /* (132) alter_topic_optr ::= alter_topic_optr partitions */ + { 210, -1 }, /* (133) typename ::= ids */ + { 210, -4 }, /* (134) typename ::= ids LP signed RP */ + { 210, -2 }, /* (135) typename ::= ids UNSIGNED */ + { 239, -1 }, /* (136) signed ::= INTEGER */ + { 239, -2 }, /* (137) signed ::= PLUS INTEGER */ + { 239, -2 }, /* (138) signed ::= MINUS INTEGER */ + { 198, -3 }, /* (139) cmd ::= CREATE TABLE create_table_args */ + { 198, -3 }, /* (140) cmd ::= CREATE TABLE create_stable_args */ + { 198, -3 }, /* (141) cmd ::= CREATE STABLE create_stable_args */ + { 198, -3 }, /* (142) cmd ::= CREATE TABLE create_table_list */ + { 242, -1 }, /* (143) create_table_list ::= create_from_stable */ + { 242, -2 }, /* (144) create_table_list ::= create_table_list create_from_stable */ + { 240, -6 }, /* (145) create_table_args ::= ifnotexists ids cpxName LP columnlist RP */ + { 241, -10 }, /* (146) create_stable_args ::= ifnotexists ids cpxName LP columnlist RP TAGS LP columnlist RP */ + { 243, -10 }, /* (147) create_from_stable ::= ifnotexists ids cpxName USING ids cpxName TAGS LP tagitemlist RP */ + { 243, -13 }, /* (148) create_from_stable ::= ifnotexists ids cpxName USING ids cpxName LP tagNamelist RP TAGS LP tagitemlist RP */ + { 246, -3 }, /* (149) tagNamelist ::= tagNamelist COMMA ids */ + { 246, -1 }, /* (150) tagNamelist ::= ids */ + { 240, -5 }, /* (151) create_table_args ::= ifnotexists ids cpxName AS select */ + { 244, -3 }, /* (152) columnlist ::= columnlist COMMA column */ + { 244, -1 }, /* (153) columnlist ::= column */ + { 248, -2 }, /* (154) column ::= ids typename */ + { 245, -3 }, /* (155) tagitemlist ::= tagitemlist COMMA tagitem */ + { 245, -1 }, /* (156) tagitemlist ::= tagitem */ + { 249, -1 }, /* (157) tagitem ::= INTEGER */ + { 249, -1 }, /* (158) tagitem ::= FLOAT */ + { 249, -1 }, /* (159) tagitem ::= STRING */ + { 249, -1 }, /* (160) tagitem ::= BOOL */ + { 249, -1 }, /* (161) tagitem ::= NULL */ + { 249, -1 }, /* (162) tagitem ::= NOW */ + { 249, -2 }, /* (163) tagitem ::= MINUS INTEGER */ + { 249, -2 }, /* (164) tagitem ::= MINUS FLOAT */ + { 249, -2 }, /* (165) tagitem ::= PLUS INTEGER */ + { 249, -2 }, /* (166) tagitem ::= PLUS FLOAT */ + { 247, -14 }, /* (167) select ::= SELECT selcollist from where_opt interval_option sliding_opt session_option windowstate_option fill_opt groupby_opt having_opt orderby_opt slimit_opt limit_opt */ + { 247, -3 }, /* (168) select ::= LP select RP */ + { 263, -1 }, /* (169) union ::= select */ + { 263, -4 }, /* (170) union ::= union UNION ALL select */ + { 198, -1 }, /* (171) cmd ::= union */ + { 247, -2 }, /* (172) select ::= SELECT selcollist */ + { 264, -2 }, /* (173) sclp ::= selcollist COMMA */ + { 264, 0 }, /* (174) sclp ::= */ + { 250, -4 }, /* (175) selcollist ::= sclp distinct expr as */ + { 250, -2 }, /* (176) selcollist ::= sclp STAR */ + { 267, -2 }, /* (177) as ::= AS ids */ + { 267, -1 }, /* (178) as ::= ids */ + { 267, 0 }, /* (179) as ::= */ + { 265, -1 }, /* (180) distinct ::= DISTINCT */ + { 265, 0 }, /* (181) distinct ::= */ + { 251, -2 }, /* (182) from ::= FROM tablelist */ + { 251, -2 }, /* (183) from ::= FROM sub */ + { 269, -3 }, /* (184) sub ::= LP union RP */ + { 269, -4 }, /* (185) sub ::= LP union RP ids */ + { 269, -6 }, /* (186) sub ::= sub COMMA LP union RP ids */ + { 268, -2 }, /* (187) tablelist ::= ids cpxName */ + { 268, -3 }, /* (188) tablelist ::= ids cpxName ids */ + { 268, -4 }, /* (189) tablelist ::= tablelist COMMA ids cpxName */ + { 268, -5 }, /* (190) tablelist ::= tablelist COMMA ids cpxName ids */ + { 270, -1 }, /* (191) tmvar ::= VARIABLE */ + { 253, -4 }, /* (192) interval_option ::= intervalKey LP tmvar RP */ + { 253, -6 }, /* (193) interval_option ::= intervalKey LP tmvar COMMA tmvar RP */ + { 253, 0 }, /* (194) interval_option ::= */ + { 271, -1 }, /* (195) intervalKey ::= INTERVAL */ + { 271, -1 }, /* (196) intervalKey ::= EVERY */ + { 255, 0 }, /* (197) session_option ::= */ + { 255, -7 }, /* (198) session_option ::= SESSION LP ids cpxName COMMA tmvar RP */ + { 256, 0 }, /* (199) windowstate_option ::= */ + { 256, -4 }, /* (200) windowstate_option ::= STATE_WINDOW LP ids RP */ + { 257, 0 }, /* (201) fill_opt ::= */ + { 257, -6 }, /* (202) fill_opt ::= FILL LP ID COMMA tagitemlist RP */ + { 257, -4 }, /* (203) fill_opt ::= FILL LP ID RP */ + { 254, -4 }, /* (204) sliding_opt ::= SLIDING LP tmvar RP */ + { 254, 0 }, /* (205) sliding_opt ::= */ + { 260, 0 }, /* (206) orderby_opt ::= */ + { 260, -3 }, /* (207) orderby_opt ::= ORDER BY sortlist */ + { 272, -4 }, /* (208) sortlist ::= sortlist COMMA item sortorder */ + { 272, -2 }, /* (209) sortlist ::= item sortorder */ + { 274, -2 }, /* (210) item ::= ids cpxName */ + { 275, -1 }, /* (211) sortorder ::= ASC */ + { 275, -1 }, /* (212) sortorder ::= DESC */ + { 275, 0 }, /* (213) sortorder ::= */ + { 258, 0 }, /* (214) groupby_opt ::= */ + { 258, -3 }, /* (215) groupby_opt ::= GROUP BY grouplist */ + { 276, -3 }, /* (216) grouplist ::= grouplist COMMA item */ + { 276, -1 }, /* (217) grouplist ::= item */ + { 259, 0 }, /* (218) having_opt ::= */ + { 259, -2 }, /* (219) having_opt ::= HAVING expr */ + { 262, 0 }, /* (220) limit_opt ::= */ + { 262, -2 }, /* (221) limit_opt ::= LIMIT signed */ + { 262, -4 }, /* (222) limit_opt ::= LIMIT signed OFFSET signed */ + { 262, -4 }, /* (223) limit_opt ::= LIMIT signed COMMA signed */ + { 261, 0 }, /* (224) slimit_opt ::= */ + { 261, -2 }, /* (225) slimit_opt ::= SLIMIT signed */ + { 261, -4 }, /* (226) slimit_opt ::= SLIMIT signed SOFFSET signed */ + { 261, -4 }, /* (227) slimit_opt ::= SLIMIT signed COMMA signed */ + { 252, 0 }, /* (228) where_opt ::= */ + { 252, -2 }, /* (229) where_opt ::= WHERE expr */ + { 266, -3 }, /* (230) expr ::= LP expr RP */ + { 266, -1 }, /* (231) expr ::= ID */ + { 266, -3 }, /* (232) expr ::= ID DOT ID */ + { 266, -3 }, /* (233) expr ::= ID DOT STAR */ + { 266, -1 }, /* (234) expr ::= INTEGER */ + { 266, -2 }, /* (235) expr ::= MINUS INTEGER */ + { 266, -2 }, /* (236) expr ::= PLUS INTEGER */ + { 266, -1 }, /* (237) expr ::= FLOAT */ + { 266, -2 }, /* (238) expr ::= MINUS FLOAT */ + { 266, -2 }, /* (239) expr ::= PLUS FLOAT */ + { 266, -1 }, /* (240) expr ::= STRING */ + { 266, -1 }, /* (241) expr ::= NOW */ + { 266, -1 }, /* (242) expr ::= VARIABLE */ + { 266, -2 }, /* (243) expr ::= PLUS VARIABLE */ + { 266, -2 }, /* (244) expr ::= MINUS VARIABLE */ + { 266, -1 }, /* (245) expr ::= BOOL */ + { 266, -1 }, /* (246) expr ::= NULL */ + { 266, -4 }, /* (247) expr ::= ID LP exprlist RP */ + { 266, -4 }, /* (248) expr ::= ID LP STAR RP */ + { 266, -3 }, /* (249) expr ::= expr IS NULL */ + { 266, -4 }, /* (250) expr ::= expr IS NOT NULL */ + { 266, -3 }, /* (251) expr ::= expr LT expr */ + { 266, -3 }, /* (252) expr ::= expr GT expr */ + { 266, -3 }, /* (253) expr ::= expr LE expr */ + { 266, -3 }, /* (254) expr ::= expr GE expr */ + { 266, -3 }, /* (255) expr ::= expr NE expr */ + { 266, -3 }, /* (256) expr ::= expr EQ expr */ + { 266, -5 }, /* (257) expr ::= expr BETWEEN expr AND expr */ + { 266, -3 }, /* (258) expr ::= expr AND expr */ + { 266, -3 }, /* (259) expr ::= expr OR expr */ + { 266, -3 }, /* (260) expr ::= expr PLUS expr */ + { 266, -3 }, /* (261) expr ::= expr MINUS expr */ + { 266, -3 }, /* (262) expr ::= expr STAR expr */ + { 266, -3 }, /* (263) expr ::= expr SLASH expr */ + { 266, -3 }, /* (264) expr ::= expr REM expr */ + { 266, -3 }, /* (265) expr ::= expr LIKE expr */ + { 266, -5 }, /* (266) expr ::= expr IN LP exprlist RP */ + { 206, -3 }, /* (267) exprlist ::= exprlist COMMA expritem */ + { 206, -1 }, /* (268) exprlist ::= expritem */ + { 277, -1 }, /* (269) expritem ::= expr */ + { 277, 0 }, /* (270) expritem ::= */ + { 198, -3 }, /* (271) cmd ::= RESET QUERY CACHE */ + { 198, -3 }, /* (272) cmd ::= SYNCDB ids REPLICA */ + { 198, -7 }, /* (273) cmd ::= ALTER TABLE ids cpxName ADD COLUMN columnlist */ + { 198, -7 }, /* (274) cmd ::= ALTER TABLE ids cpxName DROP COLUMN ids */ + { 198, -7 }, /* (275) cmd ::= ALTER TABLE ids cpxName MODIFY COLUMN columnlist */ + { 198, -7 }, /* (276) cmd ::= ALTER TABLE ids cpxName ADD TAG columnlist */ + { 198, -7 }, /* (277) cmd ::= ALTER TABLE ids cpxName DROP TAG ids */ + { 198, -8 }, /* (278) cmd ::= ALTER TABLE ids cpxName CHANGE TAG ids ids */ + { 198, -9 }, /* (279) cmd ::= ALTER TABLE ids cpxName SET TAG ids EQ tagitem */ + { 198, -7 }, /* (280) cmd ::= ALTER TABLE ids cpxName MODIFY TAG columnlist */ + { 198, -7 }, /* (281) cmd ::= ALTER STABLE ids cpxName ADD COLUMN columnlist */ + { 198, -7 }, /* (282) cmd ::= ALTER STABLE ids cpxName DROP COLUMN ids */ + { 198, -7 }, /* (283) cmd ::= ALTER STABLE ids cpxName MODIFY COLUMN columnlist */ + { 198, -7 }, /* (284) cmd ::= ALTER STABLE ids cpxName ADD TAG columnlist */ + { 198, -7 }, /* (285) cmd ::= ALTER STABLE ids cpxName DROP TAG ids */ + { 198, -8 }, /* (286) cmd ::= ALTER STABLE ids cpxName CHANGE TAG ids ids */ + { 198, -9 }, /* (287) cmd ::= ALTER STABLE ids cpxName SET TAG ids EQ tagitem */ + { 198, -7 }, /* (288) cmd ::= ALTER STABLE ids cpxName MODIFY TAG columnlist */ + { 198, -3 }, /* (289) cmd ::= KILL CONNECTION INTEGER */ + { 198, -5 }, /* (290) cmd ::= KILL STREAM INTEGER COLON INTEGER */ + { 198, -5 }, /* (291) cmd ::= KILL QUERY INTEGER COLON INTEGER */ }; static void yy_accept(yyParser*); /* Forward Declaration */ @@ -2650,21 +2139,59 @@ static void yy_accept(yyParser*); /* Forward Declaration */ ** only called from one place, optimizing compilers will in-line it, which ** means that the extra parameters have no performance impact. */ -static YYACTIONTYPE yy_reduce( +static void yy_reduce( yyParser *yypParser, /* The parser */ unsigned int yyruleno, /* Number of the rule by which to reduce */ int yyLookahead, /* Lookahead token, or YYNOCODE if none */ ParseTOKENTYPE yyLookaheadToken /* Value of the lookahead token */ - ParseCTX_PDECL /* %extra_context */ ){ int yygoto; /* The next state */ - YYACTIONTYPE yyact; /* The next action */ + int yyact; /* The next action */ yyStackEntry *yymsp; /* The top of the parser's stack */ int yysize; /* Amount to pop the stack */ - ParseARG_FETCH + ParseARG_FETCH; (void)yyLookahead; (void)yyLookaheadToken; yymsp = yypParser->yytos; +#ifndef NDEBUG + if( yyTraceFILE && yyruleno<(int)(sizeof(yyRuleName)/sizeof(yyRuleName[0])) ){ + yysize = yyRuleInfo[yyruleno].nrhs; + if( yysize ){ + fprintf(yyTraceFILE, "%sReduce %d [%s], go to state %d.\n", + yyTracePrompt, + yyruleno, yyRuleName[yyruleno], yymsp[yysize].stateno); + }else{ + fprintf(yyTraceFILE, "%sReduce %d [%s].\n", + yyTracePrompt, yyruleno, yyRuleName[yyruleno]); + } + } +#endif /* NDEBUG */ + + /* Check that the stack is large enough to grow by a single entry + ** if the RHS of the rule is empty. This ensures that there is room + ** enough on the stack to push the LHS value */ + if( yyRuleInfo[yyruleno].nrhs==0 ){ +#ifdef YYTRACKMAXSTACKDEPTH + if( (int)(yypParser->yytos - yypParser->yystack)>yypParser->yyhwm ){ + yypParser->yyhwm++; + assert( yypParser->yyhwm == (int)(yypParser->yytos - yypParser->yystack)); + } +#endif +#if YYSTACKDEPTH>0 + if( yypParser->yytos>=yypParser->yystackEnd ){ + yyStackOverflow(yypParser); + return; + } +#else + if( yypParser->yytos>=&yypParser->yystack[yypParser->yystksz-1] ){ + if( yyGrowStack(yypParser) ){ + yyStackOverflow(yypParser); + return; + } + yymsp = yypParser->yytos; + } +#endif + } switch( yyruleno ){ /* Beginning here are the reduction cases. A typical example @@ -2681,347 +2208,227 @@ static YYACTIONTYPE yy_reduce( case 139: /* cmd ::= CREATE TABLE create_table_args */ yytestcase(yyruleno==139); case 140: /* cmd ::= CREATE TABLE create_stable_args */ yytestcase(yyruleno==140); case 141: /* cmd ::= CREATE STABLE create_stable_args */ yytestcase(yyruleno==141); -#line 63 "src/query/inc/sql.y" {} -#line 2686 "src/query/inc/sql.c" break; case 1: /* cmd ::= SHOW DATABASES */ -#line 66 "src/query/inc/sql.y" { setShowOptions(pInfo, TSDB_MGMT_TABLE_DB, 0, 0);} -#line 2691 "src/query/inc/sql.c" break; case 2: /* cmd ::= SHOW TOPICS */ -#line 67 "src/query/inc/sql.y" { setShowOptions(pInfo, TSDB_MGMT_TABLE_TP, 0, 0);} -#line 2696 "src/query/inc/sql.c" break; case 3: /* cmd ::= SHOW FUNCTIONS */ -#line 68 "src/query/inc/sql.y" { setShowOptions(pInfo, TSDB_MGMT_TABLE_FUNCTION, 0, 0);} -#line 2701 "src/query/inc/sql.c" break; case 4: /* cmd ::= SHOW MNODES */ -#line 69 "src/query/inc/sql.y" { setShowOptions(pInfo, TSDB_MGMT_TABLE_MNODE, 0, 0);} -#line 2706 "src/query/inc/sql.c" break; case 5: /* cmd ::= SHOW DNODES */ -#line 70 "src/query/inc/sql.y" { setShowOptions(pInfo, TSDB_MGMT_TABLE_DNODE, 0, 0);} -#line 2711 "src/query/inc/sql.c" break; case 6: /* cmd ::= SHOW ACCOUNTS */ -#line 71 "src/query/inc/sql.y" { setShowOptions(pInfo, TSDB_MGMT_TABLE_ACCT, 0, 0);} -#line 2716 "src/query/inc/sql.c" break; case 7: /* cmd ::= SHOW USERS */ -#line 72 "src/query/inc/sql.y" { setShowOptions(pInfo, TSDB_MGMT_TABLE_USER, 0, 0);} -#line 2721 "src/query/inc/sql.c" break; case 8: /* cmd ::= SHOW MODULES */ -#line 74 "src/query/inc/sql.y" { setShowOptions(pInfo, TSDB_MGMT_TABLE_MODULE, 0, 0); } -#line 2726 "src/query/inc/sql.c" break; case 9: /* cmd ::= SHOW QUERIES */ -#line 75 "src/query/inc/sql.y" { setShowOptions(pInfo, TSDB_MGMT_TABLE_QUERIES, 0, 0); } -#line 2731 "src/query/inc/sql.c" break; case 10: /* cmd ::= SHOW CONNECTIONS */ -#line 76 "src/query/inc/sql.y" { setShowOptions(pInfo, TSDB_MGMT_TABLE_CONNS, 0, 0);} -#line 2736 "src/query/inc/sql.c" break; case 11: /* cmd ::= SHOW STREAMS */ -#line 77 "src/query/inc/sql.y" { setShowOptions(pInfo, TSDB_MGMT_TABLE_STREAMS, 0, 0); } -#line 2741 "src/query/inc/sql.c" break; case 12: /* cmd ::= SHOW VARIABLES */ -#line 78 "src/query/inc/sql.y" { setShowOptions(pInfo, TSDB_MGMT_TABLE_VARIABLES, 0, 0); } -#line 2746 "src/query/inc/sql.c" break; case 13: /* cmd ::= SHOW SCORES */ -#line 79 "src/query/inc/sql.y" { setShowOptions(pInfo, TSDB_MGMT_TABLE_SCORES, 0, 0); } -#line 2751 "src/query/inc/sql.c" break; case 14: /* cmd ::= SHOW GRANTS */ -#line 80 "src/query/inc/sql.y" { setShowOptions(pInfo, TSDB_MGMT_TABLE_GRANTS, 0, 0); } -#line 2756 "src/query/inc/sql.c" break; case 15: /* cmd ::= SHOW VNODES */ -#line 82 "src/query/inc/sql.y" { setShowOptions(pInfo, TSDB_MGMT_TABLE_VNODES, 0, 0); } -#line 2761 "src/query/inc/sql.c" break; case 16: /* cmd ::= SHOW VNODES ids */ -#line 83 "src/query/inc/sql.y" { setShowOptions(pInfo, TSDB_MGMT_TABLE_VNODES, &yymsp[0].minor.yy0, 0); } -#line 2766 "src/query/inc/sql.c" break; case 17: /* dbPrefix ::= */ -#line 87 "src/query/inc/sql.y" {yymsp[1].minor.yy0.n = 0; yymsp[1].minor.yy0.type = 0;} -#line 2771 "src/query/inc/sql.c" break; case 18: /* dbPrefix ::= ids DOT */ -#line 88 "src/query/inc/sql.y" {yylhsminor.yy0 = yymsp[-1].minor.yy0; } -#line 2776 "src/query/inc/sql.c" yymsp[-1].minor.yy0 = yylhsminor.yy0; break; case 19: /* cpxName ::= */ -#line 91 "src/query/inc/sql.y" {yymsp[1].minor.yy0.n = 0; } -#line 2782 "src/query/inc/sql.c" break; case 20: /* cpxName ::= DOT ids */ -#line 92 "src/query/inc/sql.y" {yymsp[-1].minor.yy0 = yymsp[0].minor.yy0; yymsp[-1].minor.yy0.n += 1; } -#line 2787 "src/query/inc/sql.c" break; case 21: /* cmd ::= SHOW CREATE TABLE ids cpxName */ -#line 94 "src/query/inc/sql.y" { yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; setDCLSqlElems(pInfo, TSDB_SQL_SHOW_CREATE_TABLE, 1, &yymsp[-1].minor.yy0); } -#line 2795 "src/query/inc/sql.c" break; case 22: /* cmd ::= SHOW CREATE STABLE ids cpxName */ -#line 98 "src/query/inc/sql.y" { yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; setDCLSqlElems(pInfo, TSDB_SQL_SHOW_CREATE_STABLE, 1, &yymsp[-1].minor.yy0); } -#line 2803 "src/query/inc/sql.c" break; case 23: /* cmd ::= SHOW CREATE DATABASE ids */ -#line 103 "src/query/inc/sql.y" { setDCLSqlElems(pInfo, TSDB_SQL_SHOW_CREATE_DATABASE, 1, &yymsp[0].minor.yy0); } -#line 2810 "src/query/inc/sql.c" break; case 24: /* cmd ::= SHOW dbPrefix TABLES */ -#line 107 "src/query/inc/sql.y" { setShowOptions(pInfo, TSDB_MGMT_TABLE_TABLE, &yymsp[-1].minor.yy0, 0); } -#line 2817 "src/query/inc/sql.c" break; case 25: /* cmd ::= SHOW dbPrefix TABLES LIKE ids */ -#line 111 "src/query/inc/sql.y" { setShowOptions(pInfo, TSDB_MGMT_TABLE_TABLE, &yymsp[-3].minor.yy0, &yymsp[0].minor.yy0); } -#line 2824 "src/query/inc/sql.c" break; case 26: /* cmd ::= SHOW dbPrefix STABLES */ -#line 115 "src/query/inc/sql.y" { setShowOptions(pInfo, TSDB_MGMT_TABLE_METRIC, &yymsp[-1].minor.yy0, 0); } -#line 2831 "src/query/inc/sql.c" break; case 27: /* cmd ::= SHOW dbPrefix STABLES LIKE ids */ -#line 119 "src/query/inc/sql.y" { SStrToken token; tSetDbName(&token, &yymsp[-3].minor.yy0); setShowOptions(pInfo, TSDB_MGMT_TABLE_METRIC, &token, &yymsp[0].minor.yy0); } -#line 2840 "src/query/inc/sql.c" break; case 28: /* cmd ::= SHOW dbPrefix VGROUPS */ -#line 125 "src/query/inc/sql.y" { SStrToken token; tSetDbName(&token, &yymsp[-1].minor.yy0); setShowOptions(pInfo, TSDB_MGMT_TABLE_VGROUP, &token, 0); } -#line 2849 "src/query/inc/sql.c" break; case 29: /* cmd ::= SHOW dbPrefix VGROUPS ids */ -#line 131 "src/query/inc/sql.y" { SStrToken token; tSetDbName(&token, &yymsp[-2].minor.yy0); setShowOptions(pInfo, TSDB_MGMT_TABLE_VGROUP, &token, &yymsp[0].minor.yy0); } -#line 2858 "src/query/inc/sql.c" break; case 30: /* cmd ::= DROP TABLE ifexists ids cpxName */ -#line 138 "src/query/inc/sql.y" { yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; setDropDbTableInfo(pInfo, TSDB_SQL_DROP_TABLE, &yymsp[-1].minor.yy0, &yymsp[-2].minor.yy0, -1, -1); } -#line 2866 "src/query/inc/sql.c" break; case 31: /* cmd ::= DROP STABLE ifexists ids cpxName */ -#line 144 "src/query/inc/sql.y" { yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; setDropDbTableInfo(pInfo, TSDB_SQL_DROP_TABLE, &yymsp[-1].minor.yy0, &yymsp[-2].minor.yy0, -1, TSDB_SUPER_TABLE); } -#line 2874 "src/query/inc/sql.c" break; case 32: /* cmd ::= DROP DATABASE ifexists ids */ -#line 149 "src/query/inc/sql.y" { setDropDbTableInfo(pInfo, TSDB_SQL_DROP_DB, &yymsp[0].minor.yy0, &yymsp[-1].minor.yy0, TSDB_DB_TYPE_DEFAULT, -1); } -#line 2879 "src/query/inc/sql.c" break; case 33: /* cmd ::= DROP TOPIC ifexists ids */ -#line 150 "src/query/inc/sql.y" { setDropDbTableInfo(pInfo, TSDB_SQL_DROP_DB, &yymsp[0].minor.yy0, &yymsp[-1].minor.yy0, TSDB_DB_TYPE_TOPIC, -1); } -#line 2884 "src/query/inc/sql.c" break; case 34: /* cmd ::= DROP FUNCTION ids */ -#line 151 "src/query/inc/sql.y" { setDropFuncInfo(pInfo, TSDB_SQL_DROP_FUNCTION, &yymsp[0].minor.yy0); } -#line 2889 "src/query/inc/sql.c" break; case 35: /* cmd ::= DROP DNODE ids */ -#line 153 "src/query/inc/sql.y" { setDCLSqlElems(pInfo, TSDB_SQL_DROP_DNODE, 1, &yymsp[0].minor.yy0); } -#line 2894 "src/query/inc/sql.c" break; case 36: /* cmd ::= DROP USER ids */ -#line 154 "src/query/inc/sql.y" { setDCLSqlElems(pInfo, TSDB_SQL_DROP_USER, 1, &yymsp[0].minor.yy0); } -#line 2899 "src/query/inc/sql.c" break; case 37: /* cmd ::= DROP ACCOUNT ids */ -#line 155 "src/query/inc/sql.y" { setDCLSqlElems(pInfo, TSDB_SQL_DROP_ACCT, 1, &yymsp[0].minor.yy0); } -#line 2904 "src/query/inc/sql.c" break; case 38: /* cmd ::= USE ids */ -#line 158 "src/query/inc/sql.y" { setDCLSqlElems(pInfo, TSDB_SQL_USE_DB, 1, &yymsp[0].minor.yy0);} -#line 2909 "src/query/inc/sql.c" break; case 39: /* cmd ::= DESCRIBE ids cpxName */ case 40: /* cmd ::= DESC ids cpxName */ yytestcase(yyruleno==40); -#line 161 "src/query/inc/sql.y" { yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; setDCLSqlElems(pInfo, TSDB_SQL_DESCRIBE_TABLE, 1, &yymsp[-1].minor.yy0); } -#line 2918 "src/query/inc/sql.c" break; case 41: /* cmd ::= ALTER USER ids PASS ids */ -#line 170 "src/query/inc/sql.y" { setAlterUserSql(pInfo, TSDB_ALTER_USER_PASSWD, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, NULL); } -#line 2923 "src/query/inc/sql.c" break; case 42: /* cmd ::= ALTER USER ids PRIVILEGE ids */ -#line 171 "src/query/inc/sql.y" { setAlterUserSql(pInfo, TSDB_ALTER_USER_PRIVILEGES, &yymsp[-2].minor.yy0, NULL, &yymsp[0].minor.yy0);} -#line 2928 "src/query/inc/sql.c" break; case 43: /* cmd ::= ALTER DNODE ids ids */ -#line 172 "src/query/inc/sql.y" { setDCLSqlElems(pInfo, TSDB_SQL_CFG_DNODE, 2, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0); } -#line 2933 "src/query/inc/sql.c" break; case 44: /* cmd ::= ALTER DNODE ids ids ids */ -#line 173 "src/query/inc/sql.y" { setDCLSqlElems(pInfo, TSDB_SQL_CFG_DNODE, 3, &yymsp[-2].minor.yy0, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0); } -#line 2938 "src/query/inc/sql.c" break; case 45: /* cmd ::= ALTER LOCAL ids */ -#line 174 "src/query/inc/sql.y" { setDCLSqlElems(pInfo, TSDB_SQL_CFG_LOCAL, 1, &yymsp[0].minor.yy0); } -#line 2943 "src/query/inc/sql.c" break; case 46: /* cmd ::= ALTER LOCAL ids ids */ -#line 175 "src/query/inc/sql.y" { setDCLSqlElems(pInfo, TSDB_SQL_CFG_LOCAL, 2, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0); } -#line 2948 "src/query/inc/sql.c" break; case 47: /* cmd ::= ALTER DATABASE ids alter_db_optr */ case 48: /* cmd ::= ALTER TOPIC ids alter_topic_optr */ yytestcase(yyruleno==48); -#line 176 "src/query/inc/sql.y" -{ SStrToken t = {0}; setCreateDbInfo(pInfo, TSDB_SQL_ALTER_DB, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy42, &t);} -#line 2954 "src/query/inc/sql.c" +{ SStrToken t = {0}; setCreateDbInfo(pInfo, TSDB_SQL_ALTER_DB, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy90, &t);} break; case 49: /* cmd ::= ALTER ACCOUNT ids acct_optr */ -#line 179 "src/query/inc/sql.y" -{ setCreateAcctSql(pInfo, TSDB_SQL_ALTER_ACCT, &yymsp[-1].minor.yy0, NULL, &yymsp[0].minor.yy341);} -#line 2959 "src/query/inc/sql.c" +{ setCreateAcctSql(pInfo, TSDB_SQL_ALTER_ACCT, &yymsp[-1].minor.yy0, NULL, &yymsp[0].minor.yy171);} break; case 50: /* cmd ::= ALTER ACCOUNT ids PASS ids acct_optr */ -#line 180 "src/query/inc/sql.y" -{ setCreateAcctSql(pInfo, TSDB_SQL_ALTER_ACCT, &yymsp[-3].minor.yy0, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy341);} -#line 2964 "src/query/inc/sql.c" +{ setCreateAcctSql(pInfo, TSDB_SQL_ALTER_ACCT, &yymsp[-3].minor.yy0, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy171);} break; case 51: /* cmd ::= COMPACT VNODES IN LP exprlist RP */ -#line 184 "src/query/inc/sql.y" -{ setCompactVnodeSql(pInfo, TSDB_SQL_COMPACT_VNODE, yymsp[-1].minor.yy131);} -#line 2969 "src/query/inc/sql.c" +{ setCompactVnodeSql(pInfo, TSDB_SQL_COMPACT_VNODE, yymsp[-1].minor.yy421);} break; case 52: /* ids ::= ID */ case 53: /* ids ::= STRING */ yytestcase(yyruleno==53); -#line 190 "src/query/inc/sql.y" {yylhsminor.yy0 = yymsp[0].minor.yy0; } -#line 2975 "src/query/inc/sql.c" yymsp[0].minor.yy0 = yylhsminor.yy0; break; case 54: /* ifexists ::= IF EXISTS */ -#line 194 "src/query/inc/sql.y" { yymsp[-1].minor.yy0.n = 1;} -#line 2981 "src/query/inc/sql.c" break; case 55: /* ifexists ::= */ case 57: /* ifnotexists ::= */ yytestcase(yyruleno==57); case 181: /* distinct ::= */ yytestcase(yyruleno==181); -#line 195 "src/query/inc/sql.y" { yymsp[1].minor.yy0.n = 0;} -#line 2988 "src/query/inc/sql.c" break; case 56: /* ifnotexists ::= IF NOT EXISTS */ -#line 198 "src/query/inc/sql.y" { yymsp[-2].minor.yy0.n = 1;} -#line 2993 "src/query/inc/sql.c" break; case 58: /* cmd ::= CREATE DNODE ids */ -#line 203 "src/query/inc/sql.y" { setDCLSqlElems(pInfo, TSDB_SQL_CREATE_DNODE, 1, &yymsp[0].minor.yy0);} -#line 2998 "src/query/inc/sql.c" break; case 59: /* cmd ::= CREATE ACCOUNT ids PASS ids acct_optr */ -#line 205 "src/query/inc/sql.y" -{ setCreateAcctSql(pInfo, TSDB_SQL_CREATE_ACCT, &yymsp[-3].minor.yy0, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy341);} -#line 3003 "src/query/inc/sql.c" +{ setCreateAcctSql(pInfo, TSDB_SQL_CREATE_ACCT, &yymsp[-3].minor.yy0, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy171);} break; case 60: /* cmd ::= CREATE DATABASE ifnotexists ids db_optr */ case 61: /* cmd ::= CREATE TOPIC ifnotexists ids topic_optr */ yytestcase(yyruleno==61); -#line 206 "src/query/inc/sql.y" -{ setCreateDbInfo(pInfo, TSDB_SQL_CREATE_DB, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy42, &yymsp[-2].minor.yy0);} -#line 3009 "src/query/inc/sql.c" +{ setCreateDbInfo(pInfo, TSDB_SQL_CREATE_DB, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy90, &yymsp[-2].minor.yy0);} break; case 62: /* cmd ::= CREATE FUNCTION ids AS ids OUTPUTTYPE typename bufsize */ -#line 208 "src/query/inc/sql.y" -{ setCreateFuncInfo(pInfo, TSDB_SQL_CREATE_FUNCTION, &yymsp[-5].minor.yy0, &yymsp[-3].minor.yy0, &yymsp[-1].minor.yy163, &yymsp[0].minor.yy0, 1);} -#line 3014 "src/query/inc/sql.c" +{ setCreateFuncInfo(pInfo, TSDB_SQL_CREATE_FUNCTION, &yymsp[-5].minor.yy0, &yymsp[-3].minor.yy0, &yymsp[-1].minor.yy183, &yymsp[0].minor.yy0, 1);} break; case 63: /* cmd ::= CREATE AGGREGATE FUNCTION ids AS ids OUTPUTTYPE typename bufsize */ -#line 209 "src/query/inc/sql.y" -{ setCreateFuncInfo(pInfo, TSDB_SQL_CREATE_FUNCTION, &yymsp[-5].minor.yy0, &yymsp[-3].minor.yy0, &yymsp[-1].minor.yy163, &yymsp[0].minor.yy0, 2);} -#line 3019 "src/query/inc/sql.c" +{ setCreateFuncInfo(pInfo, TSDB_SQL_CREATE_FUNCTION, &yymsp[-5].minor.yy0, &yymsp[-3].minor.yy0, &yymsp[-1].minor.yy183, &yymsp[0].minor.yy0, 2);} break; case 64: /* cmd ::= CREATE USER ids PASS ids */ -#line 210 "src/query/inc/sql.y" { setCreateUserSql(pInfo, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0);} -#line 3024 "src/query/inc/sql.c" break; case 65: /* bufsize ::= */ case 67: /* pps ::= */ yytestcase(yyruleno==67); @@ -3033,9 +2440,7 @@ static YYACTIONTYPE yy_reduce( case 79: /* users ::= */ yytestcase(yyruleno==79); case 81: /* conns ::= */ yytestcase(yyruleno==81); case 83: /* state ::= */ yytestcase(yyruleno==83); -#line 212 "src/query/inc/sql.y" { yymsp[1].minor.yy0.n = 0; } -#line 3038 "src/query/inc/sql.c" break; case 66: /* bufsize ::= BUFSIZE INTEGER */ case 68: /* pps ::= PPS INTEGER */ yytestcase(yyruleno==68); @@ -3047,54 +2452,42 @@ static YYACTIONTYPE yy_reduce( case 80: /* users ::= USERS INTEGER */ yytestcase(yyruleno==80); case 82: /* conns ::= CONNS INTEGER */ yytestcase(yyruleno==82); case 84: /* state ::= STATE ids */ yytestcase(yyruleno==84); -#line 213 "src/query/inc/sql.y" { yymsp[-1].minor.yy0 = yymsp[0].minor.yy0; } -#line 3052 "src/query/inc/sql.c" break; case 85: /* acct_optr ::= pps tseries storage streams qtime dbs users conns state */ -#line 243 "src/query/inc/sql.y" { - yylhsminor.yy341.maxUsers = (yymsp[-2].minor.yy0.n>0)?atoi(yymsp[-2].minor.yy0.z):-1; - yylhsminor.yy341.maxDbs = (yymsp[-3].minor.yy0.n>0)?atoi(yymsp[-3].minor.yy0.z):-1; - yylhsminor.yy341.maxTimeSeries = (yymsp[-7].minor.yy0.n>0)?atoi(yymsp[-7].minor.yy0.z):-1; - yylhsminor.yy341.maxStreams = (yymsp[-5].minor.yy0.n>0)?atoi(yymsp[-5].minor.yy0.z):-1; - yylhsminor.yy341.maxPointsPerSecond = (yymsp[-8].minor.yy0.n>0)?atoi(yymsp[-8].minor.yy0.z):-1; - yylhsminor.yy341.maxStorage = (yymsp[-6].minor.yy0.n>0)?strtoll(yymsp[-6].minor.yy0.z, NULL, 10):-1; - yylhsminor.yy341.maxQueryTime = (yymsp[-4].minor.yy0.n>0)?strtoll(yymsp[-4].minor.yy0.z, NULL, 10):-1; - yylhsminor.yy341.maxConnections = (yymsp[-1].minor.yy0.n>0)?atoi(yymsp[-1].minor.yy0.z):-1; - yylhsminor.yy341.stat = yymsp[0].minor.yy0; + yylhsminor.yy171.maxUsers = (yymsp[-2].minor.yy0.n>0)?atoi(yymsp[-2].minor.yy0.z):-1; + yylhsminor.yy171.maxDbs = (yymsp[-3].minor.yy0.n>0)?atoi(yymsp[-3].minor.yy0.z):-1; + yylhsminor.yy171.maxTimeSeries = (yymsp[-7].minor.yy0.n>0)?atoi(yymsp[-7].minor.yy0.z):-1; + yylhsminor.yy171.maxStreams = (yymsp[-5].minor.yy0.n>0)?atoi(yymsp[-5].minor.yy0.z):-1; + yylhsminor.yy171.maxPointsPerSecond = (yymsp[-8].minor.yy0.n>0)?atoi(yymsp[-8].minor.yy0.z):-1; + yylhsminor.yy171.maxStorage = (yymsp[-6].minor.yy0.n>0)?strtoll(yymsp[-6].minor.yy0.z, NULL, 10):-1; + yylhsminor.yy171.maxQueryTime = (yymsp[-4].minor.yy0.n>0)?strtoll(yymsp[-4].minor.yy0.z, NULL, 10):-1; + yylhsminor.yy171.maxConnections = (yymsp[-1].minor.yy0.n>0)?atoi(yymsp[-1].minor.yy0.z):-1; + yylhsminor.yy171.stat = yymsp[0].minor.yy0; } -#line 3067 "src/query/inc/sql.c" - yymsp[-8].minor.yy341 = yylhsminor.yy341; + yymsp[-8].minor.yy171 = yylhsminor.yy171; break; case 86: /* intitemlist ::= intitemlist COMMA intitem */ case 155: /* tagitemlist ::= tagitemlist COMMA tagitem */ yytestcase(yyruleno==155); -#line 259 "src/query/inc/sql.y" -{ yylhsminor.yy131 = tVariantListAppend(yymsp[-2].minor.yy131, &yymsp[0].minor.yy516, -1); } -#line 3074 "src/query/inc/sql.c" - yymsp[-2].minor.yy131 = yylhsminor.yy131; +{ yylhsminor.yy421 = tVariantListAppend(yymsp[-2].minor.yy421, &yymsp[0].minor.yy430, -1); } + yymsp[-2].minor.yy421 = yylhsminor.yy421; break; case 87: /* intitemlist ::= intitem */ case 156: /* tagitemlist ::= tagitem */ yytestcase(yyruleno==156); -#line 260 "src/query/inc/sql.y" -{ yylhsminor.yy131 = tVariantListAppend(NULL, &yymsp[0].minor.yy516, -1); } -#line 3081 "src/query/inc/sql.c" - yymsp[0].minor.yy131 = yylhsminor.yy131; +{ yylhsminor.yy421 = tVariantListAppend(NULL, &yymsp[0].minor.yy430, -1); } + yymsp[0].minor.yy421 = yylhsminor.yy421; break; case 88: /* intitem ::= INTEGER */ case 157: /* tagitem ::= INTEGER */ yytestcase(yyruleno==157); case 158: /* tagitem ::= FLOAT */ yytestcase(yyruleno==158); case 159: /* tagitem ::= STRING */ yytestcase(yyruleno==159); case 160: /* tagitem ::= BOOL */ yytestcase(yyruleno==160); -#line 262 "src/query/inc/sql.y" -{ toTSDBType(yymsp[0].minor.yy0.type); tVariantCreate(&yylhsminor.yy516, &yymsp[0].minor.yy0); } -#line 3091 "src/query/inc/sql.c" - yymsp[0].minor.yy516 = yylhsminor.yy516; +{ toTSDBType(yymsp[0].minor.yy0.type); tVariantCreate(&yylhsminor.yy430, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy430 = yylhsminor.yy430; break; case 89: /* keep ::= KEEP intitemlist */ -#line 266 "src/query/inc/sql.y" -{ yymsp[-1].minor.yy131 = yymsp[0].minor.yy131; } -#line 3097 "src/query/inc/sql.c" +{ yymsp[-1].minor.yy421 = yymsp[0].minor.yy421; } break; case 90: /* cache ::= CACHE INTEGER */ case 91: /* replica ::= REPLICA INTEGER */ yytestcase(yyruleno==91); @@ -3111,912 +2504,647 @@ static YYACTIONTYPE yy_reduce( case 102: /* update ::= UPDATE INTEGER */ yytestcase(yyruleno==102); case 103: /* cachelast ::= CACHELAST INTEGER */ yytestcase(yyruleno==103); case 104: /* partitions ::= PARTITIONS INTEGER */ yytestcase(yyruleno==104); -#line 268 "src/query/inc/sql.y" { yymsp[-1].minor.yy0 = yymsp[0].minor.yy0; } -#line 3116 "src/query/inc/sql.c" break; case 105: /* db_optr ::= */ -#line 285 "src/query/inc/sql.y" -{setDefaultCreateDbOption(&yymsp[1].minor.yy42); yymsp[1].minor.yy42.dbType = TSDB_DB_TYPE_DEFAULT;} -#line 3121 "src/query/inc/sql.c" +{setDefaultCreateDbOption(&yymsp[1].minor.yy90); yymsp[1].minor.yy90.dbType = TSDB_DB_TYPE_DEFAULT;} break; case 106: /* db_optr ::= db_optr cache */ -#line 287 "src/query/inc/sql.y" -{ yylhsminor.yy42 = yymsp[-1].minor.yy42; yylhsminor.yy42.cacheBlockSize = strtol(yymsp[0].minor.yy0.z, NULL, 10); } -#line 3126 "src/query/inc/sql.c" - yymsp[-1].minor.yy42 = yylhsminor.yy42; +{ yylhsminor.yy90 = yymsp[-1].minor.yy90; yylhsminor.yy90.cacheBlockSize = strtol(yymsp[0].minor.yy0.z, NULL, 10); } + yymsp[-1].minor.yy90 = yylhsminor.yy90; break; case 107: /* db_optr ::= db_optr replica */ case 124: /* alter_db_optr ::= alter_db_optr replica */ yytestcase(yyruleno==124); -#line 288 "src/query/inc/sql.y" -{ yylhsminor.yy42 = yymsp[-1].minor.yy42; yylhsminor.yy42.replica = strtol(yymsp[0].minor.yy0.z, NULL, 10); } -#line 3133 "src/query/inc/sql.c" - yymsp[-1].minor.yy42 = yylhsminor.yy42; +{ yylhsminor.yy90 = yymsp[-1].minor.yy90; yylhsminor.yy90.replica = strtol(yymsp[0].minor.yy0.z, NULL, 10); } + yymsp[-1].minor.yy90 = yylhsminor.yy90; break; case 108: /* db_optr ::= db_optr quorum */ case 125: /* alter_db_optr ::= alter_db_optr quorum */ yytestcase(yyruleno==125); -#line 289 "src/query/inc/sql.y" -{ yylhsminor.yy42 = yymsp[-1].minor.yy42; yylhsminor.yy42.quorum = strtol(yymsp[0].minor.yy0.z, NULL, 10); } -#line 3140 "src/query/inc/sql.c" - yymsp[-1].minor.yy42 = yylhsminor.yy42; +{ yylhsminor.yy90 = yymsp[-1].minor.yy90; yylhsminor.yy90.quorum = strtol(yymsp[0].minor.yy0.z, NULL, 10); } + yymsp[-1].minor.yy90 = yylhsminor.yy90; break; case 109: /* db_optr ::= db_optr days */ -#line 290 "src/query/inc/sql.y" -{ yylhsminor.yy42 = yymsp[-1].minor.yy42; yylhsminor.yy42.daysPerFile = strtol(yymsp[0].minor.yy0.z, NULL, 10); } -#line 3146 "src/query/inc/sql.c" - yymsp[-1].minor.yy42 = yylhsminor.yy42; +{ yylhsminor.yy90 = yymsp[-1].minor.yy90; yylhsminor.yy90.daysPerFile = strtol(yymsp[0].minor.yy0.z, NULL, 10); } + yymsp[-1].minor.yy90 = yylhsminor.yy90; break; case 110: /* db_optr ::= db_optr minrows */ -#line 291 "src/query/inc/sql.y" -{ yylhsminor.yy42 = yymsp[-1].minor.yy42; yylhsminor.yy42.minRowsPerBlock = strtod(yymsp[0].minor.yy0.z, NULL); } -#line 3152 "src/query/inc/sql.c" - yymsp[-1].minor.yy42 = yylhsminor.yy42; +{ yylhsminor.yy90 = yymsp[-1].minor.yy90; yylhsminor.yy90.minRowsPerBlock = strtod(yymsp[0].minor.yy0.z, NULL); } + yymsp[-1].minor.yy90 = yylhsminor.yy90; break; case 111: /* db_optr ::= db_optr maxrows */ -#line 292 "src/query/inc/sql.y" -{ yylhsminor.yy42 = yymsp[-1].minor.yy42; yylhsminor.yy42.maxRowsPerBlock = strtod(yymsp[0].minor.yy0.z, NULL); } -#line 3158 "src/query/inc/sql.c" - yymsp[-1].minor.yy42 = yylhsminor.yy42; +{ yylhsminor.yy90 = yymsp[-1].minor.yy90; yylhsminor.yy90.maxRowsPerBlock = strtod(yymsp[0].minor.yy0.z, NULL); } + yymsp[-1].minor.yy90 = yylhsminor.yy90; break; case 112: /* db_optr ::= db_optr blocks */ case 127: /* alter_db_optr ::= alter_db_optr blocks */ yytestcase(yyruleno==127); -#line 293 "src/query/inc/sql.y" -{ yylhsminor.yy42 = yymsp[-1].minor.yy42; yylhsminor.yy42.numOfBlocks = strtol(yymsp[0].minor.yy0.z, NULL, 10); } -#line 3165 "src/query/inc/sql.c" - yymsp[-1].minor.yy42 = yylhsminor.yy42; +{ yylhsminor.yy90 = yymsp[-1].minor.yy90; yylhsminor.yy90.numOfBlocks = strtol(yymsp[0].minor.yy0.z, NULL, 10); } + yymsp[-1].minor.yy90 = yylhsminor.yy90; break; case 113: /* db_optr ::= db_optr ctime */ -#line 294 "src/query/inc/sql.y" -{ yylhsminor.yy42 = yymsp[-1].minor.yy42; yylhsminor.yy42.commitTime = strtol(yymsp[0].minor.yy0.z, NULL, 10); } -#line 3171 "src/query/inc/sql.c" - yymsp[-1].minor.yy42 = yylhsminor.yy42; +{ yylhsminor.yy90 = yymsp[-1].minor.yy90; yylhsminor.yy90.commitTime = strtol(yymsp[0].minor.yy0.z, NULL, 10); } + yymsp[-1].minor.yy90 = yylhsminor.yy90; break; case 114: /* db_optr ::= db_optr wal */ -#line 295 "src/query/inc/sql.y" -{ yylhsminor.yy42 = yymsp[-1].minor.yy42; yylhsminor.yy42.walLevel = strtol(yymsp[0].minor.yy0.z, NULL, 10); } -#line 3177 "src/query/inc/sql.c" - yymsp[-1].minor.yy42 = yylhsminor.yy42; +{ yylhsminor.yy90 = yymsp[-1].minor.yy90; yylhsminor.yy90.walLevel = strtol(yymsp[0].minor.yy0.z, NULL, 10); } + yymsp[-1].minor.yy90 = yylhsminor.yy90; break; case 115: /* db_optr ::= db_optr fsync */ -#line 296 "src/query/inc/sql.y" -{ yylhsminor.yy42 = yymsp[-1].minor.yy42; yylhsminor.yy42.fsyncPeriod = strtol(yymsp[0].minor.yy0.z, NULL, 10); } -#line 3183 "src/query/inc/sql.c" - yymsp[-1].minor.yy42 = yylhsminor.yy42; +{ yylhsminor.yy90 = yymsp[-1].minor.yy90; yylhsminor.yy90.fsyncPeriod = strtol(yymsp[0].minor.yy0.z, NULL, 10); } + yymsp[-1].minor.yy90 = yylhsminor.yy90; break; case 116: /* db_optr ::= db_optr comp */ case 128: /* alter_db_optr ::= alter_db_optr comp */ yytestcase(yyruleno==128); -#line 297 "src/query/inc/sql.y" -{ yylhsminor.yy42 = yymsp[-1].minor.yy42; yylhsminor.yy42.compressionLevel = strtol(yymsp[0].minor.yy0.z, NULL, 10); } -#line 3190 "src/query/inc/sql.c" - yymsp[-1].minor.yy42 = yylhsminor.yy42; +{ yylhsminor.yy90 = yymsp[-1].minor.yy90; yylhsminor.yy90.compressionLevel = strtol(yymsp[0].minor.yy0.z, NULL, 10); } + yymsp[-1].minor.yy90 = yylhsminor.yy90; break; case 117: /* db_optr ::= db_optr prec */ -#line 298 "src/query/inc/sql.y" -{ yylhsminor.yy42 = yymsp[-1].minor.yy42; yylhsminor.yy42.precision = yymsp[0].minor.yy0; } -#line 3196 "src/query/inc/sql.c" - yymsp[-1].minor.yy42 = yylhsminor.yy42; +{ yylhsminor.yy90 = yymsp[-1].minor.yy90; yylhsminor.yy90.precision = yymsp[0].minor.yy0; } + yymsp[-1].minor.yy90 = yylhsminor.yy90; break; case 118: /* db_optr ::= db_optr keep */ case 126: /* alter_db_optr ::= alter_db_optr keep */ yytestcase(yyruleno==126); -#line 299 "src/query/inc/sql.y" -{ yylhsminor.yy42 = yymsp[-1].minor.yy42; yylhsminor.yy42.keep = yymsp[0].minor.yy131; } -#line 3203 "src/query/inc/sql.c" - yymsp[-1].minor.yy42 = yylhsminor.yy42; +{ yylhsminor.yy90 = yymsp[-1].minor.yy90; yylhsminor.yy90.keep = yymsp[0].minor.yy421; } + yymsp[-1].minor.yy90 = yylhsminor.yy90; break; case 119: /* db_optr ::= db_optr update */ case 129: /* alter_db_optr ::= alter_db_optr update */ yytestcase(yyruleno==129); -#line 300 "src/query/inc/sql.y" -{ yylhsminor.yy42 = yymsp[-1].minor.yy42; yylhsminor.yy42.update = strtol(yymsp[0].minor.yy0.z, NULL, 10); } -#line 3210 "src/query/inc/sql.c" - yymsp[-1].minor.yy42 = yylhsminor.yy42; +{ yylhsminor.yy90 = yymsp[-1].minor.yy90; yylhsminor.yy90.update = strtol(yymsp[0].minor.yy0.z, NULL, 10); } + yymsp[-1].minor.yy90 = yylhsminor.yy90; break; case 120: /* db_optr ::= db_optr cachelast */ case 130: /* alter_db_optr ::= alter_db_optr cachelast */ yytestcase(yyruleno==130); -#line 301 "src/query/inc/sql.y" -{ yylhsminor.yy42 = yymsp[-1].minor.yy42; yylhsminor.yy42.cachelast = strtol(yymsp[0].minor.yy0.z, NULL, 10); } -#line 3217 "src/query/inc/sql.c" - yymsp[-1].minor.yy42 = yylhsminor.yy42; +{ yylhsminor.yy90 = yymsp[-1].minor.yy90; yylhsminor.yy90.cachelast = strtol(yymsp[0].minor.yy0.z, NULL, 10); } + yymsp[-1].minor.yy90 = yylhsminor.yy90; break; case 121: /* topic_optr ::= db_optr */ case 131: /* alter_topic_optr ::= alter_db_optr */ yytestcase(yyruleno==131); -#line 305 "src/query/inc/sql.y" -{ yylhsminor.yy42 = yymsp[0].minor.yy42; yylhsminor.yy42.dbType = TSDB_DB_TYPE_TOPIC; } -#line 3224 "src/query/inc/sql.c" - yymsp[0].minor.yy42 = yylhsminor.yy42; +{ yylhsminor.yy90 = yymsp[0].minor.yy90; yylhsminor.yy90.dbType = TSDB_DB_TYPE_TOPIC; } + yymsp[0].minor.yy90 = yylhsminor.yy90; break; case 122: /* topic_optr ::= topic_optr partitions */ case 132: /* alter_topic_optr ::= alter_topic_optr partitions */ yytestcase(yyruleno==132); -#line 306 "src/query/inc/sql.y" -{ yylhsminor.yy42 = yymsp[-1].minor.yy42; yylhsminor.yy42.partitions = strtol(yymsp[0].minor.yy0.z, NULL, 10); } -#line 3231 "src/query/inc/sql.c" - yymsp[-1].minor.yy42 = yylhsminor.yy42; +{ yylhsminor.yy90 = yymsp[-1].minor.yy90; yylhsminor.yy90.partitions = strtol(yymsp[0].minor.yy0.z, NULL, 10); } + yymsp[-1].minor.yy90 = yylhsminor.yy90; break; case 123: /* alter_db_optr ::= */ -#line 309 "src/query/inc/sql.y" -{ setDefaultCreateDbOption(&yymsp[1].minor.yy42); yymsp[1].minor.yy42.dbType = TSDB_DB_TYPE_DEFAULT;} -#line 3237 "src/query/inc/sql.c" +{ setDefaultCreateDbOption(&yymsp[1].minor.yy90); yymsp[1].minor.yy90.dbType = TSDB_DB_TYPE_DEFAULT;} break; case 133: /* typename ::= ids */ -#line 329 "src/query/inc/sql.y" { yymsp[0].minor.yy0.type = 0; - tSetColumnType (&yylhsminor.yy163, &yymsp[0].minor.yy0); + tSetColumnType (&yylhsminor.yy183, &yymsp[0].minor.yy0); } -#line 3245 "src/query/inc/sql.c" - yymsp[0].minor.yy163 = yylhsminor.yy163; + yymsp[0].minor.yy183 = yylhsminor.yy183; break; case 134: /* typename ::= ids LP signed RP */ -#line 335 "src/query/inc/sql.y" { - if (yymsp[-1].minor.yy459 <= 0) { + if (yymsp[-1].minor.yy325 <= 0) { yymsp[-3].minor.yy0.type = 0; - tSetColumnType(&yylhsminor.yy163, &yymsp[-3].minor.yy0); + tSetColumnType(&yylhsminor.yy183, &yymsp[-3].minor.yy0); } else { - yymsp[-3].minor.yy0.type = -yymsp[-1].minor.yy459; // negative value of name length - tSetColumnType(&yylhsminor.yy163, &yymsp[-3].minor.yy0); + yymsp[-3].minor.yy0.type = -yymsp[-1].minor.yy325; // negative value of name length + tSetColumnType(&yylhsminor.yy183, &yymsp[-3].minor.yy0); } } -#line 3259 "src/query/inc/sql.c" - yymsp[-3].minor.yy163 = yylhsminor.yy163; + yymsp[-3].minor.yy183 = yylhsminor.yy183; break; case 135: /* typename ::= ids UNSIGNED */ -#line 346 "src/query/inc/sql.y" { yymsp[-1].minor.yy0.type = 0; yymsp[-1].minor.yy0.n = ((yymsp[0].minor.yy0.z + yymsp[0].minor.yy0.n) - yymsp[-1].minor.yy0.z); - tSetColumnType (&yylhsminor.yy163, &yymsp[-1].minor.yy0); + tSetColumnType (&yylhsminor.yy183, &yymsp[-1].minor.yy0); } -#line 3269 "src/query/inc/sql.c" - yymsp[-1].minor.yy163 = yylhsminor.yy163; + yymsp[-1].minor.yy183 = yylhsminor.yy183; break; case 136: /* signed ::= INTEGER */ -#line 353 "src/query/inc/sql.y" -{ yylhsminor.yy459 = strtol(yymsp[0].minor.yy0.z, NULL, 10); } -#line 3275 "src/query/inc/sql.c" - yymsp[0].minor.yy459 = yylhsminor.yy459; +{ yylhsminor.yy325 = strtol(yymsp[0].minor.yy0.z, NULL, 10); } + yymsp[0].minor.yy325 = yylhsminor.yy325; break; case 137: /* signed ::= PLUS INTEGER */ -#line 354 "src/query/inc/sql.y" -{ yymsp[-1].minor.yy459 = strtol(yymsp[0].minor.yy0.z, NULL, 10); } -#line 3281 "src/query/inc/sql.c" +{ yymsp[-1].minor.yy325 = strtol(yymsp[0].minor.yy0.z, NULL, 10); } break; case 138: /* signed ::= MINUS INTEGER */ -#line 355 "src/query/inc/sql.y" -{ yymsp[-1].minor.yy459 = -strtol(yymsp[0].minor.yy0.z, NULL, 10);} -#line 3286 "src/query/inc/sql.c" +{ yymsp[-1].minor.yy325 = -strtol(yymsp[0].minor.yy0.z, NULL, 10);} break; case 142: /* cmd ::= CREATE TABLE create_table_list */ -#line 361 "src/query/inc/sql.y" -{ pInfo->type = TSDB_SQL_CREATE_TABLE; pInfo->pCreateTableInfo = yymsp[0].minor.yy272;} -#line 3291 "src/query/inc/sql.c" +{ pInfo->type = TSDB_SQL_CREATE_TABLE; pInfo->pCreateTableInfo = yymsp[0].minor.yy438;} break; case 143: /* create_table_list ::= create_from_stable */ -#line 365 "src/query/inc/sql.y" { SCreateTableSql* pCreateTable = calloc(1, sizeof(SCreateTableSql)); pCreateTable->childTableInfo = taosArrayInit(4, sizeof(SCreatedTableInfo)); - taosArrayPush(pCreateTable->childTableInfo, &yymsp[0].minor.yy96); + taosArrayPush(pCreateTable->childTableInfo, &yymsp[0].minor.yy152); pCreateTable->type = TSQL_CREATE_TABLE_FROM_STABLE; - yylhsminor.yy272 = pCreateTable; + yylhsminor.yy438 = pCreateTable; } -#line 3303 "src/query/inc/sql.c" - yymsp[0].minor.yy272 = yylhsminor.yy272; + yymsp[0].minor.yy438 = yylhsminor.yy438; break; case 144: /* create_table_list ::= create_table_list create_from_stable */ -#line 374 "src/query/inc/sql.y" { - taosArrayPush(yymsp[-1].minor.yy272->childTableInfo, &yymsp[0].minor.yy96); - yylhsminor.yy272 = yymsp[-1].minor.yy272; + taosArrayPush(yymsp[-1].minor.yy438->childTableInfo, &yymsp[0].minor.yy152); + yylhsminor.yy438 = yymsp[-1].minor.yy438; } -#line 3312 "src/query/inc/sql.c" - yymsp[-1].minor.yy272 = yylhsminor.yy272; + yymsp[-1].minor.yy438 = yylhsminor.yy438; break; case 145: /* create_table_args ::= ifnotexists ids cpxName LP columnlist RP */ -#line 380 "src/query/inc/sql.y" { - yylhsminor.yy272 = tSetCreateTableInfo(yymsp[-1].minor.yy131, NULL, NULL, TSQL_CREATE_TABLE); - setSqlInfo(pInfo, yylhsminor.yy272, NULL, TSDB_SQL_CREATE_TABLE); + yylhsminor.yy438 = tSetCreateTableInfo(yymsp[-1].minor.yy421, NULL, NULL, TSQL_CREATE_TABLE); + setSqlInfo(pInfo, yylhsminor.yy438, 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); } -#line 3324 "src/query/inc/sql.c" - yymsp[-5].minor.yy272 = yylhsminor.yy272; + yymsp[-5].minor.yy438 = yylhsminor.yy438; break; case 146: /* create_stable_args ::= ifnotexists ids cpxName LP columnlist RP TAGS LP columnlist RP */ -#line 390 "src/query/inc/sql.y" { - yylhsminor.yy272 = tSetCreateTableInfo(yymsp[-5].minor.yy131, yymsp[-1].minor.yy131, NULL, TSQL_CREATE_STABLE); - setSqlInfo(pInfo, yylhsminor.yy272, NULL, TSDB_SQL_CREATE_TABLE); + yylhsminor.yy438 = tSetCreateTableInfo(yymsp[-5].minor.yy421, yymsp[-1].minor.yy421, NULL, TSQL_CREATE_STABLE); + setSqlInfo(pInfo, yylhsminor.yy438, 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); } -#line 3336 "src/query/inc/sql.c" - yymsp[-9].minor.yy272 = yylhsminor.yy272; + yymsp[-9].minor.yy438 = yylhsminor.yy438; break; case 147: /* create_from_stable ::= ifnotexists ids cpxName USING ids cpxName TAGS LP tagitemlist RP */ -#line 401 "src/query/inc/sql.y" { yymsp[-5].minor.yy0.n += yymsp[-4].minor.yy0.n; yymsp[-8].minor.yy0.n += yymsp[-7].minor.yy0.n; - yylhsminor.yy96 = createNewChildTableInfo(&yymsp[-5].minor.yy0, NULL, yymsp[-1].minor.yy131, &yymsp[-8].minor.yy0, &yymsp[-9].minor.yy0); + yylhsminor.yy152 = createNewChildTableInfo(&yymsp[-5].minor.yy0, NULL, yymsp[-1].minor.yy421, &yymsp[-8].minor.yy0, &yymsp[-9].minor.yy0); } -#line 3346 "src/query/inc/sql.c" - yymsp[-9].minor.yy96 = yylhsminor.yy96; + yymsp[-9].minor.yy152 = yylhsminor.yy152; break; case 148: /* create_from_stable ::= ifnotexists ids cpxName USING ids cpxName LP tagNamelist RP TAGS LP tagitemlist RP */ -#line 407 "src/query/inc/sql.y" { yymsp[-8].minor.yy0.n += yymsp[-7].minor.yy0.n; yymsp[-11].minor.yy0.n += yymsp[-10].minor.yy0.n; - yylhsminor.yy96 = createNewChildTableInfo(&yymsp[-8].minor.yy0, yymsp[-5].minor.yy131, yymsp[-1].minor.yy131, &yymsp[-11].minor.yy0, &yymsp[-12].minor.yy0); + yylhsminor.yy152 = createNewChildTableInfo(&yymsp[-8].minor.yy0, yymsp[-5].minor.yy421, yymsp[-1].minor.yy421, &yymsp[-11].minor.yy0, &yymsp[-12].minor.yy0); } -#line 3356 "src/query/inc/sql.c" - yymsp[-12].minor.yy96 = yylhsminor.yy96; + yymsp[-12].minor.yy152 = yylhsminor.yy152; break; case 149: /* tagNamelist ::= tagNamelist COMMA ids */ -#line 415 "src/query/inc/sql.y" -{taosArrayPush(yymsp[-2].minor.yy131, &yymsp[0].minor.yy0); yylhsminor.yy131 = yymsp[-2].minor.yy131; } -#line 3362 "src/query/inc/sql.c" - yymsp[-2].minor.yy131 = yylhsminor.yy131; +{taosArrayPush(yymsp[-2].minor.yy421, &yymsp[0].minor.yy0); yylhsminor.yy421 = yymsp[-2].minor.yy421; } + yymsp[-2].minor.yy421 = yylhsminor.yy421; break; case 150: /* tagNamelist ::= ids */ -#line 416 "src/query/inc/sql.y" -{yylhsminor.yy131 = taosArrayInit(4, sizeof(SStrToken)); taosArrayPush(yylhsminor.yy131, &yymsp[0].minor.yy0);} -#line 3368 "src/query/inc/sql.c" - yymsp[0].minor.yy131 = yylhsminor.yy131; +{yylhsminor.yy421 = taosArrayInit(4, sizeof(SStrToken)); taosArrayPush(yylhsminor.yy421, &yymsp[0].minor.yy0);} + yymsp[0].minor.yy421 = yylhsminor.yy421; break; case 151: /* create_table_args ::= ifnotexists ids cpxName AS select */ -#line 420 "src/query/inc/sql.y" { - yylhsminor.yy272 = tSetCreateTableInfo(NULL, NULL, yymsp[0].minor.yy256, TSQL_CREATE_STREAM); - setSqlInfo(pInfo, yylhsminor.yy272, NULL, TSDB_SQL_CREATE_TABLE); + yylhsminor.yy438 = tSetCreateTableInfo(NULL, NULL, yymsp[0].minor.yy56, TSQL_CREATE_STREAM); + setSqlInfo(pInfo, yylhsminor.yy438, 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); } -#line 3380 "src/query/inc/sql.c" - yymsp[-4].minor.yy272 = yylhsminor.yy272; + yymsp[-4].minor.yy438 = yylhsminor.yy438; break; case 152: /* columnlist ::= columnlist COMMA column */ -#line 431 "src/query/inc/sql.y" -{taosArrayPush(yymsp[-2].minor.yy131, &yymsp[0].minor.yy163); yylhsminor.yy131 = yymsp[-2].minor.yy131; } -#line 3386 "src/query/inc/sql.c" - yymsp[-2].minor.yy131 = yylhsminor.yy131; +{taosArrayPush(yymsp[-2].minor.yy421, &yymsp[0].minor.yy183); yylhsminor.yy421 = yymsp[-2].minor.yy421; } + yymsp[-2].minor.yy421 = yylhsminor.yy421; break; case 153: /* columnlist ::= column */ -#line 432 "src/query/inc/sql.y" -{yylhsminor.yy131 = taosArrayInit(4, sizeof(TAOS_FIELD)); taosArrayPush(yylhsminor.yy131, &yymsp[0].minor.yy163);} -#line 3392 "src/query/inc/sql.c" - yymsp[0].minor.yy131 = yylhsminor.yy131; +{yylhsminor.yy421 = taosArrayInit(4, sizeof(TAOS_FIELD)); taosArrayPush(yylhsminor.yy421, &yymsp[0].minor.yy183);} + yymsp[0].minor.yy421 = yylhsminor.yy421; break; case 154: /* column ::= ids typename */ -#line 436 "src/query/inc/sql.y" { - tSetColumnInfo(&yylhsminor.yy163, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy163); + tSetColumnInfo(&yylhsminor.yy183, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy183); } -#line 3400 "src/query/inc/sql.c" - yymsp[-1].minor.yy163 = yylhsminor.yy163; + yymsp[-1].minor.yy183 = yylhsminor.yy183; break; case 161: /* tagitem ::= NULL */ -#line 451 "src/query/inc/sql.y" -{ yymsp[0].minor.yy0.type = 0; tVariantCreate(&yylhsminor.yy516, &yymsp[0].minor.yy0); } -#line 3406 "src/query/inc/sql.c" - yymsp[0].minor.yy516 = yylhsminor.yy516; +{ yymsp[0].minor.yy0.type = 0; tVariantCreate(&yylhsminor.yy430, &yymsp[0].minor.yy0); } + yymsp[0].minor.yy430 = yylhsminor.yy430; break; case 162: /* tagitem ::= NOW */ -#line 452 "src/query/inc/sql.y" -{ yymsp[0].minor.yy0.type = TSDB_DATA_TYPE_TIMESTAMP; tVariantCreate(&yylhsminor.yy516, &yymsp[0].minor.yy0);} -#line 3412 "src/query/inc/sql.c" - yymsp[0].minor.yy516 = yylhsminor.yy516; +{ yymsp[0].minor.yy0.type = TSDB_DATA_TYPE_TIMESTAMP; tVariantCreate(&yylhsminor.yy430, &yymsp[0].minor.yy0);} + yymsp[0].minor.yy430 = yylhsminor.yy430; break; case 163: /* tagitem ::= MINUS INTEGER */ case 164: /* tagitem ::= MINUS FLOAT */ yytestcase(yyruleno==164); case 165: /* tagitem ::= PLUS INTEGER */ yytestcase(yyruleno==165); case 166: /* tagitem ::= PLUS FLOAT */ yytestcase(yyruleno==166); -#line 454 "src/query/inc/sql.y" { yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; yymsp[-1].minor.yy0.type = yymsp[0].minor.yy0.type; toTSDBType(yymsp[-1].minor.yy0.type); - tVariantCreate(&yylhsminor.yy516, &yymsp[-1].minor.yy0); + tVariantCreate(&yylhsminor.yy430, &yymsp[-1].minor.yy0); } -#line 3426 "src/query/inc/sql.c" - yymsp[-1].minor.yy516 = yylhsminor.yy516; + yymsp[-1].minor.yy430 = yylhsminor.yy430; break; - case 167: /* select ::= SELECT selcollist from where_opt interval_opt sliding_opt session_option windowstate_option fill_opt groupby_opt having_opt orderby_opt slimit_opt limit_opt */ -#line 485 "src/query/inc/sql.y" + case 167: /* select ::= SELECT selcollist from where_opt interval_option sliding_opt session_option windowstate_option fill_opt groupby_opt having_opt orderby_opt slimit_opt limit_opt */ { - yylhsminor.yy256 = tSetQuerySqlNode(&yymsp[-13].minor.yy0, yymsp[-12].minor.yy131, yymsp[-11].minor.yy544, yymsp[-10].minor.yy46, yymsp[-4].minor.yy131, yymsp[-2].minor.yy131, &yymsp[-9].minor.yy530, &yymsp[-7].minor.yy39, &yymsp[-6].minor.yy538, &yymsp[-8].minor.yy0, yymsp[-5].minor.yy131, &yymsp[0].minor.yy284, &yymsp[-1].minor.yy284, yymsp[-3].minor.yy46); + yylhsminor.yy56 = tSetQuerySqlNode(&yymsp[-13].minor.yy0, yymsp[-12].minor.yy421, yymsp[-11].minor.yy8, yymsp[-10].minor.yy439, yymsp[-4].minor.yy421, yymsp[-2].minor.yy421, &yymsp[-9].minor.yy400, &yymsp[-7].minor.yy147, &yymsp[-6].minor.yy40, &yymsp[-8].minor.yy0, yymsp[-5].minor.yy421, &yymsp[0].minor.yy166, &yymsp[-1].minor.yy166, yymsp[-3].minor.yy439); } -#line 3434 "src/query/inc/sql.c" - yymsp[-13].minor.yy256 = yylhsminor.yy256; + yymsp[-13].minor.yy56 = yylhsminor.yy56; break; case 168: /* select ::= LP select RP */ -#line 489 "src/query/inc/sql.y" -{yymsp[-2].minor.yy256 = yymsp[-1].minor.yy256;} -#line 3440 "src/query/inc/sql.c" +{yymsp[-2].minor.yy56 = yymsp[-1].minor.yy56;} break; case 169: /* union ::= select */ -#line 493 "src/query/inc/sql.y" -{ yylhsminor.yy131 = setSubclause(NULL, yymsp[0].minor.yy256); } -#line 3445 "src/query/inc/sql.c" - yymsp[0].minor.yy131 = yylhsminor.yy131; +{ yylhsminor.yy421 = setSubclause(NULL, yymsp[0].minor.yy56); } + yymsp[0].minor.yy421 = yylhsminor.yy421; break; case 170: /* union ::= union UNION ALL select */ -#line 494 "src/query/inc/sql.y" -{ yylhsminor.yy131 = appendSelectClause(yymsp[-3].minor.yy131, yymsp[0].minor.yy256); } -#line 3451 "src/query/inc/sql.c" - yymsp[-3].minor.yy131 = yylhsminor.yy131; +{ yylhsminor.yy421 = appendSelectClause(yymsp[-3].minor.yy421, yymsp[0].minor.yy56); } + yymsp[-3].minor.yy421 = yylhsminor.yy421; break; case 171: /* cmd ::= union */ -#line 496 "src/query/inc/sql.y" -{ setSqlInfo(pInfo, yymsp[0].minor.yy131, NULL, TSDB_SQL_SELECT); } -#line 3457 "src/query/inc/sql.c" +{ setSqlInfo(pInfo, yymsp[0].minor.yy421, NULL, TSDB_SQL_SELECT); } break; case 172: /* select ::= SELECT selcollist */ -#line 503 "src/query/inc/sql.y" { - yylhsminor.yy256 = tSetQuerySqlNode(&yymsp[-1].minor.yy0, yymsp[0].minor.yy131, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + yylhsminor.yy56 = tSetQuerySqlNode(&yymsp[-1].minor.yy0, yymsp[0].minor.yy421, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); } -#line 3464 "src/query/inc/sql.c" - yymsp[-1].minor.yy256 = yylhsminor.yy256; + yymsp[-1].minor.yy56 = yylhsminor.yy56; break; case 173: /* sclp ::= selcollist COMMA */ -#line 515 "src/query/inc/sql.y" -{yylhsminor.yy131 = yymsp[-1].minor.yy131;} -#line 3470 "src/query/inc/sql.c" - yymsp[-1].minor.yy131 = yylhsminor.yy131; +{yylhsminor.yy421 = yymsp[-1].minor.yy421;} + yymsp[-1].minor.yy421 = yylhsminor.yy421; break; case 174: /* sclp ::= */ - case 204: /* orderby_opt ::= */ yytestcase(yyruleno==204); -#line 516 "src/query/inc/sql.y" -{yymsp[1].minor.yy131 = 0;} -#line 3477 "src/query/inc/sql.c" + case 206: /* orderby_opt ::= */ yytestcase(yyruleno==206); +{yymsp[1].minor.yy421 = 0;} break; case 175: /* selcollist ::= sclp distinct expr as */ -#line 517 "src/query/inc/sql.y" { - yylhsminor.yy131 = tSqlExprListAppend(yymsp[-3].minor.yy131, yymsp[-1].minor.yy46, yymsp[-2].minor.yy0.n? &yymsp[-2].minor.yy0:0, yymsp[0].minor.yy0.n?&yymsp[0].minor.yy0:0); + yylhsminor.yy421 = tSqlExprListAppend(yymsp[-3].minor.yy421, yymsp[-1].minor.yy439, yymsp[-2].minor.yy0.n? &yymsp[-2].minor.yy0:0, yymsp[0].minor.yy0.n?&yymsp[0].minor.yy0:0); } -#line 3484 "src/query/inc/sql.c" - yymsp[-3].minor.yy131 = yylhsminor.yy131; + yymsp[-3].minor.yy421 = yylhsminor.yy421; break; case 176: /* selcollist ::= sclp STAR */ -#line 521 "src/query/inc/sql.y" { tSqlExpr *pNode = tSqlExprCreateIdValue(NULL, TK_ALL); - yylhsminor.yy131 = tSqlExprListAppend(yymsp[-1].minor.yy131, pNode, 0, 0); + yylhsminor.yy421 = tSqlExprListAppend(yymsp[-1].minor.yy421, pNode, 0, 0); } -#line 3493 "src/query/inc/sql.c" - yymsp[-1].minor.yy131 = yylhsminor.yy131; + yymsp[-1].minor.yy421 = yylhsminor.yy421; break; case 177: /* as ::= AS ids */ -#line 529 "src/query/inc/sql.y" { yymsp[-1].minor.yy0 = yymsp[0].minor.yy0; } -#line 3499 "src/query/inc/sql.c" break; case 178: /* as ::= ids */ -#line 530 "src/query/inc/sql.y" { yylhsminor.yy0 = yymsp[0].minor.yy0; } -#line 3504 "src/query/inc/sql.c" yymsp[0].minor.yy0 = yylhsminor.yy0; break; case 179: /* as ::= */ -#line 531 "src/query/inc/sql.y" { yymsp[1].minor.yy0.n = 0; } -#line 3510 "src/query/inc/sql.c" break; case 180: /* distinct ::= DISTINCT */ -#line 534 "src/query/inc/sql.y" { yylhsminor.yy0 = yymsp[0].minor.yy0; } -#line 3515 "src/query/inc/sql.c" yymsp[0].minor.yy0 = yylhsminor.yy0; break; case 182: /* from ::= FROM tablelist */ case 183: /* from ::= FROM sub */ yytestcase(yyruleno==183); -#line 540 "src/query/inc/sql.y" -{yymsp[-1].minor.yy544 = yymsp[0].minor.yy544;} -#line 3522 "src/query/inc/sql.c" +{yymsp[-1].minor.yy8 = yymsp[0].minor.yy8;} break; case 184: /* sub ::= LP union RP */ -#line 545 "src/query/inc/sql.y" -{yymsp[-2].minor.yy544 = addSubqueryElem(NULL, yymsp[-1].minor.yy131, NULL);} -#line 3527 "src/query/inc/sql.c" +{yymsp[-2].minor.yy8 = addSubqueryElem(NULL, yymsp[-1].minor.yy421, NULL);} break; case 185: /* sub ::= LP union RP ids */ -#line 546 "src/query/inc/sql.y" -{yymsp[-3].minor.yy544 = addSubqueryElem(NULL, yymsp[-2].minor.yy131, &yymsp[0].minor.yy0);} -#line 3532 "src/query/inc/sql.c" +{yymsp[-3].minor.yy8 = addSubqueryElem(NULL, yymsp[-2].minor.yy421, &yymsp[0].minor.yy0);} break; case 186: /* sub ::= sub COMMA LP union RP ids */ -#line 547 "src/query/inc/sql.y" -{yylhsminor.yy544 = addSubqueryElem(yymsp[-5].minor.yy544, yymsp[-2].minor.yy131, &yymsp[0].minor.yy0);} -#line 3537 "src/query/inc/sql.c" - yymsp[-5].minor.yy544 = yylhsminor.yy544; +{yylhsminor.yy8 = addSubqueryElem(yymsp[-5].minor.yy8, yymsp[-2].minor.yy421, &yymsp[0].minor.yy0);} + yymsp[-5].minor.yy8 = yylhsminor.yy8; break; case 187: /* tablelist ::= ids cpxName */ -#line 551 "src/query/inc/sql.y" { yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; - yylhsminor.yy544 = setTableNameList(NULL, &yymsp[-1].minor.yy0, NULL); + yylhsminor.yy8 = setTableNameList(NULL, &yymsp[-1].minor.yy0, NULL); } -#line 3546 "src/query/inc/sql.c" - yymsp[-1].minor.yy544 = yylhsminor.yy544; + yymsp[-1].minor.yy8 = yylhsminor.yy8; break; case 188: /* tablelist ::= ids cpxName ids */ -#line 556 "src/query/inc/sql.y" { yymsp[-2].minor.yy0.n += yymsp[-1].minor.yy0.n; - yylhsminor.yy544 = setTableNameList(NULL, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0); + yylhsminor.yy8 = setTableNameList(NULL, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0); } -#line 3555 "src/query/inc/sql.c" - yymsp[-2].minor.yy544 = yylhsminor.yy544; + yymsp[-2].minor.yy8 = yylhsminor.yy8; break; case 189: /* tablelist ::= tablelist COMMA ids cpxName */ -#line 561 "src/query/inc/sql.y" { yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; - yylhsminor.yy544 = setTableNameList(yymsp[-3].minor.yy544, &yymsp[-1].minor.yy0, NULL); + yylhsminor.yy8 = setTableNameList(yymsp[-3].minor.yy8, &yymsp[-1].minor.yy0, NULL); } -#line 3564 "src/query/inc/sql.c" - yymsp[-3].minor.yy544 = yylhsminor.yy544; + yymsp[-3].minor.yy8 = yylhsminor.yy8; break; case 190: /* tablelist ::= tablelist COMMA ids cpxName ids */ -#line 566 "src/query/inc/sql.y" { yymsp[-2].minor.yy0.n += yymsp[-1].minor.yy0.n; - yylhsminor.yy544 = setTableNameList(yymsp[-4].minor.yy544, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0); + yylhsminor.yy8 = setTableNameList(yymsp[-4].minor.yy8, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0); } -#line 3573 "src/query/inc/sql.c" - yymsp[-4].minor.yy544 = yylhsminor.yy544; + yymsp[-4].minor.yy8 = yylhsminor.yy8; break; case 191: /* tmvar ::= VARIABLE */ -#line 573 "src/query/inc/sql.y" {yylhsminor.yy0 = yymsp[0].minor.yy0;} -#line 3579 "src/query/inc/sql.c" yymsp[0].minor.yy0 = yylhsminor.yy0; break; - case 192: /* interval_opt ::= INTERVAL LP tmvar RP */ -#line 576 "src/query/inc/sql.y" -{yymsp[-3].minor.yy530.interval = yymsp[-1].minor.yy0; yymsp[-3].minor.yy530.offset.n = 0;} -#line 3585 "src/query/inc/sql.c" + case 192: /* interval_option ::= intervalKey LP tmvar RP */ +{yylhsminor.yy400.interval = yymsp[-1].minor.yy0; yylhsminor.yy400.offset.n = 0; yylhsminor.yy400.token = yymsp[-3].minor.yy104;} + yymsp[-3].minor.yy400 = yylhsminor.yy400; + break; + case 193: /* interval_option ::= intervalKey LP tmvar COMMA tmvar RP */ +{yylhsminor.yy400.interval = yymsp[-3].minor.yy0; yylhsminor.yy400.offset = yymsp[-1].minor.yy0; yylhsminor.yy400.token = yymsp[-5].minor.yy104;} + yymsp[-5].minor.yy400 = yylhsminor.yy400; break; - case 193: /* interval_opt ::= INTERVAL LP tmvar COMMA tmvar RP */ -#line 577 "src/query/inc/sql.y" -{yymsp[-5].minor.yy530.interval = yymsp[-3].minor.yy0; yymsp[-5].minor.yy530.offset = yymsp[-1].minor.yy0;} -#line 3590 "src/query/inc/sql.c" + case 194: /* interval_option ::= */ +{memset(&yymsp[1].minor.yy400, 0, sizeof(yymsp[1].minor.yy400));} break; - case 194: /* interval_opt ::= */ -#line 578 "src/query/inc/sql.y" -{memset(&yymsp[1].minor.yy530, 0, sizeof(yymsp[1].minor.yy530));} -#line 3595 "src/query/inc/sql.c" + case 195: /* intervalKey ::= INTERVAL */ +{yymsp[0].minor.yy104 = TK_INTERVAL;} break; - case 195: /* session_option ::= */ -#line 581 "src/query/inc/sql.y" -{yymsp[1].minor.yy39.col.n = 0; yymsp[1].minor.yy39.gap.n = 0;} -#line 3600 "src/query/inc/sql.c" + case 196: /* intervalKey ::= EVERY */ +{yymsp[0].minor.yy104 = TK_EVERY; } break; - case 196: /* session_option ::= SESSION LP ids cpxName COMMA tmvar RP */ -#line 582 "src/query/inc/sql.y" + case 197: /* session_option ::= */ +{yymsp[1].minor.yy147.col.n = 0; yymsp[1].minor.yy147.gap.n = 0;} + break; + case 198: /* session_option ::= SESSION LP ids cpxName COMMA tmvar RP */ { yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n; - yymsp[-6].minor.yy39.col = yymsp[-4].minor.yy0; - yymsp[-6].minor.yy39.gap = yymsp[-1].minor.yy0; + yymsp[-6].minor.yy147.col = yymsp[-4].minor.yy0; + yymsp[-6].minor.yy147.gap = yymsp[-1].minor.yy0; } -#line 3609 "src/query/inc/sql.c" break; - case 197: /* windowstate_option ::= */ -#line 588 "src/query/inc/sql.y" -{ yymsp[1].minor.yy538.col.n = 0; yymsp[1].minor.yy538.col.z = NULL;} -#line 3614 "src/query/inc/sql.c" + case 199: /* windowstate_option ::= */ +{ yymsp[1].minor.yy40.col.n = 0; yymsp[1].minor.yy40.col.z = NULL;} break; - case 198: /* windowstate_option ::= STATE_WINDOW LP ids RP */ -#line 589 "src/query/inc/sql.y" -{ yymsp[-3].minor.yy538.col = yymsp[-1].minor.yy0; } -#line 3619 "src/query/inc/sql.c" + case 200: /* windowstate_option ::= STATE_WINDOW LP ids RP */ +{ yymsp[-3].minor.yy40.col = yymsp[-1].minor.yy0; } break; - case 199: /* fill_opt ::= */ -#line 593 "src/query/inc/sql.y" -{ yymsp[1].minor.yy131 = 0; } -#line 3624 "src/query/inc/sql.c" + case 201: /* fill_opt ::= */ +{ yymsp[1].minor.yy421 = 0; } break; - case 200: /* fill_opt ::= FILL LP ID COMMA tagitemlist RP */ -#line 594 "src/query/inc/sql.y" + case 202: /* 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.yy131, &A, -1, 0); - yymsp[-5].minor.yy131 = yymsp[-1].minor.yy131; + tVariantListInsert(yymsp[-1].minor.yy421, &A, -1, 0); + yymsp[-5].minor.yy421 = yymsp[-1].minor.yy421; } -#line 3636 "src/query/inc/sql.c" break; - case 201: /* fill_opt ::= FILL LP ID RP */ -#line 603 "src/query/inc/sql.y" + case 203: /* fill_opt ::= FILL LP ID RP */ { toTSDBType(yymsp[-1].minor.yy0.type); - yymsp[-3].minor.yy131 = tVariantListAppendToken(NULL, &yymsp[-1].minor.yy0, -1); + yymsp[-3].minor.yy421 = tVariantListAppendToken(NULL, &yymsp[-1].minor.yy0, -1); } -#line 3644 "src/query/inc/sql.c" break; - case 202: /* sliding_opt ::= SLIDING LP tmvar RP */ -#line 609 "src/query/inc/sql.y" + case 204: /* sliding_opt ::= SLIDING LP tmvar RP */ {yymsp[-3].minor.yy0 = yymsp[-1].minor.yy0; } -#line 3649 "src/query/inc/sql.c" break; - case 203: /* sliding_opt ::= */ -#line 610 "src/query/inc/sql.y" + case 205: /* sliding_opt ::= */ {yymsp[1].minor.yy0.n = 0; yymsp[1].minor.yy0.z = NULL; yymsp[1].minor.yy0.type = 0; } -#line 3654 "src/query/inc/sql.c" break; - case 205: /* orderby_opt ::= ORDER BY sortlist */ -#line 622 "src/query/inc/sql.y" -{yymsp[-2].minor.yy131 = yymsp[0].minor.yy131;} -#line 3659 "src/query/inc/sql.c" + case 207: /* orderby_opt ::= ORDER BY sortlist */ +{yymsp[-2].minor.yy421 = yymsp[0].minor.yy421;} break; - case 206: /* sortlist ::= sortlist COMMA item sortorder */ -#line 624 "src/query/inc/sql.y" + case 208: /* sortlist ::= sortlist COMMA item sortorder */ { - yylhsminor.yy131 = tVariantListAppend(yymsp[-3].minor.yy131, &yymsp[-1].minor.yy516, yymsp[0].minor.yy43); + yylhsminor.yy421 = tVariantListAppend(yymsp[-3].minor.yy421, &yymsp[-1].minor.yy430, yymsp[0].minor.yy96); } -#line 3666 "src/query/inc/sql.c" - yymsp[-3].minor.yy131 = yylhsminor.yy131; + yymsp[-3].minor.yy421 = yylhsminor.yy421; break; - case 207: /* sortlist ::= item sortorder */ -#line 628 "src/query/inc/sql.y" + case 209: /* sortlist ::= item sortorder */ { - yylhsminor.yy131 = tVariantListAppend(NULL, &yymsp[-1].minor.yy516, yymsp[0].minor.yy43); + yylhsminor.yy421 = tVariantListAppend(NULL, &yymsp[-1].minor.yy430, yymsp[0].minor.yy96); } -#line 3674 "src/query/inc/sql.c" - yymsp[-1].minor.yy131 = yylhsminor.yy131; + yymsp[-1].minor.yy421 = yylhsminor.yy421; break; - case 208: /* item ::= ids cpxName */ -#line 633 "src/query/inc/sql.y" + case 210: /* item ::= ids cpxName */ { toTSDBType(yymsp[-1].minor.yy0.type); yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; - tVariantCreate(&yylhsminor.yy516, &yymsp[-1].minor.yy0); + tVariantCreate(&yylhsminor.yy430, &yymsp[-1].minor.yy0); } -#line 3685 "src/query/inc/sql.c" - yymsp[-1].minor.yy516 = yylhsminor.yy516; - break; - case 209: /* sortorder ::= ASC */ -#line 641 "src/query/inc/sql.y" -{ yymsp[0].minor.yy43 = TSDB_ORDER_ASC; } -#line 3691 "src/query/inc/sql.c" - break; - case 210: /* sortorder ::= DESC */ -#line 642 "src/query/inc/sql.y" -{ yymsp[0].minor.yy43 = TSDB_ORDER_DESC;} -#line 3696 "src/query/inc/sql.c" - break; - case 211: /* sortorder ::= */ -#line 643 "src/query/inc/sql.y" -{ yymsp[1].minor.yy43 = TSDB_ORDER_ASC; } -#line 3701 "src/query/inc/sql.c" - break; - case 212: /* groupby_opt ::= */ -#line 651 "src/query/inc/sql.y" -{ yymsp[1].minor.yy131 = 0;} -#line 3706 "src/query/inc/sql.c" - break; - case 213: /* groupby_opt ::= GROUP BY grouplist */ -#line 652 "src/query/inc/sql.y" -{ yymsp[-2].minor.yy131 = yymsp[0].minor.yy131;} -#line 3711 "src/query/inc/sql.c" - break; - case 214: /* grouplist ::= grouplist COMMA item */ -#line 654 "src/query/inc/sql.y" + yymsp[-1].minor.yy430 = yylhsminor.yy430; + break; + case 211: /* sortorder ::= ASC */ +{ yymsp[0].minor.yy96 = TSDB_ORDER_ASC; } + break; + case 212: /* sortorder ::= DESC */ +{ yymsp[0].minor.yy96 = TSDB_ORDER_DESC;} + break; + case 213: /* sortorder ::= */ +{ yymsp[1].minor.yy96 = TSDB_ORDER_ASC; } + break; + case 214: /* groupby_opt ::= */ +{ yymsp[1].minor.yy421 = 0;} + break; + case 215: /* groupby_opt ::= GROUP BY grouplist */ +{ yymsp[-2].minor.yy421 = yymsp[0].minor.yy421;} + break; + case 216: /* grouplist ::= grouplist COMMA item */ { - yylhsminor.yy131 = tVariantListAppend(yymsp[-2].minor.yy131, &yymsp[0].minor.yy516, -1); + yylhsminor.yy421 = tVariantListAppend(yymsp[-2].minor.yy421, &yymsp[0].minor.yy430, -1); } -#line 3718 "src/query/inc/sql.c" - yymsp[-2].minor.yy131 = yylhsminor.yy131; + yymsp[-2].minor.yy421 = yylhsminor.yy421; break; - case 215: /* grouplist ::= item */ -#line 658 "src/query/inc/sql.y" + case 217: /* grouplist ::= item */ { - yylhsminor.yy131 = tVariantListAppend(NULL, &yymsp[0].minor.yy516, -1); + yylhsminor.yy421 = tVariantListAppend(NULL, &yymsp[0].minor.yy430, -1); } -#line 3726 "src/query/inc/sql.c" - yymsp[0].minor.yy131 = yylhsminor.yy131; - break; - case 216: /* having_opt ::= */ - case 226: /* where_opt ::= */ yytestcase(yyruleno==226); - case 268: /* expritem ::= */ yytestcase(yyruleno==268); -#line 665 "src/query/inc/sql.y" -{yymsp[1].minor.yy46 = 0;} -#line 3734 "src/query/inc/sql.c" - break; - case 217: /* having_opt ::= HAVING expr */ - case 227: /* where_opt ::= WHERE expr */ yytestcase(yyruleno==227); -#line 666 "src/query/inc/sql.y" -{yymsp[-1].minor.yy46 = yymsp[0].minor.yy46;} -#line 3740 "src/query/inc/sql.c" - break; - case 218: /* limit_opt ::= */ - case 222: /* slimit_opt ::= */ yytestcase(yyruleno==222); -#line 670 "src/query/inc/sql.y" -{yymsp[1].minor.yy284.limit = -1; yymsp[1].minor.yy284.offset = 0;} -#line 3746 "src/query/inc/sql.c" - break; - case 219: /* limit_opt ::= LIMIT signed */ - case 223: /* slimit_opt ::= SLIMIT signed */ yytestcase(yyruleno==223); -#line 671 "src/query/inc/sql.y" -{yymsp[-1].minor.yy284.limit = yymsp[0].minor.yy459; yymsp[-1].minor.yy284.offset = 0;} -#line 3752 "src/query/inc/sql.c" - break; - case 220: /* limit_opt ::= LIMIT signed OFFSET signed */ -#line 673 "src/query/inc/sql.y" -{ yymsp[-3].minor.yy284.limit = yymsp[-2].minor.yy459; yymsp[-3].minor.yy284.offset = yymsp[0].minor.yy459;} -#line 3757 "src/query/inc/sql.c" - break; - case 221: /* limit_opt ::= LIMIT signed COMMA signed */ -#line 675 "src/query/inc/sql.y" -{ yymsp[-3].minor.yy284.limit = yymsp[0].minor.yy459; yymsp[-3].minor.yy284.offset = yymsp[-2].minor.yy459;} -#line 3762 "src/query/inc/sql.c" - break; - case 224: /* slimit_opt ::= SLIMIT signed SOFFSET signed */ -#line 681 "src/query/inc/sql.y" -{yymsp[-3].minor.yy284.limit = yymsp[-2].minor.yy459; yymsp[-3].minor.yy284.offset = yymsp[0].minor.yy459;} -#line 3767 "src/query/inc/sql.c" - break; - case 225: /* slimit_opt ::= SLIMIT signed COMMA signed */ -#line 683 "src/query/inc/sql.y" -{yymsp[-3].minor.yy284.limit = yymsp[0].minor.yy459; yymsp[-3].minor.yy284.offset = yymsp[-2].minor.yy459;} -#line 3772 "src/query/inc/sql.c" - break; - case 228: /* expr ::= LP expr RP */ -#line 696 "src/query/inc/sql.y" -{yylhsminor.yy46 = yymsp[-1].minor.yy46; yylhsminor.yy46->exprToken.z = yymsp[-2].minor.yy0.z; yylhsminor.yy46->exprToken.n = (yymsp[0].minor.yy0.z - yymsp[-2].minor.yy0.z + 1);} -#line 3777 "src/query/inc/sql.c" - yymsp[-2].minor.yy46 = yylhsminor.yy46; - break; - case 229: /* expr ::= ID */ -#line 698 "src/query/inc/sql.y" -{ yylhsminor.yy46 = tSqlExprCreateIdValue(&yymsp[0].minor.yy0, TK_ID);} -#line 3783 "src/query/inc/sql.c" - yymsp[0].minor.yy46 = yylhsminor.yy46; - break; - case 230: /* expr ::= ID DOT ID */ -#line 699 "src/query/inc/sql.y" -{ yymsp[-2].minor.yy0.n += (1+yymsp[0].minor.yy0.n); yylhsminor.yy46 = tSqlExprCreateIdValue(&yymsp[-2].minor.yy0, TK_ID);} -#line 3789 "src/query/inc/sql.c" - yymsp[-2].minor.yy46 = yylhsminor.yy46; - break; - case 231: /* expr ::= ID DOT STAR */ -#line 700 "src/query/inc/sql.y" -{ yymsp[-2].minor.yy0.n += (1+yymsp[0].minor.yy0.n); yylhsminor.yy46 = tSqlExprCreateIdValue(&yymsp[-2].minor.yy0, TK_ALL);} -#line 3795 "src/query/inc/sql.c" - yymsp[-2].minor.yy46 = yylhsminor.yy46; - break; - case 232: /* expr ::= INTEGER */ -#line 702 "src/query/inc/sql.y" -{ yylhsminor.yy46 = tSqlExprCreateIdValue(&yymsp[0].minor.yy0, TK_INTEGER);} -#line 3801 "src/query/inc/sql.c" - yymsp[0].minor.yy46 = yylhsminor.yy46; - break; - case 233: /* expr ::= MINUS INTEGER */ - case 234: /* expr ::= PLUS INTEGER */ yytestcase(yyruleno==234); -#line 703 "src/query/inc/sql.y" -{ yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; yymsp[-1].minor.yy0.type = TK_INTEGER; yylhsminor.yy46 = tSqlExprCreateIdValue(&yymsp[-1].minor.yy0, TK_INTEGER);} -#line 3808 "src/query/inc/sql.c" - yymsp[-1].minor.yy46 = yylhsminor.yy46; - break; - case 235: /* expr ::= FLOAT */ -#line 705 "src/query/inc/sql.y" -{ yylhsminor.yy46 = tSqlExprCreateIdValue(&yymsp[0].minor.yy0, TK_FLOAT);} -#line 3814 "src/query/inc/sql.c" - yymsp[0].minor.yy46 = yylhsminor.yy46; - break; - case 236: /* expr ::= MINUS FLOAT */ - case 237: /* expr ::= PLUS FLOAT */ yytestcase(yyruleno==237); -#line 706 "src/query/inc/sql.y" -{ yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; yymsp[-1].minor.yy0.type = TK_FLOAT; yylhsminor.yy46 = tSqlExprCreateIdValue(&yymsp[-1].minor.yy0, TK_FLOAT);} -#line 3821 "src/query/inc/sql.c" - yymsp[-1].minor.yy46 = yylhsminor.yy46; - break; - case 238: /* expr ::= STRING */ -#line 708 "src/query/inc/sql.y" -{ yylhsminor.yy46 = tSqlExprCreateIdValue(&yymsp[0].minor.yy0, TK_STRING);} -#line 3827 "src/query/inc/sql.c" - yymsp[0].minor.yy46 = yylhsminor.yy46; - break; - case 239: /* expr ::= NOW */ -#line 709 "src/query/inc/sql.y" -{ yylhsminor.yy46 = tSqlExprCreateIdValue(&yymsp[0].minor.yy0, TK_NOW); } -#line 3833 "src/query/inc/sql.c" - yymsp[0].minor.yy46 = yylhsminor.yy46; - break; - case 240: /* expr ::= VARIABLE */ -#line 710 "src/query/inc/sql.y" -{ yylhsminor.yy46 = tSqlExprCreateIdValue(&yymsp[0].minor.yy0, TK_VARIABLE);} -#line 3839 "src/query/inc/sql.c" - yymsp[0].minor.yy46 = yylhsminor.yy46; - break; - case 241: /* expr ::= PLUS VARIABLE */ - case 242: /* expr ::= MINUS VARIABLE */ yytestcase(yyruleno==242); -#line 711 "src/query/inc/sql.y" -{ yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; yymsp[-1].minor.yy0.type = TK_VARIABLE; yylhsminor.yy46 = tSqlExprCreateIdValue(&yymsp[-1].minor.yy0, TK_VARIABLE);} -#line 3846 "src/query/inc/sql.c" - yymsp[-1].minor.yy46 = yylhsminor.yy46; - break; - case 243: /* expr ::= BOOL */ -#line 713 "src/query/inc/sql.y" -{ yylhsminor.yy46 = tSqlExprCreateIdValue(&yymsp[0].minor.yy0, TK_BOOL);} -#line 3852 "src/query/inc/sql.c" - yymsp[0].minor.yy46 = yylhsminor.yy46; - break; - case 244: /* expr ::= NULL */ -#line 714 "src/query/inc/sql.y" -{ yylhsminor.yy46 = tSqlExprCreateIdValue(&yymsp[0].minor.yy0, TK_NULL);} -#line 3858 "src/query/inc/sql.c" - yymsp[0].minor.yy46 = yylhsminor.yy46; - break; - case 245: /* expr ::= ID LP exprlist RP */ -#line 717 "src/query/inc/sql.y" -{ tStrTokenAppend(pInfo->funcs, &yymsp[-3].minor.yy0); yylhsminor.yy46 = tSqlExprCreateFunction(yymsp[-1].minor.yy131, &yymsp[-3].minor.yy0, &yymsp[0].minor.yy0, yymsp[-3].minor.yy0.type); } -#line 3864 "src/query/inc/sql.c" - yymsp[-3].minor.yy46 = yylhsminor.yy46; - break; - case 246: /* expr ::= ID LP STAR RP */ -#line 720 "src/query/inc/sql.y" -{ tStrTokenAppend(pInfo->funcs, &yymsp[-3].minor.yy0); yylhsminor.yy46 = tSqlExprCreateFunction(NULL, &yymsp[-3].minor.yy0, &yymsp[0].minor.yy0, yymsp[-3].minor.yy0.type); } -#line 3870 "src/query/inc/sql.c" - yymsp[-3].minor.yy46 = yylhsminor.yy46; - break; - case 247: /* expr ::= expr IS NULL */ -#line 723 "src/query/inc/sql.y" -{yylhsminor.yy46 = tSqlExprCreate(yymsp[-2].minor.yy46, NULL, TK_ISNULL);} -#line 3876 "src/query/inc/sql.c" - yymsp[-2].minor.yy46 = yylhsminor.yy46; - break; - case 248: /* expr ::= expr IS NOT NULL */ -#line 724 "src/query/inc/sql.y" -{yylhsminor.yy46 = tSqlExprCreate(yymsp[-3].minor.yy46, NULL, TK_NOTNULL);} -#line 3882 "src/query/inc/sql.c" - yymsp[-3].minor.yy46 = yylhsminor.yy46; - break; - case 249: /* expr ::= expr LT expr */ -#line 727 "src/query/inc/sql.y" -{yylhsminor.yy46 = tSqlExprCreate(yymsp[-2].minor.yy46, yymsp[0].minor.yy46, TK_LT);} -#line 3888 "src/query/inc/sql.c" - yymsp[-2].minor.yy46 = yylhsminor.yy46; - break; - case 250: /* expr ::= expr GT expr */ -#line 728 "src/query/inc/sql.y" -{yylhsminor.yy46 = tSqlExprCreate(yymsp[-2].minor.yy46, yymsp[0].minor.yy46, TK_GT);} -#line 3894 "src/query/inc/sql.c" - yymsp[-2].minor.yy46 = yylhsminor.yy46; - break; - case 251: /* expr ::= expr LE expr */ -#line 729 "src/query/inc/sql.y" -{yylhsminor.yy46 = tSqlExprCreate(yymsp[-2].minor.yy46, yymsp[0].minor.yy46, TK_LE);} -#line 3900 "src/query/inc/sql.c" - yymsp[-2].minor.yy46 = yylhsminor.yy46; - break; - case 252: /* expr ::= expr GE expr */ -#line 730 "src/query/inc/sql.y" -{yylhsminor.yy46 = tSqlExprCreate(yymsp[-2].minor.yy46, yymsp[0].minor.yy46, TK_GE);} -#line 3906 "src/query/inc/sql.c" - yymsp[-2].minor.yy46 = yylhsminor.yy46; - break; - case 253: /* expr ::= expr NE expr */ -#line 731 "src/query/inc/sql.y" -{yylhsminor.yy46 = tSqlExprCreate(yymsp[-2].minor.yy46, yymsp[0].minor.yy46, TK_NE);} -#line 3912 "src/query/inc/sql.c" - yymsp[-2].minor.yy46 = yylhsminor.yy46; - break; - case 254: /* expr ::= expr EQ expr */ -#line 732 "src/query/inc/sql.y" -{yylhsminor.yy46 = tSqlExprCreate(yymsp[-2].minor.yy46, yymsp[0].minor.yy46, TK_EQ);} -#line 3918 "src/query/inc/sql.c" - yymsp[-2].minor.yy46 = yylhsminor.yy46; - break; - case 255: /* expr ::= expr BETWEEN expr AND expr */ -#line 734 "src/query/inc/sql.y" -{ tSqlExpr* X2 = tSqlExprClone(yymsp[-4].minor.yy46); yylhsminor.yy46 = tSqlExprCreate(tSqlExprCreate(yymsp[-4].minor.yy46, yymsp[-2].minor.yy46, TK_GE), tSqlExprCreate(X2, yymsp[0].minor.yy46, TK_LE), TK_AND);} -#line 3924 "src/query/inc/sql.c" - yymsp[-4].minor.yy46 = yylhsminor.yy46; - break; - case 256: /* expr ::= expr AND expr */ -#line 736 "src/query/inc/sql.y" -{yylhsminor.yy46 = tSqlExprCreate(yymsp[-2].minor.yy46, yymsp[0].minor.yy46, TK_AND);} -#line 3930 "src/query/inc/sql.c" - yymsp[-2].minor.yy46 = yylhsminor.yy46; - break; - case 257: /* expr ::= expr OR expr */ -#line 737 "src/query/inc/sql.y" -{yylhsminor.yy46 = tSqlExprCreate(yymsp[-2].minor.yy46, yymsp[0].minor.yy46, TK_OR); } -#line 3936 "src/query/inc/sql.c" - yymsp[-2].minor.yy46 = yylhsminor.yy46; - break; - case 258: /* expr ::= expr PLUS expr */ -#line 740 "src/query/inc/sql.y" -{yylhsminor.yy46 = tSqlExprCreate(yymsp[-2].minor.yy46, yymsp[0].minor.yy46, TK_PLUS); } -#line 3942 "src/query/inc/sql.c" - yymsp[-2].minor.yy46 = yylhsminor.yy46; - break; - case 259: /* expr ::= expr MINUS expr */ -#line 741 "src/query/inc/sql.y" -{yylhsminor.yy46 = tSqlExprCreate(yymsp[-2].minor.yy46, yymsp[0].minor.yy46, TK_MINUS); } -#line 3948 "src/query/inc/sql.c" - yymsp[-2].minor.yy46 = yylhsminor.yy46; - break; - case 260: /* expr ::= expr STAR expr */ -#line 742 "src/query/inc/sql.y" -{yylhsminor.yy46 = tSqlExprCreate(yymsp[-2].minor.yy46, yymsp[0].minor.yy46, TK_STAR); } -#line 3954 "src/query/inc/sql.c" - yymsp[-2].minor.yy46 = yylhsminor.yy46; - break; - case 261: /* expr ::= expr SLASH expr */ -#line 743 "src/query/inc/sql.y" -{yylhsminor.yy46 = tSqlExprCreate(yymsp[-2].minor.yy46, yymsp[0].minor.yy46, TK_DIVIDE);} -#line 3960 "src/query/inc/sql.c" - yymsp[-2].minor.yy46 = yylhsminor.yy46; - break; - case 262: /* expr ::= expr REM expr */ -#line 744 "src/query/inc/sql.y" -{yylhsminor.yy46 = tSqlExprCreate(yymsp[-2].minor.yy46, yymsp[0].minor.yy46, TK_REM); } -#line 3966 "src/query/inc/sql.c" - yymsp[-2].minor.yy46 = yylhsminor.yy46; - break; - case 263: /* expr ::= expr LIKE expr */ -#line 747 "src/query/inc/sql.y" -{yylhsminor.yy46 = tSqlExprCreate(yymsp[-2].minor.yy46, yymsp[0].minor.yy46, TK_LIKE); } -#line 3972 "src/query/inc/sql.c" - yymsp[-2].minor.yy46 = yylhsminor.yy46; - break; - case 264: /* expr ::= expr IN LP exprlist RP */ -#line 750 "src/query/inc/sql.y" -{yylhsminor.yy46 = tSqlExprCreate(yymsp[-4].minor.yy46, (tSqlExpr*)yymsp[-1].minor.yy131, TK_IN); } -#line 3978 "src/query/inc/sql.c" - yymsp[-4].minor.yy46 = yylhsminor.yy46; - break; - case 265: /* exprlist ::= exprlist COMMA expritem */ -#line 758 "src/query/inc/sql.y" -{yylhsminor.yy131 = tSqlExprListAppend(yymsp[-2].minor.yy131,yymsp[0].minor.yy46,0, 0);} -#line 3984 "src/query/inc/sql.c" - yymsp[-2].minor.yy131 = yylhsminor.yy131; - break; - case 266: /* exprlist ::= expritem */ -#line 759 "src/query/inc/sql.y" -{yylhsminor.yy131 = tSqlExprListAppend(0,yymsp[0].minor.yy46,0, 0);} -#line 3990 "src/query/inc/sql.c" - yymsp[0].minor.yy131 = yylhsminor.yy131; - break; - case 267: /* expritem ::= expr */ -#line 760 "src/query/inc/sql.y" -{yylhsminor.yy46 = yymsp[0].minor.yy46;} -#line 3996 "src/query/inc/sql.c" - yymsp[0].minor.yy46 = yylhsminor.yy46; - break; - case 269: /* cmd ::= RESET QUERY CACHE */ -#line 764 "src/query/inc/sql.y" + yymsp[0].minor.yy421 = yylhsminor.yy421; + break; + case 218: /* having_opt ::= */ + case 228: /* where_opt ::= */ yytestcase(yyruleno==228); + case 270: /* expritem ::= */ yytestcase(yyruleno==270); +{yymsp[1].minor.yy439 = 0;} + break; + case 219: /* having_opt ::= HAVING expr */ + case 229: /* where_opt ::= WHERE expr */ yytestcase(yyruleno==229); +{yymsp[-1].minor.yy439 = yymsp[0].minor.yy439;} + break; + case 220: /* limit_opt ::= */ + case 224: /* slimit_opt ::= */ yytestcase(yyruleno==224); +{yymsp[1].minor.yy166.limit = -1; yymsp[1].minor.yy166.offset = 0;} + break; + case 221: /* limit_opt ::= LIMIT signed */ + case 225: /* slimit_opt ::= SLIMIT signed */ yytestcase(yyruleno==225); +{yymsp[-1].minor.yy166.limit = yymsp[0].minor.yy325; yymsp[-1].minor.yy166.offset = 0;} + break; + case 222: /* limit_opt ::= LIMIT signed OFFSET signed */ +{ yymsp[-3].minor.yy166.limit = yymsp[-2].minor.yy325; yymsp[-3].minor.yy166.offset = yymsp[0].minor.yy325;} + break; + case 223: /* limit_opt ::= LIMIT signed COMMA signed */ +{ yymsp[-3].minor.yy166.limit = yymsp[0].minor.yy325; yymsp[-3].minor.yy166.offset = yymsp[-2].minor.yy325;} + break; + case 226: /* slimit_opt ::= SLIMIT signed SOFFSET signed */ +{yymsp[-3].minor.yy166.limit = yymsp[-2].minor.yy325; yymsp[-3].minor.yy166.offset = yymsp[0].minor.yy325;} + break; + case 227: /* slimit_opt ::= SLIMIT signed COMMA signed */ +{yymsp[-3].minor.yy166.limit = yymsp[0].minor.yy325; yymsp[-3].minor.yy166.offset = yymsp[-2].minor.yy325;} + break; + case 230: /* expr ::= LP expr RP */ +{yylhsminor.yy439 = yymsp[-1].minor.yy439; yylhsminor.yy439->exprToken.z = yymsp[-2].minor.yy0.z; yylhsminor.yy439->exprToken.n = (yymsp[0].minor.yy0.z - yymsp[-2].minor.yy0.z + 1);} + yymsp[-2].minor.yy439 = yylhsminor.yy439; + break; + case 231: /* expr ::= ID */ +{ yylhsminor.yy439 = tSqlExprCreateIdValue(&yymsp[0].minor.yy0, TK_ID);} + yymsp[0].minor.yy439 = yylhsminor.yy439; + break; + case 232: /* expr ::= ID DOT ID */ +{ yymsp[-2].minor.yy0.n += (1+yymsp[0].minor.yy0.n); yylhsminor.yy439 = tSqlExprCreateIdValue(&yymsp[-2].minor.yy0, TK_ID);} + yymsp[-2].minor.yy439 = yylhsminor.yy439; + break; + case 233: /* expr ::= ID DOT STAR */ +{ yymsp[-2].minor.yy0.n += (1+yymsp[0].minor.yy0.n); yylhsminor.yy439 = tSqlExprCreateIdValue(&yymsp[-2].minor.yy0, TK_ALL);} + yymsp[-2].minor.yy439 = yylhsminor.yy439; + break; + case 234: /* expr ::= INTEGER */ +{ yylhsminor.yy439 = tSqlExprCreateIdValue(&yymsp[0].minor.yy0, TK_INTEGER);} + yymsp[0].minor.yy439 = yylhsminor.yy439; + break; + case 235: /* expr ::= MINUS INTEGER */ + case 236: /* expr ::= PLUS INTEGER */ yytestcase(yyruleno==236); +{ yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; yymsp[-1].minor.yy0.type = TK_INTEGER; yylhsminor.yy439 = tSqlExprCreateIdValue(&yymsp[-1].minor.yy0, TK_INTEGER);} + yymsp[-1].minor.yy439 = yylhsminor.yy439; + break; + case 237: /* expr ::= FLOAT */ +{ yylhsminor.yy439 = tSqlExprCreateIdValue(&yymsp[0].minor.yy0, TK_FLOAT);} + yymsp[0].minor.yy439 = yylhsminor.yy439; + break; + case 238: /* expr ::= MINUS FLOAT */ + case 239: /* expr ::= PLUS FLOAT */ yytestcase(yyruleno==239); +{ yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; yymsp[-1].minor.yy0.type = TK_FLOAT; yylhsminor.yy439 = tSqlExprCreateIdValue(&yymsp[-1].minor.yy0, TK_FLOAT);} + yymsp[-1].minor.yy439 = yylhsminor.yy439; + break; + case 240: /* expr ::= STRING */ +{ yylhsminor.yy439 = tSqlExprCreateIdValue(&yymsp[0].minor.yy0, TK_STRING);} + yymsp[0].minor.yy439 = yylhsminor.yy439; + break; + case 241: /* expr ::= NOW */ +{ yylhsminor.yy439 = tSqlExprCreateIdValue(&yymsp[0].minor.yy0, TK_NOW); } + yymsp[0].minor.yy439 = yylhsminor.yy439; + break; + case 242: /* expr ::= VARIABLE */ +{ yylhsminor.yy439 = tSqlExprCreateIdValue(&yymsp[0].minor.yy0, TK_VARIABLE);} + yymsp[0].minor.yy439 = yylhsminor.yy439; + break; + case 243: /* expr ::= PLUS VARIABLE */ + case 244: /* expr ::= MINUS VARIABLE */ yytestcase(yyruleno==244); +{ yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; yymsp[-1].minor.yy0.type = TK_VARIABLE; yylhsminor.yy439 = tSqlExprCreateIdValue(&yymsp[-1].minor.yy0, TK_VARIABLE);} + yymsp[-1].minor.yy439 = yylhsminor.yy439; + break; + case 245: /* expr ::= BOOL */ +{ yylhsminor.yy439 = tSqlExprCreateIdValue(&yymsp[0].minor.yy0, TK_BOOL);} + yymsp[0].minor.yy439 = yylhsminor.yy439; + break; + case 246: /* expr ::= NULL */ +{ yylhsminor.yy439 = tSqlExprCreateIdValue(&yymsp[0].minor.yy0, TK_NULL);} + yymsp[0].minor.yy439 = yylhsminor.yy439; + break; + case 247: /* expr ::= ID LP exprlist RP */ +{ tStrTokenAppend(pInfo->funcs, &yymsp[-3].minor.yy0); yylhsminor.yy439 = tSqlExprCreateFunction(yymsp[-1].minor.yy421, &yymsp[-3].minor.yy0, &yymsp[0].minor.yy0, yymsp[-3].minor.yy0.type); } + yymsp[-3].minor.yy439 = yylhsminor.yy439; + break; + case 248: /* expr ::= ID LP STAR RP */ +{ tStrTokenAppend(pInfo->funcs, &yymsp[-3].minor.yy0); yylhsminor.yy439 = tSqlExprCreateFunction(NULL, &yymsp[-3].minor.yy0, &yymsp[0].minor.yy0, yymsp[-3].minor.yy0.type); } + yymsp[-3].minor.yy439 = yylhsminor.yy439; + break; + case 249: /* expr ::= expr IS NULL */ +{yylhsminor.yy439 = tSqlExprCreate(yymsp[-2].minor.yy439, NULL, TK_ISNULL);} + yymsp[-2].minor.yy439 = yylhsminor.yy439; + break; + case 250: /* expr ::= expr IS NOT NULL */ +{yylhsminor.yy439 = tSqlExprCreate(yymsp[-3].minor.yy439, NULL, TK_NOTNULL);} + yymsp[-3].minor.yy439 = yylhsminor.yy439; + break; + case 251: /* expr ::= expr LT expr */ +{yylhsminor.yy439 = tSqlExprCreate(yymsp[-2].minor.yy439, yymsp[0].minor.yy439, TK_LT);} + yymsp[-2].minor.yy439 = yylhsminor.yy439; + break; + case 252: /* expr ::= expr GT expr */ +{yylhsminor.yy439 = tSqlExprCreate(yymsp[-2].minor.yy439, yymsp[0].minor.yy439, TK_GT);} + yymsp[-2].minor.yy439 = yylhsminor.yy439; + break; + case 253: /* expr ::= expr LE expr */ +{yylhsminor.yy439 = tSqlExprCreate(yymsp[-2].minor.yy439, yymsp[0].minor.yy439, TK_LE);} + yymsp[-2].minor.yy439 = yylhsminor.yy439; + break; + case 254: /* expr ::= expr GE expr */ +{yylhsminor.yy439 = tSqlExprCreate(yymsp[-2].minor.yy439, yymsp[0].minor.yy439, TK_GE);} + yymsp[-2].minor.yy439 = yylhsminor.yy439; + break; + case 255: /* expr ::= expr NE expr */ +{yylhsminor.yy439 = tSqlExprCreate(yymsp[-2].minor.yy439, yymsp[0].minor.yy439, TK_NE);} + yymsp[-2].minor.yy439 = yylhsminor.yy439; + break; + case 256: /* expr ::= expr EQ expr */ +{yylhsminor.yy439 = tSqlExprCreate(yymsp[-2].minor.yy439, yymsp[0].minor.yy439, TK_EQ);} + yymsp[-2].minor.yy439 = yylhsminor.yy439; + break; + case 257: /* expr ::= expr BETWEEN expr AND expr */ +{ tSqlExpr* X2 = tSqlExprClone(yymsp[-4].minor.yy439); yylhsminor.yy439 = tSqlExprCreate(tSqlExprCreate(yymsp[-4].minor.yy439, yymsp[-2].minor.yy439, TK_GE), tSqlExprCreate(X2, yymsp[0].minor.yy439, TK_LE), TK_AND);} + yymsp[-4].minor.yy439 = yylhsminor.yy439; + break; + case 258: /* expr ::= expr AND expr */ +{yylhsminor.yy439 = tSqlExprCreate(yymsp[-2].minor.yy439, yymsp[0].minor.yy439, TK_AND);} + yymsp[-2].minor.yy439 = yylhsminor.yy439; + break; + case 259: /* expr ::= expr OR expr */ +{yylhsminor.yy439 = tSqlExprCreate(yymsp[-2].minor.yy439, yymsp[0].minor.yy439, TK_OR); } + yymsp[-2].minor.yy439 = yylhsminor.yy439; + break; + case 260: /* expr ::= expr PLUS expr */ +{yylhsminor.yy439 = tSqlExprCreate(yymsp[-2].minor.yy439, yymsp[0].minor.yy439, TK_PLUS); } + yymsp[-2].minor.yy439 = yylhsminor.yy439; + break; + case 261: /* expr ::= expr MINUS expr */ +{yylhsminor.yy439 = tSqlExprCreate(yymsp[-2].minor.yy439, yymsp[0].minor.yy439, TK_MINUS); } + yymsp[-2].minor.yy439 = yylhsminor.yy439; + break; + case 262: /* expr ::= expr STAR expr */ +{yylhsminor.yy439 = tSqlExprCreate(yymsp[-2].minor.yy439, yymsp[0].minor.yy439, TK_STAR); } + yymsp[-2].minor.yy439 = yylhsminor.yy439; + break; + case 263: /* expr ::= expr SLASH expr */ +{yylhsminor.yy439 = tSqlExprCreate(yymsp[-2].minor.yy439, yymsp[0].minor.yy439, TK_DIVIDE);} + yymsp[-2].minor.yy439 = yylhsminor.yy439; + break; + case 264: /* expr ::= expr REM expr */ +{yylhsminor.yy439 = tSqlExprCreate(yymsp[-2].minor.yy439, yymsp[0].minor.yy439, TK_REM); } + yymsp[-2].minor.yy439 = yylhsminor.yy439; + break; + case 265: /* expr ::= expr LIKE expr */ +{yylhsminor.yy439 = tSqlExprCreate(yymsp[-2].minor.yy439, yymsp[0].minor.yy439, TK_LIKE); } + yymsp[-2].minor.yy439 = yylhsminor.yy439; + break; + case 266: /* expr ::= expr IN LP exprlist RP */ +{yylhsminor.yy439 = tSqlExprCreate(yymsp[-4].minor.yy439, (tSqlExpr*)yymsp[-1].minor.yy421, TK_IN); } + yymsp[-4].minor.yy439 = yylhsminor.yy439; + break; + case 267: /* exprlist ::= exprlist COMMA expritem */ +{yylhsminor.yy421 = tSqlExprListAppend(yymsp[-2].minor.yy421,yymsp[0].minor.yy439,0, 0);} + yymsp[-2].minor.yy421 = yylhsminor.yy421; + break; + case 268: /* exprlist ::= expritem */ +{yylhsminor.yy421 = tSqlExprListAppend(0,yymsp[0].minor.yy439,0, 0);} + yymsp[0].minor.yy421 = yylhsminor.yy421; + break; + case 269: /* expritem ::= expr */ +{yylhsminor.yy439 = yymsp[0].minor.yy439;} + yymsp[0].minor.yy439 = yylhsminor.yy439; + break; + case 271: /* cmd ::= RESET QUERY CACHE */ { setDCLSqlElems(pInfo, TSDB_SQL_RESET_CACHE, 0);} -#line 4002 "src/query/inc/sql.c" break; - case 270: /* cmd ::= SYNCDB ids REPLICA */ -#line 767 "src/query/inc/sql.y" + case 272: /* cmd ::= SYNCDB ids REPLICA */ { setDCLSqlElems(pInfo, TSDB_SQL_SYNC_DB_REPLICA, 1, &yymsp[-1].minor.yy0);} -#line 4007 "src/query/inc/sql.c" break; - case 271: /* cmd ::= ALTER TABLE ids cpxName ADD COLUMN columnlist */ -#line 770 "src/query/inc/sql.y" + case 273: /* 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.yy131, NULL, TSDB_ALTER_TABLE_ADD_COLUMN, -1); + SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, yymsp[0].minor.yy421, NULL, TSDB_ALTER_TABLE_ADD_COLUMN, -1); setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); } -#line 4016 "src/query/inc/sql.c" break; - case 272: /* cmd ::= ALTER TABLE ids cpxName DROP COLUMN ids */ -#line 776 "src/query/inc/sql.y" + case 274: /* cmd ::= ALTER TABLE ids cpxName DROP COLUMN ids */ { yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n; @@ -4026,28 +3154,22 @@ static YYACTIONTYPE yy_reduce( SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, NULL, K, TSDB_ALTER_TABLE_DROP_COLUMN, -1); setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); } -#line 4029 "src/query/inc/sql.c" break; - case 273: /* cmd ::= ALTER TABLE ids cpxName MODIFY COLUMN columnlist */ -#line 786 "src/query/inc/sql.y" + case 275: /* 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.yy131, NULL, TSDB_ALTER_TABLE_CHANGE_COLUMN, -1); + SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, yymsp[0].minor.yy421, NULL, TSDB_ALTER_TABLE_CHANGE_COLUMN, -1); setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); } -#line 4038 "src/query/inc/sql.c" break; - case 274: /* cmd ::= ALTER TABLE ids cpxName ADD TAG columnlist */ -#line 793 "src/query/inc/sql.y" + case 276: /* 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.yy131, NULL, TSDB_ALTER_TABLE_ADD_TAG_COLUMN, -1); + SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, yymsp[0].minor.yy421, NULL, TSDB_ALTER_TABLE_ADD_TAG_COLUMN, -1); setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); } -#line 4047 "src/query/inc/sql.c" break; - case 275: /* cmd ::= ALTER TABLE ids cpxName DROP TAG ids */ -#line 798 "src/query/inc/sql.y" + case 277: /* cmd ::= ALTER TABLE ids cpxName DROP TAG ids */ { yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n; @@ -4057,10 +3179,8 @@ static YYACTIONTYPE yy_reduce( SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, NULL, A, TSDB_ALTER_TABLE_DROP_TAG_COLUMN, -1); setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); } -#line 4060 "src/query/inc/sql.c" break; - case 276: /* cmd ::= ALTER TABLE ids cpxName CHANGE TAG ids ids */ -#line 808 "src/query/inc/sql.y" + case 278: /* cmd ::= ALTER TABLE ids cpxName CHANGE TAG ids ids */ { yymsp[-5].minor.yy0.n += yymsp[-4].minor.yy0.n; @@ -4073,42 +3193,34 @@ static YYACTIONTYPE yy_reduce( SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-5].minor.yy0, NULL, A, TSDB_ALTER_TABLE_CHANGE_TAG_COLUMN, -1); setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); } -#line 4076 "src/query/inc/sql.c" break; - case 277: /* cmd ::= ALTER TABLE ids cpxName SET TAG ids EQ tagitem */ -#line 821 "src/query/inc/sql.y" + case 279: /* 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.yy516, -1); + A = tVariantListAppend(A, &yymsp[0].minor.yy430, -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); } -#line 4090 "src/query/inc/sql.c" break; - case 278: /* cmd ::= ALTER TABLE ids cpxName MODIFY TAG columnlist */ -#line 832 "src/query/inc/sql.y" + case 280: /* 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.yy131, NULL, TSDB_ALTER_TABLE_MODIFY_TAG_COLUMN, -1); + SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, yymsp[0].minor.yy421, NULL, TSDB_ALTER_TABLE_MODIFY_TAG_COLUMN, -1); setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); } -#line 4099 "src/query/inc/sql.c" break; - case 279: /* cmd ::= ALTER STABLE ids cpxName ADD COLUMN columnlist */ -#line 839 "src/query/inc/sql.y" + case 281: /* 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.yy131, NULL, TSDB_ALTER_TABLE_ADD_COLUMN, TSDB_SUPER_TABLE); + SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, yymsp[0].minor.yy421, NULL, TSDB_ALTER_TABLE_ADD_COLUMN, TSDB_SUPER_TABLE); setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); } -#line 4108 "src/query/inc/sql.c" break; - case 280: /* cmd ::= ALTER STABLE ids cpxName DROP COLUMN ids */ -#line 845 "src/query/inc/sql.y" + case 282: /* cmd ::= ALTER STABLE ids cpxName DROP COLUMN ids */ { yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n; @@ -4118,28 +3230,22 @@ static YYACTIONTYPE yy_reduce( SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, NULL, K, TSDB_ALTER_TABLE_DROP_COLUMN, TSDB_SUPER_TABLE); setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); } -#line 4121 "src/query/inc/sql.c" break; - case 281: /* cmd ::= ALTER STABLE ids cpxName MODIFY COLUMN columnlist */ -#line 855 "src/query/inc/sql.y" + case 283: /* 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.yy131, NULL, TSDB_ALTER_TABLE_CHANGE_COLUMN, TSDB_SUPER_TABLE); + SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, yymsp[0].minor.yy421, NULL, TSDB_ALTER_TABLE_CHANGE_COLUMN, TSDB_SUPER_TABLE); setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); } -#line 4130 "src/query/inc/sql.c" break; - case 282: /* cmd ::= ALTER STABLE ids cpxName ADD TAG columnlist */ -#line 862 "src/query/inc/sql.y" + case 284: /* 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.yy131, NULL, TSDB_ALTER_TABLE_ADD_TAG_COLUMN, TSDB_SUPER_TABLE); + SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, yymsp[0].minor.yy421, NULL, TSDB_ALTER_TABLE_ADD_TAG_COLUMN, TSDB_SUPER_TABLE); setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); } -#line 4139 "src/query/inc/sql.c" break; - case 283: /* cmd ::= ALTER STABLE ids cpxName DROP TAG ids */ -#line 867 "src/query/inc/sql.y" + case 285: /* cmd ::= ALTER STABLE ids cpxName DROP TAG ids */ { yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n; @@ -4149,10 +3255,8 @@ static YYACTIONTYPE yy_reduce( SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, NULL, A, TSDB_ALTER_TABLE_DROP_TAG_COLUMN, TSDB_SUPER_TABLE); setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); } -#line 4152 "src/query/inc/sql.c" break; - case 284: /* cmd ::= ALTER STABLE ids cpxName CHANGE TAG ids ids */ -#line 877 "src/query/inc/sql.y" + case 286: /* cmd ::= ALTER STABLE ids cpxName CHANGE TAG ids ids */ { yymsp[-5].minor.yy0.n += yymsp[-4].minor.yy0.n; @@ -4165,53 +3269,42 @@ static YYACTIONTYPE yy_reduce( SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-5].minor.yy0, NULL, A, TSDB_ALTER_TABLE_CHANGE_TAG_COLUMN, TSDB_SUPER_TABLE); setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); } -#line 4168 "src/query/inc/sql.c" break; - case 285: /* cmd ::= ALTER STABLE ids cpxName SET TAG ids EQ tagitem */ -#line 890 "src/query/inc/sql.y" + case 287: /* 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.yy516, -1); + A = tVariantListAppend(A, &yymsp[0].minor.yy430, -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); } -#line 4182 "src/query/inc/sql.c" break; - case 286: /* cmd ::= ALTER STABLE ids cpxName MODIFY TAG columnlist */ -#line 901 "src/query/inc/sql.y" + case 288: /* 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.yy131, NULL, TSDB_ALTER_TABLE_MODIFY_TAG_COLUMN, TSDB_SUPER_TABLE); + SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, yymsp[0].minor.yy421, NULL, TSDB_ALTER_TABLE_MODIFY_TAG_COLUMN, TSDB_SUPER_TABLE); setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); } -#line 4191 "src/query/inc/sql.c" break; - case 287: /* cmd ::= KILL CONNECTION INTEGER */ -#line 908 "src/query/inc/sql.y" + case 289: /* cmd ::= KILL CONNECTION INTEGER */ {setKillSql(pInfo, TSDB_SQL_KILL_CONNECTION, &yymsp[0].minor.yy0);} -#line 4196 "src/query/inc/sql.c" break; - case 288: /* cmd ::= KILL STREAM INTEGER COLON INTEGER */ -#line 909 "src/query/inc/sql.y" + case 290: /* 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);} -#line 4201 "src/query/inc/sql.c" break; - case 289: /* cmd ::= KILL QUERY INTEGER COLON INTEGER */ -#line 910 "src/query/inc/sql.y" + case 291: /* 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);} -#line 4206 "src/query/inc/sql.c" break; default: break; /********** End reduce actions ************************************************/ }; - assert( yyrulenostateno = (YYACTIONTYPE)yyact; yymsp->major = (YYCODETYPE)yygoto; yyTraceShift(yypParser, yyact, "... then shift"); - return yyact; } /* @@ -4236,8 +3328,7 @@ static YYACTIONTYPE yy_reduce( static void yy_parse_failed( yyParser *yypParser /* The parser */ ){ - ParseARG_FETCH - ParseCTX_FETCH + ParseARG_FETCH; #ifndef NDEBUG if( yyTraceFILE ){ fprintf(yyTraceFILE,"%sFail!\n",yyTracePrompt); @@ -4248,8 +3339,7 @@ static void yy_parse_failed( ** parser fails */ /************ Begin %parse_failure code ***************************************/ /************ End %parse_failure code *****************************************/ - ParseARG_STORE /* Suppress warning about unused %extra_argument variable */ - ParseCTX_STORE + ParseARG_STORE; /* Suppress warning about unused %extra_argument variable */ } #endif /* YYNOERRORRECOVERY */ @@ -4261,11 +3351,9 @@ static void yy_syntax_error( int yymajor, /* The major type of the error token */ ParseTOKENTYPE yyminor /* The minor type of the error token */ ){ - ParseARG_FETCH - ParseCTX_FETCH + ParseARG_FETCH; #define TOKEN yyminor /************ Begin %syntax_error code ****************************************/ -#line 37 "src/query/inc/sql.y" pInfo->valid = false; int32_t outputBufLen = tListLen(pInfo->msg); @@ -4288,10 +3376,8 @@ static void yy_syntax_error( } assert(len <= outputBufLen); -#line 4291 "src/query/inc/sql.c" /************ End %syntax_error code ******************************************/ - ParseARG_STORE /* Suppress warning about unused %extra_argument variable */ - ParseCTX_STORE + ParseARG_STORE; /* Suppress warning about unused %extra_argument variable */ } /* @@ -4300,8 +3386,7 @@ static void yy_syntax_error( static void yy_accept( yyParser *yypParser /* The parser */ ){ - ParseARG_FETCH - ParseCTX_FETCH + ParseARG_FETCH; #ifndef NDEBUG if( yyTraceFILE ){ fprintf(yyTraceFILE,"%sAccept!\n",yyTracePrompt); @@ -4314,11 +3399,9 @@ static void yy_accept( /* Here code is inserted which will be executed whenever the ** parser accepts */ /*********** Begin %parse_accept code *****************************************/ -#line 61 "src/query/inc/sql.y" -#line 4318 "src/query/inc/sql.c" + /*********** End %parse_accept code *******************************************/ - ParseARG_STORE /* Suppress warning about unused %extra_argument variable */ - ParseCTX_STORE + ParseARG_STORE; /* Suppress warning about unused %extra_argument variable */ } /* The main parser program. @@ -4347,91 +3430,45 @@ void Parse( ParseARG_PDECL /* Optional %extra_argument parameter */ ){ YYMINORTYPE yyminorunion; - YYACTIONTYPE yyact; /* The parser action. */ + unsigned int yyact; /* The parser action. */ #if !defined(YYERRORSYMBOL) && !defined(YYNOERRORRECOVERY) int yyendofinput; /* True if we are at the end of input */ #endif #ifdef YYERRORSYMBOL int yyerrorhit = 0; /* True if yymajor has invoked an error */ #endif - yyParser *yypParser = (yyParser*)yyp; /* The parser */ - ParseCTX_FETCH - ParseARG_STORE + yyParser *yypParser; /* The parser */ + yypParser = (yyParser*)yyp; assert( yypParser->yytos!=0 ); #if !defined(YYERRORSYMBOL) && !defined(YYNOERRORRECOVERY) yyendofinput = (yymajor==0); #endif + ParseARG_STORE; - yyact = yypParser->yytos->stateno; #ifndef NDEBUG if( yyTraceFILE ){ - if( yyact < YY_MIN_REDUCE ){ + int stateno = yypParser->yytos->stateno; + if( stateno < YY_MIN_REDUCE ){ fprintf(yyTraceFILE,"%sInput '%s' in state %d\n", - yyTracePrompt,yyTokenName[yymajor],yyact); + yyTracePrompt,yyTokenName[yymajor],stateno); }else{ fprintf(yyTraceFILE,"%sInput '%s' with pending reduce %d\n", - yyTracePrompt,yyTokenName[yymajor],yyact-YY_MIN_REDUCE); + yyTracePrompt,yyTokenName[yymajor],stateno-YY_MIN_REDUCE); } } #endif - while(1){ /* Exit by "break" */ - assert( yypParser->yytos>=yypParser->yystack ); - assert( yyact==yypParser->yytos->stateno ); - yyact = yy_find_shift_action((YYCODETYPE)yymajor,yyact); + do{ + yyact = yy_find_shift_action(yypParser,(YYCODETYPE)yymajor); if( yyact >= YY_MIN_REDUCE ){ - unsigned int yyruleno = yyact - YY_MIN_REDUCE; /* Reduce by this rule */ - assert( yyruleno<(int)(sizeof(yyRuleName)/sizeof(yyRuleName[0])) ); -#ifndef NDEBUG - if( yyTraceFILE ){ - int yysize = yyRuleInfoNRhs[yyruleno]; - if( yysize ){ - fprintf(yyTraceFILE, "%sReduce %d [%s]%s, pop back to state %d.\n", - yyTracePrompt, - yyruleno, yyRuleName[yyruleno], - yyrulenoyytos[yysize].stateno); - }else{ - fprintf(yyTraceFILE, "%sReduce %d [%s]%s.\n", - yyTracePrompt, yyruleno, yyRuleName[yyruleno], - yyrulenoyytos - yypParser->yystack)>yypParser->yyhwm ){ - yypParser->yyhwm++; - assert( yypParser->yyhwm == - (int)(yypParser->yytos - yypParser->yystack)); - } -#endif -#if YYSTACKDEPTH>0 - if( yypParser->yytos>=yypParser->yystackEnd ){ - yyStackOverflow(yypParser); - break; - } -#else - if( yypParser->yytos>=&yypParser->yystack[yypParser->yystksz-1] ){ - if( yyGrowStack(yypParser) ){ - yyStackOverflow(yypParser); - break; - } - } -#endif - } - yyact = yy_reduce(yypParser,yyruleno,yymajor,yyminor ParseCTX_PARAM); + yy_reduce(yypParser,yyact-YY_MIN_REDUCE,yymajor,yyminor); }else if( yyact <= YY_MAX_SHIFTREDUCE ){ - yy_shift(yypParser,yyact,(YYCODETYPE)yymajor,yyminor); + yy_shift(yypParser,yyact,yymajor,yyminor); #ifndef YYNOERRORRECOVERY yypParser->yyerrcnt--; #endif - break; + yymajor = YYNOCODE; }else if( yyact==YY_ACCEPT_ACTION ){ yypParser->yytos--; yy_accept(yypParser); @@ -4482,9 +3519,10 @@ void Parse( yymajor = YYNOCODE; }else{ while( yypParser->yytos >= yypParser->yystack + && yymx != YYERRORSYMBOL && (yyact = yy_find_reduce_action( yypParser->yytos->stateno, - YYERRORSYMBOL)) > YY_MAX_SHIFTREDUCE + YYERRORSYMBOL)) >= YY_MIN_REDUCE ){ yy_pop_parser_stack(yypParser); } @@ -4501,8 +3539,6 @@ void Parse( } yypParser->yyerrcnt = 3; yyerrorhit = 1; - if( yymajor==YYNOCODE ) break; - yyact = yypParser->yytos->stateno; #elif defined(YYNOERRORRECOVERY) /* If the YYNOERRORRECOVERY macro is defined, then do not attempt to ** do any kind of error recovery. Instead, simply invoke the syntax @@ -4513,7 +3549,8 @@ void Parse( */ yy_syntax_error(yypParser,yymajor, yyminor); yy_destructor(yypParser,(YYCODETYPE)yymajor,&yyminorunion); - break; + yymajor = YYNOCODE; + #else /* YYERRORSYMBOL is not defined */ /* This is what we do if the grammar does not define ERROR: ** @@ -4535,10 +3572,10 @@ void Parse( yypParser->yyerrcnt = -1; #endif } - break; + yymajor = YYNOCODE; #endif } - } + }while( yymajor!=YYNOCODE && yypParser->yytos>yypParser->yystack ); #ifndef NDEBUG if( yyTraceFILE ){ yyStackEntry *i; @@ -4553,17 +3590,3 @@ void Parse( #endif return; } - -/* -** Return the fallback token corresponding to canonical token iToken, or -** 0 if iToken has no fallback. -*/ -int ParseFallback(int iToken){ -#ifdef YYFALLBACK - assert( iToken<(int)(sizeof(yyFallback)/sizeof(yyFallback[0])) ); - return yyFallback[iToken]; -#else - (void)iToken; - return 0; -#endif -} diff --git a/src/util/src/ttokenizer.c b/src/util/src/ttokenizer.c index c4d05b2d5a851ee4c2a8232095dd6ea5567213ab..2d4e3aa743a250b618d9c9e80ffa312af1feba12 100644 --- a/src/util/src/ttokenizer.c +++ b/src/util/src/ttokenizer.c @@ -137,6 +137,7 @@ static SKeyword keywordTable[] = { {"COMMA", TK_COMMA}, {"NULL", TK_NULL}, {"SELECT", TK_SELECT}, + {"EVERY", TK_EVERY}, {"FROM", TK_FROM}, {"VARIABLE", TK_VARIABLE}, {"INTERVAL", TK_INTERVAL}, diff --git a/tests/pytest/functions/function_interp.py b/tests/pytest/functions/function_interp.py index 41215f15ebea082c96ec54d86ad77db93b99461e..87d001d9e586fdfccb28e6fe9c8a04510d6f3fb1 100644 --- a/tests/pytest/functions/function_interp.py +++ b/tests/pytest/functions/function_interp.py @@ -57,15 +57,15 @@ class TDTestCase: tdSql.checkRows(0) tdSql.query("select interp(pav) from ap1 where ts = '2021-07-25 02:19:54' FILL (LINEAR)") tdSql.checkRows(0) - tdSql.query("select interp(pav) from ap1 where ts> '2021-07-25 02:19:54' and ts<'2021-07-25 02:20:00' INTERVAL(1000a) FILL (LINEAR)") + tdSql.query("select interp(pav) from ap1 where ts> '2021-07-25 02:19:54' and ts<'2021-07-25 02:20:00' every(1000a) FILL (LINEAR)") tdSql.checkRows(6) - tdSql.query("select interp(pav) from ap1 where ts>= '2021-07-25 02:19:54' and ts<'2021-07-25 02:20:00' INTERVAL(1000a) FILL (NEXT)") + tdSql.query("select interp(pav) from ap1 where ts>= '2021-07-25 02:19:54' and ts<'2021-07-25 02:20:00' every(1000a) FILL (NEXT)") tdSql.checkRows(6) tdSql.checkData(0,1,2.90799) - tdSql.query("select interp(pav) from ap1 where ts> '2021-07-25 02:19:54' and ts <= '2021-07-25 02:20:00' INTERVAL(1000a) FILL (PREV)") + tdSql.query("select interp(pav) from ap1 where ts> '2021-07-25 02:19:54' and ts <= '2021-07-25 02:20:00' every(1000a) FILL (PREV)") tdSql.checkRows(7) tdSql.checkData(1,1,1.47885) - tdSql.query("select interp(pav) from ap1 where ts>= '2021-07-25 02:19:54' and ts <= '2021-07-25 02:20:00' INTERVAL(1000a) FILL (LINEAR)") + tdSql.query("select interp(pav) from ap1 where ts>= '2021-07-25 02:19:54' and ts <= '2021-07-25 02:20:00' every(1000a) FILL (LINEAR)") tdSql.checkRows(7) # check desc order @@ -74,13 +74,13 @@ class TDTestCase: tdSql.checkRows(0) tdSql.query("select interp(pav) from ap1 where ts = '2021-07-25 02:19:54' FILL (LINEAR) order by ts desc") tdSql.checkRows(0) - tdSql.query("select interp(pav) from ap1 where ts> '2021-07-25 02:19:54' and ts<'2021-07-25 02:20:00' INTERVAL(1000a) FILL (LINEAR) order by ts desc") + tdSql.query("select interp(pav) from ap1 where ts> '2021-07-25 02:19:54' and ts<'2021-07-25 02:20:00' every(1000a) FILL (LINEAR) order by ts desc") tdSql.checkRows(6) - tdSql.query("select interp(pav) from ap1 where ts>= '2021-07-25 02:19:54' and ts<'2021-07-25 02:20:00' INTERVAL(1000a) FILL (NEXT) order by ts desc") + tdSql.query("select interp(pav) from ap1 where ts>= '2021-07-25 02:19:54' and ts<'2021-07-25 02:20:00' every(1000a) FILL (NEXT) order by ts desc") tdSql.checkRows(6) tdSql.checkData(0,1,4.60900) - tdSql.error("select interp(pav) from ap1 where ts> '2021-07-25 02:19:54' and ts <= '2021-07-25 02:20:00' INTERVAL(1000a) FILL (PREV) order by ts desc") - tdSql.query("select interp(pav) from ap1 where ts>= '2021-07-25 02:19:54' and ts <= '2021-07-25 02:20:00' INTERVAL(1000a) FILL (LINEAR) order by ts desc") + tdSql.error("select interp(pav) from ap1 where ts> '2021-07-25 02:19:54' and ts <= '2021-07-25 02:20:00' every(1000a) FILL (PREV) order by ts desc") + tdSql.query("select interp(pav) from ap1 where ts>= '2021-07-25 02:19:54' and ts <= '2021-07-25 02:20:00' every(1000a) FILL (LINEAR) order by ts desc") tdSql.checkRows(7) # check exception @@ -88,7 +88,7 @@ class TDTestCase: tdSql.error("select interp(*) from ap1 FILL(NEXT)") tdSql.error("select interp(*) from ap1 ts >= '2021-07-25 02:19:54' FILL(NEXT)") tdSql.error("select interp(*) from ap1 ts <= '2021-07-25 02:19:54' FILL(NEXT)") - tdSql.error("select interp(*) from ap1 where ts >'2021-07-25 02:19:59.938' and ts < now interval(1s) fill(next)") + tdSql.error("select interp(*) from ap1 where ts >'2021-07-25 02:19:59.938' and ts < now every(1s) fill(next)") def stop(self): tdSql.close() diff --git a/tests/script/general/parser/interp_test.sim b/tests/script/general/parser/interp_test.sim index 5a2021dcfc0d961abfcdc4768545091092786e3c..8eac8a41d391508737232a3f068c477922bf77aa 100644 --- a/tests/script/general/parser/interp_test.sim +++ b/tests/script/general/parser/interp_test.sim @@ -23,562 +23,563 @@ sql use $db ##### select interp from table print ====== select intp from table $tb = $tbPrefix . 0 - ## interp(*) from tb - sql select interp(*) from $tb where ts = $ts0 - if $rows != 1 then - return -1 - endi - if $data00 != @18-09-17 09:00:00.000@ then - return -1 - endi - if $data01 != 0 then - return -1 - endi - if $data02 != 0 then - return -1 - endi - - ## interp + limit offset - sql select interp(*) from $tb where ts = $ts0 limit 5 offset 1 - if $rows != 0 then - return -1 - endi - - sql select interp(ts), interp(c1), interp(c2), interp(c3), interp(c4), interp(c5), interp(c6), interp(c7), interp(c8), interp(c9) from $tb where ts = $ts0 - if $rows != 1 then - return -1 - endi - if $data00 != @18-09-17 09:00:00.000@ then - return -1 - endi - if $data01 != 0 then - return -1 - endi - if $data02 != 0 then - return -1 - endi - if $data03 != 0.00000 then - return -1 - endi - if $data04 != 0.000000000 then - return -1 - endi - if $data05 != 0 then - return -1 - endi - if $data06 != 0 then - return -1 - endi - if $data07 != 1 then - return -1 - endi - if $data08 != binary0 then - return -1 - endi - if $data09 != nchar0 then - return -1 - endi - - ## intp + aggregation functions - #$t = $ts0 + $delta - #$t = $t + $delta - #sql_error select interp(ts), max(c1), min(c2), count(c3), sum(c4), avg(c5), stddev(c6), first(c7), last(c8), interp(c9) from $tb where ts = $t - - ### illegal queries on a table - sql_error select interp(ts), c1 from $tb where ts = $ts0 - sql_error select interp(ts) from $tb where ts >= $ts0 - sql_error select interp(ts), max(c1), min(c2), count(c3), interp(c4), interp(c5), interp(c6), interp(c7), interp(c8), interp(c9) from $tb where ts = $t fill(NULL) - - ### interp from tb + fill - $t = $ts0 + 1000 - sql select interp(ts), interp(c1), interp(c2), interp(c3), interp(c4), interp(c5), interp(c6), interp(c7), interp(c8), interp(c9) from $tb where ts = $t - if $rows != 0 then - return -1 - endi - - ## fill(none) - sql select interp(ts), interp(c1), interp(c2), interp(c3), interp(c4), interp(c5), interp(c6), interp(c7), interp(c8), interp(c9) from $tb where ts = $t fill(none) - if $rows != 0 then - return -1 - endi - $t = $tsu + 1000 - sql select interp(ts), interp(c1), interp(c2), interp(c3), interp(c4), interp(c5), interp(c6), interp(c7), interp(c8), interp(c9) from $tb where ts = $t fill(none) - if $rows != 0 then - return -1 - endi - - ## fill(NULL) - $t = $tsu - 1000 - sql select interp(ts), interp(c1), interp(c2), interp(c3), interp(c4), interp(c5), interp(c6), interp(c7), interp(c8), interp(c9) from $tb where ts = $t fill(value, NULL) order by ts asc - if $rows != 1 then - return -1 - endi - if $data00 != @18-11-25 19:29:59.000@ then - return -1 - endi - if $data01 != NULL then - print expect NULL, actual $data01 - return -1 - endi - if $data02 != NULL then - return -1 - endi - if $data03 != NULL then - return -1 - endi - if $data04 != NULL then - return -1 - endi - if $data05 != NULL then - return -1 - endi - if $data06 != NULL then - return -1 - endi - if $data07 != NULL then - return -1 - endi - if $data08 != NULL then - return -1 - endi - if $data09 != NULL then - return -1 - endi - - $t = $tsu + 1000 - sql select interp(ts), interp(c1), interp(c2), interp(c3), interp(c4), interp(c5), interp(c6), interp(c7), interp(c8), interp(c9) from $tb where ts = $t fill(none) - if $rows != 0 then - return -1 - endi - - ## fill(prev) - $t = $ts0 + 1000 - sql select interp(ts), interp(c1), interp(c2), interp(c3), interp(c4), interp(c5), interp(c6), interp(c7), interp(c8), interp(c9) from $tb where ts = $t fill(prev) - if $rows != 1 then - return -1 - endi - - sql select interp(ts), interp(c1), interp(c2), interp(c3), interp(c4), interp(c5), interp(c6), interp(c7), interp(c8), interp(c9) from $tb where ts = $ts0 fill(prev) - if $rows != 1 then - return -1 - endi - if $data00 != @18-09-17 09:00:00.000@ then - return -1 - endi - if $data01 != 0 then - return -1 - endi - if $data02 != 0 then - return -1 - endi - if $data03 != 0.00000 then - return -1 - endi - if $data04 != 0.000000000 then - return -1 - endi - if $data05 != 0 then - return -1 - endi - if $data06 != 0 then - return -1 - endi - if $data07 != 1 then - return -1 - endi - if $data08 != binary0 then - return -1 - endi - if $data09 != nchar0 then - return -1 - endi - - $t = $ts0 - 1000 - sql select interp(ts), interp(c1), interp(c2), interp(c3), interp(c4), interp(c5), interp(c6), interp(c7), interp(c8), interp(c9) from $tb where ts = $t fill(prev) - if $rows != 0 then - return -1 - endi - - $t = $ts0 + 1000 - sql select interp(ts), interp(c1), interp(c2), interp(c3), interp(c4), interp(c5), interp(c6), interp(c7), interp(c8), interp(c9) from intp_tb3 where ts = $t fill(prev) - if $rows != 1 then - return -1 - endi - if $data00 != @18-09-17 09:00:01.000@ then - return -1 - endi - if $data01 != 0 then - return -1 - endi - if $data02 != NULL then - return -1 - endi - if $data03 != 0.00000 then - print expect 0.00000, actual:$data03 - return -1 - endi +## interp(*) from tb +sql select interp(*) from $tb where ts = $ts0 +if $rows != 1 then + return -1 +endi +if $data00 != @18-09-17 09:00:00.000@ then + return -1 +endi +if $data01 != 0 then + return -1 +endi +if $data02 != 0 then + return -1 +endi + +## interp + limit offset +sql select interp(*) from $tb where ts = $ts0 limit 5 offset 1 +if $rows != 0 then + return -1 +endi + +sql select interp(ts), interp(c1), interp(c2), interp(c3), interp(c4), interp(c5), interp(c6), interp(c7), interp(c8), interp(c9) from $tb where ts = $ts0 +if $rows != 1 then + return -1 +endi +if $data00 != @18-09-17 09:00:00.000@ then + return -1 +endi +if $data01 != 0 then + return -1 +endi +if $data02 != 0 then + return -1 +endi +if $data03 != 0.00000 then + return -1 +endi +if $data04 != 0.000000000 then + return -1 +endi +if $data05 != 0 then + return -1 +endi +if $data06 != 0 then + return -1 +endi +if $data07 != 1 then + return -1 +endi +if $data08 != binary0 then + return -1 +endi +if $data09 != nchar0 then + return -1 +endi + +## intp + aggregation functions +$t = $ts0 + $delta +$t = $t + $delta +sql_error select interp(ts), max(c1), min(c2), count(c3), sum(c4), avg(c5), stddev(c6), first(c7), last(c8), interp(c9) from $tb where ts = $t +sql_error select interp(ts) from $tb where ts=$ts0 interval(1s) + +### illegal queries on a table +sql_error select interp(ts), c1 from $tb where ts = $ts0 +sql_error select interp(ts) from $tb where ts >= $ts0 +sql_error select interp(ts), max(c1), min(c2), count(c3), interp(c4), interp(c5), interp(c6), interp(c7), interp(c8), interp(c9) from $tb where ts = $t fill(NULL) + +### interp from tb + fill +$t = $ts0 + 1000 +sql select interp(ts), interp(c1), interp(c2), interp(c3), interp(c4), interp(c5), interp(c6), interp(c7), interp(c8), interp(c9) from $tb where ts = $t +if $rows != 0 then + return -1 +endi + +## fill(none) +sql select interp(ts), interp(c1), interp(c2), interp(c3), interp(c4), interp(c5), interp(c6), interp(c7), interp(c8), interp(c9) from $tb where ts = $t fill(none) +if $rows != 0 then + return -1 +endi +$t = $tsu + 1000 +sql select interp(ts), interp(c1), interp(c2), interp(c3), interp(c4), interp(c5), interp(c6), interp(c7), interp(c8), interp(c9) from $tb where ts = $t fill(none) +if $rows != 0 then + return -1 +endi + +## fill(NULL) +$t = $tsu - 1000 +sql select interp(ts), interp(c1), interp(c2), interp(c3), interp(c4), interp(c5), interp(c6), interp(c7), interp(c8), interp(c9) from $tb where ts = $t fill(value, NULL) order by ts asc +if $rows != 1 then + return -1 +endi +if $data00 != @18-11-25 19:29:59.000@ then + return -1 +endi +if $data01 != NULL then + print expect NULL, actual $data01 + return -1 +endi +if $data02 != NULL then + return -1 +endi +if $data03 != NULL then + return -1 +endi +if $data04 != NULL then + return -1 +endi +if $data05 != NULL then + return -1 +endi +if $data06 != NULL then + return -1 +endi +if $data07 != NULL then + return -1 +endi +if $data08 != NULL then + return -1 +endi +if $data09 != NULL then + return -1 +endi + +$t = $tsu + 1000 +sql select interp(ts), interp(c1), interp(c2), interp(c3), interp(c4), interp(c5), interp(c6), interp(c7), interp(c8), interp(c9) from $tb where ts = $t fill(none) +if $rows != 0 then + return -1 +endi + +## fill(prev) +$t = $ts0 + 1000 +sql select interp(ts), interp(c1), interp(c2), interp(c3), interp(c4), interp(c5), interp(c6), interp(c7), interp(c8), interp(c9) from $tb where ts = $t fill(prev) +if $rows != 1 then + return -1 +endi + +sql select interp(ts), interp(c1), interp(c2), interp(c3), interp(c4), interp(c5), interp(c6), interp(c7), interp(c8), interp(c9) from $tb where ts = $ts0 fill(prev) +if $rows != 1 then + return -1 +endi +if $data00 != @18-09-17 09:00:00.000@ then + return -1 +endi +if $data01 != 0 then + return -1 +endi +if $data02 != 0 then + return -1 +endi +if $data03 != 0.00000 then + return -1 +endi +if $data04 != 0.000000000 then + return -1 +endi +if $data05 != 0 then + return -1 +endi +if $data06 != 0 then + return -1 +endi +if $data07 != 1 then + return -1 +endi +if $data08 != binary0 then + return -1 +endi +if $data09 != nchar0 then + return -1 +endi + +$t = $ts0 - 1000 +sql select interp(ts), interp(c1), interp(c2), interp(c3), interp(c4), interp(c5), interp(c6), interp(c7), interp(c8), interp(c9) from $tb where ts = $t fill(prev) +if $rows != 0 then + return -1 +endi + +$t = $ts0 + 1000 +sql select interp(ts), interp(c1), interp(c2), interp(c3), interp(c4), interp(c5), interp(c6), interp(c7), interp(c8), interp(c9) from intp_tb3 where ts = $t fill(prev) +if $rows != 1 then + return -1 +endi +if $data00 != @18-09-17 09:00:01.000@ then + return -1 +endi +if $data01 != 0 then + return -1 +endi +if $data02 != NULL then + return -1 +endi +if $data03 != 0.00000 then + print expect 0.00000, actual:$data03 + return -1 +endi # if $data04 != NULL then # return -1 # endi - $t = $tsu + 1000 - sql select interp(ts), interp(c1), interp(c2), interp(c3), interp(c4), interp(c5), interp(c6), interp(c7), interp(c8), interp(c9) from $tb where ts = $t fill(prev) - if $rows != 0 then - return -1 - endi - - ## fill(linear) - $t = $ts0 + 1000 - sql select interp(ts), interp(c1), interp(c2), interp(c3), interp(c4), interp(c5), interp(c6), interp(c7), interp(c8), interp(c9) from $tb where ts = $t fill(linear) - print ====== 0:$data00, 1:$data01, 2:$data02, 3:$data03, 4:$data04, 5:$data05, 6:$data06, 7:$data07, 8:$data08, 9:$data09 - if $rows != 1 then - return -1 - endi - if $data00 != @18-09-17 09:00:01.000@ then - return -1 - endi - if $data01 != 0 then - return -1 - endi - if $data02 != 0 then - return -1 - endi - print $data03 - if $data03 != 0.00167 then - return -1 - endi - if $data04 != 0.001666667 then - return -1 - endi - if $data05 != 0 then - return -1 - endi - if $data06 != 0 then - return -1 - endi - if $data07 != NULL then - return -1 - endi - if $data08 != NULL then - return -1 - endi - if $data09 != NULL then - return -1 - endi - # columns contain NULL values - $t = $ts0 + 1000 - sql select interp(ts), interp(c1), interp(c2), interp(c3), interp(c4), interp(c5), interp(c6), interp(c7), interp(c8), interp(c9) from intp_tb3 where ts = $t fill(linear) - print ====== 0:$data00, 1:$data01, 2:$data02, 3:$data03, 4:$data04, 5:$data05, 6:$data06, 7:$data07, 8:$data08, 9:$data09 - if $rows != 1 then - return -1 - endi - if $data00 != @18-09-17 09:00:01.000@ then - return -1 - endi - if $data01 != 0 then - return -1 - endi - if $data02 != NULL then - return -1 - endi - if $data03 != 0.00167 then - return -1 - endi - if $data04 != NULL then - return -1 - endi - if $data05 != 0 then - return -1 - endi - if $data06 != 0 then - return -1 - endi - if $data07 != NULL then - return -1 - endi - if $data08 != NULL then - return -1 - endi - if $data09 != NULL then - return -1 - endi - - print select interp(ts), interp(c1), interp(c2), interp(c3), interp(c4), interp(c5), interp(c6), interp(c7), interp(c8), interp(c9) from $tb where ts = $ts0 fill(linear) - - sql select interp(ts), interp(c1), interp(c2), interp(c3), interp(c4), interp(c5), interp(c6), interp(c7), interp(c8), interp(c9) from $tb where ts = $ts0 fill(linear) - if $rows != 1 then - return -1 - endi - if $data00 != @18-09-17 09:00:00.000@ then - return -1 - endi - if $data01 != 0 then - return -1 - endi - if $data02 != 0 then - return -1 - endi - if $data03 != 0.00000 then - return -1 - endi - if $data04 != 0.000000000 then - return -1 - endi - if $data05 != 0 then - return -1 - endi - if $data06 != 0 then - return -1 - endi - if $data07 != 1 then - return -1 - endi - if $data08 != binary0 then - return -1 - endi - if $data09 != nchar0 then - return -1 - endi - # columns contain NULL values - - print select interp(ts), interp(c1), interp(c2), interp(c3), interp(c4), interp(c5), interp(c6), interp(c7), interp(c8), interp(c9) from intp_tb3 where ts = $ts0 fill(linear) - sql select interp(ts), interp(c1), interp(c2), interp(c3), interp(c4), interp(c5), interp(c6), interp(c7), interp(c8), interp(c9) from intp_tb3 where ts = $ts0 fill(linear) - if $rows != 1 then - return -1 - endi - if $data00 != @18-09-17 09:00:00.000@ then - return -1 - endi - if $data01 != 0 then - return -1 - endi - if $data02 != NULL then - return -1 - endi - if $data03 != 0.00000 then - return -1 - endi - if $data04 != NULL then - return -1 - endi - if $data05 != 0 then - return -1 - endi - if $data06 != 0 then - return -1 - endi - if $data07 != 1 then - return -1 - endi - if $data08 != binary0 then - return -1 - endi - if $data09 != nchar0 then - return -1 - endi - - $t = $ts0 - 1000 - sql select interp(ts), interp(c1), interp(c2), interp(c3), interp(c4), interp(c5), interp(c6), interp(c7), interp(c8), interp(c9) from $tb where ts = $t fill(linear) - if $rows != 0 then - return -1 - endi - - $t = $tsu + 1000 - print select interp(ts), interp(c1), interp(c2), interp(c3), interp(c4), interp(c5), interp(c6), interp(c7), interp(c8), interp(c9) from $tb where ts = $t fill(linear) - sql select interp(ts), interp(c1), interp(c2), interp(c3), interp(c4), interp(c5), interp(c6), interp(c7), interp(c8), interp(c9) from $tb where ts = $t fill(linear) - if $rows != 0 then - return -1 - endi +$t = $tsu + 1000 +sql select interp(ts), interp(c1), interp(c2), interp(c3), interp(c4), interp(c5), interp(c6), interp(c7), interp(c8), interp(c9) from $tb where ts = $t fill(prev) +if $rows != 0 then + return -1 +endi + +## fill(linear) +$t = $ts0 + 1000 +sql select interp(ts), interp(c1), interp(c2), interp(c3), interp(c4), interp(c5), interp(c6), interp(c7), interp(c8), interp(c9) from $tb where ts = $t fill(linear) +print ====== 0:$data00, 1:$data01, 2:$data02, 3:$data03, 4:$data04, 5:$data05, 6:$data06, 7:$data07, 8:$data08, 9:$data09 +if $rows != 1 then + return -1 +endi +if $data00 != @18-09-17 09:00:01.000@ then + return -1 +endi +if $data01 != 0 then + return -1 +endi +if $data02 != 0 then + return -1 +endi +print $data03 +if $data03 != 0.00167 then + return -1 +endi +if $data04 != 0.001666667 then + return -1 +endi +if $data05 != 0 then + return -1 +endi +if $data06 != 0 then + return -1 +endi +if $data07 != NULL then + return -1 +endi +if $data08 != NULL then + return -1 +endi +if $data09 != NULL then + return -1 +endi +# columns contain NULL values +$t = $ts0 + 1000 +sql select interp(ts), interp(c1), interp(c2), interp(c3), interp(c4), interp(c5), interp(c6), interp(c7), interp(c8), interp(c9) from intp_tb3 where ts = $t fill(linear) +print ====== 0:$data00, 1:$data01, 2:$data02, 3:$data03, 4:$data04, 5:$data05, 6:$data06, 7:$data07, 8:$data08, 9:$data09 +if $rows != 1 then + return -1 +endi +if $data00 != @18-09-17 09:00:01.000@ then + return -1 +endi +if $data01 != 0 then + return -1 +endi +if $data02 != NULL then + return -1 +endi +if $data03 != 0.00167 then + return -1 +endi +if $data04 != NULL then + return -1 +endi +if $data05 != 0 then + return -1 +endi +if $data06 != 0 then + return -1 +endi +if $data07 != NULL then + return -1 +endi +if $data08 != NULL then + return -1 +endi +if $data09 != NULL then + return -1 +endi + +print select interp(ts), interp(c1), interp(c2), interp(c3), interp(c4), interp(c5), interp(c6), interp(c7), interp(c8), interp(c9) from $tb where ts = $ts0 fill(linear) + +sql select interp(ts), interp(c1), interp(c2), interp(c3), interp(c4), interp(c5), interp(c6), interp(c7), interp(c8), interp(c9) from $tb where ts = $ts0 fill(linear) +if $rows != 1 then + return -1 +endi +if $data00 != @18-09-17 09:00:00.000@ then + return -1 +endi +if $data01 != 0 then + return -1 +endi +if $data02 != 0 then + return -1 +endi +if $data03 != 0.00000 then + return -1 +endi +if $data04 != 0.000000000 then + return -1 +endi +if $data05 != 0 then + return -1 +endi +if $data06 != 0 then + return -1 +endi +if $data07 != 1 then + return -1 +endi +if $data08 != binary0 then + return -1 +endi +if $data09 != nchar0 then + return -1 +endi +# columns contain NULL values + +print select interp(ts), interp(c1), interp(c2), interp(c3), interp(c4), interp(c5), interp(c6), interp(c7), interp(c8), interp(c9) from intp_tb3 where ts = $ts0 fill(linear) +sql select interp(ts), interp(c1), interp(c2), interp(c3), interp(c4), interp(c5), interp(c6), interp(c7), interp(c8), interp(c9) from intp_tb3 where ts = $ts0 fill(linear) +if $rows != 1 then + return -1 +endi +if $data00 != @18-09-17 09:00:00.000@ then + return -1 +endi +if $data01 != 0 then + return -1 +endi +if $data02 != NULL then + return -1 +endi +if $data03 != 0.00000 then + return -1 +endi +if $data04 != NULL then + return -1 +endi +if $data05 != 0 then + return -1 +endi +if $data06 != 0 then + return -1 +endi +if $data07 != 1 then + return -1 +endi +if $data08 != binary0 then + return -1 +endi +if $data09 != nchar0 then + return -1 +endi + +$t = $ts0 - 1000 +sql select interp(ts), interp(c1), interp(c2), interp(c3), interp(c4), interp(c5), interp(c6), interp(c7), interp(c8), interp(c9) from $tb where ts = $t fill(linear) +if $rows != 0 then + return -1 +endi + +$t = $tsu + 1000 +print select interp(ts), interp(c1), interp(c2), interp(c3), interp(c4), interp(c5), interp(c6), interp(c7), interp(c8), interp(c9) from $tb where ts = $t fill(linear) +sql select interp(ts), interp(c1), interp(c2), interp(c3), interp(c4), interp(c5), interp(c6), interp(c7), interp(c8), interp(c9) from $tb where ts = $t fill(linear) +if $rows != 0 then + return -1 +endi ## fill(value) - $t = $ts0 + 1000 - print 91 - sql select interp(ts), interp(c1), interp(c2), interp(c3), interp(c4), interp(c5), interp(c6), interp(c7), interp(c8), interp(c9) from $tb where ts = $t fill(value, -1, -2) - if $rows != 1 then - return -1 - endi - if $data00 != @18-09-17 09:00:01.000@ then - return -1 - endi - if $data01 != -2 then - return -1 - endi - if $data02 != -2 then - return -1 - endi - if $data03 != -2.00000 then - return -1 - endi - if $data04 != -2.000000000 then - return -1 - endi - if $data05 != -2 then - return -1 - endi - if $data06 != -2 then - return -1 - endi - if $data07 != 1 then - return -1 - endi - if $data08 != NULL then - return -1 - endi - if $data09 != NULL then - return -1 - endi - - sql select interp(ts), interp(c1), interp(c2), interp(c3), interp(c4), interp(c5), interp(c6), interp(c7), interp(c8), interp(c9) from $tb where ts = $ts0 fill(value, -1, -2, -3) - if $rows != 1 then - return -1 - endi - if $data00 != @18-09-17 09:00:00.000@ then - return -1 - endi - if $data01 != 0 then - return -1 - endi - if $data02 != 0 then - return -1 - endi - if $data03 != 0.00000 then - return -1 - endi - if $data04 != 0.000000000 then - return -1 - endi - if $data05 != 0 then - return -1 - endi - if $data06 != 0 then - return -1 - endi - if $data07 != 1 then - return -1 - endi - if $data08 != binary0 then - return -1 - endi - if $data09 != nchar0 then - return -1 - endi - - # table has NULL columns - sql select interp(ts), interp(c1), interp(c2), interp(c3), interp(c4), interp(c5), interp(c6), interp(c7), interp(c8), interp(c9) from intp_tb3 where ts = $ts0 fill(value, -1, -2, -3) - if $rows != 1 then - return -1 - endi - if $data00 != @18-09-17 09:00:00.000@ then - return -1 - endi - if $data01 != 0 then - return -1 - endi - if $data02 != NULL then - return -1 - endi - if $data03 != 0.00000 then - return -1 - endi - if $data04 != NULL then - return -1 - endi - - $t = $ts0 - 1000 - sql select interp(ts), interp(c1), interp(c2), interp(c3), interp(c4), interp(c5), interp(c6), interp(c7), interp(c8), interp(c9) from $tb where ts = $t fill(value, -1, -2) - if $rows != 0 then - return -1 - endi - - $t = $tsu + 1000 - sql select interp(ts), interp(c1), interp(c2), interp(c3), interp(c4), interp(c5), interp(c6), interp(c7), interp(c8), interp(c9) from $tb where ts = $t fill(value, -1, -2) - if $rows != 0 then - return -1 - endi - -##### select interp from stable - ## interp(*) from stb - print select interp(*) from $stb where ts = $ts0 - sql select interp(*) from $stb where ts = $ts0 - if $rows != 1 then - return -1 - endi - $t = $ts0 + 1000 - print 92 - - sql select interp(*) from $stb where ts = $t - if $rows != 0 then - return -1 - endi - ## interp(*) from stb + group by - sql select interp(ts, c1, c2, c3, c4, c5, c7, c9) from $stb where ts = $ts0 group by tbname order by tbname asc - print ====== select interp(ts, c1, c2, c3, c4, c5, c7, c9) from $stb where ts = $ts0 group by tbname order by tbname asc - print ====== 0:$data00, 1:$data01, 2:$data02, 3:$data03, 4:$data04, 5:$data05, 6:$data06, 7:$data07, 8:$data08, 9:$data09 - print ====== 0:$data20, 1:$data21, 2:$data22, 3:$data23, 4:$data24, 5:$data25, 6:$data26, 7:$data27, 8:$data28, 9:$data29 - if $rows != $tbNum then - return -1 - endi - if $data00 != @18-09-17 09:00:00.000@ then - return -1 - endi - if $data01 != 0 then - return -1 - endi - if $data02 != 0 then - return -1 - endi - if $data04 != 0.000000000 then - return -1 - endi - if $data08 != intp_tb0 then - return -1 - endi - if $data22 != NULL then - return -1 - endi - if $data24 != NULL then - return -1 - endi - if $data28 != intp_tb2 then - return -1 - endi - - ## interp(*) from stb + group by + limit offset - sql select interp(*) from $stb where ts = $ts0 group by tbname limit 0 - if $rows != 0 then - return -1 - endi - sql select interp(*) from $stb where ts = $ts0 group by tbname limit 0 offset 1 - - ## interp(*) from stb + group by + fill(none) - $t = $ts0 + 1000 - sql select interp(*) from $stb where ts = $t fill(none) group by tbname - if $rows != 0 then - return -1 - endi - - sql select interp(*) from $stb where ts = $ts0 fill(none) group by tbname - if $rows != 4 then - return -1 - endi - if $data01 != 0 then - return -1 - endi - if $data02 != 0 then - return -1 - endi - if $data21 != 0 then - return -1 - endi - if $data22 != NULL then - return -1 - endi - if $data24 != NULL then - return -1 - endi - - ## interp(*) from stb + group by + fill(none) - $t = $ts0 + 1000 +$t = $ts0 + 1000 +print 91 +sql select interp(ts), interp(c1), interp(c2), interp(c3), interp(c4), interp(c5), interp(c6), interp(c7), interp(c8), interp(c9) from $tb where ts = $t fill(value, -1, -2) +if $rows != 1 then + return -1 +endi +if $data00 != @18-09-17 09:00:01.000@ then + return -1 +endi +if $data01 != -2 then + return -1 +endi +if $data02 != -2 then + return -1 +endi +if $data03 != -2.00000 then + return -1 +endi +if $data04 != -2.000000000 then + return -1 +endi +if $data05 != -2 then + return -1 +endi +if $data06 != -2 then + return -1 +endi +if $data07 != 1 then + return -1 +endi +if $data08 != NULL then + return -1 +endi +if $data09 != NULL then + return -1 +endi + +sql select interp(ts), interp(c1), interp(c2), interp(c3), interp(c4), interp(c5), interp(c6), interp(c7), interp(c8), interp(c9) from $tb where ts = $ts0 fill(value, -1, -2, -3) +if $rows != 1 then + return -1 +endi +if $data00 != @18-09-17 09:00:00.000@ then + return -1 +endi +if $data01 != 0 then + return -1 +endi +if $data02 != 0 then + return -1 +endi +if $data03 != 0.00000 then + return -1 +endi +if $data04 != 0.000000000 then + return -1 +endi +if $data05 != 0 then + return -1 +endi +if $data06 != 0 then + return -1 +endi +if $data07 != 1 then + return -1 +endi +if $data08 != binary0 then + return -1 +endi +if $data09 != nchar0 then + return -1 +endi + +# table has NULL columns +sql select interp(ts), interp(c1), interp(c2), interp(c3), interp(c4), interp(c5), interp(c6), interp(c7), interp(c8), interp(c9) from intp_tb3 where ts = $ts0 fill(value, -1, -2, -3) +if $rows != 1 then + return -1 +endi +if $data00 != @18-09-17 09:00:00.000@ then + return -1 +endi +if $data01 != 0 then + return -1 +endi +if $data02 != NULL then + return -1 +endi +if $data03 != 0.00000 then + return -1 +endi +if $data04 != NULL then + return -1 +endi + +$t = $ts0 - 1000 +sql select interp(ts), interp(c1), interp(c2), interp(c3), interp(c4), interp(c5), interp(c6), interp(c7), interp(c8), interp(c9) from $tb where ts = $t fill(value, -1, -2) +if $rows != 0 then + return -1 +endi + +$t = $tsu + 1000 +sql select interp(ts), interp(c1), interp(c2), interp(c3), interp(c4), interp(c5), interp(c6), interp(c7), interp(c8), interp(c9) from $tb where ts = $t fill(value, -1, -2) +if $rows != 0 then + return -1 +endi + +### select interp from stable +## interp(*) from stb +print select interp(*) from $stb where ts = $ts0 +sql select interp(*) from $stb where ts = $ts0 +if $rows != 1 then + return -1 +endi +$t = $ts0 + 1000 +print 92 + +sql select interp(*) from $stb where ts = $t +if $rows != 0 then + return -1 +endi +## interp(*) from stb + group by +sql select interp(ts, c1, c2, c3, c4, c5, c7, c9) from $stb where ts = $ts0 group by tbname order by tbname asc +print ====== select interp(ts, c1, c2, c3, c4, c5, c7, c9) from $stb where ts = $ts0 group by tbname order by tbname asc +print ====== 0:$data00, 1:$data01, 2:$data02, 3:$data03, 4:$data04, 5:$data05, 6:$data06, 7:$data07, 8:$data08, 9:$data09 +print ====== 0:$data20, 1:$data21, 2:$data22, 3:$data23, 4:$data24, 5:$data25, 6:$data26, 7:$data27, 8:$data28, 9:$data29 +if $rows != $tbNum then + return -1 +endi +if $data00 != @18-09-17 09:00:00.000@ then + return -1 +endi +if $data01 != 0 then + return -1 +endi +if $data02 != 0 then + return -1 +endi +if $data04 != 0.000000000 then + return -1 +endi +if $data08 != intp_tb0 then + return -1 +endi +if $data22 != NULL then + return -1 +endi +if $data24 != NULL then + return -1 +endi +if $data28 != intp_tb2 then + return -1 +endi + +## interp(*) from stb + group by + limit offset +sql select interp(*) from $stb where ts = $ts0 group by tbname limit 0 +if $rows != 0 then + return -1 +endi +sql select interp(*) from $stb where ts = $ts0 group by tbname limit 0 offset 1 + +## interp(*) from stb + group by + fill(none) +$t = $ts0 + 1000 +sql select interp(*) from $stb where ts = $t fill(none) group by tbname +if $rows != 0 then + return -1 +endi + +sql select interp(*) from $stb where ts = $ts0 fill(none) group by tbname +if $rows != 4 then + return -1 +endi +if $data01 != 0 then + return -1 +endi +if $data02 != 0 then + return -1 +endi +if $data21 != 0 then + return -1 +endi +if $data22 != NULL then + return -1 +endi +if $data24 != NULL then + return -1 +endi + +## interp(*) from stb + group by + fill(none) +$t = $ts0 + 1000 sql select interp(*) from $stb where ts = $t fill(NULL) group by tbname if $rows != $tbNum then return -1 @@ -846,12 +847,12 @@ if $data29 != NULL then endi sql_error select interp(ts,c1) from intp_tb0 where ts>'2018-11-25 19:19:00' and ts<'2018-11-25 19:19:12'; -sql select interp(ts,c1) from intp_tb0 where ts>'2018-11-25 19:19:00' and ts<'2018-11-25 19:19:12' interval(1s) fill(linear); +sql select interp(ts,c1) from intp_tb0 where ts>'2018-11-25 19:19:00' and ts<'2018-11-25 19:19:12' every(1s) fill(linear); if $rows != 0 then return -1 endi -sql select interp(c1) from intp_tb0 where ts>'2018-11-25 18:09:00' and ts<'2018-11-25 19:20:12' interval(18m); +sql select interp(c1) from intp_tb0 where ts>'2018-11-25 18:09:00' and ts<'2018-11-25 19:20:12' every(18m); if $rows != 1 then return -1 endi @@ -864,7 +865,7 @@ if $data01 != 3 then return -1 endi -sql select interp(c1,c3,c4,ts) from intp_tb0 where ts>'2018-11-25 18:09:00' and ts<'2018-11-25 19:20:12' interval(18m) fill(linear) +sql select interp(c1,c3,c4,ts) from intp_tb0 where ts>'2018-11-25 18:09:00' and ts<'2018-11-25 19:20:12' every(18m) fill(linear) if $rows != 5 then return -1 endi @@ -930,7 +931,7 @@ if $data44 != @18-11-25 19:06:00.000@ then endi -sql select interp(c1) from intp_stb0 where ts >= '2018-09-17 20:35:00.000' and ts <= '2018-09-17 20:42:00.000' interval(1m) fill(linear); +sql select interp(c1) from intp_stb0 where ts >= '2018-09-17 20:35:00.000' and ts <= '2018-09-17 20:42:00.000' every(1m) fill(linear); if $rows != 8 then return -1 endi @@ -984,7 +985,7 @@ if $data71 != NULL then endi -sql select interp(c1) from intp_stb0 where ts >= '2018-09-17 20:35:00.000' and ts <= '2018-09-17 20:42:00.000' interval(1m) fill(linear) order by ts desc; +sql select interp(c1) from intp_stb0 where ts >= '2018-09-17 20:35:00.000' and ts <= '2018-09-17 20:42:00.000' every(1m) fill(linear) order by ts desc; if $rows != 8 then return -1 endi @@ -1037,7 +1038,7 @@ if $data71 != NULL then return -1 endi -sql select interp(c3) from intp_stb0 where ts >= '2018-09-17 20:35:00.000' and ts <= '2018-09-17 20:50:00.000' interval(2m) fill(linear) order by ts; +sql select interp(c3) from intp_stb0 where ts >= '2018-09-17 20:35:00.000' and ts <= '2018-09-17 20:50:00.000' every(2m) fill(linear) order by ts; if $rows != 9 then return -1 endi @@ -1097,7 +1098,7 @@ if $data81 != 1.00000 then endi -sql select interp(c3) from intp_stb0 where ts >= '2018-09-17 20:35:00.000' and ts <= '2018-09-17 20:50:00.000' interval(3m) fill(linear) order by ts; +sql select interp(c3) from intp_stb0 where ts >= '2018-09-17 20:35:00.000' and ts <= '2018-09-17 20:50:00.000' every(3m) fill(linear) order by ts; if $rows != 6 then return -1 endi @@ -1138,7 +1139,7 @@ if $data51 != 0.80000 then return -1 endi -sql select interp(c3) from intp_stb0 where ts >= '2018-09-17 20:35:00.000' and ts <= '2018-09-17 20:50:00.000' interval(3m) fill(linear) order by ts desc; +sql select interp(c3) from intp_stb0 where ts >= '2018-09-17 20:35:00.000' and ts <= '2018-09-17 20:50:00.000' every(3m) fill(linear) order by ts desc; if $rows != 6 then return -1 endi @@ -1181,7 +1182,7 @@ endi -sql select interp(pav) from ap1 where ts> '2021-07-25 02:19:54' and ts<'2021-07-25 02:20:00' interval(1s) fill(linear); +sql select interp(pav) from ap1 where ts> '2021-07-25 02:19:54' and ts<'2021-07-25 02:20:00' every(1s) fill(linear); if $rows != 6 then return -1 endi @@ -1222,7 +1223,7 @@ if $data51 != 9.87500 then return -1 endi -sql select interp(pav) from ap1 where ts> '2021-07-25 02:19:54' and ts<'2021-07-25 02:20:00' interval(1s) fill(value, 1); +sql select interp(pav) from ap1 where ts> '2021-07-25 02:19:54' and ts<'2021-07-25 02:20:00' every(1s) fill(value, 1); if $rows != 6 then return -1 endi @@ -1263,7 +1264,7 @@ if $data51 != 1.00000 then return -1 endi -sql select interp(pav) from ap1 where ts> '2021-07-25 02:19:54' and ts<'2021-07-25 02:20:00' interval(1s) fill(NULL); +sql select interp(pav) from ap1 where ts> '2021-07-25 02:19:54' and ts<'2021-07-25 02:20:00' every(1s) fill(NULL); if $rows != 6 then return -1 endi @@ -1304,7 +1305,7 @@ if $data51 != NULL then return -1 endi -sql select interp(pav) from ap1 where ts> '2021-07-25 02:19:54' and ts<'2021-07-25 02:20:00' interval(1s) fill(prev); +sql select interp(pav) from ap1 where ts> '2021-07-25 02:19:54' and ts<'2021-07-25 02:20:00' every(1s) fill(prev); if $rows != 6 then return -1 endi @@ -1345,7 +1346,7 @@ if $data51 != 9.00000 then return -1 endi -sql select interp(pav) from ap1 where ts> '2021-07-25 02:19:54' and ts<'2021-07-25 02:20:00' interval(1s) fill(next); +sql select interp(pav) from ap1 where ts> '2021-07-25 02:19:54' and ts<'2021-07-25 02:20:00' every(1s) fill(next); if $rows != 6 then return -1 endi @@ -1387,11 +1388,11 @@ if $data51 != 10.00000 then endi -sql select interp(pav) from ap1 where ts> '2021-07-25 02:19:54' and ts<'2021-07-25 02:19:56' interval(1s) fill(linear); +sql select interp(pav) from ap1 where ts> '2021-07-25 02:19:54' and ts<'2021-07-25 02:19:56' every(1s) fill(linear); if $rows != 0 then return -1 endi -sql select interp(pav) from ap1 where ts> '2021-07-25 02:19:54' and ts<'2021-07-25 02:19:56' interval(1s) fill(prev); +sql select interp(pav) from ap1 where ts> '2021-07-25 02:19:54' and ts<'2021-07-25 02:19:56' every(1s) fill(prev); if $rows != 2 then return -1 endi @@ -1408,7 +1409,7 @@ if $data11 != 3.00000 then return -1 endi -sql select interp(pav) from ap1 where ts> '2021-07-25 02:19:54' and ts<'2021-07-25 02:19:56' interval(1s) fill(next); +sql select interp(pav) from ap1 where ts> '2021-07-25 02:19:54' and ts<'2021-07-25 02:19:56' every(1s) fill(next); if $rows != 2 then return -1 endi @@ -1425,7 +1426,7 @@ if $data11 != NULL then return -1 endi -sql select interp(pav) from ap1 where ts> '2021-07-25 02:19:54' and ts<'2021-07-25 02:19:57' interval(1s) fill(linear); +sql select interp(pav) from ap1 where ts> '2021-07-25 02:19:54' and ts<'2021-07-25 02:19:57' every(1s) fill(linear); if $rows != 3 then return -1 endi @@ -1448,7 +1449,7 @@ if $data21 != 3.77273 then return -1 endi -sql select interp(pav) from ap1 where ts> '2021-07-25 02:19:54' and ts<'2021-07-25 02:19:57' interval(1s) fill(prev); +sql select interp(pav) from ap1 where ts> '2021-07-25 02:19:54' and ts<'2021-07-25 02:19:57' every(1s) fill(prev); if $rows != 3 then return -1 endi @@ -1471,7 +1472,7 @@ if $data21 != 3.00000 then return -1 endi -sql select interp(pav) from ap1 where ts> '2021-07-25 02:19:54' and ts<'2021-07-25 02:19:57' interval(1s) fill(next); +sql select interp(pav) from ap1 where ts> '2021-07-25 02:19:54' and ts<'2021-07-25 02:19:57' every(1s) fill(next); if $rows != 3 then return -1 endi @@ -1494,7 +1495,7 @@ if $data21 != 4.00000 then return -1 endi -sql select interp(pav) from ap1 where ts> '2021-07-25 02:19:54' and ts<='2021-07-25 02:20:03' interval(1s) fill(linear); +sql select interp(pav) from ap1 where ts> '2021-07-25 02:19:54' and ts<='2021-07-25 02:20:03' every(1s) fill(linear); if $rows != 10 then return -1 endi @@ -1559,7 +1560,7 @@ if $data91 != NULL then return -1 endi -sql select interp(pav) from ap1 where ts> '2021-07-25 02:19:54' and ts<='2021-07-25 02:20:03' interval(1s) fill(prev); +sql select interp(pav) from ap1 where ts> '2021-07-25 02:19:54' and ts<='2021-07-25 02:20:03' every(1s) fill(prev); if $rows != 10 then return -1 endi @@ -1624,7 +1625,7 @@ if $data91 != 14.00000 then return -1 endi -sql select interp(pav) from ap1 where ts> '2021-07-25 02:19:54' and ts<='2021-07-25 02:20:03' interval(1s) fill(next); +sql select interp(pav) from ap1 where ts> '2021-07-25 02:19:54' and ts<='2021-07-25 02:20:03' every(1s) fill(next); if $rows != 10 then return -1 endi @@ -1689,7 +1690,7 @@ if $data91 != NULL then return -1 endi -sql select interp(pav) from ap1 where ts> '2021-07-25 02:19:54' and ts<='2021-07-25 02:20:05' interval(1s) fill(linear); +sql select interp(pav) from ap1 where ts> '2021-07-25 02:19:54' and ts<='2021-07-25 02:20:05' every(1s) fill(linear); if $rows != 12 then return -1 endi @@ -1742,7 +1743,7 @@ if $data71 != 15.29412 then return -1 endi -sql select interp(pav) from ap1 where ts> '2021-07-25 02:19:54' and ts<='2021-07-25 02:20:05' interval(1s) fill(prev); +sql select interp(pav) from ap1 where ts> '2021-07-25 02:19:54' and ts<='2021-07-25 02:20:05' every(1s) fill(prev); if $rows != 12 then return -1 endi @@ -1807,7 +1808,7 @@ if $data91 != 14.00000 then return -1 endi -sql select interp(pav) from ap1 where ts> '2021-07-25 02:19:54' and ts<='2021-07-25 02:20:05' interval(1s) fill(next); +sql select interp(pav) from ap1 where ts> '2021-07-25 02:19:54' and ts<='2021-07-25 02:20:05' every(1s) fill(next); if $rows != 12 then return -1 endi @@ -1872,7 +1873,7 @@ if $data91 != 20.00000 then return -1 endi -sql select interp(pav) from ap1 where ts> '2021-07-25 02:20:02' and ts<='2021-07-25 02:20:05' interval(1s) fill(value, 1); +sql select interp(pav) from ap1 where ts> '2021-07-25 02:20:02' and ts<='2021-07-25 02:20:05' every(1s) fill(value, 1); if $rows != 4 then return -1 endi @@ -1901,7 +1902,7 @@ if $data31 != 20.00000 then return -1 endi -sql select interp(pav) from ap1 where ts> '2021-07-25 02:20:02' and ts<='2021-07-25 02:20:05' interval(1s) fill(null); +sql select interp(pav) from ap1 where ts> '2021-07-25 02:20:02' and ts<='2021-07-25 02:20:05' every(1s) fill(null); if $rows != 4 then return -1 endi @@ -1931,7 +1932,7 @@ if $data31 != 20.00000 then endi -sql select interp(pav) from ap1 where ts> '2021-07-25 02:19:54' and ts<='2021-07-25 02:20:25' interval(1s) fill(linear); +sql select interp(pav) from ap1 where ts> '2021-07-25 02:19:54' and ts<='2021-07-25 02:20:25' every(1s) fill(linear); if $rows != 32 then return -1 endi @@ -1984,7 +1985,7 @@ if $data71 != 15.29412 then return -1 endi -sql select interp(pav) from ap1 where ts> '2021-07-25 02:19:54' and ts<='2021-07-25 02:20:25' interval(1s) fill(prev); +sql select interp(pav) from ap1 where ts> '2021-07-25 02:19:54' and ts<='2021-07-25 02:20:25' every(1s) fill(prev); if $rows != 32 then return -1 endi @@ -2049,7 +2050,7 @@ if $data91 != 14.00000 then return -1 endi -sql select interp(pav) from ap1 where ts> '2021-07-25 02:19:54' and ts<='2021-07-25 02:20:25' interval(1s) fill(next); +sql select interp(pav) from ap1 where ts> '2021-07-25 02:19:54' and ts<='2021-07-25 02:20:25' every(1s) fill(next); if $rows != 32 then return -1 endi @@ -2115,7 +2116,7 @@ if $data91 != 20.00000 then endi -sql select interp(pav) from ap1 where ts> '2021-07-25 02:19:54' and ts<='2021-07-25 02:25:00' interval(1s) fill(linear); +sql select interp(pav) from ap1 where ts> '2021-07-25 02:19:54' and ts<='2021-07-25 02:25:00' every(1s) fill(linear); if $rows != 307 then return -1 endi @@ -2168,7 +2169,7 @@ if $data71 != 15.29412 then return -1 endi -sql select interp(pav) from ap1 where ts> '2021-07-25 02:19:54' and ts<='2021-07-25 02:25:00' interval(1s) fill(prev); +sql select interp(pav) from ap1 where ts> '2021-07-25 02:19:54' and ts<='2021-07-25 02:25:00' every(1s) fill(prev); if $rows != 307 then return -1 endi @@ -2233,7 +2234,7 @@ if $data91 != 14.00000 then return -1 endi -sql select interp(pav) from ap1 where ts> '2021-07-25 02:19:54' and ts<='2021-07-25 02:25:00' interval(1s) fill(next); +sql select interp(pav) from ap1 where ts> '2021-07-25 02:19:54' and ts<='2021-07-25 02:25:00' every(1s) fill(next); if $rows != 307 then return -1 endi @@ -2298,7 +2299,7 @@ if $data91 != 20.00000 then return -1 endi -sql select interp(pav) from ap1 where ts> '2021-07-25 02:19:54' and ts<='2021-07-25 03:25:00' interval(1s) fill(linear); +sql select interp(pav) from ap1 where ts> '2021-07-25 02:19:54' and ts<='2021-07-25 03:25:00' every(1s) fill(linear); if $rows != 3907 then return -1 endi @@ -2352,7 +2353,7 @@ if $data71 != 15.29412 then endi -sql select interp(pav) from ap1 where ts> '2021-07-25 02:19:54' and ts<='2021-07-25 03:25:00' interval(1s) fill(prev); +sql select interp(pav) from ap1 where ts> '2021-07-25 02:19:54' and ts<='2021-07-25 03:25:00' every(1s) fill(prev); if $rows != 3907 then return -1 endi @@ -2417,7 +2418,7 @@ if $data91 != 14.00000 then return -1 endi -sql select interp(pav) from ap1 where ts> '2021-07-25 02:19:54' and ts<='2021-07-25 03:25:00' interval(1s) fill(next); +sql select interp(pav) from ap1 where ts> '2021-07-25 02:19:54' and ts<='2021-07-25 03:25:00' every(1s) fill(next); if $rows != 3907 then return -1 endi @@ -2482,7 +2483,7 @@ if $data91 != 20.00000 then return -1 endi -sql select interp(pav) from ap1 where ts> '2021-07-25 02:19:54' and ts<'2021-07-25 02:20:07' interval(1s); +sql select interp(pav) from ap1 where ts> '2021-07-25 02:19:54' and ts<'2021-07-25 02:20:07' every(1s); if $rows != 1 then return -1 endi