sql.c 233.9 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
/*
** 2000-05-29
**
** 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:
*/
#include <stdio.h>
#include <assert.h>
/************ Begin %include sections from the grammar ************************/

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include <stdbool.h>

35
#include "functionMgt.h"
36
#include "nodes.h"
X
Xiaoyu Wang 已提交
37
#include "parToken.h"
38
#include "ttokendef.h"
X
Xiaoyu Wang 已提交
39
#include "parAst.h"
40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62
/**************** End of %include directives **********************************/
/* These constants specify the various numeric values for terminal symbols
** in a format understandable to "makeheaders".  This section is blank unless
** "lemon" is run with the "-m" command-line option.
***************** Begin makeheaders token definitions *************************/
/**************** End makeheaders token definitions ***************************/

/* The next sections is a series of control #defines.
** various aspects of the generated parser.
**    YYCODETYPE         is the data type used to store the integer codes
**                       that represent terminal and non-terminal symbols.
**                       "unsigned char" is used if there are fewer than
**                       256 symbols.  Larger types otherwise.
**    YYNOCODE           is a number of type YYCODETYPE that is not used for
**                       any terminal or nonterminal symbol.
**    YYFALLBACK         If defined, this indicates that one or more tokens
**                       (also known as: "terminal symbols") have fall-back
**                       values which should be used if the original symbol
**                       would not parse.  This permits keywords to sometimes
**                       be used as identifiers, for example.
**    YYACTIONTYPE       is the data type used for "action codes" - numbers
**                       that indicate what to do in response to the next
**                       token.
X
Xiaoyu Wang 已提交
63
**    ParseTOKENTYPE     is the data type used for minor type for terminal
64 65 66 67 68 69 70 71 72 73
**                       symbols.  Background: A "minor type" is a semantic
**                       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
X
Xiaoyu Wang 已提交
74
**                       which is ParseTOKENTYPE.  The entry in the union
75 76
**                       for terminal symbols is called "yy0".
**    YYSTACKDEPTH       is the maximum depth of the parser's stack.  If
X
Xiaoyu Wang 已提交
77
**                       zero the stack is dynamically sized using realloc()
X
Xiaoyu Wang 已提交
78 79 80 81 82 83
**    ParseARG_SDECL     A static variable declaration for the %extra_argument
**    ParseARG_PDECL     A parameter declaration for the %extra_argument
**    ParseARG_PARAM     Code to pass %extra_argument as a subroutine parameter
**    ParseARG_STORE     Code to store %extra_argument into yypParser
**    ParseARG_FETCH     Code to extract %extra_argument from yypParser
**    ParseCTX_*         As ParseARG_ except for %extra_context
84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101
**    YYERRORSYMBOL      is the code number of the error symbol.  If not
**                       defined, then do no error processing.
**    YYNSTATE           the combined number of states.
**    YYNRULE            the number of rules in the grammar
**    YYNTOKEN           Number of terminal symbols
**    YY_MAX_SHIFT       Maximum value for shift actions
**    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 *****************************************/
X
Xiaoyu Wang 已提交
102
#define YYCODETYPE unsigned short int
103
#define YYNOCODE 347
104
#define YYACTIONTYPE unsigned short int
X
Xiaoyu Wang 已提交
105
#define ParseTOKENTYPE  SToken 
106 107
typedef union {
  int yyinit;
X
Xiaoyu Wang 已提交
108
  ParseTOKENTYPE yy0;
109 110 111 112 113 114 115 116 117 118 119 120
  EJoinType yy84;
  SDataType yy156;
  ENullOrder yy181;
  EOrder yy272;
  EFillMode yy284;
  EOperatorType yy304;
  SAlterOption yy475;
  SToken yy555;
  SNodeList* yy568;
  int32_t yy610;
  bool yy617;
  SNode* yy662;
121 122 123 124
} YYMINORTYPE;
#ifndef YYSTACKDEPTH
#define YYSTACKDEPTH 100
#endif
X
Xiaoyu Wang 已提交
125 126 127 128 129 130 131 132 133 134
#define ParseARG_SDECL  SAstCreateContext* pCxt ;
#define ParseARG_PDECL , SAstCreateContext* pCxt 
#define ParseARG_PARAM ,pCxt 
#define ParseARG_FETCH  SAstCreateContext* pCxt =yypParser->pCxt ;
#define ParseARG_STORE yypParser->pCxt =pCxt ;
#define ParseCTX_SDECL
#define ParseCTX_PDECL
#define ParseCTX_PARAM
#define ParseCTX_FETCH
#define ParseCTX_STORE
X
Xiaoyu Wang 已提交
135
#define YYFALLBACK 1
136 137
#define YYNSTATE             575
#define YYNRULE              444
X
Xiaoyu Wang 已提交
138
#define YYNTOKEN             231
139 140 141 142 143 144 145 146
#define YY_MAX_SHIFT         574
#define YY_MIN_SHIFTREDUCE   857
#define YY_MAX_SHIFTREDUCE   1300
#define YY_ERROR_ACTION      1301
#define YY_ACCEPT_ACTION     1302
#define YY_NO_ACTION         1303
#define YY_MIN_REDUCE        1304
#define YY_MAX_REDUCE        1747
147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212
/************* End control #defines *******************************************/
#define YY_NLOOKAHEAD ((int)(sizeof(yy_lookahead)/sizeof(yy_lookahead[0])))

/* Define the yytestcase() macro to be a no-op if is not already defined
** otherwise.
**
** Applications can choose to define yytestcase() in the %include section
** to a macro that can assist in verifying code coverage.  For production
** code the yytestcase() macro should be turned off.  But it is useful
** for testing.
*/
#ifndef yytestcase
# define yytestcase(X)
#endif


/* Next are the tables used to determine what action to take based on the
** current state and lookahead token.  These tables are used to implement
** functions that take a state number and lookahead value and return an
** action integer.  
**
** Suppose the action integer is N.  Then the action is determined as
** follows
**
**   0 <= N <= YY_MAX_SHIFT             Shift N.  That is, push the lookahead
**                                      token onto the stack and goto state N.
**
**   N between YY_MIN_SHIFTREDUCE       Shift to an arbitrary state then
**     and YY_MAX_SHIFTREDUCE           reduce by rule N-YY_MIN_SHIFTREDUCE.
**
**   N == YY_ERROR_ACTION               A syntax error has occurred.
**
**   N == YY_ACCEPT_ACTION              The parser accepts its input.
**
**   N == YY_NO_ACTION                  No such action.  Denotes unused
**                                      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[].
** Given state S and lookahead X, the action is computed as either:
**
**    (A)   N = yy_action[ yy_shift_ofst[S] + X ]
**    (B)   N = yy_default[S]
**
** The (A) formula is preferred.  The B formula is used instead if
** yy_lookahead[yy_shift_ofst[S]+X] is not equal to X.
**
** The formulas above are for computing the action when the lookahead is
** 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
** the yy_shift_ofst[] array.
**
** The following are the tables generated in this section:
**
**  yy_action[]        A single table containing all actions.
**  yy_lookahead[]     A table containing the lookahead for each entry in
**                     yy_action.  Used to detect hash collisions.
**  yy_shift_ofst[]    For each state, the offset into yy_action for
**                     shifting terminals.
**  yy_reduce_ofst[]   For each state, the offset into yy_action for
**                     shifting non-terminals after a reduce.
**  yy_default[]       Default action for each state.
**
*********** Begin parsing tables **********************************************/
213
#define YY_ACTTAB_COUNT (2021)
214
static const YYACTIONTYPE yy_action[] = {
215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417
 /*     0 */   273,  124,  485, 1316, 1596,  485,  485,  322,  128, 1581,
 /*    10 */   472,   78,   33,   31,   78,  326, 1520, 1581,  386, 1467,
 /*    20 */   282,  393, 1117,  447, 1577, 1585, 1583, 1426, 1612,  484,
 /*    30 */  1426, 1426, 1577, 1584, 1583,  469,  488,  485, 1115,   34,
 /*    40 */    32,   30,   29,   28,  488,  468,  327, 1726,  105, 1567,
 /*    50 */    12,   33,   31, 1242,  484,  451,  484, 1123,   59,  282,
 /*    60 */   137, 1117, 1426,  125, 1723, 1726, 1624, 1383, 1726,   73,
 /*    70 */  1597,  471, 1599, 1600,  467,    1,  488, 1115, 1725, 1664,
 /*    80 */    22, 1724, 1723,  253, 1660, 1723,  103,  328,  485,   12,
 /*    90 */    34,   32,   30,   29,   28, 1726, 1123,  336,  571, 1353,
 /*   100 */   449,  133, 1671, 1672,  365, 1676,   26,  205,  137,   36,
 /*   110 */  1116,   36, 1723, 1426,    1, 1305,  454,  251,  985,  511,
 /*   120 */   510,  509,  989,  508,  991,  992,  507,  994,  504,  947,
 /*   130 */  1000,  501, 1002, 1003,  498,  495,   89,  571, 1141,   88,
 /*   140 */    87,   86,   85,   84,   83,   82,   81,   80,  949, 1116,
 /*   150 */  1118,  547,  546,  545,  544,  297,  441,  543,  542,  541,
 /*   160 */   108,  536,  535,  534,  533,  532,  531,  530,  529,  115,
 /*   170 */   525, 1121, 1122, 1139, 1167, 1168, 1169, 1170, 1171, 1172,
 /*   180 */  1173,  464,  486, 1181, 1182, 1183, 1184, 1185, 1186, 1118,
 /*   190 */    30,   29,   28,  402,  416,  396,   69, 1475,  321,  401,
 /*   200 */   320,  138,  102,  272,  397,  395,   65,  398, 1473,   54,
 /*   210 */  1121, 1122,  394, 1167, 1168, 1169, 1170, 1171, 1172, 1173,
 /*   220 */   464,  486, 1181, 1182, 1183, 1184, 1185, 1186,   33,   31,
 /*   230 */  1422,  447,   63, 1596, 1726,  138,  282,  250, 1117, 1139,
 /*   240 */    34,   32,   30,   29,   28,  447,  344,  137,   54,  356,
 /*   250 */   138, 1723, 1079, 1419, 1115,  138,  105, 1612,  357,  472,
 /*   260 */  1081,  100,  285,  455,  466, 1519,   12,   33,   31, 1421,
 /*   270 */   105,  485,  485, 1123,  468,  282,  451, 1117, 1567,   89,
 /*   280 */   337,  364,   88,   87,   86,   85,   84,   83,   82,   81,
 /*   290 */    80,    1, 1142, 1115,  103, 1624, 1426, 1426,  248, 1597,
 /*   300 */   471, 1599, 1600,  467,  465,  488,  462, 1636,  103,  198,
 /*   310 */  1671,  446, 1123,  445,  571, 1356, 1726, 1140,   56,  270,
 /*   320 */  1080, 1612,  175,  134, 1671, 1672, 1116, 1676,  469,  137,
 /*   330 */     7, 1304,  355, 1723,  138,  350,  349,  348,  347,  346,
 /*   340 */  1404,  343,  342,  341,  340,  339,  335,  334,  333,  332,
 /*   350 */   331,  330,  329,  571,  138,   98,   97,   96,   95,   94,
 /*   360 */    93,   92,   91,   90,  440, 1116, 1118,  402, 1507,  396,
 /*   370 */  1143, 1297,  524,  401, 1475,  146,  102,  514,  397,  395,
 /*   380 */   287,  398, 1266,  567,  566, 1473,  394, 1121, 1122,  365,
 /*   390 */  1167, 1168, 1169, 1170, 1171, 1172, 1173,  464,  486, 1181,
 /*   400 */  1182, 1183, 1184, 1185, 1186, 1118,   34,   32,   30,   29,
 /*   410 */    28,  293,  286,   34,   32,   30,   29,   28, 1510, 1512,
 /*   420 */   122,  434, 1264, 1265, 1267, 1268, 1121, 1122, 1428, 1167,
 /*   430 */  1168, 1169, 1170, 1171, 1172, 1173,  464,  486, 1181, 1182,
 /*   440 */  1183, 1184, 1185, 1186,   33,   31, 1187, 1475,  391,  390,
 /*   450 */  1296,  254,  282,  294, 1117,  485,  138, 1596, 1473,   48,
 /*   460 */   161,   70,  290,  131, 1423,  527,  894,  485,  893,  382,
 /*   470 */  1115,  378,  374,  370,  160,  106, 1548, 1154,  485, 1581,
 /*   480 */  1426, 1612, 1418,   33,   31, 1204,  895,  482,  450, 1123,
 /*   490 */   200,  282, 1426, 1117, 1577, 1584, 1583,  122,  468, 1417,
 /*   500 */   351,   55, 1567, 1426,  158, 1429,  488,    7,  485, 1115,
 /*   510 */  1415,   34,   32,   30,   29,   28,  101,  483,  437, 1624,
 /*   520 */   389, 1206,   74, 1597,  471, 1599, 1600,  467, 1123,  488,
 /*   530 */   571, 1402, 1664, 1426,  121, 1205,  275, 1660,  132,  424,
 /*   540 */   485, 1211, 1116,  392, 1567,  292,    7,  148,  147,  219,
 /*   550 */   201,  295, 1411,  122,  485, 1210,  430, 1691, 1144,  122,
 /*   560 */    24, 1428,  157,  296,  152, 1426,  154, 1428, 1302,  571,
 /*   570 */    34,   32,   30,   29,   28, 1256,   23, 1475, 1327, 1426,
 /*   580 */   524, 1116, 1118, 1413,  425,  151,  442,  438, 1474,  893,
 /*   590 */    25,  280, 1199, 1200, 1201, 1202, 1203, 1207, 1208, 1209,
 /*   600 */  1409,    9,    8, 1121, 1122,  384, 1167, 1168, 1169, 1170,
 /*   610 */  1171, 1172, 1173,  464,  486, 1181, 1182, 1183, 1184, 1185,
 /*   620 */  1186, 1118,  298, 1567, 1726,   34,   32,   30,   29,   28,
 /*   630 */    34,   32,   30,   29,   28,    6, 1326,  137, 1325,  447,
 /*   640 */  1324, 1723, 1121, 1122,  144, 1167, 1168, 1169, 1170, 1171,
 /*   650 */  1172, 1173,  464,  486, 1181, 1182, 1183, 1184, 1185, 1186,
 /*   660 */    33,   31, 1726,  254,  105,  400,  399, 1678,  282, 1596,
 /*   670 */  1117,   52, 1678,  453,   51,  137, 1218, 1323,  186, 1723,
 /*   680 */  1678, 1567, 1322, 1567,  178, 1567, 1115, 1321, 1320,  521,
 /*   690 */   520, 1675, 1241, 1612, 1154, 1319, 1674, 1204, 1318,  539,
 /*   700 */   450,  463,  103,  316, 1673, 1123, 1315, 1314, 1313, 1312,
 /*   710 */   468,  528, 1311, 1398, 1567, 1310, 1309,  135, 1671, 1672,
 /*   720 */  1308, 1676, 1567,    1,  540,  538, 1307, 1567,  457,  264,
 /*   730 */  1403, 1624, 1567, 1567,   74, 1597,  471, 1599, 1600,  467,
 /*   740 */  1567,  488,  228, 1567, 1664, 1456,  571, 1205,  275, 1660,
 /*   750 */   132, 1567, 1567, 1567, 1567,  101, 1401, 1567, 1116,  389,
 /*   760 */  1567, 1567, 1511, 1512, 1249, 1567,  313, 1210,  513, 1692,
 /*   770 */  1141, 1567,  265,  461,  263,  262, 1556,  388, 1683, 1237,
 /*   780 */  1192,  919,  392,  423,  166,  315, 1141,  164,  414, 1317,
 /*   790 */   168,  107, 1237,  167,  170,  519,  172,  169, 1118,  171,
 /*   800 */   920,  412,   25,  280, 1199, 1200, 1201, 1202, 1203, 1207,
 /*   810 */  1208, 1209,  305, 1103, 1104, 1384, 1596,  107,  522, 1121,
 /*   820 */  1122,  519, 1167, 1168, 1169, 1170, 1171, 1172, 1173,  464,
 /*   830 */   486, 1181, 1182, 1183, 1184, 1185, 1186,  518,  517,  516,
 /*   840 */  1612,  515,  113,  202,  522, 1468,  426,  469, 1596, 1343,
 /*   850 */    43,  252,   42,    9,    8,  189, 1263,  468,   35,  191,
 /*   860 */   435, 1567, 1212,  518,  517,  516,   35,  515, 1299, 1300,
 /*   870 */  1174,  403, 1612,  417,  195,  383, 1694,  458, 1624,  469,
 /*   880 */  1596,   74, 1597,  471, 1599, 1600,  467, 1338,  488,  468,
 /*   890 */  1240, 1664,  448, 1567, 1196,  275, 1660, 1738,   35,  208,
 /*   900 */  1589,  110, 1074,  210, 1612,  477, 1698, 1613, 1139,  405,
 /*   910 */  1624,  469, 1587,   74, 1597,  471, 1599, 1600,  467, 1336,
 /*   920 */   488,  468,  111, 1664, 1126, 1567,  216,  275, 1660, 1738,
 /*   930 */   204,  113, 1596,    2,  123,  978, 1125,  300, 1721,  234,
 /*   940 */    42,  408, 1624,  407,  973,   74, 1597,  471, 1599, 1600,
 /*   950 */   467,  232,  488,  304,  259, 1664, 1612,  261,  415,  275,
 /*   960 */  1660, 1738,  493,  469,  149,  947, 1006,  111, 1087,  224,
 /*   970 */  1682, 1010,  174,  468,  112,  410,  338, 1567, 1017, 1117,
 /*   980 */   404, 1596, 1509,  451,  113,  111,  173,  145, 1016,  114,
 /*   990 */   353,  345,  352,  354, 1624, 1115, 1129,  241, 1597,  471,
 /*  1000 */  1599, 1600,  467,  358,  488, 1612, 1148,  150, 1128,  359,
 /*  1010 */   360, 1147,  469,   46, 1123,  361,   45,  153,  362, 1146,
 /*  1020 */   363,  156,  468, 1726,   53,  366, 1567, 1145,   72,  159,
 /*  1030 */   387,  385, 1416, 1596, 1123,  163,  137,   79,  269, 1412,
 /*  1040 */  1723, 1552,  165, 1624,  225,  176,  126, 1597,  471, 1599,
 /*  1050 */  1600,  467,  179,  488,  116,  571,  117, 1612, 1414,   50,
 /*  1060 */    49,  325, 1410,  143,  469, 1596,  118, 1116,  319,  119,
 /*  1070 */   427,  418,  226,  181,  468,  184,  422,  419, 1567,  428,
 /*  1080 */   260, 1144,  311,  436,  307,  303,  140, 1705, 1695, 1612,
 /*  1090 */   452, 1739,  475, 1704,  187, 1624,  469,  433,   75, 1597,
 /*  1100 */   471, 1599, 1600,  467,  190,  488,  468, 1118, 1664,  274,
 /*  1110 */  1567,  439, 1663, 1660,  444, 1596,    5,  138, 1237,  432,
 /*  1120 */   104,  130, 1143, 1685,  194,    4,   37, 1624, 1121, 1122,
 /*  1130 */    75, 1597,  471, 1599, 1600,  467, 1679,  488,  196, 1612,
 /*  1140 */  1664,  456,   16,  276,  460, 1660,  469,  574,  459,  197,
 /*  1150 */  1722, 1518,  203, 1741, 1645, 1596,  468,  473,  474,  284,
 /*  1160 */  1567,  223, 1517,  478,   99,  214,  479,  480,  212,   62,
 /*  1170 */   563, 1427,  559,  555,  551,  222,   64, 1624,  227, 1612,
 /*  1180 */    75, 1597,  471, 1599, 1600,  467,  469,  488, 1399,  229,
 /*  1190 */  1664,  221,  491,  271,  570, 1661,  468,   44,  129,  235,
 /*  1200 */  1567,  231,   71,  431,  233,  217,  236, 1561, 1596, 1560,
 /*  1210 */   299, 1557,  301,  302, 1111, 1112,  141, 1624,  306, 1555,
 /*  1220 */   249, 1597,  471, 1599, 1600,  467,  308,  488,  309,  310,
 /*  1230 */  1554,  312, 1612, 1553,  314,  481, 1538,  142,  317,  469,
 /*  1240 */   318, 1090, 1089, 1532, 1531,  323,  324, 1530, 1529,  468,
 /*  1250 */  1057, 1502, 1501, 1567, 1500, 1499, 1498, 1596,  109, 1485,
 /*  1260 */  1484, 1483, 1482, 1481,  429, 1497, 1496,  182, 1596, 1495,
 /*  1270 */  1624, 1494, 1493,  244, 1597,  471, 1599, 1600,  467, 1492,
 /*  1280 */   488, 1612, 1491, 1490, 1095, 1489,  177, 1488,  469, 1487,
 /*  1290 */  1486, 1480, 1612, 1479, 1478, 1059, 1477, 1476,  468,  469,
 /*  1300 */  1355, 1546, 1567, 1540, 1524, 1515, 1405,  155,  912,  468,
 /*  1310 */  1354,  443, 1352, 1567,  367, 1596,  279,  368,  369, 1624,
 /*  1320 */  1350,  373,  126, 1597,  471, 1599, 1600,  467,  372,  488,
 /*  1330 */  1624, 1596,  162,  249, 1597,  471, 1599, 1600,  467, 1612,
 /*  1340 */   488, 1348,  377, 1346,  376,  371,  466, 1596, 1335,  375,
 /*  1350 */  1334,  379,  380, 1331, 1407, 1612,  468, 1025,  381, 1022,
 /*  1360 */  1567,   77,  469, 1406,  946,  945,  944, 1740,  943,  942,
 /*  1370 */   537, 1612,  468,  939,  539, 1344, 1567, 1624,  469,  281,
 /*  1380 */   248, 1597,  471, 1599, 1600,  467,  266,  488,  468, 1637,
 /*  1390 */   938, 1339, 1567, 1624,  267,  283,  249, 1597,  471, 1599,
 /*  1400 */  1600,  467, 1337,  488,  406, 1596,  268,  409, 1330, 1624,
 /*  1410 */   411, 1329,  249, 1597,  471, 1599, 1600,  467, 1596,  488,
 /*  1420 */   413,   76, 1545, 1097,   47, 1539,  420, 1523,  421, 1612,
 /*  1430 */  1522, 1514,  180,   57,    3,  120,  469, 1596,  183,   35,
 /*  1440 */    13,  127, 1612,  192,  185,   40,  468,  188, 1587,  469,
 /*  1450 */  1567,   14, 1262,   20,  193, 1255,   58,  199,   21,  468,
 /*  1460 */  1162, 1612, 1285, 1567,   39, 1234, 1233, 1624,  469,   38,
 /*  1470 */   237, 1597,  471, 1599, 1600,  467, 1290,  488,  468,   15,
 /*  1480 */  1624,  136, 1567,  243, 1597,  471, 1599, 1600,  467, 1284,
 /*  1490 */   488,   11, 1596,  277, 1289, 1288,  278,    8,   17, 1624,
 /*  1500 */  1197,  139,  245, 1597,  471, 1599, 1600,  467, 1596,  488,
 /*  1510 */  1176,   27,  470, 1175,   10,   18, 1612,   19,  476,  206,
 /*  1520 */   207, 1260,  209,  469,  211,   60, 1513,  213,  215,   61,
 /*  1530 */  1133,   65, 1612,  468, 1627, 1586, 1178, 1567,  487,  469,
 /*  1540 */   218,   41,  492, 1007,  291,  494,  497,  490, 1596,  468,
 /*  1550 */  1004,  496, 1001, 1567, 1624,  499,  500,  238, 1597,  471,
 /*  1560 */  1599, 1600,  467,  995,  488,  502, 1596,  503,  505,  993,
 /*  1570 */  1624,  506, 1612,  246, 1597,  471, 1599, 1600,  467,  469,
 /*  1580 */   488, 1596,  999,  998,  984,  997,  996,  512, 1019,  468,
 /*  1590 */  1612,   66, 1015, 1567,   67,   68, 1012,  469, 1018,  910,
 /*  1600 */   953,  523,  935,  933,  526, 1612,  220,  468,  932,  931,
 /*  1610 */  1624, 1567,  469,  239, 1597,  471, 1599, 1600,  467,  930,
 /*  1620 */   488,  929,  468,  928,  927,  926, 1567,  948, 1624,  950,
 /*  1630 */  1596,  247, 1597,  471, 1599, 1600,  467,  923,  488,  922,
 /*  1640 */   921, 1351,  918, 1624,  917,  916,  240, 1597,  471, 1599,
 /*  1650 */  1600,  467,  915,  488, 1612,  548,  549, 1349,  550,  552,
 /*  1660 */   553,  469,  554, 1347,  556,  557,  558, 1345,  560,  561,
 /*  1670 */   562,  468, 1333,  564,  565, 1567, 1332, 1596, 1328,  573,
 /*  1680 */   568,  569, 1303, 1119,  230,  572, 1303, 1303, 1303, 1303,
 /*  1690 */  1303, 1303, 1624, 1303, 1303, 1608, 1597,  471, 1599, 1600,
 /*  1700 */   467, 1612,  488, 1303, 1303, 1303, 1303, 1596,  469, 1303,
 /*  1710 */  1303, 1303, 1303, 1303, 1303, 1303, 1303, 1303,  468, 1303,
 /*  1720 */  1303, 1303, 1567, 1303, 1303, 1303, 1303, 1303, 1303, 1303,
 /*  1730 */  1303, 1612, 1303, 1303, 1303, 1303, 1303, 1596,  469, 1624,
 /*  1740 */  1303, 1303, 1607, 1597,  471, 1599, 1600,  467,  468,  488,
 /*  1750 */  1303, 1303, 1567, 1303, 1303, 1303, 1303, 1303, 1303, 1303,
 /*  1760 */  1303, 1612, 1303, 1303, 1303, 1303, 1303, 1596,  469, 1624,
 /*  1770 */  1303, 1303, 1606, 1597,  471, 1599, 1600,  467,  468,  488,
 /*  1780 */  1303, 1303, 1567, 1303, 1303, 1303, 1303, 1303, 1303, 1303,
 /*  1790 */  1303, 1612, 1303, 1303, 1303, 1303, 1303, 1596,  469, 1624,
 /*  1800 */  1303, 1303,  257, 1597,  471, 1599, 1600,  467,  468,  488,
 /*  1810 */  1303, 1303, 1567, 1303, 1303, 1303, 1596, 1303, 1303, 1303,
 /*  1820 */  1303, 1612, 1303, 1303, 1303, 1303, 1303, 1303,  469, 1624,
 /*  1830 */  1303, 1303,  256, 1597,  471, 1599, 1600,  467,  468,  488,
 /*  1840 */  1612, 1303, 1567, 1303, 1303, 1303, 1596,  469,  289,  288,
 /*  1850 */  1303, 1303, 1303, 1303, 1303, 1303, 1303,  468, 1131, 1624,
 /*  1860 */  1303, 1567,  258, 1597,  471, 1599, 1600,  467, 1303,  488,
 /*  1870 */  1612, 1303, 1303, 1303, 1124, 1303, 1303,  469, 1624, 1303,
 /*  1880 */  1303,  255, 1597,  471, 1599, 1600,  467,  468,  488, 1303,
 /*  1890 */  1303, 1567, 1303, 1123, 1303, 1303, 1303, 1303, 1303, 1303,
 /*  1900 */  1303, 1303, 1303, 1303, 1303, 1303, 1303, 1303, 1624, 1303,
 /*  1910 */  1303,  242, 1597,  471, 1599, 1600,  467, 1303,  488, 1303,
 /*  1920 */  1303, 1303, 1303, 1303, 1303, 1303, 1303, 1303, 1303, 1303,
 /*  1930 */  1303, 1303, 1303, 1303,  489, 1303, 1303, 1303, 1303, 1303,
 /*  1940 */  1303, 1303, 1303, 1303, 1303, 1303, 1127, 1303, 1303, 1303,
 /*  1950 */  1303, 1303, 1303, 1303, 1303, 1303, 1303, 1303, 1303, 1303,
 /*  1960 */  1303, 1303, 1303, 1303, 1303, 1303, 1303, 1303, 1303, 1303,
 /*  1970 */  1303, 1303, 1303, 1303, 1303, 1303, 1303, 1303, 1303, 1303,
 /*  1980 */  1303, 1303, 1303, 1303, 1303, 1303, 1132, 1303, 1303, 1303,
 /*  1990 */  1303, 1303, 1303, 1303, 1303, 1303, 1303, 1303, 1303, 1303,
 /*  2000 */  1303, 1303, 1303, 1303, 1303, 1303, 1303, 1135, 1303, 1303,
 /*  2010 */  1303, 1303, 1303, 1303, 1303, 1303, 1303, 1303,  486, 1181,
 /*  2020 */  1182,
418 419
};
static const YYCODETYPE yy_lookahead[] = {
420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435
 /*     0 */   262,  233,  240,  235,  234,  240,  240,  285,  257,  279,
 /*    10 */   275,  249,   12,   13,  249,  249,  281,  279,  256,  268,
 /*    20 */    20,  256,   22,  240,  294,  295,  296,  265,  258,   20,
 /*    30 */   265,  265,  294,  295,  296,  265,  306,  240,   38,   12,
 /*    40 */    13,   14,   15,   16,  306,  275,  249,  325,  265,  279,
 /*    50 */    50,   12,   13,   14,   20,  285,   20,   57,    4,   20,
 /*    60 */   338,   22,  265,  243,  342,  325,  296,  247,  325,  299,
 /*    70 */   300,  301,  302,  303,  304,   75,  306,   38,  338,  309,
 /*    80 */     2,  338,  342,  313,  314,  342,  303,  240,  240,   50,
 /*    90 */    12,   13,   14,   15,   16,  325,   57,  249,   98,    0,
 /*   100 */   317,  318,  319,  320,   49,  322,  310,  311,  338,   75,
 /*   110 */   110,   75,  342,  265,   75,    0,   72,  270,   89,   90,
 /*   120 */    91,   92,   93,   94,   95,   96,   97,   98,   99,   38,
 /*   130 */   101,  102,  103,  104,  105,  106,   21,   98,   20,   24,
 /*   140 */    25,   26,   27,   28,   29,   30,   31,   32,   57,  110,
 /*   150 */   150,   52,   53,   54,   55,   56,   20,   58,   59,   60,
X
Xiaoyu Wang 已提交
436
 /*   160 */    61,   62,   63,   64,   65,   66,   67,   68,   69,   70,
437
 /*   170 */    71,  171,  172,   20,  174,  175,  176,  177,  178,  179,
X
Xiaoyu Wang 已提交
438
 /*   180 */   180,  181,  182,  183,  184,  185,  186,  187,  188,  150,
439 440
 /*   190 */    14,   15,   16,   52,  285,   54,   75,  258,  149,   58,
 /*   200 */   151,  201,   61,  264,   63,   64,   85,   66,  269,  242,
X
Xiaoyu Wang 已提交
441 442
 /*   210 */   171,  172,   71,  174,  175,  176,  177,  178,  179,  180,
 /*   220 */   181,  182,  183,  184,  185,  186,  187,  188,   12,   13,
443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458
 /*   230 */   263,  240,  239,  234,  325,  201,   20,   18,   22,   20,
 /*   240 */    12,   13,   14,   15,   16,  240,   27,  338,  242,   30,
 /*   250 */   201,  342,   74,  260,   38,  201,  265,  258,   39,  275,
 /*   260 */    82,  255,  278,  219,  265,  281,   50,   12,   13,  263,
 /*   270 */   265,  240,  240,   57,  275,   20,  285,   22,  279,   21,
 /*   280 */   249,  249,   24,   25,   26,   27,   28,   29,   30,   31,
 /*   290 */    32,   75,   20,   38,  303,  296,  265,  265,  299,  300,
 /*   300 */   301,  302,  303,  304,  305,  306,  307,  308,  303,  318,
 /*   310 */   319,  320,   57,  322,   98,    0,  325,   20,  159,  160,
 /*   320 */   142,  258,  163,  318,  319,  320,  110,  322,  265,  338,
 /*   330 */    75,    0,  113,  342,  201,  116,  117,  118,  119,  120,
 /*   340 */     0,  122,  123,  124,  125,  126,  127,  128,  129,  130,
 /*   350 */   131,  132,  133,   98,  201,   24,   25,   26,   27,   28,
 /*   360 */    29,   30,   31,   32,  301,  110,  150,   52,  265,   54,
 /*   370 */    20,  143,   49,   58,  258,  272,   61,   86,   63,   64,
 /*   380 */   264,   66,  171,  237,  238,  269,   71,  171,  172,   49,
X
Xiaoyu Wang 已提交
459
 /*   390 */   174,  175,  176,  177,  178,  179,  180,  181,  182,  183,
460 461 462
 /*   400 */   184,  185,  186,  187,  188,  150,   12,   13,   14,   15,
 /*   410 */    16,  267,  250,   12,   13,   14,   15,   16,  274,  275,
 /*   420 */   258,  210,  211,  212,  213,  214,  171,  172,  266,  174,
X
Xiaoyu Wang 已提交
463
 /*   430 */   175,  176,  177,  178,  179,  180,  181,  182,  183,  184,
464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480
 /*   440 */   185,  186,  187,  188,   12,   13,   14,  258,  244,  245,
 /*   450 */   222,   50,   20,  264,   22,  240,  201,  234,  269,    3,
 /*   460 */    33,  239,  262,   36,  249,   57,   20,  240,   22,   42,
 /*   470 */    38,   44,   45,   46,   47,  253,  249,   76,  240,  279,
 /*   480 */   265,  258,  260,   12,   13,   84,   40,  249,  265,   57,
 /*   490 */   140,   20,  265,   22,  294,  295,  296,  258,  275,  234,
 /*   500 */    67,   74,  279,  265,   77,  266,  306,   75,  240,   38,
 /*   510 */   259,   12,   13,   14,   15,   16,   61,  249,  138,  296,
 /*   520 */    65,  134,  299,  300,  301,  302,  303,  304,   57,  306,
 /*   530 */    98,    0,  309,  265,  140,  134,  313,  314,  315,  240,
 /*   540 */   240,  154,  110,   88,  279,  250,   75,  114,  115,  249,
 /*   550 */   327,  250,  259,  258,  240,  154,  333,  334,   20,  258,
 /*   560 */     2,  266,  135,  249,  137,  265,  139,  266,  231,   98,
 /*   570 */    12,   13,   14,   15,   16,   76,  189,  258,  234,  265,
 /*   580 */    49,  110,  150,  259,  285,  158,  206,  207,  269,   22,
 /*   590 */   189,  190,  191,  192,  193,  194,  195,  196,  197,  198,
 /*   600 */   259,    1,    2,  171,  172,   38,  174,  175,  176,  177,
X
Xiaoyu Wang 已提交
481
 /*   610 */   178,  179,  180,  181,  182,  183,  184,  185,  186,  187,
482 483 484
 /*   620 */   188,  150,  285,  279,  325,   12,   13,   14,   15,   16,
 /*   630 */    12,   13,   14,   15,   16,   43,  234,  338,  234,  240,
 /*   640 */   234,  342,  171,  172,   47,  174,  175,  176,  177,  178,
X
Xiaoyu Wang 已提交
485
 /*   650 */   179,  180,  181,  182,  183,  184,  185,  186,  187,  188,
486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627
 /*   660 */    12,   13,  325,   50,  265,  244,  245,  297,   20,  234,
 /*   670 */    22,   74,  297,  217,   77,  338,   76,  234,  140,  342,
 /*   680 */   297,  279,  234,  279,  259,  279,   38,  234,  234,  244,
 /*   690 */   245,  321,    4,  258,   76,  234,  321,   84,  234,   72,
 /*   700 */   265,  259,  303,   76,  321,   57,  234,  234,  234,  234,
 /*   710 */   275,  246,  234,  248,  279,  234,  234,  318,  319,  320,
 /*   720 */   234,  322,  279,   75,  244,  245,  234,  279,   72,   35,
 /*   730 */     0,  296,  279,  279,  299,  300,  301,  302,  303,  304,
 /*   740 */   279,  306,  251,  279,  309,  254,   98,  134,  313,  314,
 /*   750 */   315,  279,  279,  279,  279,   61,    0,  279,  110,   65,
 /*   760 */   279,  279,  274,  275,   14,  279,  146,  154,  259,  334,
 /*   770 */    20,  279,   78,   50,   80,   81,    0,   83,  199,  200,
 /*   780 */    14,   38,   88,  288,   79,  165,   20,   82,   21,  235,
 /*   790 */    79,   61,  200,   82,   79,   65,   79,   82,  150,   82,
 /*   800 */    57,   34,  189,  190,  191,  192,  193,  194,  195,  196,
 /*   810 */   197,  198,   36,  161,  162,  247,  234,   61,   88,  171,
 /*   820 */   172,   65,  174,  175,  176,  177,  178,  179,  180,  181,
 /*   830 */   182,  183,  184,  185,  186,  187,  188,  107,  108,  109,
 /*   840 */   258,  111,   72,  345,   88,  268,   76,  265,  234,    0,
 /*   850 */   140,  141,   72,    1,    2,   72,   76,  275,   72,   76,
 /*   860 */   336,  279,   76,  107,  108,  109,   72,  111,  186,  187,
 /*   870 */    76,   22,  258,  292,  330,  237,  298,  221,  296,  265,
 /*   880 */   234,  299,  300,  301,  302,  303,  304,    0,  306,  275,
 /*   890 */   202,  309,  323,  279,  171,  313,  314,  315,   72,   72,
 /*   900 */    75,   72,   76,   76,  258,   76,  324,  258,   20,   22,
 /*   910 */   296,  265,   87,  299,  300,  301,  302,  303,  304,    0,
 /*   920 */   306,  275,   72,  309,   38,  279,   76,  313,  314,  315,
 /*   930 */   339,   72,  234,  326,   18,   76,   38,  240,  324,   23,
 /*   940 */    72,   22,  296,    4,   76,  299,  300,  301,  302,  303,
 /*   950 */   304,   35,  306,   36,  293,  309,  258,  244,   19,  313,
 /*   960 */   314,  315,   72,  265,   48,   38,   76,   72,  148,  286,
 /*   970 */   324,   76,   33,  275,   72,   36,  240,  279,   76,   22,
 /*   980 */    41,  234,  240,  285,   72,   72,   47,  121,   76,   76,
 /*   990 */   134,  273,  271,  271,  296,   38,  110,  299,  300,  301,
 /*  1000 */   302,  303,  304,  240,  306,  258,   20,  242,  110,  290,
 /*  1010 */   275,   20,  265,   74,   57,  283,   77,  242,  265,   20,
 /*  1020 */   276,  242,  275,  325,  242,  240,  279,   20,  112,  242,
 /*  1030 */   258,  236,  258,  234,   57,  258,  338,  240,  236,  258,
 /*  1040 */   342,  279,  258,  296,  290,  239,  299,  300,  301,  302,
 /*  1050 */   303,  304,  239,  306,  258,   98,  258,  258,  258,  143,
 /*  1060 */   144,  145,  258,  147,  265,  234,  258,  110,  152,  258,
 /*  1070 */   265,  157,  283,  239,  275,  239,  275,  289,  279,  276,
 /*  1080 */   164,   20,  166,  209,  168,  169,  170,  335,  298,  258,
 /*  1090 */   343,  344,  208,  335,  280,  296,  265,  279,  299,  300,
 /*  1100 */   301,  302,  303,  304,  280,  306,  275,  150,  309,  279,
 /*  1110 */   279,  279,  313,  314,  215,  234,  216,  201,  200,  204,
 /*  1120 */   265,  329,   20,  332,  331,  203,  121,  296,  171,  172,
 /*  1130 */   299,  300,  301,  302,  303,  304,  297,  306,  328,  258,
 /*  1140 */   309,  218,   75,  223,  313,  314,  265,   19,  220,  316,
 /*  1150 */   341,  280,  340,  346,  312,  234,  275,  279,  279,  279,
 /*  1160 */   279,   33,  280,  137,   36,  239,  277,  276,  265,  239,
 /*  1170 */    42,  265,   44,   45,   46,   47,   75,  296,  254,  258,
 /*  1180 */   299,  300,  301,  302,  303,  304,  265,  306,  248,  240,
 /*  1190 */   309,  239,  261,  284,  236,  314,  275,  287,  291,  252,
 /*  1200 */   279,  241,   74,  282,  232,   77,  252,    0,  234,    0,
 /*  1210 */    64,    0,   38,  167,   38,   38,   38,  296,  167,    0,
 /*  1220 */   299,  300,  301,  302,  303,  304,   38,  306,   38,  167,
 /*  1230 */     0,   38,  258,    0,   38,  107,    0,   75,  154,  265,
 /*  1240 */   153,  110,  150,    0,    0,   53,  146,    0,    0,  275,
 /*  1250 */    87,    0,    0,  279,    0,    0,    0,  234,  121,    0,
 /*  1260 */     0,    0,    0,    0,  136,    0,    0,  139,  234,    0,
 /*  1270 */   296,    0,    0,  299,  300,  301,  302,  303,  304,    0,
 /*  1280 */   306,  258,    0,    0,  156,    0,  158,    0,  265,    0,
 /*  1290 */     0,    0,  258,    0,    0,   22,    0,    0,  275,  265,
 /*  1300 */     0,    0,  279,    0,    0,    0,    0,   43,   51,  275,
 /*  1310 */     0,  337,    0,  279,   38,  234,  282,   36,   43,  296,
 /*  1320 */     0,   43,  299,  300,  301,  302,  303,  304,   36,  306,
 /*  1330 */   296,  234,   82,  299,  300,  301,  302,  303,  304,  258,
 /*  1340 */   306,    0,   43,    0,   36,   38,  265,  234,    0,   38,
 /*  1350 */     0,   38,   36,    0,    0,  258,  275,   38,   43,   22,
 /*  1360 */   279,   84,  265,    0,   38,   38,   38,  344,   38,   38,
 /*  1370 */    72,  258,  275,   38,   72,    0,  279,  296,  265,  282,
 /*  1380 */   299,  300,  301,  302,  303,  304,   22,  306,  275,  308,
 /*  1390 */    38,    0,  279,  296,   22,  282,  299,  300,  301,  302,
 /*  1400 */   303,  304,    0,  306,   39,  234,   22,   38,    0,  296,
 /*  1410 */    22,    0,  299,  300,  301,  302,  303,  304,  234,  306,
 /*  1420 */    22,   20,    0,   38,  140,    0,   22,    0,  140,  258,
 /*  1430 */     0,    0,  137,   75,   72,  155,  265,  234,   43,   72,
 /*  1440 */   205,   75,  258,   75,  135,   72,  275,   76,   87,  265,
 /*  1450 */   279,  205,   76,   75,   72,   76,   75,   87,   72,  275,
 /*  1460 */    22,  258,   38,  279,   72,   76,   76,  296,  265,  199,
 /*  1470 */   299,  300,  301,  302,  303,  304,   76,  306,  275,   72,
 /*  1480 */   296,   87,  279,  299,  300,  301,  302,  303,  304,   38,
 /*  1490 */   306,  205,  234,   38,   38,   38,   38,    2,   72,  296,
 /*  1500 */   171,   87,  299,  300,  301,  302,  303,  304,  234,  306,
 /*  1510 */    76,   75,  173,   76,   75,   75,  258,   75,  138,   87,
 /*  1520 */    76,   76,   75,  265,   75,   75,    0,   43,  135,   75,
 /*  1530 */    22,   85,  258,  275,   75,   87,   76,  279,   75,  265,
 /*  1540 */    87,   75,   38,   76,   38,   75,   75,   86,  234,  275,
 /*  1550 */    76,   38,   76,  279,  296,   38,   75,  299,  300,  301,
 /*  1560 */   302,  303,  304,   76,  306,   38,  234,   75,   38,   76,
 /*  1570 */   296,   75,  258,  299,  300,  301,  302,  303,  304,  265,
 /*  1580 */   306,  234,  100,  100,   22,  100,  100,   88,   38,  275,
 /*  1590 */   258,   75,   38,  279,   75,   75,   22,  265,  110,   51,
 /*  1600 */    57,   50,   38,   38,   73,  258,   72,  275,   38,   38,
 /*  1610 */   296,  279,  265,  299,  300,  301,  302,  303,  304,   38,
 /*  1620 */   306,   38,  275,   38,   38,   22,  279,   38,  296,   57,
 /*  1630 */   234,  299,  300,  301,  302,  303,  304,   38,  306,   38,
 /*  1640 */    38,    0,   38,  296,   38,   38,  299,  300,  301,  302,
 /*  1650 */   303,  304,   38,  306,  258,   38,   36,    0,   43,   38,
 /*  1660 */    36,  265,   43,    0,   38,   36,   43,    0,   38,   36,
 /*  1670 */    43,  275,    0,   38,   37,  279,    0,  234,    0,   20,
 /*  1680 */    22,   21,  347,   22,   22,   21,  347,  347,  347,  347,
 /*  1690 */   347,  347,  296,  347,  347,  299,  300,  301,  302,  303,
 /*  1700 */   304,  258,  306,  347,  347,  347,  347,  234,  265,  347,
 /*  1710 */   347,  347,  347,  347,  347,  347,  347,  347,  275,  347,
 /*  1720 */   347,  347,  279,  347,  347,  347,  347,  347,  347,  347,
 /*  1730 */   347,  258,  347,  347,  347,  347,  347,  234,  265,  296,
 /*  1740 */   347,  347,  299,  300,  301,  302,  303,  304,  275,  306,
 /*  1750 */   347,  347,  279,  347,  347,  347,  347,  347,  347,  347,
 /*  1760 */   347,  258,  347,  347,  347,  347,  347,  234,  265,  296,
 /*  1770 */   347,  347,  299,  300,  301,  302,  303,  304,  275,  306,
 /*  1780 */   347,  347,  279,  347,  347,  347,  347,  347,  347,  347,
 /*  1790 */   347,  258,  347,  347,  347,  347,  347,  234,  265,  296,
 /*  1800 */   347,  347,  299,  300,  301,  302,  303,  304,  275,  306,
 /*  1810 */   347,  347,  279,  347,  347,  347,  234,  347,  347,  347,
 /*  1820 */   347,  258,  347,  347,  347,  347,  347,  347,  265,  296,
 /*  1830 */   347,  347,  299,  300,  301,  302,  303,  304,  275,  306,
 /*  1840 */   258,  347,  279,  347,  347,  347,  234,  265,   12,   13,
 /*  1850 */   347,  347,  347,  347,  347,  347,  347,  275,   22,  296,
 /*  1860 */   347,  279,  299,  300,  301,  302,  303,  304,  347,  306,
 /*  1870 */   258,  347,  347,  347,   38,  347,  347,  265,  296,  347,
 /*  1880 */   347,  299,  300,  301,  302,  303,  304,  275,  306,  347,
 /*  1890 */   347,  279,  347,   57,  347,  347,  347,  347,  347,  347,
 /*  1900 */   347,  347,  347,  347,  347,  347,  347,  347,  296,  347,
 /*  1910 */   347,  299,  300,  301,  302,  303,  304,  347,  306,  347,
 /*  1920 */   347,  347,  347,  347,  347,  347,  347,  347,  347,  347,
 /*  1930 */   347,  347,  347,  347,   98,  347,  347,  347,  347,  347,
 /*  1940 */   347,  347,  347,  347,  347,  347,  110,  347,  347,  347,
 /*  1950 */   347,  347,  347,  347,  347,  347,  347,  347,  347,  347,
 /*  1960 */   347,  347,  347,  347,  347,  347,  347,  347,  347,  347,
 /*  1970 */   347,  347,  347,  347,  347,  347,  347,  347,  347,  347,
 /*  1980 */   347,  347,  347,  347,  347,  347,  150,  347,  347,  347,
 /*  1990 */   347,  347,  347,  347,  347,  347,  347,  347,  347,  347,
 /*  2000 */   347,  347,  347,  347,  347,  347,  347,  171,  347,  347,
 /*  2010 */   347,  347,  347,  347,  347,  347,  347,  347,  182,  183,
 /*  2020 */   184,  347,  347,  347,  347,  347,  347,  347,  347,  347,
 /*  2030 */   347,  347,  347,  347,  347,  347,  347,  347,  347,  347,
 /*  2040 */   347,  347,  347,  347,  347,  347,  347,  347,  347,  347,
 /*  2050 */   347,  347,  347,  347,  347,  347,  347,  347,  347,  347,
 /*  2060 */   347,  347,  347,  347,  347,  347,  347,  347,  347,  347,
 /*  2070 */   347,  347,  347,  347,  347,  347,  347,  347,  347,  347,
628
};
629
#define YY_SHIFT_COUNT    (574)
630
#define YY_SHIFT_MIN      (0)
631
#define YY_SHIFT_MAX      (1836)
632
static const unsigned short int yy_shift_ofst[] = {
633
 /*     0 */   916,    0,   39,  216,  216,  216,  216,  255,  216,  216,
X
Xiaoyu Wang 已提交
634 635
 /*    10 */   432,  471,  648,  471,  471,  471,  471,  471,  471,  471,
 /*    20 */   471,  471,  471,  471,  471,  471,  471,  471,  471,  471,
636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690
 /*    30 */   471,  471,  471,  471,  471,  471,   34,   36,   36,   36,
 /*    40 */  1836, 1836, 1836,  153,   49,    9,    9,  133,   54,    9,
 /*    50 */     9,    9,    9,    9,    9,   55,    9,  118,  136,  133,
 /*    60 */   272,  118,    9,    9,  118,    9,  118,  272,  118,  118,
 /*    70 */     9,  323,  219,  401,  613,  613,  258,  957,  694,  141,
 /*    80 */   957,  957,  957,  957,  957,  957,  957,  957,  957,  957,
 /*    90 */   957,  957,  957,  957,  957,  957,  957,  957,  957,  446,
 /*   100 */   340,   91,   91,  350,  350,  350,  531,   91,   91,  297,
 /*   110 */   272,  118,  272,  118,  291,  408,   29,   29,   29,   29,
 /*   120 */    29,   29,   29, 1128,  115,  315,  228,  211,  455,  159,
 /*   130 */   380,  567,  538,  579,  592,  579,  750,  456,  688,  766,
 /*   140 */   888,  917,  927,  820,  888,  888,  866,  856,  856,  888,
 /*   150 */   986,   55,  272,  991,   55,  297,  999,   55,   55,  888,
 /*   160 */    55, 1007,  118,  118,  118,  118,  118,  118,  118,  118,
 /*   170 */   118,  118,  118,  888, 1007,  977,  986,  323,  914,  272,
 /*   180 */   323,  991,  323,  297,  999,  323, 1061,  874,  884,  977,
 /*   190 */   874,  884,  977,  977,  900,  899,  915,  922,  918,  297,
 /*   200 */  1102, 1005,  920,  928,  923, 1067,  118,  884,  977,  977,
 /*   210 */   884,  977, 1026,  297,  999,  323,  291,  323,  297, 1101,
 /*   220 */   408,  888,  323, 1007, 2021, 2021, 2021, 2021, 2021, 2021,
 /*   230 */  2021,   99,  427,  331,  939,  730,  756,  499,   78,  558,
 /*   240 */   394,  618,   27,   27,   27,   27,   27,   27,   27,   27,
 /*   250 */   597,  433,  178,  600,  387,  176,  176,  176,  176,  776,
 /*   260 */   620,  627,  705,  711,  715,  717,  849,  887,  919,  767,
 /*   270 */   652,  710,  770,  780,  783,  852,  682,   44,  656,  786,
 /*   280 */   723,  794,  825,  826,  827,  829,  850,  859,  886,  898,
 /*   290 */   868,  890,  895,  902,  912,  913,  121,  743, 1207, 1209,
 /*   300 */  1146, 1211, 1174, 1046, 1176, 1177, 1178, 1051, 1219, 1188,
 /*   310 */  1190, 1062, 1230, 1193, 1233, 1196, 1236, 1162, 1084, 1087,
 /*   320 */  1131, 1092, 1243, 1244, 1192, 1100, 1247, 1248, 1163, 1251,
 /*   330 */  1252, 1254, 1255, 1256, 1265, 1266, 1269, 1271, 1272, 1279,
 /*   340 */  1282, 1283, 1285, 1287, 1289, 1290, 1137, 1259, 1260, 1261,
 /*   350 */  1262, 1263, 1291, 1273, 1293, 1294, 1296, 1297, 1300, 1301,
 /*   360 */  1303, 1304, 1305, 1264, 1306, 1257, 1310, 1312, 1276, 1281,
 /*   370 */  1275, 1320, 1307, 1292, 1278, 1341, 1311, 1308, 1299, 1343,
 /*   380 */  1313, 1316, 1315, 1348, 1350, 1353, 1354, 1277, 1250, 1319,
 /*   390 */  1298, 1302, 1337, 1363, 1326, 1327, 1328, 1330, 1331, 1298,
 /*   400 */  1302, 1335, 1352, 1375, 1364, 1391, 1372, 1365, 1402, 1384,
 /*   410 */  1369, 1408, 1388, 1411, 1398, 1401, 1422, 1284, 1385, 1425,
 /*   420 */  1280, 1404, 1288, 1295, 1427, 1430, 1431, 1358, 1395, 1309,
 /*   430 */  1362, 1367, 1235, 1371, 1373, 1376, 1366, 1368, 1378, 1379,
 /*   440 */  1382, 1361, 1381, 1386, 1246, 1389, 1390, 1370, 1270, 1392,
 /*   450 */  1394, 1400, 1407, 1286, 1424, 1451, 1455, 1456, 1457, 1458,
 /*   460 */  1495, 1329, 1426, 1434, 1436, 1437, 1414, 1439, 1440, 1432,
 /*   470 */  1438, 1339, 1442, 1444, 1445, 1447, 1449, 1380, 1450, 1526,
 /*   480 */  1484, 1393, 1454, 1446, 1448, 1453, 1459, 1460, 1463, 1508,
 /*   490 */  1466, 1461, 1467, 1504, 1506, 1470, 1474, 1513, 1471, 1476,
 /*   500 */  1517, 1481, 1487, 1527, 1492, 1493, 1530, 1496, 1482, 1483,
 /*   510 */  1485, 1486, 1562, 1499, 1516, 1550, 1488, 1519, 1520, 1554,
 /*   520 */  1298, 1302, 1574, 1548, 1551, 1564, 1543, 1531, 1534, 1565,
 /*   530 */  1570, 1571, 1581, 1583, 1585, 1586, 1603, 1572, 1298, 1589,
 /*   540 */  1302, 1599, 1601, 1602, 1604, 1606, 1607, 1614, 1641, 1617,
 /*   550 */  1620, 1615, 1657, 1621, 1624, 1619, 1663, 1626, 1629, 1623,
 /*   560 */  1667, 1630, 1633, 1627, 1672, 1635, 1637, 1676, 1678, 1658,
 /*   570 */  1660, 1661, 1662, 1664, 1659,
691
};
X
Xiaoyu Wang 已提交
692
#define YY_REDUCE_COUNT (230)
693 694
#define YY_REDUCE_MIN   (-278)
#define YY_REDUCE_MAX   (1612)
695
static const short yy_reduce_ofst[] = {
696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719
 /*     0 */   337, -230,  223,  435,  582,  614,  646,  698,  799,  831,
 /*    10 */    -1,  747,  881,  921,  974, 1023, 1034, 1081, 1097, 1113,
 /*    20 */  1171, 1184, 1203, 1258, 1274, 1314, 1332, 1347, 1396, 1443,
 /*    30 */  1473, 1503, 1533, 1563, 1582, 1612,   -9, -217,    5,  399,
 /*    40 */  -262,  200, -270,  299, -278, -238, -235,  -91, -260, -234,
 /*    50 */  -203, -152,   31,   32,  215,    6,  227,  -61,   63, -257,
 /*    60 */   -16,  162,  238,  268,  116,  300,  295,  144,  189,  301,
 /*    70 */   314,  222, -153, -204, -204, -204, -232,  265, -249, -180,
 /*    80 */   344,  402,  404,  406,  443,  448,  453,  454,  461,  464,
 /*    90 */   472,  473,  474,  475,  478,  481,  482,  486,  492,  146,
 /*   100 */   -33,  204,  421,  370,  375,  383,   -7,  445,  480,  103,
 /*   110 */  -265,  239,  488,  319,  491,  465,  251,  293,  324,  341,
 /*   120 */   425,  442,  509,  495,  554,  568,  498,  524,  577,  581,
 /*   130 */   544,  638,  578,  569,  569,  569,  649,  591,  607,  649,
 /*   140 */   697,  661,  713,  683,  736,  742,  718,  721,  722,  763,
 /*   150 */   719,  765,  735,  732,  775,  753,  744,  779,  782,  785,
 /*   160 */   787,  795,  772,  774,  777,  781,  784,  796,  798,  800,
 /*   170 */   804,  808,  811,  797,  802,  762,  754,  806,  788,  801,
 /*   180 */   813,  789,  834,  805,  803,  836,  790,  752,  814,  818,
 /*   190 */   758,  824,  830,  832,  791,  793,  792,  810,  569,  855,
 /*   200 */   839,  833,  807,  809,  812,  842,  649,  871,  878,  879,
 /*   210 */   882,  880,  889,  903,  891,  926,  924,  930,  906,  931,
 /*   220 */   940,  949,  952,  958,  910,  907,  909,  947,  954,  960,
 /*   230 */   972,
720 721
};
static const YYACTIONTYPE yy_default[] = {
722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779
 /*     0 */  1301, 1301, 1301, 1301, 1301, 1301, 1301, 1301, 1301, 1301,
 /*    10 */  1301, 1301, 1301, 1301, 1301, 1301, 1301, 1301, 1301, 1301,
 /*    20 */  1301, 1301, 1301, 1301, 1301, 1301, 1301, 1301, 1301, 1301,
 /*    30 */  1301, 1301, 1301, 1301, 1301, 1301, 1301, 1301, 1301, 1301,
 /*    40 */  1301, 1301, 1301, 1301, 1301, 1301, 1301, 1301, 1301, 1301,
 /*    50 */  1301, 1301, 1301, 1301, 1301, 1360, 1301, 1301, 1301, 1301,
 /*    60 */  1301, 1301, 1301, 1301, 1301, 1301, 1301, 1301, 1301, 1301,
 /*    70 */  1301, 1358, 1503, 1301, 1666, 1301, 1301, 1301, 1301, 1301,
 /*    80 */  1301, 1301, 1301, 1301, 1301, 1301, 1301, 1301, 1301, 1301,
 /*    90 */  1301, 1301, 1301, 1301, 1301, 1301, 1301, 1301, 1301, 1301,
 /*   100 */  1360, 1301, 1301, 1677, 1677, 1677, 1358, 1301, 1301, 1301,
 /*   110 */  1301, 1301, 1301, 1301, 1455, 1301, 1301, 1301, 1301, 1301,
 /*   120 */  1301, 1301, 1301, 1541, 1301, 1301, 1742, 1301, 1408, 1547,
 /*   130 */  1701, 1301, 1693, 1669, 1683, 1670, 1301, 1727, 1686, 1301,
 /*   140 */  1301, 1301, 1301, 1533, 1301, 1301, 1508, 1505, 1505, 1301,
 /*   150 */  1301, 1360, 1301, 1301, 1360, 1301, 1301, 1360, 1360, 1301,
 /*   160 */  1360, 1301, 1301, 1301, 1301, 1301, 1301, 1301, 1301, 1301,
 /*   170 */  1301, 1301, 1301, 1301, 1301, 1301, 1301, 1358, 1543, 1301,
 /*   180 */  1358, 1301, 1358, 1301, 1301, 1358, 1301, 1708, 1706, 1301,
 /*   190 */  1708, 1706, 1301, 1301, 1720, 1716, 1699, 1697, 1683, 1301,
 /*   200 */  1301, 1301, 1745, 1733, 1729, 1301, 1301, 1706, 1301, 1301,
 /*   210 */  1706, 1301, 1516, 1301, 1301, 1358, 1301, 1358, 1301, 1424,
 /*   220 */  1301, 1301, 1358, 1301, 1535, 1549, 1525, 1458, 1458, 1361,
 /*   230 */  1306, 1301, 1301, 1301, 1301, 1301, 1301, 1301, 1301, 1301,
 /*   240 */  1301, 1301, 1611, 1719, 1718, 1642, 1641, 1640, 1638, 1610,
 /*   250 */  1301, 1301, 1301, 1301, 1301, 1604, 1605, 1603, 1602, 1301,
 /*   260 */  1301, 1301, 1301, 1301, 1301, 1301, 1301, 1301, 1301, 1301,
 /*   270 */  1301, 1301, 1301, 1301, 1301, 1667, 1301, 1730, 1734, 1301,
 /*   280 */  1301, 1301, 1588, 1301, 1301, 1301, 1301, 1301, 1301, 1301,
 /*   290 */  1301, 1301, 1301, 1301, 1301, 1301, 1301, 1301, 1301, 1301,
 /*   300 */  1301, 1301, 1301, 1301, 1301, 1301, 1301, 1301, 1301, 1301,
 /*   310 */  1301, 1301, 1301, 1301, 1301, 1301, 1301, 1301, 1301, 1301,
 /*   320 */  1301, 1301, 1301, 1301, 1301, 1301, 1301, 1301, 1301, 1301,
 /*   330 */  1301, 1301, 1301, 1301, 1301, 1301, 1301, 1301, 1301, 1301,
 /*   340 */  1301, 1301, 1301, 1301, 1301, 1301, 1301, 1301, 1301, 1301,
 /*   350 */  1301, 1301, 1301, 1301, 1301, 1301, 1301, 1301, 1301, 1301,
 /*   360 */  1301, 1301, 1301, 1301, 1301, 1301, 1301, 1301, 1301, 1301,
 /*   370 */  1301, 1301, 1301, 1301, 1301, 1301, 1301, 1301, 1301, 1301,
 /*   380 */  1301, 1301, 1301, 1301, 1301, 1301, 1301, 1301, 1301, 1301,
 /*   390 */  1471, 1470, 1301, 1301, 1301, 1301, 1301, 1301, 1301, 1388,
 /*   400 */  1387, 1301, 1301, 1301, 1301, 1301, 1301, 1301, 1301, 1301,
 /*   410 */  1301, 1301, 1301, 1301, 1301, 1301, 1301, 1301, 1301, 1301,
 /*   420 */  1301, 1301, 1301, 1301, 1301, 1301, 1301, 1301, 1301, 1301,
 /*   430 */  1690, 1700, 1301, 1301, 1301, 1301, 1301, 1301, 1301, 1301,
 /*   440 */  1301, 1588, 1301, 1717, 1301, 1676, 1672, 1301, 1301, 1668,
 /*   450 */  1301, 1301, 1728, 1301, 1301, 1301, 1301, 1301, 1301, 1301,
 /*   460 */  1662, 1301, 1635, 1301, 1301, 1301, 1301, 1301, 1301, 1301,
 /*   470 */  1301, 1598, 1301, 1301, 1301, 1301, 1301, 1301, 1301, 1301,
 /*   480 */  1301, 1301, 1301, 1301, 1587, 1301, 1626, 1301, 1301, 1301,
 /*   490 */  1301, 1301, 1301, 1301, 1301, 1452, 1301, 1301, 1301, 1301,
 /*   500 */  1301, 1301, 1301, 1301, 1301, 1301, 1301, 1301, 1437, 1435,
 /*   510 */  1434, 1433, 1301, 1430, 1301, 1301, 1301, 1301, 1301, 1301,
 /*   520 */  1461, 1460, 1301, 1301, 1301, 1301, 1301, 1301, 1381, 1301,
 /*   530 */  1301, 1301, 1301, 1301, 1301, 1301, 1301, 1301, 1372, 1301,
 /*   540 */  1371, 1301, 1301, 1301, 1301, 1301, 1301, 1301, 1301, 1301,
 /*   550 */  1301, 1301, 1301, 1301, 1301, 1301, 1301, 1301, 1301, 1301,
 /*   560 */  1301, 1301, 1301, 1301, 1301, 1301, 1301, 1301, 1301, 1301,
 /*   570 */  1301, 1301, 1301, 1301, 1301,
780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798
};
/********** End of lemon-generated parsing tables *****************************/

