未验证 提交 3ab9fe47 编写于 作者: wmmhello's avatar wmmhello 提交者: GitHub

Merge pull request #8488 from taosdata/fix/TD-10399-master

fix error tips because of overflowing of convert time precision & inv…
......@@ -343,15 +343,20 @@ int64_t convertTimePrecision(int64_t time, int32_t fromPrecision, int32_t toPrec
assert(toPrecision == TSDB_TIME_PRECISION_MILLI ||
toPrecision == TSDB_TIME_PRECISION_MICRO ||
toPrecision == TSDB_TIME_PRECISION_NANO);
double tempResult = (double)time;
switch(fromPrecision) {
case TSDB_TIME_PRECISION_MILLI: {
switch (toPrecision) {
case TSDB_TIME_PRECISION_MILLI:
return time;
case TSDB_TIME_PRECISION_MICRO:
return time * 1000;
tempResult *= 1000;
time *= 1000;
goto end_;
case TSDB_TIME_PRECISION_NANO:
return time * 1000000;
tempResult *= 1000000;
time *= 1000000;
goto end_;
}
} // end from milli
case TSDB_TIME_PRECISION_MICRO: {
......@@ -361,7 +366,9 @@ int64_t convertTimePrecision(int64_t time, int32_t fromPrecision, int32_t toPrec
case TSDB_TIME_PRECISION_MICRO:
return time;
case TSDB_TIME_PRECISION_NANO:
return time * 1000;
tempResult *= 1000;
time *= 1000;
goto end_;
}
} //end from micro
case TSDB_TIME_PRECISION_NANO: {
......@@ -379,26 +386,45 @@ int64_t convertTimePrecision(int64_t time, int32_t fromPrecision, int32_t toPrec
return time; // only to pass windows compilation
}
} //end switch fromPrecision
end_:
if (tempResult >= (double)INT64_MAX) return INT64_MAX;
if (tempResult <= (double)INT64_MIN) return INT64_MIN + 1; // INT64_MIN means NULL
return time;
}
static int32_t getDuration(int64_t val, char unit, int64_t* result, int32_t timePrecision) {
switch (unit) {
case 's':
case 's':{
double temp = ((double)val) * MILLISECOND_PER_SECOND;
if (temp >= (double)INT64_MAX || temp <= (double)INT64_MIN) return -1;
(*result) = convertTimePrecision(val * MILLISECOND_PER_SECOND, TSDB_TIME_PRECISION_MILLI, timePrecision);
break;
case 'm':
}
case 'm':{
double temp = ((double)val) * MILLISECOND_PER_MINUTE;
if (temp >= (double)INT64_MAX || temp <= (double)INT64_MIN) return -1;
(*result) = convertTimePrecision(val * MILLISECOND_PER_MINUTE, TSDB_TIME_PRECISION_MILLI, timePrecision);
break;
case 'h':
}
case 'h':{
double temp = ((double)val) * MILLISECOND_PER_HOUR;
if (temp >= (double)INT64_MAX || temp <= (double)INT64_MIN) return -1;
(*result) = convertTimePrecision(val * MILLISECOND_PER_HOUR, TSDB_TIME_PRECISION_MILLI, timePrecision);
break;
case 'd':
}
case 'd': {
double temp = ((double)val) * MILLISECOND_PER_DAY;
if (temp >= (double)INT64_MAX || temp <= (double)INT64_MIN) return -1;
(*result) = convertTimePrecision(val * MILLISECOND_PER_DAY, TSDB_TIME_PRECISION_MILLI, timePrecision);
break;
case 'w':
}
case 'w': {
double temp = ((double)val) * MILLISECOND_PER_WEEK;
if (temp >= (double)INT64_MAX || temp <= (double)INT64_MIN) return -1;
(*result) = convertTimePrecision(val * MILLISECOND_PER_WEEK, TSDB_TIME_PRECISION_MILLI, timePrecision);
break;
}
case 'a':
(*result) = convertTimePrecision(val, TSDB_TIME_PRECISION_MILLI, timePrecision);
break;
......
......@@ -281,7 +281,7 @@ void *destroyRelationInfo(SRelationInfo* pFromInfo);
SRelationInfo *addSubqueryElem(SRelationInfo* pRelationInfo, SArray* pSub, SStrToken* pAlias);
// sql expr leaf node
tSqlExpr *tSqlExprCreateIdValue(SStrToken *pToken, int32_t optrType);
tSqlExpr *tSqlExprCreateIdValue(SSqlInfo* pInfo, SStrToken *pToken, int32_t optrType);
tSqlExpr *tSqlExprCreateFunction(SArray *pParam, SStrToken *pFuncToken, SStrToken *endToken, int32_t optType);
SArray *tStrTokenAppend(SArray *pList, SStrToken *pToken);
......
......@@ -515,7 +515,7 @@ selcollist(A) ::= sclp(P) distinct(Z) expr(X) as(Y). {
}
selcollist(A) ::= sclp(P) STAR. {
tSqlExpr *pNode = tSqlExprCreateIdValue(NULL, TK_ALL);
tSqlExpr *pNode = tSqlExprCreateIdValue(pInfo, NULL, TK_ALL);
A = tSqlExprListAppend(P, pNode, 0, 0);
}
......@@ -696,23 +696,23 @@ where_opt(A) ::= WHERE expr(X). {A = X;}
expr(A) ::= LP(X) expr(Y) RP(Z). {A = Y; A->exprToken.z = X.z; A->exprToken.n = (Z.z - X.z + 1);}
expr(A) ::= ID(X). { A = tSqlExprCreateIdValue(&X, TK_ID);}
expr(A) ::= ID(X) DOT ID(Y). { X.n += (1+Y.n); A = tSqlExprCreateIdValue(&X, TK_ID);}
expr(A) ::= ID(X) DOT STAR(Y). { X.n += (1+Y.n); A = tSqlExprCreateIdValue(&X, TK_ALL);}
expr(A) ::= INTEGER(X). { A = tSqlExprCreateIdValue(&X, TK_INTEGER);}
expr(A) ::= MINUS(X) INTEGER(Y). { X.n += Y.n; X.type = TK_INTEGER; A = tSqlExprCreateIdValue(&X, TK_INTEGER);}
expr(A) ::= PLUS(X) INTEGER(Y). { X.n += Y.n; X.type = TK_INTEGER; A = tSqlExprCreateIdValue(&X, TK_INTEGER);}
expr(A) ::= FLOAT(X). { A = tSqlExprCreateIdValue(&X, TK_FLOAT);}
expr(A) ::= MINUS(X) FLOAT(Y). { X.n += Y.n; X.type = TK_FLOAT; A = tSqlExprCreateIdValue(&X, TK_FLOAT);}
expr(A) ::= PLUS(X) FLOAT(Y). { X.n += Y.n; X.type = TK_FLOAT; A = tSqlExprCreateIdValue(&X, TK_FLOAT);}
expr(A) ::= STRING(X). { A = tSqlExprCreateIdValue(&X, TK_STRING);}
expr(A) ::= NOW(X). { A = tSqlExprCreateIdValue(&X, TK_NOW); }
expr(A) ::= VARIABLE(X). { A = tSqlExprCreateIdValue(&X, TK_VARIABLE);}
expr(A) ::= PLUS(X) VARIABLE(Y). { X.n += Y.n; X.type = TK_VARIABLE; A = tSqlExprCreateIdValue(&X, TK_VARIABLE);}
expr(A) ::= MINUS(X) VARIABLE(Y). { X.n += Y.n; X.type = TK_VARIABLE; A = tSqlExprCreateIdValue(&X, TK_VARIABLE);}
expr(A) ::= BOOL(X). { A = tSqlExprCreateIdValue(&X, TK_BOOL);}
expr(A) ::= NULL(X). { A = tSqlExprCreateIdValue(&X, TK_NULL);}
expr(A) ::= ID(X). { A = tSqlExprCreateIdValue(pInfo, &X, TK_ID);}
expr(A) ::= ID(X) DOT ID(Y). { X.n += (1+Y.n); A = tSqlExprCreateIdValue(pInfo, &X, TK_ID);}
expr(A) ::= ID(X) DOT STAR(Y). { X.n += (1+Y.n); A = tSqlExprCreateIdValue(pInfo, &X, TK_ALL);}
expr(A) ::= INTEGER(X). { A = tSqlExprCreateIdValue(pInfo, &X, TK_INTEGER);}
expr(A) ::= MINUS(X) INTEGER(Y). { X.n += Y.n; X.type = TK_INTEGER; A = tSqlExprCreateIdValue(pInfo, &X, TK_INTEGER);}
expr(A) ::= PLUS(X) INTEGER(Y). { X.n += Y.n; X.type = TK_INTEGER; A = tSqlExprCreateIdValue(pInfo, &X, TK_INTEGER);}
expr(A) ::= FLOAT(X). { A = tSqlExprCreateIdValue(pInfo, &X, TK_FLOAT);}
expr(A) ::= MINUS(X) FLOAT(Y). { X.n += Y.n; X.type = TK_FLOAT; A = tSqlExprCreateIdValue(pInfo, &X, TK_FLOAT);}
expr(A) ::= PLUS(X) FLOAT(Y). { X.n += Y.n; X.type = TK_FLOAT; A = tSqlExprCreateIdValue(pInfo, &X, TK_FLOAT);}
expr(A) ::= STRING(X). { A = tSqlExprCreateIdValue(pInfo, &X, TK_STRING);}
expr(A) ::= NOW(X). { A = tSqlExprCreateIdValue(pInfo, &X, TK_NOW); }
expr(A) ::= VARIABLE(X). { A = tSqlExprCreateIdValue(pInfo, &X, TK_VARIABLE);}
expr(A) ::= PLUS(X) VARIABLE(Y). { X.n += Y.n; X.type = TK_VARIABLE; A = tSqlExprCreateIdValue(pInfo, &X, TK_VARIABLE);}
expr(A) ::= MINUS(X) VARIABLE(Y). { X.n += Y.n; X.type = TK_VARIABLE; A = tSqlExprCreateIdValue(pInfo, &X, TK_VARIABLE);}
expr(A) ::= BOOL(X). { A = tSqlExprCreateIdValue(pInfo, &X, TK_BOOL);}
expr(A) ::= NULL(X). { A = tSqlExprCreateIdValue(pInfo, &X, TK_NULL);}
// ordinary functions: min(x), max(x), top(k, 20)
expr(A) ::= ID(X) LP exprlist(Y) RP(E). { tStrTokenAppend(pInfo->funcs, &X); A = tSqlExprCreateFunction(Y, &X, &E, X.type); }
......
......@@ -134,7 +134,7 @@ SArray *tStrTokenAppend(SArray *pList, SStrToken *pToken) {
return pList;
}
tSqlExpr *tSqlExprCreateIdValue(SStrToken *pToken, int32_t optrType) {
tSqlExpr *tSqlExprCreateIdValue(SSqlInfo* pInfo, SStrToken *pToken, int32_t optrType) {
tSqlExpr *pSqlExpr = calloc(1, sizeof(tSqlExpr));
if (pToken != NULL) {
......@@ -169,6 +169,7 @@ tSqlExpr *tSqlExprCreateIdValue(SStrToken *pToken, int32_t optrType) {
char unit = 0;
int32_t ret = parseAbsoluteDuration(pToken->z, pToken->n, &pSqlExpr->value.i64, &unit, TSDB_TIME_PRECISION_NANO);
if (ret != TSDB_CODE_SUCCESS) {
snprintf(pInfo->msg, tListLen(pInfo->msg), "%s", pToken->z);
terrno = TSDB_CODE_TSC_SQL_SYNTAX_ERROR;
}
}
......
/* This file is automatically generated by Lemon from input grammar
** source file "sql.y". */
/*
** 2000-05-29
**
......@@ -22,10 +24,7 @@
** The following is the concatenation of all %include directives from the
** input grammar file:
*/
#include <stdio.h>
#include <assert.h>
/************ Begin %include sections from the grammar ************************/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
......@@ -38,11 +37,207 @@
#include "tutil.h"
#include "tvariant.h"
/**************** End of %include directives **********************************/
/* 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 ***************************/
/* 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_IPTOKEN 60
#define TK_DOT 61
#define TK_CREATE 62
#define TK_TABLE 63
#define TK_STABLE 64
#define TK_DATABASE 65
#define TK_TABLES 66
#define TK_STABLES 67
#define TK_VGROUPS 68
#define TK_DROP 69
#define TK_TOPIC 70
#define TK_FUNCTION 71
#define TK_DNODE 72
#define TK_USER 73
#define TK_ACCOUNT 74
#define TK_USE 75
#define TK_DESCRIBE 76
#define TK_DESC 77
#define TK_ALTER 78
#define TK_PASS 79
#define TK_PRIVILEGE 80
#define TK_LOCAL 81
#define TK_COMPACT 82
#define TK_LP 83
#define TK_RP 84
#define TK_IF 85
#define TK_EXISTS 86
#define TK_AS 87
#define TK_OUTPUTTYPE 88
#define TK_AGGREGATE 89
#define TK_BUFSIZE 90
#define TK_PPS 91
#define TK_TSERIES 92
#define TK_DBS 93
#define TK_STORAGE 94
#define TK_QTIME 95
#define TK_CONNS 96
#define TK_STATE 97
#define TK_COMMA 98
#define TK_KEEP 99
#define TK_CACHE 100
#define TK_REPLICA 101
#define TK_QUORUM 102
#define TK_DAYS 103
#define TK_MINROWS 104
#define TK_MAXROWS 105
#define TK_BLOCKS 106
#define TK_CTIME 107
#define TK_WAL 108
#define TK_FSYNC 109
#define TK_COMP 110
#define TK_PRECISION 111
#define TK_UPDATE 112
#define TK_CACHELAST 113
#define TK_PARTITIONS 114
#define TK_UNSIGNED 115
#define TK_TAGS 116
#define TK_USING 117
#define TK_NULL 118
#define TK_NOW 119
#define TK_SELECT 120
#define TK_UNION 121
#define TK_ALL 122
#define TK_DISTINCT 123
#define TK_FROM 124
#define TK_VARIABLE 125
#define TK_INTERVAL 126
#define TK_EVERY 127
#define TK_SESSION 128
#define TK_STATE_WINDOW 129
#define TK_FILL 130
#define TK_SLIDING 131
#define TK_ORDER 132
#define TK_BY 133
#define TK_ASC 134
#define TK_GROUP 135
#define TK_HAVING 136
#define TK_LIMIT 137
#define TK_OFFSET 138
#define TK_SLIMIT 139
#define TK_SOFFSET 140
#define TK_WHERE 141
#define TK_RESET 142
#define TK_QUERY 143
#define TK_SYNCDB 144
#define TK_ADD 145
#define TK_COLUMN 146
#define TK_MODIFY 147
#define TK_TAG 148
#define TK_CHANGE 149
#define TK_SET 150
#define TK_KILL 151
#define TK_CONNECTION 152
#define TK_STREAM 153
#define TK_COLON 154
#define TK_ABORT 155
#define TK_AFTER 156
#define TK_ATTACH 157
#define TK_BEFORE 158
#define TK_BEGIN 159
#define TK_CASCADE 160
#define TK_CLUSTER 161
#define TK_CONFLICT 162
#define TK_COPY 163
#define TK_DEFERRED 164
#define TK_DELIMITERS 165
#define TK_DETACH 166
#define TK_EACH 167
#define TK_END 168
#define TK_EXPLAIN 169
#define TK_FAIL 170
#define TK_FOR 171
#define TK_IGNORE 172
#define TK_IMMEDIATE 173
#define TK_INITIALLY 174
#define TK_INSTEAD 175
#define TK_MATCH 176
#define TK_KEY 177
#define TK_OF 178
#define TK_RAISE 179
#define TK_REPLACE 180
#define TK_RESTRICT 181
#define TK_ROW 182
#define TK_STATEMENT 183
#define TK_TRIGGER 184
#define TK_VIEW 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_FILE 196
#endif
/**************** End token definitions ***************************************/
/* The next sections is a series of control #defines.
** various aspects of the generated parser.
......@@ -140,6 +335,7 @@ typedef union {
#define YYFALLBACK 1
#define YYNSTATE 363
#define YYNRULE 291
#define YYNRULE_WITH_ACTION 291
#define YYNTOKEN 197
#define YY_MAX_SHIFT 362
#define YY_MIN_SHIFTREDUCE 571
......@@ -767,6 +963,7 @@ typedef struct yyParser yyParser;
#ifndef NDEBUG
#include <stdio.h>
#include <assert.h>
static FILE *yyTraceFILE = 0;
static char *yyTracePrompt = 0;
#endif /* NDEBUG */
......@@ -1681,15 +1878,18 @@ static YYACTIONTYPE yy_find_shift_action(
do{
i = yy_shift_ofst[stateno];
assert( i>=0 );
/* assert( i+YYNTOKEN<=(int)YY_NLOOKAHEAD ); */
assert( i<=YY_ACTTAB_COUNT );
assert( i+YYNTOKEN<=(int)YY_NLOOKAHEAD );
assert( iLookAhead!=YYNOCODE );
assert( iLookAhead < YYNTOKEN );
i += iLookAhead;
if( i>=YY_NLOOKAHEAD || yy_lookahead[i]!=iLookAhead ){
assert( i<(int)YY_NLOOKAHEAD );
if( yy_lookahead[i]!=iLookAhead ){
#ifdef YYFALLBACK
YYCODETYPE iFallback; /* Fallback token */
if( iLookAhead<sizeof(yyFallback)/sizeof(yyFallback[0])
&& (iFallback = yyFallback[iLookAhead])!=0 ){
assert( iLookAhead<sizeof(yyFallback)/sizeof(yyFallback[0]) );
iFallback = yyFallback[iLookAhead];
if( iFallback!=0 ){
#ifndef NDEBUG
if( yyTraceFILE ){
fprintf(yyTraceFILE, "%sFALLBACK %s => %s\n",
......@@ -1704,16 +1904,8 @@ static YYACTIONTYPE yy_find_shift_action(
#ifdef YYWILDCARD
{
int j = i - iLookAhead + YYWILDCARD;
if(
#if YY_SHIFT_MIN+YYWILDCARD<0
j>=0 &&
#endif
#if YY_SHIFT_MAX+YYWILDCARD>=YY_ACTTAB_COUNT
j<YY_ACTTAB_COUNT &&
#endif
j<(int)(sizeof(yy_lookahead)/sizeof(yy_lookahead[0])) &&
yy_lookahead[j]==YYWILDCARD && iLookAhead>0
){
assert( j<(int)(sizeof(yy_lookahead)/sizeof(yy_lookahead[0])) );
if( yy_lookahead[j]==YYWILDCARD && iLookAhead>0 ){
#ifndef NDEBUG
if( yyTraceFILE ){
fprintf(yyTraceFILE, "%sWILDCARD %s => %s\n",
......@@ -1727,6 +1919,7 @@ 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);
......@@ -1845,304 +2038,596 @@ static void yy_shift(
yyTraceShift(yypParser, yyNewState, "Shift");
}
/* 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 IPTOKEN */
{ 199, 0 }, /* (17) dbPrefix ::= */
{ 199, -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, -5 }, /* (29) cmd ::= DROP TABLE ifexists ids cpxName */
{ 198, -5 }, /* (30) cmd ::= DROP STABLE ifexists ids cpxName */
{ 198, -4 }, /* (31) cmd ::= DROP DATABASE ifexists ids */
{ 198, -4 }, /* (32) cmd ::= DROP TOPIC ifexists ids */
{ 198, -3 }, /* (33) cmd ::= DROP FUNCTION ids */
{ 198, -3 }, /* (34) cmd ::= DROP DNODE ids */
{ 198, -3 }, /* (35) cmd ::= DROP USER ids */
{ 198, -3 }, /* (36) cmd ::= DROP ACCOUNT ids */
{ 198, -2 }, /* (37) cmd ::= USE ids */
{ 198, -3 }, /* (38) cmd ::= DESCRIBE ids cpxName */
{ 198, -3 }, /* (39) cmd ::= DESC ids cpxName */
{ 198, -5 }, /* (40) cmd ::= ALTER USER ids PASS ids */
{ 198, -5 }, /* (41) cmd ::= ALTER USER ids PRIVILEGE ids */
{ 198, -4 }, /* (42) cmd ::= ALTER DNODE ids ids */
{ 198, -5 }, /* (43) cmd ::= ALTER DNODE ids ids ids */
{ 198, -3 }, /* (44) cmd ::= ALTER LOCAL ids */
{ 198, -4 }, /* (45) cmd ::= ALTER LOCAL ids ids */
{ 198, -4 }, /* (46) cmd ::= ALTER DATABASE ids alter_db_optr */
{ 198, -4 }, /* (47) cmd ::= ALTER TOPIC ids alter_topic_optr */
{ 198, -4 }, /* (48) cmd ::= ALTER ACCOUNT ids acct_optr */
{ 198, -6 }, /* (49) cmd ::= ALTER ACCOUNT ids PASS ids acct_optr */
{ 198, -6 }, /* (50) cmd ::= COMPACT VNODES IN LP exprlist RP */
{ 200, -1 }, /* (51) ids ::= ID */
{ 200, -1 }, /* (52) ids ::= STRING */
{ 202, -2 }, /* (53) ifexists ::= IF EXISTS */
{ 202, 0 }, /* (54) ifexists ::= */
{ 207, -3 }, /* (55) ifnotexists ::= IF NOT EXISTS */
{ 207, 0 }, /* (56) ifnotexists ::= */
{ 198, -3 }, /* (57) cmd ::= CREATE DNODE ids */
{ 198, -6 }, /* (58) cmd ::= CREATE ACCOUNT ids PASS ids acct_optr */
{ 198, -5 }, /* (59) cmd ::= CREATE DATABASE ifnotexists ids db_optr */
{ 198, -5 }, /* (60) cmd ::= CREATE TOPIC ifnotexists ids topic_optr */
{ 198, -8 }, /* (61) cmd ::= CREATE FUNCTION ids AS ids OUTPUTTYPE typename bufsize */
{ 198, -9 }, /* (62) cmd ::= CREATE AGGREGATE FUNCTION ids AS ids OUTPUTTYPE typename bufsize */
{ 198, -5 }, /* (63) cmd ::= CREATE USER ids PASS ids */
{ 211, 0 }, /* (64) bufsize ::= */
{ 211, -2 }, /* (65) bufsize ::= BUFSIZE INTEGER */
{ 212, 0 }, /* (66) pps ::= */
{ 212, -2 }, /* (67) pps ::= PPS INTEGER */
{ 213, 0 }, /* (68) tseries ::= */
{ 213, -2 }, /* (69) tseries ::= TSERIES INTEGER */
{ 214, 0 }, /* (70) dbs ::= */
{ 214, -2 }, /* (71) dbs ::= DBS INTEGER */
{ 215, 0 }, /* (72) streams ::= */
{ 215, -2 }, /* (73) streams ::= STREAMS INTEGER */
{ 216, 0 }, /* (74) storage ::= */
{ 216, -2 }, /* (75) storage ::= STORAGE INTEGER */
{ 217, 0 }, /* (76) qtime ::= */
{ 217, -2 }, /* (77) qtime ::= QTIME INTEGER */
{ 218, 0 }, /* (78) users ::= */
{ 218, -2 }, /* (79) users ::= USERS INTEGER */
{ 219, 0 }, /* (80) conns ::= */
{ 219, -2 }, /* (81) conns ::= CONNS INTEGER */
{ 220, 0 }, /* (82) state ::= */
{ 220, -2 }, /* (83) state ::= STATE ids */
{ 205, -9 }, /* (84) acct_optr ::= pps tseries storage streams qtime dbs users conns state */
{ 221, -3 }, /* (85) intitemlist ::= intitemlist COMMA intitem */
{ 221, -1 }, /* (86) intitemlist ::= intitem */
{ 222, -1 }, /* (87) intitem ::= INTEGER */
{ 223, -2 }, /* (88) keep ::= KEEP intitemlist */
{ 224, -2 }, /* (89) cache ::= CACHE INTEGER */
{ 225, -2 }, /* (90) replica ::= REPLICA INTEGER */
{ 226, -2 }, /* (91) quorum ::= QUORUM INTEGER */
{ 227, -2 }, /* (92) days ::= DAYS INTEGER */
{ 228, -2 }, /* (93) minrows ::= MINROWS INTEGER */
{ 229, -2 }, /* (94) maxrows ::= MAXROWS INTEGER */
{ 230, -2 }, /* (95) blocks ::= BLOCKS INTEGER */
{ 231, -2 }, /* (96) ctime ::= CTIME INTEGER */
{ 232, -2 }, /* (97) wal ::= WAL INTEGER */
{ 233, -2 }, /* (98) fsync ::= FSYNC INTEGER */
{ 234, -2 }, /* (99) comp ::= COMP INTEGER */
{ 235, -2 }, /* (100) prec ::= PRECISION STRING */
{ 236, -2 }, /* (101) update ::= UPDATE INTEGER */
{ 237, -2 }, /* (102) cachelast ::= CACHELAST INTEGER */
{ 238, -2 }, /* (103) partitions ::= PARTITIONS INTEGER */
{ 208, 0 }, /* (104) db_optr ::= */
{ 208, -2 }, /* (105) db_optr ::= db_optr cache */
{ 208, -2 }, /* (106) db_optr ::= db_optr replica */
{ 208, -2 }, /* (107) db_optr ::= db_optr quorum */
{ 208, -2 }, /* (108) db_optr ::= db_optr days */
{ 208, -2 }, /* (109) db_optr ::= db_optr minrows */
{ 208, -2 }, /* (110) db_optr ::= db_optr maxrows */
{ 208, -2 }, /* (111) db_optr ::= db_optr blocks */
{ 208, -2 }, /* (112) db_optr ::= db_optr ctime */
{ 208, -2 }, /* (113) db_optr ::= db_optr wal */
{ 208, -2 }, /* (114) db_optr ::= db_optr fsync */
{ 208, -2 }, /* (115) db_optr ::= db_optr comp */
{ 208, -2 }, /* (116) db_optr ::= db_optr prec */
{ 208, -2 }, /* (117) db_optr ::= db_optr keep */
{ 208, -2 }, /* (118) db_optr ::= db_optr update */
{ 208, -2 }, /* (119) db_optr ::= db_optr cachelast */
{ 209, -1 }, /* (120) topic_optr ::= db_optr */
{ 209, -2 }, /* (121) topic_optr ::= topic_optr partitions */
{ 203, 0 }, /* (122) alter_db_optr ::= */
{ 203, -2 }, /* (123) alter_db_optr ::= alter_db_optr replica */
{ 203, -2 }, /* (124) alter_db_optr ::= alter_db_optr quorum */
{ 203, -2 }, /* (125) alter_db_optr ::= alter_db_optr keep */
{ 203, -2 }, /* (126) alter_db_optr ::= alter_db_optr blocks */
{ 203, -2 }, /* (127) alter_db_optr ::= alter_db_optr comp */
{ 203, -2 }, /* (128) alter_db_optr ::= alter_db_optr update */
{ 203, -2 }, /* (129) alter_db_optr ::= alter_db_optr cachelast */
{ 204, -1 }, /* (130) alter_topic_optr ::= alter_db_optr */
{ 204, -2 }, /* (131) alter_topic_optr ::= alter_topic_optr partitions */
{ 210, -1 }, /* (132) typename ::= ids */
{ 210, -4 }, /* (133) typename ::= ids LP signed RP */
{ 210, -2 }, /* (134) typename ::= ids UNSIGNED */
{ 239, -1 }, /* (135) signed ::= INTEGER */
{ 239, -2 }, /* (136) signed ::= PLUS INTEGER */
{ 239, -2 }, /* (137) signed ::= MINUS INTEGER */
{ 198, -3 }, /* (138) cmd ::= CREATE TABLE create_table_args */
{ 198, -3 }, /* (139) cmd ::= CREATE TABLE create_stable_args */
{ 198, -3 }, /* (140) cmd ::= CREATE STABLE create_stable_args */
{ 198, -3 }, /* (141) cmd ::= CREATE TABLE create_table_list */
{ 242, -1 }, /* (142) create_table_list ::= create_from_stable */
{ 242, -2 }, /* (143) create_table_list ::= create_table_list create_from_stable */
{ 240, -6 }, /* (144) create_table_args ::= ifnotexists ids cpxName LP columnlist RP */
{ 241, -10 }, /* (145) create_stable_args ::= ifnotexists ids cpxName LP columnlist RP TAGS LP columnlist RP */
{ 243, -10 }, /* (146) create_from_stable ::= ifnotexists ids cpxName USING ids cpxName TAGS LP tagitemlist RP */
{ 243, -13 }, /* (147) create_from_stable ::= ifnotexists ids cpxName USING ids cpxName LP tagNamelist RP TAGS LP tagitemlist RP */
{ 246, -3 }, /* (148) tagNamelist ::= tagNamelist COMMA ids */
{ 246, -1 }, /* (149) tagNamelist ::= ids */
{ 240, -5 }, /* (150) create_table_args ::= ifnotexists ids cpxName AS select */
{ 244, -3 }, /* (151) columnlist ::= columnlist COMMA column */
{ 244, -1 }, /* (152) columnlist ::= column */
{ 248, -2 }, /* (153) column ::= ids typename */
{ 245, -3 }, /* (154) tagitemlist ::= tagitemlist COMMA tagitem */
{ 245, -1 }, /* (155) tagitemlist ::= tagitem */
{ 249, -1 }, /* (156) tagitem ::= INTEGER */
{ 249, -1 }, /* (157) tagitem ::= FLOAT */
{ 249, -1 }, /* (158) tagitem ::= STRING */
{ 249, -1 }, /* (159) tagitem ::= BOOL */
{ 249, -1 }, /* (160) tagitem ::= NULL */
{ 249, -1 }, /* (161) tagitem ::= NOW */
{ 249, -2 }, /* (162) tagitem ::= MINUS INTEGER */
{ 249, -2 }, /* (163) tagitem ::= MINUS FLOAT */
{ 249, -2 }, /* (164) tagitem ::= PLUS INTEGER */
{ 249, -2 }, /* (165) tagitem ::= PLUS FLOAT */
{ 247, -14 }, /* (166) 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 }, /* (167) select ::= LP select RP */
{ 263, -1 }, /* (168) union ::= select */
{ 263, -4 }, /* (169) union ::= union UNION ALL select */
{ 198, -1 }, /* (170) cmd ::= union */
{ 247, -2 }, /* (171) select ::= SELECT selcollist */
{ 264, -2 }, /* (172) sclp ::= selcollist COMMA */
{ 264, 0 }, /* (173) sclp ::= */
{ 250, -4 }, /* (174) selcollist ::= sclp distinct expr as */
{ 250, -2 }, /* (175) selcollist ::= sclp STAR */
{ 267, -2 }, /* (176) as ::= AS ids */
{ 267, -1 }, /* (177) as ::= ids */
{ 267, 0 }, /* (178) as ::= */
{ 265, -1 }, /* (179) distinct ::= DISTINCT */
{ 265, 0 }, /* (180) distinct ::= */
{ 251, -2 }, /* (181) from ::= FROM tablelist */
{ 251, -2 }, /* (182) from ::= FROM sub */
{ 269, -3 }, /* (183) sub ::= LP union RP */
{ 269, -4 }, /* (184) sub ::= LP union RP ids */
{ 269, -6 }, /* (185) sub ::= sub COMMA LP union RP ids */
{ 268, -2 }, /* (186) tablelist ::= ids cpxName */
{ 268, -3 }, /* (187) tablelist ::= ids cpxName ids */
{ 268, -4 }, /* (188) tablelist ::= tablelist COMMA ids cpxName */
{ 268, -5 }, /* (189) tablelist ::= tablelist COMMA ids cpxName ids */
{ 270, -1 }, /* (190) tmvar ::= VARIABLE */
{ 253, -4 }, /* (191) interval_option ::= intervalKey LP tmvar RP */
{ 253, -6 }, /* (192) interval_option ::= intervalKey LP tmvar COMMA tmvar RP */
{ 253, 0 }, /* (193) interval_option ::= */
{ 271, -1 }, /* (194) intervalKey ::= INTERVAL */
{ 271, -1 }, /* (195) intervalKey ::= EVERY */
{ 255, 0 }, /* (196) session_option ::= */
{ 255, -7 }, /* (197) session_option ::= SESSION LP ids cpxName COMMA tmvar RP */
{ 256, 0 }, /* (198) windowstate_option ::= */
{ 256, -4 }, /* (199) windowstate_option ::= STATE_WINDOW LP ids RP */
{ 257, 0 }, /* (200) fill_opt ::= */
{ 257, -6 }, /* (201) fill_opt ::= FILL LP ID COMMA tagitemlist RP */
{ 257, -4 }, /* (202) fill_opt ::= FILL LP ID RP */
{ 254, -4 }, /* (203) sliding_opt ::= SLIDING LP tmvar RP */
{ 254, 0 }, /* (204) sliding_opt ::= */
{ 260, 0 }, /* (205) orderby_opt ::= */
{ 260, -3 }, /* (206) orderby_opt ::= ORDER BY sortlist */
{ 272, -4 }, /* (207) sortlist ::= sortlist COMMA item sortorder */
{ 272, -2 }, /* (208) sortlist ::= item sortorder */
{ 274, -2 }, /* (209) item ::= ids cpxName */
{ 275, -1 }, /* (210) sortorder ::= ASC */
{ 275, -1 }, /* (211) sortorder ::= DESC */
{ 275, 0 }, /* (212) sortorder ::= */
{ 258, 0 }, /* (213) groupby_opt ::= */
{ 258, -3 }, /* (214) groupby_opt ::= GROUP BY grouplist */
{ 276, -3 }, /* (215) grouplist ::= grouplist COMMA item */
{ 276, -1 }, /* (216) grouplist ::= item */
{ 259, 0 }, /* (217) having_opt ::= */
{ 259, -2 }, /* (218) having_opt ::= HAVING expr */
{ 262, 0 }, /* (219) limit_opt ::= */
{ 262, -2 }, /* (220) limit_opt ::= LIMIT signed */
{ 262, -4 }, /* (221) limit_opt ::= LIMIT signed OFFSET signed */
{ 262, -4 }, /* (222) limit_opt ::= LIMIT signed COMMA signed */
{ 261, 0 }, /* (223) slimit_opt ::= */
{ 261, -2 }, /* (224) slimit_opt ::= SLIMIT signed */
{ 261, -4 }, /* (225) slimit_opt ::= SLIMIT signed SOFFSET signed */
{ 261, -4 }, /* (226) slimit_opt ::= SLIMIT signed COMMA signed */
{ 252, 0 }, /* (227) where_opt ::= */
{ 252, -2 }, /* (228) where_opt ::= WHERE expr */
{ 266, -3 }, /* (229) expr ::= LP expr RP */
{ 266, -1 }, /* (230) expr ::= ID */
{ 266, -3 }, /* (231) expr ::= ID DOT ID */
{ 266, -3 }, /* (232) expr ::= ID DOT STAR */
{ 266, -1 }, /* (233) expr ::= INTEGER */
{ 266, -2 }, /* (234) expr ::= MINUS INTEGER */
{ 266, -2 }, /* (235) expr ::= PLUS INTEGER */
{ 266, -1 }, /* (236) expr ::= FLOAT */
{ 266, -2 }, /* (237) expr ::= MINUS FLOAT */
{ 266, -2 }, /* (238) expr ::= PLUS FLOAT */
{ 266, -1 }, /* (239) expr ::= STRING */
{ 266, -1 }, /* (240) expr ::= NOW */
{ 266, -1 }, /* (241) expr ::= VARIABLE */
{ 266, -2 }, /* (242) expr ::= PLUS VARIABLE */
{ 266, -2 }, /* (243) expr ::= MINUS VARIABLE */
{ 266, -1 }, /* (244) expr ::= BOOL */
{ 266, -1 }, /* (245) expr ::= NULL */
{ 266, -4 }, /* (246) expr ::= ID LP exprlist RP */
{ 266, -4 }, /* (247) expr ::= ID LP STAR RP */
{ 266, -3 }, /* (248) expr ::= expr IS NULL */
{ 266, -4 }, /* (249) expr ::= expr IS NOT NULL */
{ 266, -3 }, /* (250) expr ::= expr LT expr */
{ 266, -3 }, /* (251) expr ::= expr GT expr */
{ 266, -3 }, /* (252) expr ::= expr LE expr */
{ 266, -3 }, /* (253) expr ::= expr GE expr */
{ 266, -3 }, /* (254) expr ::= expr NE expr */
{ 266, -3 }, /* (255) expr ::= expr EQ expr */
{ 266, -5 }, /* (256) expr ::= expr BETWEEN expr AND expr */
{ 266, -3 }, /* (257) expr ::= expr AND expr */
{ 266, -3 }, /* (258) expr ::= expr OR expr */
{ 266, -3 }, /* (259) expr ::= expr PLUS expr */
{ 266, -3 }, /* (260) expr ::= expr MINUS expr */
{ 266, -3 }, /* (261) expr ::= expr STAR expr */
{ 266, -3 }, /* (262) expr ::= expr SLASH expr */
{ 266, -3 }, /* (263) expr ::= expr REM expr */
{ 266, -3 }, /* (264) expr ::= expr LIKE expr */
{ 266, -5 }, /* (265) expr ::= expr IN LP exprlist RP */
{ 206, -3 }, /* (266) exprlist ::= exprlist COMMA expritem */
{ 206, -1 }, /* (267) exprlist ::= expritem */
{ 277, -1 }, /* (268) expritem ::= expr */
{ 277, 0 }, /* (269) expritem ::= */
{ 198, -3 }, /* (270) cmd ::= RESET QUERY CACHE */
{ 198, -3 }, /* (271) cmd ::= SYNCDB ids REPLICA */
{ 198, -7 }, /* (272) cmd ::= ALTER TABLE ids cpxName ADD COLUMN columnlist */
{ 198, -7 }, /* (273) cmd ::= ALTER TABLE ids cpxName DROP COLUMN ids */
{ 198, -7 }, /* (274) cmd ::= ALTER TABLE ids cpxName MODIFY COLUMN columnlist */
{ 198, -7 }, /* (275) cmd ::= ALTER TABLE ids cpxName ADD TAG columnlist */
{ 198, -7 }, /* (276) cmd ::= ALTER TABLE ids cpxName DROP TAG ids */
{ 198, -8 }, /* (277) cmd ::= ALTER TABLE ids cpxName CHANGE TAG ids ids */
{ 198, -9 }, /* (278) cmd ::= ALTER TABLE ids cpxName SET TAG ids EQ tagitem */
{ 198, -7 }, /* (279) cmd ::= ALTER TABLE ids cpxName MODIFY TAG columnlist */
{ 198, -7 }, /* (280) cmd ::= ALTER STABLE ids cpxName ADD COLUMN columnlist */
{ 198, -7 }, /* (281) cmd ::= ALTER STABLE ids cpxName DROP COLUMN ids */
{ 198, -7 }, /* (282) cmd ::= ALTER STABLE ids cpxName MODIFY COLUMN columnlist */
{ 198, -7 }, /* (283) cmd ::= ALTER STABLE ids cpxName ADD TAG columnlist */
{ 198, -7 }, /* (284) cmd ::= ALTER STABLE ids cpxName DROP TAG ids */
{ 198, -8 }, /* (285) cmd ::= ALTER STABLE ids cpxName CHANGE TAG ids ids */
{ 198, -9 }, /* (286) cmd ::= ALTER STABLE ids cpxName SET TAG ids EQ tagitem */
{ 198, -7 }, /* (287) cmd ::= ALTER STABLE ids cpxName MODIFY TAG columnlist */
{ 198, -3 }, /* (288) cmd ::= KILL CONNECTION INTEGER */
{ 198, -5 }, /* (289) cmd ::= KILL STREAM INTEGER COLON INTEGER */
{ 198, -5 }, /* (290) cmd ::= KILL QUERY INTEGER COLON INTEGER */
/* For rule J, yyRuleInfoLhs[J] contains the symbol on the left-hand side
** of that rule */
static const YYCODETYPE yyRuleInfoLhs[] = {
197, /* (0) program ::= cmd */
198, /* (1) cmd ::= SHOW DATABASES */
198, /* (2) cmd ::= SHOW TOPICS */
198, /* (3) cmd ::= SHOW FUNCTIONS */
198, /* (4) cmd ::= SHOW MNODES */
198, /* (5) cmd ::= SHOW DNODES */
198, /* (6) cmd ::= SHOW ACCOUNTS */
198, /* (7) cmd ::= SHOW USERS */
198, /* (8) cmd ::= SHOW MODULES */
198, /* (9) cmd ::= SHOW QUERIES */
198, /* (10) cmd ::= SHOW CONNECTIONS */
198, /* (11) cmd ::= SHOW STREAMS */
198, /* (12) cmd ::= SHOW VARIABLES */
198, /* (13) cmd ::= SHOW SCORES */
198, /* (14) cmd ::= SHOW GRANTS */
198, /* (15) cmd ::= SHOW VNODES */
198, /* (16) cmd ::= SHOW VNODES IPTOKEN */
199, /* (17) dbPrefix ::= */
199, /* (18) dbPrefix ::= ids DOT */
201, /* (19) cpxName ::= */
201, /* (20) cpxName ::= DOT ids */
198, /* (21) cmd ::= SHOW CREATE TABLE ids cpxName */
198, /* (22) cmd ::= SHOW CREATE STABLE ids cpxName */
198, /* (23) cmd ::= SHOW CREATE DATABASE ids */
198, /* (24) cmd ::= SHOW dbPrefix TABLES */
198, /* (25) cmd ::= SHOW dbPrefix TABLES LIKE ids */
198, /* (26) cmd ::= SHOW dbPrefix STABLES */
198, /* (27) cmd ::= SHOW dbPrefix STABLES LIKE ids */
198, /* (28) cmd ::= SHOW dbPrefix VGROUPS */
198, /* (29) cmd ::= DROP TABLE ifexists ids cpxName */
198, /* (30) cmd ::= DROP STABLE ifexists ids cpxName */
198, /* (31) cmd ::= DROP DATABASE ifexists ids */
198, /* (32) cmd ::= DROP TOPIC ifexists ids */
198, /* (33) cmd ::= DROP FUNCTION ids */
198, /* (34) cmd ::= DROP DNODE ids */
198, /* (35) cmd ::= DROP USER ids */
198, /* (36) cmd ::= DROP ACCOUNT ids */
198, /* (37) cmd ::= USE ids */
198, /* (38) cmd ::= DESCRIBE ids cpxName */
198, /* (39) cmd ::= DESC ids cpxName */
198, /* (40) cmd ::= ALTER USER ids PASS ids */
198, /* (41) cmd ::= ALTER USER ids PRIVILEGE ids */
198, /* (42) cmd ::= ALTER DNODE ids ids */
198, /* (43) cmd ::= ALTER DNODE ids ids ids */
198, /* (44) cmd ::= ALTER LOCAL ids */
198, /* (45) cmd ::= ALTER LOCAL ids ids */
198, /* (46) cmd ::= ALTER DATABASE ids alter_db_optr */
198, /* (47) cmd ::= ALTER TOPIC ids alter_topic_optr */
198, /* (48) cmd ::= ALTER ACCOUNT ids acct_optr */
198, /* (49) cmd ::= ALTER ACCOUNT ids PASS ids acct_optr */
198, /* (50) cmd ::= COMPACT VNODES IN LP exprlist RP */
200, /* (51) ids ::= ID */
200, /* (52) ids ::= STRING */
202, /* (53) ifexists ::= IF EXISTS */
202, /* (54) ifexists ::= */
207, /* (55) ifnotexists ::= IF NOT EXISTS */
207, /* (56) ifnotexists ::= */
198, /* (57) cmd ::= CREATE DNODE ids */
198, /* (58) cmd ::= CREATE ACCOUNT ids PASS ids acct_optr */
198, /* (59) cmd ::= CREATE DATABASE ifnotexists ids db_optr */
198, /* (60) cmd ::= CREATE TOPIC ifnotexists ids topic_optr */
198, /* (61) cmd ::= CREATE FUNCTION ids AS ids OUTPUTTYPE typename bufsize */
198, /* (62) cmd ::= CREATE AGGREGATE FUNCTION ids AS ids OUTPUTTYPE typename bufsize */
198, /* (63) cmd ::= CREATE USER ids PASS ids */
211, /* (64) bufsize ::= */
211, /* (65) bufsize ::= BUFSIZE INTEGER */
212, /* (66) pps ::= */
212, /* (67) pps ::= PPS INTEGER */
213, /* (68) tseries ::= */
213, /* (69) tseries ::= TSERIES INTEGER */
214, /* (70) dbs ::= */
214, /* (71) dbs ::= DBS INTEGER */
215, /* (72) streams ::= */
215, /* (73) streams ::= STREAMS INTEGER */
216, /* (74) storage ::= */
216, /* (75) storage ::= STORAGE INTEGER */
217, /* (76) qtime ::= */
217, /* (77) qtime ::= QTIME INTEGER */
218, /* (78) users ::= */
218, /* (79) users ::= USERS INTEGER */
219, /* (80) conns ::= */
219, /* (81) conns ::= CONNS INTEGER */
220, /* (82) state ::= */
220, /* (83) state ::= STATE ids */
205, /* (84) acct_optr ::= pps tseries storage streams qtime dbs users conns state */
221, /* (85) intitemlist ::= intitemlist COMMA intitem */
221, /* (86) intitemlist ::= intitem */
222, /* (87) intitem ::= INTEGER */
223, /* (88) keep ::= KEEP intitemlist */
224, /* (89) cache ::= CACHE INTEGER */
225, /* (90) replica ::= REPLICA INTEGER */
226, /* (91) quorum ::= QUORUM INTEGER */
227, /* (92) days ::= DAYS INTEGER */
228, /* (93) minrows ::= MINROWS INTEGER */
229, /* (94) maxrows ::= MAXROWS INTEGER */
230, /* (95) blocks ::= BLOCKS INTEGER */
231, /* (96) ctime ::= CTIME INTEGER */
232, /* (97) wal ::= WAL INTEGER */
233, /* (98) fsync ::= FSYNC INTEGER */
234, /* (99) comp ::= COMP INTEGER */
235, /* (100) prec ::= PRECISION STRING */
236, /* (101) update ::= UPDATE INTEGER */
237, /* (102) cachelast ::= CACHELAST INTEGER */
238, /* (103) partitions ::= PARTITIONS INTEGER */
208, /* (104) db_optr ::= */
208, /* (105) db_optr ::= db_optr cache */
208, /* (106) db_optr ::= db_optr replica */
208, /* (107) db_optr ::= db_optr quorum */
208, /* (108) db_optr ::= db_optr days */
208, /* (109) db_optr ::= db_optr minrows */
208, /* (110) db_optr ::= db_optr maxrows */
208, /* (111) db_optr ::= db_optr blocks */
208, /* (112) db_optr ::= db_optr ctime */
208, /* (113) db_optr ::= db_optr wal */
208, /* (114) db_optr ::= db_optr fsync */
208, /* (115) db_optr ::= db_optr comp */
208, /* (116) db_optr ::= db_optr prec */
208, /* (117) db_optr ::= db_optr keep */
208, /* (118) db_optr ::= db_optr update */
208, /* (119) db_optr ::= db_optr cachelast */
209, /* (120) topic_optr ::= db_optr */
209, /* (121) topic_optr ::= topic_optr partitions */
203, /* (122) alter_db_optr ::= */
203, /* (123) alter_db_optr ::= alter_db_optr replica */
203, /* (124) alter_db_optr ::= alter_db_optr quorum */
203, /* (125) alter_db_optr ::= alter_db_optr keep */
203, /* (126) alter_db_optr ::= alter_db_optr blocks */
203, /* (127) alter_db_optr ::= alter_db_optr comp */
203, /* (128) alter_db_optr ::= alter_db_optr update */
203, /* (129) alter_db_optr ::= alter_db_optr cachelast */
204, /* (130) alter_topic_optr ::= alter_db_optr */
204, /* (131) alter_topic_optr ::= alter_topic_optr partitions */
210, /* (132) typename ::= ids */
210, /* (133) typename ::= ids LP signed RP */
210, /* (134) typename ::= ids UNSIGNED */
239, /* (135) signed ::= INTEGER */
239, /* (136) signed ::= PLUS INTEGER */
239, /* (137) signed ::= MINUS INTEGER */
198, /* (138) cmd ::= CREATE TABLE create_table_args */
198, /* (139) cmd ::= CREATE TABLE create_stable_args */
198, /* (140) cmd ::= CREATE STABLE create_stable_args */
198, /* (141) cmd ::= CREATE TABLE create_table_list */
242, /* (142) create_table_list ::= create_from_stable */
242, /* (143) create_table_list ::= create_table_list create_from_stable */
240, /* (144) create_table_args ::= ifnotexists ids cpxName LP columnlist RP */
241, /* (145) create_stable_args ::= ifnotexists ids cpxName LP columnlist RP TAGS LP columnlist RP */
243, /* (146) create_from_stable ::= ifnotexists ids cpxName USING ids cpxName TAGS LP tagitemlist RP */
243, /* (147) create_from_stable ::= ifnotexists ids cpxName USING ids cpxName LP tagNamelist RP TAGS LP tagitemlist RP */
246, /* (148) tagNamelist ::= tagNamelist COMMA ids */
246, /* (149) tagNamelist ::= ids */
240, /* (150) create_table_args ::= ifnotexists ids cpxName AS select */
244, /* (151) columnlist ::= columnlist COMMA column */
244, /* (152) columnlist ::= column */
248, /* (153) column ::= ids typename */
245, /* (154) tagitemlist ::= tagitemlist COMMA tagitem */
245, /* (155) tagitemlist ::= tagitem */
249, /* (156) tagitem ::= INTEGER */
249, /* (157) tagitem ::= FLOAT */
249, /* (158) tagitem ::= STRING */
249, /* (159) tagitem ::= BOOL */
249, /* (160) tagitem ::= NULL */
249, /* (161) tagitem ::= NOW */
249, /* (162) tagitem ::= MINUS INTEGER */
249, /* (163) tagitem ::= MINUS FLOAT */
249, /* (164) tagitem ::= PLUS INTEGER */
249, /* (165) tagitem ::= PLUS FLOAT */
247, /* (166) 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, /* (167) select ::= LP select RP */
263, /* (168) union ::= select */
263, /* (169) union ::= union UNION ALL select */
198, /* (170) cmd ::= union */
247, /* (171) select ::= SELECT selcollist */
264, /* (172) sclp ::= selcollist COMMA */
264, /* (173) sclp ::= */
250, /* (174) selcollist ::= sclp distinct expr as */
250, /* (175) selcollist ::= sclp STAR */
267, /* (176) as ::= AS ids */
267, /* (177) as ::= ids */
267, /* (178) as ::= */
265, /* (179) distinct ::= DISTINCT */
265, /* (180) distinct ::= */
251, /* (181) from ::= FROM tablelist */
251, /* (182) from ::= FROM sub */
269, /* (183) sub ::= LP union RP */
269, /* (184) sub ::= LP union RP ids */
269, /* (185) sub ::= sub COMMA LP union RP ids */
268, /* (186) tablelist ::= ids cpxName */
268, /* (187) tablelist ::= ids cpxName ids */
268, /* (188) tablelist ::= tablelist COMMA ids cpxName */
268, /* (189) tablelist ::= tablelist COMMA ids cpxName ids */
270, /* (190) tmvar ::= VARIABLE */
253, /* (191) interval_option ::= intervalKey LP tmvar RP */
253, /* (192) interval_option ::= intervalKey LP tmvar COMMA tmvar RP */
253, /* (193) interval_option ::= */
271, /* (194) intervalKey ::= INTERVAL */
271, /* (195) intervalKey ::= EVERY */
255, /* (196) session_option ::= */
255, /* (197) session_option ::= SESSION LP ids cpxName COMMA tmvar RP */
256, /* (198) windowstate_option ::= */
256, /* (199) windowstate_option ::= STATE_WINDOW LP ids RP */
257, /* (200) fill_opt ::= */
257, /* (201) fill_opt ::= FILL LP ID COMMA tagitemlist RP */
257, /* (202) fill_opt ::= FILL LP ID RP */
254, /* (203) sliding_opt ::= SLIDING LP tmvar RP */
254, /* (204) sliding_opt ::= */
260, /* (205) orderby_opt ::= */
260, /* (206) orderby_opt ::= ORDER BY sortlist */
272, /* (207) sortlist ::= sortlist COMMA item sortorder */
272, /* (208) sortlist ::= item sortorder */
274, /* (209) item ::= ids cpxName */
275, /* (210) sortorder ::= ASC */
275, /* (211) sortorder ::= DESC */
275, /* (212) sortorder ::= */
258, /* (213) groupby_opt ::= */
258, /* (214) groupby_opt ::= GROUP BY grouplist */
276, /* (215) grouplist ::= grouplist COMMA item */
276, /* (216) grouplist ::= item */
259, /* (217) having_opt ::= */
259, /* (218) having_opt ::= HAVING expr */
262, /* (219) limit_opt ::= */
262, /* (220) limit_opt ::= LIMIT signed */
262, /* (221) limit_opt ::= LIMIT signed OFFSET signed */
262, /* (222) limit_opt ::= LIMIT signed COMMA signed */
261, /* (223) slimit_opt ::= */
261, /* (224) slimit_opt ::= SLIMIT signed */
261, /* (225) slimit_opt ::= SLIMIT signed SOFFSET signed */
261, /* (226) slimit_opt ::= SLIMIT signed COMMA signed */
252, /* (227) where_opt ::= */
252, /* (228) where_opt ::= WHERE expr */
266, /* (229) expr ::= LP expr RP */
266, /* (230) expr ::= ID */
266, /* (231) expr ::= ID DOT ID */
266, /* (232) expr ::= ID DOT STAR */
266, /* (233) expr ::= INTEGER */
266, /* (234) expr ::= MINUS INTEGER */
266, /* (235) expr ::= PLUS INTEGER */
266, /* (236) expr ::= FLOAT */
266, /* (237) expr ::= MINUS FLOAT */
266, /* (238) expr ::= PLUS FLOAT */
266, /* (239) expr ::= STRING */
266, /* (240) expr ::= NOW */
266, /* (241) expr ::= VARIABLE */
266, /* (242) expr ::= PLUS VARIABLE */
266, /* (243) expr ::= MINUS VARIABLE */
266, /* (244) expr ::= BOOL */
266, /* (245) expr ::= NULL */
266, /* (246) expr ::= ID LP exprlist RP */
266, /* (247) expr ::= ID LP STAR RP */
266, /* (248) expr ::= expr IS NULL */
266, /* (249) expr ::= expr IS NOT NULL */
266, /* (250) expr ::= expr LT expr */
266, /* (251) expr ::= expr GT expr */
266, /* (252) expr ::= expr LE expr */
266, /* (253) expr ::= expr GE expr */
266, /* (254) expr ::= expr NE expr */
266, /* (255) expr ::= expr EQ expr */
266, /* (256) expr ::= expr BETWEEN expr AND expr */
266, /* (257) expr ::= expr AND expr */
266, /* (258) expr ::= expr OR expr */
266, /* (259) expr ::= expr PLUS expr */
266, /* (260) expr ::= expr MINUS expr */
266, /* (261) expr ::= expr STAR expr */
266, /* (262) expr ::= expr SLASH expr */
266, /* (263) expr ::= expr REM expr */
266, /* (264) expr ::= expr LIKE expr */
266, /* (265) expr ::= expr IN LP exprlist RP */
206, /* (266) exprlist ::= exprlist COMMA expritem */
206, /* (267) exprlist ::= expritem */
277, /* (268) expritem ::= expr */
277, /* (269) expritem ::= */
198, /* (270) cmd ::= RESET QUERY CACHE */
198, /* (271) cmd ::= SYNCDB ids REPLICA */
198, /* (272) cmd ::= ALTER TABLE ids cpxName ADD COLUMN columnlist */
198, /* (273) cmd ::= ALTER TABLE ids cpxName DROP COLUMN ids */
198, /* (274) cmd ::= ALTER TABLE ids cpxName MODIFY COLUMN columnlist */
198, /* (275) cmd ::= ALTER TABLE ids cpxName ADD TAG columnlist */
198, /* (276) cmd ::= ALTER TABLE ids cpxName DROP TAG ids */
198, /* (277) cmd ::= ALTER TABLE ids cpxName CHANGE TAG ids ids */
198, /* (278) cmd ::= ALTER TABLE ids cpxName SET TAG ids EQ tagitem */
198, /* (279) cmd ::= ALTER TABLE ids cpxName MODIFY TAG columnlist */
198, /* (280) cmd ::= ALTER STABLE ids cpxName ADD COLUMN columnlist */
198, /* (281) cmd ::= ALTER STABLE ids cpxName DROP COLUMN ids */
198, /* (282) cmd ::= ALTER STABLE ids cpxName MODIFY COLUMN columnlist */
198, /* (283) cmd ::= ALTER STABLE ids cpxName ADD TAG columnlist */
198, /* (284) cmd ::= ALTER STABLE ids cpxName DROP TAG ids */
198, /* (285) cmd ::= ALTER STABLE ids cpxName CHANGE TAG ids ids */
198, /* (286) cmd ::= ALTER STABLE ids cpxName SET TAG ids EQ tagitem */
198, /* (287) cmd ::= ALTER STABLE ids cpxName MODIFY TAG columnlist */
198, /* (288) cmd ::= KILL CONNECTION INTEGER */
198, /* (289) cmd ::= KILL STREAM INTEGER COLON INTEGER */
198, /* (290) 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 IPTOKEN */
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 */
-5, /* (29) cmd ::= DROP TABLE ifexists ids cpxName */
-5, /* (30) cmd ::= DROP STABLE ifexists ids cpxName */
-4, /* (31) cmd ::= DROP DATABASE ifexists ids */
-4, /* (32) cmd ::= DROP TOPIC ifexists ids */
-3, /* (33) cmd ::= DROP FUNCTION ids */
-3, /* (34) cmd ::= DROP DNODE ids */
-3, /* (35) cmd ::= DROP USER ids */
-3, /* (36) cmd ::= DROP ACCOUNT ids */
-2, /* (37) cmd ::= USE ids */
-3, /* (38) cmd ::= DESCRIBE ids cpxName */
-3, /* (39) cmd ::= DESC ids cpxName */
-5, /* (40) cmd ::= ALTER USER ids PASS ids */
-5, /* (41) cmd ::= ALTER USER ids PRIVILEGE ids */
-4, /* (42) cmd ::= ALTER DNODE ids ids */
-5, /* (43) cmd ::= ALTER DNODE ids ids ids */
-3, /* (44) cmd ::= ALTER LOCAL ids */
-4, /* (45) cmd ::= ALTER LOCAL ids ids */
-4, /* (46) cmd ::= ALTER DATABASE ids alter_db_optr */
-4, /* (47) cmd ::= ALTER TOPIC ids alter_topic_optr */
-4, /* (48) cmd ::= ALTER ACCOUNT ids acct_optr */
-6, /* (49) cmd ::= ALTER ACCOUNT ids PASS ids acct_optr */
-6, /* (50) cmd ::= COMPACT VNODES IN LP exprlist RP */
-1, /* (51) ids ::= ID */
-1, /* (52) ids ::= STRING */
-2, /* (53) ifexists ::= IF EXISTS */
0, /* (54) ifexists ::= */
-3, /* (55) ifnotexists ::= IF NOT EXISTS */
0, /* (56) ifnotexists ::= */
-3, /* (57) cmd ::= CREATE DNODE ids */
-6, /* (58) cmd ::= CREATE ACCOUNT ids PASS ids acct_optr */
-5, /* (59) cmd ::= CREATE DATABASE ifnotexists ids db_optr */
-5, /* (60) cmd ::= CREATE TOPIC ifnotexists ids topic_optr */
-8, /* (61) cmd ::= CREATE FUNCTION ids AS ids OUTPUTTYPE typename bufsize */
-9, /* (62) cmd ::= CREATE AGGREGATE FUNCTION ids AS ids OUTPUTTYPE typename bufsize */
-5, /* (63) cmd ::= CREATE USER ids PASS ids */
0, /* (64) bufsize ::= */
-2, /* (65) bufsize ::= BUFSIZE INTEGER */
0, /* (66) pps ::= */
-2, /* (67) pps ::= PPS INTEGER */
0, /* (68) tseries ::= */
-2, /* (69) tseries ::= TSERIES INTEGER */
0, /* (70) dbs ::= */
-2, /* (71) dbs ::= DBS INTEGER */
0, /* (72) streams ::= */
-2, /* (73) streams ::= STREAMS INTEGER */
0, /* (74) storage ::= */
-2, /* (75) storage ::= STORAGE INTEGER */
0, /* (76) qtime ::= */
-2, /* (77) qtime ::= QTIME INTEGER */
0, /* (78) users ::= */
-2, /* (79) users ::= USERS INTEGER */
0, /* (80) conns ::= */
-2, /* (81) conns ::= CONNS INTEGER */
0, /* (82) state ::= */
-2, /* (83) state ::= STATE ids */
-9, /* (84) acct_optr ::= pps tseries storage streams qtime dbs users conns state */
-3, /* (85) intitemlist ::= intitemlist COMMA intitem */
-1, /* (86) intitemlist ::= intitem */
-1, /* (87) intitem ::= INTEGER */
-2, /* (88) keep ::= KEEP intitemlist */
-2, /* (89) cache ::= CACHE INTEGER */
-2, /* (90) replica ::= REPLICA INTEGER */
-2, /* (91) quorum ::= QUORUM INTEGER */
-2, /* (92) days ::= DAYS INTEGER */
-2, /* (93) minrows ::= MINROWS INTEGER */
-2, /* (94) maxrows ::= MAXROWS INTEGER */
-2, /* (95) blocks ::= BLOCKS INTEGER */
-2, /* (96) ctime ::= CTIME INTEGER */
-2, /* (97) wal ::= WAL INTEGER */
-2, /* (98) fsync ::= FSYNC INTEGER */
-2, /* (99) comp ::= COMP INTEGER */
-2, /* (100) prec ::= PRECISION STRING */
-2, /* (101) update ::= UPDATE INTEGER */
-2, /* (102) cachelast ::= CACHELAST INTEGER */
-2, /* (103) partitions ::= PARTITIONS INTEGER */
0, /* (104) db_optr ::= */
-2, /* (105) db_optr ::= db_optr cache */
-2, /* (106) db_optr ::= db_optr replica */
-2, /* (107) db_optr ::= db_optr quorum */
-2, /* (108) db_optr ::= db_optr days */
-2, /* (109) db_optr ::= db_optr minrows */
-2, /* (110) db_optr ::= db_optr maxrows */
-2, /* (111) db_optr ::= db_optr blocks */
-2, /* (112) db_optr ::= db_optr ctime */
-2, /* (113) db_optr ::= db_optr wal */
-2, /* (114) db_optr ::= db_optr fsync */
-2, /* (115) db_optr ::= db_optr comp */
-2, /* (116) db_optr ::= db_optr prec */
-2, /* (117) db_optr ::= db_optr keep */
-2, /* (118) db_optr ::= db_optr update */
-2, /* (119) db_optr ::= db_optr cachelast */
-1, /* (120) topic_optr ::= db_optr */
-2, /* (121) topic_optr ::= topic_optr partitions */
0, /* (122) alter_db_optr ::= */
-2, /* (123) alter_db_optr ::= alter_db_optr replica */
-2, /* (124) alter_db_optr ::= alter_db_optr quorum */
-2, /* (125) alter_db_optr ::= alter_db_optr keep */
-2, /* (126) alter_db_optr ::= alter_db_optr blocks */
-2, /* (127) alter_db_optr ::= alter_db_optr comp */
-2, /* (128) alter_db_optr ::= alter_db_optr update */
-2, /* (129) alter_db_optr ::= alter_db_optr cachelast */
-1, /* (130) alter_topic_optr ::= alter_db_optr */
-2, /* (131) alter_topic_optr ::= alter_topic_optr partitions */
-1, /* (132) typename ::= ids */
-4, /* (133) typename ::= ids LP signed RP */
-2, /* (134) typename ::= ids UNSIGNED */
-1, /* (135) signed ::= INTEGER */
-2, /* (136) signed ::= PLUS INTEGER */
-2, /* (137) signed ::= MINUS INTEGER */
-3, /* (138) cmd ::= CREATE TABLE create_table_args */
-3, /* (139) cmd ::= CREATE TABLE create_stable_args */
-3, /* (140) cmd ::= CREATE STABLE create_stable_args */
-3, /* (141) cmd ::= CREATE TABLE create_table_list */
-1, /* (142) create_table_list ::= create_from_stable */
-2, /* (143) create_table_list ::= create_table_list create_from_stable */
-6, /* (144) create_table_args ::= ifnotexists ids cpxName LP columnlist RP */
-10, /* (145) create_stable_args ::= ifnotexists ids cpxName LP columnlist RP TAGS LP columnlist RP */
-10, /* (146) create_from_stable ::= ifnotexists ids cpxName USING ids cpxName TAGS LP tagitemlist RP */
-13, /* (147) create_from_stable ::= ifnotexists ids cpxName USING ids cpxName LP tagNamelist RP TAGS LP tagitemlist RP */
-3, /* (148) tagNamelist ::= tagNamelist COMMA ids */
-1, /* (149) tagNamelist ::= ids */
-5, /* (150) create_table_args ::= ifnotexists ids cpxName AS select */
-3, /* (151) columnlist ::= columnlist COMMA column */
-1, /* (152) columnlist ::= column */
-2, /* (153) column ::= ids typename */
-3, /* (154) tagitemlist ::= tagitemlist COMMA tagitem */
-1, /* (155) tagitemlist ::= tagitem */
-1, /* (156) tagitem ::= INTEGER */
-1, /* (157) tagitem ::= FLOAT */
-1, /* (158) tagitem ::= STRING */
-1, /* (159) tagitem ::= BOOL */
-1, /* (160) tagitem ::= NULL */
-1, /* (161) tagitem ::= NOW */
-2, /* (162) tagitem ::= MINUS INTEGER */
-2, /* (163) tagitem ::= MINUS FLOAT */
-2, /* (164) tagitem ::= PLUS INTEGER */
-2, /* (165) tagitem ::= PLUS FLOAT */
-14, /* (166) 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 */
-3, /* (167) select ::= LP select RP */
-1, /* (168) union ::= select */
-4, /* (169) union ::= union UNION ALL select */
-1, /* (170) cmd ::= union */
-2, /* (171) select ::= SELECT selcollist */
-2, /* (172) sclp ::= selcollist COMMA */
0, /* (173) sclp ::= */
-4, /* (174) selcollist ::= sclp distinct expr as */
-2, /* (175) selcollist ::= sclp STAR */
-2, /* (176) as ::= AS ids */
-1, /* (177) as ::= ids */
0, /* (178) as ::= */
-1, /* (179) distinct ::= DISTINCT */
0, /* (180) distinct ::= */
-2, /* (181) from ::= FROM tablelist */
-2, /* (182) from ::= FROM sub */
-3, /* (183) sub ::= LP union RP */
-4, /* (184) sub ::= LP union RP ids */
-6, /* (185) sub ::= sub COMMA LP union RP ids */
-2, /* (186) tablelist ::= ids cpxName */
-3, /* (187) tablelist ::= ids cpxName ids */
-4, /* (188) tablelist ::= tablelist COMMA ids cpxName */
-5, /* (189) tablelist ::= tablelist COMMA ids cpxName ids */
-1, /* (190) tmvar ::= VARIABLE */
-4, /* (191) interval_option ::= intervalKey LP tmvar RP */
-6, /* (192) interval_option ::= intervalKey LP tmvar COMMA tmvar RP */
0, /* (193) interval_option ::= */
-1, /* (194) intervalKey ::= INTERVAL */
-1, /* (195) intervalKey ::= EVERY */
0, /* (196) session_option ::= */
-7, /* (197) session_option ::= SESSION LP ids cpxName COMMA tmvar RP */
0, /* (198) windowstate_option ::= */
-4, /* (199) windowstate_option ::= STATE_WINDOW LP ids RP */
0, /* (200) fill_opt ::= */
-6, /* (201) fill_opt ::= FILL LP ID COMMA tagitemlist RP */
-4, /* (202) fill_opt ::= FILL LP ID RP */
-4, /* (203) sliding_opt ::= SLIDING LP tmvar RP */
0, /* (204) sliding_opt ::= */
0, /* (205) orderby_opt ::= */
-3, /* (206) orderby_opt ::= ORDER BY sortlist */
-4, /* (207) sortlist ::= sortlist COMMA item sortorder */
-2, /* (208) sortlist ::= item sortorder */
-2, /* (209) item ::= ids cpxName */
-1, /* (210) sortorder ::= ASC */
-1, /* (211) sortorder ::= DESC */
0, /* (212) sortorder ::= */
0, /* (213) groupby_opt ::= */
-3, /* (214) groupby_opt ::= GROUP BY grouplist */
-3, /* (215) grouplist ::= grouplist COMMA item */
-1, /* (216) grouplist ::= item */
0, /* (217) having_opt ::= */
-2, /* (218) having_opt ::= HAVING expr */
0, /* (219) limit_opt ::= */
-2, /* (220) limit_opt ::= LIMIT signed */
-4, /* (221) limit_opt ::= LIMIT signed OFFSET signed */
-4, /* (222) limit_opt ::= LIMIT signed COMMA signed */
0, /* (223) slimit_opt ::= */
-2, /* (224) slimit_opt ::= SLIMIT signed */
-4, /* (225) slimit_opt ::= SLIMIT signed SOFFSET signed */
-4, /* (226) slimit_opt ::= SLIMIT signed COMMA signed */
0, /* (227) where_opt ::= */
-2, /* (228) where_opt ::= WHERE expr */
-3, /* (229) expr ::= LP expr RP */
-1, /* (230) expr ::= ID */
-3, /* (231) expr ::= ID DOT ID */
-3, /* (232) expr ::= ID DOT STAR */
-1, /* (233) expr ::= INTEGER */
-2, /* (234) expr ::= MINUS INTEGER */
-2, /* (235) expr ::= PLUS INTEGER */
-1, /* (236) expr ::= FLOAT */
-2, /* (237) expr ::= MINUS FLOAT */
-2, /* (238) expr ::= PLUS FLOAT */
-1, /* (239) expr ::= STRING */
-1, /* (240) expr ::= NOW */
-1, /* (241) expr ::= VARIABLE */
-2, /* (242) expr ::= PLUS VARIABLE */
-2, /* (243) expr ::= MINUS VARIABLE */
-1, /* (244) expr ::= BOOL */
-1, /* (245) expr ::= NULL */
-4, /* (246) expr ::= ID LP exprlist RP */
-4, /* (247) expr ::= ID LP STAR RP */
-3, /* (248) expr ::= expr IS NULL */
-4, /* (249) expr ::= expr IS NOT NULL */
-3, /* (250) expr ::= expr LT expr */
-3, /* (251) expr ::= expr GT expr */
-3, /* (252) expr ::= expr LE expr */
-3, /* (253) expr ::= expr GE expr */
-3, /* (254) expr ::= expr NE expr */
-3, /* (255) expr ::= expr EQ expr */
-5, /* (256) expr ::= expr BETWEEN expr AND expr */
-3, /* (257) expr ::= expr AND expr */
-3, /* (258) expr ::= expr OR expr */
-3, /* (259) expr ::= expr PLUS expr */
-3, /* (260) expr ::= expr MINUS expr */
-3, /* (261) expr ::= expr STAR expr */
-3, /* (262) expr ::= expr SLASH expr */
-3, /* (263) expr ::= expr REM expr */
-3, /* (264) expr ::= expr LIKE expr */
-5, /* (265) expr ::= expr IN LP exprlist RP */
-3, /* (266) exprlist ::= exprlist COMMA expritem */
-1, /* (267) exprlist ::= expritem */
-1, /* (268) expritem ::= expr */
0, /* (269) expritem ::= */
-3, /* (270) cmd ::= RESET QUERY CACHE */
-3, /* (271) cmd ::= SYNCDB ids REPLICA */
-7, /* (272) cmd ::= ALTER TABLE ids cpxName ADD COLUMN columnlist */
-7, /* (273) cmd ::= ALTER TABLE ids cpxName DROP COLUMN ids */
-7, /* (274) cmd ::= ALTER TABLE ids cpxName MODIFY COLUMN columnlist */
-7, /* (275) cmd ::= ALTER TABLE ids cpxName ADD TAG columnlist */
-7, /* (276) cmd ::= ALTER TABLE ids cpxName DROP TAG ids */
-8, /* (277) cmd ::= ALTER TABLE ids cpxName CHANGE TAG ids ids */
-9, /* (278) cmd ::= ALTER TABLE ids cpxName SET TAG ids EQ tagitem */
-7, /* (279) cmd ::= ALTER TABLE ids cpxName MODIFY TAG columnlist */
-7, /* (280) cmd ::= ALTER STABLE ids cpxName ADD COLUMN columnlist */
-7, /* (281) cmd ::= ALTER STABLE ids cpxName DROP COLUMN ids */
-7, /* (282) cmd ::= ALTER STABLE ids cpxName MODIFY COLUMN columnlist */
-7, /* (283) cmd ::= ALTER STABLE ids cpxName ADD TAG columnlist */
-7, /* (284) cmd ::= ALTER STABLE ids cpxName DROP TAG ids */
-8, /* (285) cmd ::= ALTER STABLE ids cpxName CHANGE TAG ids ids */
-9, /* (286) cmd ::= ALTER STABLE ids cpxName SET TAG ids EQ tagitem */
-7, /* (287) cmd ::= ALTER STABLE ids cpxName MODIFY TAG columnlist */
-3, /* (288) cmd ::= KILL CONNECTION INTEGER */
-5, /* (289) cmd ::= KILL STREAM INTEGER COLON INTEGER */
-5, /* (290) cmd ::= KILL QUERY INTEGER COLON INTEGER */
};
static void yy_accept(yyParser*); /* Forward Declaration */
......@@ -2172,51 +2657,6 @@ static YYACTIONTYPE yy_reduce(
(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);
/* The call to yyStackOverflow() above pops the stack until it is
** empty, causing the main parser loop to exit. So the return value
** is never used and does not matter. */
return 0;
}
#else
if( yypParser->yytos>=&yypParser->yystack[yypParser->yystksz-1] ){
if( yyGrowStack(yypParser) ){
yyStackOverflow(yypParser);
/* The call to yyStackOverflow() above pops the stack until it is
** empty, causing the main parser loop to exit. So the return value
** is never used and does not matter. */
return 0;
}
yymsp = yypParser->yytos;
}
#endif
}
switch( yyruleno ){
/* Beginning here are the reduction cases. A typical example
......@@ -2795,7 +3235,7 @@ static YYACTIONTYPE yy_reduce(
break;
case 175: /* selcollist ::= sclp STAR */
{
tSqlExpr *pNode = tSqlExprCreateIdValue(NULL, TK_ALL);
tSqlExpr *pNode = tSqlExprCreateIdValue(pInfo, NULL, TK_ALL);
yylhsminor.yy421 = tSqlExprListAppend(yymsp[-1].minor.yy421, pNode, 0, 0);
}
yymsp[-1].minor.yy421 = yylhsminor.yy421;
......@@ -3003,58 +3443,58 @@ static YYACTIONTYPE yy_reduce(
yymsp[-2].minor.yy439 = yylhsminor.yy439;
break;
case 230: /* expr ::= ID */
{ yylhsminor.yy439 = tSqlExprCreateIdValue(&yymsp[0].minor.yy0, TK_ID);}
{ yylhsminor.yy439 = tSqlExprCreateIdValue(pInfo, &yymsp[0].minor.yy0, TK_ID);}
yymsp[0].minor.yy439 = yylhsminor.yy439;
break;
case 231: /* 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.yy0.n += (1+yymsp[0].minor.yy0.n); yylhsminor.yy439 = tSqlExprCreateIdValue(pInfo, &yymsp[-2].minor.yy0, TK_ID);}
yymsp[-2].minor.yy439 = yylhsminor.yy439;
break;
case 232: /* 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.yy0.n += (1+yymsp[0].minor.yy0.n); yylhsminor.yy439 = tSqlExprCreateIdValue(pInfo, &yymsp[-2].minor.yy0, TK_ALL);}
yymsp[-2].minor.yy439 = yylhsminor.yy439;
break;
case 233: /* expr ::= INTEGER */
{ yylhsminor.yy439 = tSqlExprCreateIdValue(&yymsp[0].minor.yy0, TK_INTEGER);}
{ yylhsminor.yy439 = tSqlExprCreateIdValue(pInfo, &yymsp[0].minor.yy0, TK_INTEGER);}
yymsp[0].minor.yy439 = yylhsminor.yy439;
break;
case 234: /* expr ::= MINUS INTEGER */
case 235: /* expr ::= PLUS INTEGER */ yytestcase(yyruleno==235);
{ 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.yy0.n += yymsp[0].minor.yy0.n; yymsp[-1].minor.yy0.type = TK_INTEGER; yylhsminor.yy439 = tSqlExprCreateIdValue(pInfo, &yymsp[-1].minor.yy0, TK_INTEGER);}
yymsp[-1].minor.yy439 = yylhsminor.yy439;
break;
case 236: /* expr ::= FLOAT */
{ yylhsminor.yy439 = tSqlExprCreateIdValue(&yymsp[0].minor.yy0, TK_FLOAT);}
{ yylhsminor.yy439 = tSqlExprCreateIdValue(pInfo, &yymsp[0].minor.yy0, TK_FLOAT);}
yymsp[0].minor.yy439 = yylhsminor.yy439;
break;
case 237: /* expr ::= MINUS FLOAT */
case 238: /* expr ::= PLUS FLOAT */ yytestcase(yyruleno==238);
{ 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.yy0.n += yymsp[0].minor.yy0.n; yymsp[-1].minor.yy0.type = TK_FLOAT; yylhsminor.yy439 = tSqlExprCreateIdValue(pInfo, &yymsp[-1].minor.yy0, TK_FLOAT);}
yymsp[-1].minor.yy439 = yylhsminor.yy439;
break;
case 239: /* expr ::= STRING */
{ yylhsminor.yy439 = tSqlExprCreateIdValue(&yymsp[0].minor.yy0, TK_STRING);}
{ yylhsminor.yy439 = tSqlExprCreateIdValue(pInfo, &yymsp[0].minor.yy0, TK_STRING);}
yymsp[0].minor.yy439 = yylhsminor.yy439;
break;
case 240: /* expr ::= NOW */
{ yylhsminor.yy439 = tSqlExprCreateIdValue(&yymsp[0].minor.yy0, TK_NOW); }
{ yylhsminor.yy439 = tSqlExprCreateIdValue(pInfo, &yymsp[0].minor.yy0, TK_NOW); }
yymsp[0].minor.yy439 = yylhsminor.yy439;
break;
case 241: /* expr ::= VARIABLE */
{ yylhsminor.yy439 = tSqlExprCreateIdValue(&yymsp[0].minor.yy0, TK_VARIABLE);}
{ yylhsminor.yy439 = tSqlExprCreateIdValue(pInfo, &yymsp[0].minor.yy0, TK_VARIABLE);}
yymsp[0].minor.yy439 = yylhsminor.yy439;
break;
case 242: /* expr ::= PLUS VARIABLE */
case 243: /* expr ::= MINUS VARIABLE */ yytestcase(yyruleno==243);
{ 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.yy0.n += yymsp[0].minor.yy0.n; yymsp[-1].minor.yy0.type = TK_VARIABLE; yylhsminor.yy439 = tSqlExprCreateIdValue(pInfo, &yymsp[-1].minor.yy0, TK_VARIABLE);}
yymsp[-1].minor.yy439 = yylhsminor.yy439;
break;
case 244: /* expr ::= BOOL */
{ yylhsminor.yy439 = tSqlExprCreateIdValue(&yymsp[0].minor.yy0, TK_BOOL);}
{ yylhsminor.yy439 = tSqlExprCreateIdValue(pInfo, &yymsp[0].minor.yy0, TK_BOOL);}
yymsp[0].minor.yy439 = yylhsminor.yy439;
break;
case 245: /* expr ::= NULL */
{ yylhsminor.yy439 = tSqlExprCreateIdValue(&yymsp[0].minor.yy0, TK_NULL);}
{ yylhsminor.yy439 = tSqlExprCreateIdValue(pInfo, &yymsp[0].minor.yy0, TK_NULL);}
yymsp[0].minor.yy439 = yylhsminor.yy439;
break;
case 246: /* expr ::= ID LP exprlist RP */
......@@ -3320,9 +3760,9 @@ static YYACTIONTYPE yy_reduce(
break;
/********** End reduce actions ************************************************/
};
assert( yyruleno<sizeof(yyRuleInfo)/sizeof(yyRuleInfo[0]) );
yygoto = yyRuleInfo[yyruleno].lhs;
yysize = yyRuleInfo[yyruleno].nrhs;
assert( yyruleno<sizeof(yyRuleInfoLhs)/sizeof(yyRuleInfoLhs[0]) );
yygoto = yyRuleInfoLhs[yyruleno];
yysize = yyRuleInfoNRhs[yyruleno];
yyact = yy_find_reduce_action(yymsp[yysize].stateno,(YYCODETYPE)yygoto);
/* There are no SHIFTREDUCE actions on nonterminals because the table
......@@ -3484,12 +3924,56 @@ void Parse(
}
#endif
do{
while(1){ /* Exit by "break" */
assert( yypParser->yytos>=yypParser->yystack );
assert( yyact==yypParser->yytos->stateno );
yyact = yy_find_shift_action((YYCODETYPE)yymajor,yyact);
if( yyact >= YY_MIN_REDUCE ){
yyact = yy_reduce(yypParser,yyact-YY_MIN_REDUCE,yymajor,
yyminor ParseCTX_PARAM);
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],
yyruleno<YYNRULE_WITH_ACTION ? "" : " without external action",
yypParser->yytos[yysize].stateno);
}else{
fprintf(yyTraceFILE, "%sReduce %d [%s]%s.\n",
yyTracePrompt, yyruleno, yyRuleName[yyruleno],
yyruleno<YYNRULE_WITH_ACTION ? "" : " without external action");
}
}
#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( yyRuleInfoNRhs[yyruleno]==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);
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);
}else if( yyact <= YY_MAX_SHIFTREDUCE ){
yy_shift(yypParser,yyact,(YYCODETYPE)yymajor,yyminor);
#ifndef YYNOERRORRECOVERY
......@@ -3545,14 +4029,13 @@ void Parse(
yy_destructor(yypParser, (YYCODETYPE)yymajor, &yyminorunion);
yymajor = YYNOCODE;
}else{
while( yypParser->yytos >= yypParser->yystack
&& (yyact = yy_find_reduce_action(
yypParser->yytos->stateno,
YYERRORSYMBOL)) > YY_MAX_SHIFTREDUCE
){
while( yypParser->yytos > yypParser->yystack ){
yyact = yy_find_reduce_action(yypParser->yytos->stateno,
YYERRORSYMBOL);
if( yyact<=YY_MAX_SHIFTREDUCE ) break;
yy_pop_parser_stack(yypParser);
}
if( yypParser->yytos < yypParser->yystack || yymajor==0 ){
if( yypParser->yytos <= yypParser->yystack || yymajor==0 ){
yy_destructor(yypParser,(YYCODETYPE)yymajor,&yyminorunion);
yy_parse_failed(yypParser);
#ifndef YYNOERRORRECOVERY
......@@ -3602,7 +4085,7 @@ void Parse(
break;
#endif
}
}while( yypParser->yytos>yypParser->yystack );
}
#ifndef NDEBUG
if( yyTraceFILE ){
yyStackEntry *i;
......@@ -3624,11 +4107,10 @@ void Parse(
*/
int ParseFallback(int iToken){
#ifdef YYFALLBACK
if( iToken<(int)(sizeof(yyFallback)/sizeof(yyFallback[0])) ){
return yyFallback[iToken];
}
assert( iToken<(int)(sizeof(yyFallback)/sizeof(yyFallback[0])) );
return yyFallback[iToken];
#else
(void)iToken;
#endif
return 0;
#endif
}
......@@ -68,9 +68,9 @@ class TDTestCase:
tdSql.checkData(0, 0, "2018-09-17 09:00:10.000")
tdSql.checkData(0, 1, "2018-09-17 09:00:10.000")
tdSql.checkData(0, 3, "2018-09-17 09:00:10.000")
tdSql.checkData(1, 0, "2018-09-17 09:00:20.009")
tdSql.checkData(1, 1, "2018-09-17 09:00:20.009")
tdSql.checkData(1, 3, "2018-09-17 09:00:20.009")
tdSql.checkData(1, 0, "2018-09-17 09:00:20.000")
tdSql.checkData(1, 1, "2018-09-17 09:00:20.000")
tdSql.checkData(1, 3, "2018-09-17 09:00:20.000")
tdSql.query("select ts from(select ts,derivative(col, 10s, 0) from stb group by tbname)")
......@@ -147,6 +147,10 @@ class TDTestCase:
tdSql.error("select derivative(col, 10s, 1) from stb group by id")
tdSql.error("select derivative(col, 999ms, 1) from stb group by id")
tdSql.error("select derivative(col, 10s, 2) from stb group by id")
tdSql.error("select derivative(col, -106752999999999922222d, 0) from stb group by tbname"); #overflow error
tdSql.error("select derivative(col, 10y, 0) from stb group by tbname") #TD-10399, DB error: syntax error near '10y, 0) from stb group by tbname;'
tdSql.error("select derivative(col, -106752d, 0) from stb group by tbname") #TD-10398 overflow tips
tdSql.error("select derivative(col, 106751991168d, 0) from stb group by tbname") #TD-10398 overflow tips
def run(self):
tdSql.prepare()
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册