提交 c126e6be 编写于 作者: H Hongze Cheng

Merge branch 'feature/update' of https://github.com/taosdata/TDengine into feature/update

...@@ -5183,6 +5183,7 @@ static void setCreateDBOption(SCMCreateDbMsg* pMsg, SCreateDBInfo* pCreateDb) { ...@@ -5183,6 +5183,7 @@ static void setCreateDBOption(SCMCreateDbMsg* pMsg, SCreateDBInfo* pCreateDb) {
pMsg->replications = pCreateDb->replica; pMsg->replications = pCreateDb->replica;
pMsg->quorum = pCreateDb->quorum; pMsg->quorum = pCreateDb->quorum;
pMsg->ignoreExist = pCreateDb->ignoreExists; pMsg->ignoreExist = pCreateDb->ignoreExists;
pMsg->update = pCreateDb->update;
} }
int32_t parseCreateDBOptions(SSqlCmd* pCmd, SCreateDBInfo* pCreateDbSql) { int32_t parseCreateDBOptions(SSqlCmd* pCmd, SCreateDBInfo* pCreateDbSql) {
......
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
#ifndef TDENGINE_TTOKENDEF_H #ifndef TDENGINE_TTOKENDEF_H
#define TDENGINE_TTOKENDEF_H #define TDENGINE_TTOKENDEF_H
#define TK_ID 1 #define TK_ID 1
#define TK_BOOL 2 #define TK_BOOL 2
#define TK_TINYINT 3 #define TK_TINYINT 3
...@@ -113,115 +114,115 @@ ...@@ -113,115 +114,115 @@
#define TK_FSYNC 95 #define TK_FSYNC 95
#define TK_COMP 96 #define TK_COMP 96
#define TK_PRECISION 97 #define TK_PRECISION 97
#define TK_LP 98 #define TK_UPDATE 98
#define TK_RP 99 #define TK_LP 99
#define TK_TAGS 100 #define TK_RP 100
#define TK_USING 101 #define TK_TAGS 101
#define TK_AS 102 #define TK_USING 102
#define TK_COMMA 103 #define TK_AS 103
#define TK_NULL 104 #define TK_COMMA 104
#define TK_SELECT 105 #define TK_NULL 105
#define TK_UNION 106 #define TK_SELECT 106
#define TK_ALL 107 #define TK_UNION 107
#define TK_FROM 108 #define TK_ALL 108
#define TK_VARIABLE 109 #define TK_FROM 109
#define TK_INTERVAL 110 #define TK_VARIABLE 110
#define TK_FILL 111 #define TK_INTERVAL 111
#define TK_SLIDING 112 #define TK_FILL 112
#define TK_ORDER 113 #define TK_SLIDING 113
#define TK_BY 114 #define TK_ORDER 114
#define TK_ASC 115 #define TK_BY 115
#define TK_DESC 116 #define TK_ASC 116
#define TK_GROUP 117 #define TK_DESC 117
#define TK_HAVING 118 #define TK_GROUP 118
#define TK_LIMIT 119 #define TK_HAVING 119
#define TK_OFFSET 120 #define TK_LIMIT 120
#define TK_SLIMIT 121 #define TK_OFFSET 121
#define TK_SOFFSET 122 #define TK_SLIMIT 122
#define TK_WHERE 123 #define TK_SOFFSET 123
#define TK_NOW 124 #define TK_WHERE 124
#define TK_RESET 125 #define TK_NOW 125
#define TK_QUERY 126 #define TK_RESET 126
#define TK_ADD 127 #define TK_QUERY 127
#define TK_COLUMN 128 #define TK_ADD 128
#define TK_TAG 129 #define TK_COLUMN 129
#define TK_CHANGE 130 #define TK_TAG 130
#define TK_SET 131 #define TK_CHANGE 131
#define TK_KILL 132 #define TK_SET 132
#define TK_CONNECTION 133 #define TK_KILL 133
#define TK_STREAM 134 #define TK_CONNECTION 134
#define TK_COLON 135 #define TK_STREAM 135
#define TK_ABORT 136 #define TK_COLON 136
#define TK_AFTER 137 #define TK_ABORT 137
#define TK_ATTACH 138 #define TK_AFTER 138
#define TK_BEFORE 139 #define TK_ATTACH 139
#define TK_BEGIN 140 #define TK_BEFORE 140
#define TK_CASCADE 141 #define TK_BEGIN 141
#define TK_CLUSTER 142 #define TK_CASCADE 142
#define TK_CONFLICT 143 #define TK_CLUSTER 143
#define TK_COPY 144 #define TK_CONFLICT 144
#define TK_DEFERRED 145 #define TK_COPY 145
#define TK_DELIMITERS 146 #define TK_DEFERRED 146
#define TK_DETACH 147 #define TK_DELIMITERS 147
#define TK_EACH 148 #define TK_DETACH 148
#define TK_END 149 #define TK_EACH 149
#define TK_EXPLAIN 150 #define TK_END 150
#define TK_FAIL 151 #define TK_EXPLAIN 151
#define TK_FOR 152 #define TK_FAIL 152
#define TK_IGNORE 153 #define TK_FOR 153
#define TK_IMMEDIATE 154 #define TK_IGNORE 154
#define TK_INITIALLY 155 #define TK_IMMEDIATE 155
#define TK_INSTEAD 156 #define TK_INITIALLY 156
#define TK_MATCH 157 #define TK_INSTEAD 157
#define TK_KEY 158 #define TK_MATCH 158
#define TK_OF 159 #define TK_KEY 159
#define TK_RAISE 160 #define TK_OF 160
#define TK_REPLACE 161 #define TK_RAISE 161
#define TK_RESTRICT 162 #define TK_REPLACE 162
#define TK_ROW 163 #define TK_RESTRICT 163
#define TK_STATEMENT 164 #define TK_ROW 164
#define TK_TRIGGER 165 #define TK_STATEMENT 165
#define TK_VIEW 166 #define TK_TRIGGER 166
#define TK_COUNT 167 #define TK_VIEW 167
#define TK_SUM 168 #define TK_COUNT 168
#define TK_AVG 169 #define TK_SUM 169
#define TK_MIN 170 #define TK_AVG 170
#define TK_MAX 171 #define TK_MIN 171
#define TK_FIRST 172 #define TK_MAX 172
#define TK_LAST 173 #define TK_FIRST 173
#define TK_TOP 174 #define TK_LAST 174
#define TK_BOTTOM 175 #define TK_TOP 175
#define TK_STDDEV 176 #define TK_BOTTOM 176
#define TK_PERCENTILE 177 #define TK_STDDEV 177
#define TK_APERCENTILE 178 #define TK_PERCENTILE 178
#define TK_LEASTSQUARES 179 #define TK_APERCENTILE 179
#define TK_HISTOGRAM 180 #define TK_LEASTSQUARES 180
#define TK_DIFF 181 #define TK_HISTOGRAM 181
#define TK_SPREAD 182 #define TK_DIFF 182
#define TK_TWA 183 #define TK_SPREAD 183
#define TK_INTERP 184 #define TK_TWA 184
#define TK_LAST_ROW 185 #define TK_INTERP 185
#define TK_RATE 186 #define TK_LAST_ROW 186
#define TK_IRATE 187 #define TK_RATE 187
#define TK_SUM_RATE 188 #define TK_IRATE 188
#define TK_SUM_IRATE 189 #define TK_SUM_RATE 189
#define TK_AVG_RATE 190 #define TK_SUM_IRATE 190
#define TK_AVG_IRATE 191 #define TK_AVG_RATE 191
#define TK_TBID 192 #define TK_AVG_IRATE 192
#define TK_SEMI 193 #define TK_TBID 193
#define TK_NONE 194 #define TK_SEMI 194
#define TK_PREV 195 #define TK_NONE 195
#define TK_LINEAR 196 #define TK_PREV 196
#define TK_IMPORT 197 #define TK_LINEAR 197
#define TK_METRIC 198 #define TK_IMPORT 198
#define TK_TBNAME 199 #define TK_METRIC 199
#define TK_JOIN 200 #define TK_TBNAME 200
#define TK_METRICS 201 #define TK_JOIN 201
#define TK_STABLE 202 #define TK_METRICS 202
#define TK_INSERT 203 #define TK_STABLE 203
#define TK_INTO 204 #define TK_INSERT 204
#define TK_VALUES 205 #define TK_INTO 205
#define TK_VALUES 206
#define TK_SPACE 300 #define TK_SPACE 300
#define TK_COMMENT 301 #define TK_COMMENT 301
......
...@@ -129,6 +129,7 @@ typedef struct SCreateDBInfo { ...@@ -129,6 +129,7 @@ typedef struct SCreateDBInfo {
int32_t compressionLevel; int32_t compressionLevel;
SStrToken precision; SStrToken precision;
bool ignoreExists; bool ignoreExists;
int8_t update;
tVariantList *keep; tVariantList *keep;
} SCreateDBInfo; } SCreateDBInfo;
......
...@@ -229,6 +229,7 @@ wal(Y) ::= WAL INTEGER(X). { Y = X; } ...@@ -229,6 +229,7 @@ wal(Y) ::= WAL INTEGER(X). { Y = X; }
fsync(Y) ::= FSYNC INTEGER(X). { Y = X; } fsync(Y) ::= FSYNC INTEGER(X). { Y = X; }
comp(Y) ::= COMP INTEGER(X). { Y = X; } comp(Y) ::= COMP INTEGER(X). { Y = X; }
prec(Y) ::= PRECISION STRING(X). { Y = X; } prec(Y) ::= PRECISION STRING(X). { Y = X; }
update(Y) ::= UPDATE INTEGER(X). { Y = X; }
%type db_optr {SCreateDBInfo} %type db_optr {SCreateDBInfo}
db_optr(Y) ::= . {setDefaultCreateDbOption(&Y);} db_optr(Y) ::= . {setDefaultCreateDbOption(&Y);}
...@@ -246,6 +247,7 @@ db_optr(Y) ::= db_optr(Z) fsync(X). { Y = Z; Y.fsyncPeriod = strtol(X.z ...@@ -246,6 +247,7 @@ db_optr(Y) ::= db_optr(Z) fsync(X). { Y = Z; Y.fsyncPeriod = strtol(X.z
db_optr(Y) ::= db_optr(Z) comp(X). { Y = Z; Y.compressionLevel = strtol(X.z, NULL, 10); } db_optr(Y) ::= db_optr(Z) comp(X). { Y = Z; Y.compressionLevel = strtol(X.z, NULL, 10); }
db_optr(Y) ::= db_optr(Z) prec(X). { Y = Z; Y.precision = X; } db_optr(Y) ::= db_optr(Z) prec(X). { Y = Z; Y.precision = X; }
db_optr(Y) ::= db_optr(Z) keep(X). { Y = Z; Y.keep = X; } db_optr(Y) ::= db_optr(Z) keep(X). { Y = Z; Y.keep = X; }
db_optr(Y) ::= db_optr(Z) update(X). { Y = Z; Y.update = strtol(X.z, NULL, 10); }
%type alter_db_optr {SCreateDBInfo} %type alter_db_optr {SCreateDBInfo}
alter_db_optr(Y) ::= . { setDefaultCreateDbOption(&Y);} alter_db_optr(Y) ::= . { setDefaultCreateDbOption(&Y);}
...@@ -257,6 +259,7 @@ alter_db_optr(Y) ::= alter_db_optr(Z) blocks(X). { Y = Z; Y.numOfBlocks = s ...@@ -257,6 +259,7 @@ alter_db_optr(Y) ::= alter_db_optr(Z) blocks(X). { Y = Z; Y.numOfBlocks = s
alter_db_optr(Y) ::= alter_db_optr(Z) comp(X). { Y = Z; Y.compressionLevel = strtol(X.z, NULL, 10); } alter_db_optr(Y) ::= alter_db_optr(Z) comp(X). { Y = Z; Y.compressionLevel = strtol(X.z, NULL, 10); }
alter_db_optr(Y) ::= alter_db_optr(Z) wal(X). { Y = Z; Y.walLevel = strtol(X.z, NULL, 10); } alter_db_optr(Y) ::= alter_db_optr(Z) wal(X). { Y = Z; Y.walLevel = strtol(X.z, NULL, 10); }
alter_db_optr(Y) ::= alter_db_optr(Z) fsync(X). { Y = Z; Y.fsyncPeriod = strtol(X.z, NULL, 10); } alter_db_optr(Y) ::= alter_db_optr(Z) fsync(X). { Y = Z; Y.fsyncPeriod = strtol(X.z, NULL, 10); }
alter_db_optr(Y) ::= alter_db_optr(Z) update(X). { Y = Z; Y.update = strtol(X.z, NULL, 10); }
%type typename {TAOS_FIELD} %type typename {TAOS_FIELD}
typename(A) ::= ids(X). { typename(A) ::= ids(X). {
......
...@@ -155,6 +155,7 @@ static SKeyword keywordTable[] = { ...@@ -155,6 +155,7 @@ static SKeyword keywordTable[] = {
{"INSERT", TK_INSERT}, {"INSERT", TK_INSERT},
{"INTO", TK_INTO}, {"INTO", TK_INTO},
{"VALUES", TK_VALUES}, {"VALUES", TK_VALUES},
{"UPDATE", TK_UPDATE},
{"RESET", TK_RESET}, {"RESET", TK_RESET},
{"QUERY", TK_QUERY}, {"QUERY", TK_QUERY},
{"ADD", TK_ADD}, {"ADD", TK_ADD},
......
/* /* Driver template for the LEMON parser generator.
** 2000-05-29 ** The author disclaims copyright to this source code.
**
** The author disclaims copyright to this source code. In place of
** a legal notice, here is a blessing:
**
** May you do good and not evil.
** May you find forgiveness for yourself and forgive others.
** May you share freely, never taking more than you give.
**
*************************************************************************
** Driver template for the LEMON parser generator.
**
** The "lemon" program processes an LALR(1) input grammar file, then uses
** this template to construct a parser. The "lemon" program inserts text
** at each "%%" line. Also, any "P-a-r-s-e" identifer prefix (without the
** interstitial "-" characters) contained in this template is changed into
** the value of the %name directive from the grammar. Otherwise, the content
** of this template is copied straight through into the generate parser
** source file.
**
** The following is the concatenation of all %include directives from the
** input grammar file:
*/ */
/* First off, code is included that follows the "include" declaration
** in the input grammar file. */
#include <stdio.h> #include <stdio.h>
#include <assert.h>
/************ Begin %include sections from the grammar ************************/
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
...@@ -37,119 +16,95 @@ ...@@ -37,119 +16,95 @@
#include "ttokendef.h" #include "ttokendef.h"
#include "tutil.h" #include "tutil.h"
#include "tvariant.h" #include "tvariant.h"
/**************** End of %include directives **********************************/ /* Next is all token values, in a form suitable for use by makeheaders.
/* These constants specify the various numeric values for terminal symbols ** This section will be null unless lemon is run with the -m switch.
** in a format understandable to "makeheaders". This section is blank unless */
** "lemon" is run with the "-m" command-line option. /*
***************** Begin makeheaders token definitions *************************/ ** These constants (all generated automatically by the parser generator)
/**************** End makeheaders token definitions ***************************/ ** specify the various kinds of tokens (terminals) that the parser
** understands.
/* The next sections is a series of control #defines. **
** Each symbol here is a terminal symbol in the grammar.
*/
/* Make sure the INTERFACE macro is defined.
*/
#ifndef INTERFACE
# define INTERFACE 1
#endif
/* The next thing included is series of defines which control
** various aspects of the generated parser. ** various aspects of the generated parser.
** YYCODETYPE is the data type used to store the integer codes ** YYCODETYPE is the data type used for storing terminal
** that represent terminal and non-terminal symbols. ** and nonterminal numbers. "unsigned char" is
** "unsigned char" is used if there are fewer than ** used if there are fewer than 250 terminals
** 256 symbols. Larger types otherwise. ** and nonterminals. "int" is used otherwise.
** YYNOCODE is a number of type YYCODETYPE that is not used for ** YYNOCODE is a number of type YYCODETYPE which corresponds
** any terminal or nonterminal symbol. ** to no legal terminal or nonterminal number. This
** number is used to fill in empty slots of the hash
** table.
** YYFALLBACK If defined, this indicates that one or more tokens ** YYFALLBACK If defined, this indicates that one or more tokens
** (also known as: "terminal symbols") have fall-back ** have fall-back values which should be used if the
** values which should be used if the original symbol ** original value of the token will not parse.
** would not parse. This permits keywords to sometimes ** YYACTIONTYPE is the data type used for storing terminal
** be used as identifiers, for example. ** and nonterminal numbers. "unsigned char" is
** YYACTIONTYPE is the data type used for "action codes" - numbers ** used if there are fewer than 250 rules and
** that indicate what to do in response to the next ** states combined. "int" is used otherwise.
** token. ** ParseTOKENTYPE is the data type used for minor tokens given
** ParseTOKENTYPE is the data type used for minor type for terminal ** directly to the parser from the tokenizer.
** symbols. Background: A "minor type" is a semantic ** YYMINORTYPE is the data type used for all minor tokens.
** value associated with a terminal or non-terminal
** symbols. For example, for an "ID" terminal symbol,
** the minor type might be the name of the identifier.
** Each non-terminal can have a different minor type.
** Terminal symbols all have the same minor type, though.
** This macros defines the minor type for terminal
** symbols.
** YYMINORTYPE is the data type used for all minor types.
** This is typically a union of many types, one of ** This is typically a union of many types, one of
** which is ParseTOKENTYPE. The entry in the union ** which is ParseTOKENTYPE. The entry in the union
** for terminal symbols is called "yy0". ** for base tokens is called "yy0".
** YYSTACKDEPTH is the maximum depth of the parser's stack. If ** YYSTACKDEPTH is the maximum depth of the parser's stack. If
** zero the stack is dynamically sized using realloc() ** zero the stack is dynamically sized using realloc()
** ParseARG_SDECL A static variable declaration for the %extra_argument ** ParseARG_SDECL A static variable declaration for the %extra_argument
** ParseARG_PDECL A parameter 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_STORE Code to store %extra_argument into yypParser
** ParseARG_FETCH Code to extract %extra_argument from 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. ** YYNSTATE the combined number of states.
** YYNRULE the number of rules in the grammar ** YYNRULE the number of rules in the grammar
** YYNTOKEN Number of terminal symbols ** YYERRORSYMBOL is the code number of the error symbol. If not
** YY_MAX_SHIFT Maximum value for shift actions ** defined, then do no error processing.
** YY_MIN_SHIFTREDUCE Minimum value for shift-reduce actions
** YY_MAX_SHIFTREDUCE Maximum value for shift-reduce actions
** YY_ERROR_ACTION The yy_action[] code for syntax error
** YY_ACCEPT_ACTION The yy_action[] code for accept
** YY_NO_ACTION The yy_action[] code for no-op
** YY_MIN_REDUCE Minimum value for reduce actions
** YY_MAX_REDUCE Maximum value for reduce actions
*/ */
#ifndef INTERFACE
# define INTERFACE 1
#endif
/************* Begin control #defines *****************************************/
#define YYCODETYPE unsigned short int #define YYCODETYPE unsigned short int
#define YYNOCODE 270 #define YYNOCODE 274
#define YYACTIONTYPE unsigned short int #define YYACTIONTYPE unsigned short int
#define ParseTOKENTYPE SStrToken #define ParseTOKENTYPE SStrToken
typedef union { typedef union {
int yyinit; int yyinit;
ParseTOKENTYPE yy0; ParseTOKENTYPE yy0;
int yy112; int yy46;
SCreateDBInfo yy118; tSQLExpr* yy64;
tVariantList* yy156; tVariant yy134;
tSQLExprList* yy158; SCreateAcctSQL yy149;
tSQLExpr* yy190; int64_t yy207;
SSubclauseInfo* yy333; SLimitVal yy216;
SIntervalVal yy340; TAOS_FIELD yy223;
TAOS_FIELD yy343; SSubclauseInfo* yy231;
int64_t yy369; SCreateDBInfo yy268;
SCreateTableSQL* yy398; tSQLExprList* yy290;
SLimitVal yy414; SQuerySQL* yy414;
SQuerySQL* yy444; SCreateTableSQL* yy470;
SCreateAcctSQL yy479; tVariantList* yy498;
tVariant yy506; tFieldList* yy523;
tFieldList* yy511; SIntervalVal yy532;
} YYMINORTYPE; } YYMINORTYPE;
#ifndef YYSTACKDEPTH #ifndef YYSTACKDEPTH
#define YYSTACKDEPTH 100 #define YYSTACKDEPTH 100
#endif #endif
#define ParseARG_SDECL SSqlInfo* pInfo; #define ParseARG_SDECL SSqlInfo* pInfo;
#define ParseARG_PDECL ,SSqlInfo* pInfo #define ParseARG_PDECL ,SSqlInfo* pInfo
#define ParseARG_PARAM ,pInfo #define ParseARG_FETCH SSqlInfo* pInfo = yypParser->pInfo
#define ParseARG_FETCH SSqlInfo* pInfo=yypParser->pInfo; #define ParseARG_STORE yypParser->pInfo = pInfo
#define ParseARG_STORE yypParser->pInfo=pInfo; #define YYNSTATE 414
#define ParseCTX_SDECL #define YYNRULE 231
#define ParseCTX_PDECL
#define ParseCTX_PARAM
#define ParseCTX_FETCH
#define ParseCTX_STORE
#define YYFALLBACK 1 #define YYFALLBACK 1
#define YYNSTATE 248 #define YY_NO_ACTION (YYNSTATE+YYNRULE+2)
#define YYNRULE 228 #define YY_ACCEPT_ACTION (YYNSTATE+YYNRULE+1)
#define YYNRULE_WITH_ACTION 228 #define YY_ERROR_ACTION (YYNSTATE+YYNRULE)
#define YYNTOKEN 206
#define YY_MAX_SHIFT 247 /* The yyzerominor constant is used to initialize instances of
#define YY_MIN_SHIFTREDUCE 410 ** YYMINORTYPE objects to zero. */
#define YY_MAX_SHIFTREDUCE 637 static const YYMINORTYPE yyzerominor = { 0 };
#define YY_ERROR_ACTION 638
#define YY_ACCEPT_ACTION 639
#define YY_NO_ACTION 640
#define YY_MIN_REDUCE 641
#define YY_MAX_REDUCE 868
/************* 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 /* Define the yytestcase() macro to be a no-op if is not already defined
** otherwise. ** otherwise.
...@@ -172,35 +127,33 @@ typedef union { ...@@ -172,35 +127,33 @@ typedef union {
** Suppose the action integer is N. Then the action is determined as ** Suppose the action integer is N. Then the action is determined as
** follows ** follows
** **
** 0 <= N <= YY_MAX_SHIFT Shift N. That is, push the lookahead ** 0 <= N < YYNSTATE Shift N. That is, push the lookahead
** token onto the stack and goto state N. ** token onto the stack and goto state N.
** **
** N between YY_MIN_SHIFTREDUCE Shift to an arbitrary state then ** YYNSTATE <= N < YYNSTATE+YYNRULE Reduce by rule N-YYNSTATE.
** and YY_MAX_SHIFTREDUCE reduce by rule N-YY_MIN_SHIFTREDUCE.
** **
** N == YY_ERROR_ACTION A syntax error has occurred. ** N == YYNSTATE+YYNRULE A syntax error has occurred.
** **
** N == YY_ACCEPT_ACTION The parser accepts its input. ** N == YYNSTATE+YYNRULE+1 The parser accepts its input.
** **
** N == YY_NO_ACTION No such action. Denotes unused ** N == YYNSTATE+YYNRULE+2 No such action. Denotes unused
** slots in the yy_action[] table. ** slots in the yy_action[] table.
** **
** N between YY_MIN_REDUCE Reduce by rule N-YY_MIN_REDUCE
** and YY_MAX_REDUCE
**
** The action table is constructed as a single large table named yy_action[]. ** The action table is constructed as a single large table named yy_action[].
** Given state S and lookahead X, the action is computed as either: ** Given state S and lookahead X, the action is computed as
** **
** (A) N = yy_action[ yy_shift_ofst[S] + X ] ** yy_action[ yy_shift_ofst[S] + X ]
** (B) N = yy_default[S]
** **
** The (A) formula is preferred. The B formula is used instead if ** If the index value yy_shift_ofst[S]+X is out of range or if the value
** yy_lookahead[yy_shift_ofst[S]+X] is not equal to X. ** yy_lookahead[yy_shift_ofst[S]+X] is not equal to X or if yy_shift_ofst[S]
** is equal to YY_SHIFT_USE_DFLT, it means that the action is not in the table
** and that yy_default[S] should be used instead.
** **
** The formulas above are for computing the action when the lookahead is ** The formula above is for computing the action when the lookahead is
** a terminal symbol. If the lookahead is a non-terminal (as occurs after ** a terminal symbol. If the lookahead is a non-terminal (as occurs after
** a reduce action) then the yy_reduce_ofst[] array is used in place of ** a reduce action) then the yy_reduce_ofst[] array is used in place of
** the yy_shift_ofst[] array. ** the yy_shift_ofst[] array and YY_REDUCE_USE_DFLT is used in place of
** YY_SHIFT_USE_DFLT.
** **
** The following are the tables generated in this section: ** The following are the tables generated in this section:
** **
...@@ -212,226 +165,244 @@ typedef union { ...@@ -212,226 +165,244 @@ typedef union {
** yy_reduce_ofst[] For each state, the offset into yy_action for ** yy_reduce_ofst[] For each state, the offset into yy_action for
** shifting non-terminals after a reduce. ** shifting non-terminals after a reduce.
** yy_default[] Default action for each state. ** yy_default[] Default action for each state.
** */
*********** Begin parsing tables **********************************************/ #define YY_ACTTAB_COUNT (665)
#define YY_ACTTAB_COUNT (560)
static const YYACTIONTYPE yy_action[] = { static const YYACTIONTYPE yy_action[] = {
/* 0 */ 741, 451, 11, 739, 740, 639, 247, 451, 742, 452, /* 0 */ 398, 76, 80, 85, 88, 79, 341, 173, 397, 263,
/* 10 */ 744, 745, 743, 35, 36, 452, 37, 38, 156, 245, /* 10 */ 180, 82, 35, 36, 18, 37, 38, 184, 183, 167,
/* 20 */ 167, 29, 138, 137, 202, 41, 39, 43, 40, 106, /* 20 */ 29, 87, 86, 202, 41, 39, 43, 40, 10, 9,
/* 30 */ 517, 162, 856, 34, 33, 782, 138, 32, 31, 30, /* 30 */ 646, 248, 34, 33, 223, 222, 32, 31, 30, 35,
/* 40 */ 35, 36, 771, 37, 38, 161, 856, 167, 29, 771, /* 40 */ 36, 8, 37, 38, 63, 116, 167, 29, 101, 21,
/* 50 */ 106, 202, 41, 39, 43, 40, 187, 159, 223, 222, /* 50 */ 202, 41, 39, 43, 40, 245, 244, 97, 414, 34,
/* 60 */ 34, 33, 138, 157, 32, 31, 30, 35, 36, 451, /* 60 */ 33, 75, 74, 32, 31, 30, 35, 36, 256, 37,
/* 70 */ 37, 38, 855, 142, 167, 29, 760, 452, 202, 41, /* 70 */ 38, 401, 174, 167, 29, 220, 219, 202, 41, 39,
/* 80 */ 39, 43, 40, 199, 78, 60, 779, 34, 33, 234, /* 80 */ 43, 40, 187, 226, 207, 337, 34, 33, 22, 398,
/* 90 */ 234, 32, 31, 30, 21, 41, 39, 43, 40, 32, /* 90 */ 32, 31, 30, 36, 307, 37, 38, 397, 22, 167,
/* 100 */ 31, 30, 56, 34, 33, 852, 808, 32, 31, 30, /* 100 */ 29, 190, 56, 202, 41, 39, 43, 40, 32, 31,
/* 110 */ 21, 21, 106, 411, 412, 413, 414, 415, 416, 417, /* 110 */ 30, 361, 34, 33, 363, 362, 32, 31, 30, 360,
/* 120 */ 418, 419, 420, 421, 422, 246, 591, 171, 36, 757, /* 120 */ 306, 358, 357, 359, 46, 356, 297, 400, 133, 131,
/* 130 */ 37, 38, 225, 50, 167, 29, 21, 62, 202, 41, /* 130 */ 93, 92, 91, 413, 412, 411, 410, 409, 408, 407,
/* 140 */ 39, 43, 40, 172, 221, 757, 757, 34, 33, 27, /* 140 */ 406, 405, 404, 403, 402, 247, 375, 138, 374, 106,
/* 150 */ 51, 32, 31, 30, 8, 37, 38, 63, 116, 167, /* 150 */ 37, 38, 50, 99, 167, 29, 161, 279, 202, 41,
/* 160 */ 29, 101, 758, 202, 41, 39, 43, 40, 809, 226, /* 160 */ 39, 43, 40, 106, 373, 165, 372, 34, 33, 51,
/* 170 */ 197, 757, 34, 33, 170, 851, 32, 31, 30, 16, /* 170 */ 203, 32, 31, 30, 311, 98, 323, 322, 321, 320,
/* 180 */ 214, 240, 239, 213, 212, 211, 238, 210, 237, 236, /* 180 */ 319, 318, 317, 316, 315, 314, 313, 312, 310, 16,
/* 190 */ 235, 209, 737, 760, 725, 726, 727, 728, 729, 730, /* 190 */ 214, 241, 240, 213, 212, 211, 239, 210, 238, 237,
/* 200 */ 731, 732, 733, 734, 735, 736, 166, 604, 12, 241, /* 200 */ 236, 209, 235, 166, 285, 3, 270, 294, 197, 289,
/* 210 */ 595, 17, 598, 190, 601, 559, 166, 604, 26, 103, /* 210 */ 293, 288, 292, 166, 285, 47, 78, 294, 199, 289,
/* 220 */ 595, 597, 598, 600, 601, 34, 33, 151, 760, 32, /* 220 */ 60, 288, 234, 166, 285, 12, 291, 294, 290, 289,
/* 230 */ 31, 30, 21, 90, 89, 145, 572, 573, 163, 164, /* 230 */ 46, 288, 21, 255, 48, 163, 164, 34, 33, 257,
/* 240 */ 173, 150, 201, 76, 80, 85, 88, 79, 163, 164, /* 240 */ 189, 32, 31, 30, 151, 163, 164, 296, 370, 201,
/* 250 */ 166, 604, 549, 82, 595, 106, 598, 100, 601, 244, /* 250 */ 90, 89, 145, 284, 392, 163, 164, 13, 150, 369,
/* 260 */ 243, 97, 17, 16, 26, 240, 239, 756, 680, 26, /* 260 */ 299, 41, 39, 43, 40, 368, 221, 138, 337, 34,
/* 270 */ 238, 129, 237, 236, 235, 119, 120, 70, 66, 69, /* 270 */ 33, 100, 21, 32, 31, 30, 162, 279, 26, 16,
/* 280 */ 203, 165, 163, 164, 689, 533, 180, 129, 530, 186, /* 280 */ 17, 241, 240, 295, 275, 274, 239, 26, 238, 237,
/* 290 */ 531, 850, 532, 184, 183, 596, 153, 599, 133, 131, /* 290 */ 236, 280, 235, 377, 21, 13, 380, 398, 379, 266,
/* 300 */ 93, 92, 91, 42, 174, 546, 681, 220, 219, 129, /* 300 */ 378, 42, 106, 14, 21, 397, 172, 186, 337, 267,
/* 310 */ 18, 61, 541, 42, 603, 593, 175, 176, 563, 189, /* 310 */ 106, 42, 286, 46, 153, 119, 120, 70, 66, 69,
/* 320 */ 3, 47, 46, 537, 603, 538, 564, 623, 605, 602, /* 320 */ 225, 42, 286, 62, 175, 176, 242, 287, 171, 265,
/* 330 */ 14, 13, 13, 154, 523, 75, 74, 522, 46, 602, /* 330 */ 337, 354, 286, 103, 129, 27, 331, 287, 355, 129,
/* 340 */ 48, 22, 207, 535, 155, 536, 22, 42, 10, 9, /* 340 */ 343, 129, 256, 17, 138, 170, 371, 287, 159, 258,
/* 350 */ 140, 594, 87, 86, 141, 143, 144, 148, 603, 149, /* 350 */ 26, 338, 156, 246, 278, 367, 157, 366, 365, 61,
/* 360 */ 147, 136, 146, 139, 865, 759, 819, 818, 168, 607, /* 360 */ 364, 353, 352, 351, 350, 371, 349, 271, 371, 348,
/* 370 */ 815, 814, 169, 602, 751, 224, 781, 773, 786, 788, /* 370 */ 347, 346, 22, 54, 340, 342, 339, 73, 71, 45,
/* 380 */ 102, 801, 117, 800, 115, 118, 26, 534, 188, 691, /* 380 */ 68, 330, 215, 329, 328, 327, 326, 325, 65, 206,
/* 390 */ 208, 134, 24, 217, 688, 218, 864, 72, 863, 861, /* 390 */ 204, 7, 324, 15, 4, 298, 376, 277, 6, 5,
/* 400 */ 121, 95, 709, 25, 23, 135, 678, 81, 558, 676, /* 400 */ 105, 260, 20, 19, 268, 193, 160, 264, 104, 185,
/* 410 */ 83, 191, 84, 674, 158, 673, 195, 177, 130, 671, /* 410 */ 55, 253, 252, 251, 59, 182, 181, 250, 179, 189,
/* 420 */ 52, 670, 770, 669, 49, 44, 668, 107, 108, 200, /* 420 */ 249, 178, 2, 1, 96, 393, 243, 95, 94, 386,
/* 430 */ 667, 194, 659, 132, 665, 663, 198, 196, 192, 661, /* 430 */ 232, 123, 127, 128, 305, 228, 230, 126, 231, 233,
/* 440 */ 28, 57, 58, 802, 216, 77, 227, 228, 229, 230, /* 440 */ 124, 125, 229, 152, 122, 53, 67, 205, 216, 344,
/* 450 */ 231, 232, 205, 233, 242, 53, 637, 178, 179, 636, /* 450 */ 64, 26, 114, 227, 28, 113, 77, 192, 198, 194,
/* 460 */ 152, 64, 67, 182, 181, 672, 635, 628, 94, 96, /* 460 */ 44, 196, 273, 52, 49, 195, 276, 58, 57, 399,
/* 470 */ 185, 666, 124, 55, 123, 710, 122, 125, 126, 128, /* 470 */ 396, 647, 395, 132, 394, 391, 390, 112, 389, 111,
/* 480 */ 127, 1, 2, 189, 755, 543, 59, 560, 111, 109, /* 480 */ 388, 110, 387, 109, 130, 108, 269, 188, 200, 177,
/* 490 */ 112, 110, 104, 113, 114, 160, 19, 193, 5, 565, /* 490 */ 107, 647, 385, 308, 234, 115, 304, 384, 84, 254,
/* 500 */ 105, 6, 606, 4, 20, 15, 204, 7, 608, 65, /* 500 */ 224, 647, 647, 158, 191, 647, 647, 647, 647, 272,
/* 510 */ 206, 492, 488, 486, 485, 484, 481, 455, 215, 68, /* 510 */ 647, 83, 647, 169, 383, 303, 647, 647, 647, 302,
/* 520 */ 45, 71, 22, 519, 73, 518, 516, 54, 476, 474, /* 520 */ 168, 647, 301, 647, 81, 382, 135, 647, 23, 25,
/* 530 */ 466, 472, 468, 470, 464, 462, 491, 490, 489, 487, /* 530 */ 345, 121, 336, 335, 72, 334, 218, 647, 332, 217,
/* 540 */ 483, 482, 46, 453, 426, 424, 641, 640, 640, 640, /* 540 */ 24, 381, 134, 208, 309, 118, 117, 102, 262, 261,
/* 550 */ 640, 640, 640, 640, 640, 640, 640, 640, 98, 99, /* 550 */ 259, 647, 647, 647, 647, 647, 647, 647, 647, 647,
/* 560 */ 647, 647, 647, 647, 647, 647, 647, 647, 647, 647,
/* 570 */ 647, 647, 647, 647, 647, 647, 647, 647, 647, 647,
/* 580 */ 647, 647, 647, 647, 647, 647, 647, 300, 647, 647,
/* 590 */ 647, 647, 647, 647, 647, 647, 647, 647, 647, 647,
/* 600 */ 647, 647, 647, 647, 647, 647, 647, 647, 647, 647,
/* 610 */ 647, 647, 647, 647, 647, 647, 647, 647, 647, 647,
/* 620 */ 647, 647, 647, 333, 647, 647, 647, 647, 647, 647,
/* 630 */ 647, 647, 647, 647, 647, 647, 647, 647, 647, 139,
/* 640 */ 647, 647, 647, 647, 647, 647, 146, 647, 647, 136,
/* 650 */ 147, 149, 148, 144, 143, 141, 140, 155, 154, 283,
/* 660 */ 282, 281, 142, 137, 11,
}; };
static const YYCODETYPE yy_lookahead[] = { static const YYCODETYPE yy_lookahead[] = {
/* 0 */ 225, 1, 259, 228, 229, 206, 207, 1, 233, 9, /* 0 */ 1, 64, 65, 66, 67, 68, 5, 63, 9, 104,
/* 10 */ 235, 236, 237, 13, 14, 9, 16, 17, 208, 209, /* 10 */ 127, 74, 13, 14, 109, 16, 17, 134, 135, 20,
/* 20 */ 20, 21, 259, 259, 24, 25, 26, 27, 28, 209, /* 20 */ 21, 72, 73, 24, 25, 26, 27, 28, 129, 130,
/* 30 */ 5, 268, 269, 33, 34, 209, 259, 37, 38, 39, /* 30 */ 208, 209, 33, 34, 33, 34, 37, 38, 39, 13,
/* 40 */ 13, 14, 243, 16, 17, 268, 269, 20, 21, 243, /* 40 */ 14, 99, 16, 17, 102, 103, 20, 21, 211, 211,
/* 50 */ 209, 24, 25, 26, 27, 28, 257, 226, 33, 34, /* 50 */ 24, 25, 26, 27, 28, 60, 61, 62, 0, 33,
/* 60 */ 33, 34, 259, 257, 37, 38, 39, 13, 14, 1, /* 60 */ 34, 129, 130, 37, 38, 39, 13, 14, 246, 16,
/* 70 */ 16, 17, 269, 259, 20, 21, 245, 9, 24, 25, /* 70 */ 17, 58, 128, 20, 21, 131, 132, 24, 25, 26,
/* 80 */ 26, 27, 28, 263, 72, 265, 260, 33, 34, 78, /* 80 */ 27, 28, 260, 245, 100, 247, 33, 34, 104, 1,
/* 90 */ 78, 37, 38, 39, 209, 25, 26, 27, 28, 37, /* 90 */ 37, 38, 39, 14, 100, 16, 17, 9, 104, 20,
/* 100 */ 38, 39, 102, 33, 34, 259, 265, 37, 38, 39, /* 100 */ 21, 264, 103, 24, 25, 26, 27, 28, 37, 38,
/* 110 */ 209, 209, 209, 45, 46, 47, 48, 49, 50, 51, /* 110 */ 39, 227, 33, 34, 230, 231, 37, 38, 39, 235,
/* 120 */ 52, 53, 54, 55, 56, 57, 99, 242, 14, 244, /* 120 */ 100, 237, 238, 239, 104, 241, 100, 59, 64, 65,
/* 130 */ 16, 17, 209, 103, 20, 21, 209, 246, 24, 25, /* 130 */ 66, 67, 68, 45, 46, 47, 48, 49, 50, 51,
/* 140 */ 26, 27, 28, 242, 242, 244, 244, 33, 34, 258, /* 140 */ 52, 53, 54, 55, 56, 57, 5, 262, 7, 211,
/* 150 */ 120, 37, 38, 39, 98, 16, 17, 101, 102, 20, /* 150 */ 16, 17, 104, 21, 20, 21, 271, 272, 24, 25,
/* 160 */ 21, 209, 239, 24, 25, 26, 27, 28, 265, 242, /* 160 */ 26, 27, 28, 211, 5, 59, 7, 33, 34, 121,
/* 170 */ 267, 244, 33, 34, 226, 259, 37, 38, 39, 85, /* 170 */ 15, 37, 38, 39, 227, 21, 229, 230, 231, 232,
/* 180 */ 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, /* 180 */ 233, 234, 235, 236, 237, 238, 239, 240, 241, 85,
/* 190 */ 96, 97, 225, 245, 227, 228, 229, 230, 231, 232, /* 190 */ 86, 87, 88, 89, 90, 91, 92, 93, 94, 95,
/* 200 */ 233, 234, 235, 236, 237, 238, 1, 2, 44, 226, /* 200 */ 96, 97, 98, 1, 2, 99, 268, 5, 270, 7,
/* 210 */ 5, 98, 7, 261, 9, 99, 1, 2, 105, 103, /* 210 */ 5, 9, 7, 1, 2, 104, 72, 5, 266, 7,
/* 220 */ 5, 5, 7, 7, 9, 33, 34, 63, 245, 37, /* 220 */ 268, 9, 78, 1, 2, 44, 5, 5, 7, 7,
/* 230 */ 38, 39, 209, 69, 70, 71, 115, 116, 33, 34, /* 230 */ 104, 9, 211, 100, 123, 33, 34, 33, 34, 37,
/* 240 */ 63, 77, 37, 64, 65, 66, 67, 68, 33, 34, /* 240 */ 107, 37, 38, 39, 63, 33, 34, 1, 5, 37,
/* 250 */ 1, 2, 37, 74, 5, 209, 7, 98, 9, 60, /* 250 */ 69, 70, 71, 100, 76, 33, 34, 104, 77, 5,
/* 260 */ 61, 62, 98, 85, 105, 87, 88, 244, 213, 105, /* 260 */ 105, 25, 26, 27, 28, 5, 245, 262, 247, 33,
/* 270 */ 92, 216, 94, 95, 96, 64, 65, 66, 67, 68, /* 270 */ 34, 99, 211, 37, 38, 39, 271, 272, 106, 85,
/* 280 */ 15, 59, 33, 34, 213, 2, 126, 216, 5, 125, /* 280 */ 99, 87, 88, 37, 116, 117, 92, 106, 94, 95,
/* 290 */ 7, 259, 9, 133, 134, 5, 132, 7, 64, 65, /* 290 */ 96, 100, 98, 2, 211, 104, 5, 1, 7, 100,
/* 300 */ 66, 67, 68, 98, 127, 103, 213, 130, 131, 216, /* 300 */ 9, 99, 211, 104, 211, 9, 245, 126, 247, 100,
/* 310 */ 108, 265, 99, 98, 109, 1, 33, 34, 99, 106, /* 310 */ 211, 99, 110, 104, 133, 64, 65, 66, 67, 68,
/* 320 */ 98, 103, 103, 5, 109, 7, 99, 99, 99, 124, /* 320 */ 211, 99, 110, 249, 33, 34, 228, 125, 245, 100,
/* 330 */ 103, 103, 103, 259, 99, 128, 129, 99, 103, 124, /* 330 */ 247, 215, 110, 104, 218, 261, 215, 125, 215, 218,
/* 340 */ 122, 103, 99, 5, 259, 7, 103, 98, 128, 129, /* 340 */ 247, 218, 246, 99, 262, 228, 248, 125, 228, 211,
/* 350 */ 259, 37, 72, 73, 259, 259, 259, 259, 109, 259, /* 350 */ 106, 242, 210, 211, 272, 5, 260, 5, 5, 268,
/* 360 */ 259, 259, 259, 259, 245, 245, 240, 240, 240, 104, /* 360 */ 5, 5, 5, 5, 5, 248, 5, 268, 248, 5,
/* 370 */ 240, 240, 240, 124, 241, 240, 209, 243, 209, 209, /* 370 */ 5, 5, 104, 99, 5, 100, 5, 130, 130, 16,
/* 380 */ 209, 266, 209, 266, 247, 209, 105, 104, 243, 209, /* 380 */ 72, 76, 15, 5, 5, 5, 5, 5, 72, 101,
/* 390 */ 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, /* 390 */ 101, 99, 9, 99, 99, 105, 105, 100, 115, 115,
/* 400 */ 209, 59, 209, 209, 209, 209, 209, 209, 109, 209, /* 400 */ 99, 263, 104, 104, 100, 99, 1, 100, 99, 127,
/* 410 */ 209, 262, 209, 209, 262, 209, 262, 209, 209, 209, /* 410 */ 108, 100, 86, 5, 104, 5, 136, 5, 5, 107,
/* 420 */ 119, 209, 256, 209, 121, 118, 209, 255, 254, 113, /* 420 */ 5, 136, 214, 217, 213, 212, 75, 59, 213, 212,
/* 430 */ 209, 111, 209, 209, 209, 209, 117, 112, 110, 209, /* 430 */ 81, 224, 222, 219, 246, 49, 82, 221, 53, 79,
/* 440 */ 123, 210, 210, 210, 75, 84, 83, 49, 80, 82, /* 440 */ 220, 223, 80, 212, 225, 212, 216, 212, 75, 226,
/* 450 */ 53, 81, 210, 79, 75, 210, 5, 135, 5, 5, /* 450 */ 216, 106, 251, 83, 124, 252, 84, 111, 118, 112,
/* 460 */ 210, 214, 214, 5, 135, 210, 5, 86, 211, 211, /* 460 */ 119, 113, 212, 120, 122, 265, 269, 212, 212, 211,
/* 470 */ 126, 210, 218, 107, 222, 224, 223, 221, 219, 217, /* 470 */ 211, 273, 211, 211, 211, 211, 211, 253, 211, 254,
/* 480 */ 220, 215, 212, 106, 243, 99, 103, 99, 251, 253, /* 480 */ 211, 255, 211, 256, 211, 257, 110, 246, 114, 211,
/* 490 */ 250, 252, 98, 249, 248, 1, 103, 98, 114, 99, /* 490 */ 258, 273, 211, 244, 78, 250, 259, 211, 211, 246,
/* 500 */ 98, 114, 99, 98, 103, 98, 100, 98, 104, 72, /* 500 */ 243, 273, 273, 265, 265, 273, 273, 273, 273, 269,
/* 510 */ 100, 9, 5, 5, 5, 5, 5, 76, 15, 72, /* 510 */ 273, 211, 273, 243, 211, 243, 273, 273, 273, 243,
/* 520 */ 16, 129, 103, 5, 129, 5, 99, 98, 5, 5, /* 520 */ 243, 273, 243, 273, 211, 211, 211, 273, 211, 211,
/* 530 */ 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, /* 530 */ 211, 211, 211, 211, 211, 211, 211, 273, 211, 211,
/* 540 */ 5, 5, 103, 76, 59, 58, 0, 270, 270, 270, /* 540 */ 211, 248, 211, 211, 211, 211, 211, 211, 211, 211,
/* 550 */ 270, 270, 270, 270, 270, 270, 270, 270, 21, 21, /* 550 */ 211, 273, 273, 273, 273, 273, 273, 273, 273, 273,
/* 560 */ 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, /* 560 */ 273, 273, 273, 273, 273, 273, 273, 273, 273, 273,
/* 570 */ 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, /* 570 */ 273, 273, 273, 273, 273, 273, 273, 273, 273, 273,
/* 580 */ 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, /* 580 */ 273, 273, 273, 273, 273, 273, 273, 243, 273, 273,
/* 590 */ 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, /* 590 */ 273, 273, 273, 273, 273, 273, 273, 273, 273, 273,
/* 600 */ 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, /* 600 */ 273, 273, 273, 273, 273, 273, 273, 273, 273, 273,
/* 610 */ 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, /* 610 */ 273, 273, 273, 273, 273, 273, 273, 273, 273, 273,
/* 620 */ 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, /* 620 */ 273, 273, 273, 248, 273, 273, 273, 273, 273, 273,
/* 630 */ 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, /* 630 */ 273, 273, 273, 273, 273, 273, 273, 273, 273, 262,
/* 640 */ 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, /* 640 */ 273, 273, 273, 273, 273, 273, 262, 273, 273, 262,
/* 650 */ 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, /* 650 */ 262, 262, 262, 262, 262, 262, 262, 262, 262, 262,
/* 660 */ 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, /* 660 */ 262, 262, 262, 262, 262,
/* 670 */ 270, 270, 270, 270, 270, 270, 270, 270, 270, 270,
/* 680 */ 270, 270, 270, 270, 270, 270, 270, 270, 270, 270,
/* 690 */ 270, 270, 270, 270, 270, 270, 270, 270, 270, 270,
/* 700 */ 270, 270, 270, 270, 270, 270, 270, 270, 270, 270,
/* 710 */ 270, 270, 270, 270, 270, 270, 270, 270, 270, 270,
/* 720 */ 270, 270, 270, 270, 270, 270, 270, 270, 270, 270,
/* 730 */ 270, 270, 270, 270, 270, 270, 270, 270, 270, 270,
/* 740 */ 270, 270, 270, 270, 270, 270, 270, 270, 270, 270,
/* 750 */ 270, 270, 270, 270, 270, 270, 270, 270, 270, 270,
/* 760 */ 270, 270, 270, 270, 270, 270,
}; };
#define YY_SHIFT_COUNT (247) #define YY_SHIFT_USE_DFLT (-118)
#define YY_SHIFT_MIN (0) #define YY_SHIFT_COUNT (248)
#define YY_SHIFT_MAX (546) #define YY_SHIFT_MIN (-117)
static const unsigned short int yy_shift_ofst[] = { #define YY_SHIFT_MAX (416)
/* 0 */ 164, 94, 178, 205, 249, 6, 6, 6, 6, 6, static const short yy_shift_ofst[] = {
/* 10 */ 6, 0, 68, 249, 283, 283, 283, 113, 6, 6, /* 0 */ 181, 104, 194, 212, 222, 296, 296, 296, 296, 296,
/* 20 */ 6, 6, 6, 12, 11, 11, 560, 215, 249, 249, /* 10 */ 296, -1, 88, 222, 291, 291, 291, 244, 296, 296,
/* 30 */ 249, 249, 249, 249, 249, 249, 249, 249, 249, 249, /* 20 */ 296, 296, 296, 144, 416, 416, -118, 202, 222, 222,
/* 40 */ 249, 249, 249, 249, 249, 283, 283, 25, 25, 25, /* 30 */ 222, 222, 222, 222, 222, 222, 222, 222, 222, 222,
/* 50 */ 25, 25, 25, 56, 25, 159, 6, 6, 6, 6, /* 40 */ 222, 222, 222, 222, 222, 291, 291, 1, 1, 1,
/* 60 */ 121, 121, 202, 6, 6, 6, 6, 6, 6, 6, /* 50 */ 1, 1, 1, -58, 1, 172, 296, 296, 296, 296,
/* 70 */ 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, /* 60 */ 168, 168, -95, 296, 296, 296, 296, 296, 296, 296,
/* 80 */ 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, /* 70 */ 296, 296, 296, 296, 296, 296, 296, 296, 296, 296,
/* 90 */ 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, /* 80 */ 296, 296, 296, 296, 296, 296, 296, 296, 296, 296,
/* 100 */ 281, 342, 342, 299, 299, 299, 342, 301, 303, 307, /* 90 */ 296, 296, 296, 296, 296, 296, 296, 296, 296, 296,
/* 110 */ 316, 319, 325, 320, 328, 317, 281, 342, 342, 369, /* 100 */ 345, 368, 368, 376, 376, 376, 368, 343, 342, 341,
/* 120 */ 369, 342, 361, 363, 398, 368, 367, 397, 370, 374, /* 110 */ 374, 340, 348, 347, 346, 330, 345, 368, 368, 373,
/* 130 */ 342, 379, 342, 379, 560, 560, 27, 54, 54, 54, /* 120 */ 373, 368, 372, 370, 386, 362, 354, 385, 349, 360,
/* 140 */ 114, 139, 70, 70, 70, 179, 192, 192, 192, 192, /* 130 */ 368, 351, 368, 351, -118, -118, 26, 53, 53, 53,
/* 150 */ 211, 234, 177, 160, 62, 62, 199, 213, 116, 219, /* 140 */ 79, 134, 236, 236, 236, -63, 204, 204, 204, 204,
/* 160 */ 227, 228, 229, 216, 290, 314, 222, 265, 218, 30, /* 150 */ 251, 64, -56, -117, 71, 71, -5, 133, 229, 209,
/* 170 */ 235, 238, 243, 207, 220, 318, 338, 280, 451, 322, /* 160 */ 199, 191, 153, 221, 205, 246, 106, 155, 111, 48,
/* 180 */ 453, 454, 329, 458, 461, 381, 344, 377, 386, 366, /* 170 */ 20, -6, -16, -68, -101, 159, 141, -51, 415, 285,
/* 190 */ 383, 388, 394, 494, 399, 400, 402, 393, 384, 401, /* 180 */ 413, 412, 280, 410, 408, 326, 282, 312, 311, 302,
/* 200 */ 387, 403, 405, 404, 407, 406, 409, 410, 437, 502, /* 190 */ 310, 307, 309, 405, 306, 304, 301, 299, 284, 298,
/* 210 */ 507, 508, 509, 510, 511, 441, 503, 447, 504, 392, /* 200 */ 283, 297, 295, 290, 294, 289, 292, 288, 316, 383,
/* 220 */ 395, 419, 518, 520, 427, 429, 419, 523, 524, 525, /* 210 */ 382, 381, 380, 379, 378, 305, 367, 308, 363, 248,
/* 230 */ 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, /* 220 */ 247, 268, 371, 369, 275, 274, 268, 366, 365, 364,
/* 240 */ 536, 439, 467, 537, 538, 485, 487, 546, /* 230 */ 361, 359, 358, 357, 356, 355, 353, 352, 350, 260,
/* 240 */ 254, 243, 126, 178, 154, 132, 68, 13, 58,
}; };
#define YY_REDUCE_USE_DFLT (-179)
#define YY_REDUCE_COUNT (135) #define YY_REDUCE_COUNT (135)
#define YY_REDUCE_MIN (-257) #define YY_REDUCE_MIN (-178)
#define YY_REDUCE_MAX (270) #define YY_REDUCE_MAX (402)
static const short yy_reduce_ofst[] = { static const short yy_reduce_ofst[] = {
/* 0 */ -201, -33, -225, -237, -223, -97, -180, -115, -99, -98, /* 0 */ -178, -53, -116, 5, -115, -62, -48, 83, 61, 21,
/* 10 */ -73, -174, -190, -197, -169, -52, -17, -194, -48, -159, /* 10 */ -162, 138, 142, 82, 120, 117, 98, 96, -163, 99,
/* 20 */ 46, -77, 23, 55, 71, 93, -109, -257, -236, -186, /* 20 */ 91, 109, 93, 123, 121, 116, 74, 402, 401, 400,
/* 30 */ -154, -84, 32, 74, 85, 91, 95, 96, 97, 98, /* 30 */ 399, 398, 397, 396, 395, 394, 393, 392, 391, 390,
/* 40 */ 100, 101, 102, 103, 104, 119, 120, 126, 127, 128, /* 40 */ 389, 388, 387, 384, 377, 375, 293, 344, 279, 277,
/* 50 */ 130, 131, 132, 133, 135, 134, 167, 169, 170, 171, /* 50 */ 276, 272, 270, 249, 257, 253, 339, 338, 337, 336,
/* 60 */ 115, 117, 137, 173, 176, 180, 181, 182, 183, 184, /* 60 */ 240, 197, 245, 335, 334, 333, 332, 331, 329, 328,
/* 70 */ 185, 186, 187, 188, 189, 190, 191, 193, 194, 195, /* 70 */ 327, 325, 324, 323, 322, 321, 320, 319, 318, 317,
/* 80 */ 196, 197, 198, 200, 201, 203, 204, 206, 208, 209, /* 80 */ 315, 314, 313, 303, 300, 287, 286, 281, 278, 273,
/* 90 */ 210, 212, 214, 217, 221, 223, 224, 225, 226, 230, /* 90 */ 271, 269, 267, 265, 264, 263, 262, 261, 259, 258,
/* 100 */ 145, 231, 232, 149, 152, 154, 233, 166, 172, 174, /* 100 */ 241, 256, 255, 239, 238, 200, 250, 237, 232, 228,
/* 110 */ 236, 239, 237, 240, 244, 246, 241, 242, 245, 247, /* 110 */ 227, 226, 225, 224, 203, 201, 188, 235, 233, 234,
/* 120 */ 248, 250, 251, 253, 252, 254, 256, 259, 260, 262, /* 120 */ 230, 231, 223, 219, 207, 220, 218, 216, 210, 214,
/* 130 */ 255, 257, 261, 258, 266, 270, /* 130 */ 217, 215, 213, 211, 206, 208,
}; };
static const YYACTIONTYPE yy_default[] = { static const YYACTIONTYPE yy_default[] = {
/* 0 */ 638, 690, 679, 858, 858, 638, 638, 638, 638, 638, /* 0 */ 645, 463, 452, 634, 634, 645, 645, 645, 645, 645,
/* 10 */ 638, 783, 656, 858, 638, 638, 638, 638, 638, 638, /* 10 */ 645, 559, 429, 634, 645, 645, 645, 645, 645, 645,
/* 20 */ 638, 638, 638, 692, 692, 692, 778, 638, 638, 638, /* 20 */ 645, 645, 645, 465, 465, 465, 554, 645, 645, 645,
/* 30 */ 638, 638, 638, 638, 638, 638, 638, 638, 638, 638, /* 30 */ 645, 645, 645, 645, 645, 645, 645, 645, 645, 645,
/* 40 */ 638, 638, 638, 638, 638, 638, 638, 638, 638, 638, /* 40 */ 645, 645, 645, 645, 645, 645, 645, 645, 645, 645,
/* 50 */ 638, 638, 638, 638, 638, 638, 638, 785, 787, 638, /* 50 */ 645, 645, 645, 645, 645, 645, 645, 561, 563, 645,
/* 60 */ 805, 805, 776, 638, 638, 638, 638, 638, 638, 638, /* 60 */ 581, 581, 552, 645, 645, 645, 645, 645, 645, 645,
/* 70 */ 638, 638, 638, 638, 638, 638, 638, 638, 638, 638, /* 70 */ 645, 645, 645, 645, 645, 645, 645, 645, 645, 645,
/* 80 */ 638, 677, 638, 675, 638, 638, 638, 638, 638, 638, /* 80 */ 645, 450, 645, 448, 645, 645, 645, 645, 645, 645,
/* 90 */ 638, 638, 638, 638, 638, 638, 638, 664, 638, 638, /* 90 */ 645, 645, 645, 645, 645, 645, 645, 437, 645, 645,
/* 100 */ 638, 658, 658, 638, 638, 638, 658, 812, 816, 810, /* 100 */ 645, 431, 431, 645, 645, 645, 431, 588, 592, 586,
/* 110 */ 798, 806, 797, 793, 792, 820, 638, 658, 658, 687, /* 110 */ 574, 582, 573, 569, 568, 596, 645, 431, 431, 460,
/* 120 */ 687, 658, 708, 706, 704, 696, 702, 698, 700, 694, /* 120 */ 460, 431, 481, 479, 477, 469, 475, 471, 473, 467,
/* 130 */ 658, 685, 658, 685, 724, 738, 638, 821, 857, 811, /* 130 */ 431, 458, 431, 458, 498, 513, 645, 597, 633, 587,
/* 140 */ 847, 846, 853, 845, 844, 638, 840, 841, 843, 842, /* 140 */ 623, 622, 629, 621, 620, 645, 616, 617, 619, 618,
/* 150 */ 638, 638, 638, 638, 849, 848, 638, 638, 638, 638, /* 150 */ 645, 645, 645, 645, 625, 624, 645, 645, 645, 645,
/* 160 */ 638, 638, 638, 638, 638, 638, 823, 638, 817, 813, /* 160 */ 645, 645, 645, 645, 645, 645, 599, 645, 593, 589,
/* 170 */ 638, 638, 638, 638, 638, 638, 638, 638, 638, 638, /* 170 */ 645, 645, 645, 645, 645, 645, 645, 645, 645, 645,
/* 180 */ 638, 638, 638, 638, 638, 638, 638, 775, 638, 638, /* 180 */ 645, 645, 645, 645, 645, 645, 645, 551, 645, 645,
/* 190 */ 784, 638, 638, 638, 638, 638, 638, 807, 638, 799, /* 190 */ 560, 645, 645, 645, 645, 645, 645, 583, 645, 575,
/* 200 */ 638, 638, 638, 638, 638, 638, 638, 752, 638, 638, /* 200 */ 645, 645, 645, 645, 645, 645, 645, 528, 645, 645,
/* 210 */ 638, 638, 638, 638, 638, 638, 638, 638, 638, 638, /* 210 */ 645, 645, 645, 645, 645, 645, 645, 645, 645, 645,
/* 220 */ 638, 862, 638, 638, 638, 746, 860, 638, 638, 638, /* 220 */ 645, 638, 645, 645, 645, 522, 636, 645, 645, 645,
/* 230 */ 638, 638, 638, 638, 638, 638, 638, 638, 638, 638, /* 230 */ 645, 645, 645, 645, 645, 645, 645, 645, 645, 645,
/* 240 */ 638, 711, 638, 662, 660, 638, 654, 638, /* 240 */ 645, 645, 484, 645, 435, 433, 645, 427, 645, 644,
/* 250 */ 643, 642, 635, 550, 549, 548, 547, 556, 558, 557,
/* 260 */ 555, 562, 564, 553, 567, 566, 571, 570, 572, 565,
/* 270 */ 585, 584, 577, 578, 580, 579, 576, 613, 631, 632,
/* 280 */ 630, 628, 627, 626, 612, 611, 610, 609, 608, 605,
/* 290 */ 607, 604, 606, 603, 602, 601, 600, 598, 615, 614,
/* 300 */ 595, 594, 591, 590, 546, 531, 530, 529, 527, 464,
/* 310 */ 512, 511, 510, 509, 508, 507, 506, 505, 504, 503,
/* 320 */ 502, 501, 500, 499, 496, 492, 490, 489, 488, 485,
/* 330 */ 459, 462, 461, 641, 640, 639, 637, 533, 534, 526,
/* 340 */ 525, 524, 523, 532, 483, 482, 480, 478, 470, 476,
/* 350 */ 472, 474, 468, 466, 454, 453, 521, 520, 519, 518,
/* 360 */ 517, 516, 515, 514, 497, 495, 494, 493, 491, 487,
/* 370 */ 486, 536, 545, 544, 543, 542, 541, 540, 539, 538,
/* 380 */ 537, 535, 451, 449, 447, 446, 445, 444, 443, 442,
/* 390 */ 441, 440, 457, 439, 432, 438, 436, 456, 455, 434,
/* 400 */ 430, 428, 426, 425, 424, 423, 422, 421, 420, 419,
/* 410 */ 418, 417, 416, 415,
}; };
/********** End of lemon-generated parsing tables *****************************/
/* The next table maps tokens (terminal symbols) into fallback tokens. /* The next table maps tokens into fallback tokens. If a construct
** If a construct like the following: ** like the following:
** **
** %fallback ID X Y Z. ** %fallback ID X Y Z.
** **
...@@ -439,10 +410,6 @@ static const YYACTIONTYPE yy_default[] = { ...@@ -439,10 +410,6 @@ static const YYACTIONTYPE yy_default[] = {
** and Z. Whenever one of the tokens X, Y, or Z is input to the parser ** and Z. Whenever one of the tokens X, Y, or Z is input to the parser
** but it does not parse, the type of the token is changed to ID and ** but it does not parse, the type of the token is changed to ID and
** the parse is retried before an error is thrown. ** the parse is retried before an error is thrown.
**
** This feature can be used, for example, to cause some keywords in a language
** to revert to identifiers if they keyword does not apply in the context where
** it appears.
*/ */
#ifdef YYFALLBACK #ifdef YYFALLBACK
static const YYCODETYPE yyFallback[] = { static const YYCODETYPE yyFallback[] = {
...@@ -544,6 +511,7 @@ static const YYCODETYPE yyFallback[] = { ...@@ -544,6 +511,7 @@ static const YYCODETYPE yyFallback[] = {
0, /* FSYNC => nothing */ 0, /* FSYNC => nothing */
0, /* COMP => nothing */ 0, /* COMP => nothing */
0, /* PRECISION => nothing */ 0, /* PRECISION => nothing */
0, /* UPDATE => nothing */
0, /* LP => nothing */ 0, /* LP => nothing */
0, /* RP => nothing */ 0, /* RP => nothing */
0, /* TAGS => nothing */ 0, /* TAGS => nothing */
...@@ -666,13 +634,9 @@ static const YYCODETYPE yyFallback[] = { ...@@ -666,13 +634,9 @@ static const YYCODETYPE yyFallback[] = {
** + The semantic value stored at this level of the stack. This is ** + The semantic value stored at this level of the stack. This is
** the information used by the action routines in the grammar. ** the information used by the action routines in the grammar.
** It is sometimes called the "minor" token. ** It is sometimes called the "minor" token.
**
** After the "shift" half of a SHIFTREDUCE action, the stateno field
** actually contains the reduce action for the second half of the
** SHIFTREDUCE.
*/ */
struct yyStackEntry { struct yyStackEntry {
YYACTIONTYPE stateno; /* The state-number, or reduce action in SHIFTREDUCE */ YYACTIONTYPE stateno; /* The state-number */
YYCODETYPE major; /* The major token value. This is the code YYCODETYPE major; /* The major token value. This is the code
** number for the token at this stack level */ ** number for the token at this stack level */
YYMINORTYPE minor; /* The user-supplied minor token value. This YYMINORTYPE minor; /* The user-supplied minor token value. This
...@@ -683,22 +647,17 @@ typedef struct yyStackEntry yyStackEntry; ...@@ -683,22 +647,17 @@ typedef struct yyStackEntry yyStackEntry;
/* The state of the parser is completely contained in an instance of /* The state of the parser is completely contained in an instance of
** the following structure */ ** the following structure */
struct yyParser { struct yyParser {
yyStackEntry *yytos; /* Pointer to top element of the stack */ int yyidx; /* Index of top element in stack */
#ifdef YYTRACKMAXSTACKDEPTH #ifdef YYTRACKMAXSTACKDEPTH
int yyhwm; /* High-water mark of the stack */ int yyidxMax; /* Maximum value of yyidx */
#endif #endif
#ifndef YYNOERRORRECOVERY
int yyerrcnt; /* Shifts left before out of the error */ int yyerrcnt; /* Shifts left before out of the error */
#endif
ParseARG_SDECL /* A place to hold %extra_argument */ ParseARG_SDECL /* A place to hold %extra_argument */
ParseCTX_SDECL /* A place to hold %extra_context */
#if YYSTACKDEPTH<=0 #if YYSTACKDEPTH<=0
int yystksz; /* Current side of the stack */ int yystksz; /* Current side of the stack */
yyStackEntry *yystack; /* The parser's stack */ yyStackEntry *yystack; /* The parser's stack */
yyStackEntry yystk0; /* First stack entry */
#else #else
yyStackEntry yystack[YYSTACKDEPTH]; /* The parser's stack */ yyStackEntry yystack[YYSTACKDEPTH]; /* The parser's stack */
yyStackEntry *yystackEnd; /* Last entry in the stack */
#endif #endif
}; };
typedef struct yyParser yyParser; typedef struct yyParser yyParser;
...@@ -735,282 +694,81 @@ void ParseTrace(FILE *TraceFILE, char *zTracePrompt){ ...@@ -735,282 +694,81 @@ void ParseTrace(FILE *TraceFILE, char *zTracePrompt){
} }
#endif /* NDEBUG */ #endif /* NDEBUG */
#if defined(YYCOVERAGE) || !defined(NDEBUG) #ifndef NDEBUG
/* For tracing shifts, the names of all terminals and nonterminals /* For tracing shifts, the names of all terminals and nonterminals
** are required. The following table supplies these names */ ** are required. The following table supplies these names */
static const char *const yyTokenName[] = { static const char *const yyTokenName[] = {
/* 0 */ "$", "$", "ID", "BOOL", "TINYINT",
/* 1 */ "ID", "SMALLINT", "INTEGER", "BIGINT", "FLOAT",
/* 2 */ "BOOL", "DOUBLE", "STRING", "TIMESTAMP", "BINARY",
/* 3 */ "TINYINT", "NCHAR", "OR", "AND", "NOT",
/* 4 */ "SMALLINT", "EQ", "NE", "ISNULL", "NOTNULL",
/* 5 */ "INTEGER", "IS", "LIKE", "GLOB", "BETWEEN",
/* 6 */ "BIGINT", "IN", "GT", "GE", "LT",
/* 7 */ "FLOAT", "LE", "BITAND", "BITOR", "LSHIFT",
/* 8 */ "DOUBLE", "RSHIFT", "PLUS", "MINUS", "DIVIDE",
/* 9 */ "STRING", "TIMES", "STAR", "SLASH", "REM",
/* 10 */ "TIMESTAMP", "CONCAT", "UMINUS", "UPLUS", "BITNOT",
/* 11 */ "BINARY", "SHOW", "DATABASES", "MNODES", "DNODES",
/* 12 */ "NCHAR", "ACCOUNTS", "USERS", "MODULES", "QUERIES",
/* 13 */ "OR", "CONNECTIONS", "STREAMS", "VARIABLES", "SCORES",
/* 14 */ "AND", "GRANTS", "VNODES", "IPTOKEN", "DOT",
/* 15 */ "NOT", "TABLES", "STABLES", "VGROUPS", "DROP",
/* 16 */ "EQ", "TABLE", "DATABASE", "DNODE", "USER",
/* 17 */ "NE", "ACCOUNT", "USE", "DESCRIBE", "ALTER",
/* 18 */ "ISNULL", "PASS", "PRIVILEGE", "LOCAL", "IF",
/* 19 */ "NOTNULL", "EXISTS", "CREATE", "PPS", "TSERIES",
/* 20 */ "IS", "DBS", "STORAGE", "QTIME", "CONNS",
/* 21 */ "LIKE", "STATE", "KEEP", "CACHE", "REPLICA",
/* 22 */ "GLOB", "QUORUM", "DAYS", "MINROWS", "MAXROWS",
/* 23 */ "BETWEEN", "BLOCKS", "CTIME", "WAL", "FSYNC",
/* 24 */ "IN", "COMP", "PRECISION", "UPDATE", "LP",
/* 25 */ "GT", "RP", "TAGS", "USING", "AS",
/* 26 */ "GE", "COMMA", "NULL", "SELECT", "UNION",
/* 27 */ "LT", "ALL", "FROM", "VARIABLE", "INTERVAL",
/* 28 */ "LE", "FILL", "SLIDING", "ORDER", "BY",
/* 29 */ "BITAND", "ASC", "DESC", "GROUP", "HAVING",
/* 30 */ "BITOR", "LIMIT", "OFFSET", "SLIMIT", "SOFFSET",
/* 31 */ "LSHIFT", "WHERE", "NOW", "RESET", "QUERY",
/* 32 */ "RSHIFT", "ADD", "COLUMN", "TAG", "CHANGE",
/* 33 */ "PLUS", "SET", "KILL", "CONNECTION", "STREAM",
/* 34 */ "MINUS", "COLON", "ABORT", "AFTER", "ATTACH",
/* 35 */ "DIVIDE", "BEFORE", "BEGIN", "CASCADE", "CLUSTER",
/* 36 */ "TIMES", "CONFLICT", "COPY", "DEFERRED", "DELIMITERS",
/* 37 */ "STAR", "DETACH", "EACH", "END", "EXPLAIN",
/* 38 */ "SLASH", "FAIL", "FOR", "IGNORE", "IMMEDIATE",
/* 39 */ "REM", "INITIALLY", "INSTEAD", "MATCH", "KEY",
/* 40 */ "CONCAT", "OF", "RAISE", "REPLACE", "RESTRICT",
/* 41 */ "UMINUS", "ROW", "STATEMENT", "TRIGGER", "VIEW",
/* 42 */ "UPLUS", "COUNT", "SUM", "AVG", "MIN",
/* 43 */ "BITNOT", "MAX", "FIRST", "LAST", "TOP",
/* 44 */ "SHOW", "BOTTOM", "STDDEV", "PERCENTILE", "APERCENTILE",
/* 45 */ "DATABASES", "LEASTSQUARES", "HISTOGRAM", "DIFF", "SPREAD",
/* 46 */ "MNODES", "TWA", "INTERP", "LAST_ROW", "RATE",
/* 47 */ "DNODES", "IRATE", "SUM_RATE", "SUM_IRATE", "AVG_RATE",
/* 48 */ "ACCOUNTS", "AVG_IRATE", "TBID", "SEMI", "NONE",
/* 49 */ "USERS", "PREV", "LINEAR", "IMPORT", "METRIC",
/* 50 */ "MODULES", "TBNAME", "JOIN", "METRICS", "STABLE",
/* 51 */ "QUERIES", "INSERT", "INTO", "VALUES", "error",
/* 52 */ "CONNECTIONS", "program", "cmd", "dbPrefix", "ids",
/* 53 */ "STREAMS", "cpxName", "ifexists", "alter_db_optr", "acct_optr",
/* 54 */ "VARIABLES", "ifnotexists", "db_optr", "pps", "tseries",
/* 55 */ "SCORES", "dbs", "streams", "storage", "qtime",
/* 56 */ "GRANTS", "users", "conns", "state", "keep",
/* 57 */ "VNODES", "tagitemlist", "cache", "replica", "quorum",
/* 58 */ "IPTOKEN", "days", "minrows", "maxrows", "blocks",
/* 59 */ "DOT", "ctime", "wal", "fsync", "comp",
/* 60 */ "TABLES", "prec", "update", "typename", "signed",
/* 61 */ "STABLES", "create_table_args", "columnlist", "select", "column",
/* 62 */ "VGROUPS", "tagitem", "selcollist", "from", "where_opt",
/* 63 */ "DROP", "interval_opt", "fill_opt", "sliding_opt", "groupby_opt",
/* 64 */ "TABLE", "orderby_opt", "having_opt", "slimit_opt", "limit_opt",
/* 65 */ "DATABASE", "union", "sclp", "expr", "as",
/* 66 */ "DNODE", "tablelist", "tmvar", "sortlist", "sortitem",
/* 67 */ "USER", "item", "sortorder", "grouplist", "exprlist",
/* 68 */ "ACCOUNT", "expritem",
/* 69 */ "USE",
/* 70 */ "DESCRIBE",
/* 71 */ "ALTER",
/* 72 */ "PASS",
/* 73 */ "PRIVILEGE",
/* 74 */ "LOCAL",
/* 75 */ "IF",
/* 76 */ "EXISTS",
/* 77 */ "CREATE",
/* 78 */ "PPS",
/* 79 */ "TSERIES",
/* 80 */ "DBS",
/* 81 */ "STORAGE",
/* 82 */ "QTIME",
/* 83 */ "CONNS",
/* 84 */ "STATE",
/* 85 */ "KEEP",
/* 86 */ "CACHE",
/* 87 */ "REPLICA",
/* 88 */ "QUORUM",
/* 89 */ "DAYS",
/* 90 */ "MINROWS",
/* 91 */ "MAXROWS",
/* 92 */ "BLOCKS",
/* 93 */ "CTIME",
/* 94 */ "WAL",
/* 95 */ "FSYNC",
/* 96 */ "COMP",
/* 97 */ "PRECISION",
/* 98 */ "LP",
/* 99 */ "RP",
/* 100 */ "TAGS",
/* 101 */ "USING",
/* 102 */ "AS",
/* 103 */ "COMMA",
/* 104 */ "NULL",
/* 105 */ "SELECT",
/* 106 */ "UNION",
/* 107 */ "ALL",
/* 108 */ "FROM",
/* 109 */ "VARIABLE",
/* 110 */ "INTERVAL",
/* 111 */ "FILL",
/* 112 */ "SLIDING",
/* 113 */ "ORDER",
/* 114 */ "BY",
/* 115 */ "ASC",
/* 116 */ "DESC",
/* 117 */ "GROUP",
/* 118 */ "HAVING",
/* 119 */ "LIMIT",
/* 120 */ "OFFSET",
/* 121 */ "SLIMIT",
/* 122 */ "SOFFSET",
/* 123 */ "WHERE",
/* 124 */ "NOW",
/* 125 */ "RESET",
/* 126 */ "QUERY",
/* 127 */ "ADD",
/* 128 */ "COLUMN",
/* 129 */ "TAG",
/* 130 */ "CHANGE",
/* 131 */ "SET",
/* 132 */ "KILL",
/* 133 */ "CONNECTION",
/* 134 */ "STREAM",
/* 135 */ "COLON",
/* 136 */ "ABORT",
/* 137 */ "AFTER",
/* 138 */ "ATTACH",
/* 139 */ "BEFORE",
/* 140 */ "BEGIN",
/* 141 */ "CASCADE",
/* 142 */ "CLUSTER",
/* 143 */ "CONFLICT",
/* 144 */ "COPY",
/* 145 */ "DEFERRED",
/* 146 */ "DELIMITERS",
/* 147 */ "DETACH",
/* 148 */ "EACH",
/* 149 */ "END",
/* 150 */ "EXPLAIN",
/* 151 */ "FAIL",
/* 152 */ "FOR",
/* 153 */ "IGNORE",
/* 154 */ "IMMEDIATE",
/* 155 */ "INITIALLY",
/* 156 */ "INSTEAD",
/* 157 */ "MATCH",
/* 158 */ "KEY",
/* 159 */ "OF",
/* 160 */ "RAISE",
/* 161 */ "REPLACE",
/* 162 */ "RESTRICT",
/* 163 */ "ROW",
/* 164 */ "STATEMENT",
/* 165 */ "TRIGGER",
/* 166 */ "VIEW",
/* 167 */ "COUNT",
/* 168 */ "SUM",
/* 169 */ "AVG",
/* 170 */ "MIN",
/* 171 */ "MAX",
/* 172 */ "FIRST",
/* 173 */ "LAST",
/* 174 */ "TOP",
/* 175 */ "BOTTOM",
/* 176 */ "STDDEV",
/* 177 */ "PERCENTILE",
/* 178 */ "APERCENTILE",
/* 179 */ "LEASTSQUARES",
/* 180 */ "HISTOGRAM",
/* 181 */ "DIFF",
/* 182 */ "SPREAD",
/* 183 */ "TWA",
/* 184 */ "INTERP",
/* 185 */ "LAST_ROW",
/* 186 */ "RATE",
/* 187 */ "IRATE",
/* 188 */ "SUM_RATE",
/* 189 */ "SUM_IRATE",
/* 190 */ "AVG_RATE",
/* 191 */ "AVG_IRATE",
/* 192 */ "TBID",
/* 193 */ "SEMI",
/* 194 */ "NONE",
/* 195 */ "PREV",
/* 196 */ "LINEAR",
/* 197 */ "IMPORT",
/* 198 */ "METRIC",
/* 199 */ "TBNAME",
/* 200 */ "JOIN",
/* 201 */ "METRICS",
/* 202 */ "STABLE",
/* 203 */ "INSERT",
/* 204 */ "INTO",
/* 205 */ "VALUES",
/* 206 */ "program",
/* 207 */ "cmd",
/* 208 */ "dbPrefix",
/* 209 */ "ids",
/* 210 */ "cpxName",
/* 211 */ "ifexists",
/* 212 */ "alter_db_optr",
/* 213 */ "acct_optr",
/* 214 */ "ifnotexists",
/* 215 */ "db_optr",
/* 216 */ "pps",
/* 217 */ "tseries",
/* 218 */ "dbs",
/* 219 */ "streams",
/* 220 */ "storage",
/* 221 */ "qtime",
/* 222 */ "users",
/* 223 */ "conns",
/* 224 */ "state",
/* 225 */ "keep",
/* 226 */ "tagitemlist",
/* 227 */ "cache",
/* 228 */ "replica",
/* 229 */ "quorum",
/* 230 */ "days",
/* 231 */ "minrows",
/* 232 */ "maxrows",
/* 233 */ "blocks",
/* 234 */ "ctime",
/* 235 */ "wal",
/* 236 */ "fsync",
/* 237 */ "comp",
/* 238 */ "prec",
/* 239 */ "typename",
/* 240 */ "signed",
/* 241 */ "create_table_args",
/* 242 */ "columnlist",
/* 243 */ "select",
/* 244 */ "column",
/* 245 */ "tagitem",
/* 246 */ "selcollist",
/* 247 */ "from",
/* 248 */ "where_opt",
/* 249 */ "interval_opt",
/* 250 */ "fill_opt",
/* 251 */ "sliding_opt",
/* 252 */ "groupby_opt",
/* 253 */ "orderby_opt",
/* 254 */ "having_opt",
/* 255 */ "slimit_opt",
/* 256 */ "limit_opt",
/* 257 */ "union",
/* 258 */ "sclp",
/* 259 */ "expr",
/* 260 */ "as",
/* 261 */ "tablelist",
/* 262 */ "tmvar",
/* 263 */ "sortlist",
/* 264 */ "sortitem",
/* 265 */ "item",
/* 266 */ "sortorder",
/* 267 */ "grouplist",
/* 268 */ "exprlist",
/* 269 */ "expritem",
}; };
#endif /* defined(YYCOVERAGE) || !defined(NDEBUG) */ #endif /* NDEBUG */
#ifndef NDEBUG #ifndef NDEBUG
/* For tracing reduce actions, the names of all rules are required. /* For tracing reduce actions, the names of all rules are required.
...@@ -1099,226 +857,181 @@ static const char *const yyRuleName[] = { ...@@ -1099,226 +857,181 @@ static const char *const yyRuleName[] = {
/* 80 */ "fsync ::= FSYNC INTEGER", /* 80 */ "fsync ::= FSYNC INTEGER",
/* 81 */ "comp ::= COMP INTEGER", /* 81 */ "comp ::= COMP INTEGER",
/* 82 */ "prec ::= PRECISION STRING", /* 82 */ "prec ::= PRECISION STRING",
/* 83 */ "db_optr ::=", /* 83 */ "update ::= UPDATE INTEGER",
/* 84 */ "db_optr ::= db_optr cache", /* 84 */ "db_optr ::=",
/* 85 */ "db_optr ::= db_optr replica", /* 85 */ "db_optr ::= db_optr cache",
/* 86 */ "db_optr ::= db_optr quorum", /* 86 */ "db_optr ::= db_optr replica",
/* 87 */ "db_optr ::= db_optr days", /* 87 */ "db_optr ::= db_optr quorum",
/* 88 */ "db_optr ::= db_optr minrows", /* 88 */ "db_optr ::= db_optr days",
/* 89 */ "db_optr ::= db_optr maxrows", /* 89 */ "db_optr ::= db_optr minrows",
/* 90 */ "db_optr ::= db_optr blocks", /* 90 */ "db_optr ::= db_optr maxrows",
/* 91 */ "db_optr ::= db_optr ctime", /* 91 */ "db_optr ::= db_optr blocks",
/* 92 */ "db_optr ::= db_optr wal", /* 92 */ "db_optr ::= db_optr ctime",
/* 93 */ "db_optr ::= db_optr fsync", /* 93 */ "db_optr ::= db_optr wal",
/* 94 */ "db_optr ::= db_optr comp", /* 94 */ "db_optr ::= db_optr fsync",
/* 95 */ "db_optr ::= db_optr prec", /* 95 */ "db_optr ::= db_optr comp",
/* 96 */ "db_optr ::= db_optr keep", /* 96 */ "db_optr ::= db_optr prec",
/* 97 */ "alter_db_optr ::=", /* 97 */ "db_optr ::= db_optr keep",
/* 98 */ "alter_db_optr ::= alter_db_optr replica", /* 98 */ "db_optr ::= db_optr update",
/* 99 */ "alter_db_optr ::= alter_db_optr quorum", /* 99 */ "alter_db_optr ::=",
/* 100 */ "alter_db_optr ::= alter_db_optr keep", /* 100 */ "alter_db_optr ::= alter_db_optr replica",
/* 101 */ "alter_db_optr ::= alter_db_optr blocks", /* 101 */ "alter_db_optr ::= alter_db_optr quorum",
/* 102 */ "alter_db_optr ::= alter_db_optr comp", /* 102 */ "alter_db_optr ::= alter_db_optr keep",
/* 103 */ "alter_db_optr ::= alter_db_optr wal", /* 103 */ "alter_db_optr ::= alter_db_optr blocks",
/* 104 */ "alter_db_optr ::= alter_db_optr fsync", /* 104 */ "alter_db_optr ::= alter_db_optr comp",
/* 105 */ "typename ::= ids", /* 105 */ "alter_db_optr ::= alter_db_optr wal",
/* 106 */ "typename ::= ids LP signed RP", /* 106 */ "alter_db_optr ::= alter_db_optr fsync",
/* 107 */ "signed ::= INTEGER", /* 107 */ "alter_db_optr ::= alter_db_optr update",
/* 108 */ "signed ::= PLUS INTEGER", /* 108 */ "typename ::= ids",
/* 109 */ "signed ::= MINUS INTEGER", /* 109 */ "typename ::= ids LP signed RP",
/* 110 */ "cmd ::= CREATE TABLE ifnotexists ids cpxName create_table_args", /* 110 */ "signed ::= INTEGER",
/* 111 */ "create_table_args ::= LP columnlist RP", /* 111 */ "signed ::= PLUS INTEGER",
/* 112 */ "create_table_args ::= LP columnlist RP TAGS LP columnlist RP", /* 112 */ "signed ::= MINUS INTEGER",
/* 113 */ "create_table_args ::= USING ids cpxName TAGS LP tagitemlist RP", /* 113 */ "cmd ::= CREATE TABLE ifnotexists ids cpxName create_table_args",
/* 114 */ "create_table_args ::= AS select", /* 114 */ "create_table_args ::= LP columnlist RP",
/* 115 */ "columnlist ::= columnlist COMMA column", /* 115 */ "create_table_args ::= LP columnlist RP TAGS LP columnlist RP",
/* 116 */ "columnlist ::= column", /* 116 */ "create_table_args ::= USING ids cpxName TAGS LP tagitemlist RP",
/* 117 */ "column ::= ids typename", /* 117 */ "create_table_args ::= AS select",
/* 118 */ "tagitemlist ::= tagitemlist COMMA tagitem", /* 118 */ "columnlist ::= columnlist COMMA column",
/* 119 */ "tagitemlist ::= tagitem", /* 119 */ "columnlist ::= column",
/* 120 */ "tagitem ::= INTEGER", /* 120 */ "column ::= ids typename",
/* 121 */ "tagitem ::= FLOAT", /* 121 */ "tagitemlist ::= tagitemlist COMMA tagitem",
/* 122 */ "tagitem ::= STRING", /* 122 */ "tagitemlist ::= tagitem",
/* 123 */ "tagitem ::= BOOL", /* 123 */ "tagitem ::= INTEGER",
/* 124 */ "tagitem ::= NULL", /* 124 */ "tagitem ::= FLOAT",
/* 125 */ "tagitem ::= MINUS INTEGER", /* 125 */ "tagitem ::= STRING",
/* 126 */ "tagitem ::= MINUS FLOAT", /* 126 */ "tagitem ::= BOOL",
/* 127 */ "tagitem ::= PLUS INTEGER", /* 127 */ "tagitem ::= NULL",
/* 128 */ "tagitem ::= PLUS FLOAT", /* 128 */ "tagitem ::= MINUS INTEGER",
/* 129 */ "select ::= SELECT selcollist from where_opt interval_opt fill_opt sliding_opt groupby_opt orderby_opt having_opt slimit_opt limit_opt", /* 129 */ "tagitem ::= MINUS FLOAT",
/* 130 */ "union ::= select", /* 130 */ "tagitem ::= PLUS INTEGER",
/* 131 */ "union ::= LP union RP", /* 131 */ "tagitem ::= PLUS FLOAT",
/* 132 */ "union ::= union UNION ALL select", /* 132 */ "select ::= SELECT selcollist from where_opt interval_opt fill_opt sliding_opt groupby_opt orderby_opt having_opt slimit_opt limit_opt",
/* 133 */ "union ::= union UNION ALL LP select RP", /* 133 */ "union ::= select",
/* 134 */ "cmd ::= union", /* 134 */ "union ::= LP union RP",
/* 135 */ "select ::= SELECT selcollist", /* 135 */ "union ::= union UNION ALL select",
/* 136 */ "sclp ::= selcollist COMMA", /* 136 */ "union ::= union UNION ALL LP select RP",
/* 137 */ "sclp ::=", /* 137 */ "cmd ::= union",
/* 138 */ "selcollist ::= sclp expr as", /* 138 */ "select ::= SELECT selcollist",
/* 139 */ "selcollist ::= sclp STAR", /* 139 */ "sclp ::= selcollist COMMA",
/* 140 */ "as ::= AS ids", /* 140 */ "sclp ::=",
/* 141 */ "as ::= ids", /* 141 */ "selcollist ::= sclp expr as",
/* 142 */ "as ::=", /* 142 */ "selcollist ::= sclp STAR",
/* 143 */ "from ::= FROM tablelist", /* 143 */ "as ::= AS ids",
/* 144 */ "tablelist ::= ids cpxName", /* 144 */ "as ::= ids",
/* 145 */ "tablelist ::= ids cpxName ids", /* 145 */ "as ::=",
/* 146 */ "tablelist ::= tablelist COMMA ids cpxName", /* 146 */ "from ::= FROM tablelist",
/* 147 */ "tablelist ::= tablelist COMMA ids cpxName ids", /* 147 */ "tablelist ::= ids cpxName",
/* 148 */ "tmvar ::= VARIABLE", /* 148 */ "tablelist ::= ids cpxName ids",
/* 149 */ "interval_opt ::= INTERVAL LP tmvar RP", /* 149 */ "tablelist ::= tablelist COMMA ids cpxName",
/* 150 */ "interval_opt ::= INTERVAL LP tmvar COMMA tmvar RP", /* 150 */ "tablelist ::= tablelist COMMA ids cpxName ids",
/* 151 */ "interval_opt ::=", /* 151 */ "tmvar ::= VARIABLE",
/* 152 */ "fill_opt ::=", /* 152 */ "interval_opt ::= INTERVAL LP tmvar RP",
/* 153 */ "fill_opt ::= FILL LP ID COMMA tagitemlist RP", /* 153 */ "interval_opt ::= INTERVAL LP tmvar COMMA tmvar RP",
/* 154 */ "fill_opt ::= FILL LP ID RP", /* 154 */ "interval_opt ::=",
/* 155 */ "sliding_opt ::= SLIDING LP tmvar RP", /* 155 */ "fill_opt ::=",
/* 156 */ "sliding_opt ::=", /* 156 */ "fill_opt ::= FILL LP ID COMMA tagitemlist RP",
/* 157 */ "orderby_opt ::=", /* 157 */ "fill_opt ::= FILL LP ID RP",
/* 158 */ "orderby_opt ::= ORDER BY sortlist", /* 158 */ "sliding_opt ::= SLIDING LP tmvar RP",
/* 159 */ "sortlist ::= sortlist COMMA item sortorder", /* 159 */ "sliding_opt ::=",
/* 160 */ "sortlist ::= item sortorder", /* 160 */ "orderby_opt ::=",
/* 161 */ "item ::= ids cpxName", /* 161 */ "orderby_opt ::= ORDER BY sortlist",
/* 162 */ "sortorder ::= ASC", /* 162 */ "sortlist ::= sortlist COMMA item sortorder",
/* 163 */ "sortorder ::= DESC", /* 163 */ "sortlist ::= item sortorder",
/* 164 */ "sortorder ::=", /* 164 */ "item ::= ids cpxName",
/* 165 */ "groupby_opt ::=", /* 165 */ "sortorder ::= ASC",
/* 166 */ "groupby_opt ::= GROUP BY grouplist", /* 166 */ "sortorder ::= DESC",
/* 167 */ "grouplist ::= grouplist COMMA item", /* 167 */ "sortorder ::=",
/* 168 */ "grouplist ::= item", /* 168 */ "groupby_opt ::=",
/* 169 */ "having_opt ::=", /* 169 */ "groupby_opt ::= GROUP BY grouplist",
/* 170 */ "having_opt ::= HAVING expr", /* 170 */ "grouplist ::= grouplist COMMA item",
/* 171 */ "limit_opt ::=", /* 171 */ "grouplist ::= item",
/* 172 */ "limit_opt ::= LIMIT signed", /* 172 */ "having_opt ::=",
/* 173 */ "limit_opt ::= LIMIT signed OFFSET signed", /* 173 */ "having_opt ::= HAVING expr",
/* 174 */ "limit_opt ::= LIMIT signed COMMA signed", /* 174 */ "limit_opt ::=",
/* 175 */ "slimit_opt ::=", /* 175 */ "limit_opt ::= LIMIT signed",
/* 176 */ "slimit_opt ::= SLIMIT signed", /* 176 */ "limit_opt ::= LIMIT signed OFFSET signed",
/* 177 */ "slimit_opt ::= SLIMIT signed SOFFSET signed", /* 177 */ "limit_opt ::= LIMIT signed COMMA signed",
/* 178 */ "slimit_opt ::= SLIMIT signed COMMA signed", /* 178 */ "slimit_opt ::=",
/* 179 */ "where_opt ::=", /* 179 */ "slimit_opt ::= SLIMIT signed",
/* 180 */ "where_opt ::= WHERE expr", /* 180 */ "slimit_opt ::= SLIMIT signed SOFFSET signed",
/* 181 */ "expr ::= LP expr RP", /* 181 */ "slimit_opt ::= SLIMIT signed COMMA signed",
/* 182 */ "expr ::= ID", /* 182 */ "where_opt ::=",
/* 183 */ "expr ::= ID DOT ID", /* 183 */ "where_opt ::= WHERE expr",
/* 184 */ "expr ::= ID DOT STAR", /* 184 */ "expr ::= LP expr RP",
/* 185 */ "expr ::= INTEGER", /* 185 */ "expr ::= ID",
/* 186 */ "expr ::= MINUS INTEGER", /* 186 */ "expr ::= ID DOT ID",
/* 187 */ "expr ::= PLUS INTEGER", /* 187 */ "expr ::= ID DOT STAR",
/* 188 */ "expr ::= FLOAT", /* 188 */ "expr ::= INTEGER",
/* 189 */ "expr ::= MINUS FLOAT", /* 189 */ "expr ::= MINUS INTEGER",
/* 190 */ "expr ::= PLUS FLOAT", /* 190 */ "expr ::= PLUS INTEGER",
/* 191 */ "expr ::= STRING", /* 191 */ "expr ::= FLOAT",
/* 192 */ "expr ::= NOW", /* 192 */ "expr ::= MINUS FLOAT",
/* 193 */ "expr ::= VARIABLE", /* 193 */ "expr ::= PLUS FLOAT",
/* 194 */ "expr ::= BOOL", /* 194 */ "expr ::= STRING",
/* 195 */ "expr ::= ID LP exprlist RP", /* 195 */ "expr ::= NOW",
/* 196 */ "expr ::= ID LP STAR RP", /* 196 */ "expr ::= VARIABLE",
/* 197 */ "expr ::= expr IS NULL", /* 197 */ "expr ::= BOOL",
/* 198 */ "expr ::= expr IS NOT NULL", /* 198 */ "expr ::= ID LP exprlist RP",
/* 199 */ "expr ::= expr LT expr", /* 199 */ "expr ::= ID LP STAR RP",
/* 200 */ "expr ::= expr GT expr", /* 200 */ "expr ::= expr IS NULL",
/* 201 */ "expr ::= expr LE expr", /* 201 */ "expr ::= expr IS NOT NULL",
/* 202 */ "expr ::= expr GE expr", /* 202 */ "expr ::= expr LT expr",
/* 203 */ "expr ::= expr NE expr", /* 203 */ "expr ::= expr GT expr",
/* 204 */ "expr ::= expr EQ expr", /* 204 */ "expr ::= expr LE expr",
/* 205 */ "expr ::= expr AND expr", /* 205 */ "expr ::= expr GE expr",
/* 206 */ "expr ::= expr OR expr", /* 206 */ "expr ::= expr NE expr",
/* 207 */ "expr ::= expr PLUS expr", /* 207 */ "expr ::= expr EQ expr",
/* 208 */ "expr ::= expr MINUS expr", /* 208 */ "expr ::= expr AND expr",
/* 209 */ "expr ::= expr STAR expr", /* 209 */ "expr ::= expr OR expr",
/* 210 */ "expr ::= expr SLASH expr", /* 210 */ "expr ::= expr PLUS expr",
/* 211 */ "expr ::= expr REM expr", /* 211 */ "expr ::= expr MINUS expr",
/* 212 */ "expr ::= expr LIKE expr", /* 212 */ "expr ::= expr STAR expr",
/* 213 */ "expr ::= expr IN LP exprlist RP", /* 213 */ "expr ::= expr SLASH expr",
/* 214 */ "exprlist ::= exprlist COMMA expritem", /* 214 */ "expr ::= expr REM expr",
/* 215 */ "exprlist ::= expritem", /* 215 */ "expr ::= expr LIKE expr",
/* 216 */ "expritem ::= expr", /* 216 */ "expr ::= expr IN LP exprlist RP",
/* 217 */ "expritem ::=", /* 217 */ "exprlist ::= exprlist COMMA expritem",
/* 218 */ "cmd ::= RESET QUERY CACHE", /* 218 */ "exprlist ::= expritem",
/* 219 */ "cmd ::= ALTER TABLE ids cpxName ADD COLUMN columnlist", /* 219 */ "expritem ::= expr",
/* 220 */ "cmd ::= ALTER TABLE ids cpxName DROP COLUMN ids", /* 220 */ "expritem ::=",
/* 221 */ "cmd ::= ALTER TABLE ids cpxName ADD TAG columnlist", /* 221 */ "cmd ::= RESET QUERY CACHE",
/* 222 */ "cmd ::= ALTER TABLE ids cpxName DROP TAG ids", /* 222 */ "cmd ::= ALTER TABLE ids cpxName ADD COLUMN columnlist",
/* 223 */ "cmd ::= ALTER TABLE ids cpxName CHANGE TAG ids ids", /* 223 */ "cmd ::= ALTER TABLE ids cpxName DROP COLUMN ids",
/* 224 */ "cmd ::= ALTER TABLE ids cpxName SET TAG ids EQ tagitem", /* 224 */ "cmd ::= ALTER TABLE ids cpxName ADD TAG columnlist",
/* 225 */ "cmd ::= KILL CONNECTION INTEGER", /* 225 */ "cmd ::= ALTER TABLE ids cpxName DROP TAG ids",
/* 226 */ "cmd ::= KILL STREAM INTEGER COLON INTEGER", /* 226 */ "cmd ::= ALTER TABLE ids cpxName CHANGE TAG ids ids",
/* 227 */ "cmd ::= KILL QUERY INTEGER COLON INTEGER", /* 227 */ "cmd ::= ALTER TABLE ids cpxName SET TAG ids EQ tagitem",
/* 228 */ "cmd ::= KILL CONNECTION INTEGER",
/* 229 */ "cmd ::= KILL STREAM INTEGER COLON INTEGER",
/* 230 */ "cmd ::= KILL QUERY INTEGER COLON INTEGER",
}; };
#endif /* NDEBUG */ #endif /* NDEBUG */
#if YYSTACKDEPTH<=0 #if YYSTACKDEPTH<=0
/* /*
** Try to increase the size of the parser stack. Return the number ** Try to increase the size of the parser stack.
** of errors. Return 0 on success.
*/ */
static int yyGrowStack(yyParser *p){ static void yyGrowStack(yyParser *p){
int newSize; int newSize;
int idx;
yyStackEntry *pNew; yyStackEntry *pNew;
newSize = p->yystksz*2 + 100; newSize = p->yystksz*2 + 100;
idx = p->yytos ? (int)(p->yytos - p->yystack) : 0;
if( p->yystack==&p->yystk0 ){
pNew = malloc(newSize*sizeof(pNew[0]));
if( pNew ) pNew[0] = p->yystk0;
}else{
pNew = realloc(p->yystack, newSize*sizeof(pNew[0])); pNew = realloc(p->yystack, newSize*sizeof(pNew[0]));
}
if( pNew ){ if( pNew ){
p->yystack = pNew; p->yystack = pNew;
p->yytos = &p->yystack[idx]; p->yystksz = newSize;
#ifndef NDEBUG #ifndef NDEBUG
if( yyTraceFILE ){ if( yyTraceFILE ){
fprintf(yyTraceFILE,"%sStack grows from %d to %d entries.\n", fprintf(yyTraceFILE,"%sStack grows to %d entries!\n",
yyTracePrompt, p->yystksz, newSize); yyTracePrompt, p->yystksz);
} }
#endif #endif
p->yystksz = newSize;
} }
return pNew==0;
} }
#endif #endif
/* Datatype of the argument to the memory allocated passed as the
** second argument to ParseAlloc() below. This can be changed by
** putting an appropriate #define in the %include section of the input
** grammar.
*/
#ifndef YYMALLOCARGTYPE
# define YYMALLOCARGTYPE size_t
#endif
/* Initialize a new parser that has already been allocated.
*/
void ParseInit(void *yypRawParser ParseCTX_PDECL){
yyParser *yypParser = (yyParser*)yypRawParser;
ParseCTX_STORE
#ifdef YYTRACKMAXSTACKDEPTH
yypParser->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;
}
#endif
#ifndef YYNOERRORRECOVERY
yypParser->yyerrcnt = -1;
#endif
yypParser->yytos = yypParser->yystack;
yypParser->yystack[0].stateno = 0;
yypParser->yystack[0].major = 0;
#if YYSTACKDEPTH>0
yypParser->yystackEnd = &yypParser->yystack[YYSTACKDEPTH-1];
#endif
}
#ifndef Parse_ENGINEALWAYSONSTACK
/* /*
** This function allocates a new parser. ** This function allocates a new parser.
** The only argument is a pointer to a function which works like ** The only argument is a pointer to a function which works like
...@@ -1331,32 +1044,34 @@ void ParseInit(void *yypRawParser ParseCTX_PDECL){ ...@@ -1331,32 +1044,34 @@ void ParseInit(void *yypRawParser ParseCTX_PDECL){
** A pointer to a parser. This pointer is used in subsequent calls ** A pointer to a parser. This pointer is used in subsequent calls
** to Parse and ParseFree. ** to Parse and ParseFree.
*/ */
void *ParseAlloc(void *(*mallocProc)(YYMALLOCARGTYPE) ParseCTX_PDECL){ void *ParseAlloc(void *(*mallocProc)(size_t)){
yyParser *yypParser; yyParser *pParser;
yypParser = (yyParser*)(*mallocProc)( (YYMALLOCARGTYPE)sizeof(yyParser) ); pParser = (yyParser*)(*mallocProc)( (size_t)sizeof(yyParser) );
if( yypParser ){ if( pParser ){
ParseCTX_STORE pParser->yyidx = -1;
ParseInit(yypParser ParseCTX_PARAM); #ifdef YYTRACKMAXSTACKDEPTH
pParser->yyidxMax = 0;
#endif
#if YYSTACKDEPTH<=0
pParser->yystack = NULL;
pParser->yystksz = 0;
yyGrowStack(pParser);
#endif
} }
return (void*)yypParser; return pParser;
} }
#endif /* Parse_ENGINEALWAYSONSTACK */
/* The following function deletes the value associated with a
/* The following function deletes the "minor type" or semantic value ** symbol. The symbol can be either a terminal or nonterminal.
** associated with a symbol. The symbol can be either a terminal ** "yymajor" is the symbol code, and "yypminor" is a pointer to
** or nonterminal. "yymajor" is the symbol code, and "yypminor" is ** the value.
** a pointer to the value to be deleted. The code used to do the
** deletions is derived from the %destructor and/or %token_destructor
** directives of the input grammar.
*/ */
static void yy_destructor( static void yy_destructor(
yyParser *yypParser, /* The parser */ yyParser *yypParser, /* The parser */
YYCODETYPE yymajor, /* Type code for object to destroy */ YYCODETYPE yymajor, /* Type code for object to destroy */
YYMINORTYPE *yypminor /* The object to be destroyed */ YYMINORTYPE *yypminor /* The object to be destroyed */
){ ){
ParseARG_FETCH ParseARG_FETCH;
ParseCTX_FETCH
switch( yymajor ){ switch( yymajor ){
/* Here is inserted the actions which take place when a /* Here is inserted the actions which take place when a
** terminal or non-terminal is destroyed. This can happen ** terminal or non-terminal is destroyed. This can happen
...@@ -1365,57 +1080,55 @@ static void yy_destructor( ...@@ -1365,57 +1080,55 @@ static void yy_destructor(
** being destroyed before it is finished parsing. ** being destroyed before it is finished parsing.
** **
** Note: during a reduce, the only symbols destroyed are those ** Note: during a reduce, the only symbols destroyed are those
** which appear on the RHS of the rule, but which are *not* used ** which appear on the RHS of the rule, but which are not used
** inside the C code. ** inside the C code.
*/ */
/********* Begin destructor definitions ***************************************/ case 227: /* keep */
case 225: /* keep */ case 228: /* tagitemlist */
case 226: /* tagitemlist */ case 253: /* fill_opt */
case 250: /* fill_opt */ case 255: /* groupby_opt */
case 252: /* groupby_opt */ case 256: /* orderby_opt */
case 253: /* orderby_opt */ case 266: /* sortlist */
case 263: /* sortlist */ case 270: /* grouplist */
case 267: /* grouplist */
{ {
tVariantListDestroy((yypminor->yy156)); tVariantListDestroy((yypminor->yy498));
} }
break; break;
case 242: /* columnlist */ case 245: /* columnlist */
{ {
tFieldListDestroy((yypminor->yy511)); tFieldListDestroy((yypminor->yy523));
} }
break; break;
case 243: /* select */ case 246: /* select */
{ {
doDestroyQuerySql((yypminor->yy444)); doDestroyQuerySql((yypminor->yy414));
} }
break; break;
case 246: /* selcollist */ case 249: /* selcollist */
case 258: /* sclp */ case 261: /* sclp */
case 268: /* exprlist */ case 271: /* exprlist */
{ {
tSQLExprListDestroy((yypminor->yy158)); tSQLExprListDestroy((yypminor->yy290));
} }
break; break;
case 248: /* where_opt */ case 251: /* where_opt */
case 254: /* having_opt */ case 257: /* having_opt */
case 259: /* expr */ case 262: /* expr */
case 269: /* expritem */ case 272: /* expritem */
{ {
tSQLExprDestroy((yypminor->yy190)); tSQLExprDestroy((yypminor->yy64));
} }
break; break;
case 257: /* union */ case 260: /* union */
{ {
destroyAllSelectClause((yypminor->yy333)); destroyAllSelectClause((yypminor->yy231));
} }
break; break;
case 264: /* sortitem */ case 267: /* sortitem */
{ {
tVariantDestroy(&(yypminor->yy506)); tVariantDestroy(&(yypminor->yy134));
} }
break; break;
/********* End destructor definitions *****************************************/
default: break; /* If no destructor action specified: do nothing */ default: break; /* If no destructor action specified: do nothing */
} }
} }
...@@ -1425,53 +1138,51 @@ tVariantDestroy(&(yypminor->yy506)); ...@@ -1425,53 +1138,51 @@ tVariantDestroy(&(yypminor->yy506));
** **
** If there is a destructor routine associated with the token which ** If there is a destructor routine associated with the token which
** is popped from the stack, then call it. ** is popped from the stack, then call it.
**
** Return the major token number for the symbol popped.
*/ */
static void yy_pop_parser_stack(yyParser *pParser){ static int yy_pop_parser_stack(yyParser *pParser){
yyStackEntry *yytos; YYCODETYPE yymajor;
assert( pParser->yytos!=0 ); yyStackEntry *yytos = &pParser->yystack[pParser->yyidx];
assert( pParser->yytos > pParser->yystack );
yytos = pParser->yytos--; if( pParser->yyidx<0 ) return 0;
#ifndef NDEBUG #ifndef NDEBUG
if( yyTraceFILE ){ if( yyTraceFILE && pParser->yyidx>=0 ){
fprintf(yyTraceFILE,"%sPopping %s\n", fprintf(yyTraceFILE,"%sPopping %s\n",
yyTracePrompt, yyTracePrompt,
yyTokenName[yytos->major]); yyTokenName[yytos->major]);
} }
#endif #endif
yy_destructor(pParser, yytos->major, &yytos->minor); yymajor = yytos->major;
} yy_destructor(pParser, yymajor, &yytos->minor);
pParser->yyidx--;
/* return yymajor;
** Clear all secondary memory allocations from the parser
*/
void ParseFinalize(void *p){
yyParser *pParser = (yyParser*)p;
while( pParser->yytos>pParser->yystack ) yy_pop_parser_stack(pParser);
#if YYSTACKDEPTH<=0
if( pParser->yystack!=&pParser->yystk0 ) free(pParser->yystack);
#endif
} }
#ifndef Parse_ENGINEALWAYSONSTACK
/* /*
** Deallocate and destroy a parser. Destructors are called for ** Deallocate and destroy a parser. Destructors are all called for
** all stack elements before shutting the parser down. ** all stack elements before shutting the parser down.
** **
** If the YYPARSEFREENEVERNULL macro exists (for example because it ** Inputs:
** is defined in a %include section of the input grammar) then it is ** <ul>
** assumed that the input pointer is never NULL. ** <li> A pointer to the parser. This should be a pointer
** obtained from ParseAlloc.
** <li> A pointer to a function used to reclaim memory obtained
** from malloc.
** </ul>
*/ */
void ParseFree( void ParseFree(
void *p, /* The parser to be deleted */ void *p, /* The parser to be deleted */
void (*freeProc)(void*) /* Function used to reclaim memory */ void (*freeProc)(void*) /* Function used to reclaim memory */
){ ){
#ifndef YYPARSEFREENEVERNULL yyParser *pParser = (yyParser*)p;
if( p==0 ) return; if( pParser==0 ) return;
while( pParser->yyidx>=0 ) yy_pop_parser_stack(pParser);
#if YYSTACKDEPTH<=0
free(pParser->yystack);
#endif #endif
ParseFinalize(p); (*freeProc)((void*)pParser);
(*freeProc)(p);
} }
#endif /* Parse_ENGINEALWAYSONSTACK */
/* /*
** Return the peak depth of the stack for a parser. ** Return the peak depth of the stack for a parser.
...@@ -1479,118 +1190,85 @@ void ParseFree( ...@@ -1479,118 +1190,85 @@ void ParseFree(
#ifdef YYTRACKMAXSTACKDEPTH #ifdef YYTRACKMAXSTACKDEPTH
int ParseStackPeak(void *p){ int ParseStackPeak(void *p){
yyParser *pParser = (yyParser*)p; yyParser *pParser = (yyParser*)p;
return pParser->yyhwm; return pParser->yyidxMax;
}
#endif
/* This array of booleans keeps track of the parser statement
** coverage. The element yycoverage[X][Y] is set when the parser
** is in state X and has a lookahead token Y. In a well-tested
** systems, every element of this matrix should end up being set.
*/
#if defined(YYCOVERAGE)
static unsigned char yycoverage[YYNSTATE][YYNTOKEN];
#endif
/*
** Write into out a description of every state/lookahead combination that
**
** (1) has not been used by the parser, and
** (2) is not a syntax error.
**
** Return the number of missed state/lookahead combinations.
*/
#if defined(YYCOVERAGE)
int ParseCoverage(FILE *out){
int stateno, iLookAhead, i;
int nMissed = 0;
for(stateno=0; stateno<YYNSTATE; stateno++){
i = yy_shift_ofst[stateno];
for(iLookAhead=0; iLookAhead<YYNTOKEN; iLookAhead++){
if( yy_lookahead[i+iLookAhead]!=iLookAhead ) continue;
if( yycoverage[stateno][iLookAhead]==0 ) nMissed++;
if( out ){
fprintf(out,"State %d lookahead %s %s\n", stateno,
yyTokenName[iLookAhead],
yycoverage[stateno][iLookAhead] ? "ok" : "missed");
}
}
}
return nMissed;
} }
#endif #endif
/* /*
** Find the appropriate action for a parser given the terminal ** Find the appropriate action for a parser given the terminal
** look-ahead token iLookAhead. ** look-ahead token iLookAhead.
**
** If the look-ahead token is YYNOCODE, then check to see if the action is
** independent of the look-ahead. If it is, return the action, otherwise
** return YY_NO_ACTION.
*/ */
static YYACTIONTYPE yy_find_shift_action( static int yy_find_shift_action(
YYCODETYPE iLookAhead, /* The look-ahead token */ yyParser *pParser, /* The parser */
YYACTIONTYPE stateno /* Current state number */ YYCODETYPE iLookAhead /* The look-ahead token */
){ ){
int i; int i;
int stateno = pParser->yystack[pParser->yyidx].stateno;
if( stateno>YY_MAX_SHIFT ) return stateno; if( stateno>YY_SHIFT_COUNT
assert( stateno <= YY_SHIFT_COUNT ); || (i = yy_shift_ofst[stateno])==YY_SHIFT_USE_DFLT ){
#if defined(YYCOVERAGE) return yy_default[stateno];
yycoverage[stateno][iLookAhead] = 1; }
#endif
do{
i = yy_shift_ofst[stateno];
assert( i>=0 );
assert( i<=YY_ACTTAB_COUNT );
assert( i+YYNTOKEN<=(int)YY_NLOOKAHEAD );
assert( iLookAhead!=YYNOCODE ); assert( iLookAhead!=YYNOCODE );
assert( iLookAhead < YYNTOKEN );
i += iLookAhead; i += iLookAhead;
assert( i<(int)YY_NLOOKAHEAD ); if( i<0 || i>=YY_ACTTAB_COUNT || yy_lookahead[i]!=iLookAhead ){
if( yy_lookahead[i]!=iLookAhead ){ if( iLookAhead>0 ){
#ifdef YYFALLBACK #ifdef YYFALLBACK
YYCODETYPE iFallback; /* Fallback token */ YYCODETYPE iFallback; /* Fallback token */
assert( iLookAhead<sizeof(yyFallback)/sizeof(yyFallback[0]) ); if( iLookAhead<sizeof(yyFallback)/sizeof(yyFallback[0])
iFallback = yyFallback[iLookAhead]; && (iFallback = yyFallback[iLookAhead])!=0 ){
if( iFallback!=0 ){
#ifndef NDEBUG #ifndef NDEBUG
if( yyTraceFILE ){ if( yyTraceFILE ){
fprintf(yyTraceFILE, "%sFALLBACK %s => %s\n", fprintf(yyTraceFILE, "%sFALLBACK %s => %s\n",
yyTracePrompt, yyTokenName[iLookAhead], yyTokenName[iFallback]); yyTracePrompt, yyTokenName[iLookAhead], yyTokenName[iFallback]);
} }
#endif #endif
assert( yyFallback[iFallback]==0 ); /* Fallback loop must terminate */ return yy_find_shift_action(pParser, iFallback);
iLookAhead = iFallback;
continue;
} }
#endif #endif
#ifdef YYWILDCARD #ifdef YYWILDCARD
{ {
int j = i - iLookAhead + YYWILDCARD; int j = i - iLookAhead + YYWILDCARD;
assert( j<(int)(sizeof(yy_lookahead)/sizeof(yy_lookahead[0])) ); if(
if( yy_lookahead[j]==YYWILDCARD && iLookAhead>0 ){ #if YY_SHIFT_MIN+YYWILDCARD<0
j>=0 &&
#endif
#if YY_SHIFT_MAX+YYWILDCARD>=YY_ACTTAB_COUNT
j<YY_ACTTAB_COUNT &&
#endif
yy_lookahead[j]==YYWILDCARD
){
#ifndef NDEBUG #ifndef NDEBUG
if( yyTraceFILE ){ if( yyTraceFILE ){
fprintf(yyTraceFILE, "%sWILDCARD %s => %s\n", fprintf(yyTraceFILE, "%sWILDCARD %s => %s\n",
yyTracePrompt, yyTokenName[iLookAhead], yyTracePrompt, yyTokenName[iLookAhead], yyTokenName[YYWILDCARD]);
yyTokenName[YYWILDCARD]);
} }
#endif /* NDEBUG */ #endif /* NDEBUG */
return yy_action[j]; return yy_action[j];
} }
} }
#endif /* YYWILDCARD */ #endif /* YYWILDCARD */
}
return yy_default[stateno]; return yy_default[stateno];
}else{ }else{
assert( i>=0 && i<sizeof(yy_action)/sizeof(yy_action[0]) );
return yy_action[i]; return yy_action[i];
} }
}while(1);
} }
/* /*
** Find the appropriate action for a parser given the non-terminal ** Find the appropriate action for a parser given the non-terminal
** look-ahead token iLookAhead. ** look-ahead token iLookAhead.
**
** If the look-ahead token is YYNOCODE, then check to see if the action is
** independent of the look-ahead. If it is, return the action, otherwise
** return YY_NO_ACTION.
*/ */
static YYACTIONTYPE yy_find_reduce_action( static int yy_find_reduce_action(
YYACTIONTYPE stateno, /* Current state number */ int stateno, /* Current state number */
YYCODETYPE iLookAhead /* The look-ahead token */ YYCODETYPE iLookAhead /* The look-ahead token */
){ ){
int i; int i;
...@@ -1602,6 +1280,7 @@ static YYACTIONTYPE yy_find_reduce_action( ...@@ -1602,6 +1280,7 @@ static YYACTIONTYPE yy_find_reduce_action(
assert( stateno<=YY_REDUCE_COUNT ); assert( stateno<=YY_REDUCE_COUNT );
#endif #endif
i = yy_reduce_ofst[stateno]; i = yy_reduce_ofst[stateno];
assert( i!=YY_REDUCE_USE_DFLT );
assert( iLookAhead!=YYNOCODE ); assert( iLookAhead!=YYNOCODE );
i += iLookAhead; i += iLookAhead;
#ifdef YYERRORSYMBOL #ifdef YYERRORSYMBOL
...@@ -1618,550 +1297,304 @@ static YYACTIONTYPE yy_find_reduce_action( ...@@ -1618,550 +1297,304 @@ static YYACTIONTYPE yy_find_reduce_action(
/* /*
** The following routine is called if the stack overflows. ** The following routine is called if the stack overflows.
*/ */
static void yyStackOverflow(yyParser *yypParser){ static void yyStackOverflow(yyParser *yypParser, YYMINORTYPE *yypMinor){
ParseARG_FETCH ParseARG_FETCH;
ParseCTX_FETCH yypParser->yyidx--;
#ifndef NDEBUG #ifndef NDEBUG
if( yyTraceFILE ){ if( yyTraceFILE ){
fprintf(yyTraceFILE,"%sStack Overflow!\n",yyTracePrompt); fprintf(yyTraceFILE,"%sStack Overflow!\n",yyTracePrompt);
} }
#endif #endif
while( yypParser->yytos>yypParser->yystack ) yy_pop_parser_stack(yypParser); while( yypParser->yyidx>=0 ) yy_pop_parser_stack(yypParser);
/* Here code is inserted which will execute if the parser /* Here code is inserted which will execute if the parser
** stack every overflows */ ** stack every overflows */
/******** Begin %stack_overflow code ******************************************/ ParseARG_STORE; /* Suppress warning about unused %extra_argument var */
/******** End %stack_overflow code ********************************************/
ParseARG_STORE /* Suppress warning about unused %extra_argument var */
ParseCTX_STORE
} }
/*
** Print tracing information for a SHIFT action
*/
#ifndef NDEBUG
static void yyTraceShift(yyParser *yypParser, int yyNewState, const char *zTag){
if( yyTraceFILE ){
if( yyNewState<YYNSTATE ){
fprintf(yyTraceFILE,"%s%s '%s', go to state %d\n",
yyTracePrompt, zTag, yyTokenName[yypParser->yytos->major],
yyNewState);
}else{
fprintf(yyTraceFILE,"%s%s '%s', pending reduce %d\n",
yyTracePrompt, zTag, yyTokenName[yypParser->yytos->major],
yyNewState - YY_MIN_REDUCE);
}
}
}
#else
# define yyTraceShift(X,Y,Z)
#endif
/* /*
** Perform a shift action. ** Perform a shift action.
*/ */
static void yy_shift( static void yy_shift(
yyParser *yypParser, /* The parser to be shifted */ yyParser *yypParser, /* The parser to be shifted */
YYACTIONTYPE yyNewState, /* The new state to shift in */ int yyNewState, /* The new state to shift in */
YYCODETYPE yyMajor, /* The major token to shift in */ int yyMajor, /* The major token to shift in */
ParseTOKENTYPE yyMinor /* The minor token to shift in */ YYMINORTYPE *yypMinor /* Pointer to the minor token to shift in */
){ ){
yyStackEntry *yytos; yyStackEntry *yytos;
yypParser->yytos++; yypParser->yyidx++;
#ifdef YYTRACKMAXSTACKDEPTH #ifdef YYTRACKMAXSTACKDEPTH
if( (int)(yypParser->yytos - yypParser->yystack)>yypParser->yyhwm ){ if( yypParser->yyidx>yypParser->yyidxMax ){
yypParser->yyhwm++; yypParser->yyidxMax = yypParser->yyidx;
assert( yypParser->yyhwm == (int)(yypParser->yytos - yypParser->yystack) );
} }
#endif #endif
#if YYSTACKDEPTH>0 #if YYSTACKDEPTH>0
if( yypParser->yytos>yypParser->yystackEnd ){ if( yypParser->yyidx>=YYSTACKDEPTH ){
yypParser->yytos--; yyStackOverflow(yypParser, yypMinor);
yyStackOverflow(yypParser);
return; return;
} }
#else #else
if( yypParser->yytos>=&yypParser->yystack[yypParser->yystksz] ){ if( yypParser->yyidx>=yypParser->yystksz ){
if( yyGrowStack(yypParser) ){ yyGrowStack(yypParser);
yypParser->yytos--; if( yypParser->yyidx>=yypParser->yystksz ){
yyStackOverflow(yypParser); yyStackOverflow(yypParser, yypMinor);
return; return;
} }
} }
#endif #endif
if( yyNewState > YY_MAX_SHIFT ){ yytos = &yypParser->yystack[yypParser->yyidx];
yyNewState += YY_MIN_REDUCE - YY_MIN_SHIFTREDUCE; yytos->stateno = (YYACTIONTYPE)yyNewState;
yytos->major = (YYCODETYPE)yyMajor;
yytos->minor = *yypMinor;
#ifndef NDEBUG
if( yyTraceFILE && yypParser->yyidx>0 ){
int i;
fprintf(yyTraceFILE,"%sShift %d\n",yyTracePrompt,yyNewState);
fprintf(yyTraceFILE,"%sStack:",yyTracePrompt);
for(i=1; i<=yypParser->yyidx; i++)
fprintf(yyTraceFILE," %s",yyTokenName[yypParser->yystack[i].major]);
fprintf(yyTraceFILE,"\n");
} }
yytos = yypParser->yytos; #endif
yytos->stateno = yyNewState;
yytos->major = yyMajor;
yytos->minor.yy0 = yyMinor;
yyTraceShift(yypParser, yyNewState, "Shift");
} }
/* For rule J, yyRuleInfoLhs[J] contains the symbol on the left-hand side /* The following table contains information about every rule that
** of that rule */ ** is used during the reduce.
static const YYCODETYPE yyRuleInfoLhs[] = { */
206, /* (0) program ::= cmd */ static const struct {
207, /* (1) cmd ::= SHOW DATABASES */ YYCODETYPE lhs; /* Symbol on the left-hand side of the rule */
207, /* (2) cmd ::= SHOW MNODES */ unsigned char nrhs; /* Number of right-hand side symbols in the rule */
207, /* (3) cmd ::= SHOW DNODES */ } yyRuleInfo[] = {
207, /* (4) cmd ::= SHOW ACCOUNTS */ { 208, 1 },
207, /* (5) cmd ::= SHOW USERS */ { 209, 2 },
207, /* (6) cmd ::= SHOW MODULES */ { 209, 2 },
207, /* (7) cmd ::= SHOW QUERIES */ { 209, 2 },
207, /* (8) cmd ::= SHOW CONNECTIONS */ { 209, 2 },
207, /* (9) cmd ::= SHOW STREAMS */ { 209, 2 },
207, /* (10) cmd ::= SHOW VARIABLES */ { 209, 2 },
207, /* (11) cmd ::= SHOW SCORES */ { 209, 2 },
207, /* (12) cmd ::= SHOW GRANTS */ { 209, 2 },
207, /* (13) cmd ::= SHOW VNODES */ { 209, 2 },
207, /* (14) cmd ::= SHOW VNODES IPTOKEN */ { 209, 2 },
208, /* (15) dbPrefix ::= */ { 209, 2 },
208, /* (16) dbPrefix ::= ids DOT */ { 209, 2 },
210, /* (17) cpxName ::= */ { 209, 2 },
210, /* (18) cpxName ::= DOT ids */ { 209, 3 },
207, /* (19) cmd ::= SHOW dbPrefix TABLES */ { 210, 0 },
207, /* (20) cmd ::= SHOW dbPrefix TABLES LIKE ids */ { 210, 2 },
207, /* (21) cmd ::= SHOW dbPrefix STABLES */ { 212, 0 },
207, /* (22) cmd ::= SHOW dbPrefix STABLES LIKE ids */ { 212, 2 },
207, /* (23) cmd ::= SHOW dbPrefix VGROUPS */ { 209, 3 },
207, /* (24) cmd ::= SHOW dbPrefix VGROUPS ids */ { 209, 5 },
207, /* (25) cmd ::= DROP TABLE ifexists ids cpxName */ { 209, 3 },
207, /* (26) cmd ::= DROP DATABASE ifexists ids */ { 209, 5 },
207, /* (27) cmd ::= DROP DNODE ids */ { 209, 3 },
207, /* (28) cmd ::= DROP USER ids */ { 209, 4 },
207, /* (29) cmd ::= DROP ACCOUNT ids */ { 209, 5 },
207, /* (30) cmd ::= USE ids */ { 209, 4 },
207, /* (31) cmd ::= DESCRIBE ids cpxName */ { 209, 3 },
207, /* (32) cmd ::= ALTER USER ids PASS ids */ { 209, 3 },
207, /* (33) cmd ::= ALTER USER ids PRIVILEGE ids */ { 209, 3 },
207, /* (34) cmd ::= ALTER DNODE ids ids */ { 209, 2 },
207, /* (35) cmd ::= ALTER DNODE ids ids ids */ { 209, 3 },
207, /* (36) cmd ::= ALTER LOCAL ids */ { 209, 5 },
207, /* (37) cmd ::= ALTER LOCAL ids ids */ { 209, 5 },
207, /* (38) cmd ::= ALTER DATABASE ids alter_db_optr */ { 209, 4 },
207, /* (39) cmd ::= ALTER ACCOUNT ids acct_optr */ { 209, 5 },
207, /* (40) cmd ::= ALTER ACCOUNT ids PASS ids acct_optr */ { 209, 3 },
209, /* (41) ids ::= ID */ { 209, 4 },
209, /* (42) ids ::= STRING */ { 209, 4 },
211, /* (43) ifexists ::= IF EXISTS */ { 209, 4 },
211, /* (44) ifexists ::= */ { 209, 6 },
214, /* (45) ifnotexists ::= IF NOT EXISTS */ { 211, 1 },
214, /* (46) ifnotexists ::= */ { 211, 1 },
207, /* (47) cmd ::= CREATE DNODE ids */ { 213, 2 },
207, /* (48) cmd ::= CREATE ACCOUNT ids PASS ids acct_optr */ { 213, 0 },
207, /* (49) cmd ::= CREATE DATABASE ifnotexists ids db_optr */ { 216, 3 },
207, /* (50) cmd ::= CREATE USER ids PASS ids */ { 216, 0 },
216, /* (51) pps ::= */ { 209, 3 },
216, /* (52) pps ::= PPS INTEGER */ { 209, 6 },
217, /* (53) tseries ::= */ { 209, 5 },
217, /* (54) tseries ::= TSERIES INTEGER */ { 209, 5 },
218, /* (55) dbs ::= */ { 218, 0 },
218, /* (56) dbs ::= DBS INTEGER */ { 218, 2 },
219, /* (57) streams ::= */ { 219, 0 },
219, /* (58) streams ::= STREAMS INTEGER */ { 219, 2 },
220, /* (59) storage ::= */ { 220, 0 },
220, /* (60) storage ::= STORAGE INTEGER */ { 220, 2 },
221, /* (61) qtime ::= */ { 221, 0 },
221, /* (62) qtime ::= QTIME INTEGER */ { 221, 2 },
222, /* (63) users ::= */ { 222, 0 },
222, /* (64) users ::= USERS INTEGER */ { 222, 2 },
223, /* (65) conns ::= */ { 223, 0 },
223, /* (66) conns ::= CONNS INTEGER */ { 223, 2 },
224, /* (67) state ::= */ { 224, 0 },
224, /* (68) state ::= STATE ids */ { 224, 2 },
213, /* (69) acct_optr ::= pps tseries storage streams qtime dbs users conns state */ { 225, 0 },
225, /* (70) keep ::= KEEP tagitemlist */ { 225, 2 },
227, /* (71) cache ::= CACHE INTEGER */ { 226, 0 },
228, /* (72) replica ::= REPLICA INTEGER */ { 226, 2 },
229, /* (73) quorum ::= QUORUM INTEGER */ { 215, 9 },
230, /* (74) days ::= DAYS INTEGER */ { 227, 2 },
231, /* (75) minrows ::= MINROWS INTEGER */ { 229, 2 },
232, /* (76) maxrows ::= MAXROWS INTEGER */ { 230, 2 },
233, /* (77) blocks ::= BLOCKS INTEGER */ { 231, 2 },
234, /* (78) ctime ::= CTIME INTEGER */ { 232, 2 },
235, /* (79) wal ::= WAL INTEGER */ { 233, 2 },
236, /* (80) fsync ::= FSYNC INTEGER */ { 234, 2 },
237, /* (81) comp ::= COMP INTEGER */ { 235, 2 },
238, /* (82) prec ::= PRECISION STRING */ { 236, 2 },
215, /* (83) db_optr ::= */ { 237, 2 },
215, /* (84) db_optr ::= db_optr cache */ { 238, 2 },
215, /* (85) db_optr ::= db_optr replica */ { 239, 2 },
215, /* (86) db_optr ::= db_optr quorum */ { 240, 2 },
215, /* (87) db_optr ::= db_optr days */ { 241, 2 },
215, /* (88) db_optr ::= db_optr minrows */ { 217, 0 },
215, /* (89) db_optr ::= db_optr maxrows */ { 217, 2 },
215, /* (90) db_optr ::= db_optr blocks */ { 217, 2 },
215, /* (91) db_optr ::= db_optr ctime */ { 217, 2 },
215, /* (92) db_optr ::= db_optr wal */ { 217, 2 },
215, /* (93) db_optr ::= db_optr fsync */ { 217, 2 },
215, /* (94) db_optr ::= db_optr comp */ { 217, 2 },
215, /* (95) db_optr ::= db_optr prec */ { 217, 2 },
215, /* (96) db_optr ::= db_optr keep */ { 217, 2 },
212, /* (97) alter_db_optr ::= */ { 217, 2 },
212, /* (98) alter_db_optr ::= alter_db_optr replica */ { 217, 2 },
212, /* (99) alter_db_optr ::= alter_db_optr quorum */ { 217, 2 },
212, /* (100) alter_db_optr ::= alter_db_optr keep */ { 217, 2 },
212, /* (101) alter_db_optr ::= alter_db_optr blocks */ { 217, 2 },
212, /* (102) alter_db_optr ::= alter_db_optr comp */ { 217, 2 },
212, /* (103) alter_db_optr ::= alter_db_optr wal */ { 214, 0 },
212, /* (104) alter_db_optr ::= alter_db_optr fsync */ { 214, 2 },
239, /* (105) typename ::= ids */ { 214, 2 },
239, /* (106) typename ::= ids LP signed RP */ { 214, 2 },
240, /* (107) signed ::= INTEGER */ { 214, 2 },
240, /* (108) signed ::= PLUS INTEGER */ { 214, 2 },
240, /* (109) signed ::= MINUS INTEGER */ { 214, 2 },
207, /* (110) cmd ::= CREATE TABLE ifnotexists ids cpxName create_table_args */ { 214, 2 },
241, /* (111) create_table_args ::= LP columnlist RP */ { 214, 2 },
241, /* (112) create_table_args ::= LP columnlist RP TAGS LP columnlist RP */ { 242, 1 },
241, /* (113) create_table_args ::= USING ids cpxName TAGS LP tagitemlist RP */ { 242, 4 },
241, /* (114) create_table_args ::= AS select */ { 243, 1 },
242, /* (115) columnlist ::= columnlist COMMA column */ { 243, 2 },
242, /* (116) columnlist ::= column */ { 243, 2 },
244, /* (117) column ::= ids typename */ { 209, 6 },
226, /* (118) tagitemlist ::= tagitemlist COMMA tagitem */ { 244, 3 },
226, /* (119) tagitemlist ::= tagitem */ { 244, 7 },
245, /* (120) tagitem ::= INTEGER */ { 244, 7 },
245, /* (121) tagitem ::= FLOAT */ { 244, 2 },
245, /* (122) tagitem ::= STRING */ { 245, 3 },
245, /* (123) tagitem ::= BOOL */ { 245, 1 },
245, /* (124) tagitem ::= NULL */ { 247, 2 },
245, /* (125) tagitem ::= MINUS INTEGER */ { 228, 3 },
245, /* (126) tagitem ::= MINUS FLOAT */ { 228, 1 },
245, /* (127) tagitem ::= PLUS INTEGER */ { 248, 1 },
245, /* (128) tagitem ::= PLUS FLOAT */ { 248, 1 },
243, /* (129) select ::= SELECT selcollist from where_opt interval_opt fill_opt sliding_opt groupby_opt orderby_opt having_opt slimit_opt limit_opt */ { 248, 1 },
257, /* (130) union ::= select */ { 248, 1 },
257, /* (131) union ::= LP union RP */ { 248, 1 },
257, /* (132) union ::= union UNION ALL select */ { 248, 2 },
257, /* (133) union ::= union UNION ALL LP select RP */ { 248, 2 },
207, /* (134) cmd ::= union */ { 248, 2 },
243, /* (135) select ::= SELECT selcollist */ { 248, 2 },
258, /* (136) sclp ::= selcollist COMMA */ { 246, 12 },
258, /* (137) sclp ::= */ { 260, 1 },
246, /* (138) selcollist ::= sclp expr as */ { 260, 3 },
246, /* (139) selcollist ::= sclp STAR */ { 260, 4 },
260, /* (140) as ::= AS ids */ { 260, 6 },
260, /* (141) as ::= ids */ { 209, 1 },
260, /* (142) as ::= */ { 246, 2 },
247, /* (143) from ::= FROM tablelist */ { 261, 2 },
261, /* (144) tablelist ::= ids cpxName */ { 261, 0 },
261, /* (145) tablelist ::= ids cpxName ids */ { 249, 3 },
261, /* (146) tablelist ::= tablelist COMMA ids cpxName */ { 249, 2 },
261, /* (147) tablelist ::= tablelist COMMA ids cpxName ids */ { 263, 2 },
262, /* (148) tmvar ::= VARIABLE */ { 263, 1 },
249, /* (149) interval_opt ::= INTERVAL LP tmvar RP */ { 263, 0 },
249, /* (150) interval_opt ::= INTERVAL LP tmvar COMMA tmvar RP */ { 250, 2 },
249, /* (151) interval_opt ::= */ { 264, 2 },
250, /* (152) fill_opt ::= */ { 264, 3 },
250, /* (153) fill_opt ::= FILL LP ID COMMA tagitemlist RP */ { 264, 4 },
250, /* (154) fill_opt ::= FILL LP ID RP */ { 264, 5 },
251, /* (155) sliding_opt ::= SLIDING LP tmvar RP */ { 265, 1 },
251, /* (156) sliding_opt ::= */ { 252, 4 },
253, /* (157) orderby_opt ::= */ { 252, 6 },
253, /* (158) orderby_opt ::= ORDER BY sortlist */ { 252, 0 },
263, /* (159) sortlist ::= sortlist COMMA item sortorder */ { 253, 0 },
263, /* (160) sortlist ::= item sortorder */ { 253, 6 },
265, /* (161) item ::= ids cpxName */ { 253, 4 },
266, /* (162) sortorder ::= ASC */ { 254, 4 },
266, /* (163) sortorder ::= DESC */ { 254, 0 },
266, /* (164) sortorder ::= */ { 256, 0 },
252, /* (165) groupby_opt ::= */ { 256, 3 },
252, /* (166) groupby_opt ::= GROUP BY grouplist */ { 266, 4 },
267, /* (167) grouplist ::= grouplist COMMA item */ { 266, 2 },
267, /* (168) grouplist ::= item */ { 268, 2 },
254, /* (169) having_opt ::= */ { 269, 1 },
254, /* (170) having_opt ::= HAVING expr */ { 269, 1 },
256, /* (171) limit_opt ::= */ { 269, 0 },
256, /* (172) limit_opt ::= LIMIT signed */ { 255, 0 },
256, /* (173) limit_opt ::= LIMIT signed OFFSET signed */ { 255, 3 },
256, /* (174) limit_opt ::= LIMIT signed COMMA signed */ { 270, 3 },
255, /* (175) slimit_opt ::= */ { 270, 1 },
255, /* (176) slimit_opt ::= SLIMIT signed */ { 257, 0 },
255, /* (177) slimit_opt ::= SLIMIT signed SOFFSET signed */ { 257, 2 },
255, /* (178) slimit_opt ::= SLIMIT signed COMMA signed */ { 259, 0 },
248, /* (179) where_opt ::= */ { 259, 2 },
248, /* (180) where_opt ::= WHERE expr */ { 259, 4 },
259, /* (181) expr ::= LP expr RP */ { 259, 4 },
259, /* (182) expr ::= ID */ { 258, 0 },
259, /* (183) expr ::= ID DOT ID */ { 258, 2 },
259, /* (184) expr ::= ID DOT STAR */ { 258, 4 },
259, /* (185) expr ::= INTEGER */ { 258, 4 },
259, /* (186) expr ::= MINUS INTEGER */ { 251, 0 },
259, /* (187) expr ::= PLUS INTEGER */ { 251, 2 },
259, /* (188) expr ::= FLOAT */ { 262, 3 },
259, /* (189) expr ::= MINUS FLOAT */ { 262, 1 },
259, /* (190) expr ::= PLUS FLOAT */ { 262, 3 },
259, /* (191) expr ::= STRING */ { 262, 3 },
259, /* (192) expr ::= NOW */ { 262, 1 },
259, /* (193) expr ::= VARIABLE */ { 262, 2 },
259, /* (194) expr ::= BOOL */ { 262, 2 },
259, /* (195) expr ::= ID LP exprlist RP */ { 262, 1 },
259, /* (196) expr ::= ID LP STAR RP */ { 262, 2 },
259, /* (197) expr ::= expr IS NULL */ { 262, 2 },
259, /* (198) expr ::= expr IS NOT NULL */ { 262, 1 },
259, /* (199) expr ::= expr LT expr */ { 262, 1 },
259, /* (200) expr ::= expr GT expr */ { 262, 1 },
259, /* (201) expr ::= expr LE expr */ { 262, 1 },
259, /* (202) expr ::= expr GE expr */ { 262, 4 },
259, /* (203) expr ::= expr NE expr */ { 262, 4 },
259, /* (204) expr ::= expr EQ expr */ { 262, 3 },
259, /* (205) expr ::= expr AND expr */ { 262, 4 },
259, /* (206) expr ::= expr OR expr */ { 262, 3 },
259, /* (207) expr ::= expr PLUS expr */ { 262, 3 },
259, /* (208) expr ::= expr MINUS expr */ { 262, 3 },
259, /* (209) expr ::= expr STAR expr */ { 262, 3 },
259, /* (210) expr ::= expr SLASH expr */ { 262, 3 },
259, /* (211) expr ::= expr REM expr */ { 262, 3 },
259, /* (212) expr ::= expr LIKE expr */ { 262, 3 },
259, /* (213) expr ::= expr IN LP exprlist RP */ { 262, 3 },
268, /* (214) exprlist ::= exprlist COMMA expritem */ { 262, 3 },
268, /* (215) exprlist ::= expritem */ { 262, 3 },
269, /* (216) expritem ::= expr */ { 262, 3 },
269, /* (217) expritem ::= */ { 262, 3 },
207, /* (218) cmd ::= RESET QUERY CACHE */ { 262, 3 },
207, /* (219) cmd ::= ALTER TABLE ids cpxName ADD COLUMN columnlist */ { 262, 3 },
207, /* (220) cmd ::= ALTER TABLE ids cpxName DROP COLUMN ids */ { 262, 5 },
207, /* (221) cmd ::= ALTER TABLE ids cpxName ADD TAG columnlist */ { 271, 3 },
207, /* (222) cmd ::= ALTER TABLE ids cpxName DROP TAG ids */ { 271, 1 },
207, /* (223) cmd ::= ALTER TABLE ids cpxName CHANGE TAG ids ids */ { 272, 1 },
207, /* (224) cmd ::= ALTER TABLE ids cpxName SET TAG ids EQ tagitem */ { 272, 0 },
207, /* (225) cmd ::= KILL CONNECTION INTEGER */ { 209, 3 },
207, /* (226) cmd ::= KILL STREAM INTEGER COLON INTEGER */ { 209, 7 },
207, /* (227) cmd ::= KILL QUERY INTEGER COLON INTEGER */ { 209, 7 },
}; { 209, 7 },
{ 209, 7 },
/* For rule J, yyRuleInfoNRhs[J] contains the negative of the number { 209, 8 },
** of symbols on the right-hand side of that rule. */ { 209, 9 },
static const signed char yyRuleInfoNRhs[] = { { 209, 3 },
-1, /* (0) program ::= cmd */ { 209, 5 },
-2, /* (1) cmd ::= SHOW DATABASES */ { 209, 5 },
-2, /* (2) cmd ::= SHOW MNODES */
-2, /* (3) cmd ::= SHOW DNODES */
-2, /* (4) cmd ::= SHOW ACCOUNTS */
-2, /* (5) cmd ::= SHOW USERS */
-2, /* (6) cmd ::= SHOW MODULES */
-2, /* (7) cmd ::= SHOW QUERIES */
-2, /* (8) cmd ::= SHOW CONNECTIONS */
-2, /* (9) cmd ::= SHOW STREAMS */
-2, /* (10) cmd ::= SHOW VARIABLES */
-2, /* (11) cmd ::= SHOW SCORES */
-2, /* (12) cmd ::= SHOW GRANTS */
-2, /* (13) cmd ::= SHOW VNODES */
-3, /* (14) cmd ::= SHOW VNODES IPTOKEN */
0, /* (15) dbPrefix ::= */
-2, /* (16) dbPrefix ::= ids DOT */
0, /* (17) cpxName ::= */
-2, /* (18) cpxName ::= DOT ids */
-3, /* (19) cmd ::= SHOW dbPrefix TABLES */
-5, /* (20) cmd ::= SHOW dbPrefix TABLES LIKE ids */
-3, /* (21) cmd ::= SHOW dbPrefix STABLES */
-5, /* (22) cmd ::= SHOW dbPrefix STABLES LIKE ids */
-3, /* (23) cmd ::= SHOW dbPrefix VGROUPS */
-4, /* (24) cmd ::= SHOW dbPrefix VGROUPS ids */
-5, /* (25) cmd ::= DROP TABLE ifexists ids cpxName */
-4, /* (26) cmd ::= DROP DATABASE ifexists ids */
-3, /* (27) cmd ::= DROP DNODE ids */
-3, /* (28) cmd ::= DROP USER ids */
-3, /* (29) cmd ::= DROP ACCOUNT ids */
-2, /* (30) cmd ::= USE ids */
-3, /* (31) cmd ::= DESCRIBE ids cpxName */
-5, /* (32) cmd ::= ALTER USER ids PASS ids */
-5, /* (33) cmd ::= ALTER USER ids PRIVILEGE ids */
-4, /* (34) cmd ::= ALTER DNODE ids ids */
-5, /* (35) cmd ::= ALTER DNODE ids ids ids */
-3, /* (36) cmd ::= ALTER LOCAL ids */
-4, /* (37) cmd ::= ALTER LOCAL ids ids */
-4, /* (38) cmd ::= ALTER DATABASE ids alter_db_optr */
-4, /* (39) cmd ::= ALTER ACCOUNT ids acct_optr */
-6, /* (40) cmd ::= ALTER ACCOUNT ids PASS ids acct_optr */
-1, /* (41) ids ::= ID */
-1, /* (42) ids ::= STRING */
-2, /* (43) ifexists ::= IF EXISTS */
0, /* (44) ifexists ::= */
-3, /* (45) ifnotexists ::= IF NOT EXISTS */
0, /* (46) ifnotexists ::= */
-3, /* (47) cmd ::= CREATE DNODE ids */
-6, /* (48) cmd ::= CREATE ACCOUNT ids PASS ids acct_optr */
-5, /* (49) cmd ::= CREATE DATABASE ifnotexists ids db_optr */
-5, /* (50) cmd ::= CREATE USER ids PASS ids */
0, /* (51) pps ::= */
-2, /* (52) pps ::= PPS INTEGER */
0, /* (53) tseries ::= */
-2, /* (54) tseries ::= TSERIES INTEGER */
0, /* (55) dbs ::= */
-2, /* (56) dbs ::= DBS INTEGER */
0, /* (57) streams ::= */
-2, /* (58) streams ::= STREAMS INTEGER */
0, /* (59) storage ::= */
-2, /* (60) storage ::= STORAGE INTEGER */
0, /* (61) qtime ::= */
-2, /* (62) qtime ::= QTIME INTEGER */
0, /* (63) users ::= */
-2, /* (64) users ::= USERS INTEGER */
0, /* (65) conns ::= */
-2, /* (66) conns ::= CONNS INTEGER */
0, /* (67) state ::= */
-2, /* (68) state ::= STATE ids */
-9, /* (69) acct_optr ::= pps tseries storage streams qtime dbs users conns state */
-2, /* (70) keep ::= KEEP tagitemlist */
-2, /* (71) cache ::= CACHE INTEGER */
-2, /* (72) replica ::= REPLICA INTEGER */
-2, /* (73) quorum ::= QUORUM INTEGER */
-2, /* (74) days ::= DAYS INTEGER */
-2, /* (75) minrows ::= MINROWS INTEGER */
-2, /* (76) maxrows ::= MAXROWS INTEGER */
-2, /* (77) blocks ::= BLOCKS INTEGER */
-2, /* (78) ctime ::= CTIME INTEGER */
-2, /* (79) wal ::= WAL INTEGER */
-2, /* (80) fsync ::= FSYNC INTEGER */
-2, /* (81) comp ::= COMP INTEGER */
-2, /* (82) prec ::= PRECISION STRING */
0, /* (83) db_optr ::= */
-2, /* (84) db_optr ::= db_optr cache */
-2, /* (85) db_optr ::= db_optr replica */
-2, /* (86) db_optr ::= db_optr quorum */
-2, /* (87) db_optr ::= db_optr days */
-2, /* (88) db_optr ::= db_optr minrows */
-2, /* (89) db_optr ::= db_optr maxrows */
-2, /* (90) db_optr ::= db_optr blocks */
-2, /* (91) db_optr ::= db_optr ctime */
-2, /* (92) db_optr ::= db_optr wal */
-2, /* (93) db_optr ::= db_optr fsync */
-2, /* (94) db_optr ::= db_optr comp */
-2, /* (95) db_optr ::= db_optr prec */
-2, /* (96) db_optr ::= db_optr keep */
0, /* (97) alter_db_optr ::= */
-2, /* (98) alter_db_optr ::= alter_db_optr replica */
-2, /* (99) alter_db_optr ::= alter_db_optr quorum */
-2, /* (100) alter_db_optr ::= alter_db_optr keep */
-2, /* (101) alter_db_optr ::= alter_db_optr blocks */
-2, /* (102) alter_db_optr ::= alter_db_optr comp */
-2, /* (103) alter_db_optr ::= alter_db_optr wal */
-2, /* (104) alter_db_optr ::= alter_db_optr fsync */
-1, /* (105) typename ::= ids */
-4, /* (106) typename ::= ids LP signed RP */
-1, /* (107) signed ::= INTEGER */
-2, /* (108) signed ::= PLUS INTEGER */
-2, /* (109) signed ::= MINUS INTEGER */
-6, /* (110) cmd ::= CREATE TABLE ifnotexists ids cpxName create_table_args */
-3, /* (111) create_table_args ::= LP columnlist RP */
-7, /* (112) create_table_args ::= LP columnlist RP TAGS LP columnlist RP */
-7, /* (113) create_table_args ::= USING ids cpxName TAGS LP tagitemlist RP */
-2, /* (114) create_table_args ::= AS select */
-3, /* (115) columnlist ::= columnlist COMMA column */
-1, /* (116) columnlist ::= column */
-2, /* (117) column ::= ids typename */
-3, /* (118) tagitemlist ::= tagitemlist COMMA tagitem */
-1, /* (119) tagitemlist ::= tagitem */
-1, /* (120) tagitem ::= INTEGER */
-1, /* (121) tagitem ::= FLOAT */
-1, /* (122) tagitem ::= STRING */
-1, /* (123) tagitem ::= BOOL */
-1, /* (124) tagitem ::= NULL */
-2, /* (125) tagitem ::= MINUS INTEGER */
-2, /* (126) tagitem ::= MINUS FLOAT */
-2, /* (127) tagitem ::= PLUS INTEGER */
-2, /* (128) tagitem ::= PLUS FLOAT */
-12, /* (129) select ::= SELECT selcollist from where_opt interval_opt fill_opt sliding_opt groupby_opt orderby_opt having_opt slimit_opt limit_opt */
-1, /* (130) union ::= select */
-3, /* (131) union ::= LP union RP */
-4, /* (132) union ::= union UNION ALL select */
-6, /* (133) union ::= union UNION ALL LP select RP */
-1, /* (134) cmd ::= union */
-2, /* (135) select ::= SELECT selcollist */
-2, /* (136) sclp ::= selcollist COMMA */
0, /* (137) sclp ::= */
-3, /* (138) selcollist ::= sclp expr as */
-2, /* (139) selcollist ::= sclp STAR */
-2, /* (140) as ::= AS ids */
-1, /* (141) as ::= ids */
0, /* (142) as ::= */
-2, /* (143) from ::= FROM tablelist */
-2, /* (144) tablelist ::= ids cpxName */
-3, /* (145) tablelist ::= ids cpxName ids */
-4, /* (146) tablelist ::= tablelist COMMA ids cpxName */
-5, /* (147) tablelist ::= tablelist COMMA ids cpxName ids */
-1, /* (148) tmvar ::= VARIABLE */
-4, /* (149) interval_opt ::= INTERVAL LP tmvar RP */
-6, /* (150) interval_opt ::= INTERVAL LP tmvar COMMA tmvar RP */
0, /* (151) interval_opt ::= */
0, /* (152) fill_opt ::= */
-6, /* (153) fill_opt ::= FILL LP ID COMMA tagitemlist RP */
-4, /* (154) fill_opt ::= FILL LP ID RP */
-4, /* (155) sliding_opt ::= SLIDING LP tmvar RP */
0, /* (156) sliding_opt ::= */
0, /* (157) orderby_opt ::= */
-3, /* (158) orderby_opt ::= ORDER BY sortlist */
-4, /* (159) sortlist ::= sortlist COMMA item sortorder */
-2, /* (160) sortlist ::= item sortorder */
-2, /* (161) item ::= ids cpxName */
-1, /* (162) sortorder ::= ASC */
-1, /* (163) sortorder ::= DESC */
0, /* (164) sortorder ::= */
0, /* (165) groupby_opt ::= */
-3, /* (166) groupby_opt ::= GROUP BY grouplist */
-3, /* (167) grouplist ::= grouplist COMMA item */
-1, /* (168) grouplist ::= item */
0, /* (169) having_opt ::= */
-2, /* (170) having_opt ::= HAVING expr */
0, /* (171) limit_opt ::= */
-2, /* (172) limit_opt ::= LIMIT signed */
-4, /* (173) limit_opt ::= LIMIT signed OFFSET signed */
-4, /* (174) limit_opt ::= LIMIT signed COMMA signed */
0, /* (175) slimit_opt ::= */
-2, /* (176) slimit_opt ::= SLIMIT signed */
-4, /* (177) slimit_opt ::= SLIMIT signed SOFFSET signed */
-4, /* (178) slimit_opt ::= SLIMIT signed COMMA signed */
0, /* (179) where_opt ::= */
-2, /* (180) where_opt ::= WHERE expr */
-3, /* (181) expr ::= LP expr RP */
-1, /* (182) expr ::= ID */
-3, /* (183) expr ::= ID DOT ID */
-3, /* (184) expr ::= ID DOT STAR */
-1, /* (185) expr ::= INTEGER */
-2, /* (186) expr ::= MINUS INTEGER */
-2, /* (187) expr ::= PLUS INTEGER */
-1, /* (188) expr ::= FLOAT */
-2, /* (189) expr ::= MINUS FLOAT */
-2, /* (190) expr ::= PLUS FLOAT */
-1, /* (191) expr ::= STRING */
-1, /* (192) expr ::= NOW */
-1, /* (193) expr ::= VARIABLE */
-1, /* (194) expr ::= BOOL */
-4, /* (195) expr ::= ID LP exprlist RP */
-4, /* (196) expr ::= ID LP STAR RP */
-3, /* (197) expr ::= expr IS NULL */
-4, /* (198) expr ::= expr IS NOT NULL */
-3, /* (199) expr ::= expr LT expr */
-3, /* (200) expr ::= expr GT expr */
-3, /* (201) expr ::= expr LE expr */
-3, /* (202) expr ::= expr GE expr */
-3, /* (203) expr ::= expr NE expr */
-3, /* (204) expr ::= expr EQ expr */
-3, /* (205) expr ::= expr AND expr */
-3, /* (206) expr ::= expr OR expr */
-3, /* (207) expr ::= expr PLUS expr */
-3, /* (208) expr ::= expr MINUS expr */
-3, /* (209) expr ::= expr STAR expr */
-3, /* (210) expr ::= expr SLASH expr */
-3, /* (211) expr ::= expr REM expr */
-3, /* (212) expr ::= expr LIKE expr */
-5, /* (213) expr ::= expr IN LP exprlist RP */
-3, /* (214) exprlist ::= exprlist COMMA expritem */
-1, /* (215) exprlist ::= expritem */
-1, /* (216) expritem ::= expr */
0, /* (217) expritem ::= */
-3, /* (218) cmd ::= RESET QUERY CACHE */
-7, /* (219) cmd ::= ALTER TABLE ids cpxName ADD COLUMN columnlist */
-7, /* (220) cmd ::= ALTER TABLE ids cpxName DROP COLUMN ids */
-7, /* (221) cmd ::= ALTER TABLE ids cpxName ADD TAG columnlist */
-7, /* (222) cmd ::= ALTER TABLE ids cpxName DROP TAG ids */
-8, /* (223) cmd ::= ALTER TABLE ids cpxName CHANGE TAG ids ids */
-9, /* (224) cmd ::= ALTER TABLE ids cpxName SET TAG ids EQ tagitem */
-3, /* (225) cmd ::= KILL CONNECTION INTEGER */
-5, /* (226) cmd ::= KILL STREAM INTEGER COLON INTEGER */
-5, /* (227) cmd ::= KILL QUERY INTEGER COLON INTEGER */
}; };
static void yy_accept(yyParser*); /* Forward Declaration */ static void yy_accept(yyParser*); /* Forward Declaration */
...@@ -2169,76 +1602,43 @@ static void yy_accept(yyParser*); /* Forward Declaration */ ...@@ -2169,76 +1602,43 @@ static void yy_accept(yyParser*); /* Forward Declaration */
/* /*
** Perform a reduce action and the shift that must immediately ** Perform a reduce action and the shift that must immediately
** follow the reduce. ** follow the reduce.
**
** The yyLookahead and yyLookaheadToken parameters provide reduce actions
** access to the lookahead token (if any). The yyLookahead will be YYNOCODE
** if the lookahead token has already been consumed. As this procedure is
** 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 */ yyParser *yypParser, /* The parser */
unsigned int yyruleno, /* Number of the rule by which to reduce */ 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 */ int yygoto; /* The next state */
YYACTIONTYPE yyact; /* The next action */ int yyact; /* The next action */
YYMINORTYPE yygotominor; /* The LHS of the rule reduced */
yyStackEntry *yymsp; /* The top of the parser's stack */ yyStackEntry *yymsp; /* The top of the parser's stack */
int yysize; /* Amount to pop the stack */ int yysize; /* Amount to pop the stack */
ParseARG_FETCH ParseARG_FETCH;
(void)yyLookahead; yymsp = &yypParser->yystack[yypParser->yyidx];
(void)yyLookaheadToken;
yymsp = yypParser->yytos;
#ifndef NDEBUG #ifndef NDEBUG
if( yyTraceFILE && yyruleno<(int)(sizeof(yyRuleName)/sizeof(yyRuleName[0])) ){ if( yyTraceFILE && yyruleno>=0
yysize = yyRuleInfoNRhs[yyruleno]; && yyruleno<(int)(sizeof(yyRuleName)/sizeof(yyRuleName[0])) ){
if( yysize ){ fprintf(yyTraceFILE, "%sReduce [%s].\n", yyTracePrompt,
fprintf(yyTraceFILE, "%sReduce %d [%s]%s, pop back to state %d.\n", yyRuleName[yyruleno]);
yyTracePrompt,
yyruleno, yyRuleName[yyruleno],
yyruleno<YYNRULE_WITH_ACTION ? "" : " without external action",
yymsp[yysize].stateno);
}else{
fprintf(yyTraceFILE, "%sReduce %d [%s]%s.\n",
yyTracePrompt, yyruleno, yyRuleName[yyruleno],
yyruleno<YYNRULE_WITH_ACTION ? "" : " without external action");
}
} }
#endif /* NDEBUG */ #endif /* NDEBUG */
/* Check that the stack is large enough to grow by a single entry /* Silence complaints from purify about yygotominor being uninitialized
** if the RHS of the rule is empty. This ensures that there is room ** in some cases when it is copied into the stack after the following
** enough on the stack to push the LHS value */ ** switch. yygotominor is uninitialized when a rule reduces that does
if( yyRuleInfoNRhs[yyruleno]==0 ){ ** not set the value of its left-hand side nonterminal. Leaving the
#ifdef YYTRACKMAXSTACKDEPTH ** value of the nonterminal uninitialized is utterly harmless as long
if( (int)(yypParser->yytos - yypParser->yystack)>yypParser->yyhwm ){ ** as the value is never used. So really the only thing this code
yypParser->yyhwm++; ** accomplishes is to quieten purify.
assert( yypParser->yyhwm == (int)(yypParser->yytos - yypParser->yystack)); **
} ** 2007-01-16: The wireshark project (www.wireshark.org) reports that
#endif ** without this code, their parser segfaults. I'm not sure what there
#if YYSTACKDEPTH>0 ** parser is doing to make this happen. This is the second bug report
if( yypParser->yytos>=yypParser->yystackEnd ){ ** from wireshark this week. Clearly they are stressing Lemon in ways
yyStackOverflow(yypParser); ** that it has not been previously stressed... (SQLite ticket #2172)
/* The call to yyStackOverflow() above pops the stack until it is */
** empty, causing the main parser loop to exit. So the return value /*memset(&yygotominor, 0, sizeof(yygotominor));*/
** is never used and does not matter. */ yygotominor = yyzerominor;
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 ){ switch( yyruleno ){
/* Beginning here are the reduction cases. A typical example /* Beginning here are the reduction cases. A typical example
...@@ -2249,8 +1649,6 @@ static YYACTIONTYPE yy_reduce( ...@@ -2249,8 +1649,6 @@ static YYACTIONTYPE yy_reduce(
** #line <lineno> <thisfile> ** #line <lineno> <thisfile>
** break; ** break;
*/ */
/********** Begin reduce actions **********************************************/
YYMINORTYPE yylhsminor;
case 0: /* program ::= cmd */ case 0: /* program ::= cmd */
{} {}
break; break;
...@@ -2297,17 +1695,16 @@ static YYACTIONTYPE yy_reduce( ...@@ -2297,17 +1695,16 @@ static YYACTIONTYPE yy_reduce(
{ setShowOptions(pInfo, TSDB_MGMT_TABLE_VNODES, &yymsp[0].minor.yy0, 0); } { setShowOptions(pInfo, TSDB_MGMT_TABLE_VNODES, &yymsp[0].minor.yy0, 0); }
break; break;
case 15: /* dbPrefix ::= */ case 15: /* dbPrefix ::= */
{yymsp[1].minor.yy0.n = 0; yymsp[1].minor.yy0.type = 0;} {yygotominor.yy0.n = 0; yygotominor.yy0.type = 0;}
break; break;
case 16: /* dbPrefix ::= ids DOT */ case 16: /* dbPrefix ::= ids DOT */
{yylhsminor.yy0 = yymsp[-1].minor.yy0; } {yygotominor.yy0 = yymsp[-1].minor.yy0; }
yymsp[-1].minor.yy0 = yylhsminor.yy0;
break; break;
case 17: /* cpxName ::= */ case 17: /* cpxName ::= */
{yymsp[1].minor.yy0.n = 0; } {yygotominor.yy0.n = 0; }
break; break;
case 18: /* cpxName ::= DOT ids */ case 18: /* cpxName ::= DOT ids */
{yymsp[-1].minor.yy0 = yymsp[0].minor.yy0; yymsp[-1].minor.yy0.n += 1; } {yygotominor.yy0 = yymsp[0].minor.yy0; yygotominor.yy0.n += 1; }
break; break;
case 19: /* cmd ::= SHOW dbPrefix TABLES */ case 19: /* cmd ::= SHOW dbPrefix TABLES */
{ {
...@@ -2391,37 +1788,34 @@ static YYACTIONTYPE yy_reduce( ...@@ -2391,37 +1788,34 @@ static YYACTIONTYPE yy_reduce(
{ setDCLSQLElems(pInfo, TSDB_SQL_CFG_LOCAL, 2, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0); } { setDCLSQLElems(pInfo, TSDB_SQL_CFG_LOCAL, 2, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0); }
break; break;
case 38: /* cmd ::= ALTER DATABASE ids alter_db_optr */ case 38: /* cmd ::= ALTER DATABASE ids alter_db_optr */
{ SStrToken t = {0}; setCreateDBSQL(pInfo, TSDB_SQL_ALTER_DB, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy118, &t);} { SStrToken t = {0}; setCreateDBSQL(pInfo, TSDB_SQL_ALTER_DB, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy268, &t);}
break; break;
case 39: /* cmd ::= ALTER ACCOUNT ids acct_optr */ case 39: /* cmd ::= ALTER ACCOUNT ids acct_optr */
{ setCreateAcctSQL(pInfo, TSDB_SQL_ALTER_ACCT, &yymsp[-1].minor.yy0, NULL, &yymsp[0].minor.yy479);} { setCreateAcctSQL(pInfo, TSDB_SQL_ALTER_ACCT, &yymsp[-1].minor.yy0, NULL, &yymsp[0].minor.yy149);}
break; break;
case 40: /* cmd ::= ALTER ACCOUNT ids PASS ids acct_optr */ case 40: /* cmd ::= ALTER ACCOUNT ids PASS ids acct_optr */
{ setCreateAcctSQL(pInfo, TSDB_SQL_ALTER_ACCT, &yymsp[-3].minor.yy0, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy479);} { setCreateAcctSQL(pInfo, TSDB_SQL_ALTER_ACCT, &yymsp[-3].minor.yy0, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy149);}
break; break;
case 41: /* ids ::= ID */ case 41: /* ids ::= ID */
case 42: /* ids ::= STRING */ yytestcase(yyruleno==42); case 42: /* ids ::= STRING */ yytestcase(yyruleno==42);
{yylhsminor.yy0 = yymsp[0].minor.yy0; } {yygotominor.yy0 = yymsp[0].minor.yy0; }
yymsp[0].minor.yy0 = yylhsminor.yy0;
break; break;
case 43: /* ifexists ::= IF EXISTS */ case 43: /* ifexists ::= IF EXISTS */
{yymsp[-1].minor.yy0.n = 1;} case 45: /* ifnotexists ::= IF NOT EXISTS */ yytestcase(yyruleno==45);
{yygotominor.yy0.n = 1;}
break; break;
case 44: /* ifexists ::= */ case 44: /* ifexists ::= */
case 46: /* ifnotexists ::= */ yytestcase(yyruleno==46); case 46: /* ifnotexists ::= */ yytestcase(yyruleno==46);
{yymsp[1].minor.yy0.n = 0;} {yygotominor.yy0.n = 0;}
break;
case 45: /* ifnotexists ::= IF NOT EXISTS */
{yymsp[-2].minor.yy0.n = 1;}
break; break;
case 47: /* cmd ::= CREATE DNODE ids */ case 47: /* cmd ::= CREATE DNODE ids */
{ setDCLSQLElems(pInfo, TSDB_SQL_CREATE_DNODE, 1, &yymsp[0].minor.yy0);} { setDCLSQLElems(pInfo, TSDB_SQL_CREATE_DNODE, 1, &yymsp[0].minor.yy0);}
break; break;
case 48: /* cmd ::= CREATE ACCOUNT ids PASS ids acct_optr */ case 48: /* cmd ::= CREATE ACCOUNT ids PASS ids acct_optr */
{ setCreateAcctSQL(pInfo, TSDB_SQL_CREATE_ACCT, &yymsp[-3].minor.yy0, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy479);} { setCreateAcctSQL(pInfo, TSDB_SQL_CREATE_ACCT, &yymsp[-3].minor.yy0, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy149);}
break; break;
case 49: /* cmd ::= CREATE DATABASE ifnotexists ids db_optr */ case 49: /* cmd ::= CREATE DATABASE ifnotexists ids db_optr */
{ setCreateDBSQL(pInfo, TSDB_SQL_CREATE_DB, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy118, &yymsp[-2].minor.yy0);} { setCreateDBSQL(pInfo, TSDB_SQL_CREATE_DB, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy268, &yymsp[-2].minor.yy0);}
break; break;
case 50: /* cmd ::= CREATE USER ids PASS ids */ case 50: /* cmd ::= CREATE USER ids PASS ids */
{ setCreateUserSQL(pInfo, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0);} { setCreateUserSQL(pInfo, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0);}
...@@ -2435,7 +1829,7 @@ static YYACTIONTYPE yy_reduce( ...@@ -2435,7 +1829,7 @@ static YYACTIONTYPE yy_reduce(
case 63: /* users ::= */ yytestcase(yyruleno==63); case 63: /* users ::= */ yytestcase(yyruleno==63);
case 65: /* conns ::= */ yytestcase(yyruleno==65); case 65: /* conns ::= */ yytestcase(yyruleno==65);
case 67: /* state ::= */ yytestcase(yyruleno==67); case 67: /* state ::= */ yytestcase(yyruleno==67);
{yymsp[1].minor.yy0.n = 0; } {yygotominor.yy0.n = 0; }
break; break;
case 52: /* pps ::= PPS INTEGER */ case 52: /* pps ::= PPS INTEGER */
case 54: /* tseries ::= TSERIES INTEGER */ yytestcase(yyruleno==54); case 54: /* tseries ::= TSERIES INTEGER */ yytestcase(yyruleno==54);
...@@ -2446,24 +1840,23 @@ static YYACTIONTYPE yy_reduce( ...@@ -2446,24 +1840,23 @@ static YYACTIONTYPE yy_reduce(
case 64: /* users ::= USERS INTEGER */ yytestcase(yyruleno==64); case 64: /* users ::= USERS INTEGER */ yytestcase(yyruleno==64);
case 66: /* conns ::= CONNS INTEGER */ yytestcase(yyruleno==66); case 66: /* conns ::= CONNS INTEGER */ yytestcase(yyruleno==66);
case 68: /* state ::= STATE ids */ yytestcase(yyruleno==68); case 68: /* state ::= STATE ids */ yytestcase(yyruleno==68);
{yymsp[-1].minor.yy0 = yymsp[0].minor.yy0; } {yygotominor.yy0 = yymsp[0].minor.yy0; }
break; break;
case 69: /* acct_optr ::= pps tseries storage streams qtime dbs users conns state */ case 69: /* acct_optr ::= pps tseries storage streams qtime dbs users conns state */
{ {
yylhsminor.yy479.maxUsers = (yymsp[-2].minor.yy0.n>0)?atoi(yymsp[-2].minor.yy0.z):-1; yygotominor.yy149.maxUsers = (yymsp[-2].minor.yy0.n>0)?atoi(yymsp[-2].minor.yy0.z):-1;
yylhsminor.yy479.maxDbs = (yymsp[-3].minor.yy0.n>0)?atoi(yymsp[-3].minor.yy0.z):-1; yygotominor.yy149.maxDbs = (yymsp[-3].minor.yy0.n>0)?atoi(yymsp[-3].minor.yy0.z):-1;
yylhsminor.yy479.maxTimeSeries = (yymsp[-7].minor.yy0.n>0)?atoi(yymsp[-7].minor.yy0.z):-1; yygotominor.yy149.maxTimeSeries = (yymsp[-7].minor.yy0.n>0)?atoi(yymsp[-7].minor.yy0.z):-1;
yylhsminor.yy479.maxStreams = (yymsp[-5].minor.yy0.n>0)?atoi(yymsp[-5].minor.yy0.z):-1; yygotominor.yy149.maxStreams = (yymsp[-5].minor.yy0.n>0)?atoi(yymsp[-5].minor.yy0.z):-1;
yylhsminor.yy479.maxPointsPerSecond = (yymsp[-8].minor.yy0.n>0)?atoi(yymsp[-8].minor.yy0.z):-1; yygotominor.yy149.maxPointsPerSecond = (yymsp[-8].minor.yy0.n>0)?atoi(yymsp[-8].minor.yy0.z):-1;
yylhsminor.yy479.maxStorage = (yymsp[-6].minor.yy0.n>0)?strtoll(yymsp[-6].minor.yy0.z, NULL, 10):-1; yygotominor.yy149.maxStorage = (yymsp[-6].minor.yy0.n>0)?strtoll(yymsp[-6].minor.yy0.z, NULL, 10):-1;
yylhsminor.yy479.maxQueryTime = (yymsp[-4].minor.yy0.n>0)?strtoll(yymsp[-4].minor.yy0.z, NULL, 10):-1; yygotominor.yy149.maxQueryTime = (yymsp[-4].minor.yy0.n>0)?strtoll(yymsp[-4].minor.yy0.z, NULL, 10):-1;
yylhsminor.yy479.maxConnections = (yymsp[-1].minor.yy0.n>0)?atoi(yymsp[-1].minor.yy0.z):-1; yygotominor.yy149.maxConnections = (yymsp[-1].minor.yy0.n>0)?atoi(yymsp[-1].minor.yy0.z):-1;
yylhsminor.yy479.stat = yymsp[0].minor.yy0; yygotominor.yy149.stat = yymsp[0].minor.yy0;
} }
yymsp[-8].minor.yy479 = yylhsminor.yy479;
break; break;
case 70: /* keep ::= KEEP tagitemlist */ case 70: /* keep ::= KEEP tagitemlist */
{ yymsp[-1].minor.yy156 = yymsp[0].minor.yy156; } { yygotominor.yy498 = yymsp[0].minor.yy498; }
break; break;
case 71: /* cache ::= CACHE INTEGER */ case 71: /* cache ::= CACHE INTEGER */
case 72: /* replica ::= REPLICA INTEGER */ yytestcase(yyruleno==72); case 72: /* replica ::= REPLICA INTEGER */ yytestcase(yyruleno==72);
...@@ -2477,540 +1870,461 @@ static YYACTIONTYPE yy_reduce( ...@@ -2477,540 +1870,461 @@ static YYACTIONTYPE yy_reduce(
case 80: /* fsync ::= FSYNC INTEGER */ yytestcase(yyruleno==80); case 80: /* fsync ::= FSYNC INTEGER */ yytestcase(yyruleno==80);
case 81: /* comp ::= COMP INTEGER */ yytestcase(yyruleno==81); case 81: /* comp ::= COMP INTEGER */ yytestcase(yyruleno==81);
case 82: /* prec ::= PRECISION STRING */ yytestcase(yyruleno==82); case 82: /* prec ::= PRECISION STRING */ yytestcase(yyruleno==82);
{ yymsp[-1].minor.yy0 = yymsp[0].minor.yy0; } case 83: /* update ::= UPDATE INTEGER */ yytestcase(yyruleno==83);
break; { yygotominor.yy0 = yymsp[0].minor.yy0; }
case 83: /* db_optr ::= */ break;
{setDefaultCreateDbOption(&yymsp[1].minor.yy118);} case 84: /* db_optr ::= */
break; {setDefaultCreateDbOption(&yygotominor.yy268);}
case 84: /* db_optr ::= db_optr cache */ break;
{ yylhsminor.yy118 = yymsp[-1].minor.yy118; yylhsminor.yy118.cacheBlockSize = strtol(yymsp[0].minor.yy0.z, NULL, 10); } case 85: /* db_optr ::= db_optr cache */
yymsp[-1].minor.yy118 = yylhsminor.yy118; { yygotominor.yy268 = yymsp[-1].minor.yy268; yygotominor.yy268.cacheBlockSize = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
break; break;
case 85: /* db_optr ::= db_optr replica */ case 86: /* db_optr ::= db_optr replica */
case 98: /* alter_db_optr ::= alter_db_optr replica */ yytestcase(yyruleno==98); case 100: /* alter_db_optr ::= alter_db_optr replica */ yytestcase(yyruleno==100);
{ yylhsminor.yy118 = yymsp[-1].minor.yy118; yylhsminor.yy118.replica = strtol(yymsp[0].minor.yy0.z, NULL, 10); } { yygotominor.yy268 = yymsp[-1].minor.yy268; yygotominor.yy268.replica = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
yymsp[-1].minor.yy118 = yylhsminor.yy118; break;
break; case 87: /* db_optr ::= db_optr quorum */
case 86: /* db_optr ::= db_optr quorum */ case 101: /* alter_db_optr ::= alter_db_optr quorum */ yytestcase(yyruleno==101);
case 99: /* alter_db_optr ::= alter_db_optr quorum */ yytestcase(yyruleno==99); { yygotominor.yy268 = yymsp[-1].minor.yy268; yygotominor.yy268.quorum = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
{ yylhsminor.yy118 = yymsp[-1].minor.yy118; yylhsminor.yy118.quorum = strtol(yymsp[0].minor.yy0.z, NULL, 10); } break;
yymsp[-1].minor.yy118 = yylhsminor.yy118; case 88: /* db_optr ::= db_optr days */
break; { yygotominor.yy268 = yymsp[-1].minor.yy268; yygotominor.yy268.daysPerFile = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
case 87: /* db_optr ::= db_optr days */ break;
{ yylhsminor.yy118 = yymsp[-1].minor.yy118; yylhsminor.yy118.daysPerFile = strtol(yymsp[0].minor.yy0.z, NULL, 10); } case 89: /* db_optr ::= db_optr minrows */
yymsp[-1].minor.yy118 = yylhsminor.yy118; { yygotominor.yy268 = yymsp[-1].minor.yy268; yygotominor.yy268.minRowsPerBlock = strtod(yymsp[0].minor.yy0.z, NULL); }
break; break;
case 88: /* db_optr ::= db_optr minrows */ case 90: /* db_optr ::= db_optr maxrows */
{ yylhsminor.yy118 = yymsp[-1].minor.yy118; yylhsminor.yy118.minRowsPerBlock = strtod(yymsp[0].minor.yy0.z, NULL); } { yygotominor.yy268 = yymsp[-1].minor.yy268; yygotominor.yy268.maxRowsPerBlock = strtod(yymsp[0].minor.yy0.z, NULL); }
yymsp[-1].minor.yy118 = yylhsminor.yy118; break;
break; case 91: /* db_optr ::= db_optr blocks */
case 89: /* db_optr ::= db_optr maxrows */ case 103: /* alter_db_optr ::= alter_db_optr blocks */ yytestcase(yyruleno==103);
{ yylhsminor.yy118 = yymsp[-1].minor.yy118; yylhsminor.yy118.maxRowsPerBlock = strtod(yymsp[0].minor.yy0.z, NULL); } { yygotominor.yy268 = yymsp[-1].minor.yy268; yygotominor.yy268.numOfBlocks = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
yymsp[-1].minor.yy118 = yylhsminor.yy118; break;
break; case 92: /* db_optr ::= db_optr ctime */
case 90: /* db_optr ::= db_optr blocks */ { yygotominor.yy268 = yymsp[-1].minor.yy268; yygotominor.yy268.commitTime = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
case 101: /* alter_db_optr ::= alter_db_optr blocks */ yytestcase(yyruleno==101); break;
{ yylhsminor.yy118 = yymsp[-1].minor.yy118; yylhsminor.yy118.numOfBlocks = strtol(yymsp[0].minor.yy0.z, NULL, 10); } case 93: /* db_optr ::= db_optr wal */
yymsp[-1].minor.yy118 = yylhsminor.yy118; case 105: /* alter_db_optr ::= alter_db_optr wal */ yytestcase(yyruleno==105);
break; { yygotominor.yy268 = yymsp[-1].minor.yy268; yygotominor.yy268.walLevel = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
case 91: /* db_optr ::= db_optr ctime */ break;
{ yylhsminor.yy118 = yymsp[-1].minor.yy118; yylhsminor.yy118.commitTime = strtol(yymsp[0].minor.yy0.z, NULL, 10); } case 94: /* db_optr ::= db_optr fsync */
yymsp[-1].minor.yy118 = yylhsminor.yy118; case 106: /* alter_db_optr ::= alter_db_optr fsync */ yytestcase(yyruleno==106);
break; { yygotominor.yy268 = yymsp[-1].minor.yy268; yygotominor.yy268.fsyncPeriod = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
case 92: /* db_optr ::= db_optr wal */ break;
case 103: /* alter_db_optr ::= alter_db_optr wal */ yytestcase(yyruleno==103); case 95: /* db_optr ::= db_optr comp */
{ yylhsminor.yy118 = yymsp[-1].minor.yy118; yylhsminor.yy118.walLevel = strtol(yymsp[0].minor.yy0.z, NULL, 10); } case 104: /* alter_db_optr ::= alter_db_optr comp */ yytestcase(yyruleno==104);
yymsp[-1].minor.yy118 = yylhsminor.yy118; { yygotominor.yy268 = yymsp[-1].minor.yy268; yygotominor.yy268.compressionLevel = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
break; break;
case 93: /* db_optr ::= db_optr fsync */ case 96: /* db_optr ::= db_optr prec */
case 104: /* alter_db_optr ::= alter_db_optr fsync */ yytestcase(yyruleno==104); { yygotominor.yy268 = yymsp[-1].minor.yy268; yygotominor.yy268.precision = yymsp[0].minor.yy0; }
{ yylhsminor.yy118 = yymsp[-1].minor.yy118; yylhsminor.yy118.fsyncPeriod = strtol(yymsp[0].minor.yy0.z, NULL, 10); } break;
yymsp[-1].minor.yy118 = yylhsminor.yy118; case 97: /* db_optr ::= db_optr keep */
break; case 102: /* alter_db_optr ::= alter_db_optr keep */ yytestcase(yyruleno==102);
case 94: /* db_optr ::= db_optr comp */ { yygotominor.yy268 = yymsp[-1].minor.yy268; yygotominor.yy268.keep = yymsp[0].minor.yy498; }
case 102: /* alter_db_optr ::= alter_db_optr comp */ yytestcase(yyruleno==102); break;
{ yylhsminor.yy118 = yymsp[-1].minor.yy118; yylhsminor.yy118.compressionLevel = strtol(yymsp[0].minor.yy0.z, NULL, 10); } case 98: /* db_optr ::= db_optr update */
yymsp[-1].minor.yy118 = yylhsminor.yy118; case 107: /* alter_db_optr ::= alter_db_optr update */ yytestcase(yyruleno==107);
break; { yygotominor.yy268 = yymsp[-1].minor.yy268; yygotominor.yy268.update = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
case 95: /* db_optr ::= db_optr prec */ break;
{ yylhsminor.yy118 = yymsp[-1].minor.yy118; yylhsminor.yy118.precision = yymsp[0].minor.yy0; } case 99: /* alter_db_optr ::= */
yymsp[-1].minor.yy118 = yylhsminor.yy118; { setDefaultCreateDbOption(&yygotominor.yy268);}
break; break;
case 96: /* db_optr ::= db_optr keep */ case 108: /* typename ::= ids */
case 100: /* alter_db_optr ::= alter_db_optr keep */ yytestcase(yyruleno==100);
{ yylhsminor.yy118 = yymsp[-1].minor.yy118; yylhsminor.yy118.keep = yymsp[0].minor.yy156; }
yymsp[-1].minor.yy118 = yylhsminor.yy118;
break;
case 97: /* alter_db_optr ::= */
{ setDefaultCreateDbOption(&yymsp[1].minor.yy118);}
break;
case 105: /* typename ::= ids */
{ {
yymsp[0].minor.yy0.type = 0; yymsp[0].minor.yy0.type = 0;
tSQLSetColumnType (&yylhsminor.yy343, &yymsp[0].minor.yy0); tSQLSetColumnType (&yygotominor.yy223, &yymsp[0].minor.yy0);
} }
yymsp[0].minor.yy343 = yylhsminor.yy343;
break; break;
case 106: /* typename ::= ids LP signed RP */ case 109: /* typename ::= ids LP signed RP */
{ {
if (yymsp[-1].minor.yy369 <= 0) { if (yymsp[-1].minor.yy207 <= 0) {
yymsp[-3].minor.yy0.type = 0; yymsp[-3].minor.yy0.type = 0;
tSQLSetColumnType(&yylhsminor.yy343, &yymsp[-3].minor.yy0); tSQLSetColumnType(&yygotominor.yy223, &yymsp[-3].minor.yy0);
} else { } else {
yymsp[-3].minor.yy0.type = -yymsp[-1].minor.yy369; // negative value of name length yymsp[-3].minor.yy0.type = -yymsp[-1].minor.yy207; // negative value of name length
tSQLSetColumnType(&yylhsminor.yy343, &yymsp[-3].minor.yy0); tSQLSetColumnType(&yygotominor.yy223, &yymsp[-3].minor.yy0);
} }
} }
yymsp[-3].minor.yy343 = yylhsminor.yy343;
break; break;
case 107: /* signed ::= INTEGER */ case 110: /* signed ::= INTEGER */
{ yylhsminor.yy369 = strtol(yymsp[0].minor.yy0.z, NULL, 10); } case 111: /* signed ::= PLUS INTEGER */ yytestcase(yyruleno==111);
yymsp[0].minor.yy369 = yylhsminor.yy369; { yygotominor.yy207 = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
break; break;
case 108: /* signed ::= PLUS INTEGER */ case 112: /* signed ::= MINUS INTEGER */
{ yymsp[-1].minor.yy369 = strtol(yymsp[0].minor.yy0.z, NULL, 10); } { yygotominor.yy207 = -strtol(yymsp[0].minor.yy0.z, NULL, 10);}
break; break;
case 109: /* signed ::= MINUS INTEGER */ case 113: /* cmd ::= CREATE TABLE ifnotexists ids cpxName create_table_args */
{ yymsp[-1].minor.yy369 = -strtol(yymsp[0].minor.yy0.z, NULL, 10);}
break;
case 110: /* cmd ::= CREATE TABLE ifnotexists ids cpxName create_table_args */
{ {
yymsp[-2].minor.yy0.n += yymsp[-1].minor.yy0.n; yymsp[-2].minor.yy0.n += yymsp[-1].minor.yy0.n;
setCreatedTableName(pInfo, &yymsp[-2].minor.yy0, &yymsp[-3].minor.yy0); setCreatedTableName(pInfo, &yymsp[-2].minor.yy0, &yymsp[-3].minor.yy0);
} }
break; break;
case 111: /* create_table_args ::= LP columnlist RP */ case 114: /* create_table_args ::= LP columnlist RP */
{ {
yymsp[-2].minor.yy398 = tSetCreateSQLElems(yymsp[-1].minor.yy511, NULL, NULL, NULL, NULL, TSQL_CREATE_TABLE); yygotominor.yy470 = tSetCreateSQLElems(yymsp[-1].minor.yy523, NULL, NULL, NULL, NULL, TSQL_CREATE_TABLE);
setSQLInfo(pInfo, yymsp[-2].minor.yy398, NULL, TSDB_SQL_CREATE_TABLE); setSQLInfo(pInfo, yygotominor.yy470, NULL, TSDB_SQL_CREATE_TABLE);
} }
break; break;
case 112: /* create_table_args ::= LP columnlist RP TAGS LP columnlist RP */ case 115: /* create_table_args ::= LP columnlist RP TAGS LP columnlist RP */
{ {
yymsp[-6].minor.yy398 = tSetCreateSQLElems(yymsp[-5].minor.yy511, yymsp[-1].minor.yy511, NULL, NULL, NULL, TSQL_CREATE_STABLE); yygotominor.yy470 = tSetCreateSQLElems(yymsp[-5].minor.yy523, yymsp[-1].minor.yy523, NULL, NULL, NULL, TSQL_CREATE_STABLE);
setSQLInfo(pInfo, yymsp[-6].minor.yy398, NULL, TSDB_SQL_CREATE_TABLE); setSQLInfo(pInfo, yygotominor.yy470, NULL, TSDB_SQL_CREATE_TABLE);
} }
break; break;
case 113: /* create_table_args ::= USING ids cpxName TAGS LP tagitemlist RP */ case 116: /* create_table_args ::= USING ids cpxName TAGS LP tagitemlist RP */
{ {
yymsp[-5].minor.yy0.n += yymsp[-4].minor.yy0.n; yymsp[-5].minor.yy0.n += yymsp[-4].minor.yy0.n;
yymsp[-6].minor.yy398 = tSetCreateSQLElems(NULL, NULL, &yymsp[-5].minor.yy0, yymsp[-1].minor.yy156, NULL, TSQL_CREATE_TABLE_FROM_STABLE); yygotominor.yy470 = tSetCreateSQLElems(NULL, NULL, &yymsp[-5].minor.yy0, yymsp[-1].minor.yy498, NULL, TSQL_CREATE_TABLE_FROM_STABLE);
setSQLInfo(pInfo, yymsp[-6].minor.yy398, NULL, TSDB_SQL_CREATE_TABLE); setSQLInfo(pInfo, yygotominor.yy470, NULL, TSDB_SQL_CREATE_TABLE);
} }
break; break;
case 114: /* create_table_args ::= AS select */ case 117: /* create_table_args ::= AS select */
{ {
yymsp[-1].minor.yy398 = tSetCreateSQLElems(NULL, NULL, NULL, NULL, yymsp[0].minor.yy444, TSQL_CREATE_STREAM); yygotominor.yy470 = tSetCreateSQLElems(NULL, NULL, NULL, NULL, yymsp[0].minor.yy414, TSQL_CREATE_STREAM);
setSQLInfo(pInfo, yymsp[-1].minor.yy398, NULL, TSDB_SQL_CREATE_TABLE); setSQLInfo(pInfo, yygotominor.yy470, NULL, TSDB_SQL_CREATE_TABLE);
} }
break; break;
case 115: /* columnlist ::= columnlist COMMA column */ case 118: /* columnlist ::= columnlist COMMA column */
{yylhsminor.yy511 = tFieldListAppend(yymsp[-2].minor.yy511, &yymsp[0].minor.yy343); } {yygotominor.yy523 = tFieldListAppend(yymsp[-2].minor.yy523, &yymsp[0].minor.yy223); }
yymsp[-2].minor.yy511 = yylhsminor.yy511;
break; break;
case 116: /* columnlist ::= column */ case 119: /* columnlist ::= column */
{yylhsminor.yy511 = tFieldListAppend(NULL, &yymsp[0].minor.yy343);} {yygotominor.yy523 = tFieldListAppend(NULL, &yymsp[0].minor.yy223);}
yymsp[0].minor.yy511 = yylhsminor.yy511;
break; break;
case 117: /* column ::= ids typename */ case 120: /* column ::= ids typename */
{ {
tSQLSetColumnInfo(&yylhsminor.yy343, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy343); tSQLSetColumnInfo(&yygotominor.yy223, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy223);
} }
yymsp[-1].minor.yy343 = yylhsminor.yy343; break;
break; case 121: /* tagitemlist ::= tagitemlist COMMA tagitem */
case 118: /* tagitemlist ::= tagitemlist COMMA tagitem */ { yygotominor.yy498 = tVariantListAppend(yymsp[-2].minor.yy498, &yymsp[0].minor.yy134, -1); }
{ yylhsminor.yy156 = tVariantListAppend(yymsp[-2].minor.yy156, &yymsp[0].minor.yy506, -1); } break;
yymsp[-2].minor.yy156 = yylhsminor.yy156; case 122: /* tagitemlist ::= tagitem */
break; { yygotominor.yy498 = tVariantListAppend(NULL, &yymsp[0].minor.yy134, -1); }
case 119: /* tagitemlist ::= tagitem */ break;
{ yylhsminor.yy156 = tVariantListAppend(NULL, &yymsp[0].minor.yy506, -1); } case 123: /* tagitem ::= INTEGER */
yymsp[0].minor.yy156 = yylhsminor.yy156; case 124: /* tagitem ::= FLOAT */ yytestcase(yyruleno==124);
break; case 125: /* tagitem ::= STRING */ yytestcase(yyruleno==125);
case 120: /* tagitem ::= INTEGER */ case 126: /* tagitem ::= BOOL */ yytestcase(yyruleno==126);
case 121: /* tagitem ::= FLOAT */ yytestcase(yyruleno==121); {toTSDBType(yymsp[0].minor.yy0.type); tVariantCreate(&yygotominor.yy134, &yymsp[0].minor.yy0); }
case 122: /* tagitem ::= STRING */ yytestcase(yyruleno==122); break;
case 123: /* tagitem ::= BOOL */ yytestcase(yyruleno==123); case 127: /* tagitem ::= NULL */
{toTSDBType(yymsp[0].minor.yy0.type); tVariantCreate(&yylhsminor.yy506, &yymsp[0].minor.yy0); } { yymsp[0].minor.yy0.type = 0; tVariantCreate(&yygotominor.yy134, &yymsp[0].minor.yy0); }
yymsp[0].minor.yy506 = yylhsminor.yy506; break;
break; case 128: /* tagitem ::= MINUS INTEGER */
case 124: /* tagitem ::= NULL */ case 129: /* tagitem ::= MINUS FLOAT */ yytestcase(yyruleno==129);
{ yymsp[0].minor.yy0.type = 0; tVariantCreate(&yylhsminor.yy506, &yymsp[0].minor.yy0); } case 130: /* tagitem ::= PLUS INTEGER */ yytestcase(yyruleno==130);
yymsp[0].minor.yy506 = yylhsminor.yy506; case 131: /* tagitem ::= PLUS FLOAT */ yytestcase(yyruleno==131);
break;
case 125: /* tagitem ::= MINUS INTEGER */
case 126: /* tagitem ::= MINUS FLOAT */ yytestcase(yyruleno==126);
case 127: /* tagitem ::= PLUS INTEGER */ yytestcase(yyruleno==127);
case 128: /* tagitem ::= PLUS FLOAT */ yytestcase(yyruleno==128);
{ {
yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n;
yymsp[-1].minor.yy0.type = yymsp[0].minor.yy0.type; yymsp[-1].minor.yy0.type = yymsp[0].minor.yy0.type;
toTSDBType(yymsp[-1].minor.yy0.type); toTSDBType(yymsp[-1].minor.yy0.type);
tVariantCreate(&yylhsminor.yy506, &yymsp[-1].minor.yy0); tVariantCreate(&yygotominor.yy134, &yymsp[-1].minor.yy0);
} }
yymsp[-1].minor.yy506 = yylhsminor.yy506;
break; break;
case 129: /* select ::= SELECT selcollist from where_opt interval_opt fill_opt sliding_opt groupby_opt orderby_opt having_opt slimit_opt limit_opt */ case 132: /* select ::= SELECT selcollist from where_opt interval_opt fill_opt sliding_opt groupby_opt orderby_opt having_opt slimit_opt limit_opt */
{ {
yylhsminor.yy444 = tSetQuerySQLElems(&yymsp[-11].minor.yy0, yymsp[-10].minor.yy158, yymsp[-9].minor.yy156, yymsp[-8].minor.yy190, yymsp[-4].minor.yy156, yymsp[-3].minor.yy156, &yymsp[-7].minor.yy340, &yymsp[-5].minor.yy0, yymsp[-6].minor.yy156, &yymsp[0].minor.yy414, &yymsp[-1].minor.yy414); yygotominor.yy414 = tSetQuerySQLElems(&yymsp[-11].minor.yy0, yymsp[-10].minor.yy290, yymsp[-9].minor.yy498, yymsp[-8].minor.yy64, yymsp[-4].minor.yy498, yymsp[-3].minor.yy498, &yymsp[-7].minor.yy532, &yymsp[-5].minor.yy0, yymsp[-6].minor.yy498, &yymsp[0].minor.yy216, &yymsp[-1].minor.yy216);
} }
yymsp[-11].minor.yy444 = yylhsminor.yy444;
break; break;
case 130: /* union ::= select */ case 133: /* union ::= select */
{ yylhsminor.yy333 = setSubclause(NULL, yymsp[0].minor.yy444); } { yygotominor.yy231 = setSubclause(NULL, yymsp[0].minor.yy414); }
yymsp[0].minor.yy333 = yylhsminor.yy333;
break; break;
case 131: /* union ::= LP union RP */ case 134: /* union ::= LP union RP */
{ yymsp[-2].minor.yy333 = yymsp[-1].minor.yy333; } { yygotominor.yy231 = yymsp[-1].minor.yy231; }
break; break;
case 132: /* union ::= union UNION ALL select */ case 135: /* union ::= union UNION ALL select */
{ yylhsminor.yy333 = appendSelectClause(yymsp[-3].minor.yy333, yymsp[0].minor.yy444); } { yygotominor.yy231 = appendSelectClause(yymsp[-3].minor.yy231, yymsp[0].minor.yy414); }
yymsp[-3].minor.yy333 = yylhsminor.yy333;
break; break;
case 133: /* union ::= union UNION ALL LP select RP */ case 136: /* union ::= union UNION ALL LP select RP */
{ yylhsminor.yy333 = appendSelectClause(yymsp[-5].minor.yy333, yymsp[-1].minor.yy444); } { yygotominor.yy231 = appendSelectClause(yymsp[-5].minor.yy231, yymsp[-1].minor.yy414); }
yymsp[-5].minor.yy333 = yylhsminor.yy333;
break; break;
case 134: /* cmd ::= union */ case 137: /* cmd ::= union */
{ setSQLInfo(pInfo, yymsp[0].minor.yy333, NULL, TSDB_SQL_SELECT); } { setSQLInfo(pInfo, yymsp[0].minor.yy231, NULL, TSDB_SQL_SELECT); }
break; break;
case 135: /* select ::= SELECT selcollist */ case 138: /* select ::= SELECT selcollist */
{ {
yylhsminor.yy444 = tSetQuerySQLElems(&yymsp[-1].minor.yy0, yymsp[0].minor.yy158, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); yygotominor.yy414 = tSetQuerySQLElems(&yymsp[-1].minor.yy0, yymsp[0].minor.yy290, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
} }
yymsp[-1].minor.yy444 = yylhsminor.yy444;
break; break;
case 136: /* sclp ::= selcollist COMMA */ case 139: /* sclp ::= selcollist COMMA */
{yylhsminor.yy158 = yymsp[-1].minor.yy158;} {yygotominor.yy290 = yymsp[-1].minor.yy290;}
yymsp[-1].minor.yy158 = yylhsminor.yy158;
break; break;
case 137: /* sclp ::= */ case 140: /* sclp ::= */
{yymsp[1].minor.yy158 = 0;} {yygotominor.yy290 = 0;}
break; break;
case 138: /* selcollist ::= sclp expr as */ case 141: /* selcollist ::= sclp expr as */
{ {
yylhsminor.yy158 = tSQLExprListAppend(yymsp[-2].minor.yy158, yymsp[-1].minor.yy190, yymsp[0].minor.yy0.n?&yymsp[0].minor.yy0:0); yygotominor.yy290 = tSQLExprListAppend(yymsp[-2].minor.yy290, yymsp[-1].minor.yy64, yymsp[0].minor.yy0.n?&yymsp[0].minor.yy0:0);
} }
yymsp[-2].minor.yy158 = yylhsminor.yy158;
break; break;
case 139: /* selcollist ::= sclp STAR */ case 142: /* selcollist ::= sclp STAR */
{ {
tSQLExpr *pNode = tSQLExprIdValueCreate(NULL, TK_ALL); tSQLExpr *pNode = tSQLExprIdValueCreate(NULL, TK_ALL);
yylhsminor.yy158 = tSQLExprListAppend(yymsp[-1].minor.yy158, pNode, 0); yygotominor.yy290 = tSQLExprListAppend(yymsp[-1].minor.yy290, pNode, 0);
} }
yymsp[-1].minor.yy158 = yylhsminor.yy158;
break;
case 140: /* as ::= AS ids */
{ yymsp[-1].minor.yy0 = yymsp[0].minor.yy0; }
break; break;
case 141: /* as ::= ids */ case 143: /* as ::= AS ids */
{ yylhsminor.yy0 = yymsp[0].minor.yy0; } case 144: /* as ::= ids */ yytestcase(yyruleno==144);
yymsp[0].minor.yy0 = yylhsminor.yy0; { yygotominor.yy0 = yymsp[0].minor.yy0; }
break; break;
case 142: /* as ::= */ case 145: /* as ::= */
{ yymsp[1].minor.yy0.n = 0; } { yygotominor.yy0.n = 0; }
break; break;
case 143: /* from ::= FROM tablelist */ case 146: /* from ::= FROM tablelist */
{yymsp[-1].minor.yy156 = yymsp[0].minor.yy156;} case 161: /* orderby_opt ::= ORDER BY sortlist */ yytestcase(yyruleno==161);
case 169: /* groupby_opt ::= GROUP BY grouplist */ yytestcase(yyruleno==169);
{yygotominor.yy498 = yymsp[0].minor.yy498;}
break; break;
case 144: /* tablelist ::= ids cpxName */ case 147: /* tablelist ::= ids cpxName */
{ {
toTSDBType(yymsp[-1].minor.yy0.type); toTSDBType(yymsp[-1].minor.yy0.type);
yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n;
yylhsminor.yy156 = tVariantListAppendToken(NULL, &yymsp[-1].minor.yy0, -1); yygotominor.yy498 = tVariantListAppendToken(NULL, &yymsp[-1].minor.yy0, -1);
yylhsminor.yy156 = tVariantListAppendToken(yylhsminor.yy156, &yymsp[-1].minor.yy0, -1); // table alias name yygotominor.yy498 = tVariantListAppendToken(yygotominor.yy498, &yymsp[-1].minor.yy0, -1); // table alias name
} }
yymsp[-1].minor.yy156 = yylhsminor.yy156;
break; break;
case 145: /* tablelist ::= ids cpxName ids */ case 148: /* tablelist ::= ids cpxName ids */
{ {
toTSDBType(yymsp[-2].minor.yy0.type); toTSDBType(yymsp[-2].minor.yy0.type);
toTSDBType(yymsp[0].minor.yy0.type); toTSDBType(yymsp[0].minor.yy0.type);
yymsp[-2].minor.yy0.n += yymsp[-1].minor.yy0.n; yymsp[-2].minor.yy0.n += yymsp[-1].minor.yy0.n;
yylhsminor.yy156 = tVariantListAppendToken(NULL, &yymsp[-2].minor.yy0, -1); yygotominor.yy498 = tVariantListAppendToken(NULL, &yymsp[-2].minor.yy0, -1);
yylhsminor.yy156 = tVariantListAppendToken(yylhsminor.yy156, &yymsp[0].minor.yy0, -1); yygotominor.yy498 = tVariantListAppendToken(yygotominor.yy498, &yymsp[0].minor.yy0, -1);
} }
yymsp[-2].minor.yy156 = yylhsminor.yy156;
break; break;
case 146: /* tablelist ::= tablelist COMMA ids cpxName */ case 149: /* tablelist ::= tablelist COMMA ids cpxName */
{ {
toTSDBType(yymsp[-1].minor.yy0.type); toTSDBType(yymsp[-1].minor.yy0.type);
yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n;
yylhsminor.yy156 = tVariantListAppendToken(yymsp[-3].minor.yy156, &yymsp[-1].minor.yy0, -1); yygotominor.yy498 = tVariantListAppendToken(yymsp[-3].minor.yy498, &yymsp[-1].minor.yy0, -1);
yylhsminor.yy156 = tVariantListAppendToken(yylhsminor.yy156, &yymsp[-1].minor.yy0, -1); yygotominor.yy498 = tVariantListAppendToken(yygotominor.yy498, &yymsp[-1].minor.yy0, -1);
} }
yymsp[-3].minor.yy156 = yylhsminor.yy156;
break; break;
case 147: /* tablelist ::= tablelist COMMA ids cpxName ids */ case 150: /* tablelist ::= tablelist COMMA ids cpxName ids */
{ {
toTSDBType(yymsp[-2].minor.yy0.type); toTSDBType(yymsp[-2].minor.yy0.type);
toTSDBType(yymsp[0].minor.yy0.type); toTSDBType(yymsp[0].minor.yy0.type);
yymsp[-2].minor.yy0.n += yymsp[-1].minor.yy0.n; yymsp[-2].minor.yy0.n += yymsp[-1].minor.yy0.n;
yylhsminor.yy156 = tVariantListAppendToken(yymsp[-4].minor.yy156, &yymsp[-2].minor.yy0, -1); yygotominor.yy498 = tVariantListAppendToken(yymsp[-4].minor.yy498, &yymsp[-2].minor.yy0, -1);
yylhsminor.yy156 = tVariantListAppendToken(yylhsminor.yy156, &yymsp[0].minor.yy0, -1); yygotominor.yy498 = tVariantListAppendToken(yygotominor.yy498, &yymsp[0].minor.yy0, -1);
} }
yymsp[-4].minor.yy156 = yylhsminor.yy156;
break; break;
case 148: /* tmvar ::= VARIABLE */ case 151: /* tmvar ::= VARIABLE */
{yylhsminor.yy0 = yymsp[0].minor.yy0;} {yygotominor.yy0 = yymsp[0].minor.yy0;}
yymsp[0].minor.yy0 = yylhsminor.yy0;
break; break;
case 149: /* interval_opt ::= INTERVAL LP tmvar RP */ case 152: /* interval_opt ::= INTERVAL LP tmvar RP */
{yymsp[-3].minor.yy340.interval = yymsp[-1].minor.yy0; yymsp[-3].minor.yy340.offset.n = 0; yymsp[-3].minor.yy340.offset.z = NULL; yymsp[-3].minor.yy340.offset.type = 0;} {yygotominor.yy532.interval = yymsp[-1].minor.yy0; yygotominor.yy532.offset.n = 0; yygotominor.yy532.offset.z = NULL; yygotominor.yy532.offset.type = 0;}
break; break;
case 150: /* interval_opt ::= INTERVAL LP tmvar COMMA tmvar RP */ case 153: /* interval_opt ::= INTERVAL LP tmvar COMMA tmvar RP */
{yymsp[-5].minor.yy340.interval = yymsp[-3].minor.yy0; yymsp[-5].minor.yy340.offset = yymsp[-1].minor.yy0;} {yygotominor.yy532.interval = yymsp[-3].minor.yy0; yygotominor.yy532.offset = yymsp[-1].minor.yy0;}
break; break;
case 151: /* interval_opt ::= */ case 154: /* interval_opt ::= */
{memset(&yymsp[1].minor.yy340, 0, sizeof(yymsp[1].minor.yy340));} {memset(&yygotominor.yy532, 0, sizeof(yygotominor.yy532));}
break; break;
case 152: /* fill_opt ::= */ case 155: /* fill_opt ::= */
{yymsp[1].minor.yy156 = 0; } {yygotominor.yy498 = 0; }
break; break;
case 153: /* fill_opt ::= FILL LP ID COMMA tagitemlist RP */ case 156: /* fill_opt ::= FILL LP ID COMMA tagitemlist RP */
{ {
tVariant A = {0}; tVariant A = {0};
toTSDBType(yymsp[-3].minor.yy0.type); toTSDBType(yymsp[-3].minor.yy0.type);
tVariantCreate(&A, &yymsp[-3].minor.yy0); tVariantCreate(&A, &yymsp[-3].minor.yy0);
tVariantListInsert(yymsp[-1].minor.yy156, &A, -1, 0); tVariantListInsert(yymsp[-1].minor.yy498, &A, -1, 0);
yymsp[-5].minor.yy156 = yymsp[-1].minor.yy156; yygotominor.yy498 = yymsp[-1].minor.yy498;
} }
break; break;
case 154: /* fill_opt ::= FILL LP ID RP */ case 157: /* fill_opt ::= FILL LP ID RP */
{ {
toTSDBType(yymsp[-1].minor.yy0.type); toTSDBType(yymsp[-1].minor.yy0.type);
yymsp[-3].minor.yy156 = tVariantListAppendToken(NULL, &yymsp[-1].minor.yy0, -1); yygotominor.yy498 = tVariantListAppendToken(NULL, &yymsp[-1].minor.yy0, -1);
} }
break; break;
case 155: /* sliding_opt ::= SLIDING LP tmvar RP */ case 158: /* sliding_opt ::= SLIDING LP tmvar RP */
{yymsp[-3].minor.yy0 = yymsp[-1].minor.yy0; } {yygotominor.yy0 = yymsp[-1].minor.yy0; }
break;
case 156: /* sliding_opt ::= */
{yymsp[1].minor.yy0.n = 0; yymsp[1].minor.yy0.z = NULL; yymsp[1].minor.yy0.type = 0; }
break; break;
case 157: /* orderby_opt ::= */ case 159: /* sliding_opt ::= */
case 165: /* groupby_opt ::= */ yytestcase(yyruleno==165); {yygotominor.yy0.n = 0; yygotominor.yy0.z = NULL; yygotominor.yy0.type = 0; }
{yymsp[1].minor.yy156 = 0;}
break; break;
case 158: /* orderby_opt ::= ORDER BY sortlist */ case 160: /* orderby_opt ::= */
case 166: /* groupby_opt ::= GROUP BY grouplist */ yytestcase(yyruleno==166); case 168: /* groupby_opt ::= */ yytestcase(yyruleno==168);
{yymsp[-2].minor.yy156 = yymsp[0].minor.yy156;} {yygotominor.yy498 = 0;}
break; break;
case 159: /* sortlist ::= sortlist COMMA item sortorder */ case 162: /* sortlist ::= sortlist COMMA item sortorder */
{ {
yylhsminor.yy156 = tVariantListAppend(yymsp[-3].minor.yy156, &yymsp[-1].minor.yy506, yymsp[0].minor.yy112); yygotominor.yy498 = tVariantListAppend(yymsp[-3].minor.yy498, &yymsp[-1].minor.yy134, yymsp[0].minor.yy46);
} }
yymsp[-3].minor.yy156 = yylhsminor.yy156;
break; break;
case 160: /* sortlist ::= item sortorder */ case 163: /* sortlist ::= item sortorder */
{ {
yylhsminor.yy156 = tVariantListAppend(NULL, &yymsp[-1].minor.yy506, yymsp[0].minor.yy112); yygotominor.yy498 = tVariantListAppend(NULL, &yymsp[-1].minor.yy134, yymsp[0].minor.yy46);
} }
yymsp[-1].minor.yy156 = yylhsminor.yy156;
break; break;
case 161: /* item ::= ids cpxName */ case 164: /* item ::= ids cpxName */
{ {
toTSDBType(yymsp[-1].minor.yy0.type); toTSDBType(yymsp[-1].minor.yy0.type);
yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n;
tVariantCreate(&yylhsminor.yy506, &yymsp[-1].minor.yy0); tVariantCreate(&yygotominor.yy134, &yymsp[-1].minor.yy0);
} }
yymsp[-1].minor.yy506 = yylhsminor.yy506;
break; break;
case 162: /* sortorder ::= ASC */ case 165: /* sortorder ::= ASC */
{yymsp[0].minor.yy112 = TSDB_ORDER_ASC; } {yygotominor.yy46 = TSDB_ORDER_ASC; }
break; break;
case 163: /* sortorder ::= DESC */ case 166: /* sortorder ::= DESC */
{yymsp[0].minor.yy112 = TSDB_ORDER_DESC;} {yygotominor.yy46 = TSDB_ORDER_DESC;}
break; break;
case 164: /* sortorder ::= */ case 167: /* sortorder ::= */
{yymsp[1].minor.yy112 = TSDB_ORDER_ASC;} {yygotominor.yy46 = TSDB_ORDER_ASC;}
break; break;
case 167: /* grouplist ::= grouplist COMMA item */ case 170: /* grouplist ::= grouplist COMMA item */
{ {
yylhsminor.yy156 = tVariantListAppend(yymsp[-2].minor.yy156, &yymsp[0].minor.yy506, -1); yygotominor.yy498 = tVariantListAppend(yymsp[-2].minor.yy498, &yymsp[0].minor.yy134, -1);
} }
yymsp[-2].minor.yy156 = yylhsminor.yy156;
break; break;
case 168: /* grouplist ::= item */ case 171: /* grouplist ::= item */
{ {
yylhsminor.yy156 = tVariantListAppend(NULL, &yymsp[0].minor.yy506, -1); yygotominor.yy498 = tVariantListAppend(NULL, &yymsp[0].minor.yy134, -1);
} }
yymsp[0].minor.yy156 = yylhsminor.yy156;
break; break;
case 169: /* having_opt ::= */ case 172: /* having_opt ::= */
case 179: /* where_opt ::= */ yytestcase(yyruleno==179); case 182: /* where_opt ::= */ yytestcase(yyruleno==182);
case 217: /* expritem ::= */ yytestcase(yyruleno==217); case 220: /* expritem ::= */ yytestcase(yyruleno==220);
{yymsp[1].minor.yy190 = 0;} {yygotominor.yy64 = 0;}
break; break;
case 170: /* having_opt ::= HAVING expr */ case 173: /* having_opt ::= HAVING expr */
case 180: /* where_opt ::= WHERE expr */ yytestcase(yyruleno==180); case 183: /* where_opt ::= WHERE expr */ yytestcase(yyruleno==183);
{yymsp[-1].minor.yy190 = yymsp[0].minor.yy190;} case 219: /* expritem ::= expr */ yytestcase(yyruleno==219);
{yygotominor.yy64 = yymsp[0].minor.yy64;}
break; break;
case 171: /* limit_opt ::= */ case 174: /* limit_opt ::= */
case 175: /* slimit_opt ::= */ yytestcase(yyruleno==175); case 178: /* slimit_opt ::= */ yytestcase(yyruleno==178);
{yymsp[1].minor.yy414.limit = -1; yymsp[1].minor.yy414.offset = 0;} {yygotominor.yy216.limit = -1; yygotominor.yy216.offset = 0;}
break; break;
case 172: /* limit_opt ::= LIMIT signed */ case 175: /* limit_opt ::= LIMIT signed */
case 176: /* slimit_opt ::= SLIMIT signed */ yytestcase(yyruleno==176); case 179: /* slimit_opt ::= SLIMIT signed */ yytestcase(yyruleno==179);
{yymsp[-1].minor.yy414.limit = yymsp[0].minor.yy369; yymsp[-1].minor.yy414.offset = 0;} {yygotominor.yy216.limit = yymsp[0].minor.yy207; yygotominor.yy216.offset = 0;}
break; break;
case 173: /* limit_opt ::= LIMIT signed OFFSET signed */ case 176: /* limit_opt ::= LIMIT signed OFFSET signed */
case 177: /* slimit_opt ::= SLIMIT signed SOFFSET signed */ yytestcase(yyruleno==177); case 180: /* slimit_opt ::= SLIMIT signed SOFFSET signed */ yytestcase(yyruleno==180);
{yymsp[-3].minor.yy414.limit = yymsp[-2].minor.yy369; yymsp[-3].minor.yy414.offset = yymsp[0].minor.yy369;} {yygotominor.yy216.limit = yymsp[-2].minor.yy207; yygotominor.yy216.offset = yymsp[0].minor.yy207;}
break; break;
case 174: /* limit_opt ::= LIMIT signed COMMA signed */ case 177: /* limit_opt ::= LIMIT signed COMMA signed */
case 178: /* slimit_opt ::= SLIMIT signed COMMA signed */ yytestcase(yyruleno==178); case 181: /* slimit_opt ::= SLIMIT signed COMMA signed */ yytestcase(yyruleno==181);
{yymsp[-3].minor.yy414.limit = yymsp[0].minor.yy369; yymsp[-3].minor.yy414.offset = yymsp[-2].minor.yy369;} {yygotominor.yy216.limit = yymsp[0].minor.yy207; yygotominor.yy216.offset = yymsp[-2].minor.yy207;}
break; break;
case 181: /* expr ::= LP expr RP */ case 184: /* expr ::= LP expr RP */
{yymsp[-2].minor.yy190 = yymsp[-1].minor.yy190; } {yygotominor.yy64 = yymsp[-1].minor.yy64; }
break; break;
case 182: /* expr ::= ID */ case 185: /* expr ::= ID */
{yylhsminor.yy190 = tSQLExprIdValueCreate(&yymsp[0].minor.yy0, TK_ID);} {yygotominor.yy64 = tSQLExprIdValueCreate(&yymsp[0].minor.yy0, TK_ID);}
yymsp[0].minor.yy190 = yylhsminor.yy190;
break; break;
case 183: /* expr ::= ID DOT ID */ case 186: /* expr ::= ID DOT ID */
{yymsp[-2].minor.yy0.n += (1+yymsp[0].minor.yy0.n); yylhsminor.yy190 = tSQLExprIdValueCreate(&yymsp[-2].minor.yy0, TK_ID);} {yymsp[-2].minor.yy0.n += (1+yymsp[0].minor.yy0.n); yygotominor.yy64 = tSQLExprIdValueCreate(&yymsp[-2].minor.yy0, TK_ID);}
yymsp[-2].minor.yy190 = yylhsminor.yy190;
break; break;
case 184: /* expr ::= ID DOT STAR */ case 187: /* expr ::= ID DOT STAR */
{yymsp[-2].minor.yy0.n += (1+yymsp[0].minor.yy0.n); yylhsminor.yy190 = tSQLExprIdValueCreate(&yymsp[-2].minor.yy0, TK_ALL);} {yymsp[-2].minor.yy0.n += (1+yymsp[0].minor.yy0.n); yygotominor.yy64 = tSQLExprIdValueCreate(&yymsp[-2].minor.yy0, TK_ALL);}
yymsp[-2].minor.yy190 = yylhsminor.yy190;
break; break;
case 185: /* expr ::= INTEGER */ case 188: /* expr ::= INTEGER */
{yylhsminor.yy190 = tSQLExprIdValueCreate(&yymsp[0].minor.yy0, TK_INTEGER);} {yygotominor.yy64 = tSQLExprIdValueCreate(&yymsp[0].minor.yy0, TK_INTEGER);}
yymsp[0].minor.yy190 = yylhsminor.yy190;
break; break;
case 186: /* expr ::= MINUS INTEGER */ case 189: /* expr ::= MINUS INTEGER */
case 187: /* expr ::= PLUS INTEGER */ yytestcase(yyruleno==187); case 190: /* expr ::= PLUS INTEGER */ yytestcase(yyruleno==190);
{yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; yymsp[-1].minor.yy0.type = TK_INTEGER; yylhsminor.yy190 = tSQLExprIdValueCreate(&yymsp[-1].minor.yy0, TK_INTEGER);} {yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; yymsp[-1].minor.yy0.type = TK_INTEGER; yygotominor.yy64 = tSQLExprIdValueCreate(&yymsp[-1].minor.yy0, TK_INTEGER);}
yymsp[-1].minor.yy190 = yylhsminor.yy190;
break; break;
case 188: /* expr ::= FLOAT */ case 191: /* expr ::= FLOAT */
{yylhsminor.yy190 = tSQLExprIdValueCreate(&yymsp[0].minor.yy0, TK_FLOAT);} {yygotominor.yy64 = tSQLExprIdValueCreate(&yymsp[0].minor.yy0, TK_FLOAT);}
yymsp[0].minor.yy190 = yylhsminor.yy190;
break; break;
case 189: /* expr ::= MINUS FLOAT */ case 192: /* expr ::= MINUS FLOAT */
case 190: /* expr ::= PLUS FLOAT */ yytestcase(yyruleno==190); case 193: /* expr ::= PLUS FLOAT */ yytestcase(yyruleno==193);
{yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; yymsp[-1].minor.yy0.type = TK_FLOAT; yylhsminor.yy190 = tSQLExprIdValueCreate(&yymsp[-1].minor.yy0, TK_FLOAT);} {yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; yymsp[-1].minor.yy0.type = TK_FLOAT; yygotominor.yy64 = tSQLExprIdValueCreate(&yymsp[-1].minor.yy0, TK_FLOAT);}
yymsp[-1].minor.yy190 = yylhsminor.yy190;
break; break;
case 191: /* expr ::= STRING */ case 194: /* expr ::= STRING */
{yylhsminor.yy190 = tSQLExprIdValueCreate(&yymsp[0].minor.yy0, TK_STRING);} {yygotominor.yy64 = tSQLExprIdValueCreate(&yymsp[0].minor.yy0, TK_STRING);}
yymsp[0].minor.yy190 = yylhsminor.yy190;
break; break;
case 192: /* expr ::= NOW */ case 195: /* expr ::= NOW */
{yylhsminor.yy190 = tSQLExprIdValueCreate(&yymsp[0].minor.yy0, TK_NOW); } {yygotominor.yy64 = tSQLExprIdValueCreate(&yymsp[0].minor.yy0, TK_NOW); }
yymsp[0].minor.yy190 = yylhsminor.yy190;
break; break;
case 193: /* expr ::= VARIABLE */ case 196: /* expr ::= VARIABLE */
{yylhsminor.yy190 = tSQLExprIdValueCreate(&yymsp[0].minor.yy0, TK_VARIABLE);} {yygotominor.yy64 = tSQLExprIdValueCreate(&yymsp[0].minor.yy0, TK_VARIABLE);}
yymsp[0].minor.yy190 = yylhsminor.yy190;
break; break;
case 194: /* expr ::= BOOL */ case 197: /* expr ::= BOOL */
{yylhsminor.yy190 = tSQLExprIdValueCreate(&yymsp[0].minor.yy0, TK_BOOL);} {yygotominor.yy64 = tSQLExprIdValueCreate(&yymsp[0].minor.yy0, TK_BOOL);}
yymsp[0].minor.yy190 = yylhsminor.yy190;
break; break;
case 195: /* expr ::= ID LP exprlist RP */ case 198: /* expr ::= ID LP exprlist RP */
{ yylhsminor.yy190 = tSQLExprCreateFunction(yymsp[-1].minor.yy158, &yymsp[-3].minor.yy0, &yymsp[0].minor.yy0, yymsp[-3].minor.yy0.type); } { yygotominor.yy64 = tSQLExprCreateFunction(yymsp[-1].minor.yy290, &yymsp[-3].minor.yy0, &yymsp[0].minor.yy0, yymsp[-3].minor.yy0.type); }
yymsp[-3].minor.yy190 = yylhsminor.yy190;
break; break;
case 196: /* expr ::= ID LP STAR RP */ case 199: /* expr ::= ID LP STAR RP */
{ yylhsminor.yy190 = tSQLExprCreateFunction(NULL, &yymsp[-3].minor.yy0, &yymsp[0].minor.yy0, yymsp[-3].minor.yy0.type); } { yygotominor.yy64 = tSQLExprCreateFunction(NULL, &yymsp[-3].minor.yy0, &yymsp[0].minor.yy0, yymsp[-3].minor.yy0.type); }
yymsp[-3].minor.yy190 = yylhsminor.yy190;
break; break;
case 197: /* expr ::= expr IS NULL */ case 200: /* expr ::= expr IS NULL */
{yylhsminor.yy190 = tSQLExprCreate(yymsp[-2].minor.yy190, NULL, TK_ISNULL);} {yygotominor.yy64 = tSQLExprCreate(yymsp[-2].minor.yy64, NULL, TK_ISNULL);}
yymsp[-2].minor.yy190 = yylhsminor.yy190;
break; break;
case 198: /* expr ::= expr IS NOT NULL */ case 201: /* expr ::= expr IS NOT NULL */
{yylhsminor.yy190 = tSQLExprCreate(yymsp[-3].minor.yy190, NULL, TK_NOTNULL);} {yygotominor.yy64 = tSQLExprCreate(yymsp[-3].minor.yy64, NULL, TK_NOTNULL);}
yymsp[-3].minor.yy190 = yylhsminor.yy190;
break; break;
case 199: /* expr ::= expr LT expr */ case 202: /* expr ::= expr LT expr */
{yylhsminor.yy190 = tSQLExprCreate(yymsp[-2].minor.yy190, yymsp[0].minor.yy190, TK_LT);} {yygotominor.yy64 = tSQLExprCreate(yymsp[-2].minor.yy64, yymsp[0].minor.yy64, TK_LT);}
yymsp[-2].minor.yy190 = yylhsminor.yy190;
break; break;
case 200: /* expr ::= expr GT expr */ case 203: /* expr ::= expr GT expr */
{yylhsminor.yy190 = tSQLExprCreate(yymsp[-2].minor.yy190, yymsp[0].minor.yy190, TK_GT);} {yygotominor.yy64 = tSQLExprCreate(yymsp[-2].minor.yy64, yymsp[0].minor.yy64, TK_GT);}
yymsp[-2].minor.yy190 = yylhsminor.yy190;
break; break;
case 201: /* expr ::= expr LE expr */ case 204: /* expr ::= expr LE expr */
{yylhsminor.yy190 = tSQLExprCreate(yymsp[-2].minor.yy190, yymsp[0].minor.yy190, TK_LE);} {yygotominor.yy64 = tSQLExprCreate(yymsp[-2].minor.yy64, yymsp[0].minor.yy64, TK_LE);}
yymsp[-2].minor.yy190 = yylhsminor.yy190;
break; break;
case 202: /* expr ::= expr GE expr */ case 205: /* expr ::= expr GE expr */
{yylhsminor.yy190 = tSQLExprCreate(yymsp[-2].minor.yy190, yymsp[0].minor.yy190, TK_GE);} {yygotominor.yy64 = tSQLExprCreate(yymsp[-2].minor.yy64, yymsp[0].minor.yy64, TK_GE);}
yymsp[-2].minor.yy190 = yylhsminor.yy190;
break; break;
case 203: /* expr ::= expr NE expr */ case 206: /* expr ::= expr NE expr */
{yylhsminor.yy190 = tSQLExprCreate(yymsp[-2].minor.yy190, yymsp[0].minor.yy190, TK_NE);} {yygotominor.yy64 = tSQLExprCreate(yymsp[-2].minor.yy64, yymsp[0].minor.yy64, TK_NE);}
yymsp[-2].minor.yy190 = yylhsminor.yy190;
break; break;
case 204: /* expr ::= expr EQ expr */ case 207: /* expr ::= expr EQ expr */
{yylhsminor.yy190 = tSQLExprCreate(yymsp[-2].minor.yy190, yymsp[0].minor.yy190, TK_EQ);} {yygotominor.yy64 = tSQLExprCreate(yymsp[-2].minor.yy64, yymsp[0].minor.yy64, TK_EQ);}
yymsp[-2].minor.yy190 = yylhsminor.yy190;
break; break;
case 205: /* expr ::= expr AND expr */ case 208: /* expr ::= expr AND expr */
{yylhsminor.yy190 = tSQLExprCreate(yymsp[-2].minor.yy190, yymsp[0].minor.yy190, TK_AND);} {yygotominor.yy64 = tSQLExprCreate(yymsp[-2].minor.yy64, yymsp[0].minor.yy64, TK_AND);}
yymsp[-2].minor.yy190 = yylhsminor.yy190;
break; break;
case 206: /* expr ::= expr OR expr */ case 209: /* expr ::= expr OR expr */
{yylhsminor.yy190 = tSQLExprCreate(yymsp[-2].minor.yy190, yymsp[0].minor.yy190, TK_OR); } {yygotominor.yy64 = tSQLExprCreate(yymsp[-2].minor.yy64, yymsp[0].minor.yy64, TK_OR); }
yymsp[-2].minor.yy190 = yylhsminor.yy190;
break; break;
case 207: /* expr ::= expr PLUS expr */ case 210: /* expr ::= expr PLUS expr */
{yylhsminor.yy190 = tSQLExprCreate(yymsp[-2].minor.yy190, yymsp[0].minor.yy190, TK_PLUS); } {yygotominor.yy64 = tSQLExprCreate(yymsp[-2].minor.yy64, yymsp[0].minor.yy64, TK_PLUS); }
yymsp[-2].minor.yy190 = yylhsminor.yy190;
break; break;
case 208: /* expr ::= expr MINUS expr */ case 211: /* expr ::= expr MINUS expr */
{yylhsminor.yy190 = tSQLExprCreate(yymsp[-2].minor.yy190, yymsp[0].minor.yy190, TK_MINUS); } {yygotominor.yy64 = tSQLExprCreate(yymsp[-2].minor.yy64, yymsp[0].minor.yy64, TK_MINUS); }
yymsp[-2].minor.yy190 = yylhsminor.yy190;
break; break;
case 209: /* expr ::= expr STAR expr */ case 212: /* expr ::= expr STAR expr */
{yylhsminor.yy190 = tSQLExprCreate(yymsp[-2].minor.yy190, yymsp[0].minor.yy190, TK_STAR); } {yygotominor.yy64 = tSQLExprCreate(yymsp[-2].minor.yy64, yymsp[0].minor.yy64, TK_STAR); }
yymsp[-2].minor.yy190 = yylhsminor.yy190;
break; break;
case 210: /* expr ::= expr SLASH expr */ case 213: /* expr ::= expr SLASH expr */
{yylhsminor.yy190 = tSQLExprCreate(yymsp[-2].minor.yy190, yymsp[0].minor.yy190, TK_DIVIDE);} {yygotominor.yy64 = tSQLExprCreate(yymsp[-2].minor.yy64, yymsp[0].minor.yy64, TK_DIVIDE);}
yymsp[-2].minor.yy190 = yylhsminor.yy190;
break; break;
case 211: /* expr ::= expr REM expr */ case 214: /* expr ::= expr REM expr */
{yylhsminor.yy190 = tSQLExprCreate(yymsp[-2].minor.yy190, yymsp[0].minor.yy190, TK_REM); } {yygotominor.yy64 = tSQLExprCreate(yymsp[-2].minor.yy64, yymsp[0].minor.yy64, TK_REM); }
yymsp[-2].minor.yy190 = yylhsminor.yy190;
break; break;
case 212: /* expr ::= expr LIKE expr */ case 215: /* expr ::= expr LIKE expr */
{yylhsminor.yy190 = tSQLExprCreate(yymsp[-2].minor.yy190, yymsp[0].minor.yy190, TK_LIKE); } {yygotominor.yy64 = tSQLExprCreate(yymsp[-2].minor.yy64, yymsp[0].minor.yy64, TK_LIKE); }
yymsp[-2].minor.yy190 = yylhsminor.yy190;
break; break;
case 213: /* expr ::= expr IN LP exprlist RP */ case 216: /* expr ::= expr IN LP exprlist RP */
{yylhsminor.yy190 = tSQLExprCreate(yymsp[-4].minor.yy190, (tSQLExpr*)yymsp[-1].minor.yy158, TK_IN); } {yygotominor.yy64 = tSQLExprCreate(yymsp[-4].minor.yy64, (tSQLExpr*)yymsp[-1].minor.yy290, TK_IN); }
yymsp[-4].minor.yy190 = yylhsminor.yy190;
break; break;
case 214: /* exprlist ::= exprlist COMMA expritem */ case 217: /* exprlist ::= exprlist COMMA expritem */
{yylhsminor.yy158 = tSQLExprListAppend(yymsp[-2].minor.yy158,yymsp[0].minor.yy190,0);} {yygotominor.yy290 = tSQLExprListAppend(yymsp[-2].minor.yy290,yymsp[0].minor.yy64,0);}
yymsp[-2].minor.yy158 = yylhsminor.yy158;
break; break;
case 215: /* exprlist ::= expritem */ case 218: /* exprlist ::= expritem */
{yylhsminor.yy158 = tSQLExprListAppend(0,yymsp[0].minor.yy190,0);} {yygotominor.yy290 = tSQLExprListAppend(0,yymsp[0].minor.yy64,0);}
yymsp[0].minor.yy158 = yylhsminor.yy158;
break; break;
case 216: /* expritem ::= expr */ case 221: /* cmd ::= RESET QUERY CACHE */
{yylhsminor.yy190 = yymsp[0].minor.yy190;}
yymsp[0].minor.yy190 = yylhsminor.yy190;
break;
case 218: /* cmd ::= RESET QUERY CACHE */
{ setDCLSQLElems(pInfo, TSDB_SQL_RESET_CACHE, 0);} { setDCLSQLElems(pInfo, TSDB_SQL_RESET_CACHE, 0);}
break; break;
case 219: /* cmd ::= ALTER TABLE ids cpxName ADD COLUMN columnlist */ case 222: /* cmd ::= ALTER TABLE ids cpxName ADD COLUMN columnlist */
{ {
yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n; yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n;
SAlterTableSQL* pAlterTable = tAlterTableSQLElems(&yymsp[-4].minor.yy0, yymsp[0].minor.yy511, NULL, TSDB_ALTER_TABLE_ADD_COLUMN); SAlterTableSQL* pAlterTable = tAlterTableSQLElems(&yymsp[-4].minor.yy0, yymsp[0].minor.yy523, NULL, TSDB_ALTER_TABLE_ADD_COLUMN);
setSQLInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); setSQLInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE);
} }
break; break;
case 220: /* cmd ::= ALTER TABLE ids cpxName DROP COLUMN ids */ case 223: /* cmd ::= ALTER TABLE ids cpxName DROP COLUMN ids */
{ {
yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n; yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n;
...@@ -3021,14 +2335,14 @@ static YYACTIONTYPE yy_reduce( ...@@ -3021,14 +2335,14 @@ static YYACTIONTYPE yy_reduce(
setSQLInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); setSQLInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE);
} }
break; break;
case 221: /* cmd ::= ALTER TABLE ids cpxName ADD TAG columnlist */ case 224: /* cmd ::= ALTER TABLE ids cpxName ADD TAG columnlist */
{ {
yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n; yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n;
SAlterTableSQL* pAlterTable = tAlterTableSQLElems(&yymsp[-4].minor.yy0, yymsp[0].minor.yy511, NULL, TSDB_ALTER_TABLE_ADD_TAG_COLUMN); SAlterTableSQL* pAlterTable = tAlterTableSQLElems(&yymsp[-4].minor.yy0, yymsp[0].minor.yy523, NULL, TSDB_ALTER_TABLE_ADD_TAG_COLUMN);
setSQLInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); setSQLInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE);
} }
break; break;
case 222: /* cmd ::= ALTER TABLE ids cpxName DROP TAG ids */ case 225: /* cmd ::= ALTER TABLE ids cpxName DROP TAG ids */
{ {
yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n; yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n;
...@@ -3039,7 +2353,7 @@ static YYACTIONTYPE yy_reduce( ...@@ -3039,7 +2353,7 @@ static YYACTIONTYPE yy_reduce(
setSQLInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); setSQLInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE);
} }
break; break;
case 223: /* cmd ::= ALTER TABLE ids cpxName CHANGE TAG ids ids */ case 226: /* cmd ::= ALTER TABLE ids cpxName CHANGE TAG ids ids */
{ {
yymsp[-5].minor.yy0.n += yymsp[-4].minor.yy0.n; yymsp[-5].minor.yy0.n += yymsp[-4].minor.yy0.n;
...@@ -3053,49 +2367,55 @@ static YYACTIONTYPE yy_reduce( ...@@ -3053,49 +2367,55 @@ static YYACTIONTYPE yy_reduce(
setSQLInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); setSQLInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE);
} }
break; break;
case 224: /* cmd ::= ALTER TABLE ids cpxName SET TAG ids EQ tagitem */ case 227: /* cmd ::= ALTER TABLE ids cpxName SET TAG ids EQ tagitem */
{ {
yymsp[-6].minor.yy0.n += yymsp[-5].minor.yy0.n; yymsp[-6].minor.yy0.n += yymsp[-5].minor.yy0.n;
toTSDBType(yymsp[-2].minor.yy0.type); toTSDBType(yymsp[-2].minor.yy0.type);
tVariantList* A = tVariantListAppendToken(NULL, &yymsp[-2].minor.yy0, -1); tVariantList* A = tVariantListAppendToken(NULL, &yymsp[-2].minor.yy0, -1);
A = tVariantListAppend(A, &yymsp[0].minor.yy506, -1); A = tVariantListAppend(A, &yymsp[0].minor.yy134, -1);
SAlterTableSQL* pAlterTable = tAlterTableSQLElems(&yymsp[-6].minor.yy0, NULL, A, TSDB_ALTER_TABLE_UPDATE_TAG_VAL); SAlterTableSQL* pAlterTable = tAlterTableSQLElems(&yymsp[-6].minor.yy0, NULL, A, TSDB_ALTER_TABLE_UPDATE_TAG_VAL);
setSQLInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); setSQLInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE);
} }
break; break;
case 225: /* cmd ::= KILL CONNECTION INTEGER */ case 228: /* cmd ::= KILL CONNECTION INTEGER */
{setKillSQL(pInfo, TSDB_SQL_KILL_CONNECTION, &yymsp[0].minor.yy0);} {setKillSQL(pInfo, TSDB_SQL_KILL_CONNECTION, &yymsp[0].minor.yy0);}
break; break;
case 226: /* cmd ::= KILL STREAM INTEGER COLON INTEGER */ case 229: /* 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);} {yymsp[-2].minor.yy0.n += (yymsp[-1].minor.yy0.n + yymsp[0].minor.yy0.n); setKillSQL(pInfo, TSDB_SQL_KILL_STREAM, &yymsp[-2].minor.yy0);}
break; break;
case 227: /* cmd ::= KILL QUERY INTEGER COLON INTEGER */ case 230: /* 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);} {yymsp[-2].minor.yy0.n += (yymsp[-1].minor.yy0.n + yymsp[0].minor.yy0.n); setKillSQL(pInfo, TSDB_SQL_KILL_QUERY, &yymsp[-2].minor.yy0);}
break; break;
default: default:
break; break;
/********** End reduce actions ************************************************/
}; };
assert( yyruleno<sizeof(yyRuleInfoLhs)/sizeof(yyRuleInfoLhs[0]) ); yygoto = yyRuleInfo[yyruleno].lhs;
yygoto = yyRuleInfoLhs[yyruleno]; yysize = yyRuleInfo[yyruleno].nrhs;
yysize = yyRuleInfoNRhs[yyruleno]; yypParser->yyidx -= yysize;
yyact = yy_find_reduce_action(yymsp[yysize].stateno,(YYCODETYPE)yygoto); yyact = yy_find_reduce_action(yymsp[-yysize].stateno,(YYCODETYPE)yygoto);
if( yyact < YYNSTATE ){
/* There are no SHIFTREDUCE actions on nonterminals because the table #ifdef NDEBUG
** generator has simplified them to pure REDUCE actions. */ /* If we are not debugging and the reduce action popped at least
assert( !(yyact>YY_MAX_SHIFT && yyact<=YY_MAX_SHIFTREDUCE) ); ** one element off the stack, then we can push the new element back
** onto the stack here, and skip the stack overflow test in yy_shift().
/* It is not possible for a REDUCE to be followed by an error */ ** That gives a significant speed improvement. */
assert( yyact!=YY_ERROR_ACTION ); if( yysize ){
yypParser->yyidx++;
yymsp += yysize+1; yymsp -= yysize-1;
yypParser->yytos = yymsp;
yymsp->stateno = (YYACTIONTYPE)yyact; yymsp->stateno = (YYACTIONTYPE)yyact;
yymsp->major = (YYCODETYPE)yygoto; yymsp->major = (YYCODETYPE)yygoto;
yyTraceShift(yypParser, yyact, "... then shift"); yymsp->minor = yygotominor;
return yyact; }else
#endif
{
yy_shift(yypParser,yyact,yygoto,&yygotominor);
}
}else{
assert( yyact == YYNSTATE + YYNRULE + 1 );
yy_accept(yypParser);
}
} }
/* /*
...@@ -3105,20 +2425,16 @@ static YYACTIONTYPE yy_reduce( ...@@ -3105,20 +2425,16 @@ static YYACTIONTYPE yy_reduce(
static void yy_parse_failed( static void yy_parse_failed(
yyParser *yypParser /* The parser */ yyParser *yypParser /* The parser */
){ ){
ParseARG_FETCH ParseARG_FETCH;
ParseCTX_FETCH
#ifndef NDEBUG #ifndef NDEBUG
if( yyTraceFILE ){ if( yyTraceFILE ){
fprintf(yyTraceFILE,"%sFail!\n",yyTracePrompt); fprintf(yyTraceFILE,"%sFail!\n",yyTracePrompt);
} }
#endif #endif
while( yypParser->yytos>yypParser->yystack ) yy_pop_parser_stack(yypParser); while( yypParser->yyidx>=0 ) yy_pop_parser_stack(yypParser);
/* Here code is inserted which will be executed whenever the /* Here code is inserted which will be executed whenever the
** parser fails */ ** parser fails */
/************ Begin %parse_failure code ***************************************/ ParseARG_STORE; /* Suppress warning about unused %extra_argument variable */
/************ End %parse_failure code *****************************************/
ParseARG_STORE /* Suppress warning about unused %extra_argument variable */
ParseCTX_STORE
} }
#endif /* YYNOERRORRECOVERY */ #endif /* YYNOERRORRECOVERY */
...@@ -3128,12 +2444,10 @@ static void yy_parse_failed( ...@@ -3128,12 +2444,10 @@ static void yy_parse_failed(
static void yy_syntax_error( static void yy_syntax_error(
yyParser *yypParser, /* The parser */ yyParser *yypParser, /* The parser */
int yymajor, /* The major type of the error token */ int yymajor, /* The major type of the error token */
ParseTOKENTYPE yyminor /* The minor type of the error token */ YYMINORTYPE yyminor /* The minor type of the error token */
){ ){
ParseARG_FETCH ParseARG_FETCH;
ParseCTX_FETCH #define TOKEN (yyminor.yy0)
#define TOKEN yyminor
/************ Begin %syntax_error code ****************************************/
pInfo->valid = false; pInfo->valid = false;
int32_t outputBufLen = tListLen(pInfo->pzErrMsg); int32_t outputBufLen = tListLen(pInfo->pzErrMsg);
...@@ -3156,9 +2470,7 @@ static void yy_syntax_error( ...@@ -3156,9 +2470,7 @@ static void yy_syntax_error(
} }
assert(len <= outputBufLen); assert(len <= outputBufLen);
/************ End %syntax_error code ******************************************/ ParseARG_STORE; /* Suppress warning about unused %extra_argument variable */
ParseARG_STORE /* Suppress warning about unused %extra_argument variable */
ParseCTX_STORE
} }
/* /*
...@@ -3167,24 +2479,17 @@ static void yy_syntax_error( ...@@ -3167,24 +2479,17 @@ static void yy_syntax_error(
static void yy_accept( static void yy_accept(
yyParser *yypParser /* The parser */ yyParser *yypParser /* The parser */
){ ){
ParseARG_FETCH ParseARG_FETCH;
ParseCTX_FETCH
#ifndef NDEBUG #ifndef NDEBUG
if( yyTraceFILE ){ if( yyTraceFILE ){
fprintf(yyTraceFILE,"%sAccept!\n",yyTracePrompt); fprintf(yyTraceFILE,"%sAccept!\n",yyTracePrompt);
} }
#endif #endif
#ifndef YYNOERRORRECOVERY while( yypParser->yyidx>=0 ) yy_pop_parser_stack(yypParser);
yypParser->yyerrcnt = -1;
#endif
assert( yypParser->yytos==yypParser->yystack );
/* Here code is inserted which will be executed whenever the /* Here code is inserted which will be executed whenever the
** parser accepts */ ** parser accepts */
/*********** Begin %parse_accept code *****************************************/
/*********** End %parse_accept code *******************************************/ ParseARG_STORE; /* Suppress warning about unused %extra_argument variable */
ParseARG_STORE /* Suppress warning about unused %extra_argument variable */
ParseCTX_STORE
} }
/* The main parser program. /* The main parser program.
...@@ -3213,54 +2518,50 @@ void Parse( ...@@ -3213,54 +2518,50 @@ void Parse(
ParseARG_PDECL /* Optional %extra_argument parameter */ ParseARG_PDECL /* Optional %extra_argument parameter */
){ ){
YYMINORTYPE yyminorunion; YYMINORTYPE yyminorunion;
YYACTIONTYPE yyact; /* The parser action. */ int yyact; /* The parser action. */
#if !defined(YYERRORSYMBOL) && !defined(YYNOERRORRECOVERY)
int yyendofinput; /* True if we are at the end of input */ int yyendofinput; /* True if we are at the end of input */
#endif
#ifdef YYERRORSYMBOL #ifdef YYERRORSYMBOL
int yyerrorhit = 0; /* True if yymajor has invoked an error */ int yyerrorhit = 0; /* True if yymajor has invoked an error */
#endif #endif
yyParser *yypParser = (yyParser*)yyp; /* The parser */ yyParser *yypParser; /* The parser */
ParseCTX_FETCH
ParseARG_STORE
assert( yypParser->yytos!=0 ); /* (re)initialize the parser, if necessary */
#if !defined(YYERRORSYMBOL) && !defined(YYNOERRORRECOVERY) yypParser = (yyParser*)yyp;
yyendofinput = (yymajor==0); if( yypParser->yyidx<0 ){
#if YYSTACKDEPTH<=0
if( yypParser->yystksz <=0 ){
/*memset(&yyminorunion, 0, sizeof(yyminorunion));*/
yyminorunion = yyzerominor;
yyStackOverflow(yypParser, &yyminorunion);
return;
}
#endif #endif
yypParser->yyidx = 0;
yypParser->yyerrcnt = -1;
yypParser->yystack[0].stateno = 0;
yypParser->yystack[0].major = 0;
}
yyminorunion.yy0 = yyminor;
yyendofinput = (yymajor==0);
ParseARG_STORE;
yyact = yypParser->yytos->stateno;
#ifndef NDEBUG #ifndef NDEBUG
if( yyTraceFILE ){ if( yyTraceFILE ){
if( yyact < YY_MIN_REDUCE ){ fprintf(yyTraceFILE,"%sInput %s\n",yyTracePrompt,yyTokenName[yymajor]);
fprintf(yyTraceFILE,"%sInput '%s' in state %d\n",
yyTracePrompt,yyTokenName[yymajor],yyact);
}else{
fprintf(yyTraceFILE,"%sInput '%s' with pending reduce %d\n",
yyTracePrompt,yyTokenName[yymajor],yyact-YY_MIN_REDUCE);
}
} }
#endif #endif
do{ do{
assert( yyact==yypParser->yytos->stateno ); yyact = yy_find_shift_action(yypParser,(YYCODETYPE)yymajor);
yyact = yy_find_shift_action((YYCODETYPE)yymajor,yyact); if( yyact<YYNSTATE ){
if( yyact >= YY_MIN_REDUCE ){ assert( !yyendofinput ); /* Impossible to shift the $ token */
yyact = yy_reduce(yypParser,yyact-YY_MIN_REDUCE,yymajor, yy_shift(yypParser,yyact,yymajor,&yyminorunion);
yyminor ParseCTX_PARAM);
}else if( yyact <= YY_MAX_SHIFTREDUCE ){
yy_shift(yypParser,yyact,(YYCODETYPE)yymajor,yyminor);
#ifndef YYNOERRORRECOVERY
yypParser->yyerrcnt--; yypParser->yyerrcnt--;
#endif yymajor = YYNOCODE;
break; }else if( yyact < YYNSTATE + YYNRULE ){
}else if( yyact==YY_ACCEPT_ACTION ){ yy_reduce(yypParser,yyact-YYNSTATE);
yypParser->yytos--;
yy_accept(yypParser);
return;
}else{ }else{
assert( yyact == YY_ERROR_ACTION ); assert( yyact == YY_ERROR_ACTION );
yyminorunion.yy0 = yyminor;
#ifdef YYERRORSYMBOL #ifdef YYERRORSYMBOL
int yymx; int yymx;
#endif #endif
...@@ -3290,9 +2591,9 @@ void Parse( ...@@ -3290,9 +2591,9 @@ void Parse(
** **
*/ */
if( yypParser->yyerrcnt<0 ){ if( yypParser->yyerrcnt<0 ){
yy_syntax_error(yypParser,yymajor,yyminor); yy_syntax_error(yypParser,yymajor,yyminorunion);
} }
yymx = yypParser->yytos->major; yymx = yypParser->yystack[yypParser->yyidx].major;
if( yymx==YYERRORSYMBOL || yyerrorhit ){ if( yymx==YYERRORSYMBOL || yyerrorhit ){
#ifndef NDEBUG #ifndef NDEBUG
if( yyTraceFILE ){ if( yyTraceFILE ){
...@@ -3300,31 +2601,30 @@ void Parse( ...@@ -3300,31 +2601,30 @@ void Parse(
yyTracePrompt,yyTokenName[yymajor]); yyTracePrompt,yyTokenName[yymajor]);
} }
#endif #endif
yy_destructor(yypParser, (YYCODETYPE)yymajor, &yyminorunion); yy_destructor(yypParser, (YYCODETYPE)yymajor,&yyminorunion);
yymajor = YYNOCODE; yymajor = YYNOCODE;
}else{ }else{
while( yypParser->yytos >= yypParser->yystack while(
&& (yyact = yy_find_reduce_action( yypParser->yyidx >= 0 &&
yypParser->yytos->stateno, yymx != YYERRORSYMBOL &&
YYERRORSYMBOL)) > YY_MAX_SHIFTREDUCE (yyact = yy_find_reduce_action(
yypParser->yystack[yypParser->yyidx].stateno,
YYERRORSYMBOL)) >= YYNSTATE
){ ){
yy_pop_parser_stack(yypParser); yy_pop_parser_stack(yypParser);
} }
if( yypParser->yytos < yypParser->yystack || yymajor==0 ){ if( yypParser->yyidx < 0 || yymajor==0 ){
yy_destructor(yypParser,(YYCODETYPE)yymajor,&yyminorunion); yy_destructor(yypParser,(YYCODETYPE)yymajor,&yyminorunion);
yy_parse_failed(yypParser); yy_parse_failed(yypParser);
#ifndef YYNOERRORRECOVERY
yypParser->yyerrcnt = -1;
#endif
yymajor = YYNOCODE; yymajor = YYNOCODE;
}else if( yymx!=YYERRORSYMBOL ){ }else if( yymx!=YYERRORSYMBOL ){
yy_shift(yypParser,yyact,YYERRORSYMBOL,yyminor); YYMINORTYPE u2;
u2.YYERRSYMDT = 0;
yy_shift(yypParser,yyact,YYERRORSYMBOL,&u2);
} }
} }
yypParser->yyerrcnt = 3; yypParser->yyerrcnt = 3;
yyerrorhit = 1; yyerrorhit = 1;
if( yymajor==YYNOCODE ) break;
yyact = yypParser->yytos->stateno;
#elif defined(YYNOERRORRECOVERY) #elif defined(YYNOERRORRECOVERY)
/* If the YYNOERRORRECOVERY macro is defined, then do not attempt to /* If the YYNOERRORRECOVERY macro is defined, then do not attempt to
** do any kind of error recovery. Instead, simply invoke the syntax ** do any kind of error recovery. Instead, simply invoke the syntax
...@@ -3333,9 +2633,10 @@ void Parse( ...@@ -3333,9 +2633,10 @@ void Parse(
** Applications can set this macro (for example inside %include) if ** Applications can set this macro (for example inside %include) if
** they intend to abandon the parse upon the first syntax error seen. ** they intend to abandon the parse upon the first syntax error seen.
*/ */
yy_syntax_error(yypParser,yymajor, yyminor); yy_syntax_error(yypParser,yymajor,yyminorunion);
yy_destructor(yypParser,(YYCODETYPE)yymajor,&yyminorunion); yy_destructor(yypParser,(YYCODETYPE)yymajor,&yyminorunion);
break; yymajor = YYNOCODE;
#else /* YYERRORSYMBOL is not defined */ #else /* YYERRORSYMBOL is not defined */
/* This is what we do if the grammar does not define ERROR: /* This is what we do if the grammar does not define ERROR:
** **
...@@ -3347,45 +2648,16 @@ void Parse( ...@@ -3347,45 +2648,16 @@ void Parse(
** three input tokens have been successfully shifted. ** three input tokens have been successfully shifted.
*/ */
if( yypParser->yyerrcnt<=0 ){ if( yypParser->yyerrcnt<=0 ){
yy_syntax_error(yypParser,yymajor, yyminor); yy_syntax_error(yypParser,yymajor,yyminorunion);
} }
yypParser->yyerrcnt = 3; yypParser->yyerrcnt = 3;
yy_destructor(yypParser,(YYCODETYPE)yymajor,&yyminorunion); yy_destructor(yypParser,(YYCODETYPE)yymajor,&yyminorunion);
if( yyendofinput ){ if( yyendofinput ){
yy_parse_failed(yypParser); yy_parse_failed(yypParser);
#ifndef YYNOERRORRECOVERY
yypParser->yyerrcnt = -1;
#endif
} }
break; yymajor = YYNOCODE;
#endif #endif
} }
}while( yypParser->yytos>yypParser->yystack ); }while( yymajor!=YYNOCODE && yypParser->yyidx>=0 );
#ifndef NDEBUG
if( yyTraceFILE ){
yyStackEntry *i;
char cDiv = '[';
fprintf(yyTraceFILE,"%sReturn. Stack=",yyTracePrompt);
for(i=&yypParser->yystack[1]; i<=yypParser->yytos; i++){
fprintf(yyTraceFILE,"%c%s", cDiv, yyTokenName[i->major]);
cDiv = ' ';
}
fprintf(yyTraceFILE,"]\n");
}
#endif
return; 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
}
# -*- coding: utf-8 -*-
import random
import string
import subprocess
import sys
from util.log import *
from util.cases import *
from util.sql import *
class TDTestCase:
def init(self, conn, logSql):
tdLog.debug("start to execute %s" % __file__)
tdSql.init(conn.cursor(), logSql)
def run(self):
tdLog.debug("check database")
tdSql.prepare()
# check default update value
sql = "create database if not exists db"
tdSql.execute(sql)
tdSql.query('show databases')
tdSql.checkRows(1)
tdSql.checkData(0,16,0)
sql = "alter database db update 1"
# check update value
tdSql.execute(sql)
tdSql.query('show databases')
tdSql.checkRows(1)
tdSql.checkData(0,16,1)
sql = "alter database db update 0"
tdSql.execute(sql)
tdSql.query('show databases')
tdSql.checkRows(1)
tdSql.checkData(0,16,0)
sql = "alter database db update -1"
tdSql.error(sql)
sql = "alter database db update 100"
tdSql.error(sql)
tdSql.query('show databases')
tdSql.checkRows(1)
tdSql.checkData(0,16,0)
tdSql.execute('drop database db')
tdSql.error('create database db update 100')
tdSql.error('create database db update -1')
tdSql.execute('create database db update 1')
tdSql.query('show databases')
tdSql.checkRows(1)
tdSql.checkData(0,16,1)
tdSql.execute('drop database db')
def stop(self):
tdSql.close()
tdLog.success("%s successfully executed" % __file__)
tdCases.addWindows(__file__, TDTestCase())
tdCases.addLinux(__file__, TDTestCase())
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册