/* The next table maps tokens (terminal symbols) into fallback tokens.  
** If a construct like the following:
** 
**      %fallback ID X Y Z.
**
** appears in the grammar, then ID becomes a fallback token for X, Y,
** 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
** 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
static const YYCODETYPE yyFallback[] = {
X
Xiaoyu Wang 已提交
799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029
    0,  /*          $ => nothing */
    0,  /*         OR => nothing */
    0,  /*        AND => nothing */
    0,  /*      UNION => nothing */
    0,  /*        ALL => nothing */
    0,  /*      MINUS => nothing */
    0,  /*     EXCEPT => nothing */
    0,  /*  INTERSECT => nothing */
    0,  /*  NK_BITAND => nothing */
    0,  /*   NK_BITOR => nothing */
    0,  /*  NK_LSHIFT => nothing */
    0,  /*  NK_RSHIFT => nothing */
    0,  /*    NK_PLUS => nothing */
    0,  /*   NK_MINUS => nothing */
    0,  /*    NK_STAR => nothing */
    0,  /*   NK_SLASH => nothing */
    0,  /*     NK_REM => nothing */
    0,  /*  NK_CONCAT => nothing */
    0,  /*     CREATE => nothing */
    0,  /*    ACCOUNT => nothing */
    0,  /*      NK_ID => nothing */
    0,  /*       PASS => nothing */
    0,  /*  NK_STRING => nothing */
    0,  /*      ALTER => nothing */
    0,  /*        PPS => nothing */
    0,  /*    TSERIES => nothing */
    0,  /*    STORAGE => nothing */
    0,  /*    STREAMS => nothing */
    0,  /*      QTIME => nothing */
    0,  /*        DBS => nothing */
    0,  /*      USERS => nothing */
    0,  /*      CONNS => nothing */
    0,  /*      STATE => nothing */
    0,  /*       USER => nothing */
    0,  /*  PRIVILEGE => nothing */
    0,  /*       DROP => nothing */
    0,  /*      DNODE => nothing */
    0,  /*       PORT => nothing */
    0,  /* NK_INTEGER => nothing */
    0,  /*     DNODES => nothing */
    0,  /* NK_IPTOKEN => nothing */
    0,  /*      LOCAL => nothing */
    0,  /*      QNODE => nothing */
    0,  /*         ON => nothing */
    0,  /*      BNODE => nothing */
    0,  /*      SNODE => nothing */
    0,  /*      MNODE => nothing */
    0,  /*   DATABASE => nothing */
    0,  /*        USE => nothing */
    0,  /*         IF => nothing */
    0,  /*        NOT => nothing */
    0,  /*     EXISTS => nothing */
    0,  /*     BLOCKS => nothing */
    0,  /*      CACHE => nothing */
    0,  /*  CACHELAST => nothing */
    0,  /*       COMP => nothing */
    0,  /*       DAYS => nothing */
    0,  /* NK_VARIABLE => nothing */
    0,  /*      FSYNC => nothing */
    0,  /*    MAXROWS => nothing */
    0,  /*    MINROWS => nothing */
    0,  /*       KEEP => nothing */
    0,  /*  PRECISION => nothing */
    0,  /*     QUORUM => nothing */
    0,  /*    REPLICA => nothing */
    0,  /*        TTL => nothing */
    0,  /*        WAL => nothing */
    0,  /*    VGROUPS => nothing */
    0,  /* SINGLE_STABLE => nothing */
    0,  /* STREAM_MODE => nothing */
    0,  /* RETENTIONS => nothing */
    0,  /*     STRICT => nothing */
    0,  /*   NK_COMMA => nothing */
    0,  /*   NK_COLON => nothing */
    0,  /*      TABLE => nothing */
    0,  /*      NK_LP => nothing */
    0,  /*      NK_RP => nothing */
    0,  /*     STABLE => nothing */
    0,  /*        ADD => nothing */
    0,  /*     COLUMN => nothing */
    0,  /*     MODIFY => nothing */
    0,  /*     RENAME => nothing */
    0,  /*        TAG => nothing */
    0,  /*        SET => nothing */
    0,  /*      NK_EQ => nothing */
    0,  /*      USING => nothing */
    0,  /*       TAGS => nothing */
    0,  /*     NK_DOT => nothing */
    0,  /*    COMMENT => nothing */
    0,  /*       BOOL => nothing */
    0,  /*    TINYINT => nothing */
    0,  /*   SMALLINT => nothing */
    0,  /*        INT => nothing */
    0,  /*    INTEGER => nothing */
    0,  /*     BIGINT => nothing */
    0,  /*      FLOAT => nothing */
    0,  /*     DOUBLE => nothing */
    0,  /*     BINARY => nothing */
    0,  /*  TIMESTAMP => nothing */
    0,  /*      NCHAR => nothing */
    0,  /*   UNSIGNED => nothing */
    0,  /*       JSON => nothing */
    0,  /*    VARCHAR => nothing */
    0,  /* MEDIUMBLOB => nothing */
    0,  /*       BLOB => nothing */
    0,  /*  VARBINARY => nothing */
    0,  /*    DECIMAL => nothing */
    0,  /*        SMA => nothing */
    0,  /*     ROLLUP => nothing */
    0,  /* FILE_FACTOR => nothing */
    0,  /*   NK_FLOAT => nothing */
    0,  /*      DELAY => nothing */
    0,  /*       SHOW => nothing */
    0,  /*  DATABASES => nothing */
    0,  /*     TABLES => nothing */
    0,  /*    STABLES => nothing */
    0,  /*     MNODES => nothing */
    0,  /*    MODULES => nothing */
    0,  /*     QNODES => nothing */
    0,  /*  FUNCTIONS => nothing */
    0,  /*    INDEXES => nothing */
    0,  /*       FROM => nothing */
    0,  /*   ACCOUNTS => nothing */
    0,  /*       APPS => nothing */
    0,  /* CONNECTIONS => nothing */
    0,  /*    LICENCE => nothing */
    0,  /*     GRANTS => nothing */
    0,  /*    QUERIES => nothing */
    0,  /*     SCORES => nothing */
    0,  /*     TOPICS => nothing */
    0,  /*  VARIABLES => nothing */
    0,  /*     BNODES => nothing */
    0,  /*     SNODES => nothing */
    0,  /*    CLUSTER => nothing */
    0,  /*       LIKE => nothing */
    0,  /*      INDEX => nothing */
    0,  /*   FULLTEXT => nothing */
    0,  /*   FUNCTION => nothing */
    0,  /*   INTERVAL => nothing */
    0,  /*      TOPIC => nothing */
    0,  /*         AS => nothing */
    0,  /*       WITH => nothing */
    0,  /*     SCHEMA => nothing */
    0,  /*       DESC => nothing */
    0,  /*   DESCRIBE => nothing */
    0,  /*      RESET => nothing */
    0,  /*      QUERY => nothing */
    0,  /*    EXPLAIN => nothing */
    0,  /*    ANALYZE => nothing */
    0,  /*    VERBOSE => nothing */
    0,  /*    NK_BOOL => nothing */
    0,  /*      RATIO => nothing */
    0,  /*    COMPACT => nothing */
    0,  /*     VNODES => nothing */
    0,  /*         IN => nothing */
    0,  /* OUTPUTTYPE => nothing */
    0,  /*  AGGREGATE => nothing */
    0,  /*    BUFSIZE => nothing */
    0,  /*     STREAM => nothing */
    0,  /*       INTO => nothing */
    0,  /*    TRIGGER => nothing */
    0,  /*    AT_ONCE => nothing */
    0,  /* WINDOW_CLOSE => nothing */
    0,  /*  WATERMARK => nothing */
    0,  /*       KILL => nothing */
    0,  /* CONNECTION => nothing */
    0,  /*      MERGE => nothing */
    0,  /*     VGROUP => nothing */
    0,  /* REDISTRIBUTE => nothing */
    0,  /*      SPLIT => nothing */
    0,  /*     SYNCDB => nothing */
    0,  /*       NULL => nothing */
    0,  /* NK_QUESTION => nothing */
    0,  /*   NK_ARROW => nothing */
    0,  /*      ROWTS => nothing */
    0,  /*     TBNAME => nothing */
    0,  /*   QSTARTTS => nothing */
    0,  /*     QENDTS => nothing */
    0,  /*   WSTARTTS => nothing */
    0,  /*     WENDTS => nothing */
    0,  /*  WDURATION => nothing */
    0,  /*       CAST => nothing */
    0,  /*        NOW => nothing */
    0,  /*      TODAY => nothing */
    0,  /*   TIMEZONE => nothing */
    0,  /*      COUNT => nothing */
    0,  /*      FIRST => nothing */
    0,  /*       LAST => nothing */
    0,  /*   LAST_ROW => nothing */
    0,  /*    BETWEEN => nothing */
    0,  /*         IS => nothing */
    0,  /*      NK_LT => nothing */
    0,  /*      NK_GT => nothing */
    0,  /*      NK_LE => nothing */
    0,  /*      NK_GE => nothing */
    0,  /*      NK_NE => nothing */
    0,  /*      MATCH => nothing */
    0,  /*     NMATCH => nothing */
    0,  /*   CONTAINS => nothing */
    0,  /*       JOIN => nothing */
    0,  /*      INNER => nothing */
    0,  /*     SELECT => nothing */
    0,  /*   DISTINCT => nothing */
    0,  /*      WHERE => nothing */
    0,  /*  PARTITION => nothing */
    0,  /*         BY => nothing */
    0,  /*    SESSION => nothing */
    0,  /* STATE_WINDOW => nothing */
    0,  /*    SLIDING => nothing */
    0,  /*       FILL => nothing */
    0,  /*      VALUE => nothing */
    0,  /*       NONE => nothing */
    0,  /*       PREV => nothing */
    0,  /*     LINEAR => nothing */
    0,  /*       NEXT => nothing */
    0,  /*      GROUP => nothing */
    0,  /*     HAVING => nothing */
    0,  /*      ORDER => nothing */
    0,  /*     SLIMIT => nothing */
    0,  /*    SOFFSET => nothing */
    0,  /*      LIMIT => nothing */
    0,  /*     OFFSET => nothing */
    0,  /*        ASC => nothing */
    0,  /*      NULLS => nothing */
    0,  /*         ID => nothing */
  224,  /*  NK_BITNOT => ID */
  224,  /*     INSERT => ID */
  224,  /*     VALUES => ID */
  224,  /*     IMPORT => ID */
  224,  /*    NK_SEMI => ID */
  224,  /*       FILE => ID */
1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067
};
#endif /* YYFALLBACK */

/* The following structure represents a single element of the
** parser's stack.  Information stored includes:
**
**   +  The state number for the parser at this level of the stack.
**
**   +  The value of the token stored at this level of the stack.
**      (In other words, the "major" token.)
**
**   +  The semantic value stored at this level of the stack.  This is
**      the information used by the action routines in the grammar.
**      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 {
  YYACTIONTYPE stateno;  /* The state-number, or reduce action in SHIFTREDUCE */
  YYCODETYPE major;      /* The major token value.  This is the code
                         ** number for the token at this stack level */
  YYMINORTYPE minor;     /* The user-supplied minor token value.  This
                         ** is the value of the token  */
};
typedef struct yyStackEntry yyStackEntry;

/* The state of the parser is completely contained in an instance of
** the following structure */
struct yyParser {
  yyStackEntry *yytos;          /* Pointer to top element of the stack */
#ifdef YYTRACKMAXSTACKDEPTH
  int yyhwm;                    /* High-water mark of the stack */
#endif
#ifndef YYNOERRORRECOVERY
  int yyerrcnt;                 /* Shifts left before out of the error */
#endif
X
Xiaoyu Wang 已提交
1068 1069
  ParseARG_SDECL                /* A place to hold %extra_argument */
  ParseCTX_SDECL                /* A place to hold %extra_context */
1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104
#if YYSTACKDEPTH<=0
  int yystksz;                  /* Current side of the stack */
  yyStackEntry *yystack;        /* The parser's stack */
  yyStackEntry yystk0;          /* First stack entry */
#else
  yyStackEntry yystack[YYSTACKDEPTH];  /* The parser's stack */
  yyStackEntry *yystackEnd;            /* Last entry in the stack */
#endif
};
typedef struct yyParser yyParser;

#ifndef NDEBUG
#include <stdio.h>
static FILE *yyTraceFILE = 0;
static char *yyTracePrompt = 0;
#endif /* NDEBUG */

#ifndef NDEBUG
/* 
** Turn parser tracing on by giving a stream to which to write the trace
** and a prompt to preface each trace message.  Tracing is turned off
** by making either argument NULL 
**
** Inputs:
** <ul>
** <li> A FILE* to which trace output should be written.
**      If NULL, then tracing is turned off.
** <li> A prefix string written at the beginning of every
**      line of trace output.  If NULL, then tracing is
**      turned off.
** </ul>
**
** Outputs:
** None.
*/
X
Xiaoyu Wang 已提交
1105
void ParseTrace(FILE *TraceFILE, char *zTracePrompt){
1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117
  yyTraceFILE = TraceFILE;
  yyTracePrompt = zTracePrompt;
  if( yyTraceFILE==0 ) yyTracePrompt = 0;
  else if( yyTracePrompt==0 ) yyTraceFILE = 0;
}
#endif /* NDEBUG */

#if defined(YYCOVERAGE) || !defined(NDEBUG)
/* For tracing shifts, the names of all terminals and nonterminals
** are required.  The following table supplies these names */
static const char *const yyTokenName[] = { 
  /*    0 */ "$",
1118 1119
  /*    1 */ "OR",
  /*    2 */ "AND",
1120 1121 1122 1123 1124
  /*    3 */ "UNION",
  /*    4 */ "ALL",
  /*    5 */ "MINUS",
  /*    6 */ "EXCEPT",
  /*    7 */ "INTERSECT",
1125 1126 1127 1128 1129 1130 1131 1132 1133 1134
  /*    8 */ "NK_BITAND",
  /*    9 */ "NK_BITOR",
  /*   10 */ "NK_LSHIFT",
  /*   11 */ "NK_RSHIFT",
  /*   12 */ "NK_PLUS",
  /*   13 */ "NK_MINUS",
  /*   14 */ "NK_STAR",
  /*   15 */ "NK_SLASH",
  /*   16 */ "NK_REM",
  /*   17 */ "NK_CONCAT",
1135
  /*   18 */ "CREATE",
1136 1137 1138
  /*   19 */ "ACCOUNT",
  /*   20 */ "NK_ID",
  /*   21 */ "PASS",
1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150
  /*   22 */ "NK_STRING",
  /*   23 */ "ALTER",
  /*   24 */ "PPS",
  /*   25 */ "TSERIES",
  /*   26 */ "STORAGE",
  /*   27 */ "STREAMS",
  /*   28 */ "QTIME",
  /*   29 */ "DBS",
  /*   30 */ "USERS",
  /*   31 */ "CONNS",
  /*   32 */ "STATE",
  /*   33 */ "USER",
1151 1152
  /*   34 */ "PRIVILEGE",
  /*   35 */ "DROP",
X
Xiaoyu Wang 已提交
1153 1154 1155 1156 1157 1158 1159 1160
  /*   36 */ "DNODE",
  /*   37 */ "PORT",
  /*   38 */ "NK_INTEGER",
  /*   39 */ "DNODES",
  /*   40 */ "NK_IPTOKEN",
  /*   41 */ "LOCAL",
  /*   42 */ "QNODE",
  /*   43 */ "ON",
1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187
  /*   44 */ "BNODE",
  /*   45 */ "SNODE",
  /*   46 */ "MNODE",
  /*   47 */ "DATABASE",
  /*   48 */ "USE",
  /*   49 */ "IF",
  /*   50 */ "NOT",
  /*   51 */ "EXISTS",
  /*   52 */ "BLOCKS",
  /*   53 */ "CACHE",
  /*   54 */ "CACHELAST",
  /*   55 */ "COMP",
  /*   56 */ "DAYS",
  /*   57 */ "NK_VARIABLE",
  /*   58 */ "FSYNC",
  /*   59 */ "MAXROWS",
  /*   60 */ "MINROWS",
  /*   61 */ "KEEP",
  /*   62 */ "PRECISION",
  /*   63 */ "QUORUM",
  /*   64 */ "REPLICA",
  /*   65 */ "TTL",
  /*   66 */ "WAL",
  /*   67 */ "VGROUPS",
  /*   68 */ "SINGLE_STABLE",
  /*   69 */ "STREAM_MODE",
  /*   70 */ "RETENTIONS",
1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249
  /*   71 */ "STRICT",
  /*   72 */ "NK_COMMA",
  /*   73 */ "NK_COLON",
  /*   74 */ "TABLE",
  /*   75 */ "NK_LP",
  /*   76 */ "NK_RP",
  /*   77 */ "STABLE",
  /*   78 */ "ADD",
  /*   79 */ "COLUMN",
  /*   80 */ "MODIFY",
  /*   81 */ "RENAME",
  /*   82 */ "TAG",
  /*   83 */ "SET",
  /*   84 */ "NK_EQ",
  /*   85 */ "USING",
  /*   86 */ "TAGS",
  /*   87 */ "NK_DOT",
  /*   88 */ "COMMENT",
  /*   89 */ "BOOL",
  /*   90 */ "TINYINT",
  /*   91 */ "SMALLINT",
  /*   92 */ "INT",
  /*   93 */ "INTEGER",
  /*   94 */ "BIGINT",
  /*   95 */ "FLOAT",
  /*   96 */ "DOUBLE",
  /*   97 */ "BINARY",
  /*   98 */ "TIMESTAMP",
  /*   99 */ "NCHAR",
  /*  100 */ "UNSIGNED",
  /*  101 */ "JSON",
  /*  102 */ "VARCHAR",
  /*  103 */ "MEDIUMBLOB",
  /*  104 */ "BLOB",
  /*  105 */ "VARBINARY",
  /*  106 */ "DECIMAL",
  /*  107 */ "SMA",
  /*  108 */ "ROLLUP",
  /*  109 */ "FILE_FACTOR",
  /*  110 */ "NK_FLOAT",
  /*  111 */ "DELAY",
  /*  112 */ "SHOW",
  /*  113 */ "DATABASES",
  /*  114 */ "TABLES",
  /*  115 */ "STABLES",
  /*  116 */ "MNODES",
  /*  117 */ "MODULES",
  /*  118 */ "QNODES",
  /*  119 */ "FUNCTIONS",
  /*  120 */ "INDEXES",
  /*  121 */ "FROM",
  /*  122 */ "ACCOUNTS",
  /*  123 */ "APPS",
  /*  124 */ "CONNECTIONS",
  /*  125 */ "LICENCE",
  /*  126 */ "GRANTS",
  /*  127 */ "QUERIES",
  /*  128 */ "SCORES",
  /*  129 */ "TOPICS",
  /*  130 */ "VARIABLES",
  /*  131 */ "BNODES",
  /*  132 */ "SNODES",
1250 1251 1252 1253 1254 1255 1256 1257
  /*  133 */ "CLUSTER",
  /*  134 */ "LIKE",
  /*  135 */ "INDEX",
  /*  136 */ "FULLTEXT",
  /*  137 */ "FUNCTION",
  /*  138 */ "INTERVAL",
  /*  139 */ "TOPIC",
  /*  140 */ "AS",
X
Xiaoyu Wang 已提交
1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412
  /*  141 */ "WITH",
  /*  142 */ "SCHEMA",
  /*  143 */ "DESC",
  /*  144 */ "DESCRIBE",
  /*  145 */ "RESET",
  /*  146 */ "QUERY",
  /*  147 */ "EXPLAIN",
  /*  148 */ "ANALYZE",
  /*  149 */ "VERBOSE",
  /*  150 */ "NK_BOOL",
  /*  151 */ "RATIO",
  /*  152 */ "COMPACT",
  /*  153 */ "VNODES",
  /*  154 */ "IN",
  /*  155 */ "OUTPUTTYPE",
  /*  156 */ "AGGREGATE",
  /*  157 */ "BUFSIZE",
  /*  158 */ "STREAM",
  /*  159 */ "INTO",
  /*  160 */ "TRIGGER",
  /*  161 */ "AT_ONCE",
  /*  162 */ "WINDOW_CLOSE",
  /*  163 */ "WATERMARK",
  /*  164 */ "KILL",
  /*  165 */ "CONNECTION",
  /*  166 */ "MERGE",
  /*  167 */ "VGROUP",
  /*  168 */ "REDISTRIBUTE",
  /*  169 */ "SPLIT",
  /*  170 */ "SYNCDB",
  /*  171 */ "NULL",
  /*  172 */ "NK_QUESTION",
  /*  173 */ "NK_ARROW",
  /*  174 */ "ROWTS",
  /*  175 */ "TBNAME",
  /*  176 */ "QSTARTTS",
  /*  177 */ "QENDTS",
  /*  178 */ "WSTARTTS",
  /*  179 */ "WENDTS",
  /*  180 */ "WDURATION",
  /*  181 */ "CAST",
  /*  182 */ "NOW",
  /*  183 */ "TODAY",
  /*  184 */ "TIMEZONE",
  /*  185 */ "COUNT",
  /*  186 */ "FIRST",
  /*  187 */ "LAST",
  /*  188 */ "LAST_ROW",
  /*  189 */ "BETWEEN",
  /*  190 */ "IS",
  /*  191 */ "NK_LT",
  /*  192 */ "NK_GT",
  /*  193 */ "NK_LE",
  /*  194 */ "NK_GE",
  /*  195 */ "NK_NE",
  /*  196 */ "MATCH",
  /*  197 */ "NMATCH",
  /*  198 */ "CONTAINS",
  /*  199 */ "JOIN",
  /*  200 */ "INNER",
  /*  201 */ "SELECT",
  /*  202 */ "DISTINCT",
  /*  203 */ "WHERE",
  /*  204 */ "PARTITION",
  /*  205 */ "BY",
  /*  206 */ "SESSION",
  /*  207 */ "STATE_WINDOW",
  /*  208 */ "SLIDING",
  /*  209 */ "FILL",
  /*  210 */ "VALUE",
  /*  211 */ "NONE",
  /*  212 */ "PREV",
  /*  213 */ "LINEAR",
  /*  214 */ "NEXT",
  /*  215 */ "GROUP",
  /*  216 */ "HAVING",
  /*  217 */ "ORDER",
  /*  218 */ "SLIMIT",
  /*  219 */ "SOFFSET",
  /*  220 */ "LIMIT",
  /*  221 */ "OFFSET",
  /*  222 */ "ASC",
  /*  223 */ "NULLS",
  /*  224 */ "ID",
  /*  225 */ "NK_BITNOT",
  /*  226 */ "INSERT",
  /*  227 */ "VALUES",
  /*  228 */ "IMPORT",
  /*  229 */ "NK_SEMI",
  /*  230 */ "FILE",
  /*  231 */ "cmd",
  /*  232 */ "account_options",
  /*  233 */ "alter_account_options",
  /*  234 */ "literal",
  /*  235 */ "alter_account_option",
  /*  236 */ "user_name",
  /*  237 */ "dnode_endpoint",
  /*  238 */ "dnode_host_name",
  /*  239 */ "not_exists_opt",
  /*  240 */ "db_name",
  /*  241 */ "db_options",
  /*  242 */ "exists_opt",
  /*  243 */ "alter_db_options",
  /*  244 */ "integer_list",
  /*  245 */ "variable_list",
  /*  246 */ "retention_list",
  /*  247 */ "alter_db_option",
  /*  248 */ "retention",
  /*  249 */ "full_table_name",
  /*  250 */ "column_def_list",
  /*  251 */ "tags_def_opt",
  /*  252 */ "table_options",
  /*  253 */ "multi_create_clause",
  /*  254 */ "tags_def",
  /*  255 */ "multi_drop_clause",
  /*  256 */ "alter_table_clause",
  /*  257 */ "alter_table_options",
  /*  258 */ "column_name",
  /*  259 */ "type_name",
  /*  260 */ "create_subtable_clause",
  /*  261 */ "specific_tags_opt",
  /*  262 */ "literal_list",
  /*  263 */ "drop_table_clause",
  /*  264 */ "col_name_list",
  /*  265 */ "table_name",
  /*  266 */ "column_def",
  /*  267 */ "func_name_list",
  /*  268 */ "alter_table_option",
  /*  269 */ "col_name",
  /*  270 */ "db_name_cond_opt",
  /*  271 */ "like_pattern_opt",
  /*  272 */ "table_name_cond",
  /*  273 */ "from_db_opt",
  /*  274 */ "func_name",
  /*  275 */ "function_name",
  /*  276 */ "index_name",
  /*  277 */ "index_options",
  /*  278 */ "func_list",
  /*  279 */ "duration_literal",
  /*  280 */ "sliding_opt",
  /*  281 */ "func",
  /*  282 */ "expression_list",
  /*  283 */ "topic_name",
  /*  284 */ "topic_options",
  /*  285 */ "query_expression",
  /*  286 */ "analyze_opt",
  /*  287 */ "explain_options",
  /*  288 */ "agg_func_opt",
  /*  289 */ "bufsize_opt",
  /*  290 */ "stream_name",
  /*  291 */ "stream_options",
  /*  292 */ "into_opt",
  /*  293 */ "dnode_list",
  /*  294 */ "signed",
  /*  295 */ "signed_literal",
1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463
  /*  296 */ "literal_func",
  /*  297 */ "table_alias",
  /*  298 */ "column_alias",
  /*  299 */ "expression",
  /*  300 */ "pseudo_column",
  /*  301 */ "column_reference",
  /*  302 */ "function_expression",
  /*  303 */ "subquery",
  /*  304 */ "star_func",
  /*  305 */ "star_func_para_list",
  /*  306 */ "noarg_func",
  /*  307 */ "other_para_list",
  /*  308 */ "star_func_para",
  /*  309 */ "predicate",
  /*  310 */ "compare_op",
  /*  311 */ "in_op",
  /*  312 */ "in_predicate_value",
  /*  313 */ "boolean_value_expression",
  /*  314 */ "boolean_primary",
  /*  315 */ "common_expression",
  /*  316 */ "from_clause",
  /*  317 */ "table_reference_list",
  /*  318 */ "table_reference",
  /*  319 */ "table_primary",
  /*  320 */ "joined_table",
  /*  321 */ "alias_opt",
  /*  322 */ "parenthesized_joined_table",
  /*  323 */ "join_type",
  /*  324 */ "search_condition",
  /*  325 */ "query_specification",
  /*  326 */ "set_quantifier_opt",
  /*  327 */ "select_list",
  /*  328 */ "where_clause_opt",
  /*  329 */ "partition_by_clause_opt",
  /*  330 */ "twindow_clause_opt",
  /*  331 */ "group_by_clause_opt",
  /*  332 */ "having_clause_opt",
  /*  333 */ "select_sublist",
  /*  334 */ "select_item",
  /*  335 */ "fill_opt",
  /*  336 */ "fill_mode",
  /*  337 */ "group_by_list",
  /*  338 */ "query_expression_body",
  /*  339 */ "order_by_clause_opt",
  /*  340 */ "slimit_clause_opt",
  /*  341 */ "limit_clause_opt",
  /*  342 */ "query_primary",
  /*  343 */ "sort_specification_list",
  /*  344 */ "sort_specification",
  /*  345 */ "ordering_specification_opt",
  /*  346 */ "null_ordering_opt",
1464 1465 1466 1467 1468 1469 1470
};
#endif /* defined(YYCOVERAGE) || !defined(NDEBUG) */

#ifndef NDEBUG
/* For tracing reduce actions, the names of all rules are required.
*/
static const char *const yyRuleName[] = {
1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498
 /*   0 */ "cmd ::= CREATE ACCOUNT NK_ID PASS NK_STRING account_options",
 /*   1 */ "cmd ::= ALTER ACCOUNT NK_ID alter_account_options",
 /*   2 */ "account_options ::=",
 /*   3 */ "account_options ::= account_options PPS literal",
 /*   4 */ "account_options ::= account_options TSERIES literal",
 /*   5 */ "account_options ::= account_options STORAGE literal",
 /*   6 */ "account_options ::= account_options STREAMS literal",
 /*   7 */ "account_options ::= account_options QTIME literal",
 /*   8 */ "account_options ::= account_options DBS literal",
 /*   9 */ "account_options ::= account_options USERS literal",
 /*  10 */ "account_options ::= account_options CONNS literal",
 /*  11 */ "account_options ::= account_options STATE literal",
 /*  12 */ "alter_account_options ::= alter_account_option",
 /*  13 */ "alter_account_options ::= alter_account_options alter_account_option",
 /*  14 */ "alter_account_option ::= PASS literal",
 /*  15 */ "alter_account_option ::= PPS literal",
 /*  16 */ "alter_account_option ::= TSERIES literal",
 /*  17 */ "alter_account_option ::= STORAGE literal",
 /*  18 */ "alter_account_option ::= STREAMS literal",
 /*  19 */ "alter_account_option ::= QTIME literal",
 /*  20 */ "alter_account_option ::= DBS literal",
 /*  21 */ "alter_account_option ::= USERS literal",
 /*  22 */ "alter_account_option ::= CONNS literal",
 /*  23 */ "alter_account_option ::= STATE literal",
 /*  24 */ "cmd ::= CREATE USER user_name PASS NK_STRING",
 /*  25 */ "cmd ::= ALTER USER user_name PASS NK_STRING",
 /*  26 */ "cmd ::= ALTER USER user_name PRIVILEGE NK_STRING",
 /*  27 */ "cmd ::= DROP USER user_name",
X
Xiaoyu Wang 已提交
1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513
 /*  28 */ "cmd ::= CREATE DNODE dnode_endpoint",
 /*  29 */ "cmd ::= CREATE DNODE dnode_host_name PORT NK_INTEGER",
 /*  30 */ "cmd ::= DROP DNODE NK_INTEGER",
 /*  31 */ "cmd ::= DROP DNODE dnode_endpoint",
 /*  32 */ "cmd ::= ALTER DNODE NK_INTEGER NK_STRING",
 /*  33 */ "cmd ::= ALTER DNODE NK_INTEGER NK_STRING NK_STRING",
 /*  34 */ "cmd ::= ALTER ALL DNODES NK_STRING",
 /*  35 */ "cmd ::= ALTER ALL DNODES NK_STRING NK_STRING",
 /*  36 */ "dnode_endpoint ::= NK_STRING",
 /*  37 */ "dnode_host_name ::= NK_ID",
 /*  38 */ "dnode_host_name ::= NK_IPTOKEN",
 /*  39 */ "cmd ::= ALTER LOCAL NK_STRING",
 /*  40 */ "cmd ::= ALTER LOCAL NK_STRING NK_STRING",
 /*  41 */ "cmd ::= CREATE QNODE ON DNODE NK_INTEGER",
 /*  42 */ "cmd ::= DROP QNODE ON DNODE NK_INTEGER",
1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548
 /*  43 */ "cmd ::= CREATE BNODE ON DNODE NK_INTEGER",
 /*  44 */ "cmd ::= DROP BNODE ON DNODE NK_INTEGER",
 /*  45 */ "cmd ::= CREATE SNODE ON DNODE NK_INTEGER",
 /*  46 */ "cmd ::= DROP SNODE ON DNODE NK_INTEGER",
 /*  47 */ "cmd ::= CREATE MNODE ON DNODE NK_INTEGER",
 /*  48 */ "cmd ::= DROP MNODE ON DNODE NK_INTEGER",
 /*  49 */ "cmd ::= CREATE DATABASE not_exists_opt db_name db_options",
 /*  50 */ "cmd ::= DROP DATABASE exists_opt db_name",
 /*  51 */ "cmd ::= USE db_name",
 /*  52 */ "cmd ::= ALTER DATABASE db_name alter_db_options",
 /*  53 */ "not_exists_opt ::= IF NOT EXISTS",
 /*  54 */ "not_exists_opt ::=",
 /*  55 */ "exists_opt ::= IF EXISTS",
 /*  56 */ "exists_opt ::=",
 /*  57 */ "db_options ::=",
 /*  58 */ "db_options ::= db_options BLOCKS NK_INTEGER",
 /*  59 */ "db_options ::= db_options CACHE NK_INTEGER",
 /*  60 */ "db_options ::= db_options CACHELAST NK_INTEGER",
 /*  61 */ "db_options ::= db_options COMP NK_INTEGER",
 /*  62 */ "db_options ::= db_options DAYS NK_INTEGER",
 /*  63 */ "db_options ::= db_options DAYS NK_VARIABLE",
 /*  64 */ "db_options ::= db_options FSYNC NK_INTEGER",
 /*  65 */ "db_options ::= db_options MAXROWS NK_INTEGER",
 /*  66 */ "db_options ::= db_options MINROWS NK_INTEGER",
 /*  67 */ "db_options ::= db_options KEEP integer_list",
 /*  68 */ "db_options ::= db_options KEEP variable_list",
 /*  69 */ "db_options ::= db_options PRECISION NK_STRING",
 /*  70 */ "db_options ::= db_options QUORUM NK_INTEGER",
 /*  71 */ "db_options ::= db_options REPLICA NK_INTEGER",
 /*  72 */ "db_options ::= db_options TTL NK_INTEGER",
 /*  73 */ "db_options ::= db_options WAL NK_INTEGER",
 /*  74 */ "db_options ::= db_options VGROUPS NK_INTEGER",
 /*  75 */ "db_options ::= db_options SINGLE_STABLE NK_INTEGER",
 /*  76 */ "db_options ::= db_options STREAM_MODE NK_INTEGER",
 /*  77 */ "db_options ::= db_options RETENTIONS retention_list",
1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668
 /*  78 */ "db_options ::= db_options STRICT NK_INTEGER",
 /*  79 */ "alter_db_options ::= alter_db_option",
 /*  80 */ "alter_db_options ::= alter_db_options alter_db_option",
 /*  81 */ "alter_db_option ::= BLOCKS NK_INTEGER",
 /*  82 */ "alter_db_option ::= FSYNC NK_INTEGER",
 /*  83 */ "alter_db_option ::= KEEP integer_list",
 /*  84 */ "alter_db_option ::= KEEP variable_list",
 /*  85 */ "alter_db_option ::= WAL NK_INTEGER",
 /*  86 */ "alter_db_option ::= QUORUM NK_INTEGER",
 /*  87 */ "alter_db_option ::= CACHELAST NK_INTEGER",
 /*  88 */ "alter_db_option ::= REPLICA NK_INTEGER",
 /*  89 */ "alter_db_option ::= STRICT NK_INTEGER",
 /*  90 */ "integer_list ::= NK_INTEGER",
 /*  91 */ "integer_list ::= integer_list NK_COMMA NK_INTEGER",
 /*  92 */ "variable_list ::= NK_VARIABLE",
 /*  93 */ "variable_list ::= variable_list NK_COMMA NK_VARIABLE",
 /*  94 */ "retention_list ::= retention",
 /*  95 */ "retention_list ::= retention_list NK_COMMA retention",
 /*  96 */ "retention ::= NK_VARIABLE NK_COLON NK_VARIABLE",
 /*  97 */ "cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options",
 /*  98 */ "cmd ::= CREATE TABLE multi_create_clause",
 /*  99 */ "cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options",
 /* 100 */ "cmd ::= DROP TABLE multi_drop_clause",
 /* 101 */ "cmd ::= DROP STABLE exists_opt full_table_name",
 /* 102 */ "cmd ::= ALTER TABLE alter_table_clause",
 /* 103 */ "cmd ::= ALTER STABLE alter_table_clause",
 /* 104 */ "alter_table_clause ::= full_table_name alter_table_options",
 /* 105 */ "alter_table_clause ::= full_table_name ADD COLUMN column_name type_name",
 /* 106 */ "alter_table_clause ::= full_table_name DROP COLUMN column_name",
 /* 107 */ "alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name",
 /* 108 */ "alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name",
 /* 109 */ "alter_table_clause ::= full_table_name ADD TAG column_name type_name",
 /* 110 */ "alter_table_clause ::= full_table_name DROP TAG column_name",
 /* 111 */ "alter_table_clause ::= full_table_name MODIFY TAG column_name type_name",
 /* 112 */ "alter_table_clause ::= full_table_name RENAME TAG column_name column_name",
 /* 113 */ "alter_table_clause ::= full_table_name SET TAG column_name NK_EQ literal",
 /* 114 */ "multi_create_clause ::= create_subtable_clause",
 /* 115 */ "multi_create_clause ::= multi_create_clause create_subtable_clause",
 /* 116 */ "create_subtable_clause ::= not_exists_opt full_table_name USING full_table_name specific_tags_opt TAGS NK_LP literal_list NK_RP",
 /* 117 */ "multi_drop_clause ::= drop_table_clause",
 /* 118 */ "multi_drop_clause ::= multi_drop_clause drop_table_clause",
 /* 119 */ "drop_table_clause ::= exists_opt full_table_name",
 /* 120 */ "specific_tags_opt ::=",
 /* 121 */ "specific_tags_opt ::= NK_LP col_name_list NK_RP",
 /* 122 */ "full_table_name ::= table_name",
 /* 123 */ "full_table_name ::= db_name NK_DOT table_name",
 /* 124 */ "column_def_list ::= column_def",
 /* 125 */ "column_def_list ::= column_def_list NK_COMMA column_def",
 /* 126 */ "column_def ::= column_name type_name",
 /* 127 */ "column_def ::= column_name type_name COMMENT NK_STRING",
 /* 128 */ "type_name ::= BOOL",
 /* 129 */ "type_name ::= TINYINT",
 /* 130 */ "type_name ::= SMALLINT",
 /* 131 */ "type_name ::= INT",
 /* 132 */ "type_name ::= INTEGER",
 /* 133 */ "type_name ::= BIGINT",
 /* 134 */ "type_name ::= FLOAT",
 /* 135 */ "type_name ::= DOUBLE",
 /* 136 */ "type_name ::= BINARY NK_LP NK_INTEGER NK_RP",
 /* 137 */ "type_name ::= TIMESTAMP",
 /* 138 */ "type_name ::= NCHAR NK_LP NK_INTEGER NK_RP",
 /* 139 */ "type_name ::= TINYINT UNSIGNED",
 /* 140 */ "type_name ::= SMALLINT UNSIGNED",
 /* 141 */ "type_name ::= INT UNSIGNED",
 /* 142 */ "type_name ::= BIGINT UNSIGNED",
 /* 143 */ "type_name ::= JSON",
 /* 144 */ "type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP",
 /* 145 */ "type_name ::= MEDIUMBLOB",
 /* 146 */ "type_name ::= BLOB",
 /* 147 */ "type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP",
 /* 148 */ "type_name ::= DECIMAL",
 /* 149 */ "type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP",
 /* 150 */ "type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP",
 /* 151 */ "tags_def_opt ::=",
 /* 152 */ "tags_def_opt ::= tags_def",
 /* 153 */ "tags_def ::= TAGS NK_LP column_def_list NK_RP",
 /* 154 */ "table_options ::=",
 /* 155 */ "table_options ::= table_options COMMENT NK_STRING",
 /* 156 */ "table_options ::= table_options KEEP integer_list",
 /* 157 */ "table_options ::= table_options KEEP variable_list",
 /* 158 */ "table_options ::= table_options TTL NK_INTEGER",
 /* 159 */ "table_options ::= table_options SMA NK_LP col_name_list NK_RP",
 /* 160 */ "table_options ::= table_options ROLLUP NK_LP func_name_list NK_RP",
 /* 161 */ "table_options ::= table_options FILE_FACTOR NK_FLOAT",
 /* 162 */ "table_options ::= table_options DELAY NK_INTEGER",
 /* 163 */ "alter_table_options ::= alter_table_option",
 /* 164 */ "alter_table_options ::= alter_table_options alter_table_option",
 /* 165 */ "alter_table_option ::= COMMENT NK_STRING",
 /* 166 */ "alter_table_option ::= KEEP integer_list",
 /* 167 */ "alter_table_option ::= KEEP variable_list",
 /* 168 */ "alter_table_option ::= TTL NK_INTEGER",
 /* 169 */ "col_name_list ::= col_name",
 /* 170 */ "col_name_list ::= col_name_list NK_COMMA col_name",
 /* 171 */ "col_name ::= column_name",
 /* 172 */ "cmd ::= SHOW DNODES",
 /* 173 */ "cmd ::= SHOW USERS",
 /* 174 */ "cmd ::= SHOW DATABASES",
 /* 175 */ "cmd ::= SHOW db_name_cond_opt TABLES like_pattern_opt",
 /* 176 */ "cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt",
 /* 177 */ "cmd ::= SHOW db_name_cond_opt VGROUPS",
 /* 178 */ "cmd ::= SHOW MNODES",
 /* 179 */ "cmd ::= SHOW MODULES",
 /* 180 */ "cmd ::= SHOW QNODES",
 /* 181 */ "cmd ::= SHOW FUNCTIONS",
 /* 182 */ "cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt",
 /* 183 */ "cmd ::= SHOW STREAMS",
 /* 184 */ "cmd ::= SHOW ACCOUNTS",
 /* 185 */ "cmd ::= SHOW APPS",
 /* 186 */ "cmd ::= SHOW CONNECTIONS",
 /* 187 */ "cmd ::= SHOW LICENCE",
 /* 188 */ "cmd ::= SHOW GRANTS",
 /* 189 */ "cmd ::= SHOW CREATE DATABASE db_name",
 /* 190 */ "cmd ::= SHOW CREATE TABLE full_table_name",
 /* 191 */ "cmd ::= SHOW CREATE STABLE full_table_name",
 /* 192 */ "cmd ::= SHOW QUERIES",
 /* 193 */ "cmd ::= SHOW SCORES",
 /* 194 */ "cmd ::= SHOW TOPICS",
 /* 195 */ "cmd ::= SHOW VARIABLES",
 /* 196 */ "cmd ::= SHOW BNODES",
 /* 197 */ "cmd ::= SHOW SNODES",
1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688
 /* 198 */ "cmd ::= SHOW CLUSTER",
 /* 199 */ "db_name_cond_opt ::=",
 /* 200 */ "db_name_cond_opt ::= db_name NK_DOT",
 /* 201 */ "like_pattern_opt ::=",
 /* 202 */ "like_pattern_opt ::= LIKE NK_STRING",
 /* 203 */ "table_name_cond ::= table_name",
 /* 204 */ "from_db_opt ::=",
 /* 205 */ "from_db_opt ::= FROM db_name",
 /* 206 */ "func_name_list ::= func_name",
 /* 207 */ "func_name_list ::= func_name_list NK_COMMA func_name",
 /* 208 */ "func_name ::= function_name",
 /* 209 */ "cmd ::= CREATE SMA INDEX not_exists_opt index_name ON table_name index_options",
 /* 210 */ "cmd ::= CREATE FULLTEXT INDEX not_exists_opt index_name ON table_name NK_LP col_name_list NK_RP",
 /* 211 */ "cmd ::= DROP INDEX exists_opt index_name ON table_name",
 /* 212 */ "index_options ::=",
 /* 213 */ "index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt",
 /* 214 */ "index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt",
 /* 215 */ "func_list ::= func",
 /* 216 */ "func_list ::= func_list NK_COMMA func",
 /* 217 */ "func ::= function_name NK_LP expression_list NK_RP",
X
Xiaoyu Wang 已提交
1689 1690
 /* 218 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name topic_options AS query_expression",
 /* 219 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name topic_options AS db_name",
1691
 /* 220 */ "cmd ::= DROP TOPIC exists_opt topic_name",
X
Xiaoyu Wang 已提交
1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749
 /* 221 */ "topic_options ::=",
 /* 222 */ "topic_options ::= topic_options WITH TABLE",
 /* 223 */ "topic_options ::= topic_options WITH SCHEMA",
 /* 224 */ "topic_options ::= topic_options WITH TAG",
 /* 225 */ "cmd ::= DESC full_table_name",
 /* 226 */ "cmd ::= DESCRIBE full_table_name",
 /* 227 */ "cmd ::= RESET QUERY CACHE",
 /* 228 */ "cmd ::= EXPLAIN analyze_opt explain_options query_expression",
 /* 229 */ "analyze_opt ::=",
 /* 230 */ "analyze_opt ::= ANALYZE",
 /* 231 */ "explain_options ::=",
 /* 232 */ "explain_options ::= explain_options VERBOSE NK_BOOL",
 /* 233 */ "explain_options ::= explain_options RATIO NK_FLOAT",
 /* 234 */ "cmd ::= COMPACT VNODES IN NK_LP integer_list NK_RP",
 /* 235 */ "cmd ::= CREATE agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt",
 /* 236 */ "cmd ::= DROP FUNCTION function_name",
 /* 237 */ "agg_func_opt ::=",
 /* 238 */ "agg_func_opt ::= AGGREGATE",
 /* 239 */ "bufsize_opt ::=",
 /* 240 */ "bufsize_opt ::= BUFSIZE NK_INTEGER",
 /* 241 */ "cmd ::= CREATE STREAM not_exists_opt stream_name stream_options into_opt AS query_expression",
 /* 242 */ "cmd ::= DROP STREAM exists_opt stream_name",
 /* 243 */ "into_opt ::=",
 /* 244 */ "into_opt ::= INTO full_table_name",
 /* 245 */ "stream_options ::=",
 /* 246 */ "stream_options ::= stream_options TRIGGER AT_ONCE",
 /* 247 */ "stream_options ::= stream_options TRIGGER WINDOW_CLOSE",
 /* 248 */ "stream_options ::= stream_options WATERMARK duration_literal",
 /* 249 */ "cmd ::= KILL CONNECTION NK_INTEGER",
 /* 250 */ "cmd ::= KILL QUERY NK_INTEGER",
 /* 251 */ "cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER",
 /* 252 */ "cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list",
 /* 253 */ "cmd ::= SPLIT VGROUP NK_INTEGER",
 /* 254 */ "dnode_list ::= DNODE NK_INTEGER",
 /* 255 */ "dnode_list ::= dnode_list DNODE NK_INTEGER",
 /* 256 */ "cmd ::= SYNCDB db_name REPLICA",
 /* 257 */ "cmd ::= query_expression",
 /* 258 */ "literal ::= NK_INTEGER",
 /* 259 */ "literal ::= NK_FLOAT",
 /* 260 */ "literal ::= NK_STRING",
 /* 261 */ "literal ::= NK_BOOL",
 /* 262 */ "literal ::= TIMESTAMP NK_STRING",
 /* 263 */ "literal ::= duration_literal",
 /* 264 */ "literal ::= NULL",
 /* 265 */ "literal ::= NK_QUESTION",
 /* 266 */ "duration_literal ::= NK_VARIABLE",
 /* 267 */ "signed ::= NK_INTEGER",
 /* 268 */ "signed ::= NK_PLUS NK_INTEGER",
 /* 269 */ "signed ::= NK_MINUS NK_INTEGER",
 /* 270 */ "signed ::= NK_FLOAT",
 /* 271 */ "signed ::= NK_PLUS NK_FLOAT",
 /* 272 */ "signed ::= NK_MINUS NK_FLOAT",
 /* 273 */ "signed_literal ::= signed",
 /* 274 */ "signed_literal ::= NK_STRING",
 /* 275 */ "signed_literal ::= NK_BOOL",
 /* 276 */ "signed_literal ::= TIMESTAMP NK_STRING",
 /* 277 */ "signed_literal ::= duration_literal",
 /* 278 */ "signed_literal ::= NULL",
1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914
 /* 279 */ "signed_literal ::= literal_func",
 /* 280 */ "literal_list ::= signed_literal",
 /* 281 */ "literal_list ::= literal_list NK_COMMA signed_literal",
 /* 282 */ "db_name ::= NK_ID",
 /* 283 */ "table_name ::= NK_ID",
 /* 284 */ "column_name ::= NK_ID",
 /* 285 */ "function_name ::= NK_ID",
 /* 286 */ "table_alias ::= NK_ID",
 /* 287 */ "column_alias ::= NK_ID",
 /* 288 */ "user_name ::= NK_ID",
 /* 289 */ "index_name ::= NK_ID",
 /* 290 */ "topic_name ::= NK_ID",
 /* 291 */ "stream_name ::= NK_ID",
 /* 292 */ "expression ::= literal",
 /* 293 */ "expression ::= pseudo_column",
 /* 294 */ "expression ::= column_reference",
 /* 295 */ "expression ::= function_expression",
 /* 296 */ "expression ::= subquery",
 /* 297 */ "expression ::= NK_LP expression NK_RP",
 /* 298 */ "expression ::= NK_PLUS expression",
 /* 299 */ "expression ::= NK_MINUS expression",
 /* 300 */ "expression ::= expression NK_PLUS expression",
 /* 301 */ "expression ::= expression NK_MINUS expression",
 /* 302 */ "expression ::= expression NK_STAR expression",
 /* 303 */ "expression ::= expression NK_SLASH expression",
 /* 304 */ "expression ::= expression NK_REM expression",
 /* 305 */ "expression ::= column_reference NK_ARROW NK_STRING",
 /* 306 */ "expression_list ::= expression",
 /* 307 */ "expression_list ::= expression_list NK_COMMA expression",
 /* 308 */ "column_reference ::= column_name",
 /* 309 */ "column_reference ::= table_name NK_DOT column_name",
 /* 310 */ "pseudo_column ::= ROWTS",
 /* 311 */ "pseudo_column ::= TBNAME",
 /* 312 */ "pseudo_column ::= QSTARTTS",
 /* 313 */ "pseudo_column ::= QENDTS",
 /* 314 */ "pseudo_column ::= WSTARTTS",
 /* 315 */ "pseudo_column ::= WENDTS",
 /* 316 */ "pseudo_column ::= WDURATION",
 /* 317 */ "function_expression ::= function_name NK_LP expression_list NK_RP",
 /* 318 */ "function_expression ::= star_func NK_LP star_func_para_list NK_RP",
 /* 319 */ "function_expression ::= CAST NK_LP expression AS type_name NK_RP",
 /* 320 */ "function_expression ::= literal_func",
 /* 321 */ "literal_func ::= noarg_func NK_LP NK_RP",
 /* 322 */ "literal_func ::= NOW",
 /* 323 */ "noarg_func ::= NOW",
 /* 324 */ "noarg_func ::= TODAY",
 /* 325 */ "noarg_func ::= TIMEZONE",
 /* 326 */ "star_func ::= COUNT",
 /* 327 */ "star_func ::= FIRST",
 /* 328 */ "star_func ::= LAST",
 /* 329 */ "star_func ::= LAST_ROW",
 /* 330 */ "star_func_para_list ::= NK_STAR",
 /* 331 */ "star_func_para_list ::= other_para_list",
 /* 332 */ "other_para_list ::= star_func_para",
 /* 333 */ "other_para_list ::= other_para_list NK_COMMA star_func_para",
 /* 334 */ "star_func_para ::= expression",
 /* 335 */ "star_func_para ::= table_name NK_DOT NK_STAR",
 /* 336 */ "predicate ::= expression compare_op expression",
 /* 337 */ "predicate ::= expression BETWEEN expression AND expression",
 /* 338 */ "predicate ::= expression NOT BETWEEN expression AND expression",
 /* 339 */ "predicate ::= expression IS NULL",
 /* 340 */ "predicate ::= expression IS NOT NULL",
 /* 341 */ "predicate ::= expression in_op in_predicate_value",
 /* 342 */ "compare_op ::= NK_LT",
 /* 343 */ "compare_op ::= NK_GT",
 /* 344 */ "compare_op ::= NK_LE",
 /* 345 */ "compare_op ::= NK_GE",
 /* 346 */ "compare_op ::= NK_NE",
 /* 347 */ "compare_op ::= NK_EQ",
 /* 348 */ "compare_op ::= LIKE",
 /* 349 */ "compare_op ::= NOT LIKE",
 /* 350 */ "compare_op ::= MATCH",
 /* 351 */ "compare_op ::= NMATCH",
 /* 352 */ "compare_op ::= CONTAINS",
 /* 353 */ "in_op ::= IN",
 /* 354 */ "in_op ::= NOT IN",
 /* 355 */ "in_predicate_value ::= NK_LP expression_list NK_RP",
 /* 356 */ "boolean_value_expression ::= boolean_primary",
 /* 357 */ "boolean_value_expression ::= NOT boolean_primary",
 /* 358 */ "boolean_value_expression ::= boolean_value_expression OR boolean_value_expression",
 /* 359 */ "boolean_value_expression ::= boolean_value_expression AND boolean_value_expression",
 /* 360 */ "boolean_primary ::= predicate",
 /* 361 */ "boolean_primary ::= NK_LP boolean_value_expression NK_RP",
 /* 362 */ "common_expression ::= expression",
 /* 363 */ "common_expression ::= boolean_value_expression",
 /* 364 */ "from_clause ::= FROM table_reference_list",
 /* 365 */ "table_reference_list ::= table_reference",
 /* 366 */ "table_reference_list ::= table_reference_list NK_COMMA table_reference",
 /* 367 */ "table_reference ::= table_primary",
 /* 368 */ "table_reference ::= joined_table",
 /* 369 */ "table_primary ::= table_name alias_opt",
 /* 370 */ "table_primary ::= db_name NK_DOT table_name alias_opt",
 /* 371 */ "table_primary ::= subquery alias_opt",
 /* 372 */ "table_primary ::= parenthesized_joined_table",
 /* 373 */ "alias_opt ::=",
 /* 374 */ "alias_opt ::= table_alias",
 /* 375 */ "alias_opt ::= AS table_alias",
 /* 376 */ "parenthesized_joined_table ::= NK_LP joined_table NK_RP",
 /* 377 */ "parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP",
 /* 378 */ "joined_table ::= table_reference join_type JOIN table_reference ON search_condition",
 /* 379 */ "join_type ::=",
 /* 380 */ "join_type ::= INNER",
 /* 381 */ "query_specification ::= SELECT set_quantifier_opt select_list from_clause where_clause_opt partition_by_clause_opt twindow_clause_opt group_by_clause_opt having_clause_opt",
 /* 382 */ "set_quantifier_opt ::=",
 /* 383 */ "set_quantifier_opt ::= DISTINCT",
 /* 384 */ "set_quantifier_opt ::= ALL",
 /* 385 */ "select_list ::= NK_STAR",
 /* 386 */ "select_list ::= select_sublist",
 /* 387 */ "select_sublist ::= select_item",
 /* 388 */ "select_sublist ::= select_sublist NK_COMMA select_item",
 /* 389 */ "select_item ::= common_expression",
 /* 390 */ "select_item ::= common_expression column_alias",
 /* 391 */ "select_item ::= common_expression AS column_alias",
 /* 392 */ "select_item ::= table_name NK_DOT NK_STAR",
 /* 393 */ "where_clause_opt ::=",
 /* 394 */ "where_clause_opt ::= WHERE search_condition",
 /* 395 */ "partition_by_clause_opt ::=",
 /* 396 */ "partition_by_clause_opt ::= PARTITION BY expression_list",
 /* 397 */ "twindow_clause_opt ::=",
 /* 398 */ "twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP",
 /* 399 */ "twindow_clause_opt ::= STATE_WINDOW NK_LP expression NK_RP",
 /* 400 */ "twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt",
 /* 401 */ "twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt",
 /* 402 */ "sliding_opt ::=",
 /* 403 */ "sliding_opt ::= SLIDING NK_LP duration_literal NK_RP",
 /* 404 */ "fill_opt ::=",
 /* 405 */ "fill_opt ::= FILL NK_LP fill_mode NK_RP",
 /* 406 */ "fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP",
 /* 407 */ "fill_mode ::= NONE",
 /* 408 */ "fill_mode ::= PREV",
 /* 409 */ "fill_mode ::= NULL",
 /* 410 */ "fill_mode ::= LINEAR",
 /* 411 */ "fill_mode ::= NEXT",
 /* 412 */ "group_by_clause_opt ::=",
 /* 413 */ "group_by_clause_opt ::= GROUP BY group_by_list",
 /* 414 */ "group_by_list ::= expression",
 /* 415 */ "group_by_list ::= group_by_list NK_COMMA expression",
 /* 416 */ "having_clause_opt ::=",
 /* 417 */ "having_clause_opt ::= HAVING search_condition",
 /* 418 */ "query_expression ::= query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt",
 /* 419 */ "query_expression_body ::= query_primary",
 /* 420 */ "query_expression_body ::= query_expression_body UNION ALL query_expression_body",
 /* 421 */ "query_expression_body ::= query_expression_body UNION query_expression_body",
 /* 422 */ "query_primary ::= query_specification",
 /* 423 */ "order_by_clause_opt ::=",
 /* 424 */ "order_by_clause_opt ::= ORDER BY sort_specification_list",
 /* 425 */ "slimit_clause_opt ::=",
 /* 426 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER",
 /* 427 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER",
 /* 428 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER",
 /* 429 */ "limit_clause_opt ::=",
 /* 430 */ "limit_clause_opt ::= LIMIT NK_INTEGER",
 /* 431 */ "limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER",
 /* 432 */ "limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER",
 /* 433 */ "subquery ::= NK_LP query_expression NK_RP",
 /* 434 */ "search_condition ::= common_expression",
 /* 435 */ "sort_specification_list ::= sort_specification",
 /* 436 */ "sort_specification_list ::= sort_specification_list NK_COMMA sort_specification",
 /* 437 */ "sort_specification ::= expression ordering_specification_opt null_ordering_opt",
 /* 438 */ "ordering_specification_opt ::=",
 /* 439 */ "ordering_specification_opt ::= ASC",
 /* 440 */ "ordering_specification_opt ::= DESC",
 /* 441 */ "null_ordering_opt ::=",
 /* 442 */ "null_ordering_opt ::= NULLS FIRST",
 /* 443 */ "null_ordering_opt ::= NULLS LAST",
1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931
};
#endif /* NDEBUG */


#if YYSTACKDEPTH<=0
/*
** Try to increase the size of the parser stack.  Return the number
** of errors.  Return 0 on success.
*/
static int yyGrowStack(yyParser *p){
  int newSize;
  int idx;
  yyStackEntry *pNew;

  newSize = p->yystksz*2 + 100;
  idx = p->yytos ? (int)(p->yytos - p->yystack) : 0;
  if( p->yystack==&p->yystk0 ){
X
Xiaoyu Wang 已提交
1932
    pNew = malloc(newSize*sizeof(pNew[0]));
1933 1934
    if( pNew ) pNew[0] = p->yystk0;
  }else{
X
Xiaoyu Wang 已提交
1935
    pNew = realloc(p->yystack, newSize*sizeof(pNew[0]));
1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952
  }
  if( pNew ){
    p->yystack = pNew;
    p->yytos = &p->yystack[idx];
#ifndef NDEBUG
    if( yyTraceFILE ){
      fprintf(yyTraceFILE,"%sStack grows from %d to %d entries.\n",
              yyTracePrompt, p->yystksz, newSize);
    }
#endif
    p->yystksz = newSize;
  }
  return pNew==0; 
}
#endif

/* Datatype of the argument to the memory allocated passed as the
X
Xiaoyu Wang 已提交
1953
** second argument to ParseAlloc() below.  This can be changed by
1954 1955 1956 1957 1958 1959 1960 1961 1962
** 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.
*/
X
Xiaoyu Wang 已提交
1963
void ParseInit(void *yypRawParser ParseCTX_PDECL){
1964
  yyParser *yypParser = (yyParser*)yypRawParser;
X
Xiaoyu Wang 已提交
1965
  ParseCTX_STORE
1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988
#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
}

X
Xiaoyu Wang 已提交
1989
#ifndef Parse_ENGINEALWAYSONSTACK
1990 1991 1992 1993 1994 1995 1996 1997 1998 1999
/* 
** This function allocates a new parser.
** The only argument is a pointer to a function which works like
** malloc.
**
** Inputs:
** A pointer to the function used to allocate memory.
**
** Outputs:
** A pointer to a parser.  This pointer is used in subsequent calls
X
Xiaoyu Wang 已提交
2000
** to Parse and ParseFree.
2001
*/
X
Xiaoyu Wang 已提交
2002
void *ParseAlloc(void *(*mallocProc)(YYMALLOCARGTYPE) ParseCTX_PDECL){
2003 2004 2005
  yyParser *yypParser;
  yypParser = (yyParser*)(*mallocProc)( (YYMALLOCARGTYPE)sizeof(yyParser) );
  if( yypParser ){
X
Xiaoyu Wang 已提交
2006 2007
    ParseCTX_STORE
    ParseInit(yypParser ParseCTX_PARAM);
2008 2009 2010
  }
  return (void*)yypParser;
}
X
Xiaoyu Wang 已提交
2011
#endif /* Parse_ENGINEALWAYSONSTACK */
2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025


/* The following function deletes the "minor type" or semantic value
** associated with a symbol.  The symbol can be either a terminal
** or nonterminal. "yymajor" is the symbol code, and "yypminor" is
** 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(
  yyParser *yypParser,    /* The parser */
  YYCODETYPE yymajor,     /* Type code for object to destroy */
  YYMINORTYPE *yypminor   /* The object to be destroyed */
){
X
Xiaoyu Wang 已提交
2026 2027
  ParseARG_FETCH
  ParseCTX_FETCH
2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040
  switch( yymajor ){
    /* Here is inserted the actions which take place when a
    ** terminal or non-terminal is destroyed.  This can happen
    ** when the symbol is popped from the stack during a
    ** reduce or during error processing or when a parser is 
    ** being destroyed before it is finished parsing.
    **
    ** Note: during a reduce, the only symbols destroyed are those
    ** which appear on the RHS of the rule, but which are *not* used
    ** inside the C code.
    */
/********* Begin destructor definitions ***************************************/
      /* Default NON-TERMINAL Destructor */
X
Xiaoyu Wang 已提交
2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069
    case 231: /* cmd */
    case 234: /* literal */
    case 241: /* db_options */
    case 243: /* alter_db_options */
    case 248: /* retention */
    case 249: /* full_table_name */
    case 252: /* table_options */
    case 256: /* alter_table_clause */
    case 257: /* alter_table_options */
    case 260: /* create_subtable_clause */
    case 263: /* drop_table_clause */
    case 266: /* column_def */
    case 269: /* col_name */
    case 270: /* db_name_cond_opt */
    case 271: /* like_pattern_opt */
    case 272: /* table_name_cond */
    case 273: /* from_db_opt */
    case 274: /* func_name */
    case 277: /* index_options */
    case 279: /* duration_literal */
    case 280: /* sliding_opt */
    case 281: /* func */
    case 284: /* topic_options */
    case 285: /* query_expression */
    case 287: /* explain_options */
    case 291: /* stream_options */
    case 292: /* into_opt */
    case 294: /* signed */
    case 295: /* signed_literal */
2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099
    case 296: /* literal_func */
    case 299: /* expression */
    case 300: /* pseudo_column */
    case 301: /* column_reference */
    case 302: /* function_expression */
    case 303: /* subquery */
    case 308: /* star_func_para */
    case 309: /* predicate */
    case 312: /* in_predicate_value */
    case 313: /* boolean_value_expression */
    case 314: /* boolean_primary */
    case 315: /* common_expression */
    case 316: /* from_clause */
    case 317: /* table_reference_list */
    case 318: /* table_reference */
    case 319: /* table_primary */
    case 320: /* joined_table */
    case 322: /* parenthesized_joined_table */
    case 324: /* search_condition */
    case 325: /* query_specification */
    case 328: /* where_clause_opt */
    case 330: /* twindow_clause_opt */
    case 332: /* having_clause_opt */
    case 334: /* select_item */
    case 335: /* fill_opt */
    case 338: /* query_expression_body */
    case 340: /* slimit_clause_opt */
    case 341: /* limit_clause_opt */
    case 342: /* query_primary */
    case 344: /* sort_specification */
2100
{
2101
 nodesDestroyNode((yypminor->yy662)); 
2102 2103
}
      break;
X
Xiaoyu Wang 已提交
2104 2105 2106 2107
    case 232: /* account_options */
    case 233: /* alter_account_options */
    case 235: /* alter_account_option */
    case 289: /* bufsize_opt */
2108
{
2109
 
2110 2111
}
      break;
X
Xiaoyu Wang 已提交
2112 2113 2114 2115 2116 2117 2118 2119 2120 2121
    case 236: /* user_name */
    case 237: /* dnode_endpoint */
    case 238: /* dnode_host_name */
    case 240: /* db_name */
    case 258: /* column_name */
    case 265: /* table_name */
    case 275: /* function_name */
    case 276: /* index_name */
    case 283: /* topic_name */
    case 290: /* stream_name */
2122 2123 2124 2125 2126
    case 297: /* table_alias */
    case 298: /* column_alias */
    case 304: /* star_func */
    case 306: /* noarg_func */
    case 321: /* alias_opt */
2127
{
2128
 
2129 2130
}
      break;
X
Xiaoyu Wang 已提交
2131 2132 2133 2134
    case 239: /* not_exists_opt */
    case 242: /* exists_opt */
    case 286: /* analyze_opt */
    case 288: /* agg_func_opt */
2135
    case 326: /* set_quantifier_opt */
2136
{
2137 2138 2139
 
}
      break;
X
Xiaoyu Wang 已提交
2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154
    case 244: /* integer_list */
    case 245: /* variable_list */
    case 246: /* retention_list */
    case 250: /* column_def_list */
    case 251: /* tags_def_opt */
    case 253: /* multi_create_clause */
    case 254: /* tags_def */
    case 255: /* multi_drop_clause */
    case 261: /* specific_tags_opt */
    case 262: /* literal_list */
    case 264: /* col_name_list */
    case 267: /* func_name_list */
    case 278: /* func_list */
    case 282: /* expression_list */
    case 293: /* dnode_list */
2155 2156 2157 2158 2159 2160 2161 2162 2163
    case 305: /* star_func_para_list */
    case 307: /* other_para_list */
    case 327: /* select_list */
    case 329: /* partition_by_clause_opt */
    case 331: /* group_by_clause_opt */
    case 333: /* select_sublist */
    case 337: /* group_by_list */
    case 339: /* order_by_clause_opt */
    case 343: /* sort_specification_list */
2164
{
2165
 nodesDestroyList((yypminor->yy568)); 
2166 2167
}
      break;
X
Xiaoyu Wang 已提交
2168 2169
    case 247: /* alter_db_option */
    case 268: /* alter_table_option */
2170
{
X
Xiaoyu Wang 已提交
2171
 
2172 2173
}
      break;
X
Xiaoyu Wang 已提交
2174
    case 259: /* type_name */
2175
{
2176
 
2177 2178
}
      break;
2179 2180
    case 310: /* compare_op */
    case 311: /* in_op */
2181
{
2182
 
2183 2184
}
      break;
2185
    case 323: /* join_type */
2186
{
2187
 
2188 2189
}
      break;
2190
    case 336: /* fill_mode */
2191
{
2192
 
2193 2194
}
      break;
2195
    case 345: /* ordering_specification_opt */
2196
{
2197
 
2198 2199
}
      break;
2200
    case 346: /* null_ordering_opt */
2201
{
2202
 
2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233
}
      break;
/********* End destructor definitions *****************************************/
    default:  break;   /* If no destructor action specified: do nothing */
  }
}

/*
** Pop the parser's stack once.
**
** If there is a destructor routine associated with the token which
** is popped from the stack, then call it.
*/
static void yy_pop_parser_stack(yyParser *pParser){
  yyStackEntry *yytos;
  assert( pParser->yytos!=0 );
  assert( pParser->yytos > pParser->yystack );
  yytos = pParser->yytos--;
#ifndef NDEBUG
  if( yyTraceFILE ){
    fprintf(yyTraceFILE,"%sPopping %s\n",
      yyTracePrompt,
      yyTokenName[yytos->major]);
  }
#endif
  yy_destructor(pParser, yytos->major, &yytos->minor);
}

/*
** Clear all secondary memory allocations from the parser
*/
X
Xiaoyu Wang 已提交
2234
void ParseFinalize(void *p){
2235 2236 2237
  yyParser *pParser = (yyParser*)p;
  while( pParser->yytos>pParser->yystack ) yy_pop_parser_stack(pParser);
#if YYSTACKDEPTH<=0
X
Xiaoyu Wang 已提交
2238
  if( pParser->yystack!=&pParser->yystk0 ) free(pParser->yystack);
2239 2240 2241
#endif
}

X
Xiaoyu Wang 已提交
2242
#ifndef Parse_ENGINEALWAYSONSTACK
2243 2244 2245 2246 2247 2248 2249 2250
/* 
** Deallocate and destroy a parser.  Destructors are called for
** all stack elements before shutting the parser down.
**
** If the YYPARSEFREENEVERNULL macro exists (for example because it
** is defined in a %include section of the input grammar) then it is
** assumed that the input pointer is never NULL.
*/
X
Xiaoyu Wang 已提交
2251
void ParseFree(
2252 2253 2254 2255 2256 2257
  void *p,                    /* The parser to be deleted */
  void (*freeProc)(void*)     /* Function used to reclaim memory */
){
#ifndef YYPARSEFREENEVERNULL
  if( p==0 ) return;
#endif
X
Xiaoyu Wang 已提交
2258
  ParseFinalize(p);
2259 2260
  (*freeProc)(p);
}
X
Xiaoyu Wang 已提交
2261
#endif /* Parse_ENGINEALWAYSONSTACK */
2262 2263 2264 2265 2266

/*
** Return the peak depth of the stack for a parser.
*/
#ifdef YYTRACKMAXSTACKDEPTH
X
Xiaoyu Wang 已提交
2267
int ParseStackPeak(void *p){
2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290
  yyParser *pParser = (yyParser*)p;
  return pParser->yyhwm;
}
#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)
X
Xiaoyu Wang 已提交
2291
int ParseCoverage(FILE *out){
2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327
  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

/*
** Find the appropriate action for a parser given the terminal
** look-ahead token iLookAhead.
*/
static YYACTIONTYPE yy_find_shift_action(
  YYCODETYPE iLookAhead,    /* The look-ahead token */
  YYACTIONTYPE stateno      /* Current state number */
){
  int i;

  if( stateno>YY_MAX_SHIFT ) return stateno;
  assert( stateno <= YY_SHIFT_COUNT );
#if defined(YYCOVERAGE)
  yycoverage[stateno][iLookAhead] = 1;
#endif
  do{
    i = yy_shift_ofst[stateno];
    assert( i>=0 );
2328
    /* assert( i+YYNTOKEN<=(int)YY_NLOOKAHEAD ); */
2329 2330 2331
    assert( iLookAhead!=YYNOCODE );
    assert( iLookAhead < YYNTOKEN );
    i += iLookAhead;
2332
    if( i>=YY_NLOOKAHEAD || yy_lookahead[i]!=iLookAhead ){
2333 2334
#ifdef YYFALLBACK
      YYCODETYPE iFallback;            /* Fallback token */
2335 2336
      if( iLookAhead<sizeof(yyFallback)/sizeof(yyFallback[0])
             && (iFallback = yyFallback[iLookAhead])!=0 ){
2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350
#ifndef NDEBUG
        if( yyTraceFILE ){
          fprintf(yyTraceFILE, "%sFALLBACK %s => %s\n",
             yyTracePrompt, yyTokenName[iLookAhead], yyTokenName[iFallback]);
        }
#endif
        assert( yyFallback[iFallback]==0 ); /* Fallback loop must terminate */
        iLookAhead = iFallback;
        continue;
      }
#endif
#ifdef YYWILDCARD
      {
        int j = i - iLookAhead + YYWILDCARD;
2351 2352 2353 2354 2355 2356 2357 2358 2359 2360
        if( 
#if YY_SHIFT_MIN+YYWILDCARD<0
          j>=0 &&
#endif
#if YY_SHIFT_MAX+YYWILDCARD>=YY_ACTTAB_COUNT
          j<YY_ACTTAB_COUNT &&
#endif
          j<(int)(sizeof(yy_lookahead)/sizeof(yy_lookahead[0])) &&
          yy_lookahead[j]==YYWILDCARD && iLookAhead>0
        ){
2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412
#ifndef NDEBUG
          if( yyTraceFILE ){
            fprintf(yyTraceFILE, "%sWILDCARD %s => %s\n",
               yyTracePrompt, yyTokenName[iLookAhead],
               yyTokenName[YYWILDCARD]);
          }
#endif /* NDEBUG */
          return yy_action[j];
        }
      }
#endif /* YYWILDCARD */
      return yy_default[stateno];
    }else{
      return yy_action[i];
    }
  }while(1);
}

/*
** Find the appropriate action for a parser given the non-terminal
** look-ahead token iLookAhead.
*/
static YYACTIONTYPE yy_find_reduce_action(
  YYACTIONTYPE stateno,     /* Current state number */
  YYCODETYPE iLookAhead     /* The look-ahead token */
){
  int i;
#ifdef YYERRORSYMBOL
  if( stateno>YY_REDUCE_COUNT ){
    return yy_default[stateno];
  }
#else
  assert( stateno<=YY_REDUCE_COUNT );
#endif
  i = yy_reduce_ofst[stateno];
  assert( iLookAhead!=YYNOCODE );
  i += iLookAhead;
#ifdef YYERRORSYMBOL
  if( i<0 || i>=YY_ACTTAB_COUNT || yy_lookahead[i]!=iLookAhead ){
    return yy_default[stateno];
  }
#else
  assert( i>=0 && i<YY_ACTTAB_COUNT );
  assert( yy_lookahead[i]==iLookAhead );
#endif
  return yy_action[i];
}

/*
** The following routine is called if the stack overflows.
*/
static void yyStackOverflow(yyParser *yypParser){
X
Xiaoyu Wang 已提交
2413 2414
   ParseARG_FETCH
   ParseCTX_FETCH
2415 2416 2417 2418 2419 2420 2421 2422 2423 2424
#ifndef NDEBUG
   if( yyTraceFILE ){
     fprintf(yyTraceFILE,"%sStack Overflow!\n",yyTracePrompt);
   }
#endif
   while( yypParser->yytos>yypParser->yystack ) yy_pop_parser_stack(yypParser);
   /* Here code is inserted which will execute if the parser
   ** stack every overflows */
/******** Begin %stack_overflow code ******************************************/
/******** End %stack_overflow code ********************************************/
X
Xiaoyu Wang 已提交
2425 2426
   ParseARG_STORE /* Suppress warning about unused %extra_argument var */
   ParseCTX_STORE
2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456
}

/*
** 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.
*/
static void yy_shift(
  yyParser *yypParser,          /* The parser to be shifted */
  YYACTIONTYPE yyNewState,      /* The new state to shift in */
  YYCODETYPE yyMajor,           /* The major token to shift in */
X
Xiaoyu Wang 已提交
2457
  ParseTOKENTYPE yyMinor        /* The minor token to shift in */
2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491
){
  yyStackEntry *yytos;
  yypParser->yytos++;
#ifdef YYTRACKMAXSTACKDEPTH
  if( (int)(yypParser->yytos - yypParser->yystack)>yypParser->yyhwm ){
    yypParser->yyhwm++;
    assert( yypParser->yyhwm == (int)(yypParser->yytos - yypParser->yystack) );
  }
#endif
#if YYSTACKDEPTH>0 
  if( yypParser->yytos>yypParser->yystackEnd ){
    yypParser->yytos--;
    yyStackOverflow(yypParser);
    return;
  }
#else
  if( yypParser->yytos>=&yypParser->yystack[yypParser->yystksz] ){
    if( yyGrowStack(yypParser) ){
      yypParser->yytos--;
      yyStackOverflow(yypParser);
      return;
    }
  }
#endif
  if( yyNewState > YY_MAX_SHIFT ){
    yyNewState += YY_MIN_REDUCE - YY_MIN_SHIFTREDUCE;
  }
  yytos = yypParser->yytos;
  yytos->stateno = yyNewState;
  yytos->major = yyMajor;
  yytos->minor.yy0 = yyMinor;
  yyTraceShift(yypParser, yyNewState, "Shift");
}

2492 2493 2494 2495 2496 2497 2498
/* The following table contains information about every rule that
** is used during the reduce.
*/
static const struct {
  YYCODETYPE lhs;       /* Symbol on the left-hand side of the rule */
  signed char nrhs;     /* Negative of the number of RHS symbols in the rule */
} yyRuleInfo[] = {
X
Xiaoyu Wang 已提交
2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 2570 2571 2572 2573 2574 2575 2576 2577 2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 2619 2620 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 2635 2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 2686 2687 2688 2689 2690 2691 2692 2693 2694 2695 2696 2697 2698 2699 2700 2701 2702 2703 2704 2705 2706 2707 2708 2709 2710 2711 2712 2713 2714 2715 2716 2717 2718 2719 2720 2721 2722 2723 2724 2725 2726 2727 2728 2729 2730 2731 2732 2733 2734 2735 2736 2737 2738 2739 2740 2741 2742 2743 2744 2745 2746 2747 2748 2749 2750 2751 2752 2753 2754 2755 2756 2757 2758 2759 2760 2761 2762 2763 2764 2765 2766 2767 2768 2769 2770 2771 2772 2773 2774 2775 2776 2777
  {  231,   -6 }, /* (0) cmd ::= CREATE ACCOUNT NK_ID PASS NK_STRING account_options */
  {  231,   -4 }, /* (1) cmd ::= ALTER ACCOUNT NK_ID alter_account_options */
  {  232,    0 }, /* (2) account_options ::= */
  {  232,   -3 }, /* (3) account_options ::= account_options PPS literal */
  {  232,   -3 }, /* (4) account_options ::= account_options TSERIES literal */
  {  232,   -3 }, /* (5) account_options ::= account_options STORAGE literal */
  {  232,   -3 }, /* (6) account_options ::= account_options STREAMS literal */
  {  232,   -3 }, /* (7) account_options ::= account_options QTIME literal */
  {  232,   -3 }, /* (8) account_options ::= account_options DBS literal */
  {  232,   -3 }, /* (9) account_options ::= account_options USERS literal */
  {  232,   -3 }, /* (10) account_options ::= account_options CONNS literal */
  {  232,   -3 }, /* (11) account_options ::= account_options STATE literal */
  {  233,   -1 }, /* (12) alter_account_options ::= alter_account_option */
  {  233,   -2 }, /* (13) alter_account_options ::= alter_account_options alter_account_option */
  {  235,   -2 }, /* (14) alter_account_option ::= PASS literal */
  {  235,   -2 }, /* (15) alter_account_option ::= PPS literal */
  {  235,   -2 }, /* (16) alter_account_option ::= TSERIES literal */
  {  235,   -2 }, /* (17) alter_account_option ::= STORAGE literal */
  {  235,   -2 }, /* (18) alter_account_option ::= STREAMS literal */
  {  235,   -2 }, /* (19) alter_account_option ::= QTIME literal */
  {  235,   -2 }, /* (20) alter_account_option ::= DBS literal */
  {  235,   -2 }, /* (21) alter_account_option ::= USERS literal */
  {  235,   -2 }, /* (22) alter_account_option ::= CONNS literal */
  {  235,   -2 }, /* (23) alter_account_option ::= STATE literal */
  {  231,   -5 }, /* (24) cmd ::= CREATE USER user_name PASS NK_STRING */
  {  231,   -5 }, /* (25) cmd ::= ALTER USER user_name PASS NK_STRING */
  {  231,   -5 }, /* (26) cmd ::= ALTER USER user_name PRIVILEGE NK_STRING */
  {  231,   -3 }, /* (27) cmd ::= DROP USER user_name */
  {  231,   -3 }, /* (28) cmd ::= CREATE DNODE dnode_endpoint */
  {  231,   -5 }, /* (29) cmd ::= CREATE DNODE dnode_host_name PORT NK_INTEGER */
  {  231,   -3 }, /* (30) cmd ::= DROP DNODE NK_INTEGER */
  {  231,   -3 }, /* (31) cmd ::= DROP DNODE dnode_endpoint */
  {  231,   -4 }, /* (32) cmd ::= ALTER DNODE NK_INTEGER NK_STRING */
  {  231,   -5 }, /* (33) cmd ::= ALTER DNODE NK_INTEGER NK_STRING NK_STRING */
  {  231,   -4 }, /* (34) cmd ::= ALTER ALL DNODES NK_STRING */
  {  231,   -5 }, /* (35) cmd ::= ALTER ALL DNODES NK_STRING NK_STRING */
  {  237,   -1 }, /* (36) dnode_endpoint ::= NK_STRING */
  {  238,   -1 }, /* (37) dnode_host_name ::= NK_ID */
  {  238,   -1 }, /* (38) dnode_host_name ::= NK_IPTOKEN */
  {  231,   -3 }, /* (39) cmd ::= ALTER LOCAL NK_STRING */
  {  231,   -4 }, /* (40) cmd ::= ALTER LOCAL NK_STRING NK_STRING */
  {  231,   -5 }, /* (41) cmd ::= CREATE QNODE ON DNODE NK_INTEGER */
  {  231,   -5 }, /* (42) cmd ::= DROP QNODE ON DNODE NK_INTEGER */
  {  231,   -5 }, /* (43) cmd ::= CREATE BNODE ON DNODE NK_INTEGER */
  {  231,   -5 }, /* (44) cmd ::= DROP BNODE ON DNODE NK_INTEGER */
  {  231,   -5 }, /* (45) cmd ::= CREATE SNODE ON DNODE NK_INTEGER */
  {  231,   -5 }, /* (46) cmd ::= DROP SNODE ON DNODE NK_INTEGER */
  {  231,   -5 }, /* (47) cmd ::= CREATE MNODE ON DNODE NK_INTEGER */
  {  231,   -5 }, /* (48) cmd ::= DROP MNODE ON DNODE NK_INTEGER */
  {  231,   -5 }, /* (49) cmd ::= CREATE DATABASE not_exists_opt db_name db_options */
  {  231,   -4 }, /* (50) cmd ::= DROP DATABASE exists_opt db_name */
  {  231,   -2 }, /* (51) cmd ::= USE db_name */
  {  231,   -4 }, /* (52) cmd ::= ALTER DATABASE db_name alter_db_options */
  {  239,   -3 }, /* (53) not_exists_opt ::= IF NOT EXISTS */
  {  239,    0 }, /* (54) not_exists_opt ::= */
  {  242,   -2 }, /* (55) exists_opt ::= IF EXISTS */
  {  242,    0 }, /* (56) exists_opt ::= */
  {  241,    0 }, /* (57) db_options ::= */
  {  241,   -3 }, /* (58) db_options ::= db_options BLOCKS NK_INTEGER */
  {  241,   -3 }, /* (59) db_options ::= db_options CACHE NK_INTEGER */
  {  241,   -3 }, /* (60) db_options ::= db_options CACHELAST NK_INTEGER */
  {  241,   -3 }, /* (61) db_options ::= db_options COMP NK_INTEGER */
  {  241,   -3 }, /* (62) db_options ::= db_options DAYS NK_INTEGER */
  {  241,   -3 }, /* (63) db_options ::= db_options DAYS NK_VARIABLE */
  {  241,   -3 }, /* (64) db_options ::= db_options FSYNC NK_INTEGER */
  {  241,   -3 }, /* (65) db_options ::= db_options MAXROWS NK_INTEGER */
  {  241,   -3 }, /* (66) db_options ::= db_options MINROWS NK_INTEGER */
  {  241,   -3 }, /* (67) db_options ::= db_options KEEP integer_list */
  {  241,   -3 }, /* (68) db_options ::= db_options KEEP variable_list */
  {  241,   -3 }, /* (69) db_options ::= db_options PRECISION NK_STRING */
  {  241,   -3 }, /* (70) db_options ::= db_options QUORUM NK_INTEGER */
  {  241,   -3 }, /* (71) db_options ::= db_options REPLICA NK_INTEGER */
  {  241,   -3 }, /* (72) db_options ::= db_options TTL NK_INTEGER */
  {  241,   -3 }, /* (73) db_options ::= db_options WAL NK_INTEGER */
  {  241,   -3 }, /* (74) db_options ::= db_options VGROUPS NK_INTEGER */
  {  241,   -3 }, /* (75) db_options ::= db_options SINGLE_STABLE NK_INTEGER */
  {  241,   -3 }, /* (76) db_options ::= db_options STREAM_MODE NK_INTEGER */
  {  241,   -3 }, /* (77) db_options ::= db_options RETENTIONS retention_list */
  {  241,   -3 }, /* (78) db_options ::= db_options STRICT NK_INTEGER */
  {  243,   -1 }, /* (79) alter_db_options ::= alter_db_option */
  {  243,   -2 }, /* (80) alter_db_options ::= alter_db_options alter_db_option */
  {  247,   -2 }, /* (81) alter_db_option ::= BLOCKS NK_INTEGER */
  {  247,   -2 }, /* (82) alter_db_option ::= FSYNC NK_INTEGER */
  {  247,   -2 }, /* (83) alter_db_option ::= KEEP integer_list */
  {  247,   -2 }, /* (84) alter_db_option ::= KEEP variable_list */
  {  247,   -2 }, /* (85) alter_db_option ::= WAL NK_INTEGER */
  {  247,   -2 }, /* (86) alter_db_option ::= QUORUM NK_INTEGER */
  {  247,   -2 }, /* (87) alter_db_option ::= CACHELAST NK_INTEGER */
  {  247,   -2 }, /* (88) alter_db_option ::= REPLICA NK_INTEGER */
  {  247,   -2 }, /* (89) alter_db_option ::= STRICT NK_INTEGER */
  {  244,   -1 }, /* (90) integer_list ::= NK_INTEGER */
  {  244,   -3 }, /* (91) integer_list ::= integer_list NK_COMMA NK_INTEGER */
  {  245,   -1 }, /* (92) variable_list ::= NK_VARIABLE */
  {  245,   -3 }, /* (93) variable_list ::= variable_list NK_COMMA NK_VARIABLE */
  {  246,   -1 }, /* (94) retention_list ::= retention */
  {  246,   -3 }, /* (95) retention_list ::= retention_list NK_COMMA retention */
  {  248,   -3 }, /* (96) retention ::= NK_VARIABLE NK_COLON NK_VARIABLE */
  {  231,   -9 }, /* (97) cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options */
  {  231,   -3 }, /* (98) cmd ::= CREATE TABLE multi_create_clause */
  {  231,   -9 }, /* (99) cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options */
  {  231,   -3 }, /* (100) cmd ::= DROP TABLE multi_drop_clause */
  {  231,   -4 }, /* (101) cmd ::= DROP STABLE exists_opt full_table_name */
  {  231,   -3 }, /* (102) cmd ::= ALTER TABLE alter_table_clause */
  {  231,   -3 }, /* (103) cmd ::= ALTER STABLE alter_table_clause */
  {  256,   -2 }, /* (104) alter_table_clause ::= full_table_name alter_table_options */
  {  256,   -5 }, /* (105) alter_table_clause ::= full_table_name ADD COLUMN column_name type_name */
  {  256,   -4 }, /* (106) alter_table_clause ::= full_table_name DROP COLUMN column_name */
  {  256,   -5 }, /* (107) alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name */
  {  256,   -5 }, /* (108) alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name */
  {  256,   -5 }, /* (109) alter_table_clause ::= full_table_name ADD TAG column_name type_name */
  {  256,   -4 }, /* (110) alter_table_clause ::= full_table_name DROP TAG column_name */
  {  256,   -5 }, /* (111) alter_table_clause ::= full_table_name MODIFY TAG column_name type_name */
  {  256,   -5 }, /* (112) alter_table_clause ::= full_table_name RENAME TAG column_name column_name */
  {  256,   -6 }, /* (113) alter_table_clause ::= full_table_name SET TAG column_name NK_EQ literal */
  {  253,   -1 }, /* (114) multi_create_clause ::= create_subtable_clause */
  {  253,   -2 }, /* (115) multi_create_clause ::= multi_create_clause create_subtable_clause */
  {  260,   -9 }, /* (116) create_subtable_clause ::= not_exists_opt full_table_name USING full_table_name specific_tags_opt TAGS NK_LP literal_list NK_RP */
  {  255,   -1 }, /* (117) multi_drop_clause ::= drop_table_clause */
  {  255,   -2 }, /* (118) multi_drop_clause ::= multi_drop_clause drop_table_clause */
  {  263,   -2 }, /* (119) drop_table_clause ::= exists_opt full_table_name */
  {  261,    0 }, /* (120) specific_tags_opt ::= */
  {  261,   -3 }, /* (121) specific_tags_opt ::= NK_LP col_name_list NK_RP */
  {  249,   -1 }, /* (122) full_table_name ::= table_name */
  {  249,   -3 }, /* (123) full_table_name ::= db_name NK_DOT table_name */
  {  250,   -1 }, /* (124) column_def_list ::= column_def */
  {  250,   -3 }, /* (125) column_def_list ::= column_def_list NK_COMMA column_def */
  {  266,   -2 }, /* (126) column_def ::= column_name type_name */
  {  266,   -4 }, /* (127) column_def ::= column_name type_name COMMENT NK_STRING */
  {  259,   -1 }, /* (128) type_name ::= BOOL */
  {  259,   -1 }, /* (129) type_name ::= TINYINT */
  {  259,   -1 }, /* (130) type_name ::= SMALLINT */
  {  259,   -1 }, /* (131) type_name ::= INT */
  {  259,   -1 }, /* (132) type_name ::= INTEGER */
  {  259,   -1 }, /* (133) type_name ::= BIGINT */
  {  259,   -1 }, /* (134) type_name ::= FLOAT */
  {  259,   -1 }, /* (135) type_name ::= DOUBLE */
  {  259,   -4 }, /* (136) type_name ::= BINARY NK_LP NK_INTEGER NK_RP */
  {  259,   -1 }, /* (137) type_name ::= TIMESTAMP */
  {  259,   -4 }, /* (138) type_name ::= NCHAR NK_LP NK_INTEGER NK_RP */
  {  259,   -2 }, /* (139) type_name ::= TINYINT UNSIGNED */
  {  259,   -2 }, /* (140) type_name ::= SMALLINT UNSIGNED */
  {  259,   -2 }, /* (141) type_name ::= INT UNSIGNED */
  {  259,   -2 }, /* (142) type_name ::= BIGINT UNSIGNED */
  {  259,   -1 }, /* (143) type_name ::= JSON */
  {  259,   -4 }, /* (144) type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP */
  {  259,   -1 }, /* (145) type_name ::= MEDIUMBLOB */
  {  259,   -1 }, /* (146) type_name ::= BLOB */
  {  259,   -4 }, /* (147) type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP */
  {  259,   -1 }, /* (148) type_name ::= DECIMAL */
  {  259,   -4 }, /* (149) type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP */
  {  259,   -6 }, /* (150) type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */
  {  251,    0 }, /* (151) tags_def_opt ::= */
  {  251,   -1 }, /* (152) tags_def_opt ::= tags_def */
  {  254,   -4 }, /* (153) tags_def ::= TAGS NK_LP column_def_list NK_RP */
  {  252,    0 }, /* (154) table_options ::= */
  {  252,   -3 }, /* (155) table_options ::= table_options COMMENT NK_STRING */
  {  252,   -3 }, /* (156) table_options ::= table_options KEEP integer_list */
  {  252,   -3 }, /* (157) table_options ::= table_options KEEP variable_list */
  {  252,   -3 }, /* (158) table_options ::= table_options TTL NK_INTEGER */
  {  252,   -5 }, /* (159) table_options ::= table_options SMA NK_LP col_name_list NK_RP */
  {  252,   -5 }, /* (160) table_options ::= table_options ROLLUP NK_LP func_name_list NK_RP */
  {  252,   -3 }, /* (161) table_options ::= table_options FILE_FACTOR NK_FLOAT */
  {  252,   -3 }, /* (162) table_options ::= table_options DELAY NK_INTEGER */
  {  257,   -1 }, /* (163) alter_table_options ::= alter_table_option */
  {  257,   -2 }, /* (164) alter_table_options ::= alter_table_options alter_table_option */
  {  268,   -2 }, /* (165) alter_table_option ::= COMMENT NK_STRING */
  {  268,   -2 }, /* (166) alter_table_option ::= KEEP integer_list */
  {  268,   -2 }, /* (167) alter_table_option ::= KEEP variable_list */
  {  268,   -2 }, /* (168) alter_table_option ::= TTL NK_INTEGER */
  {  264,   -1 }, /* (169) col_name_list ::= col_name */
  {  264,   -3 }, /* (170) col_name_list ::= col_name_list NK_COMMA col_name */
  {  269,   -1 }, /* (171) col_name ::= column_name */
  {  231,   -2 }, /* (172) cmd ::= SHOW DNODES */
  {  231,   -2 }, /* (173) cmd ::= SHOW USERS */
  {  231,   -2 }, /* (174) cmd ::= SHOW DATABASES */
  {  231,   -4 }, /* (175) cmd ::= SHOW db_name_cond_opt TABLES like_pattern_opt */
  {  231,   -4 }, /* (176) cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt */
  {  231,   -3 }, /* (177) cmd ::= SHOW db_name_cond_opt VGROUPS */
  {  231,   -2 }, /* (178) cmd ::= SHOW MNODES */
  {  231,   -2 }, /* (179) cmd ::= SHOW MODULES */
  {  231,   -2 }, /* (180) cmd ::= SHOW QNODES */
  {  231,   -2 }, /* (181) cmd ::= SHOW FUNCTIONS */
  {  231,   -5 }, /* (182) cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt */
  {  231,   -2 }, /* (183) cmd ::= SHOW STREAMS */
  {  231,   -2 }, /* (184) cmd ::= SHOW ACCOUNTS */
  {  231,   -2 }, /* (185) cmd ::= SHOW APPS */
  {  231,   -2 }, /* (186) cmd ::= SHOW CONNECTIONS */
  {  231,   -2 }, /* (187) cmd ::= SHOW LICENCE */
  {  231,   -2 }, /* (188) cmd ::= SHOW GRANTS */
  {  231,   -4 }, /* (189) cmd ::= SHOW CREATE DATABASE db_name */
  {  231,   -4 }, /* (190) cmd ::= SHOW CREATE TABLE full_table_name */
  {  231,   -4 }, /* (191) cmd ::= SHOW CREATE STABLE full_table_name */
  {  231,   -2 }, /* (192) cmd ::= SHOW QUERIES */
  {  231,   -2 }, /* (193) cmd ::= SHOW SCORES */
  {  231,   -2 }, /* (194) cmd ::= SHOW TOPICS */
  {  231,   -2 }, /* (195) cmd ::= SHOW VARIABLES */
  {  231,   -2 }, /* (196) cmd ::= SHOW BNODES */
  {  231,   -2 }, /* (197) cmd ::= SHOW SNODES */
  {  231,   -2 }, /* (198) cmd ::= SHOW CLUSTER */
  {  270,    0 }, /* (199) db_name_cond_opt ::= */
  {  270,   -2 }, /* (200) db_name_cond_opt ::= db_name NK_DOT */
  {  271,    0 }, /* (201) like_pattern_opt ::= */
  {  271,   -2 }, /* (202) like_pattern_opt ::= LIKE NK_STRING */
  {  272,   -1 }, /* (203) table_name_cond ::= table_name */
  {  273,    0 }, /* (204) from_db_opt ::= */
  {  273,   -2 }, /* (205) from_db_opt ::= FROM db_name */
  {  267,   -1 }, /* (206) func_name_list ::= func_name */
  {  267,   -3 }, /* (207) func_name_list ::= func_name_list NK_COMMA func_name */
  {  274,   -1 }, /* (208) func_name ::= function_name */
  {  231,   -8 }, /* (209) cmd ::= CREATE SMA INDEX not_exists_opt index_name ON table_name index_options */
  {  231,  -10 }, /* (210) cmd ::= CREATE FULLTEXT INDEX not_exists_opt index_name ON table_name NK_LP col_name_list NK_RP */
  {  231,   -6 }, /* (211) cmd ::= DROP INDEX exists_opt index_name ON table_name */
  {  277,    0 }, /* (212) index_options ::= */
  {  277,   -9 }, /* (213) index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt */
  {  277,  -11 }, /* (214) index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt */
  {  278,   -1 }, /* (215) func_list ::= func */
  {  278,   -3 }, /* (216) func_list ::= func_list NK_COMMA func */
  {  281,   -4 }, /* (217) func ::= function_name NK_LP expression_list NK_RP */
  {  231,   -7 }, /* (218) cmd ::= CREATE TOPIC not_exists_opt topic_name topic_options AS query_expression */
  {  231,   -7 }, /* (219) cmd ::= CREATE TOPIC not_exists_opt topic_name topic_options AS db_name */
  {  231,   -4 }, /* (220) cmd ::= DROP TOPIC exists_opt topic_name */
  {  284,    0 }, /* (221) topic_options ::= */
  {  284,   -3 }, /* (222) topic_options ::= topic_options WITH TABLE */
  {  284,   -3 }, /* (223) topic_options ::= topic_options WITH SCHEMA */
  {  284,   -3 }, /* (224) topic_options ::= topic_options WITH TAG */
  {  231,   -2 }, /* (225) cmd ::= DESC full_table_name */
  {  231,   -2 }, /* (226) cmd ::= DESCRIBE full_table_name */
  {  231,   -3 }, /* (227) cmd ::= RESET QUERY CACHE */
  {  231,   -4 }, /* (228) cmd ::= EXPLAIN analyze_opt explain_options query_expression */
  {  286,    0 }, /* (229) analyze_opt ::= */
  {  286,   -1 }, /* (230) analyze_opt ::= ANALYZE */
  {  287,    0 }, /* (231) explain_options ::= */
  {  287,   -3 }, /* (232) explain_options ::= explain_options VERBOSE NK_BOOL */
  {  287,   -3 }, /* (233) explain_options ::= explain_options RATIO NK_FLOAT */
  {  231,   -6 }, /* (234) cmd ::= COMPACT VNODES IN NK_LP integer_list NK_RP */
  {  231,  -10 }, /* (235) cmd ::= CREATE agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt */
  {  231,   -3 }, /* (236) cmd ::= DROP FUNCTION function_name */
  {  288,    0 }, /* (237) agg_func_opt ::= */
  {  288,   -1 }, /* (238) agg_func_opt ::= AGGREGATE */
  {  289,    0 }, /* (239) bufsize_opt ::= */
  {  289,   -2 }, /* (240) bufsize_opt ::= BUFSIZE NK_INTEGER */
  {  231,   -8 }, /* (241) cmd ::= CREATE STREAM not_exists_opt stream_name stream_options into_opt AS query_expression */
  {  231,   -4 }, /* (242) cmd ::= DROP STREAM exists_opt stream_name */
  {  292,    0 }, /* (243) into_opt ::= */
  {  292,   -2 }, /* (244) into_opt ::= INTO full_table_name */
  {  291,    0 }, /* (245) stream_options ::= */
  {  291,   -3 }, /* (246) stream_options ::= stream_options TRIGGER AT_ONCE */
  {  291,   -3 }, /* (247) stream_options ::= stream_options TRIGGER WINDOW_CLOSE */
  {  291,   -3 }, /* (248) stream_options ::= stream_options WATERMARK duration_literal */
  {  231,   -3 }, /* (249) cmd ::= KILL CONNECTION NK_INTEGER */
  {  231,   -3 }, /* (250) cmd ::= KILL QUERY NK_INTEGER */
  {  231,   -4 }, /* (251) cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER */
  {  231,   -4 }, /* (252) cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list */
  {  231,   -3 }, /* (253) cmd ::= SPLIT VGROUP NK_INTEGER */
  {  293,   -2 }, /* (254) dnode_list ::= DNODE NK_INTEGER */
  {  293,   -3 }, /* (255) dnode_list ::= dnode_list DNODE NK_INTEGER */
  {  231,   -3 }, /* (256) cmd ::= SYNCDB db_name REPLICA */
  {  231,   -1 }, /* (257) cmd ::= query_expression */
  {  234,   -1 }, /* (258) literal ::= NK_INTEGER */
  {  234,   -1 }, /* (259) literal ::= NK_FLOAT */
  {  234,   -1 }, /* (260) literal ::= NK_STRING */
  {  234,   -1 }, /* (261) literal ::= NK_BOOL */
  {  234,   -2 }, /* (262) literal ::= TIMESTAMP NK_STRING */
  {  234,   -1 }, /* (263) literal ::= duration_literal */
  {  234,   -1 }, /* (264) literal ::= NULL */
  {  234,   -1 }, /* (265) literal ::= NK_QUESTION */
  {  279,   -1 }, /* (266) duration_literal ::= NK_VARIABLE */
  {  294,   -1 }, /* (267) signed ::= NK_INTEGER */
  {  294,   -2 }, /* (268) signed ::= NK_PLUS NK_INTEGER */
  {  294,   -2 }, /* (269) signed ::= NK_MINUS NK_INTEGER */
  {  294,   -1 }, /* (270) signed ::= NK_FLOAT */
  {  294,   -2 }, /* (271) signed ::= NK_PLUS NK_FLOAT */
  {  294,   -2 }, /* (272) signed ::= NK_MINUS NK_FLOAT */
  {  295,   -1 }, /* (273) signed_literal ::= signed */
  {  295,   -1 }, /* (274) signed_literal ::= NK_STRING */
  {  295,   -1 }, /* (275) signed_literal ::= NK_BOOL */
  {  295,   -2 }, /* (276) signed_literal ::= TIMESTAMP NK_STRING */
  {  295,   -1 }, /* (277) signed_literal ::= duration_literal */
  {  295,   -1 }, /* (278) signed_literal ::= NULL */
2778 2779 2780 2781 2782 2783 2784 2785 2786 2787 2788 2789 2790 2791 2792 2793 2794 2795 2796 2797 2798 2799 2800 2801 2802 2803 2804 2805 2806 2807 2808 2809 2810 2811 2812 2813 2814 2815 2816 2817 2818 2819 2820 2821 2822 2823 2824 2825 2826 2827 2828 2829 2830 2831 2832 2833 2834 2835 2836 2837 2838 2839 2840 2841 2842 2843 2844 2845 2846 2847 2848 2849 2850 2851 2852 2853 2854 2855 2856 2857 2858 2859 2860 2861 2862 2863 2864 2865 2866 2867 2868 2869 2870 2871 2872 2873 2874 2875 2876 2877 2878 2879 2880 2881 2882 2883 2884 2885 2886 2887 2888 2889 2890 2891 2892 2893 2894 2895 2896 2897 2898 2899 2900 2901 2902 2903 2904 2905 2906 2907 2908 2909 2910 2911 2912 2913 2914 2915 2916 2917 2918 2919 2920 2921 2922 2923 2924 2925 2926 2927 2928 2929 2930 2931 2932 2933 2934 2935 2936 2937 2938 2939 2940 2941 2942
  {  295,   -1 }, /* (279) signed_literal ::= literal_func */
  {  262,   -1 }, /* (280) literal_list ::= signed_literal */
  {  262,   -3 }, /* (281) literal_list ::= literal_list NK_COMMA signed_literal */
  {  240,   -1 }, /* (282) db_name ::= NK_ID */
  {  265,   -1 }, /* (283) table_name ::= NK_ID */
  {  258,   -1 }, /* (284) column_name ::= NK_ID */
  {  275,   -1 }, /* (285) function_name ::= NK_ID */
  {  297,   -1 }, /* (286) table_alias ::= NK_ID */
  {  298,   -1 }, /* (287) column_alias ::= NK_ID */
  {  236,   -1 }, /* (288) user_name ::= NK_ID */
  {  276,   -1 }, /* (289) index_name ::= NK_ID */
  {  283,   -1 }, /* (290) topic_name ::= NK_ID */
  {  290,   -1 }, /* (291) stream_name ::= NK_ID */
  {  299,   -1 }, /* (292) expression ::= literal */
  {  299,   -1 }, /* (293) expression ::= pseudo_column */
  {  299,   -1 }, /* (294) expression ::= column_reference */
  {  299,   -1 }, /* (295) expression ::= function_expression */
  {  299,   -1 }, /* (296) expression ::= subquery */
  {  299,   -3 }, /* (297) expression ::= NK_LP expression NK_RP */
  {  299,   -2 }, /* (298) expression ::= NK_PLUS expression */
  {  299,   -2 }, /* (299) expression ::= NK_MINUS expression */
  {  299,   -3 }, /* (300) expression ::= expression NK_PLUS expression */
  {  299,   -3 }, /* (301) expression ::= expression NK_MINUS expression */
  {  299,   -3 }, /* (302) expression ::= expression NK_STAR expression */
  {  299,   -3 }, /* (303) expression ::= expression NK_SLASH expression */
  {  299,   -3 }, /* (304) expression ::= expression NK_REM expression */
  {  299,   -3 }, /* (305) expression ::= column_reference NK_ARROW NK_STRING */
  {  282,   -1 }, /* (306) expression_list ::= expression */
  {  282,   -3 }, /* (307) expression_list ::= expression_list NK_COMMA expression */
  {  301,   -1 }, /* (308) column_reference ::= column_name */
  {  301,   -3 }, /* (309) column_reference ::= table_name NK_DOT column_name */
  {  300,   -1 }, /* (310) pseudo_column ::= ROWTS */
  {  300,   -1 }, /* (311) pseudo_column ::= TBNAME */
  {  300,   -1 }, /* (312) pseudo_column ::= QSTARTTS */
  {  300,   -1 }, /* (313) pseudo_column ::= QENDTS */
  {  300,   -1 }, /* (314) pseudo_column ::= WSTARTTS */
  {  300,   -1 }, /* (315) pseudo_column ::= WENDTS */
  {  300,   -1 }, /* (316) pseudo_column ::= WDURATION */
  {  302,   -4 }, /* (317) function_expression ::= function_name NK_LP expression_list NK_RP */
  {  302,   -4 }, /* (318) function_expression ::= star_func NK_LP star_func_para_list NK_RP */
  {  302,   -6 }, /* (319) function_expression ::= CAST NK_LP expression AS type_name NK_RP */
  {  302,   -1 }, /* (320) function_expression ::= literal_func */
  {  296,   -3 }, /* (321) literal_func ::= noarg_func NK_LP NK_RP */
  {  296,   -1 }, /* (322) literal_func ::= NOW */
  {  306,   -1 }, /* (323) noarg_func ::= NOW */
  {  306,   -1 }, /* (324) noarg_func ::= TODAY */
  {  306,   -1 }, /* (325) noarg_func ::= TIMEZONE */
  {  304,   -1 }, /* (326) star_func ::= COUNT */
  {  304,   -1 }, /* (327) star_func ::= FIRST */
  {  304,   -1 }, /* (328) star_func ::= LAST */
  {  304,   -1 }, /* (329) star_func ::= LAST_ROW */
  {  305,   -1 }, /* (330) star_func_para_list ::= NK_STAR */
  {  305,   -1 }, /* (331) star_func_para_list ::= other_para_list */
  {  307,   -1 }, /* (332) other_para_list ::= star_func_para */
  {  307,   -3 }, /* (333) other_para_list ::= other_para_list NK_COMMA star_func_para */
  {  308,   -1 }, /* (334) star_func_para ::= expression */
  {  308,   -3 }, /* (335) star_func_para ::= table_name NK_DOT NK_STAR */
  {  309,   -3 }, /* (336) predicate ::= expression compare_op expression */
  {  309,   -5 }, /* (337) predicate ::= expression BETWEEN expression AND expression */
  {  309,   -6 }, /* (338) predicate ::= expression NOT BETWEEN expression AND expression */
  {  309,   -3 }, /* (339) predicate ::= expression IS NULL */
  {  309,   -4 }, /* (340) predicate ::= expression IS NOT NULL */
  {  309,   -3 }, /* (341) predicate ::= expression in_op in_predicate_value */
  {  310,   -1 }, /* (342) compare_op ::= NK_LT */
  {  310,   -1 }, /* (343) compare_op ::= NK_GT */
  {  310,   -1 }, /* (344) compare_op ::= NK_LE */
  {  310,   -1 }, /* (345) compare_op ::= NK_GE */
  {  310,   -1 }, /* (346) compare_op ::= NK_NE */
  {  310,   -1 }, /* (347) compare_op ::= NK_EQ */
  {  310,   -1 }, /* (348) compare_op ::= LIKE */
  {  310,   -2 }, /* (349) compare_op ::= NOT LIKE */
  {  310,   -1 }, /* (350) compare_op ::= MATCH */
  {  310,   -1 }, /* (351) compare_op ::= NMATCH */
  {  310,   -1 }, /* (352) compare_op ::= CONTAINS */
  {  311,   -1 }, /* (353) in_op ::= IN */
  {  311,   -2 }, /* (354) in_op ::= NOT IN */
  {  312,   -3 }, /* (355) in_predicate_value ::= NK_LP expression_list NK_RP */
  {  313,   -1 }, /* (356) boolean_value_expression ::= boolean_primary */
  {  313,   -2 }, /* (357) boolean_value_expression ::= NOT boolean_primary */
  {  313,   -3 }, /* (358) boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */
  {  313,   -3 }, /* (359) boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */
  {  314,   -1 }, /* (360) boolean_primary ::= predicate */
  {  314,   -3 }, /* (361) boolean_primary ::= NK_LP boolean_value_expression NK_RP */
  {  315,   -1 }, /* (362) common_expression ::= expression */
  {  315,   -1 }, /* (363) common_expression ::= boolean_value_expression */
  {  316,   -2 }, /* (364) from_clause ::= FROM table_reference_list */
  {  317,   -1 }, /* (365) table_reference_list ::= table_reference */
  {  317,   -3 }, /* (366) table_reference_list ::= table_reference_list NK_COMMA table_reference */
  {  318,   -1 }, /* (367) table_reference ::= table_primary */
  {  318,   -1 }, /* (368) table_reference ::= joined_table */
  {  319,   -2 }, /* (369) table_primary ::= table_name alias_opt */
  {  319,   -4 }, /* (370) table_primary ::= db_name NK_DOT table_name alias_opt */
  {  319,   -2 }, /* (371) table_primary ::= subquery alias_opt */
  {  319,   -1 }, /* (372) table_primary ::= parenthesized_joined_table */
  {  321,    0 }, /* (373) alias_opt ::= */
  {  321,   -1 }, /* (374) alias_opt ::= table_alias */
  {  321,   -2 }, /* (375) alias_opt ::= AS table_alias */
  {  322,   -3 }, /* (376) parenthesized_joined_table ::= NK_LP joined_table NK_RP */
  {  322,   -3 }, /* (377) parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */
  {  320,   -6 }, /* (378) joined_table ::= table_reference join_type JOIN table_reference ON search_condition */
  {  323,    0 }, /* (379) join_type ::= */
  {  323,   -1 }, /* (380) join_type ::= INNER */
  {  325,   -9 }, /* (381) query_specification ::= SELECT set_quantifier_opt select_list from_clause where_clause_opt partition_by_clause_opt twindow_clause_opt group_by_clause_opt having_clause_opt */
  {  326,    0 }, /* (382) set_quantifier_opt ::= */
  {  326,   -1 }, /* (383) set_quantifier_opt ::= DISTINCT */
  {  326,   -1 }, /* (384) set_quantifier_opt ::= ALL */
  {  327,   -1 }, /* (385) select_list ::= NK_STAR */
  {  327,   -1 }, /* (386) select_list ::= select_sublist */
  {  333,   -1 }, /* (387) select_sublist ::= select_item */
  {  333,   -3 }, /* (388) select_sublist ::= select_sublist NK_COMMA select_item */
  {  334,   -1 }, /* (389) select_item ::= common_expression */
  {  334,   -2 }, /* (390) select_item ::= common_expression column_alias */
  {  334,   -3 }, /* (391) select_item ::= common_expression AS column_alias */
  {  334,   -3 }, /* (392) select_item ::= table_name NK_DOT NK_STAR */
  {  328,    0 }, /* (393) where_clause_opt ::= */
  {  328,   -2 }, /* (394) where_clause_opt ::= WHERE search_condition */
  {  329,    0 }, /* (395) partition_by_clause_opt ::= */
  {  329,   -3 }, /* (396) partition_by_clause_opt ::= PARTITION BY expression_list */
  {  330,    0 }, /* (397) twindow_clause_opt ::= */
  {  330,   -6 }, /* (398) twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP */
  {  330,   -4 }, /* (399) twindow_clause_opt ::= STATE_WINDOW NK_LP expression NK_RP */
  {  330,   -6 }, /* (400) twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt */
  {  330,   -8 }, /* (401) twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt */
  {  280,    0 }, /* (402) sliding_opt ::= */
  {  280,   -4 }, /* (403) sliding_opt ::= SLIDING NK_LP duration_literal NK_RP */
  {  335,    0 }, /* (404) fill_opt ::= */
  {  335,   -4 }, /* (405) fill_opt ::= FILL NK_LP fill_mode NK_RP */
  {  335,   -6 }, /* (406) fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP */
  {  336,   -1 }, /* (407) fill_mode ::= NONE */
  {  336,   -1 }, /* (408) fill_mode ::= PREV */
  {  336,   -1 }, /* (409) fill_mode ::= NULL */
  {  336,   -1 }, /* (410) fill_mode ::= LINEAR */
  {  336,   -1 }, /* (411) fill_mode ::= NEXT */
  {  331,    0 }, /* (412) group_by_clause_opt ::= */
  {  331,   -3 }, /* (413) group_by_clause_opt ::= GROUP BY group_by_list */
  {  337,   -1 }, /* (414) group_by_list ::= expression */
  {  337,   -3 }, /* (415) group_by_list ::= group_by_list NK_COMMA expression */
  {  332,    0 }, /* (416) having_clause_opt ::= */
  {  332,   -2 }, /* (417) having_clause_opt ::= HAVING search_condition */
  {  285,   -4 }, /* (418) query_expression ::= query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt */
  {  338,   -1 }, /* (419) query_expression_body ::= query_primary */
  {  338,   -4 }, /* (420) query_expression_body ::= query_expression_body UNION ALL query_expression_body */
  {  338,   -3 }, /* (421) query_expression_body ::= query_expression_body UNION query_expression_body */
  {  342,   -1 }, /* (422) query_primary ::= query_specification */
  {  339,    0 }, /* (423) order_by_clause_opt ::= */
  {  339,   -3 }, /* (424) order_by_clause_opt ::= ORDER BY sort_specification_list */
  {  340,    0 }, /* (425) slimit_clause_opt ::= */
  {  340,   -2 }, /* (426) slimit_clause_opt ::= SLIMIT NK_INTEGER */
  {  340,   -4 }, /* (427) slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */
  {  340,   -4 }, /* (428) slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */
  {  341,    0 }, /* (429) limit_clause_opt ::= */
  {  341,   -2 }, /* (430) limit_clause_opt ::= LIMIT NK_INTEGER */
  {  341,   -4 }, /* (431) limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */
  {  341,   -4 }, /* (432) limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */
  {  303,   -3 }, /* (433) subquery ::= NK_LP query_expression NK_RP */
  {  324,   -1 }, /* (434) search_condition ::= common_expression */
  {  343,   -1 }, /* (435) sort_specification_list ::= sort_specification */
  {  343,   -3 }, /* (436) sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */
  {  344,   -3 }, /* (437) sort_specification ::= expression ordering_specification_opt null_ordering_opt */
  {  345,    0 }, /* (438) ordering_specification_opt ::= */
  {  345,   -1 }, /* (439) ordering_specification_opt ::= ASC */
  {  345,   -1 }, /* (440) ordering_specification_opt ::= DESC */
  {  346,    0 }, /* (441) null_ordering_opt ::= */
  {  346,   -2 }, /* (442) null_ordering_opt ::= NULLS FIRST */
  {  346,   -2 }, /* (443) null_ordering_opt ::= NULLS LAST */
2943 2944 2945 2946 2947 2948 2949 2950 2951 2952 2953 2954 2955 2956 2957 2958 2959 2960
};

static void yy_accept(yyParser*);  /* Forward Declaration */

/*
** Perform a reduce action and the shift that must immediately
** 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(
  yyParser *yypParser,         /* The parser */
  unsigned int yyruleno,       /* Number of the rule by which to reduce */
  int yyLookahead,             /* Lookahead token, or YYNOCODE if none */
X
Xiaoyu Wang 已提交
2961 2962
  ParseTOKENTYPE yyLookaheadToken  /* Value of the lookahead token */
  ParseCTX_PDECL                   /* %extra_context */
2963 2964 2965 2966 2967
){
  int yygoto;                     /* The next state */
  YYACTIONTYPE yyact;             /* The next action */
  yyStackEntry *yymsp;            /* The top of the parser's stack */
  int yysize;                     /* Amount to pop the stack */
X
Xiaoyu Wang 已提交
2968
  ParseARG_FETCH
2969 2970 2971 2972 2973
  (void)yyLookahead;
  (void)yyLookaheadToken;
  yymsp = yypParser->yytos;
#ifndef NDEBUG
  if( yyTraceFILE && yyruleno<(int)(sizeof(yyRuleName)/sizeof(yyRuleName[0])) ){
2974
    yysize = yyRuleInfo[yyruleno].nrhs;
2975
    if( yysize ){
2976
      fprintf(yyTraceFILE, "%sReduce %d [%s], go to state %d.\n",
2977
        yyTracePrompt,
2978
        yyruleno, yyRuleName[yyruleno], yymsp[yysize].stateno);
2979
    }else{
2980 2981
      fprintf(yyTraceFILE, "%sReduce %d [%s].\n",
        yyTracePrompt, yyruleno, yyRuleName[yyruleno]);
2982 2983 2984 2985 2986 2987 2988
    }
  }
#endif /* NDEBUG */

  /* Check that the stack is large enough to grow by a single entry
  ** if the RHS of the rule is empty.  This ensures that there is room
  ** enough on the stack to push the LHS value */
2989
  if( yyRuleInfo[yyruleno].nrhs==0 ){
2990 2991 2992 2993 2994 2995 2996 2997 2998 2999 3000 3001 3002 3003 3004 3005 3006 3007 3008 3009 3010 3011 3012 3013 3014 3015 3016 3017 3018 3019 3020 3021 3022 3023 3024 3025 3026 3027 3028
#ifdef YYTRACKMAXSTACKDEPTH
    if( (int)(yypParser->yytos - yypParser->yystack)>yypParser->yyhwm ){
      yypParser->yyhwm++;
      assert( yypParser->yyhwm == (int)(yypParser->yytos - yypParser->yystack));
    }
#endif
#if YYSTACKDEPTH>0 
    if( yypParser->yytos>=yypParser->yystackEnd ){
      yyStackOverflow(yypParser);
      /* The call to yyStackOverflow() above pops the stack until it is
      ** empty, causing the main parser loop to exit.  So the return value
      ** is never used and does not matter. */
      return 0;
    }
#else
    if( yypParser->yytos>=&yypParser->yystack[yypParser->yystksz-1] ){
      if( yyGrowStack(yypParser) ){
        yyStackOverflow(yypParser);
        /* The call to yyStackOverflow() above pops the stack until it is
        ** empty, causing the main parser loop to exit.  So the return value
        ** is never used and does not matter. */
        return 0;
      }
      yymsp = yypParser->yytos;
    }
#endif
  }

  switch( yyruleno ){
  /* Beginning here are the reduction cases.  A typical example
  ** follows:
  **   case 0:
  **  #line <lineno> <grammarfile>
  **     { ... }           // User supplied code
  **  #line <lineno> <thisfile>
  **     break;
  */
/********** Begin reduce actions **********************************************/
        YYMINORTYPE yylhsminor;
3029
      case 0: /* cmd ::= CREATE ACCOUNT NK_ID PASS NK_STRING account_options */
3030
{ pCxt->valid = false; generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_EXPRIE_STATEMENT); }
X
Xiaoyu Wang 已提交
3031
  yy_destructor(yypParser,232,&yymsp[0].minor);
3032
        break;
3033 3034
      case 1: /* cmd ::= ALTER ACCOUNT NK_ID alter_account_options */
{ pCxt->valid = false; generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_EXPRIE_STATEMENT); }
X
Xiaoyu Wang 已提交
3035
  yy_destructor(yypParser,233,&yymsp[0].minor);
3036 3037 3038 3039 3040 3041 3042 3043 3044 3045 3046 3047 3048
        break;
      case 2: /* account_options ::= */
{ }
        break;
      case 3: /* account_options ::= account_options PPS literal */
      case 4: /* account_options ::= account_options TSERIES literal */ yytestcase(yyruleno==4);
      case 5: /* account_options ::= account_options STORAGE literal */ yytestcase(yyruleno==5);
      case 6: /* account_options ::= account_options STREAMS literal */ yytestcase(yyruleno==6);
      case 7: /* account_options ::= account_options QTIME literal */ yytestcase(yyruleno==7);
      case 8: /* account_options ::= account_options DBS literal */ yytestcase(yyruleno==8);
      case 9: /* account_options ::= account_options USERS literal */ yytestcase(yyruleno==9);
      case 10: /* account_options ::= account_options CONNS literal */ yytestcase(yyruleno==10);
      case 11: /* account_options ::= account_options STATE literal */ yytestcase(yyruleno==11);
X
Xiaoyu Wang 已提交
3049
{  yy_destructor(yypParser,232,&yymsp[-2].minor);
3050
{ }
X
Xiaoyu Wang 已提交
3051
  yy_destructor(yypParser,234,&yymsp[0].minor);
3052
}
3053
        break;
3054
      case 12: /* alter_account_options ::= alter_account_option */
X
Xiaoyu Wang 已提交
3055
{  yy_destructor(yypParser,235,&yymsp[0].minor);
3056 3057 3058
{ }
}
        break;
3059
      case 13: /* alter_account_options ::= alter_account_options alter_account_option */
X
Xiaoyu Wang 已提交
3060
{  yy_destructor(yypParser,233,&yymsp[-1].minor);
3061
{ }
X
Xiaoyu Wang 已提交
3062
  yy_destructor(yypParser,235,&yymsp[0].minor);
3063 3064 3065 3066 3067 3068 3069 3070 3071 3072 3073 3074
}
        break;
      case 14: /* alter_account_option ::= PASS literal */
      case 15: /* alter_account_option ::= PPS literal */ yytestcase(yyruleno==15);
      case 16: /* alter_account_option ::= TSERIES literal */ yytestcase(yyruleno==16);
      case 17: /* alter_account_option ::= STORAGE literal */ yytestcase(yyruleno==17);
      case 18: /* alter_account_option ::= STREAMS literal */ yytestcase(yyruleno==18);
      case 19: /* alter_account_option ::= QTIME literal */ yytestcase(yyruleno==19);
      case 20: /* alter_account_option ::= DBS literal */ yytestcase(yyruleno==20);
      case 21: /* alter_account_option ::= USERS literal */ yytestcase(yyruleno==21);
      case 22: /* alter_account_option ::= CONNS literal */ yytestcase(yyruleno==22);
      case 23: /* alter_account_option ::= STATE literal */ yytestcase(yyruleno==23);
3075
{ }
X
Xiaoyu Wang 已提交
3076
  yy_destructor(yypParser,234,&yymsp[0].minor);
3077
        break;
3078
      case 24: /* cmd ::= CREATE USER user_name PASS NK_STRING */
3079
{ pCxt->pRootNode = createCreateUserStmt(pCxt, &yymsp[-2].minor.yy555, &yymsp[0].minor.yy0); }
3080
        break;
3081
      case 25: /* cmd ::= ALTER USER user_name PASS NK_STRING */
3082
{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy555, TSDB_ALTER_USER_PASSWD, &yymsp[0].minor.yy0); }
3083
        break;
3084
      case 26: /* cmd ::= ALTER USER user_name PRIVILEGE NK_STRING */
3085
{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy555, TSDB_ALTER_USER_PRIVILEGES, &yymsp[0].minor.yy0); }
3086
        break;
3087
      case 27: /* cmd ::= DROP USER user_name */
3088
{ pCxt->pRootNode = createDropUserStmt(pCxt, &yymsp[0].minor.yy555); }
3089
        break;
X
Xiaoyu Wang 已提交
3090
      case 28: /* cmd ::= CREATE DNODE dnode_endpoint */
3091
{ pCxt->pRootNode = createCreateDnodeStmt(pCxt, &yymsp[0].minor.yy555, NULL); }
3092
        break;
X
Xiaoyu Wang 已提交
3093
      case 29: /* cmd ::= CREATE DNODE dnode_host_name PORT NK_INTEGER */
3094
{ pCxt->pRootNode = createCreateDnodeStmt(pCxt, &yymsp[-2].minor.yy555, &yymsp[0].minor.yy0); }
3095
        break;
X
Xiaoyu Wang 已提交
3096
      case 30: /* cmd ::= DROP DNODE NK_INTEGER */
3097
{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[0].minor.yy0); }
3098
        break;
X
Xiaoyu Wang 已提交
3099
      case 31: /* cmd ::= DROP DNODE dnode_endpoint */
3100
{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[0].minor.yy555); }
3101
        break;
X
Xiaoyu Wang 已提交
3102
      case 32: /* cmd ::= ALTER DNODE NK_INTEGER NK_STRING */
3103 3104
{ pCxt->pRootNode = createAlterDnodeStmt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0, NULL); }
        break;
X
Xiaoyu Wang 已提交
3105
      case 33: /* cmd ::= ALTER DNODE NK_INTEGER NK_STRING NK_STRING */
3106 3107
{ pCxt->pRootNode = createAlterDnodeStmt(pCxt, &yymsp[-2].minor.yy0, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0); }
        break;
X
Xiaoyu Wang 已提交
3108
      case 34: /* cmd ::= ALTER ALL DNODES NK_STRING */
3109 3110
{ pCxt->pRootNode = createAlterDnodeStmt(pCxt, NULL, &yymsp[0].minor.yy0, NULL); }
        break;
X
Xiaoyu Wang 已提交
3111
      case 35: /* cmd ::= ALTER ALL DNODES NK_STRING NK_STRING */
3112 3113
{ pCxt->pRootNode = createAlterDnodeStmt(pCxt, NULL, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0); }
        break;
X
Xiaoyu Wang 已提交
3114 3115 3116
      case 36: /* dnode_endpoint ::= NK_STRING */
      case 37: /* dnode_host_name ::= NK_ID */ yytestcase(yyruleno==37);
      case 38: /* dnode_host_name ::= NK_IPTOKEN */ yytestcase(yyruleno==38);
3117 3118 3119 3120 3121 3122 3123 3124 3125 3126 3127 3128 3129 3130 3131 3132 3133 3134 3135
      case 282: /* db_name ::= NK_ID */ yytestcase(yyruleno==282);
      case 283: /* table_name ::= NK_ID */ yytestcase(yyruleno==283);
      case 284: /* column_name ::= NK_ID */ yytestcase(yyruleno==284);
      case 285: /* function_name ::= NK_ID */ yytestcase(yyruleno==285);
      case 286: /* table_alias ::= NK_ID */ yytestcase(yyruleno==286);
      case 287: /* column_alias ::= NK_ID */ yytestcase(yyruleno==287);
      case 288: /* user_name ::= NK_ID */ yytestcase(yyruleno==288);
      case 289: /* index_name ::= NK_ID */ yytestcase(yyruleno==289);
      case 290: /* topic_name ::= NK_ID */ yytestcase(yyruleno==290);
      case 291: /* stream_name ::= NK_ID */ yytestcase(yyruleno==291);
      case 323: /* noarg_func ::= NOW */ yytestcase(yyruleno==323);
      case 324: /* noarg_func ::= TODAY */ yytestcase(yyruleno==324);
      case 325: /* noarg_func ::= TIMEZONE */ yytestcase(yyruleno==325);
      case 326: /* star_func ::= COUNT */ yytestcase(yyruleno==326);
      case 327: /* star_func ::= FIRST */ yytestcase(yyruleno==327);
      case 328: /* star_func ::= LAST */ yytestcase(yyruleno==328);
      case 329: /* star_func ::= LAST_ROW */ yytestcase(yyruleno==329);
{ yylhsminor.yy555 = yymsp[0].minor.yy0; }
  yymsp[0].minor.yy555 = yylhsminor.yy555;
X
Xiaoyu Wang 已提交
3136 3137
        break;
      case 39: /* cmd ::= ALTER LOCAL NK_STRING */
3138 3139
{ pCxt->pRootNode = createAlterLocalStmt(pCxt, &yymsp[0].minor.yy0, NULL); }
        break;
X
Xiaoyu Wang 已提交
3140
      case 40: /* cmd ::= ALTER LOCAL NK_STRING NK_STRING */
3141 3142
{ pCxt->pRootNode = createAlterLocalStmt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0); }
        break;
X
Xiaoyu Wang 已提交
3143
      case 41: /* cmd ::= CREATE QNODE ON DNODE NK_INTEGER */
3144
{ pCxt->pRootNode = createCreateComponentNodeStmt(pCxt, QUERY_NODE_CREATE_QNODE_STMT, &yymsp[0].minor.yy0); }
X
Xiaoyu Wang 已提交
3145
        break;
X
Xiaoyu Wang 已提交
3146
      case 42: /* cmd ::= DROP QNODE ON DNODE NK_INTEGER */
3147
{ pCxt->pRootNode = createDropComponentNodeStmt(pCxt, QUERY_NODE_DROP_QNODE_STMT, &yymsp[0].minor.yy0); }
3148
        break;
3149 3150
      case 43: /* cmd ::= CREATE BNODE ON DNODE NK_INTEGER */
{ pCxt->pRootNode = createCreateComponentNodeStmt(pCxt, QUERY_NODE_CREATE_BNODE_STMT, &yymsp[0].minor.yy0); }
X
Xiaoyu Wang 已提交
3151
        break;
3152 3153
      case 44: /* cmd ::= DROP BNODE ON DNODE NK_INTEGER */
{ pCxt->pRootNode = createDropComponentNodeStmt(pCxt, QUERY_NODE_DROP_BNODE_STMT, &yymsp[0].minor.yy0); }
X
Xiaoyu Wang 已提交
3154
        break;
3155 3156
      case 45: /* cmd ::= CREATE SNODE ON DNODE NK_INTEGER */
{ pCxt->pRootNode = createCreateComponentNodeStmt(pCxt, QUERY_NODE_CREATE_SNODE_STMT, &yymsp[0].minor.yy0); }
3157
        break;
3158 3159
      case 46: /* cmd ::= DROP SNODE ON DNODE NK_INTEGER */
{ pCxt->pRootNode = createDropComponentNodeStmt(pCxt, QUERY_NODE_DROP_SNODE_STMT, &yymsp[0].minor.yy0); }
3160
        break;
3161 3162
      case 47: /* cmd ::= CREATE MNODE ON DNODE NK_INTEGER */
{ pCxt->pRootNode = createCreateComponentNodeStmt(pCxt, QUERY_NODE_CREATE_MNODE_STMT, &yymsp[0].minor.yy0); }
3163
        break;
3164 3165
      case 48: /* cmd ::= DROP MNODE ON DNODE NK_INTEGER */
{ pCxt->pRootNode = createDropComponentNodeStmt(pCxt, QUERY_NODE_DROP_MNODE_STMT, &yymsp[0].minor.yy0); }
3166
        break;
3167
      case 49: /* cmd ::= CREATE DATABASE not_exists_opt db_name db_options */
3168
{ pCxt->pRootNode = createCreateDatabaseStmt(pCxt, yymsp[-2].minor.yy617, &yymsp[-1].minor.yy555, yymsp[0].minor.yy662); }
3169
        break;
3170
      case 50: /* cmd ::= DROP DATABASE exists_opt db_name */
3171
{ pCxt->pRootNode = createDropDatabaseStmt(pCxt, yymsp[-1].minor.yy617, &yymsp[0].minor.yy555); }
3172
        break;
3173
      case 51: /* cmd ::= USE db_name */
3174
{ pCxt->pRootNode = createUseDatabaseStmt(pCxt, &yymsp[0].minor.yy555); }
3175
        break;
3176
      case 52: /* cmd ::= ALTER DATABASE db_name alter_db_options */
3177
{ pCxt->pRootNode = createAlterDatabaseStmt(pCxt, &yymsp[-1].minor.yy555, yymsp[0].minor.yy662); }
3178
        break;
3179
      case 53: /* not_exists_opt ::= IF NOT EXISTS */
3180
{ yymsp[-2].minor.yy617 = true; }
3181
        break;
3182 3183
      case 54: /* not_exists_opt ::= */
      case 56: /* exists_opt ::= */ yytestcase(yyruleno==56);
X
Xiaoyu Wang 已提交
3184 3185
      case 229: /* analyze_opt ::= */ yytestcase(yyruleno==229);
      case 237: /* agg_func_opt ::= */ yytestcase(yyruleno==237);
3186 3187
      case 382: /* set_quantifier_opt ::= */ yytestcase(yyruleno==382);
{ yymsp[1].minor.yy617 = false; }
3188
        break;
3189
      case 55: /* exists_opt ::= IF EXISTS */
3190
{ yymsp[-1].minor.yy617 = true; }
X
Xiaoyu Wang 已提交
3191
        break;
3192
      case 57: /* db_options ::= */
3193
{ yymsp[1].minor.yy662 = createDatabaseOptions(pCxt); }
3194
        break;
3195
      case 58: /* db_options ::= db_options BLOCKS NK_INTEGER */
3196 3197
{ ((SDatabaseOptions*)yymsp[-2].minor.yy662)->pNumOfBlocks = (SValueNode*)createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); yylhsminor.yy662 = yymsp[-2].minor.yy662; }
  yymsp[-2].minor.yy662 = yylhsminor.yy662;
3198
        break;
3199
      case 59: /* db_options ::= db_options CACHE NK_INTEGER */
3200 3201
{ ((SDatabaseOptions*)yymsp[-2].minor.yy662)->pCacheBlockSize = (SValueNode*)createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); yylhsminor.yy662 = yymsp[-2].minor.yy662; }
  yymsp[-2].minor.yy662 = yylhsminor.yy662;
X
Xiaoyu Wang 已提交
3202
        break;
3203
      case 60: /* db_options ::= db_options CACHELAST NK_INTEGER */
3204 3205
{ ((SDatabaseOptions*)yymsp[-2].minor.yy662)->pCachelast = (SValueNode*)createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); yylhsminor.yy662 = yymsp[-2].minor.yy662; }
  yymsp[-2].minor.yy662 = yylhsminor.yy662;
X
Xiaoyu Wang 已提交
3206
        break;
3207
      case 61: /* db_options ::= db_options COMP NK_INTEGER */
3208 3209
{ ((SDatabaseOptions*)yymsp[-2].minor.yy662)->pCompressionLevel = (SValueNode*)createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); yylhsminor.yy662 = yymsp[-2].minor.yy662; }
  yymsp[-2].minor.yy662 = yylhsminor.yy662;
X
Xiaoyu Wang 已提交
3210
        break;
3211
      case 62: /* db_options ::= db_options DAYS NK_INTEGER */
3212 3213
{ ((SDatabaseOptions*)yymsp[-2].minor.yy662)->pDaysPerFile = (SValueNode*)createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); yylhsminor.yy662 = yymsp[-2].minor.yy662; }
  yymsp[-2].minor.yy662 = yylhsminor.yy662;
X
Xiaoyu Wang 已提交
3214
        break;
3215
      case 63: /* db_options ::= db_options DAYS NK_VARIABLE */
3216 3217
{ ((SDatabaseOptions*)yymsp[-2].minor.yy662)->pDaysPerFile = (SValueNode*)createDurationValueNode(pCxt, &yymsp[0].minor.yy0); yylhsminor.yy662 = yymsp[-2].minor.yy662; }
  yymsp[-2].minor.yy662 = yylhsminor.yy662;
X
Xiaoyu Wang 已提交
3218
        break;
3219
      case 64: /* db_options ::= db_options FSYNC NK_INTEGER */
3220 3221
{ ((SDatabaseOptions*)yymsp[-2].minor.yy662)->pFsyncPeriod = (SValueNode*)createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); yylhsminor.yy662 = yymsp[-2].minor.yy662; }
  yymsp[-2].minor.yy662 = yylhsminor.yy662;
X
Xiaoyu Wang 已提交
3222
        break;
3223
      case 65: /* db_options ::= db_options MAXROWS NK_INTEGER */
3224 3225
{ ((SDatabaseOptions*)yymsp[-2].minor.yy662)->pMaxRowsPerBlock = (SValueNode*)createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); yylhsminor.yy662 = yymsp[-2].minor.yy662; }
  yymsp[-2].minor.yy662 = yylhsminor.yy662;
X
Xiaoyu Wang 已提交
3226
        break;
3227
      case 66: /* db_options ::= db_options MINROWS NK_INTEGER */
3228 3229
{ ((SDatabaseOptions*)yymsp[-2].minor.yy662)->pMinRowsPerBlock = (SValueNode*)createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); yylhsminor.yy662 = yymsp[-2].minor.yy662; }
  yymsp[-2].minor.yy662 = yylhsminor.yy662;
X
Xiaoyu Wang 已提交
3230
        break;
3231 3232
      case 67: /* db_options ::= db_options KEEP integer_list */
      case 68: /* db_options ::= db_options KEEP variable_list */ yytestcase(yyruleno==68);
3233 3234
{ ((SDatabaseOptions*)yymsp[-2].minor.yy662)->pKeep = yymsp[0].minor.yy568; yylhsminor.yy662 = yymsp[-2].minor.yy662; }
  yymsp[-2].minor.yy662 = yylhsminor.yy662;
X
Xiaoyu Wang 已提交
3235
        break;
3236
      case 69: /* db_options ::= db_options PRECISION NK_STRING */
3237 3238
{ ((SDatabaseOptions*)yymsp[-2].minor.yy662)->pPrecision = (SValueNode*)createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0); yylhsminor.yy662 = yymsp[-2].minor.yy662; }
  yymsp[-2].minor.yy662 = yylhsminor.yy662;
3239
        break;
3240
      case 70: /* db_options ::= db_options QUORUM NK_INTEGER */
3241 3242
{ ((SDatabaseOptions*)yymsp[-2].minor.yy662)->pQuorum = (SValueNode*)createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); yylhsminor.yy662 = yymsp[-2].minor.yy662; }
  yymsp[-2].minor.yy662 = yylhsminor.yy662;
3243
        break;
3244
      case 71: /* db_options ::= db_options REPLICA NK_INTEGER */
3245 3246
{ ((SDatabaseOptions*)yymsp[-2].minor.yy662)->pReplica = (SValueNode*)createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); yylhsminor.yy662 = yymsp[-2].minor.yy662; }
  yymsp[-2].minor.yy662 = yylhsminor.yy662;
3247
        break;
3248
      case 72: /* db_options ::= db_options TTL NK_INTEGER */
3249 3250
{ ((SDatabaseOptions*)yymsp[-2].minor.yy662)->pTtl = (SValueNode*)createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); yylhsminor.yy662 = yymsp[-2].minor.yy662; }
  yymsp[-2].minor.yy662 = yylhsminor.yy662;
3251
        break;
3252
      case 73: /* db_options ::= db_options WAL NK_INTEGER */
3253 3254
{ ((SDatabaseOptions*)yymsp[-2].minor.yy662)->pWalLevel = (SValueNode*)createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); yylhsminor.yy662 = yymsp[-2].minor.yy662; }
  yymsp[-2].minor.yy662 = yylhsminor.yy662;
3255 3256
        break;
      case 74: /* db_options ::= db_options VGROUPS NK_INTEGER */
3257 3258
{ ((SDatabaseOptions*)yymsp[-2].minor.yy662)->pNumOfVgroups = (SValueNode*)createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); yylhsminor.yy662 = yymsp[-2].minor.yy662; }
  yymsp[-2].minor.yy662 = yylhsminor.yy662;
3259
        break;
3260
      case 75: /* db_options ::= db_options SINGLE_STABLE NK_INTEGER */
3261 3262
{ ((SDatabaseOptions*)yymsp[-2].minor.yy662)->pSingleStable = (SValueNode*)createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); yylhsminor.yy662 = yymsp[-2].minor.yy662; }
  yymsp[-2].minor.yy662 = yylhsminor.yy662;
3263 3264
        break;
      case 76: /* db_options ::= db_options STREAM_MODE NK_INTEGER */
3265 3266
{ ((SDatabaseOptions*)yymsp[-2].minor.yy662)->pStreamMode = (SValueNode*)createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); yylhsminor.yy662 = yymsp[-2].minor.yy662; }
  yymsp[-2].minor.yy662 = yylhsminor.yy662;
3267 3268
        break;
      case 77: /* db_options ::= db_options RETENTIONS retention_list */
3269 3270
{ ((SDatabaseOptions*)yymsp[-2].minor.yy662)->pRetentions = yymsp[0].minor.yy568; yylhsminor.yy662 = yymsp[-2].minor.yy662; }
  yymsp[-2].minor.yy662 = yylhsminor.yy662;
3271 3272
        break;
      case 78: /* db_options ::= db_options STRICT NK_INTEGER */
3273 3274
{ ((SDatabaseOptions*)yymsp[-2].minor.yy662)->pStrict = (SValueNode*)createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); yylhsminor.yy662 = yymsp[-2].minor.yy662; }
  yymsp[-2].minor.yy662 = yylhsminor.yy662;
3275 3276
        break;
      case 79: /* alter_db_options ::= alter_db_option */
3277 3278
{ yylhsminor.yy662 = createDatabaseOptions(pCxt); yylhsminor.yy662 = setDatabaseAlterOption(pCxt, yylhsminor.yy662, &yymsp[0].minor.yy475); }
  yymsp[0].minor.yy662 = yylhsminor.yy662;
3279 3280
        break;
      case 80: /* alter_db_options ::= alter_db_options alter_db_option */
3281 3282
{ yylhsminor.yy662 = setDatabaseAlterOption(pCxt, yymsp[-1].minor.yy662, &yymsp[0].minor.yy475); }
  yymsp[-1].minor.yy662 = yylhsminor.yy662;
3283 3284
        break;
      case 81: /* alter_db_option ::= BLOCKS NK_INTEGER */
3285
{ yymsp[-1].minor.yy475.type = DB_OPTION_BLOCKS; yymsp[-1].minor.yy475.pVal = (SValueNode*)createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); }
3286 3287
        break;
      case 82: /* alter_db_option ::= FSYNC NK_INTEGER */
3288
{ yymsp[-1].minor.yy475.type = DB_OPTION_FSYNC; yymsp[-1].minor.yy475.pVal = (SValueNode*)createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); }
3289 3290 3291
        break;
      case 83: /* alter_db_option ::= KEEP integer_list */
      case 84: /* alter_db_option ::= KEEP variable_list */ yytestcase(yyruleno==84);
3292
{ yymsp[-1].minor.yy475.type = DB_OPTION_KEEP; yymsp[-1].minor.yy475.pList = yymsp[0].minor.yy568; }
3293 3294
        break;
      case 85: /* alter_db_option ::= WAL NK_INTEGER */
3295
{ yymsp[-1].minor.yy475.type = DB_OPTION_WAL; yymsp[-1].minor.yy475.pVal = (SValueNode*)createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); }
3296 3297
        break;
      case 86: /* alter_db_option ::= QUORUM NK_INTEGER */
3298
{ yymsp[-1].minor.yy475.type = DB_OPTION_QUORUM; yymsp[-1].minor.yy475.pVal = (SValueNode*)createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); }
3299 3300
        break;
      case 87: /* alter_db_option ::= CACHELAST NK_INTEGER */
3301
{ yymsp[-1].minor.yy475.type = DB_OPTION_CACHELAST; yymsp[-1].minor.yy475.pVal = (SValueNode*)createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); }
3302 3303
        break;
      case 88: /* alter_db_option ::= REPLICA NK_INTEGER */
3304
{ yymsp[-1].minor.yy475.type = DB_OPTION_REPLICA; yymsp[-1].minor.yy475.pVal = (SValueNode*)createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); }
3305 3306
        break;
      case 89: /* alter_db_option ::= STRICT NK_INTEGER */
3307
{ yymsp[-1].minor.yy475.type = DB_OPTION_STRICT; yymsp[-1].minor.yy475.pVal = (SValueNode*)createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); }
3308 3309
        break;
      case 90: /* integer_list ::= NK_INTEGER */
3310 3311
{ yylhsminor.yy568 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); }
  yymsp[0].minor.yy568 = yylhsminor.yy568;
3312 3313
        break;
      case 91: /* integer_list ::= integer_list NK_COMMA NK_INTEGER */
X
Xiaoyu Wang 已提交
3314
      case 255: /* dnode_list ::= dnode_list DNODE NK_INTEGER */ yytestcase(yyruleno==255);
3315 3316
{ yylhsminor.yy568 = addNodeToList(pCxt, yymsp[-2].minor.yy568, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); }
  yymsp[-2].minor.yy568 = yylhsminor.yy568;
3317 3318
        break;
      case 92: /* variable_list ::= NK_VARIABLE */
3319 3320
{ yylhsminor.yy568 = createNodeList(pCxt, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); }
  yymsp[0].minor.yy568 = yylhsminor.yy568;
3321 3322
        break;
      case 93: /* variable_list ::= variable_list NK_COMMA NK_VARIABLE */
3323 3324
{ yylhsminor.yy568 = addNodeToList(pCxt, yymsp[-2].minor.yy568, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); }
  yymsp[-2].minor.yy568 = yylhsminor.yy568;
3325 3326 3327 3328 3329 3330
        break;
      case 94: /* retention_list ::= retention */
      case 114: /* multi_create_clause ::= create_subtable_clause */ yytestcase(yyruleno==114);
      case 117: /* multi_drop_clause ::= drop_table_clause */ yytestcase(yyruleno==117);
      case 124: /* column_def_list ::= column_def */ yytestcase(yyruleno==124);
      case 169: /* col_name_list ::= col_name */ yytestcase(yyruleno==169);
3331 3332
      case 206: /* func_name_list ::= func_name */ yytestcase(yyruleno==206);
      case 215: /* func_list ::= func */ yytestcase(yyruleno==215);
3333 3334 3335 3336 3337 3338
      case 280: /* literal_list ::= signed_literal */ yytestcase(yyruleno==280);
      case 332: /* other_para_list ::= star_func_para */ yytestcase(yyruleno==332);
      case 387: /* select_sublist ::= select_item */ yytestcase(yyruleno==387);
      case 435: /* sort_specification_list ::= sort_specification */ yytestcase(yyruleno==435);
{ yylhsminor.yy568 = createNodeList(pCxt, yymsp[0].minor.yy662); }
  yymsp[0].minor.yy568 = yylhsminor.yy568;
3339 3340 3341 3342
        break;
      case 95: /* retention_list ::= retention_list NK_COMMA retention */
      case 125: /* column_def_list ::= column_def_list NK_COMMA column_def */ yytestcase(yyruleno==125);
      case 170: /* col_name_list ::= col_name_list NK_COMMA col_name */ yytestcase(yyruleno==170);
3343 3344
      case 207: /* func_name_list ::= func_name_list NK_COMMA func_name */ yytestcase(yyruleno==207);
      case 216: /* func_list ::= func_list NK_COMMA func */ yytestcase(yyruleno==216);
3345 3346 3347 3348 3349 3350
      case 281: /* literal_list ::= literal_list NK_COMMA signed_literal */ yytestcase(yyruleno==281);
      case 333: /* other_para_list ::= other_para_list NK_COMMA star_func_para */ yytestcase(yyruleno==333);
      case 388: /* select_sublist ::= select_sublist NK_COMMA select_item */ yytestcase(yyruleno==388);
      case 436: /* sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ yytestcase(yyruleno==436);
{ yylhsminor.yy568 = addNodeToList(pCxt, yymsp[-2].minor.yy568, yymsp[0].minor.yy662); }
  yymsp[-2].minor.yy568 = yylhsminor.yy568;
3351 3352
        break;
      case 96: /* retention ::= NK_VARIABLE NK_COLON NK_VARIABLE */
3353 3354
{ yylhsminor.yy662 = createNodeListNodeEx(pCxt, createDurationValueNode(pCxt, &yymsp[-2].minor.yy0), createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); }
  yymsp[-2].minor.yy662 = yylhsminor.yy662;
3355 3356 3357
        break;
      case 97: /* cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options */
      case 99: /* cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options */ yytestcase(yyruleno==99);
3358
{ pCxt->pRootNode = createCreateTableStmt(pCxt, yymsp[-6].minor.yy617, yymsp[-5].minor.yy662, yymsp[-3].minor.yy568, yymsp[-1].minor.yy568, yymsp[0].minor.yy662); }
3359 3360
        break;
      case 98: /* cmd ::= CREATE TABLE multi_create_clause */
3361
{ pCxt->pRootNode = createCreateMultiTableStmt(pCxt, yymsp[0].minor.yy568); }
3362 3363
        break;
      case 100: /* cmd ::= DROP TABLE multi_drop_clause */
3364
{ pCxt->pRootNode = createDropTableStmt(pCxt, yymsp[0].minor.yy568); }
3365 3366
        break;
      case 101: /* cmd ::= DROP STABLE exists_opt full_table_name */
3367
{ pCxt->pRootNode = createDropSuperTableStmt(pCxt, yymsp[-1].minor.yy617, yymsp[0].minor.yy662); }
3368 3369 3370
        break;
      case 102: /* cmd ::= ALTER TABLE alter_table_clause */
      case 103: /* cmd ::= ALTER STABLE alter_table_clause */ yytestcase(yyruleno==103);
X
Xiaoyu Wang 已提交
3371
      case 257: /* cmd ::= query_expression */ yytestcase(yyruleno==257);
3372
{ pCxt->pRootNode = yymsp[0].minor.yy662; }
3373 3374
        break;
      case 104: /* alter_table_clause ::= full_table_name alter_table_options */
3375 3376
{ yylhsminor.yy662 = createAlterTableOption(pCxt, yymsp[-1].minor.yy662, yymsp[0].minor.yy662); }
  yymsp[-1].minor.yy662 = yylhsminor.yy662;
3377 3378
        break;
      case 105: /* alter_table_clause ::= full_table_name ADD COLUMN column_name type_name */
3379 3380
{ yylhsminor.yy662 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy662, TSDB_ALTER_TABLE_ADD_COLUMN, &yymsp[-1].minor.yy555, yymsp[0].minor.yy156); }
  yymsp[-4].minor.yy662 = yylhsminor.yy662;
3381 3382
        break;
      case 106: /* alter_table_clause ::= full_table_name DROP COLUMN column_name */
3383 3384
{ yylhsminor.yy662 = createAlterTableDropCol(pCxt, yymsp[-3].minor.yy662, TSDB_ALTER_TABLE_DROP_COLUMN, &yymsp[0].minor.yy555); }
  yymsp[-3].minor.yy662 = yylhsminor.yy662;
3385 3386
        break;
      case 107: /* alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name */
3387 3388
{ yylhsminor.yy662 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy662, TSDB_ALTER_TABLE_UPDATE_COLUMN_BYTES, &yymsp[-1].minor.yy555, yymsp[0].minor.yy156); }
  yymsp[-4].minor.yy662 = yylhsminor.yy662;
3389 3390
        break;
      case 108: /* alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name */
3391 3392
{ yylhsminor.yy662 = createAlterTableRenameCol(pCxt, yymsp[-4].minor.yy662, TSDB_ALTER_TABLE_UPDATE_COLUMN_NAME, &yymsp[-1].minor.yy555, &yymsp[0].minor.yy555); }
  yymsp[-4].minor.yy662 = yylhsminor.yy662;
3393
        break;
3394
      case 109: /* alter_table_clause ::= full_table_name ADD TAG column_name type_name */
3395 3396
{ yylhsminor.yy662 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy662, TSDB_ALTER_TABLE_ADD_TAG, &yymsp[-1].minor.yy555, yymsp[0].minor.yy156); }
  yymsp[-4].minor.yy662 = yylhsminor.yy662;
3397 3398
        break;
      case 110: /* alter_table_clause ::= full_table_name DROP TAG column_name */
3399 3400
{ yylhsminor.yy662 = createAlterTableDropCol(pCxt, yymsp[-3].minor.yy662, TSDB_ALTER_TABLE_DROP_TAG, &yymsp[0].minor.yy555); }
  yymsp[-3].minor.yy662 = yylhsminor.yy662;
3401
        break;
3402
      case 111: /* alter_table_clause ::= full_table_name MODIFY TAG column_name type_name */
3403 3404
{ yylhsminor.yy662 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy662, TSDB_ALTER_TABLE_UPDATE_TAG_BYTES, &yymsp[-1].minor.yy555, yymsp[0].minor.yy156); }
  yymsp[-4].minor.yy662 = yylhsminor.yy662;
3405
        break;
3406
      case 112: /* alter_table_clause ::= full_table_name RENAME TAG column_name column_name */
3407 3408
{ yylhsminor.yy662 = createAlterTableRenameCol(pCxt, yymsp[-4].minor.yy662, TSDB_ALTER_TABLE_UPDATE_TAG_NAME, &yymsp[-1].minor.yy555, &yymsp[0].minor.yy555); }
  yymsp[-4].minor.yy662 = yylhsminor.yy662;
3409 3410
        break;
      case 113: /* alter_table_clause ::= full_table_name SET TAG column_name NK_EQ literal */
3411 3412
{ yylhsminor.yy662 = createAlterTableSetTag(pCxt, yymsp[-5].minor.yy662, &yymsp[-2].minor.yy555, yymsp[0].minor.yy662); }
  yymsp[-5].minor.yy662 = yylhsminor.yy662;
3413
        break;
3414 3415
      case 115: /* multi_create_clause ::= multi_create_clause create_subtable_clause */
      case 118: /* multi_drop_clause ::= multi_drop_clause drop_table_clause */ yytestcase(yyruleno==118);
3416 3417
{ yylhsminor.yy568 = addNodeToList(pCxt, yymsp[-1].minor.yy568, yymsp[0].minor.yy662); }
  yymsp[-1].minor.yy568 = yylhsminor.yy568;
3418
        break;
3419
      case 116: /* create_subtable_clause ::= not_exists_opt full_table_name USING full_table_name specific_tags_opt TAGS NK_LP literal_list NK_RP */
3420 3421
{ yylhsminor.yy662 = createCreateSubTableClause(pCxt, yymsp[-8].minor.yy617, yymsp[-7].minor.yy662, yymsp[-5].minor.yy662, yymsp[-4].minor.yy568, yymsp[-1].minor.yy568); }
  yymsp[-8].minor.yy662 = yylhsminor.yy662;
3422
        break;
3423
      case 119: /* drop_table_clause ::= exists_opt full_table_name */
3424 3425
{ yylhsminor.yy662 = createDropTableClause(pCxt, yymsp[-1].minor.yy617, yymsp[0].minor.yy662); }
  yymsp[-1].minor.yy662 = yylhsminor.yy662;
3426
        break;
3427 3428
      case 120: /* specific_tags_opt ::= */
      case 151: /* tags_def_opt ::= */ yytestcase(yyruleno==151);
3429 3430 3431 3432
      case 395: /* partition_by_clause_opt ::= */ yytestcase(yyruleno==395);
      case 412: /* group_by_clause_opt ::= */ yytestcase(yyruleno==412);
      case 423: /* order_by_clause_opt ::= */ yytestcase(yyruleno==423);
{ yymsp[1].minor.yy568 = NULL; }
3433
        break;
3434
      case 121: /* specific_tags_opt ::= NK_LP col_name_list NK_RP */
3435
{ yymsp[-2].minor.yy568 = yymsp[-1].minor.yy568; }
3436
        break;
3437
      case 122: /* full_table_name ::= table_name */
3438 3439
{ yylhsminor.yy662 = createRealTableNode(pCxt, NULL, &yymsp[0].minor.yy555, NULL); }
  yymsp[0].minor.yy662 = yylhsminor.yy662;
3440
        break;
3441
      case 123: /* full_table_name ::= db_name NK_DOT table_name */
3442 3443
{ yylhsminor.yy662 = createRealTableNode(pCxt, &yymsp[-2].minor.yy555, &yymsp[0].minor.yy555, NULL); }
  yymsp[-2].minor.yy662 = yylhsminor.yy662;
3444
        break;
3445
      case 126: /* column_def ::= column_name type_name */
3446 3447
{ yylhsminor.yy662 = createColumnDefNode(pCxt, &yymsp[-1].minor.yy555, yymsp[0].minor.yy156, NULL); }
  yymsp[-1].minor.yy662 = yylhsminor.yy662;
3448
        break;
3449
      case 127: /* column_def ::= column_name type_name COMMENT NK_STRING */
3450 3451
{ yylhsminor.yy662 = createColumnDefNode(pCxt, &yymsp[-3].minor.yy555, yymsp[-2].minor.yy156, &yymsp[0].minor.yy0); }
  yymsp[-3].minor.yy662 = yylhsminor.yy662;
3452
        break;
3453
      case 128: /* type_name ::= BOOL */
3454
{ yymsp[0].minor.yy156 = createDataType(TSDB_DATA_TYPE_BOOL); }
3455
        break;
3456
      case 129: /* type_name ::= TINYINT */
3457
{ yymsp[0].minor.yy156 = createDataType(TSDB_DATA_TYPE_TINYINT); }
3458
        break;
3459
      case 130: /* type_name ::= SMALLINT */
3460
{ yymsp[0].minor.yy156 = createDataType(TSDB_DATA_TYPE_SMALLINT); }
3461
        break;
3462 3463
      case 131: /* type_name ::= INT */
      case 132: /* type_name ::= INTEGER */ yytestcase(yyruleno==132);
3464
{ yymsp[0].minor.yy156 = createDataType(TSDB_DATA_TYPE_INT); }
3465
        break;
3466
      case 133: /* type_name ::= BIGINT */
3467
{ yymsp[0].minor.yy156 = createDataType(TSDB_DATA_TYPE_BIGINT); }
3468
        break;
3469
      case 134: /* type_name ::= FLOAT */
3470
{ yymsp[0].minor.yy156 = createDataType(TSDB_DATA_TYPE_FLOAT); }
3471
        break;
3472
      case 135: /* type_name ::= DOUBLE */
3473
{ yymsp[0].minor.yy156 = createDataType(TSDB_DATA_TYPE_DOUBLE); }
3474
        break;
3475
      case 136: /* type_name ::= BINARY NK_LP NK_INTEGER NK_RP */
3476
{ yymsp[-3].minor.yy156 = createVarLenDataType(TSDB_DATA_TYPE_BINARY, &yymsp[-1].minor.yy0); }
3477
        break;
3478
      case 137: /* type_name ::= TIMESTAMP */
3479
{ yymsp[0].minor.yy156 = createDataType(TSDB_DATA_TYPE_TIMESTAMP); }
3480
        break;
3481
      case 138: /* type_name ::= NCHAR NK_LP NK_INTEGER NK_RP */
3482
{ yymsp[-3].minor.yy156 = createVarLenDataType(TSDB_DATA_TYPE_NCHAR, &yymsp[-1].minor.yy0); }
3483
        break;
3484
      case 139: /* type_name ::= TINYINT UNSIGNED */
3485
{ yymsp[-1].minor.yy156 = createDataType(TSDB_DATA_TYPE_UTINYINT); }
3486
        break;
3487
      case 140: /* type_name ::= SMALLINT UNSIGNED */
3488
{ yymsp[-1].minor.yy156 = createDataType(TSDB_DATA_TYPE_USMALLINT); }
3489
        break;
3490
      case 141: /* type_name ::= INT UNSIGNED */
3491
{ yymsp[-1].minor.yy156 = createDataType(TSDB_DATA_TYPE_UINT); }
3492
        break;
3493
      case 142: /* type_name ::= BIGINT UNSIGNED */
3494
{ yymsp[-1].minor.yy156 = createDataType(TSDB_DATA_TYPE_UBIGINT); }
3495
        break;
3496
      case 143: /* type_name ::= JSON */
3497
{ yymsp[0].minor.yy156 = createDataType(TSDB_DATA_TYPE_JSON); }
3498
        break;
3499
      case 144: /* type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP */
3500
{ yymsp[-3].minor.yy156 = createVarLenDataType(TSDB_DATA_TYPE_VARCHAR, &yymsp[-1].minor.yy0); }
3501
        break;
3502
      case 145: /* type_name ::= MEDIUMBLOB */
3503
{ yymsp[0].minor.yy156 = createDataType(TSDB_DATA_TYPE_MEDIUMBLOB); }
3504
        break;
3505
      case 146: /* type_name ::= BLOB */
3506
{ yymsp[0].minor.yy156 = createDataType(TSDB_DATA_TYPE_BLOB); }
3507
        break;
3508
      case 147: /* type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP */
3509
{ yymsp[-3].minor.yy156 = createVarLenDataType(TSDB_DATA_TYPE_VARBINARY, &yymsp[-1].minor.yy0); }
3510
        break;
3511
      case 148: /* type_name ::= DECIMAL */
3512
{ yymsp[0].minor.yy156 = createDataType(TSDB_DATA_TYPE_DECIMAL); }
3513
        break;
3514
      case 149: /* type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP */
3515
{ yymsp[-3].minor.yy156 = createDataType(TSDB_DATA_TYPE_DECIMAL); }
3516
        break;
3517
      case 150: /* type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */
3518
{ yymsp[-5].minor.yy156 = createDataType(TSDB_DATA_TYPE_DECIMAL); }
3519
        break;
3520
      case 152: /* tags_def_opt ::= tags_def */
3521 3522 3523 3524
      case 331: /* star_func_para_list ::= other_para_list */ yytestcase(yyruleno==331);
      case 386: /* select_list ::= select_sublist */ yytestcase(yyruleno==386);
{ yylhsminor.yy568 = yymsp[0].minor.yy568; }
  yymsp[0].minor.yy568 = yylhsminor.yy568;
3525
        break;
3526
      case 153: /* tags_def ::= TAGS NK_LP column_def_list NK_RP */
3527
{ yymsp[-3].minor.yy568 = yymsp[-1].minor.yy568; }
3528
        break;
3529
      case 154: /* table_options ::= */
3530
{ yymsp[1].minor.yy662 = createTableOptions(pCxt); }
3531
        break;
3532
      case 155: /* table_options ::= table_options COMMENT NK_STRING */
3533 3534
{ ((STableOptions*)yymsp[-2].minor.yy662)->pComments = (SValueNode*)createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0); yylhsminor.yy662 = yymsp[-2].minor.yy662; }
  yymsp[-2].minor.yy662 = yylhsminor.yy662;
3535
        break;
3536 3537
      case 156: /* table_options ::= table_options KEEP integer_list */
      case 157: /* table_options ::= table_options KEEP variable_list */ yytestcase(yyruleno==157);
3538 3539
{ ((STableOptions*)yymsp[-2].minor.yy662)->pKeep = yymsp[0].minor.yy568; yylhsminor.yy662 = yymsp[-2].minor.yy662; }
  yymsp[-2].minor.yy662 = yylhsminor.yy662;
3540
        break;
3541
      case 158: /* table_options ::= table_options TTL NK_INTEGER */
3542 3543
{ ((STableOptions*)yymsp[-2].minor.yy662)->pTtl = (SValueNode*)createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); yylhsminor.yy662 = yymsp[-2].minor.yy662; }
  yymsp[-2].minor.yy662 = yylhsminor.yy662;
3544
        break;
3545
      case 159: /* table_options ::= table_options SMA NK_LP col_name_list NK_RP */
3546 3547
{ ((STableOptions*)yymsp[-4].minor.yy662)->pSma = yymsp[-1].minor.yy568; yylhsminor.yy662 = yymsp[-4].minor.yy662; }
  yymsp[-4].minor.yy662 = yylhsminor.yy662;
3548
        break;
3549
      case 160: /* table_options ::= table_options ROLLUP NK_LP func_name_list NK_RP */
3550 3551
{ ((STableOptions*)yymsp[-4].minor.yy662)->pFuncs = yymsp[-1].minor.yy568; yylhsminor.yy662 = yymsp[-4].minor.yy662; }
  yymsp[-4].minor.yy662 = yylhsminor.yy662;
3552
        break;
3553
      case 161: /* table_options ::= table_options FILE_FACTOR NK_FLOAT */
3554 3555
{ ((STableOptions*)yymsp[-2].minor.yy662)->pFilesFactor = (SValueNode*)createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0); yylhsminor.yy662 = yymsp[-2].minor.yy662; }
  yymsp[-2].minor.yy662 = yylhsminor.yy662;
3556
        break;
3557
      case 162: /* table_options ::= table_options DELAY NK_INTEGER */
3558 3559
{ ((STableOptions*)yymsp[-2].minor.yy662)->pDelay = (SValueNode*)createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); yylhsminor.yy662 = yymsp[-2].minor.yy662; }
  yymsp[-2].minor.yy662 = yylhsminor.yy662;
3560
        break;
3561
      case 163: /* alter_table_options ::= alter_table_option */
3562 3563
{ yylhsminor.yy662 = createTableOptions(pCxt); yylhsminor.yy662 = setTableAlterOption(pCxt, yylhsminor.yy662, &yymsp[0].minor.yy475); }
  yymsp[0].minor.yy662 = yylhsminor.yy662;
3564
        break;
3565
      case 164: /* alter_table_options ::= alter_table_options alter_table_option */
3566 3567
{ yylhsminor.yy662 = setTableAlterOption(pCxt, yymsp[-1].minor.yy662, &yymsp[0].minor.yy475); }
  yymsp[-1].minor.yy662 = yylhsminor.yy662;
3568
        break;
3569
      case 165: /* alter_table_option ::= COMMENT NK_STRING */
3570
{ yymsp[-1].minor.yy475.type = TABLE_OPTION_COMMENT; yymsp[-1].minor.yy475.pVal = (SValueNode*)createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0); }
3571
        break;
3572 3573
      case 166: /* alter_table_option ::= KEEP integer_list */
      case 167: /* alter_table_option ::= KEEP variable_list */ yytestcase(yyruleno==167);
3574
{ yymsp[-1].minor.yy475.type = TABLE_OPTION_KEEP; yymsp[-1].minor.yy475.pList = yymsp[0].minor.yy568; }
3575
        break;
3576
      case 168: /* alter_table_option ::= TTL NK_INTEGER */
3577
{ yymsp[-1].minor.yy475.type = TABLE_OPTION_TTL; yymsp[-1].minor.yy475.pVal = (SValueNode*)createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); }
3578
        break;
3579
      case 171: /* col_name ::= column_name */
3580 3581
{ yylhsminor.yy662 = createColumnNode(pCxt, NULL, &yymsp[0].minor.yy555); }
  yymsp[0].minor.yy662 = yylhsminor.yy662;
3582
        break;
3583
      case 172: /* cmd ::= SHOW DNODES */
X
Xiaoyu Wang 已提交
3584
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_DNODES_STMT, NULL, NULL); }
3585
        break;
3586
      case 173: /* cmd ::= SHOW USERS */
X
Xiaoyu Wang 已提交
3587
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_USERS_STMT, NULL, NULL); }
3588
        break;
3589
      case 174: /* cmd ::= SHOW DATABASES */
X
Xiaoyu Wang 已提交
3590
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_DATABASES_STMT, NULL, NULL); }
3591
        break;
3592
      case 175: /* cmd ::= SHOW db_name_cond_opt TABLES like_pattern_opt */
3593
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_TABLES_STMT, yymsp[-2].minor.yy662, yymsp[0].minor.yy662); }
3594
        break;
3595
      case 176: /* cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt */
3596
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_STABLES_STMT, yymsp[-2].minor.yy662, yymsp[0].minor.yy662); }
3597
        break;
3598
      case 177: /* cmd ::= SHOW db_name_cond_opt VGROUPS */
3599
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_VGROUPS_STMT, yymsp[-1].minor.yy662, NULL); }
3600
        break;
3601
      case 178: /* cmd ::= SHOW MNODES */
X
Xiaoyu Wang 已提交
3602
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_MNODES_STMT, NULL, NULL); }
3603
        break;
3604
      case 179: /* cmd ::= SHOW MODULES */
X
Xiaoyu Wang 已提交
3605
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_MODULES_STMT, NULL, NULL); }
3606
        break;
3607
      case 180: /* cmd ::= SHOW QNODES */
X
Xiaoyu Wang 已提交
3608
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_QNODES_STMT, NULL, NULL); }
3609
        break;
3610
      case 181: /* cmd ::= SHOW FUNCTIONS */
X
Xiaoyu Wang 已提交
3611
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_FUNCTIONS_STMT, NULL, NULL); }
3612
        break;
3613
      case 182: /* cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt */
3614
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_INDEXES_STMT, yymsp[-1].minor.yy662, yymsp[0].minor.yy662); }
3615
        break;
3616
      case 183: /* cmd ::= SHOW STREAMS */
X
Xiaoyu Wang 已提交
3617
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_STREAMS_STMT, NULL, NULL); }
3618
        break;
3619
      case 184: /* cmd ::= SHOW ACCOUNTS */
3620 3621
{ pCxt->valid = false; generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_EXPRIE_STATEMENT); }
        break;
3622
      case 185: /* cmd ::= SHOW APPS */
3623
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_APPS_STMT, NULL, NULL); }
3624
        break;
3625
      case 186: /* cmd ::= SHOW CONNECTIONS */
3626 3627
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_CONNECTIONS_STMT, NULL, NULL); }
        break;
3628 3629
      case 187: /* cmd ::= SHOW LICENCE */
      case 188: /* cmd ::= SHOW GRANTS */ yytestcase(yyruleno==188);
3630 3631
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_LICENCE_STMT, NULL, NULL); }
        break;
3632
      case 189: /* cmd ::= SHOW CREATE DATABASE db_name */
3633
{ pCxt->pRootNode = createShowCreateDatabaseStmt(pCxt, &yymsp[0].minor.yy555); }
3634
        break;
3635
      case 190: /* cmd ::= SHOW CREATE TABLE full_table_name */
3636
{ pCxt->pRootNode = createShowCreateTableStmt(pCxt, QUERY_NODE_SHOW_CREATE_TABLE_STMT, yymsp[0].minor.yy662); }
3637
        break;
3638
      case 191: /* cmd ::= SHOW CREATE STABLE full_table_name */
3639
{ pCxt->pRootNode = createShowCreateTableStmt(pCxt, QUERY_NODE_SHOW_CREATE_STABLE_STMT, yymsp[0].minor.yy662); }
3640
        break;
3641
      case 192: /* cmd ::= SHOW QUERIES */
3642 3643
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_QUERIES_STMT, NULL, NULL); }
        break;
3644
      case 193: /* cmd ::= SHOW SCORES */
3645
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_SCORES_STMT, NULL, NULL); }
3646
        break;
3647
      case 194: /* cmd ::= SHOW TOPICS */
3648 3649
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_TOPICS_STMT, NULL, NULL); }
        break;
3650
      case 195: /* cmd ::= SHOW VARIABLES */
3651
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_VARIABLE_STMT, NULL, NULL); }
X
Xiaoyu Wang 已提交
3652
        break;
3653
      case 196: /* cmd ::= SHOW BNODES */
3654 3655
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_BNODES_STMT, NULL, NULL); }
        break;
3656
      case 197: /* cmd ::= SHOW SNODES */
3657 3658
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_SNODES_STMT, NULL, NULL); }
        break;
3659 3660 3661 3662 3663
      case 198: /* cmd ::= SHOW CLUSTER */
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_CLUSTER_STMT, NULL, NULL); }
        break;
      case 199: /* db_name_cond_opt ::= */
      case 204: /* from_db_opt ::= */ yytestcase(yyruleno==204);
3664
{ yymsp[1].minor.yy662 = createDefaultDatabaseCondValue(pCxt); }
X
Xiaoyu Wang 已提交
3665
        break;
3666
      case 200: /* db_name_cond_opt ::= db_name NK_DOT */
3667 3668
{ yylhsminor.yy662 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[-1].minor.yy555); }
  yymsp[-1].minor.yy662 = yylhsminor.yy662;
X
Xiaoyu Wang 已提交
3669
        break;
3670 3671
      case 201: /* like_pattern_opt ::= */
      case 212: /* index_options ::= */ yytestcase(yyruleno==212);
X
Xiaoyu Wang 已提交
3672
      case 243: /* into_opt ::= */ yytestcase(yyruleno==243);
3673 3674 3675 3676 3677 3678 3679 3680
      case 393: /* where_clause_opt ::= */ yytestcase(yyruleno==393);
      case 397: /* twindow_clause_opt ::= */ yytestcase(yyruleno==397);
      case 402: /* sliding_opt ::= */ yytestcase(yyruleno==402);
      case 404: /* fill_opt ::= */ yytestcase(yyruleno==404);
      case 416: /* having_clause_opt ::= */ yytestcase(yyruleno==416);
      case 425: /* slimit_clause_opt ::= */ yytestcase(yyruleno==425);
      case 429: /* limit_clause_opt ::= */ yytestcase(yyruleno==429);
{ yymsp[1].minor.yy662 = NULL; }
X
Xiaoyu Wang 已提交
3681
        break;
3682
      case 202: /* like_pattern_opt ::= LIKE NK_STRING */
3683
{ yymsp[-1].minor.yy662 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0); }
X
Xiaoyu Wang 已提交
3684
        break;
3685
      case 203: /* table_name_cond ::= table_name */
3686 3687
{ yylhsminor.yy662 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy555); }
  yymsp[0].minor.yy662 = yylhsminor.yy662;
X
Xiaoyu Wang 已提交
3688
        break;
3689
      case 205: /* from_db_opt ::= FROM db_name */
3690
{ yymsp[-1].minor.yy662 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy555); }
X
Xiaoyu Wang 已提交
3691
        break;
3692
      case 208: /* func_name ::= function_name */
3693 3694
{ yylhsminor.yy662 = createFunctionNode(pCxt, &yymsp[0].minor.yy555, NULL); }
  yymsp[0].minor.yy662 = yylhsminor.yy662;
X
Xiaoyu Wang 已提交
3695
        break;
3696
      case 209: /* cmd ::= CREATE SMA INDEX not_exists_opt index_name ON table_name index_options */
3697
{ pCxt->pRootNode = createCreateIndexStmt(pCxt, INDEX_TYPE_SMA, yymsp[-4].minor.yy617, &yymsp[-3].minor.yy555, &yymsp[-1].minor.yy555, NULL, yymsp[0].minor.yy662); }
X
Xiaoyu Wang 已提交
3698
        break;
3699
      case 210: /* cmd ::= CREATE FULLTEXT INDEX not_exists_opt index_name ON table_name NK_LP col_name_list NK_RP */
3700
{ pCxt->pRootNode = createCreateIndexStmt(pCxt, INDEX_TYPE_FULLTEXT, yymsp[-6].minor.yy617, &yymsp[-5].minor.yy555, &yymsp[-3].minor.yy555, yymsp[-1].minor.yy568, NULL); }
X
Xiaoyu Wang 已提交
3701
        break;
3702
      case 211: /* cmd ::= DROP INDEX exists_opt index_name ON table_name */
3703
{ pCxt->pRootNode = createDropIndexStmt(pCxt, yymsp[-3].minor.yy617, &yymsp[-2].minor.yy555, &yymsp[0].minor.yy555); }
X
Xiaoyu Wang 已提交
3704
        break;
3705
      case 213: /* index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt */
3706
{ yymsp[-8].minor.yy662 = createIndexOption(pCxt, yymsp[-6].minor.yy568, releaseRawExprNode(pCxt, yymsp[-2].minor.yy662), NULL, yymsp[0].minor.yy662); }
X
Xiaoyu Wang 已提交
3707
        break;
3708
      case 214: /* index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt */
3709
{ yymsp[-10].minor.yy662 = createIndexOption(pCxt, yymsp[-8].minor.yy568, releaseRawExprNode(pCxt, yymsp[-4].minor.yy662), releaseRawExprNode(pCxt, yymsp[-2].minor.yy662), yymsp[0].minor.yy662); }
X
Xiaoyu Wang 已提交
3710
        break;
3711
      case 217: /* func ::= function_name NK_LP expression_list NK_RP */
3712 3713
{ yylhsminor.yy662 = createFunctionNode(pCxt, &yymsp[-3].minor.yy555, yymsp[-1].minor.yy568); }
  yymsp[-3].minor.yy662 = yylhsminor.yy662;
X
Xiaoyu Wang 已提交
3714
        break;
X
Xiaoyu Wang 已提交
3715
      case 218: /* cmd ::= CREATE TOPIC not_exists_opt topic_name topic_options AS query_expression */
3716
{ pCxt->pRootNode = createCreateTopicStmt(pCxt, yymsp[-4].minor.yy617, &yymsp[-3].minor.yy555, yymsp[0].minor.yy662, NULL, yymsp[-2].minor.yy662); }
X
Xiaoyu Wang 已提交
3717
        break;
X
Xiaoyu Wang 已提交
3718
      case 219: /* cmd ::= CREATE TOPIC not_exists_opt topic_name topic_options AS db_name */
3719
{ pCxt->pRootNode = createCreateTopicStmt(pCxt, yymsp[-4].minor.yy617, &yymsp[-3].minor.yy555, NULL, &yymsp[0].minor.yy555, yymsp[-2].minor.yy662); }
3720
        break;
3721
      case 220: /* cmd ::= DROP TOPIC exists_opt topic_name */
3722
{ pCxt->pRootNode = createDropTopicStmt(pCxt, yymsp[-1].minor.yy617, &yymsp[0].minor.yy555); }
3723
        break;
X
Xiaoyu Wang 已提交
3724
      case 221: /* topic_options ::= */
3725
{ yymsp[1].minor.yy662 = createTopicOptions(pCxt); }
3726
        break;
X
Xiaoyu Wang 已提交
3727
      case 222: /* topic_options ::= topic_options WITH TABLE */
3728 3729
{ ((STopicOptions*)yymsp[-2].minor.yy662)->withTable = true; yylhsminor.yy662 = yymsp[-2].minor.yy662; }
  yymsp[-2].minor.yy662 = yylhsminor.yy662;
X
Xiaoyu Wang 已提交
3730 3731
        break;
      case 223: /* topic_options ::= topic_options WITH SCHEMA */
3732 3733
{ ((STopicOptions*)yymsp[-2].minor.yy662)->withSchema = true; yylhsminor.yy662 = yymsp[-2].minor.yy662; }
  yymsp[-2].minor.yy662 = yylhsminor.yy662;
X
Xiaoyu Wang 已提交
3734 3735
        break;
      case 224: /* topic_options ::= topic_options WITH TAG */
3736 3737
{ ((STopicOptions*)yymsp[-2].minor.yy662)->withTag = true; yylhsminor.yy662 = yymsp[-2].minor.yy662; }
  yymsp[-2].minor.yy662 = yylhsminor.yy662;
X
Xiaoyu Wang 已提交
3738 3739 3740
        break;
      case 225: /* cmd ::= DESC full_table_name */
      case 226: /* cmd ::= DESCRIBE full_table_name */ yytestcase(yyruleno==226);
3741
{ pCxt->pRootNode = createDescribeStmt(pCxt, yymsp[0].minor.yy662); }
X
Xiaoyu Wang 已提交
3742 3743
        break;
      case 227: /* cmd ::= RESET QUERY CACHE */
3744 3745
{ pCxt->pRootNode = createResetQueryCacheStmt(pCxt); }
        break;
X
Xiaoyu Wang 已提交
3746
      case 228: /* cmd ::= EXPLAIN analyze_opt explain_options query_expression */
3747
{ pCxt->pRootNode = createExplainStmt(pCxt, yymsp[-2].minor.yy617, yymsp[-1].minor.yy662, yymsp[0].minor.yy662); }
3748
        break;
X
Xiaoyu Wang 已提交
3749 3750
      case 230: /* analyze_opt ::= ANALYZE */
      case 238: /* agg_func_opt ::= AGGREGATE */ yytestcase(yyruleno==238);
3751 3752
      case 383: /* set_quantifier_opt ::= DISTINCT */ yytestcase(yyruleno==383);
{ yymsp[0].minor.yy617 = true; }
3753
        break;
X
Xiaoyu Wang 已提交
3754
      case 231: /* explain_options ::= */
3755
{ yymsp[1].minor.yy662 = createDefaultExplainOptions(pCxt); }
3756
        break;
X
Xiaoyu Wang 已提交
3757
      case 232: /* explain_options ::= explain_options VERBOSE NK_BOOL */
3758 3759
{ yylhsminor.yy662 = setExplainVerbose(pCxt, yymsp[-2].minor.yy662, &yymsp[0].minor.yy0); }
  yymsp[-2].minor.yy662 = yylhsminor.yy662;
3760
        break;
X
Xiaoyu Wang 已提交
3761
      case 233: /* explain_options ::= explain_options RATIO NK_FLOAT */
3762 3763
{ yylhsminor.yy662 = setExplainRatio(pCxt, yymsp[-2].minor.yy662, &yymsp[0].minor.yy0); }
  yymsp[-2].minor.yy662 = yylhsminor.yy662;
3764
        break;
X
Xiaoyu Wang 已提交
3765
      case 234: /* cmd ::= COMPACT VNODES IN NK_LP integer_list NK_RP */
3766
{ pCxt->pRootNode = createCompactStmt(pCxt, yymsp[-1].minor.yy568); }
3767
        break;
X
Xiaoyu Wang 已提交
3768
      case 235: /* cmd ::= CREATE agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt */
3769
{ pCxt->pRootNode = createCreateFunctionStmt(pCxt, yymsp[-6].minor.yy617, yymsp[-8].minor.yy617, &yymsp[-5].minor.yy555, &yymsp[-3].minor.yy0, yymsp[-1].minor.yy156, yymsp[0].minor.yy610); }
3770
        break;
X
Xiaoyu Wang 已提交
3771
      case 236: /* cmd ::= DROP FUNCTION function_name */
3772
{ pCxt->pRootNode = createDropFunctionStmt(pCxt, &yymsp[0].minor.yy555); }
3773
        break;
X
Xiaoyu Wang 已提交
3774
      case 239: /* bufsize_opt ::= */
3775
{ yymsp[1].minor.yy610 = 0; }
3776
        break;
X
Xiaoyu Wang 已提交
3777
      case 240: /* bufsize_opt ::= BUFSIZE NK_INTEGER */
3778
{ yymsp[-1].minor.yy610 = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
3779
        break;
X
Xiaoyu Wang 已提交
3780
      case 241: /* cmd ::= CREATE STREAM not_exists_opt stream_name stream_options into_opt AS query_expression */
3781
{ pCxt->pRootNode = createCreateStreamStmt(pCxt, yymsp[-5].minor.yy617, &yymsp[-4].minor.yy555, yymsp[-2].minor.yy662, yymsp[-3].minor.yy662, yymsp[0].minor.yy662); }
3782
        break;
X
Xiaoyu Wang 已提交
3783
      case 242: /* cmd ::= DROP STREAM exists_opt stream_name */
3784
{ pCxt->pRootNode = createDropStreamStmt(pCxt, yymsp[-1].minor.yy617, &yymsp[0].minor.yy555); }
3785
        break;
X
Xiaoyu Wang 已提交
3786
      case 244: /* into_opt ::= INTO full_table_name */
3787 3788 3789 3790
      case 364: /* from_clause ::= FROM table_reference_list */ yytestcase(yyruleno==364);
      case 394: /* where_clause_opt ::= WHERE search_condition */ yytestcase(yyruleno==394);
      case 417: /* having_clause_opt ::= HAVING search_condition */ yytestcase(yyruleno==417);
{ yymsp[-1].minor.yy662 = yymsp[0].minor.yy662; }
3791
        break;
X
Xiaoyu Wang 已提交
3792
      case 245: /* stream_options ::= */
3793
{ yymsp[1].minor.yy662 = createStreamOptions(pCxt); }
3794
        break;
X
Xiaoyu Wang 已提交
3795
      case 246: /* stream_options ::= stream_options TRIGGER AT_ONCE */
3796 3797
{ ((SStreamOptions*)yymsp[-2].minor.yy662)->triggerType = STREAM_TRIGGER_AT_ONCE; yylhsminor.yy662 = yymsp[-2].minor.yy662; }
  yymsp[-2].minor.yy662 = yylhsminor.yy662;
3798
        break;
X
Xiaoyu Wang 已提交
3799
      case 247: /* stream_options ::= stream_options TRIGGER WINDOW_CLOSE */
3800 3801
{ ((SStreamOptions*)yymsp[-2].minor.yy662)->triggerType = STREAM_TRIGGER_WINDOW_CLOSE; yylhsminor.yy662 = yymsp[-2].minor.yy662; }
  yymsp[-2].minor.yy662 = yylhsminor.yy662;
3802
        break;
X
Xiaoyu Wang 已提交
3803
      case 248: /* stream_options ::= stream_options WATERMARK duration_literal */
3804 3805
{ ((SStreamOptions*)yymsp[-2].minor.yy662)->pWatermark = releaseRawExprNode(pCxt, yymsp[0].minor.yy662); yylhsminor.yy662 = yymsp[-2].minor.yy662; }
  yymsp[-2].minor.yy662 = yylhsminor.yy662;
3806
        break;
X
Xiaoyu Wang 已提交
3807
      case 249: /* cmd ::= KILL CONNECTION NK_INTEGER */
3808 3809
{ pCxt->pRootNode = createKillStmt(pCxt, QUERY_NODE_KILL_CONNECTION_STMT, &yymsp[0].minor.yy0); }
        break;
X
Xiaoyu Wang 已提交
3810
      case 250: /* cmd ::= KILL QUERY NK_INTEGER */
3811 3812
{ pCxt->pRootNode = createKillStmt(pCxt, QUERY_NODE_KILL_QUERY_STMT, &yymsp[0].minor.yy0); }
        break;
X
Xiaoyu Wang 已提交
3813
      case 251: /* cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER */
3814 3815
{ pCxt->pRootNode = createMergeVgroupStmt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0); }
        break;
X
Xiaoyu Wang 已提交
3816
      case 252: /* cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list */
3817
{ pCxt->pRootNode = createRedistributeVgroupStmt(pCxt, &yymsp[-1].minor.yy0, yymsp[0].minor.yy568); }
3818
        break;
X
Xiaoyu Wang 已提交
3819
      case 253: /* cmd ::= SPLIT VGROUP NK_INTEGER */
3820 3821
{ pCxt->pRootNode = createSplitVgroupStmt(pCxt, &yymsp[0].minor.yy0); }
        break;
X
Xiaoyu Wang 已提交
3822
      case 254: /* dnode_list ::= DNODE NK_INTEGER */
3823
{ yymsp[-1].minor.yy568 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); }
X
Xiaoyu Wang 已提交
3824 3825
        break;
      case 256: /* cmd ::= SYNCDB db_name REPLICA */
3826
{ pCxt->pRootNode = createSyncdbStmt(pCxt, &yymsp[-1].minor.yy555); }
X
Xiaoyu Wang 已提交
3827 3828
        break;
      case 258: /* literal ::= NK_INTEGER */
3829 3830
{ yylhsminor.yy662 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); }
  yymsp[0].minor.yy662 = yylhsminor.yy662;
X
Xiaoyu Wang 已提交
3831 3832
        break;
      case 259: /* literal ::= NK_FLOAT */
3833 3834
{ yylhsminor.yy662 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0)); }
  yymsp[0].minor.yy662 = yylhsminor.yy662;
X
Xiaoyu Wang 已提交
3835 3836
        break;
      case 260: /* literal ::= NK_STRING */
3837 3838
{ yylhsminor.yy662 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0)); }
  yymsp[0].minor.yy662 = yylhsminor.yy662;
X
Xiaoyu Wang 已提交
3839 3840
        break;
      case 261: /* literal ::= NK_BOOL */
3841 3842
{ yylhsminor.yy662 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0)); }
  yymsp[0].minor.yy662 = yylhsminor.yy662;
X
Xiaoyu Wang 已提交
3843 3844
        break;
      case 262: /* literal ::= TIMESTAMP NK_STRING */
3845 3846
{ yylhsminor.yy662 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0)); }
  yymsp[-1].minor.yy662 = yylhsminor.yy662;
X
Xiaoyu Wang 已提交
3847 3848 3849
        break;
      case 263: /* literal ::= duration_literal */
      case 273: /* signed_literal ::= signed */ yytestcase(yyruleno==273);
3850 3851 3852 3853 3854 3855 3856 3857 3858 3859 3860 3861 3862 3863 3864 3865 3866 3867
      case 292: /* expression ::= literal */ yytestcase(yyruleno==292);
      case 293: /* expression ::= pseudo_column */ yytestcase(yyruleno==293);
      case 294: /* expression ::= column_reference */ yytestcase(yyruleno==294);
      case 295: /* expression ::= function_expression */ yytestcase(yyruleno==295);
      case 296: /* expression ::= subquery */ yytestcase(yyruleno==296);
      case 320: /* function_expression ::= literal_func */ yytestcase(yyruleno==320);
      case 356: /* boolean_value_expression ::= boolean_primary */ yytestcase(yyruleno==356);
      case 360: /* boolean_primary ::= predicate */ yytestcase(yyruleno==360);
      case 362: /* common_expression ::= expression */ yytestcase(yyruleno==362);
      case 363: /* common_expression ::= boolean_value_expression */ yytestcase(yyruleno==363);
      case 365: /* table_reference_list ::= table_reference */ yytestcase(yyruleno==365);
      case 367: /* table_reference ::= table_primary */ yytestcase(yyruleno==367);
      case 368: /* table_reference ::= joined_table */ yytestcase(yyruleno==368);
      case 372: /* table_primary ::= parenthesized_joined_table */ yytestcase(yyruleno==372);
      case 419: /* query_expression_body ::= query_primary */ yytestcase(yyruleno==419);
      case 422: /* query_primary ::= query_specification */ yytestcase(yyruleno==422);
{ yylhsminor.yy662 = yymsp[0].minor.yy662; }
  yymsp[0].minor.yy662 = yylhsminor.yy662;
X
Xiaoyu Wang 已提交
3868 3869
        break;
      case 264: /* literal ::= NULL */
3870 3871
{ yylhsminor.yy662 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_NULL, &yymsp[0].minor.yy0)); }
  yymsp[0].minor.yy662 = yylhsminor.yy662;
X
Xiaoyu Wang 已提交
3872 3873
        break;
      case 265: /* literal ::= NK_QUESTION */
3874 3875
{ yylhsminor.yy662 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createPlaceholderValueNode(pCxt, &yymsp[0].minor.yy0)); }
  yymsp[0].minor.yy662 = yylhsminor.yy662;
X
Xiaoyu Wang 已提交
3876 3877
        break;
      case 266: /* duration_literal ::= NK_VARIABLE */
3878 3879
{ yylhsminor.yy662 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); }
  yymsp[0].minor.yy662 = yylhsminor.yy662;
X
Xiaoyu Wang 已提交
3880 3881
        break;
      case 267: /* signed ::= NK_INTEGER */
3882 3883
{ yylhsminor.yy662 = createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); }
  yymsp[0].minor.yy662 = yylhsminor.yy662;
X
Xiaoyu Wang 已提交
3884 3885
        break;
      case 268: /* signed ::= NK_PLUS NK_INTEGER */
3886
{ yymsp[-1].minor.yy662 = createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); }
X
Xiaoyu Wang 已提交
3887 3888
        break;
      case 269: /* signed ::= NK_MINUS NK_INTEGER */
X
Xiaoyu Wang 已提交
3889 3890 3891
{ 
                                                                                    SToken t = yymsp[-1].minor.yy0;
                                                                                    t.n = (yymsp[0].minor.yy0.z + yymsp[0].minor.yy0.n) - yymsp[-1].minor.yy0.z;
3892
                                                                                    yylhsminor.yy662 = createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &t);
X
Xiaoyu Wang 已提交
3893
                                                                                  }
3894
  yymsp[-1].minor.yy662 = yylhsminor.yy662;
X
Xiaoyu Wang 已提交
3895
        break;
X
Xiaoyu Wang 已提交
3896
      case 270: /* signed ::= NK_FLOAT */
3897 3898
{ yylhsminor.yy662 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0); }
  yymsp[0].minor.yy662 = yylhsminor.yy662;
X
Xiaoyu Wang 已提交
3899
        break;
X
Xiaoyu Wang 已提交
3900
      case 271: /* signed ::= NK_PLUS NK_FLOAT */
3901
{ yymsp[-1].minor.yy662 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0); }
X
Xiaoyu Wang 已提交
3902
        break;
X
Xiaoyu Wang 已提交
3903
      case 272: /* signed ::= NK_MINUS NK_FLOAT */
X
Xiaoyu Wang 已提交
3904 3905 3906
{ 
                                                                                    SToken t = yymsp[-1].minor.yy0;
                                                                                    t.n = (yymsp[0].minor.yy0.z + yymsp[0].minor.yy0.n) - yymsp[-1].minor.yy0.z;
3907
                                                                                    yylhsminor.yy662 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &t);
X
Xiaoyu Wang 已提交
3908
                                                                                  }
3909
  yymsp[-1].minor.yy662 = yylhsminor.yy662;
3910
        break;
X
Xiaoyu Wang 已提交
3911
      case 274: /* signed_literal ::= NK_STRING */
3912 3913
{ yylhsminor.yy662 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0); }
  yymsp[0].minor.yy662 = yylhsminor.yy662;
3914
        break;
X
Xiaoyu Wang 已提交
3915
      case 275: /* signed_literal ::= NK_BOOL */
3916 3917
{ yylhsminor.yy662 = createValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0); }
  yymsp[0].minor.yy662 = yylhsminor.yy662;
X
Xiaoyu Wang 已提交
3918
        break;
X
Xiaoyu Wang 已提交
3919
      case 276: /* signed_literal ::= TIMESTAMP NK_STRING */
3920
{ yymsp[-1].minor.yy662 = createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0); }
X
Xiaoyu Wang 已提交
3921
        break;
X
Xiaoyu Wang 已提交
3922
      case 277: /* signed_literal ::= duration_literal */
3923 3924 3925 3926 3927 3928
      case 279: /* signed_literal ::= literal_func */ yytestcase(yyruleno==279);
      case 334: /* star_func_para ::= expression */ yytestcase(yyruleno==334);
      case 389: /* select_item ::= common_expression */ yytestcase(yyruleno==389);
      case 434: /* search_condition ::= common_expression */ yytestcase(yyruleno==434);
{ yylhsminor.yy662 = releaseRawExprNode(pCxt, yymsp[0].minor.yy662); }
  yymsp[0].minor.yy662 = yylhsminor.yy662;
X
Xiaoyu Wang 已提交
3929
        break;
X
Xiaoyu Wang 已提交
3930
      case 278: /* signed_literal ::= NULL */
3931
{ yymsp[0].minor.yy662 = createValueNode(pCxt, TSDB_DATA_TYPE_NULL, NULL); }
X
Xiaoyu Wang 已提交
3932
        break;
3933 3934 3935 3936
      case 297: /* expression ::= NK_LP expression NK_RP */
      case 361: /* boolean_primary ::= NK_LP boolean_value_expression NK_RP */ yytestcase(yyruleno==361);
{ yylhsminor.yy662 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, releaseRawExprNode(pCxt, yymsp[-1].minor.yy662)); }
  yymsp[-2].minor.yy662 = yylhsminor.yy662;
3937
        break;
3938
      case 298: /* expression ::= NK_PLUS expression */
3939
{
3940 3941
                                                                                    SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy662);
                                                                                    yylhsminor.yy662 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, releaseRawExprNode(pCxt, yymsp[0].minor.yy662));
3942
                                                                                  }
3943
  yymsp[-1].minor.yy662 = yylhsminor.yy662;
X
Xiaoyu Wang 已提交
3944
        break;
3945
      case 299: /* expression ::= NK_MINUS expression */
3946
{
3947 3948
                                                                                    SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy662);
                                                                                    yylhsminor.yy662 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, createOperatorNode(pCxt, OP_TYPE_MINUS, releaseRawExprNode(pCxt, yymsp[0].minor.yy662), NULL));
3949
                                                                                  }
3950
  yymsp[-1].minor.yy662 = yylhsminor.yy662;
3951
        break;
3952
      case 300: /* expression ::= expression NK_PLUS expression */
3953
{
3954 3955 3956
                                                                                    SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy662);
                                                                                    SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy662);
                                                                                    yylhsminor.yy662 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_ADD, releaseRawExprNode(pCxt, yymsp[-2].minor.yy662), releaseRawExprNode(pCxt, yymsp[0].minor.yy662))); 
3957
                                                                                  }
3958
  yymsp[-2].minor.yy662 = yylhsminor.yy662;
3959
        break;
3960
      case 301: /* expression ::= expression NK_MINUS expression */
3961
{
3962 3963 3964
                                                                                    SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy662);
                                                                                    SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy662);
                                                                                    yylhsminor.yy662 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_SUB, releaseRawExprNode(pCxt, yymsp[-2].minor.yy662), releaseRawExprNode(pCxt, yymsp[0].minor.yy662))); 
3965
                                                                                  }
3966
  yymsp[-2].minor.yy662 = yylhsminor.yy662;
3967
        break;
3968
      case 302: /* expression ::= expression NK_STAR expression */
3969
{
3970 3971 3972
                                                                                    SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy662);
                                                                                    SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy662);
                                                                                    yylhsminor.yy662 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_MULTI, releaseRawExprNode(pCxt, yymsp[-2].minor.yy662), releaseRawExprNode(pCxt, yymsp[0].minor.yy662))); 
3973
                                                                                  }
3974
  yymsp[-2].minor.yy662 = yylhsminor.yy662;
3975
        break;
3976
      case 303: /* expression ::= expression NK_SLASH expression */
3977
{
3978 3979 3980
                                                                                    SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy662);
                                                                                    SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy662);
                                                                                    yylhsminor.yy662 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_DIV, releaseRawExprNode(pCxt, yymsp[-2].minor.yy662), releaseRawExprNode(pCxt, yymsp[0].minor.yy662))); 
3981
                                                                                  }
3982
  yymsp[-2].minor.yy662 = yylhsminor.yy662;
3983
        break;
3984
      case 304: /* expression ::= expression NK_REM expression */
3985
{
3986 3987 3988
                                                                                    SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy662);
                                                                                    SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy662);
                                                                                    yylhsminor.yy662 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_MOD, releaseRawExprNode(pCxt, yymsp[-2].minor.yy662), releaseRawExprNode(pCxt, yymsp[0].minor.yy662))); 
3989
                                                                                  }
3990
  yymsp[-2].minor.yy662 = yylhsminor.yy662;
3991
        break;
3992
      case 305: /* expression ::= column_reference NK_ARROW NK_STRING */
3993
{
3994 3995
                                                                                    SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy662);
                                                                                    yylhsminor.yy662 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_JSON_GET_VALUE, releaseRawExprNode(pCxt, yymsp[-2].minor.yy662), createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0))); 
3996
                                                                                  }
3997 3998 3999 4000 4001 4002 4003 4004 4005 4006 4007 4008 4009 4010 4011 4012 4013 4014 4015 4016 4017 4018 4019 4020 4021 4022 4023 4024 4025 4026 4027 4028 4029 4030 4031 4032 4033 4034 4035 4036 4037 4038 4039 4040 4041 4042 4043 4044 4045 4046 4047 4048 4049
  yymsp[-2].minor.yy662 = yylhsminor.yy662;
        break;
      case 306: /* expression_list ::= expression */
{ yylhsminor.yy568 = createNodeList(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy662)); }
  yymsp[0].minor.yy568 = yylhsminor.yy568;
        break;
      case 307: /* expression_list ::= expression_list NK_COMMA expression */
{ yylhsminor.yy568 = addNodeToList(pCxt, yymsp[-2].minor.yy568, releaseRawExprNode(pCxt, yymsp[0].minor.yy662)); }
  yymsp[-2].minor.yy568 = yylhsminor.yy568;
        break;
      case 308: /* column_reference ::= column_name */
{ yylhsminor.yy662 = createRawExprNode(pCxt, &yymsp[0].minor.yy555, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy555)); }
  yymsp[0].minor.yy662 = yylhsminor.yy662;
        break;
      case 309: /* column_reference ::= table_name NK_DOT column_name */
{ yylhsminor.yy662 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy555, &yymsp[0].minor.yy555, createColumnNode(pCxt, &yymsp[-2].minor.yy555, &yymsp[0].minor.yy555)); }
  yymsp[-2].minor.yy662 = yylhsminor.yy662;
        break;
      case 310: /* pseudo_column ::= ROWTS */
      case 311: /* pseudo_column ::= TBNAME */ yytestcase(yyruleno==311);
      case 312: /* pseudo_column ::= QSTARTTS */ yytestcase(yyruleno==312);
      case 313: /* pseudo_column ::= QENDTS */ yytestcase(yyruleno==313);
      case 314: /* pseudo_column ::= WSTARTTS */ yytestcase(yyruleno==314);
      case 315: /* pseudo_column ::= WENDTS */ yytestcase(yyruleno==315);
      case 316: /* pseudo_column ::= WDURATION */ yytestcase(yyruleno==316);
      case 322: /* literal_func ::= NOW */ yytestcase(yyruleno==322);
{ yylhsminor.yy662 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL)); }
  yymsp[0].minor.yy662 = yylhsminor.yy662;
        break;
      case 317: /* function_expression ::= function_name NK_LP expression_list NK_RP */
      case 318: /* function_expression ::= star_func NK_LP star_func_para_list NK_RP */ yytestcase(yyruleno==318);
{ yylhsminor.yy662 = createRawExprNodeExt(pCxt, &yymsp[-3].minor.yy555, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-3].minor.yy555, yymsp[-1].minor.yy568)); }
  yymsp[-3].minor.yy662 = yylhsminor.yy662;
        break;
      case 319: /* function_expression ::= CAST NK_LP expression AS type_name NK_RP */
{ yylhsminor.yy662 = createRawExprNodeExt(pCxt, &yymsp[-5].minor.yy0, &yymsp[0].minor.yy0, createCastFunctionNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy662), yymsp[-1].minor.yy156)); }
  yymsp[-5].minor.yy662 = yylhsminor.yy662;
        break;
      case 321: /* literal_func ::= noarg_func NK_LP NK_RP */
{ yylhsminor.yy662 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy555, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-2].minor.yy555, NULL)); }
  yymsp[-2].minor.yy662 = yylhsminor.yy662;
        break;
      case 330: /* star_func_para_list ::= NK_STAR */
{ yylhsminor.yy568 = createNodeList(pCxt, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy0)); }
  yymsp[0].minor.yy568 = yylhsminor.yy568;
        break;
      case 335: /* star_func_para ::= table_name NK_DOT NK_STAR */
      case 392: /* select_item ::= table_name NK_DOT NK_STAR */ yytestcase(yyruleno==392);
{ yylhsminor.yy662 = createColumnNode(pCxt, &yymsp[-2].minor.yy555, &yymsp[0].minor.yy0); }
  yymsp[-2].minor.yy662 = yylhsminor.yy662;
        break;
      case 336: /* predicate ::= expression compare_op expression */
      case 341: /* predicate ::= expression in_op in_predicate_value */ yytestcase(yyruleno==341);
4050
{
4051 4052 4053
                                                                                    SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy662);
                                                                                    SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy662);
                                                                                    yylhsminor.yy662 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, yymsp[-1].minor.yy304, releaseRawExprNode(pCxt, yymsp[-2].minor.yy662), releaseRawExprNode(pCxt, yymsp[0].minor.yy662)));
4054
                                                                                  }
4055
  yymsp[-2].minor.yy662 = yylhsminor.yy662;
4056
        break;
4057
      case 337: /* predicate ::= expression BETWEEN expression AND expression */
4058
{
4059 4060 4061
                                                                                    SToken s = getTokenFromRawExprNode(pCxt, yymsp[-4].minor.yy662);
                                                                                    SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy662);
                                                                                    yylhsminor.yy662 = createRawExprNodeExt(pCxt, &s, &e, createBetweenAnd(pCxt, releaseRawExprNode(pCxt, yymsp[-4].minor.yy662), releaseRawExprNode(pCxt, yymsp[-2].minor.yy662), releaseRawExprNode(pCxt, yymsp[0].minor.yy662)));
4062
                                                                                  }
4063
  yymsp[-4].minor.yy662 = yylhsminor.yy662;
4064
        break;
4065
      case 338: /* predicate ::= expression NOT BETWEEN expression AND expression */
4066
{
4067 4068 4069
                                                                                    SToken s = getTokenFromRawExprNode(pCxt, yymsp[-5].minor.yy662);
                                                                                    SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy662);
                                                                                    yylhsminor.yy662 = createRawExprNodeExt(pCxt, &s, &e, createNotBetweenAnd(pCxt, releaseRawExprNode(pCxt, yymsp[-5].minor.yy662), releaseRawExprNode(pCxt, yymsp[-2].minor.yy662), releaseRawExprNode(pCxt, yymsp[0].minor.yy662)));
4070
                                                                                  }
4071
  yymsp[-5].minor.yy662 = yylhsminor.yy662;
4072
        break;
4073
      case 339: /* predicate ::= expression IS NULL */
4074
{
4075 4076
                                                                                    SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy662);
                                                                                    yylhsminor.yy662 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NULL, releaseRawExprNode(pCxt, yymsp[-2].minor.yy662), NULL));
4077
                                                                                  }
4078
  yymsp[-2].minor.yy662 = yylhsminor.yy662;
4079
        break;
4080
      case 340: /* predicate ::= expression IS NOT NULL */
4081
{
4082 4083
                                                                                    SToken s = getTokenFromRawExprNode(pCxt, yymsp[-3].minor.yy662);
                                                                                    yylhsminor.yy662 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NOT_NULL, releaseRawExprNode(pCxt, yymsp[-3].minor.yy662), NULL));
4084
                                                                                  }
4085
  yymsp[-3].minor.yy662 = yylhsminor.yy662;
4086
        break;
4087 4088
      case 342: /* compare_op ::= NK_LT */
{ yymsp[0].minor.yy304 = OP_TYPE_LOWER_THAN; }
4089
        break;
4090 4091
      case 343: /* compare_op ::= NK_GT */
{ yymsp[0].minor.yy304 = OP_TYPE_GREATER_THAN; }
4092
        break;
4093 4094
      case 344: /* compare_op ::= NK_LE */
{ yymsp[0].minor.yy304 = OP_TYPE_LOWER_EQUAL; }
4095
        break;
4096 4097
      case 345: /* compare_op ::= NK_GE */
{ yymsp[0].minor.yy304 = OP_TYPE_GREATER_EQUAL; }
4098
        break;
4099 4100
      case 346: /* compare_op ::= NK_NE */
{ yymsp[0].minor.yy304 = OP_TYPE_NOT_EQUAL; }
4101
        break;
4102 4103
      case 347: /* compare_op ::= NK_EQ */
{ yymsp[0].minor.yy304 = OP_TYPE_EQUAL; }
4104
        break;
4105 4106
      case 348: /* compare_op ::= LIKE */
{ yymsp[0].minor.yy304 = OP_TYPE_LIKE; }
4107
        break;
4108 4109
      case 349: /* compare_op ::= NOT LIKE */
{ yymsp[-1].minor.yy304 = OP_TYPE_NOT_LIKE; }
4110
        break;
4111 4112
      case 350: /* compare_op ::= MATCH */
{ yymsp[0].minor.yy304 = OP_TYPE_MATCH; }
4113
        break;
4114 4115
      case 351: /* compare_op ::= NMATCH */
{ yymsp[0].minor.yy304 = OP_TYPE_NMATCH; }
4116
        break;
4117 4118
      case 352: /* compare_op ::= CONTAINS */
{ yymsp[0].minor.yy304 = OP_TYPE_JSON_CONTAINS; }
4119
        break;
4120 4121
      case 353: /* in_op ::= IN */
{ yymsp[0].minor.yy304 = OP_TYPE_IN; }
4122
        break;
4123 4124
      case 354: /* in_op ::= NOT IN */
{ yymsp[-1].minor.yy304 = OP_TYPE_NOT_IN; }
4125
        break;
4126 4127 4128
      case 355: /* in_predicate_value ::= NK_LP expression_list NK_RP */
{ yylhsminor.yy662 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, createNodeListNode(pCxt, yymsp[-1].minor.yy568)); }
  yymsp[-2].minor.yy662 = yylhsminor.yy662;
4129
        break;
4130
      case 357: /* boolean_value_expression ::= NOT boolean_primary */
4131
{
4132 4133
                                                                                    SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy662);
                                                                                    yylhsminor.yy662 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_NOT, releaseRawExprNode(pCxt, yymsp[0].minor.yy662), NULL));
4134
                                                                                  }
4135
  yymsp[-1].minor.yy662 = yylhsminor.yy662;
4136
        break;
4137
      case 358: /* boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */
4138
{
4139 4140 4141
                                                                                    SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy662);
                                                                                    SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy662);
                                                                                    yylhsminor.yy662 = createRawExprNodeExt(pCxt, &s, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_OR, releaseRawExprNode(pCxt, yymsp[-2].minor.yy662), releaseRawExprNode(pCxt, yymsp[0].minor.yy662)));
4142
                                                                                  }
4143
  yymsp[-2].minor.yy662 = yylhsminor.yy662;
4144
        break;
4145
      case 359: /* boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */
4146
{
4147 4148 4149
                                                                                    SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy662);
                                                                                    SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy662);
                                                                                    yylhsminor.yy662 = createRawExprNodeExt(pCxt, &s, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_AND, releaseRawExprNode(pCxt, yymsp[-2].minor.yy662), releaseRawExprNode(pCxt, yymsp[0].minor.yy662)));
4150
                                                                                  }
4151
  yymsp[-2].minor.yy662 = yylhsminor.yy662;
4152
        break;
4153 4154 4155
      case 366: /* table_reference_list ::= table_reference_list NK_COMMA table_reference */
{ yylhsminor.yy662 = createJoinTableNode(pCxt, JOIN_TYPE_INNER, yymsp[-2].minor.yy662, yymsp[0].minor.yy662, NULL); }
  yymsp[-2].minor.yy662 = yylhsminor.yy662;
4156
        break;
4157 4158 4159
      case 369: /* table_primary ::= table_name alias_opt */
{ yylhsminor.yy662 = createRealTableNode(pCxt, NULL, &yymsp[-1].minor.yy555, &yymsp[0].minor.yy555); }
  yymsp[-1].minor.yy662 = yylhsminor.yy662;
4160
        break;
4161 4162 4163
      case 370: /* table_primary ::= db_name NK_DOT table_name alias_opt */
{ yylhsminor.yy662 = createRealTableNode(pCxt, &yymsp[-3].minor.yy555, &yymsp[-1].minor.yy555, &yymsp[0].minor.yy555); }
  yymsp[-3].minor.yy662 = yylhsminor.yy662;
4164
        break;
4165 4166 4167
      case 371: /* table_primary ::= subquery alias_opt */
{ yylhsminor.yy662 = createTempTableNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy662), &yymsp[0].minor.yy555); }
  yymsp[-1].minor.yy662 = yylhsminor.yy662;
4168
        break;
4169 4170
      case 373: /* alias_opt ::= */
{ yymsp[1].minor.yy555 = nil_token;  }
4171
        break;
4172 4173 4174
      case 374: /* alias_opt ::= table_alias */
{ yylhsminor.yy555 = yymsp[0].minor.yy555; }
  yymsp[0].minor.yy555 = yylhsminor.yy555;
4175
        break;
4176 4177
      case 375: /* alias_opt ::= AS table_alias */
{ yymsp[-1].minor.yy555 = yymsp[0].minor.yy555; }
4178
        break;
4179 4180 4181
      case 376: /* parenthesized_joined_table ::= NK_LP joined_table NK_RP */
      case 377: /* parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ yytestcase(yyruleno==377);
{ yymsp[-2].minor.yy662 = yymsp[-1].minor.yy662; }
4182
        break;
4183 4184 4185
      case 378: /* joined_table ::= table_reference join_type JOIN table_reference ON search_condition */
{ yylhsminor.yy662 = createJoinTableNode(pCxt, yymsp[-4].minor.yy84, yymsp[-5].minor.yy662, yymsp[-2].minor.yy662, yymsp[0].minor.yy662); }
  yymsp[-5].minor.yy662 = yylhsminor.yy662;
4186
        break;
4187 4188
      case 379: /* join_type ::= */
{ yymsp[1].minor.yy84 = JOIN_TYPE_INNER; }
4189
        break;
4190 4191
      case 380: /* join_type ::= INNER */
{ yymsp[0].minor.yy84 = JOIN_TYPE_INNER; }
4192
        break;
4193
      case 381: /* query_specification ::= SELECT set_quantifier_opt select_list from_clause where_clause_opt partition_by_clause_opt twindow_clause_opt group_by_clause_opt having_clause_opt */
4194
{ 
4195 4196 4197 4198 4199 4200
                                                                                    yymsp[-8].minor.yy662 = createSelectStmt(pCxt, yymsp[-7].minor.yy617, yymsp[-6].minor.yy568, yymsp[-5].minor.yy662);
                                                                                    yymsp[-8].minor.yy662 = addWhereClause(pCxt, yymsp[-8].minor.yy662, yymsp[-4].minor.yy662);
                                                                                    yymsp[-8].minor.yy662 = addPartitionByClause(pCxt, yymsp[-8].minor.yy662, yymsp[-3].minor.yy568);
                                                                                    yymsp[-8].minor.yy662 = addWindowClauseClause(pCxt, yymsp[-8].minor.yy662, yymsp[-2].minor.yy662);
                                                                                    yymsp[-8].minor.yy662 = addGroupByClause(pCxt, yymsp[-8].minor.yy662, yymsp[-1].minor.yy568);
                                                                                    yymsp[-8].minor.yy662 = addHavingClause(pCxt, yymsp[-8].minor.yy662, yymsp[0].minor.yy662);
4201 4202
                                                                                  }
        break;
4203 4204
      case 384: /* set_quantifier_opt ::= ALL */
{ yymsp[0].minor.yy617 = false; }
4205
        break;
4206 4207
      case 385: /* select_list ::= NK_STAR */
{ yymsp[0].minor.yy568 = NULL; }
4208
        break;
4209 4210 4211
      case 390: /* select_item ::= common_expression column_alias */
{ yylhsminor.yy662 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy662), &yymsp[0].minor.yy555); }
  yymsp[-1].minor.yy662 = yylhsminor.yy662;
4212
        break;
4213 4214 4215
      case 391: /* select_item ::= common_expression AS column_alias */
{ yylhsminor.yy662 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy662), &yymsp[0].minor.yy555); }
  yymsp[-2].minor.yy662 = yylhsminor.yy662;
4216
        break;
4217 4218 4219 4220
      case 396: /* partition_by_clause_opt ::= PARTITION BY expression_list */
      case 413: /* group_by_clause_opt ::= GROUP BY group_by_list */ yytestcase(yyruleno==413);
      case 424: /* order_by_clause_opt ::= ORDER BY sort_specification_list */ yytestcase(yyruleno==424);
{ yymsp[-2].minor.yy568 = yymsp[0].minor.yy568; }
4221
        break;
4222 4223
      case 398: /* twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP */
{ yymsp[-5].minor.yy662 = createSessionWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy662), releaseRawExprNode(pCxt, yymsp[-1].minor.yy662)); }
4224
        break;
4225 4226
      case 399: /* twindow_clause_opt ::= STATE_WINDOW NK_LP expression NK_RP */
{ yymsp[-3].minor.yy662 = createStateWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy662)); }
4227
        break;
4228 4229
      case 400: /* twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt */
{ yymsp[-5].minor.yy662 = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy662), NULL, yymsp[-1].minor.yy662, yymsp[0].minor.yy662); }
4230
        break;
4231 4232
      case 401: /* twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt */
{ yymsp[-7].minor.yy662 = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-5].minor.yy662), releaseRawExprNode(pCxt, yymsp[-3].minor.yy662), yymsp[-1].minor.yy662, yymsp[0].minor.yy662); }
4233
        break;
4234 4235
      case 403: /* sliding_opt ::= SLIDING NK_LP duration_literal NK_RP */
{ yymsp[-3].minor.yy662 = releaseRawExprNode(pCxt, yymsp[-1].minor.yy662); }
4236
        break;
4237 4238
      case 405: /* fill_opt ::= FILL NK_LP fill_mode NK_RP */
{ yymsp[-3].minor.yy662 = createFillNode(pCxt, yymsp[-1].minor.yy284, NULL); }
4239
        break;
4240 4241
      case 406: /* fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP */
{ yymsp[-5].minor.yy662 = createFillNode(pCxt, FILL_MODE_VALUE, createNodeListNode(pCxt, yymsp[-1].minor.yy568)); }
4242
        break;
4243 4244
      case 407: /* fill_mode ::= NONE */
{ yymsp[0].minor.yy284 = FILL_MODE_NONE; }
4245
        break;
4246 4247
      case 408: /* fill_mode ::= PREV */
{ yymsp[0].minor.yy284 = FILL_MODE_PREV; }
4248
        break;
4249 4250
      case 409: /* fill_mode ::= NULL */
{ yymsp[0].minor.yy284 = FILL_MODE_NULL; }
4251
        break;
4252 4253
      case 410: /* fill_mode ::= LINEAR */
{ yymsp[0].minor.yy284 = FILL_MODE_LINEAR; }
4254
        break;
4255 4256
      case 411: /* fill_mode ::= NEXT */
{ yymsp[0].minor.yy284 = FILL_MODE_NEXT; }
4257
        break;
4258 4259 4260
      case 414: /* group_by_list ::= expression */
{ yylhsminor.yy568 = createNodeList(pCxt, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy662))); }
  yymsp[0].minor.yy568 = yylhsminor.yy568;
4261
        break;
4262 4263 4264
      case 415: /* group_by_list ::= group_by_list NK_COMMA expression */
{ yylhsminor.yy568 = addNodeToList(pCxt, yymsp[-2].minor.yy568, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy662))); }
  yymsp[-2].minor.yy568 = yylhsminor.yy568;
4265
        break;
4266
      case 418: /* query_expression ::= query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt */
4267
{ 
4268 4269 4270
                                                                                    yylhsminor.yy662 = addOrderByClause(pCxt, yymsp[-3].minor.yy662, yymsp[-2].minor.yy568);
                                                                                    yylhsminor.yy662 = addSlimitClause(pCxt, yylhsminor.yy662, yymsp[-1].minor.yy662);
                                                                                    yylhsminor.yy662 = addLimitClause(pCxt, yylhsminor.yy662, yymsp[0].minor.yy662);
4271
                                                                                  }
4272
  yymsp[-3].minor.yy662 = yylhsminor.yy662;
4273
        break;
4274 4275 4276
      case 420: /* query_expression_body ::= query_expression_body UNION ALL query_expression_body */
{ yylhsminor.yy662 = createSetOperator(pCxt, SET_OP_TYPE_UNION_ALL, yymsp[-3].minor.yy662, yymsp[0].minor.yy662); }
  yymsp[-3].minor.yy662 = yylhsminor.yy662;
4277
        break;
4278 4279 4280
      case 421: /* query_expression_body ::= query_expression_body UNION query_expression_body */
{ yylhsminor.yy662 = createSetOperator(pCxt, SET_OP_TYPE_UNION, yymsp[-2].minor.yy662, yymsp[0].minor.yy662); }
  yymsp[-2].minor.yy662 = yylhsminor.yy662;
X
Xiaoyu Wang 已提交
4281
        break;
4282 4283 4284
      case 426: /* slimit_clause_opt ::= SLIMIT NK_INTEGER */
      case 430: /* limit_clause_opt ::= LIMIT NK_INTEGER */ yytestcase(yyruleno==430);
{ yymsp[-1].minor.yy662 = createLimitNode(pCxt, &yymsp[0].minor.yy0, NULL); }
4285
        break;
4286 4287 4288
      case 427: /* slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */
      case 431: /* limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ yytestcase(yyruleno==431);
{ yymsp[-3].minor.yy662 = createLimitNode(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0); }
4289
        break;
4290 4291 4292
      case 428: /* slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */
      case 432: /* limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ yytestcase(yyruleno==432);
{ yymsp[-3].minor.yy662 = createLimitNode(pCxt, &yymsp[0].minor.yy0, &yymsp[-2].minor.yy0); }
4293
        break;
4294 4295 4296
      case 433: /* subquery ::= NK_LP query_expression NK_RP */
{ yylhsminor.yy662 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, yymsp[-1].minor.yy662); }
  yymsp[-2].minor.yy662 = yylhsminor.yy662;
4297
        break;
4298 4299 4300
      case 437: /* sort_specification ::= expression ordering_specification_opt null_ordering_opt */
{ yylhsminor.yy662 = createOrderByExprNode(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy662), yymsp[-1].minor.yy272, yymsp[0].minor.yy181); }
  yymsp[-2].minor.yy662 = yylhsminor.yy662;
4301
        break;
4302 4303
      case 438: /* ordering_specification_opt ::= */
{ yymsp[1].minor.yy272 = ORDER_ASC; }
4304
        break;
4305 4306
      case 439: /* ordering_specification_opt ::= ASC */
{ yymsp[0].minor.yy272 = ORDER_ASC; }
4307
        break;
4308 4309
      case 440: /* ordering_specification_opt ::= DESC */
{ yymsp[0].minor.yy272 = ORDER_DESC; }
4310
        break;
4311 4312
      case 441: /* null_ordering_opt ::= */
{ yymsp[1].minor.yy181 = NULL_ORDER_DEFAULT; }
4313
        break;
4314 4315
      case 442: /* null_ordering_opt ::= NULLS FIRST */
{ yymsp[-1].minor.yy181 = NULL_ORDER_FIRST; }
4316
        break;
4317 4318
      case 443: /* null_ordering_opt ::= NULLS LAST */
{ yymsp[-1].minor.yy181 = NULL_ORDER_LAST; }
4319 4320 4321 4322 4323
        break;
      default:
        break;
/********** End reduce actions ************************************************/
  };
4324 4325 4326
  assert( yyruleno<sizeof(yyRuleInfo)/sizeof(yyRuleInfo[0]) );
  yygoto = yyRuleInfo[yyruleno].lhs;
  yysize = yyRuleInfo[yyruleno].nrhs;
4327 4328 4329 4330 4331 4332 4333 4334 4335 4336 4337 4338 4339 4340 4341 4342 4343 4344 4345 4346 4347 4348 4349 4350
  yyact = yy_find_reduce_action(yymsp[yysize].stateno,(YYCODETYPE)yygoto);

  /* There are no SHIFTREDUCE actions on nonterminals because the table
  ** generator has simplified them to pure REDUCE actions. */
  assert( !(yyact>YY_MAX_SHIFT && yyact<=YY_MAX_SHIFTREDUCE) );

  /* It is not possible for a REDUCE to be followed by an error */
  assert( yyact!=YY_ERROR_ACTION );

  yymsp += yysize+1;
  yypParser->yytos = yymsp;
  yymsp->stateno = (YYACTIONTYPE)yyact;
  yymsp->major = (YYCODETYPE)yygoto;
  yyTraceShift(yypParser, yyact, "... then shift");
  return yyact;
}

/*
** The following code executes when the parse fails
*/
#ifndef YYNOERRORRECOVERY
static void yy_parse_failed(
  yyParser *yypParser           /* The parser */
){
X
Xiaoyu Wang 已提交
4351 4352
  ParseARG_FETCH
  ParseCTX_FETCH
4353 4354 4355 4356 4357 4358 4359 4360 4361 4362
#ifndef NDEBUG
  if( yyTraceFILE ){
    fprintf(yyTraceFILE,"%sFail!\n",yyTracePrompt);
  }
#endif
  while( yypParser->yytos>yypParser->yystack ) yy_pop_parser_stack(yypParser);
  /* Here code is inserted which will be executed whenever the
  ** parser fails */
/************ Begin %parse_failure code ***************************************/
/************ End %parse_failure code *****************************************/
X
Xiaoyu Wang 已提交
4363 4364
  ParseARG_STORE /* Suppress warning about unused %extra_argument variable */
  ParseCTX_STORE
4365 4366 4367 4368 4369 4370 4371 4372 4373
}
#endif /* YYNOERRORRECOVERY */

/*
** The following code executes when a syntax error first occurs.
*/
static void yy_syntax_error(
  yyParser *yypParser,           /* The parser */
  int yymajor,                   /* The major type of the error token */
X
Xiaoyu Wang 已提交
4374
  ParseTOKENTYPE yyminor         /* The minor type of the error token */
4375
){
X
Xiaoyu Wang 已提交
4376 4377
  ParseARG_FETCH
  ParseCTX_FETCH
4378 4379
#define TOKEN yyminor
/************ Begin %syntax_error code ****************************************/
4380 4381 4382 4383 4384 4385 4386 4387

  if (pCxt->valid) {
    if(TOKEN.z) {
      generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_SYNTAX_ERROR, TOKEN.z);
    } else {
      generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_INCOMPLETE_SQL);
    }
    pCxt->valid = false;
4388 4389
  }
/************ End %syntax_error code ******************************************/
X
Xiaoyu Wang 已提交
4390 4391
  ParseARG_STORE /* Suppress warning about unused %extra_argument variable */
  ParseCTX_STORE
4392 4393 4394 4395 4396 4397 4398 4399
}

/*
** The following is executed when the parser accepts
*/
static void yy_accept(
  yyParser *yypParser           /* The parser */
){
X
Xiaoyu Wang 已提交
4400 4401
  ParseARG_FETCH
  ParseCTX_FETCH
4402 4403 4404 4405 4406 4407 4408 4409 4410 4411 4412 4413 4414
#ifndef NDEBUG
  if( yyTraceFILE ){
    fprintf(yyTraceFILE,"%sAccept!\n",yyTracePrompt);
  }
#endif
#ifndef YYNOERRORRECOVERY
  yypParser->yyerrcnt = -1;
#endif
  assert( yypParser->yytos==yypParser->yystack );
  /* Here code is inserted which will be executed whenever the
  ** parser accepts */
/*********** Begin %parse_accept code *****************************************/
/*********** End %parse_accept code *******************************************/
X
Xiaoyu Wang 已提交
4415 4416
  ParseARG_STORE /* Suppress warning about unused %extra_argument variable */
  ParseCTX_STORE
4417 4418 4419 4420
}

/* The main parser program.
** The first argument is a pointer to a structure obtained from
X
Xiaoyu Wang 已提交
4421
** "ParseAlloc" which describes the current state of the parser.
4422 4423 4424 4425 4426 4427 4428 4429 4430 4431 4432 4433 4434 4435 4436 4437
** The second argument is the major token number.  The third is
** the minor token.  The fourth optional argument is whatever the
** user wants (and specified in the grammar) and is available for
** use by the action routines.
**
** Inputs:
** <ul>
** <li> A pointer to the parser (an opaque structure.)
** <li> The major token number.
** <li> The minor token number.
** <li> An option argument of a grammar-specified type.
** </ul>
**
** Outputs:
** None.
*/
X
Xiaoyu Wang 已提交
4438
void Parse(
4439 4440
  void *yyp,                   /* The parser */
  int yymajor,                 /* The major token code number */
X
Xiaoyu Wang 已提交
4441 4442
  ParseTOKENTYPE yyminor       /* The value for the token */
  ParseARG_PDECL               /* Optional %extra_argument parameter */
4443 4444 4445 4446 4447 4448 4449 4450 4451 4452
){
  YYMINORTYPE yyminorunion;
  YYACTIONTYPE yyact;   /* The parser action. */
#if !defined(YYERRORSYMBOL) && !defined(YYNOERRORRECOVERY)
  int yyendofinput;     /* True if we are at the end of input */
#endif
#ifdef YYERRORSYMBOL
  int yyerrorhit = 0;   /* True if yymajor has invoked an error */
#endif
  yyParser *yypParser = (yyParser*)yyp;  /* The parser */
X
Xiaoyu Wang 已提交
4453 4454
  ParseCTX_FETCH
  ParseARG_STORE
4455 4456 4457 4458 4459 4460 4461 4462 4463 4464 4465 4466 4467 4468 4469 4470 4471 4472 4473 4474 4475 4476 4477 4478

  assert( yypParser->yytos!=0 );
#if !defined(YYERRORSYMBOL) && !defined(YYNOERRORRECOVERY)
  yyendofinput = (yymajor==0);
#endif

  yyact = yypParser->yytos->stateno;
#ifndef NDEBUG
  if( yyTraceFILE ){
    if( yyact < YY_MIN_REDUCE ){
      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

  do{
    assert( yyact==yypParser->yytos->stateno );
    yyact = yy_find_shift_action((YYCODETYPE)yymajor,yyact);
    if( yyact >= YY_MIN_REDUCE ){
      yyact = yy_reduce(yypParser,yyact-YY_MIN_REDUCE,yymajor,
X
Xiaoyu Wang 已提交
4479
                        yyminor ParseCTX_PARAM);
4480 4481 4482 4483 4484 4485 4486 4487 4488 4489 4490 4491 4492 4493 4494 4495 4496 4497 4498 4499 4500 4501 4502 4503 4504 4505 4506 4507 4508 4509 4510 4511 4512 4513 4514 4515 4516 4517 4518 4519 4520 4521 4522 4523 4524 4525 4526 4527 4528 4529 4530 4531 4532 4533 4534 4535 4536 4537 4538 4539 4540 4541 4542 4543 4544 4545 4546 4547 4548 4549 4550 4551 4552 4553 4554 4555 4556 4557 4558 4559 4560 4561 4562 4563 4564 4565 4566 4567 4568 4569 4570 4571 4572 4573 4574 4575 4576 4577 4578 4579 4580 4581 4582 4583 4584 4585 4586 4587 4588 4589 4590 4591 4592 4593 4594 4595 4596 4597 4598 4599 4600 4601 4602 4603 4604 4605 4606 4607 4608 4609 4610 4611
    }else if( yyact <= YY_MAX_SHIFTREDUCE ){
      yy_shift(yypParser,yyact,(YYCODETYPE)yymajor,yyminor);
#ifndef YYNOERRORRECOVERY
      yypParser->yyerrcnt--;
#endif
      break;
    }else if( yyact==YY_ACCEPT_ACTION ){
      yypParser->yytos--;
      yy_accept(yypParser);
      return;
    }else{
      assert( yyact == YY_ERROR_ACTION );
      yyminorunion.yy0 = yyminor;
#ifdef YYERRORSYMBOL
      int yymx;
#endif
#ifndef NDEBUG
      if( yyTraceFILE ){
        fprintf(yyTraceFILE,"%sSyntax Error!\n",yyTracePrompt);
      }
#endif
#ifdef YYERRORSYMBOL
      /* A syntax error has occurred.
      ** The response to an error depends upon whether or not the
      ** grammar defines an error token "ERROR".  
      **
      ** This is what we do if the grammar does define ERROR:
      **
      **  * Call the %syntax_error function.
      **
      **  * Begin popping the stack until we enter a state where
      **    it is legal to shift the error symbol, then shift
      **    the error symbol.
      **
      **  * Set the error count to three.
      **
      **  * Begin accepting and shifting new tokens.  No new error
      **    processing will occur until three tokens have been
      **    shifted successfully.
      **
      */
      if( yypParser->yyerrcnt<0 ){
        yy_syntax_error(yypParser,yymajor,yyminor);
      }
      yymx = yypParser->yytos->major;
      if( yymx==YYERRORSYMBOL || yyerrorhit ){
#ifndef NDEBUG
        if( yyTraceFILE ){
          fprintf(yyTraceFILE,"%sDiscard input token %s\n",
             yyTracePrompt,yyTokenName[yymajor]);
        }
#endif
        yy_destructor(yypParser, (YYCODETYPE)yymajor, &yyminorunion);
        yymajor = YYNOCODE;
      }else{
        while( yypParser->yytos >= yypParser->yystack
            && (yyact = yy_find_reduce_action(
                        yypParser->yytos->stateno,
                        YYERRORSYMBOL)) > YY_MAX_SHIFTREDUCE
        ){
          yy_pop_parser_stack(yypParser);
        }
        if( yypParser->yytos < yypParser->yystack || yymajor==0 ){
          yy_destructor(yypParser,(YYCODETYPE)yymajor,&yyminorunion);
          yy_parse_failed(yypParser);
#ifndef YYNOERRORRECOVERY
          yypParser->yyerrcnt = -1;
#endif
          yymajor = YYNOCODE;
        }else if( yymx!=YYERRORSYMBOL ){
          yy_shift(yypParser,yyact,YYERRORSYMBOL,yyminor);
        }
      }
      yypParser->yyerrcnt = 3;
      yyerrorhit = 1;
      if( yymajor==YYNOCODE ) break;
      yyact = yypParser->yytos->stateno;
#elif defined(YYNOERRORRECOVERY)
      /* If the YYNOERRORRECOVERY macro is defined, then do not attempt to
      ** do any kind of error recovery.  Instead, simply invoke the syntax
      ** error routine and continue going as if nothing had happened.
      **
      ** Applications can set this macro (for example inside %include) if
      ** they intend to abandon the parse upon the first syntax error seen.
      */
      yy_syntax_error(yypParser,yymajor, yyminor);
      yy_destructor(yypParser,(YYCODETYPE)yymajor,&yyminorunion);
      break;
#else  /* YYERRORSYMBOL is not defined */
      /* This is what we do if the grammar does not define ERROR:
      **
      **  * Report an error message, and throw away the input token.
      **
      **  * If the input token is $, then fail the parse.
      **
      ** As before, subsequent error messages are suppressed until
      ** three input tokens have been successfully shifted.
      */
      if( yypParser->yyerrcnt<=0 ){
        yy_syntax_error(yypParser,yymajor, yyminor);
      }
      yypParser->yyerrcnt = 3;
      yy_destructor(yypParser,(YYCODETYPE)yymajor,&yyminorunion);
      if( yyendofinput ){
        yy_parse_failed(yypParser);
#ifndef YYNOERRORRECOVERY
        yypParser->yyerrcnt = -1;
#endif
      }
      break;
#endif
    }
  }while( yypParser->yytos>yypParser->yystack );
#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 the fallback token corresponding to canonical token iToken, or
** 0 if iToken has no fallback.
*/
X
Xiaoyu Wang 已提交
4612
int ParseFallback(int iToken){
4613
#ifdef YYFALLBACK
4614 4615 4616
  if( iToken<(int)(sizeof(yyFallback)/sizeof(yyFallback[0])) ){
    return yyFallback[iToken];
  }
4617 4618
#else
  (void)iToken;
4619
#endif
4620
  return 0;
4621
}