sql.c 281.4 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
/*
** 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:
*/
X
Xiaoyu Wang 已提交
25 26
#include <stdio.h>
#include <assert.h>
27
/************ Begin %include sections from the grammar ************************/
X
Xiaoyu Wang 已提交
28

29 30 31 32 33 34
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include <stdbool.h>

D
dapan1121 已提交
35 36
#define ALLOW_FORBID_FUNC

37
#include "functionMgt.h"
38
#include "nodes.h"
X
Xiaoyu Wang 已提交
39
#include "parToken.h"
40
#include "ttokendef.h"
X
Xiaoyu Wang 已提交
41
#include "parAst.h"
D
dapan1121 已提交
42 43

#define YYSTACKDEPTH 0
44
/**************** End of %include directives **********************************/
X
Xiaoyu Wang 已提交
45 46 47 48 49
/* 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 ***************************/
50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66

/* 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 已提交
67
**    ParseTOKENTYPE     is the data type used for minor type for terminal
68 69 70 71 72 73 74 75 76 77
**                       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 已提交
78
**                       which is ParseTOKENTYPE.  The entry in the union
79 80
**                       for terminal symbols is called "yy0".
**    YYSTACKDEPTH       is the maximum depth of the parser's stack.  If
X
Xiaoyu Wang 已提交
81
**                       zero the stack is dynamically sized using realloc()
X
Xiaoyu Wang 已提交
82 83 84 85 86 87
**    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
88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105
**    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 已提交
106
#define YYCODETYPE unsigned short int
107
#define YYNOCODE 459
108
#define YYACTIONTYPE unsigned short int
X
Xiaoyu Wang 已提交
109
#define ParseTOKENTYPE  SToken 
110 111
typedef union {
  int yyinit;
X
Xiaoyu Wang 已提交
112
  ParseTOKENTYPE yy0;
113
  EOperatorType yy20;
114 115 116 117 118 119 120 121 122 123 124 125 126
  SNode* yy74;
  ENullOrder yy109;
  SToken yy317;
  EOrder yy326;
  bool yy335;
  int8_t yy449;
  int64_t yy531;
  EJoinType yy630;
  SAlterOption yy767;
  EFillMode yy828;
  int32_t yy856;
  SNodeList* yy874;
  SDataType yy898;
127 128 129 130
} YYMINORTYPE;
#ifndef YYSTACKDEPTH
#define YYSTACKDEPTH 100
#endif
X
Xiaoyu Wang 已提交
131 132 133 134 135 136 137 138 139 140
#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 已提交
141
#define YYFALLBACK 1
142 143
#define YYNSTATE             712
#define YYNRULE              542
144
#define YYNTOKEN             322
145 146 147 148 149 150 151 152
#define YY_MAX_SHIFT         711
#define YY_MIN_SHIFTREDUCE   1056
#define YY_MAX_SHIFTREDUCE   1597
#define YY_ERROR_ACTION      1598
#define YY_ACCEPT_ACTION     1599
#define YY_NO_ACTION         1600
#define YY_MIN_REDUCE        1601
#define YY_MAX_REDUCE        2142
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 213 214 215 216 217 218
/************* 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 **********************************************/
219
#define YY_ACTTAB_COUNT (2723)
220
static const YYACTIONTYPE yy_action[] = {
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 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493
 /*     0 */   460,  354,  461, 1637,  567,  601,  579, 2118, 2113,  155,
 /*    10 */  1944, 2113,   43,   41, 1528,   39,   38,   37, 1756,  123,
 /*    20 */   362, 1940, 1378,  566,  173,  600,  499, 2117, 2114,  568,
 /*    30 */  1958, 2114, 2116, 1458, 1403, 1376, 1754,  131,  469,  407,
 /*    40 */   461, 1637,   36,   35, 1944,  587,   42,   40,   39,   38,
 /*    50 */    37, 1936, 1942,  345,  542, 1940,  167,  579, 1453,  466,
 /*    60 */   586, 1976,  611,   16,  367,  462, 1807, 1800, 1802,  582,
 /*    70 */  1384,  600, 1404,  331, 1926,  158,  617,  334, 1854,  320,
 /*    80 */  1708, 1976, 1805,   43,   41, 1936, 1942,  357,  131,  561,
 /*    90 */   478,  362,  476, 1378, 1863,   12,  611,  327,  172, 2053,
 /*   100 */  2054, 1957,  129, 2058, 1458, 1992, 1376, 2117,  100, 1959,
 /*   110 */   621, 1961, 1962,  616,  601,  611, 1108,  708, 1107,  655,
 /*   120 */   170,  459, 2045,  600,  464, 1643,  356, 2041,  123, 1453,
 /*   130 */   560,  210, 1460, 1461,   16,  504,   33,  276, 1487,  567,
 /*   140 */   175, 1384,  157, 2113, 1613, 1754,   46, 1109, 2071,  256,
 /*   150 */  2053,  578,  579,  124,  577, 1624, 1958, 2113,  566,  173,
 /*   160 */   601, 1434, 1443, 2114,  568,  579,   12,   42,   40,   39,
 /*   170 */    38,   37,  566,  173,   52, 1311, 1312, 2114,  568,   97,
 /*   180 */  1379,  587, 1377,  131, 1258, 1259,  468, 1976,  708,  464,
 /*   190 */  1643, 1754, 1405,  132, 1488,  615,  131,  562,   46, 1926,
 /*   200 */  1926, 1746,  617, 1460, 1461, 1382, 1383,   62, 1433, 1436,
 /*   210 */  1437, 1438, 1439, 1440, 1441, 1442,  613,  609, 1451, 1452,
 /*   220 */  1454, 1455, 1456, 1457, 1459, 1462,    2, 1957,  596,   58,
 /*   230 */  1863, 1992, 1434, 1443,  312, 1959,  621, 1961, 1962,  616,
 /*   240 */   614,  611,  602, 2010,  174, 2053, 2054, 1403,  129, 2058,
 /*   250 */   339, 1379, 2060, 1377, 1801, 1802,  581,  171, 2053, 2054,
 /*   260 */   557,  129, 2058, 1623,   58,   32,  360, 1482, 1483, 1484,
 /*   270 */  1485, 1486, 1490, 1491, 1492, 1493, 1382, 1383, 2057, 1433,
 /*   280 */  1436, 1437, 1438, 1439, 1440, 1441, 1442,  613,  609, 1451,
 /*   290 */  1452, 1454, 1455, 1456, 1457, 1459, 1462,    2,   58,    9,
 /*   300 */    43,   41, 1670,   47, 1554, 1599, 1850, 1926,  362, 1532,
 /*   310 */  1378,  340, 1732,  338,  337, 1403,  501,  181, 1958, 1622,
 /*   320 */   503, 1458,   58, 1376, 1215,  643,  642,  641, 1219,  640,
 /*   330 */  1221, 1222,  639, 1224,  636,  258, 1230,  633, 1232, 1233,
 /*   340 */   630,  627,  502,  563,  558,  259, 1453,  176,  400, 1976,
 /*   350 */   399,   16,  554, 1552, 1553, 1555, 1556,  618, 1384, 1108,
 /*   360 */  1175, 1107, 1926, 1926,  617,  570,  396,  514,  513,  512,
 /*   370 */   377,   43,   41, 1463,  478,  128,  508,  401,  176,  362,
 /*   380 */   507, 1378,   58,   12,   85,  506,  511,  398,  394, 1957,
 /*   390 */  1109,  505, 1458, 1992, 1376, 1177,  100, 1959,  621, 1961,
 /*   400 */  1962,  616, 1958,  611,   80,  708,  134, 1621,  141, 2016,
 /*   410 */  2045,  601,  547,  176,  356, 2041, 2113, 1453,  127,  547,
 /*   420 */  1460, 1461,  169, 2113, 1404,  178,  227, 1749,  574, 1384,
 /*   430 */  1620, 2119,  173, 1976, 1602, 1794, 2114,  568, 2119,  173,
 /*   440 */  1378,  618, 1754, 2114,  568,  167, 1926,  176,  617, 1434,
 /*   450 */  1443, 1926,  176, 1376,   44,  113, 1435,  588,  112,  111,
 /*   460 */   110,  109,  108,  107,  106,  105,  104, 1855, 1379,  353,
 /*   470 */  1377,  176, 1867, 1957, 1926,  228,  708, 1992, 1784, 1807,
 /*   480 */   160, 1959,  621, 1961, 1962,  616,  355,  611, 1384, 1354,
 /*   490 */  1355, 1460, 1461, 1382, 1383, 1805, 1433, 1436, 1437, 1438,
 /*   500 */  1439, 1440, 1441, 1442,  613,  609, 1451, 1452, 1454, 1455,
 /*   510 */  1456, 1457, 1459, 1462,    2,  510,  509,  679,  677,  113,
 /*   520 */  1434, 1443,  112,  111,  110,  109,  108,  107,  106,  105,
 /*   530 */   104,  176,  569, 2134,  365,  708,  514,  513,  512, 1379,
 /*   540 */   368, 1377,  155, 1807,  128,  508, 1468, 1913,  155,  507,
 /*   550 */   366, 1756, 1403, 1406,  506,  511, 1731, 1756, 1958, 1805,
 /*   560 */   505,  267,  268, 1403, 1382, 1383,  266, 1433, 1436, 1437,
 /*   570 */  1438, 1439, 1440, 1441, 1442,  613,  609, 1451, 1452, 1454,
 /*   580 */  1455, 1456, 1457, 1459, 1462,    2,   43,   41, 1601, 1976,
 /*   590 */  1619,  601,  185,  528,  362,  384, 1378,  582, 1379, 1730,
 /*   600 */  1377, 1618, 1926,  646,  617,  405,  526, 1458,  524, 1376,
 /*   610 */  1745,  601,  122,  121,  120,  119,  118,  117,  116,  115,
 /*   620 */   114, 1940, 1754, 1382, 1383,  406,   11,   10,   77, 1957,
 /*   630 */  1617,   76, 1453, 1992, 1926, 1616,  100, 1959,  621, 1961,
 /*   640 */  1962,  616, 1754,  611, 1384, 1926,   91,   80,  170,  575,
 /*   650 */  2045, 1936, 1942,  133,  356, 2041, 2016,   43,   41,  601,
 /*   660 */   519,  655,  611,  653, 2118,  362, 1958, 1378, 1747,   44,
 /*   670 */  1750,  443, 1615,  415, 1926,  529, 2072,  588, 1458, 1926,
 /*   680 */  1376, 1405,  146,  145,  650,  649,  648,  143,   29,  224,
 /*   690 */  1754,  708, 1868, 1435,   36,   35,  182, 1976,   42,   40,
 /*   700 */    39,   38,   37, 1453,  522,  618, 1460, 1461, 1612,  516,
 /*   710 */  1926, 1611,  617, 2060,  223, 1384, 1926, 1610, 2118,   36,
 /*   720 */    35, 1501, 2113,   42,   40,   39,   38,   37, 1402,  189,
 /*   730 */   188, 1406, 1644, 1489, 2060, 1434, 1443, 1957, 2117, 2056,
 /*   740 */    12, 1992, 2114, 2115,  101, 1959,  621, 1961, 1962,  616,
 /*   750 */    64,  611, 1926,   63, 1379, 1926, 1377, 1587, 2045,   31,
 /*   760 */  2055, 1926,  708, 2042, 1609,   36,   35, 1608, 1607,   42,
 /*   770 */    40,   39,   38,   37,    9, 1606, 1089, 1460, 1461, 1382,
 /*   780 */  1383,  703, 1433, 1436, 1437, 1438, 1439, 1440, 1441, 1442,
 /*   790 */   613,  609, 1451, 1452, 1454, 1455, 1456, 1457, 1459, 1462,
 /*   800 */     2,  319,  234, 1401,   30, 1605, 1434, 1443, 1926,  711,
 /*   810 */   437, 1926, 1926,  450, 1494, 1091,  449, 1094, 1095, 1926,
 /*   820 */   603, 1837, 2017,  283,  258, 1379, 1667, 1377, 1604, 1850,
 /*   830 */     9,  421,    7,  451,  155,  605,  423, 2017,  166,  647,
 /*   840 */   183,   83, 1798, 1757,  701,  697,  693,  689,  281, 1926,
 /*   850 */  1382, 1383, 1729, 1433, 1436, 1437, 1438, 1439, 1440, 1441,
 /*   860 */  1442,  613,  609, 1451, 1452, 1454, 1455, 1456, 1457, 1459,
 /*   870 */  1462,    2, 1926, 1406,  236,   36,   35,  335,    6,   42,
 /*   880 */    40,   39,   38,   37,   98, 1850,  668,  274, 1724,  411,
 /*   890 */  1525,  685,  684,  683,  682,  372,  187,  681,  680,  135,
 /*   900 */   675,  674,  673,  672,  671,  670,  669,  148,  665,  664,
 /*   910 */   663,  371,  370,  660,  659,  658,  657,  656,  651,  447,
 /*   920 */   597, 1798,  442,  441,  440,  439,  436,  435,  434,  433,
 /*   930 */   432,  428,  427,  426,  425,  336,  418,  417,  416, 1807,
 /*   940 */   413,  412,  333,  156, 1094, 1095,   36,   35,  296, 1384,
 /*   950 */    42,   40,   39,   38,   37, 1806,  144,  261, 1958,  653,
 /*   960 */   667,  652,  294,   66, 1798,  290,   65, 1403, 1784, 2065,
 /*   970 */  1521,   48,  424,    3, 1348, 1743,  230,  503,  146,  145,
 /*   980 */   650,  649,  648,  143,  193,  456,  454,   36,   35, 1976,
 /*   990 */   571,   42,   40,   39,   38,   37,  226,  618, 1739,  502,
 /*  1000 */   225,  601, 1926,  653,  617,  408,   36,   35,   51, 1657,
 /*  1010 */    42,   40,   39,   38,   37,  429,  235,  137,  409,  125,
 /*  1020 */    58,  601,  146,  145,  650,  649,  648,  143, 1741, 1957,
 /*  1030 */   154,  515, 1754, 1992, 1564,  430,  100, 1959,  621, 1961,
 /*  1040 */  1962,  616,   25,  611,  216, 1614,   67,  214, 2133, 1737,
 /*  1050 */  2045,  608, 1754, 1650,  356, 2041,   82,  322,   60,   99,
 /*  1060 */   532, 1958,  530,   36,   35, 2079,  231,   42,   40,   39,
 /*  1070 */    38,   37,   36,   35,  612,  517,   42,   40,   39,   38,
 /*  1080 */    37,  601, 1521,  218, 1387,  220,  217,  601,  219, 1648,
 /*  1090 */  1947,  222, 1976, 2085,  221,  477,   75,   74,   73,  404,
 /*  1100 */   618, 1751,  180,  601,  240, 1926, 1958,  617, 1435, 1386,
 /*  1110 */  1551,  520, 1754, 1945, 1596, 1597,   50,  139, 1754,  645,
 /*  1120 */   318,  546,   45,  392, 1940,  390,  386,  382,  379,  376,
 /*  1130 */   264, 1524, 1957,  601, 1754,  601, 1992, 1976, 1949,  100,
 /*  1140 */  1959,  621, 1961, 1962,  616,  618,  611,  543,  140,  583,
 /*  1150 */  1926, 2133,  617, 2045, 1936, 1942,  242,  356, 2041, 1709,
 /*  1160 */  1544,  601,  142,   96, 1754,  611, 1754,  253, 2107,  176,
 /*  1170 */    11,   10,  555,   93, 1324,  271,  209, 1957,  247, 1958,
 /*  1180 */   144, 1992,  269, 1977,  100, 1959,  621, 1961, 1962,  616,
 /*  1190 */   373,  611, 1754, 1479,  359,  358, 2133,  601, 2045,   60,
 /*  1200 */   593,   45,  356, 2041, 1392,  601, 1638,  661,  601,  572,
 /*  1210 */  1976,  598, 1859, 2064,  273, 1458,  601, 1385,  618,  599,
 /*  1220 */   211,  585,  277, 1926,  375,  617, 1795, 1594, 1754, 1156,
 /*  1230 */   369, 1390, 1208,  662, 1958,  162, 1754,   45, 2075, 1754,
 /*  1240 */  1453,  495,  491,  487,  483,  208,  625, 1754,  142,  144,
 /*  1250 */  1957, 1495, 1384, 1444, 1992, 1154, 1389,  100, 1959,  621,
 /*  1260 */  1961, 1962,  616,  547,  611, 1976,  547, 2113,  126, 2020,
 /*  1270 */  2113, 2045, 1137,  618,  580,  356, 2041,  142, 1926,  255,
 /*  1280 */   617,   81, 2119,  173,  206, 2119,  173, 2114,  568,  289,
 /*  1290 */  2114,  568,    4,  378,  374,    1,  252,  383, 1236,  607,
 /*  1300 */  1240, 1247,  332, 1341,  284, 1957,  186, 1138,  410, 1992,
 /*  1310 */  1406,  414,  100, 1959,  621, 1961, 1962,  616, 1860,  611,
 /*  1320 */  1245, 1593,  445,  419, 2018, 1401, 2045,  431, 1852,  147,
 /*  1330 */   356, 2041,  438,  444,  452,  446,  547,  453,  190,  455,
 /*  1340 */  2113,  457, 1407,  458,  467, 1409, 1958,  535,  470,  196,
 /*  1350 */   198,  205,  199, 1408,  204, 2119,  173,  474,  471,  472,
 /*  1360 */  2114,  568, 1393, 1410, 1388,  473,  201,  475,  203,   78,
 /*  1370 */    79,  479, 1111,  197,  207,  496, 1958, 1976,  497,  498,
 /*  1380 */   500,  103, 1744,  534,  213,  618,  321, 1396, 1398,  547,
 /*  1390 */  1926, 1905,  617, 2113,  536,  285, 1740,  215,  537,  609,
 /*  1400 */  1451, 1452, 1454, 1455, 1456, 1457,  149, 1976, 2119,  173,
 /*  1410 */   150,  538, 1742, 2114,  568,  618, 1902, 1957, 1738,  151,
 /*  1420 */  1926, 1992,  617,  152,  100, 1959,  621, 1961, 1962,  616,
 /*  1430 */  1901,  611, 1958,  229,  232,  544,  604,  541, 2045,  551,
 /*  1440 */   556,  591,  356, 2041, 2076, 2067, 2091, 1957, 2086,  553,
 /*  1450 */     5, 1992, 1958,  346,  101, 1959,  621, 1961, 1962,  616,
 /*  1460 */   238,  611, 2090, 1976,  559,  241,  565,  552, 2045,  550,
 /*  1470 */   248,  618, 2044, 2041,  249,  246, 1926,  549,  617,  347,
 /*  1480 */   250,  251,  576, 1976,  163,  573, 1521,  130, 1405, 2061,
 /*  1490 */   350,  618,  584, 1411, 2136,  260, 1926, 1864,  617,  589,
 /*  1500 */   286,  590, 1873, 1957, 1872,  287, 1871, 1992,  352, 2112,
 /*  1510 */   101, 1959,  621, 1961, 1962,  616,  594,  611,   88,  595,
 /*  1520 */  1958,   90,  254,  619, 2045,  288,   57, 1992,  606, 2041,
 /*  1530 */   101, 1959,  621, 1961, 1962,  616, 1958,  611, 1755, 2026,
 /*  1540 */    92, 1799, 1725,  623, 2045,  280,  704,  291,  326, 2041,
 /*  1550 */   705, 1976,  707,   49,  315,  323,  324,  295, 1920,  618,
 /*  1560 */    71, 1918, 1917,   72, 1926,  300,  617, 1976, 1919,  314,
 /*  1570 */   293,  304, 1914,  380,  381,  618, 1370, 1371,  179,  385,
 /*  1580 */  1926, 1912,  617,  387,  388,  389, 1911,  391, 1910,  393,
 /*  1590 */  1909, 1957,  395, 1908,  397, 1992, 1344, 1958,  159, 1959,
 /*  1600 */   621, 1961, 1962,  616, 1343,  611, 1884, 1957, 1883,  402,
 /*  1610 */   403, 1992, 1882, 1881,  159, 1959,  621, 1961, 1962,  616,
 /*  1620 */  1302,  611, 1845, 1844, 1842,  136, 1841, 1840, 1976,  184,
 /*  1630 */   420, 1833,  422, 1832, 1831, 1830,  618, 1843, 1839,  548,
 /*  1640 */  2082, 1926, 1958,  617, 1838, 1836, 1835, 1834, 1829, 1828,
 /*  1650 */  1827, 1826, 1825, 1824, 1823, 1822, 2083, 1821, 1820, 1819,
 /*  1660 */  1818,  138, 1817, 1816, 1815, 1814, 1813, 1812, 1957, 1811,
 /*  1670 */  1810,  448, 1992, 1976, 1183,  306, 1959,  621, 1961, 1962,
 /*  1680 */   616,  618,  611, 1304, 1809, 1808, 1926, 1672,  617, 1671,
 /*  1690 */   191, 1669, 1633, 1097,  192, 1632, 1897, 1096,  194, 1891,
 /*  1700 */  1880,  202, 1879, 1958, 1862, 1733, 1130,   69, 1668, 1666,
 /*  1710 */  1664,  480,  195, 1957,   70,  168,  200, 1992, 1662,  564,
 /*  1720 */   160, 1959,  621, 1961, 1962,  616, 1958,  611, 1946,  463,
 /*  1730 */  1660, 1647,  482,  465, 1976, 1646,  481,  486,  484,  351,
 /*  1740 */   490,  488,  618,  212,   59,  485,  492, 1926, 1629,  617,
 /*  1750 */  1735, 1252,  494, 1734, 1251,  489, 1174, 1976, 1173, 1172,
 /*  1760 */   493, 1171, 1166,  676,  678,  615, 1658,  341, 1168, 1167,
 /*  1770 */  1926, 1165,  617, 2135, 1957, 1651,  342, 1649, 1992,  518,
 /*  1780 */   343,  313, 1959,  621, 1961, 1962,  616, 1958,  611, 1628,
 /*  1790 */   521,  523, 1627, 1626,  525,  527,  102, 1957, 1359, 1358,
 /*  1800 */  1896, 1992,  531, 1350,  312, 1959,  621, 1961, 1962,  616,
 /*  1810 */  1362,  611,   24, 2011, 1890, 1878,  539, 1958, 1976, 1876,
 /*  1820 */  2118, 1566,   17,  361,  239,   14,  618,   56,  244,  245,
 /*  1830 */    28, 1926,   26,  617,  237,   18,   53, 1550, 1543,  161,
 /*  1840 */  1958,  540,  243, 1947,   27,  233,   84,   61, 1976,   19,
 /*  1850 */    15, 1581,   55,  363,  257, 1580,  618,  344, 1957,  348,
 /*  1860 */  1585, 1926, 1992,  617, 1584,  313, 1959,  621, 1961, 1962,
 /*  1870 */   616, 1976,  611,  153,  349, 1586, 1587, 1518,  164,  618,
 /*  1880 */  1877, 1517, 1875, 1874, 1926, 1958,  617,  262, 1957, 1861,
 /*  1890 */    20,  545, 1992,  263, 1548,  313, 1959,  621, 1961, 1962,
 /*  1900 */   616, 1958,  611,   87,  265,  270,   86,   89,   93,  275,
 /*  1910 */    21,  533,  592,   10, 1394, 1992, 1976, 1995,  308, 1959,
 /*  1920 */   621, 1961, 1962,  616,  618,  611,  272, 1426, 1448, 1926,
 /*  1930 */   610,  617, 1976, 1446, 1445,  165,  622,   34,   13,  624,
 /*  1940 */   618,   22,  177, 1480, 1418, 1926,   23,  617, 1237,  364,
 /*  1950 */   626,  628, 1234,  629, 1958, 1231, 1957,   54,  631,  620,
 /*  1960 */  1992, 1225,  632,  297, 1959,  621, 1961, 1962,  616,  634,
 /*  1970 */   611,  635, 1957, 1223,  637, 1214, 1992,  278,  644,  298,
 /*  1980 */  1959,  621, 1961, 1962,  616, 1976,  611, 1470,  638, 1229,
 /*  1990 */     8, 1228, 1469,  618, 1227,   94,   95, 1226, 1926, 1958,
 /*  2000 */   617, 1246,   68, 1242, 1128,  654, 1162, 1161, 1160, 1159,
 /*  2010 */  1158, 1157, 1155, 1153, 1152, 1151, 1181, 1146,  666, 1149,
 /*  2020 */  1148, 1147, 1145, 1144, 1143, 1957,  279, 1178, 1176, 1992,
 /*  2030 */  1976, 1140,  299, 1959,  621, 1961, 1962,  616,  618,  611,
 /*  2040 */  1139, 1136, 1135, 1926, 1134,  617, 1133, 1665,  686,  687,
 /*  2050 */  1663,  688, 1958,  690,  692, 1661,  691,  695,  694,  696,
 /*  2060 */  1659,  698,  699,  700, 1645,  702, 1625, 1086, 1958,  706,
 /*  2070 */  1957,  282,  710, 1380, 1992, 1600,  292,  305, 1959,  621,
 /*  2080 */  1961, 1962,  616, 1976,  611, 1600,  709, 1600, 1600, 1600,
 /*  2090 */  1600,  618, 1600, 1600, 1600, 1600, 1926, 1600,  617, 1976,
 /*  2100 */  1600, 1600, 1600, 1600, 1600, 1600, 1600,  618, 1600, 1600,
 /*  2110 */  1600, 1600, 1926, 1958,  617, 1600, 1600, 1600, 1600, 1600,
 /*  2120 */  1600, 1600, 1600, 1957, 1600, 1600, 1600, 1992, 1600, 1600,
 /*  2130 */   309, 1959,  621, 1961, 1962,  616, 1600,  611, 1600, 1957,
 /*  2140 */  1600, 1600, 1600, 1992, 1976, 1600,  301, 1959,  621, 1961,
 /*  2150 */  1962,  616,  618,  611, 1600, 1600, 1600, 1926, 1600,  617,
 /*  2160 */  1600, 1600, 1600, 1600, 1600, 1600, 1958, 1600, 1600, 1600,
 /*  2170 */  1600, 1600, 1600, 1600, 1600, 1600, 1600, 1600, 1600, 1600,
 /*  2180 */  1600, 1600, 1958, 1600, 1957, 1600, 1600, 1600, 1992, 1600,
 /*  2190 */  1600,  310, 1959,  621, 1961, 1962,  616, 1976,  611, 1600,
 /*  2200 */  1600, 1600, 1600, 1600, 1600,  618, 1600, 1600, 1600, 1600,
 /*  2210 */  1926, 1600,  617, 1976, 1600, 1600, 1600, 1600, 1600, 1600,
 /*  2220 */  1600,  618, 1600, 1600, 1600, 1600, 1926, 1958,  617, 1600,
 /*  2230 */  1600, 1600, 1600, 1600, 1600, 1600, 1600, 1957, 1600, 1600,
 /*  2240 */  1600, 1992, 1600, 1600,  302, 1959,  621, 1961, 1962,  616,
 /*  2250 */  1958,  611, 1600, 1957, 1600, 1600, 1600, 1992, 1976, 1600,
 /*  2260 */   311, 1959,  621, 1961, 1962,  616,  618,  611, 1600, 1600,
 /*  2270 */  1600, 1926, 1600,  617, 1600, 1600, 1600, 1600, 1600, 1600,
 /*  2280 */  1958, 1976, 1600, 1600, 1600, 1600, 1600, 1600, 1600,  618,
 /*  2290 */  1600, 1600, 1600, 1600, 1926, 1600,  617, 1600, 1957, 1600,
 /*  2300 */  1600, 1600, 1992, 1600, 1600,  303, 1959,  621, 1961, 1962,
 /*  2310 */   616, 1976,  611, 1600, 1600, 1600, 1600, 1600, 1600,  618,
 /*  2320 */  1600, 1957, 1600, 1600, 1926, 1992,  617, 1600,  316, 1959,
 /*  2330 */   621, 1961, 1962,  616, 1600,  611, 1600, 1600, 1600, 1600,
 /*  2340 */  1600, 1600, 1600, 1600, 1600, 1600, 1600, 1600, 1600, 1600,
 /*  2350 */  1600, 1957, 1600, 1600, 1600, 1992, 1958, 1600,  317, 1959,
 /*  2360 */   621, 1961, 1962,  616, 1600,  611, 1600, 1600, 1600, 1600,
 /*  2370 */  1600, 1600, 1600, 1600, 1600, 1600, 1600, 1600, 1958, 1600,
 /*  2380 */  1600, 1600, 1600, 1600, 1600, 1600, 1600, 1976, 1600, 1600,
 /*  2390 */  1600, 1600, 1600, 1600, 1600,  618, 1600, 1600, 1600, 1600,
 /*  2400 */  1926, 1600,  617, 1600, 1600, 1600, 1600, 1600, 1600, 1976,
 /*  2410 */  1600, 1600, 1600, 1600, 1600, 1600, 1600,  618, 1600, 1600,
 /*  2420 */  1600, 1600, 1926, 1600,  617, 1600, 1600, 1957, 1600, 1600,
 /*  2430 */  1600, 1992, 1600, 1958, 1970, 1959,  621, 1961, 1962,  616,
 /*  2440 */  1600,  611, 1600, 1600, 1600, 1600, 1600, 1600, 1600, 1957,
 /*  2450 */  1600, 1600, 1600, 1992, 1600, 1600, 1969, 1959,  621, 1961,
 /*  2460 */  1962,  616, 1600,  611, 1976, 1600, 1600, 1600, 1600, 1600,
 /*  2470 */  1600, 1600,  618, 1600, 1600, 1600, 1600, 1926, 1958,  617,
 /*  2480 */  1600, 1600, 1600, 1600, 1600, 1600, 1600, 1600, 1600, 1600,
 /*  2490 */  1600, 1600, 1600, 1600, 1600, 1600, 1600, 1600, 1600, 1600,
 /*  2500 */  1600, 1600, 1600, 1600, 1957, 1600, 1600, 1600, 1992, 1976,
 /*  2510 */  1600, 1968, 1959,  621, 1961, 1962,  616,  618,  611, 1600,
 /*  2520 */  1600, 1600, 1926, 1958,  617, 1600, 1600, 1600, 1600, 1600,
 /*  2530 */  1600, 1600, 1600, 1600, 1600, 1600, 1600, 1600, 1600, 1958,
 /*  2540 */  1600, 1600, 1600, 1600, 1600, 1600, 1600, 1600, 1600, 1957,
 /*  2550 */  1600, 1600, 1600, 1992, 1976, 1600,  328, 1959,  621, 1961,
 /*  2560 */  1962,  616,  618,  611, 1600, 1600, 1600, 1926, 1600,  617,
 /*  2570 */  1976, 1600, 1600, 1600, 1600, 1600, 1600, 1600,  618, 1600,
 /*  2580 */  1600, 1600, 1600, 1926, 1958,  617, 1600, 1600, 1600, 1600,
 /*  2590 */  1600, 1600, 1600, 1600, 1957, 1600, 1600, 1600, 1992, 1600,
 /*  2600 */  1600,  329, 1959,  621, 1961, 1962,  616, 1958,  611, 1600,
 /*  2610 */  1957, 1600, 1600, 1600, 1992, 1976, 1600,  325, 1959,  621,
 /*  2620 */  1961, 1962,  616,  618,  611, 1600, 1600, 1600, 1926, 1600,
 /*  2630 */   617, 1600, 1600, 1600, 1600, 1600, 1600, 1958, 1976, 1600,
 /*  2640 */  1600, 1600, 1600, 1600, 1600, 1600,  618, 1600, 1600, 1600,
 /*  2650 */  1600, 1926, 1600,  617, 1600, 1957, 1600, 1600, 1600, 1992,
 /*  2660 */  1600, 1600,  330, 1959,  621, 1961, 1962,  616, 1976,  611,
 /*  2670 */  1600, 1600, 1600, 1600, 1600, 1600,  618, 1600,  619, 1600,
 /*  2680 */  1600, 1926, 1992,  617, 1600,  308, 1959,  621, 1961, 1962,
 /*  2690 */   616, 1600,  611, 1600, 1600, 1600, 1600, 1600, 1600, 1600,
 /*  2700 */  1600, 1600, 1600, 1600, 1600, 1600, 1600, 1600, 1957, 1600,
 /*  2710 */  1600, 1600, 1992, 1600, 1600,  307, 1959,  621, 1961, 1962,
 /*  2720 */   616, 1600,  611,
494 495
};
static const YYCODETYPE yy_lookahead[] = {
496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516
 /*     0 */   329,  348,  331,  332,  429,  333,  333,  429,  433,  356,
 /*    10 */   358,  433,   12,   13,   14,   14,   15,   16,  365,  347,
 /*    20 */    20,  369,   22,  448,  449,   20,  354,  449,  453,  454,
 /*    30 */   325,  453,  454,   33,   20,   35,  364,  364,  329,  333,
 /*    40 */   331,  332,    8,    9,  358,  333,   12,   13,   14,   15,
 /*    50 */    16,  399,  400,  401,  391,  369,  356,  333,   58,   14,
 /*    60 */    20,  356,  410,   63,  367,   20,  356,  370,  371,  364,
 /*    70 */    70,   20,   20,  363,  369,  340,  371,  377,  378,  373,
 /*    80 */   345,  356,  372,   12,   13,  399,  400,  401,  364,  364,
 /*    90 */    62,   20,  380,   22,  382,   95,  410,   63,  425,  426,
 /*   100 */   427,  396,  429,  430,   33,  400,   35,    3,  403,  404,
 /*   110 */   405,  406,  407,  408,  333,  410,   20,  117,   22,   62,
 /*   120 */   415,  330,  417,   20,  333,  334,  421,  422,  347,   58,
 /*   130 */   405,   35,  132,  133,   63,  354,  418,  419,  104,  429,
 /*   140 */   435,   70,  324,  433,  326,  364,   95,   51,  443,  425,
 /*   150 */   426,  427,  333,  429,  430,  325,  325,  433,  448,  449,
 /*   160 */   333,  161,  162,  453,  454,  333,   95,   12,   13,   14,
 /*   170 */    15,   16,  448,  449,  347,  161,  162,  453,  454,  337,
 /*   180 */   180,  333,  182,  364,  132,  133,  330,  356,  117,  333,
 /*   190 */   334,  364,   20,  351,  160,  364,  364,   20,   95,  369,
 /*   200 */   369,  359,  371,  132,  133,  205,  206,    4,  208,  209,
X
Xiaoyu Wang 已提交
517
 /*   210 */   210,  211,  212,  213,  214,  215,  216,  217,  218,  219,
518 519 520 521 522 523
 /*   220 */   220,  221,  222,  223,  224,  225,  226,  396,  380,   95,
 /*   230 */   382,  400,  161,  162,  403,  404,  405,  406,  407,  408,
 /*   240 */   409,  410,  411,  412,  425,  426,  427,   20,  429,  430,
 /*   250 */    37,  180,  402,  182,  370,  371,  424,  425,  426,  427,
 /*   260 */   166,  429,  430,  325,   95,  231,  232,  233,  234,  235,
 /*   270 */   236,  237,  238,  239,  240,  241,  205,  206,  428,  208,
524
 /*   280 */   209,  210,  211,  212,  213,  214,  215,  216,  217,  218,
525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545
 /*   290 */   219,  220,  221,  222,  223,  224,  225,  226,   95,  228,
 /*   300 */    12,   13,    0,   95,  205,  322,  364,  369,   20,   14,
 /*   310 */    22,   98,    0,  100,  101,   20,  103,  375,  325,  325,
 /*   320 */   107,   33,   95,   35,  108,  109,  110,  111,  112,  113,
 /*   330 */   114,  115,  116,  117,  118,  163,  120,  121,  122,  123,
 /*   340 */   124,  125,  129,  249,  250,   58,   58,  244,  179,  356,
 /*   350 */   181,   63,  253,  254,  255,  256,  257,  364,   70,   20,
 /*   360 */    35,   22,  369,  369,  371,  261,  175,   65,   66,   67,
 /*   370 */   387,   12,   13,   14,   62,   73,   74,  387,  244,   20,
 /*   380 */    78,   22,   95,   95,   97,   83,   84,  196,  197,  396,
 /*   390 */    51,   89,   33,  400,   35,   70,  403,  404,  405,  406,
 /*   400 */   407,  408,  325,  410,  339,  117,  413,  325,  415,  416,
 /*   410 */   417,  333,  429,  244,  421,  422,  433,   58,  353,  429,
 /*   420 */   132,  133,  355,  433,   20,  347,  126,  362,   44,   70,
 /*   430 */   325,  448,  449,  356,    0,  368,  453,  454,  448,  449,
 /*   440 */    22,  364,  364,  453,  454,  356,  369,  244,  371,  161,
 /*   450 */   162,  369,  244,   35,   95,   21,  161,  371,   24,   25,
 /*   460 */    26,   27,   28,   29,   30,   31,   32,  378,  180,  383,
 /*   470 */   182,  244,  386,  396,  369,  349,  117,  400,  352,  356,
 /*   480 */   403,  404,  405,  406,  407,  408,  363,  410,   70,  189,
 /*   490 */   190,  132,  133,  205,  206,  372,  208,  209,  210,  211,
546
 /*   500 */   212,  213,  214,  215,  216,  217,  218,  219,  220,  221,
547 548 549 550 551 552
 /*   510 */   222,  223,  224,  225,  226,  342,  343,  342,  343,   21,
 /*   520 */   161,  162,   24,   25,   26,   27,   28,   29,   30,   31,
 /*   530 */    32,  244,  455,  456,  348,  117,   65,   66,   67,  180,
 /*   540 */   348,  182,  356,  356,   73,   74,   14,    0,  356,   78,
 /*   550 */   363,  365,   20,   20,   83,   84,    0,  365,  325,  372,
 /*   560 */    89,  126,  127,   20,  205,  206,  131,  208,  209,  210,
553
 /*   570 */   211,  212,  213,  214,  215,  216,  217,  218,  219,  220,
554 555
 /*   580 */   221,  222,  223,  224,  225,  226,   12,   13,    0,  356,
 /*   590 */   325,  333,   58,   21,   20,   48,   22,  364,  180,    0,
556
 /*   600 */   182,  325,  369,  106,  371,  347,   34,   33,   36,   35,
557 558 559 560 561 562 563 564 565 566 567
 /*   610 */   358,  333,   24,   25,   26,   27,   28,   29,   30,   31,
 /*   620 */    32,  369,  364,  205,  206,  347,    1,    2,   94,  396,
 /*   630 */   325,   97,   58,  400,  369,  325,  403,  404,  405,  406,
 /*   640 */   407,  408,  364,  410,   70,  369,  337,  339,  415,  265,
 /*   650 */   417,  399,  400,  413,  421,  422,  416,   12,   13,  333,
 /*   660 */     4,   62,  410,  107,    3,   20,  325,   22,  359,   95,
 /*   670 */   362,   79,  325,  347,  369,   19,  443,  371,   33,  369,
 /*   680 */    35,   20,  126,  127,  128,  129,  130,  131,    2,   33,
 /*   690 */   364,  117,  386,  161,    8,    9,  163,  356,   12,   13,
 /*   700 */    14,   15,   16,   58,   48,  364,  132,  133,  325,   53,
 /*   710 */   369,  325,  371,  402,   58,   70,  369,  325,  429,    8,
568
 /*   720 */     9,   96,  433,   12,   13,   14,   15,   16,   20,  137,
569 570 571
 /*   730 */   138,   20,    0,  160,  402,  161,  162,  396,  449,  428,
 /*   740 */    95,  400,  453,  454,  403,  404,  405,  406,  407,  408,
 /*   750 */    94,  410,  369,   97,  180,  369,  182,   96,  417,    2,
572
 /*   760 */   428,  369,  117,  422,  325,    8,    9,  325,  325,   12,
573 574
 /*   770 */    13,   14,   15,   16,  228,  325,    4,  132,  133,  205,
 /*   780 */   206,   49,  208,  209,  210,  211,  212,  213,  214,  215,
575
 /*   790 */   216,  217,  218,  219,  220,  221,  222,  223,  224,  225,
576 577 578 579 580
 /*   800 */   226,   18,   58,   20,  231,  325,  161,  162,  369,   19,
 /*   810 */    27,  369,  369,   30,  241,   43,   33,   45,   46,  369,
 /*   820 */   414,    0,  416,   33,  163,  180,    0,  182,  325,  364,
 /*   830 */   228,   48,  230,   50,  356,  414,   53,  416,   48,  366,
 /*   840 */   375,   97,  369,  365,   54,   55,   56,   57,   58,  369,
581
 /*   850 */   205,  206,    0,  208,  209,  210,  211,  212,  213,  214,
582
 /*   860 */   215,  216,  217,  218,  219,  220,  221,  222,  223,  224,
583 584 585
 /*   870 */   225,  226,  369,   20,  163,    8,    9,   94,   39,   12,
 /*   880 */    13,   14,   15,   16,   94,  364,  344,   97,  346,  106,
 /*   890 */     4,   65,   66,   67,   68,   69,  375,   71,   72,   73,
586
 /*   900 */    74,   75,   76,   77,   78,   79,   80,   81,   82,   83,
587 588
 /*   910 */    84,   85,   86,   87,   88,   89,   90,   91,  366,  136,
 /*   920 */   130,  369,  139,  140,  141,  142,  143,  144,  145,  146,
589 590 591 592 593
 /*   930 */   147,  148,  149,  150,  151,  152,  153,  154,  155,  356,
 /*   940 */   157,  158,  159,   18,   45,   46,    8,    9,   23,   70,
 /*   950 */    12,   13,   14,   15,   16,  372,   44,  167,  325,  107,
 /*   960 */    70,  366,   37,   38,  369,  349,   41,   20,  352,  242,
 /*   970 */   243,   42,  151,   44,  184,  357,  186,  107,  126,  127,
594
 /*   980 */   128,  129,  130,  131,   59,   60,   61,    8,    9,  356,
595 596 597 598 599 600 601 602 603 604 605 606 607 608 609
 /*   990 */    44,   12,   13,   14,   15,   16,  127,  364,  357,  129,
 /*  1000 */   131,  333,  369,  107,  371,   22,    8,    9,   96,    0,
 /*  1010 */    12,   13,   14,   15,   16,  347,  163,   42,   35,   44,
 /*  1020 */    95,  333,  126,  127,  128,  129,  130,  131,  357,  396,
 /*  1030 */   163,   22,  364,  400,   96,  347,  403,  404,  405,  406,
 /*  1040 */   407,  408,   44,  410,   99,  326,  106,  102,  415,  357,
 /*  1050 */   417,   63,  364,    0,  421,  422,  187,  188,   44,  134,
 /*  1060 */   191,  325,  193,    8,    9,  432,  357,   12,   13,   14,
 /*  1070 */    15,   16,    8,    9,  357,   22,   12,   13,   14,   15,
 /*  1080 */    16,  333,  243,   99,   35,   99,  102,  333,  102,    0,
 /*  1090 */    47,   99,  356,  379,  102,  347,  156,  172,  173,  174,
 /*  1100 */   364,  347,  177,  333,   44,  369,  325,  371,  161,   35,
 /*  1110 */    96,   22,  364,  358,  132,  133,  163,  347,  364,  357,
 /*  1120 */   195,  168,   44,  198,  369,  200,  201,  202,  203,  204,
 /*  1130 */    44,  245,  396,  333,  364,  333,  400,  356,   95,  403,
610 611
 /*  1140 */   404,  405,  406,  407,  408,  364,  410,  347,   44,  347,
 /*  1150 */   369,  415,  371,  417,  399,  400,   96,  421,  422,  345,
612 613 614 615 616 617 618 619 620 621 622 623
 /*  1160 */    96,  333,   44,   95,  364,  410,  364,  457,  432,  244,
 /*  1170 */     1,    2,  446,  105,   96,  347,  335,  396,  440,  325,
 /*  1180 */    44,  400,   96,  356,  403,  404,  405,  406,  407,  408,
 /*  1190 */   335,  410,  364,  205,   12,   13,  415,  333,  417,   44,
 /*  1200 */    96,   44,  421,  422,   22,  333,  332,   13,  333,  263,
 /*  1210 */   356,  347,  379,  432,   96,   33,  333,   35,  364,  347,
 /*  1220 */    33,  387,  347,  369,  387,  371,  368,  172,  364,   35,
 /*  1230 */   347,  182,   96,   13,  325,   48,  364,   44,  379,  364,
 /*  1240 */    58,   54,   55,   56,   57,   58,   44,  364,   44,   44,
 /*  1250 */   396,   96,   70,   96,  400,   35,  182,  403,  404,  405,
 /*  1260 */   406,  407,  408,  429,  410,  356,  429,  433,   44,  415,
 /*  1270 */   433,  417,   35,  364,  431,  421,  422,   44,  369,  450,
624
 /*  1280 */   371,   94,  448,  449,   97,  448,  449,  453,  454,   96,
625 626 627 628 629 630 631 632 633 634 635
 /*  1290 */   453,  454,  246,  398,  387,  434,  423,   48,   96,  117,
 /*  1300 */    96,   96,  397,  178,  389,  396,   42,   70,  376,  400,
 /*  1310 */    20,  376,  403,  404,  405,  406,  407,  408,  379,  410,
 /*  1320 */    96,  266,  160,  374,  415,   20,  417,  333,  333,   96,
 /*  1330 */   421,  422,  376,  374,   93,  374,  429,  341,  333,  333,
 /*  1340 */   433,  333,   20,  327,  327,   20,  325,  387,  393,  339,
 /*  1350 */   339,  164,  165,   20,  167,  448,  449,  170,  371,  334,
 /*  1360 */   453,  454,  180,   20,  182,  388,  339,  334,  339,  339,
 /*  1370 */   339,  333,   52,  186,  339,  336,  325,  356,  336,  327,
 /*  1380 */   356,  333,  356,  194,  356,  364,  327,  205,  206,  429,
 /*  1390 */   369,  369,  371,  433,  395,  393,  356,  356,  185,  217,
636
 /*  1400 */   218,  219,  220,  221,  222,  223,  356,  356,  448,  449,
637
 /*  1410 */   356,  392,  356,  453,  454,  364,  369,  396,  356,  356,
638
 /*  1420 */   369,  400,  371,  356,  403,  404,  405,  406,  407,  408,
639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658
 /*  1430 */   369,  410,  325,  337,  337,  333,  415,  371,  417,  369,
 /*  1440 */   252,  251,  421,  422,  379,  442,  439,  396,  379,  369,
 /*  1450 */   258,  400,  325,  369,  403,  404,  405,  406,  407,  408,
 /*  1460 */   384,  410,  439,  356,  369,  384,  171,  260,  417,  259,
 /*  1470 */   438,  364,  421,  422,  437,  441,  369,  247,  371,  267,
 /*  1480 */   436,  398,  264,  356,  439,  262,  243,  364,   20,  402,
 /*  1490 */   334,  364,  333,   20,  458,  337,  369,  382,  371,  369,
 /*  1500 */   384,  369,  369,  396,  369,  384,  369,  400,  369,  452,
 /*  1510 */   403,  404,  405,  406,  407,  408,  165,  410,  337,  381,
 /*  1520 */   325,  337,  451,  396,  417,  352,   95,  400,  421,  422,
 /*  1530 */   403,  404,  405,  406,  407,  408,  325,  410,  364,  420,
 /*  1540 */    95,  369,  346,  360,  417,  337,   36,  333,  421,  422,
 /*  1550 */   328,  356,  327,  390,  394,  385,  385,  323,    0,  364,
 /*  1560 */   187,    0,    0,   42,  369,  350,  371,  356,    0,  350,
 /*  1570 */   338,  350,    0,   35,  199,  364,   35,   35,   35,  199,
 /*  1580 */   369,    0,  371,   35,   35,  199,    0,  199,    0,   35,
 /*  1590 */     0,  396,   22,    0,   35,  400,  182,  325,  403,  404,
 /*  1600 */   405,  406,  407,  408,  180,  410,    0,  396,    0,  176,
 /*  1610 */   175,  400,    0,    0,  403,  404,  405,  406,  407,  408,
 /*  1620 */    47,  410,    0,    0,    0,   42,    0,    0,  356,  151,
659 660
 /*  1630 */    35,    0,  151,    0,    0,    0,  364,    0,    0,  444,
 /*  1640 */   445,  369,  325,  371,    0,    0,    0,    0,    0,    0,
661 662
 /*  1650 */     0,    0,    0,    0,    0,    0,  445,    0,    0,    0,
 /*  1660 */     0,   42,    0,    0,    0,    0,    0,    0,  396,    0,
663
 /*  1670 */     0,  135,  400,  356,   35,  403,  404,  405,  406,  407,
664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681
 /*  1680 */   408,  364,  410,   22,    0,    0,  369,    0,  371,    0,
 /*  1690 */    58,    0,    0,   14,   58,    0,    0,   14,   42,    0,
 /*  1700 */     0,  171,    0,  325,    0,    0,   64,   39,    0,    0,
 /*  1710 */     0,   35,   40,  396,   39,   44,   39,  400,    0,  447,
 /*  1720 */   403,  404,  405,  406,  407,  408,  325,  410,   47,   47,
 /*  1730 */     0,    0,   39,   47,  356,    0,   48,   39,   35,  361,
 /*  1740 */    39,   35,  364,  102,  104,   48,   35,  369,    0,  371,
 /*  1750 */     0,   35,   39,    0,   22,   48,   35,  356,   35,   35,
 /*  1760 */    48,   35,   22,   44,   44,  364,    0,   22,   35,   35,
 /*  1770 */   369,   35,  371,  456,  396,    0,   22,    0,  400,   50,
 /*  1780 */    22,  403,  404,  405,  406,  407,  408,  325,  410,    0,
 /*  1790 */    35,   35,    0,    0,   35,   22,   20,  396,   35,   35,
 /*  1800 */     0,  400,  192,   35,  403,  404,  405,  406,  407,  408,
 /*  1810 */    96,  410,   95,  412,    0,    0,   22,  325,  356,    0,
 /*  1820 */     3,   96,   44,  361,   96,  248,  364,   44,   44,   47,
 /*  1830 */    44,  369,   95,  371,   95,  248,  163,   96,   96,   95,
 /*  1840 */   325,  163,   95,   47,   95,  165,   95,    3,  356,   44,
 /*  1850 */   248,   35,   44,  361,   47,   35,  364,  163,  396,   35,
682
 /*  1860 */    35,  369,  400,  371,   35,  403,  404,  405,  406,  407,
683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698
 /*  1870 */   408,  356,  410,  183,   35,   96,   96,   96,   47,  364,
 /*  1880 */     0,   96,    0,    0,  369,  325,  371,   47,  396,    0,
 /*  1890 */    95,  169,  400,   96,   96,  403,  404,  405,  406,  407,
 /*  1900 */   408,  325,  410,   39,   95,   95,   95,   95,  105,   47,
 /*  1910 */    44,  396,  166,    2,   22,  400,  356,   95,  403,  404,
 /*  1920 */   405,  406,  407,  408,  364,  410,  164,   22,   96,  369,
 /*  1930 */    95,  371,  356,   96,   96,   47,  106,   95,   95,   35,
 /*  1940 */   364,   95,   47,  205,   96,  369,   95,  371,   96,   35,
 /*  1950 */    95,   35,   96,   95,  325,   96,  396,  242,   35,  207,
 /*  1960 */   400,   96,   95,  403,  404,  405,  406,  407,  408,   35,
 /*  1970 */   410,   95,  396,   96,   35,   22,  400,   44,  107,  403,
 /*  1980 */   404,  405,  406,  407,  408,  356,  410,  227,   95,  119,
 /*  1990 */   229,  119,  227,  364,  119,   95,   95,  119,  369,  325,
 /*  2000 */   371,   35,   95,   22,   64,   63,   35,   35,   35,   35,
 /*  2010 */    35,   35,   35,   35,   35,   35,   70,   22,   92,   35,
 /*  2020 */    35,   35,   35,   35,   35,  396,   44,   70,   35,  400,
699
 /*  2030 */   356,   35,  403,  404,  405,  406,  407,  408,  364,  410,
700 701 702 703 704
 /*  2040 */    35,   35,   35,  369,   22,  371,   35,    0,   35,   48,
 /*  2050 */     0,   39,  325,   35,   39,    0,   48,   48,   35,   39,
 /*  2060 */     0,   35,   48,   39,    0,   35,    0,   35,  325,   21,
 /*  2070 */   396,   22,   20,   22,  400,  459,   22,  403,  404,  405,
 /*  2080 */   406,  407,  408,  356,  410,  459,   21,  459,  459,  459,
705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 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
 /*  2090 */   459,  364,  459,  459,  459,  459,  369,  459,  371,  356,
 /*  2100 */   459,  459,  459,  459,  459,  459,  459,  364,  459,  459,
 /*  2110 */   459,  459,  369,  325,  371,  459,  459,  459,  459,  459,
 /*  2120 */   459,  459,  459,  396,  459,  459,  459,  400,  459,  459,
 /*  2130 */   403,  404,  405,  406,  407,  408,  459,  410,  459,  396,
 /*  2140 */   459,  459,  459,  400,  356,  459,  403,  404,  405,  406,
 /*  2150 */   407,  408,  364,  410,  459,  459,  459,  369,  459,  371,
 /*  2160 */   459,  459,  459,  459,  459,  459,  325,  459,  459,  459,
 /*  2170 */   459,  459,  459,  459,  459,  459,  459,  459,  459,  459,
 /*  2180 */   459,  459,  325,  459,  396,  459,  459,  459,  400,  459,
 /*  2190 */   459,  403,  404,  405,  406,  407,  408,  356,  410,  459,
 /*  2200 */   459,  459,  459,  459,  459,  364,  459,  459,  459,  459,
 /*  2210 */   369,  459,  371,  356,  459,  459,  459,  459,  459,  459,
 /*  2220 */   459,  364,  459,  459,  459,  459,  369,  325,  371,  459,
 /*  2230 */   459,  459,  459,  459,  459,  459,  459,  396,  459,  459,
 /*  2240 */   459,  400,  459,  459,  403,  404,  405,  406,  407,  408,
 /*  2250 */   325,  410,  459,  396,  459,  459,  459,  400,  356,  459,
 /*  2260 */   403,  404,  405,  406,  407,  408,  364,  410,  459,  459,
 /*  2270 */   459,  369,  459,  371,  459,  459,  459,  459,  459,  459,
 /*  2280 */   325,  356,  459,  459,  459,  459,  459,  459,  459,  364,
 /*  2290 */   459,  459,  459,  459,  369,  459,  371,  459,  396,  459,
 /*  2300 */   459,  459,  400,  459,  459,  403,  404,  405,  406,  407,
 /*  2310 */   408,  356,  410,  459,  459,  459,  459,  459,  459,  364,
 /*  2320 */   459,  396,  459,  459,  369,  400,  371,  459,  403,  404,
 /*  2330 */   405,  406,  407,  408,  459,  410,  459,  459,  459,  459,
 /*  2340 */   459,  459,  459,  459,  459,  459,  459,  459,  459,  459,
 /*  2350 */   459,  396,  459,  459,  459,  400,  325,  459,  403,  404,
 /*  2360 */   405,  406,  407,  408,  459,  410,  459,  459,  459,  459,
 /*  2370 */   459,  459,  459,  459,  459,  459,  459,  459,  325,  459,
 /*  2380 */   459,  459,  459,  459,  459,  459,  459,  356,  459,  459,
 /*  2390 */   459,  459,  459,  459,  459,  364,  459,  459,  459,  459,
 /*  2400 */   369,  459,  371,  459,  459,  459,  459,  459,  459,  356,
 /*  2410 */   459,  459,  459,  459,  459,  459,  459,  364,  459,  459,
 /*  2420 */   459,  459,  369,  459,  371,  459,  459,  396,  459,  459,
 /*  2430 */   459,  400,  459,  325,  403,  404,  405,  406,  407,  408,
 /*  2440 */   459,  410,  459,  459,  459,  459,  459,  459,  459,  396,
 /*  2450 */   459,  459,  459,  400,  459,  459,  403,  404,  405,  406,
 /*  2460 */   407,  408,  459,  410,  356,  459,  459,  459,  459,  459,
 /*  2470 */   459,  459,  364,  459,  459,  459,  459,  369,  325,  371,
 /*  2480 */   459,  459,  459,  459,  459,  459,  459,  459,  459,  459,
 /*  2490 */   459,  459,  459,  459,  459,  459,  459,  459,  459,  459,
 /*  2500 */   459,  459,  459,  459,  396,  459,  459,  459,  400,  356,
 /*  2510 */   459,  403,  404,  405,  406,  407,  408,  364,  410,  459,
 /*  2520 */   459,  459,  369,  325,  371,  459,  459,  459,  459,  459,
 /*  2530 */   459,  459,  459,  459,  459,  459,  459,  459,  459,  325,
 /*  2540 */   459,  459,  459,  459,  459,  459,  459,  459,  459,  396,
 /*  2550 */   459,  459,  459,  400,  356,  459,  403,  404,  405,  406,
 /*  2560 */   407,  408,  364,  410,  459,  459,  459,  369,  459,  371,
 /*  2570 */   356,  459,  459,  459,  459,  459,  459,  459,  364,  459,
 /*  2580 */   459,  459,  459,  369,  325,  371,  459,  459,  459,  459,
 /*  2590 */   459,  459,  459,  459,  396,  459,  459,  459,  400,  459,
 /*  2600 */   459,  403,  404,  405,  406,  407,  408,  325,  410,  459,
 /*  2610 */   396,  459,  459,  459,  400,  356,  459,  403,  404,  405,
 /*  2620 */   406,  407,  408,  364,  410,  459,  459,  459,  369,  459,
 /*  2630 */   371,  459,  459,  459,  459,  459,  459,  325,  356,  459,
 /*  2640 */   459,  459,  459,  459,  459,  459,  364,  459,  459,  459,
 /*  2650 */   459,  369,  459,  371,  459,  396,  459,  459,  459,  400,
 /*  2660 */   459,  459,  403,  404,  405,  406,  407,  408,  356,  410,
 /*  2670 */   459,  459,  459,  459,  459,  459,  364,  459,  396,  459,
 /*  2680 */   459,  369,  400,  371,  459,  403,  404,  405,  406,  407,
 /*  2690 */   408,  459,  410,  459,  459,  459,  459,  459,  459,  459,
 /*  2700 */   459,  459,  459,  459,  459,  459,  459,  459,  396,  459,
 /*  2710 */   459,  459,  400,  459,  459,  403,  404,  405,  406,  407,
 /*  2720 */   408,  459,  410,
769
};
770
#define YY_SHIFT_COUNT    (711)
771
#define YY_SHIFT_MIN      (0)
772
#define YY_SHIFT_MAX      (2066)
773
static const unsigned short int yy_shift_ofst[] = {
774 775 776 777
 /*     0 */   925,    0,   71,    0,  288,  288,  288,  288,  288,  288,
 /*    10 */   288,  288,  288,  359,  574,  574,  645,  574,  574,  574,
 /*    20 */   574,  574,  574,  574,  574,  574,  574,  574,  574,  574,
 /*    30 */   574,  574,  574,  574,  574,  574,  574,  574,  574,  574,
778 779 780 781 782 783 784 785 786
 /*    40 */   574,  574,  574,  574,  574,  574,  103,  227,   51,  169,
 /*    50 */   287,  134,  208,  134,   51,   51, 1182, 1182,  134, 1182,
 /*    60 */  1182,  203,  134,    5,    5,  772,  772,   14,   52,   45,
 /*    70 */    45,    5,    5,    5,    5,    5,    5,    5,   40,    5,
 /*    80 */     5,   28,    5,    5,  177,    5,  404,    5,   40,  543,
 /*    90 */     5,    5,  543,    5,  543,  543,  543,    5,   57,  783,
 /*   100 */    34,   34,  498,  471,  418,  418,  418,  418,  418,  418,
 /*   110 */   418,  418,  418,  418,  418,  418,  418,  418,  418,  418,
 /*   120 */   418,  418,  418,  213,  661,   14,   52,  312,  325,  172,
787 788
 /*   130 */   172,  172,  599,  602,  602,  325,  708,  708,  708,  497,
 /*   140 */   404,  546,  543,  879,  543,  879,  879,  497,  890,  216,
789
 /*   150 */   216,  216,  216,  216,  216,  216,  790,  434,  302,  711,
790 791 792 793 794 795 796 797 798 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
 /*   160 */  1055,   99,   96,   94,  295,  532,  339,  533,  899,  870,
 /*   170 */   853,  727,  839,  104,  727,  929,  886,  947, 1046, 1249,
 /*   180 */  1125, 1264, 1290, 1264, 1162, 1305, 1305, 1264, 1162, 1162,
 /*   190 */  1241, 1305, 1305, 1305, 1322, 1322, 1325,   28,  404,   28,
 /*   200 */  1333, 1343,   28, 1333,   28,   28,   28, 1305,   28, 1320,
 /*   210 */  1320, 1322,  543,  543,  543,  543,  543,  543,  543,  543,
 /*   220 */   543,  543,  543, 1305, 1322,  879,  879,  879, 1189, 1325,
 /*   230 */    57, 1213,  404,   57, 1305, 1290, 1290,  879, 1188, 1190,
 /*   240 */   879, 1188, 1190,  879,  879,  543, 1192, 1295, 1188, 1207,
 /*   250 */  1210, 1230, 1046, 1212, 1218, 1223, 1243,  708, 1468, 1305,
 /*   260 */  1333,   57, 1473, 1190,  879,  879,  879,  879,  879, 1190,
 /*   270 */   879, 1351,   57,  497,   57,  708, 1431, 1445,  879,  890,
 /*   280 */  1305,   57, 1510, 1322, 2723, 2723, 2723, 2723, 2723, 2723,
 /*   290 */  2723, 2723, 2723,  826, 1187,  588,  656,  938,  998, 1064,
 /*   300 */   556,  686,  757,  867,  852,  979,  979,  979,  979,  979,
 /*   310 */   979,  979,  979,  979,  896,  869,  155,  155,  191,  534,
 /*   320 */   592,  572,  300,  435,  435,    1,  625,  573,    1,    1,
 /*   330 */     1,  912,  547,  983,  975,  940,  821,  945,  984,  986,
 /*   340 */   992, 1009, 1053, 1089,  744, 1014, 1060,  982,  946,  384,
 /*   350 */   953, 1078, 1086, 1104, 1118, 1136, 1169, 1155, 1049, 1074,
 /*   360 */   988, 1157, 1043, 1193, 1202, 1204, 1205, 1224, 1233, 1068,
 /*   370 */  1194, 1220, 1237,  732, 1558, 1568, 1373, 1561, 1562, 1521,
 /*   380 */  1572, 1538, 1375, 1541, 1542, 1543, 1380, 1581, 1548, 1549,
 /*   390 */  1386, 1586, 1388, 1588, 1554, 1590, 1570, 1593, 1559, 1414,
 /*   400 */  1424, 1606, 1608, 1433, 1435, 1612, 1613, 1573, 1622, 1623,
 /*   410 */  1624, 1583, 1626, 1627, 1637, 1638, 1644, 1645, 1646, 1647,
 /*   420 */  1478, 1595, 1631, 1481, 1633, 1634, 1635, 1648, 1649, 1650,
 /*   430 */  1651, 1652, 1653, 1654, 1655, 1657, 1658, 1659, 1660, 1619,
 /*   440 */  1662, 1663, 1664, 1665, 1666, 1661, 1667, 1669, 1670, 1536,
 /*   450 */  1684, 1685, 1639, 1687, 1632, 1689, 1636, 1691, 1692, 1656,
 /*   460 */  1668, 1671, 1681, 1679, 1682, 1683, 1686, 1695, 1672, 1675,
 /*   470 */  1696, 1699, 1700, 1677, 1530, 1702, 1704, 1705, 1642, 1708,
 /*   480 */  1709, 1676, 1688, 1693, 1710, 1703, 1697, 1698, 1718, 1706,
 /*   490 */  1707, 1701, 1730, 1711, 1712, 1713, 1731, 1735, 1748, 1750,
 /*   500 */  1640, 1641, 1716, 1732, 1753, 1721, 1723, 1724, 1726, 1719,
 /*   510 */  1720, 1733, 1734, 1740, 1736, 1766, 1745, 1775, 1754, 1729,
 /*   520 */  1777, 1758, 1755, 1789, 1756, 1792, 1759, 1793, 1773, 1776,
 /*   530 */  1763, 1764, 1610, 1714, 1717, 1800, 1673, 1768, 1814, 1690,
 /*   540 */  1794, 1678, 1680, 1815, 1819, 1694, 1722, 1817, 1778, 1577,
 /*   550 */  1737, 1725, 1739, 1728, 1783, 1741, 1744, 1747, 1749, 1742,
 /*   560 */  1784, 1782, 1796, 1751, 1786, 1587, 1779, 1780, 1844, 1805,
 /*   570 */  1602, 1816, 1820, 1824, 1825, 1829, 1839, 1781, 1785, 1807,
 /*   580 */  1715, 1808, 1831, 1880, 1882, 1883, 1681, 1840, 1795, 1797,
 /*   590 */  1798, 1809, 1810, 1746, 1811, 1889, 1864, 1762, 1812, 1803,
 /*   600 */  1681, 1862, 1866, 1760, 1761, 1765, 1911, 1892, 1738, 1822,
 /*   610 */  1832, 1835, 1837, 1842, 1838, 1888, 1843, 1846, 1895, 1848,
 /*   620 */  1905, 1752, 1851, 1830, 1852, 1904, 1914, 1855, 1856, 1916,
 /*   630 */  1858, 1859, 1923, 1867, 1865, 1934, 1876, 1877, 1939, 1893,
 /*   640 */  1870, 1872, 1875, 1878, 1953, 1871, 1900, 1933, 1901, 1966,
 /*   650 */  1907, 1933, 1933, 1981, 1940, 1942, 1971, 1972, 1973, 1974,
 /*   660 */  1975, 1976, 1977, 1978, 1979, 1980, 1946, 1926, 1982, 1984,
 /*   670 */  1985, 1986, 1995, 1987, 1988, 1989, 1957, 1719, 1993, 1720,
 /*   680 */  1996, 2005, 2006, 2007, 2022, 2011, 2047, 2013, 2001, 2012,
 /*   690 */  2050, 2018, 2008, 2015, 2055, 2023, 2009, 2020, 2060, 2026,
 /*   700 */  2014, 2024, 2064, 2030, 2032, 2066, 2049, 2048, 2051, 2054,
 /*   710 */  2065, 2052,
846
};
847
#define YY_REDUCE_COUNT (292)
848 849
#define YY_REDUCE_MIN   (-425)
#define YY_REDUCE_MAX   (2312)
850
static const short yy_reduce_ofst[] = {
851 852 853 854 855 856 857
 /*     0 */   -17, -295,   -7,  233,  633,  736,  781,  854,  909, 1021,
 /*    10 */  1051, 1107, 1127, -169, 1195,   77,  341, 1211, 1272, 1317,
 /*    20 */  1378, 1401, 1462, 1492, 1515, 1560, 1576, 1629, 1674, 1727,
 /*    30 */  1743, 1788, 1841, 1857, 1902, 1925, 1955, 2031, 2053, 2108,
 /*    40 */  2153, 2198, 2214, 2259, 2282, 2312, -276, -290, -168,  -10,
 /*    50 */   834,  837,  907,  960, -327, -181, -348, -314, -425,  252,
 /*    60 */   755, -422,  289, -328, -219, -329, -291, -300, -303, -209,
858 859 860
 /*    70 */  -144, -173,   78,  258,  278,  326,  668,  688, -288,  748,
 /*    80 */   754,   65,  770,  800, -275,  802,   86,  828, -152, -347,
 /*    90 */   864,  872,  123,  875,  186,  187,  192,  883, -158, -294,
861
 /*   100 */  -282, -282, -182, -265, -170,  -62,   -6,   82,  105,  265,
862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880
 /*   110 */   276,  305,  310,  347,  383,  386,  392,  439,  442,  443,
 /*   120 */   450,  480,  503,   67, -150,   89, -116,  308,  173, -150,
 /*   130 */   311,  332,  309,  406,  421,  175,  -58,  465,  521,  126,
 /*   140 */   306,  240,  478,  473,  583,  552,  595,  616,  542,  618,
 /*   150 */   641,  671,  692,  709,  717,  762, -337,  719,  814,  714,
 /*   160 */   710,  726,  841,  738,  827,  827,  855,  833,  874,  858,
 /*   170 */   859,  843,  843,  829,  843,  873,  861,  827,  895,  905,
 /*   180 */   915,  932,  939,  935,  949,  994,  995,  956,  959,  961,
 /*   190 */   996, 1005, 1006, 1008, 1016, 1017,  955, 1010,  987, 1011,
 /*   200 */  1025,  977, 1027, 1033, 1029, 1030, 1031, 1038, 1035, 1039,
 /*   210 */  1042, 1052, 1024, 1026, 1028, 1040, 1041, 1050, 1054, 1056,
 /*   220 */  1062, 1063, 1067, 1048, 1059, 1022, 1047, 1061,  999, 1002,
 /*   230 */  1096, 1019, 1066, 1097, 1102, 1065, 1069, 1070, 1007, 1076,
 /*   240 */  1080, 1023, 1081, 1084, 1095,  827, 1003, 1034, 1045, 1032,
 /*   250 */  1037, 1044, 1083, 1036, 1057, 1071,  843, 1123, 1087, 1159,
 /*   260 */  1156, 1158, 1115, 1116, 1130, 1132, 1133, 1135, 1137, 1121,
 /*   270 */  1139, 1138, 1181, 1173, 1184, 1174, 1119, 1183, 1172, 1196,
 /*   280 */  1214, 1208, 1222, 1225, 1163, 1160, 1170, 1171, 1215, 1219,
 /*   290 */  1221, 1232, 1234,
881 882
};
static const YYACTIONTYPE yy_default[] = {
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
 /*     0 */  1598, 1598, 1598, 1598, 1598, 1598, 1598, 1598, 1598, 1598,
 /*    10 */  1598, 1598, 1598, 1598, 1598, 1598, 1598, 1598, 1598, 1598,
 /*    20 */  1598, 1598, 1598, 1598, 1598, 1598, 1598, 1598, 1598, 1598,
 /*    30 */  1598, 1598, 1598, 1598, 1598, 1598, 1598, 1598, 1598, 1598,
 /*    40 */  1598, 1598, 1598, 1598, 1598, 1598, 1598, 1598, 1598, 1598,
 /*    50 */  1598, 1598, 1598, 1598, 1598, 1598, 1598, 1598, 1598, 1598,
 /*    60 */  1598, 1598, 1598, 1598, 1598, 1598, 1598, 1853, 1598, 1598,
 /*    70 */  1598, 1598, 1598, 1598, 1598, 1598, 1598, 1598, 1598, 1598,
 /*    80 */  1598, 1676, 1598, 1598, 1598, 1598, 1598, 1598, 1598, 1598,
 /*    90 */  1598, 1598, 1598, 1598, 1598, 1598, 1598, 1598, 1674, 1846,
 /*   100 */  2047, 1598, 1598, 1598, 1598, 1598, 1598, 1598, 1598, 1598,
 /*   110 */  1598, 1598, 1598, 1598, 1598, 1598, 1598, 1598, 1598, 1598,
 /*   120 */  1598, 1598, 1598, 1598, 2059, 1598, 1598, 1676, 1598, 2059,
 /*   130 */  2059, 2059, 1674, 2019, 2019, 1598, 1598, 1598, 1598, 1783,
 /*   140 */  1598, 1598, 1598, 1598, 1598, 1598, 1598, 1783, 1598, 1598,
 /*   150 */  1598, 1598, 1598, 1598, 1598, 1598, 1892, 1598, 1598, 2084,
 /*   160 */  2137, 1598, 1598, 2087, 1598, 1598, 1598, 1858, 1598, 1736,
 /*   170 */  2074, 2051, 2065, 2121, 2052, 2049, 2068, 1598, 2078, 1598,
 /*   180 */  1885, 1851, 1598, 1851, 1848, 1598, 1598, 1851, 1848, 1848,
 /*   190 */  1727, 1598, 1598, 1598, 1598, 1598, 1598, 1676, 1598, 1676,
 /*   200 */  1598, 1598, 1676, 1598, 1676, 1676, 1676, 1598, 1676, 1655,
 /*   210 */  1655, 1598, 1598, 1598, 1598, 1598, 1598, 1598, 1598, 1598,
 /*   220 */  1598, 1598, 1598, 1598, 1598, 1598, 1598, 1598, 1906, 1598,
 /*   230 */  1674, 1894, 1598, 1674, 1598, 1598, 1598, 1598, 2094, 2092,
 /*   240 */  1598, 2094, 2092, 1598, 1598, 1598, 2106, 2102, 2094, 2110,
 /*   250 */  2108, 2080, 2078, 2140, 2127, 2123, 2065, 1598, 1598, 1598,
 /*   260 */  1598, 1674, 1598, 2092, 1598, 1598, 1598, 1598, 1598, 2092,
 /*   270 */  1598, 1598, 1674, 1598, 1674, 1598, 1598, 1752, 1598, 1598,
 /*   280 */  1598, 1674, 1630, 1598, 1887, 1898, 1870, 1870, 1786, 1786,
 /*   290 */  1786, 1677, 1603, 1598, 1598, 1598, 1598, 1598, 1598, 1598,
 /*   300 */  1598, 1598, 1598, 1598, 1598, 2105, 2104, 1975, 1598, 2023,
 /*   310 */  2022, 2021, 2012, 1974, 1748, 1598, 1973, 1972, 1598, 1598,
 /*   320 */  1598, 1598, 1598, 1866, 1865, 1966, 1598, 1598, 1967, 1965,
 /*   330 */  1964, 1598, 1598, 1598, 1598, 1598, 1598, 1598, 1598, 1598,
 /*   340 */  1598, 1598, 1598, 1598, 1598, 1598, 1598, 1598, 2124, 2128,
 /*   350 */  1598, 1598, 1598, 1598, 1598, 1598, 2048, 1598, 1598, 1598,
 /*   360 */  1598, 1598, 1948, 1598, 1598, 1598, 1598, 1598, 1598, 1598,
 /*   370 */  1598, 1598, 1598, 1598, 1598, 1598, 1598, 1598, 1598, 1598,
 /*   380 */  1598, 1598, 1598, 1598, 1598, 1598, 1598, 1598, 1598, 1598,
 /*   390 */  1598, 1598, 1598, 1598, 1598, 1598, 1598, 1598, 1598, 1598,
 /*   400 */  1598, 1598, 1598, 1598, 1598, 1598, 1598, 1598, 1598, 1598,
 /*   410 */  1598, 1598, 1598, 1598, 1598, 1598, 1598, 1598, 1598, 1598,
 /*   420 */  1598, 1598, 1598, 1598, 1598, 1598, 1598, 1598, 1598, 1598,
 /*   430 */  1598, 1598, 1598, 1598, 1598, 1598, 1598, 1598, 1598, 1598,
 /*   440 */  1598, 1598, 1598, 1598, 1598, 1598, 1598, 1598, 1598, 1598,
 /*   450 */  1598, 1598, 1598, 1598, 1598, 1598, 1598, 1598, 1598, 1598,
 /*   460 */  1598, 1635, 1953, 1598, 1598, 1598, 1598, 1598, 1598, 1598,
 /*   470 */  1598, 1598, 1598, 1598, 1598, 1598, 1598, 1598, 1598, 1598,
 /*   480 */  1598, 1598, 1598, 1598, 1598, 1598, 1598, 1598, 1598, 1598,
 /*   490 */  1598, 1598, 1598, 1598, 1598, 1598, 1598, 1598, 1598, 1598,
 /*   500 */  1598, 1598, 1598, 1598, 1598, 1598, 1598, 1598, 1598, 1715,
 /*   510 */  1714, 1598, 1598, 1598, 1598, 1598, 1598, 1598, 1598, 1598,
 /*   520 */  1598, 1598, 1598, 1598, 1598, 1598, 1598, 1598, 1598, 1598,
 /*   530 */  1598, 1598, 1598, 1957, 1598, 1598, 1598, 1598, 1598, 1598,
 /*   540 */  1598, 1598, 1598, 1598, 1598, 1598, 1598, 2120, 2081, 1598,
 /*   550 */  1598, 1598, 1598, 1598, 1598, 1598, 1598, 1598, 1598, 1598,
 /*   560 */  1598, 1598, 1948, 1598, 2103, 1598, 1598, 2118, 1598, 2122,
 /*   570 */  1598, 1598, 1598, 1598, 1598, 1598, 1598, 2058, 2054, 1598,
 /*   580 */  1598, 2050, 1598, 1598, 1598, 1598, 1956, 1598, 1598, 1598,
 /*   590 */  1598, 1598, 1598, 1598, 1598, 1598, 1598, 1598, 1598, 1598,
 /*   600 */  1947, 1598, 2009, 1598, 1598, 1598, 2043, 1598, 1598, 1994,
 /*   610 */  1598, 1598, 1598, 1598, 1598, 1598, 1598, 1598, 1598, 1957,
 /*   620 */  1598, 1960, 1598, 1598, 1598, 1598, 1598, 1780, 1598, 1598,
 /*   630 */  1598, 1598, 1598, 1598, 1598, 1598, 1598, 1598, 1598, 1598,
 /*   640 */  1765, 1763, 1762, 1761, 1598, 1758, 1598, 1793, 1598, 1598,
 /*   650 */  1598, 1789, 1788, 1598, 1598, 1598, 1598, 1598, 1598, 1598,
 /*   660 */  1598, 1598, 1598, 1598, 1598, 1598, 1598, 1598, 1695, 1598,
 /*   670 */  1598, 1598, 1598, 1598, 1598, 1598, 1598, 1687, 1598, 1686,
 /*   680 */  1598, 1598, 1598, 1598, 1598, 1598, 1598, 1598, 1598, 1598,
 /*   690 */  1598, 1598, 1598, 1598, 1598, 1598, 1598, 1598, 1598, 1598,
 /*   700 */  1598, 1598, 1598, 1598, 1598, 1598, 1598, 1598, 1598, 1598,
 /*   710 */  1598, 1598,
955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973
};
/********** 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 已提交
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
    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 */
X
Xiaoyu Wang 已提交
1008 1009 1010
    0,  /*     ENABLE => nothing */
    0,  /* NK_INTEGER => nothing */
    0,  /*    SYSINFO => nothing */
X
Xiaoyu Wang 已提交
1011
    0,  /*       DROP => nothing */
1012 1013 1014 1015 1016
    0,  /*      GRANT => nothing */
    0,  /*         ON => nothing */
    0,  /*         TO => nothing */
    0,  /*     REVOKE => nothing */
    0,  /*       FROM => nothing */
1017
    0,  /*  SUBSCRIBE => nothing */
1018 1019 1020 1021
    0,  /*   NK_COMMA => nothing */
    0,  /*       READ => nothing */
    0,  /*      WRITE => nothing */
    0,  /*     NK_DOT => nothing */
X
Xiaoyu Wang 已提交
1022 1023 1024
    0,  /*      DNODE => nothing */
    0,  /*       PORT => nothing */
    0,  /*     DNODES => nothing */
1025
    0,  /* NK_IPTOKEN => nothing */
1026
    0,  /*      FORCE => nothing */
X
Xiaoyu Wang 已提交
1027 1028 1029 1030 1031 1032 1033
    0,  /*      LOCAL => nothing */
    0,  /*      QNODE => nothing */
    0,  /*      BNODE => nothing */
    0,  /*      SNODE => nothing */
    0,  /*      MNODE => nothing */
    0,  /*   DATABASE => nothing */
    0,  /*        USE => nothing */
X
Xiaoyu Wang 已提交
1034
    0,  /*      FLUSH => nothing */
X
Xiaoyu Wang 已提交
1035
    0,  /*       TRIM => nothing */
X
Xiaoyu Wang 已提交
1036 1037 1038
    0,  /*         IF => nothing */
    0,  /*        NOT => nothing */
    0,  /*     EXISTS => nothing */
X
Xiaoyu Wang 已提交
1039
    0,  /*     BUFFER => nothing */
1040 1041
    0,  /* CACHEMODEL => nothing */
    0,  /*  CACHESIZE => nothing */
X
Xiaoyu Wang 已提交
1042
    0,  /*       COMP => nothing */
X
Xiaoyu Wang 已提交
1043
    0,  /*   DURATION => nothing */
X
Xiaoyu Wang 已提交
1044 1045 1046 1047
    0,  /* NK_VARIABLE => nothing */
    0,  /*    MAXROWS => nothing */
    0,  /*    MINROWS => nothing */
    0,  /*       KEEP => nothing */
X
Xiaoyu Wang 已提交
1048 1049
    0,  /*      PAGES => nothing */
    0,  /*   PAGESIZE => nothing */
1050
    0,  /* TSDB_PAGESIZE => nothing */
X
Xiaoyu Wang 已提交
1051 1052 1053 1054 1055
    0,  /*  PRECISION => nothing */
    0,  /*    REPLICA => nothing */
    0,  /*    VGROUPS => nothing */
    0,  /* SINGLE_STABLE => nothing */
    0,  /* RETENTIONS => nothing */
X
Xiaoyu Wang 已提交
1056
    0,  /* SCHEMALESS => nothing */
X
Xiaoyu Wang 已提交
1057 1058
    0,  /*  WAL_LEVEL => nothing */
    0,  /* WAL_FSYNC_PERIOD => nothing */
X
Xiaoyu Wang 已提交
1059 1060 1061 1062
    0,  /* WAL_RETENTION_PERIOD => nothing */
    0,  /* WAL_RETENTION_SIZE => nothing */
    0,  /* WAL_ROLL_PERIOD => nothing */
    0,  /* WAL_SEGMENT_SIZE => nothing */
1063
    0,  /* STT_TRIGGER => nothing */
1064 1065
    0,  /* TABLE_PREFIX => nothing */
    0,  /* TABLE_SUFFIX => nothing */
X
Xiaoyu Wang 已提交
1066
    0,  /*   NK_COLON => nothing */
1067
    0,  /*  MAX_SPEED => nothing */
X
Xiaoyu Wang 已提交
1068 1069 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
    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,  /*    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 */
X
Xiaoyu Wang 已提交
1100 1101
    0,  /*  MAX_DELAY => nothing */
    0,  /*  WATERMARK => nothing */
X
Xiaoyu Wang 已提交
1102 1103 1104
    0,  /*     ROLLUP => nothing */
    0,  /*        TTL => nothing */
    0,  /*        SMA => nothing */
1105
    0,  /* DELETE_MARK => nothing */
X
Xiaoyu Wang 已提交
1106 1107
    0,  /*      FIRST => nothing */
    0,  /*       LAST => nothing */
X
Xiaoyu Wang 已提交
1108
    0,  /*       SHOW => nothing */
1109
    0,  /* PRIVILEGES => nothing */
X
Xiaoyu Wang 已提交
1110 1111 1112 1113 1114 1115 1116 1117 1118 1119
    0,  /*  DATABASES => nothing */
    0,  /*     TABLES => nothing */
    0,  /*    STABLES => nothing */
    0,  /*     MNODES => nothing */
    0,  /*     QNODES => nothing */
    0,  /*  FUNCTIONS => nothing */
    0,  /*    INDEXES => nothing */
    0,  /*   ACCOUNTS => nothing */
    0,  /*       APPS => nothing */
    0,  /* CONNECTIONS => nothing */
X
Xiaoyu Wang 已提交
1120
    0,  /*   LICENCES => nothing */
X
Xiaoyu Wang 已提交
1121 1122 1123 1124 1125
    0,  /*     GRANTS => nothing */
    0,  /*    QUERIES => nothing */
    0,  /*     SCORES => nothing */
    0,  /*     TOPICS => nothing */
    0,  /*  VARIABLES => nothing */
1126
    0,  /*    CLUSTER => nothing */
X
Xiaoyu Wang 已提交
1127 1128
    0,  /*     BNODES => nothing */
    0,  /*     SNODES => nothing */
1129
    0,  /* TRANSACTIONS => nothing */
1130
    0,  /* DISTRIBUTED => nothing */
1131 1132
    0,  /*  CONSUMERS => nothing */
    0,  /* SUBSCRIPTIONS => nothing */
1133
    0,  /*     VNODES => nothing */
X
Xiaoyu Wang 已提交
1134
    0,  /*       LIKE => nothing */
1135 1136 1137
    0,  /*     TBNAME => nothing */
    0,  /*      QTAGS => nothing */
    0,  /*         AS => nothing */
X
Xiaoyu Wang 已提交
1138 1139 1140 1141
    0,  /*      INDEX => nothing */
    0,  /*   FUNCTION => nothing */
    0,  /*   INTERVAL => nothing */
    0,  /*      TOPIC => nothing */
X
Xiaoyu Wang 已提交
1142 1143
    0,  /*       WITH => nothing */
    0,  /*       META => nothing */
1144 1145
    0,  /*   CONSUMER => nothing */
    0,  /*      GROUP => nothing */
X
Xiaoyu Wang 已提交
1146 1147 1148 1149
    0,  /*       DESC => nothing */
    0,  /*   DESCRIBE => nothing */
    0,  /*      RESET => nothing */
    0,  /*      QUERY => nothing */
X
Xiaoyu Wang 已提交
1150
    0,  /*      CACHE => nothing */
X
Xiaoyu Wang 已提交
1151 1152 1153 1154 1155
    0,  /*    EXPLAIN => nothing */
    0,  /*    ANALYZE => nothing */
    0,  /*    VERBOSE => nothing */
    0,  /*    NK_BOOL => nothing */
    0,  /*      RATIO => nothing */
X
Xiaoyu Wang 已提交
1156
    0,  /*   NK_FLOAT => nothing */
X
Xiaoyu Wang 已提交
1157 1158 1159 1160 1161 1162 1163 1164
    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 */
1165 1166
    0,  /*     IGNORE => nothing */
    0,  /*    EXPIRED => nothing */
1167
    0,  /* FILL_HISTORY => nothing */
1168
    0,  /*   SUBTABLE => nothing */
X
Xiaoyu Wang 已提交
1169 1170
    0,  /*       KILL => nothing */
    0,  /* CONNECTION => nothing */
1171
    0,  /* TRANSACTION => nothing */
X
Xiaoyu Wang 已提交
1172
    0,  /*    BALANCE => nothing */
X
Xiaoyu Wang 已提交
1173
    0,  /*     VGROUP => nothing */
X
Xiaoyu Wang 已提交
1174
    0,  /*      MERGE => nothing */
X
Xiaoyu Wang 已提交
1175
    0,  /* REDISTRIBUTE => nothing */
1176
    0,  /*      SPLIT => nothing */
X
Xiaoyu Wang 已提交
1177
    0,  /*     DELETE => nothing */
1178
    0,  /*     INSERT => nothing */
X
Xiaoyu Wang 已提交
1179 1180 1181 1182
    0,  /*       NULL => nothing */
    0,  /* NK_QUESTION => nothing */
    0,  /*   NK_ARROW => nothing */
    0,  /*      ROWTS => nothing */
1183 1184 1185 1186 1187
    0,  /*     QSTART => nothing */
    0,  /*       QEND => nothing */
    0,  /*  QDURATION => nothing */
    0,  /*     WSTART => nothing */
    0,  /*       WEND => nothing */
X
Xiaoyu Wang 已提交
1188
    0,  /*  WDURATION => nothing */
1189
    0,  /*     IROWTS => nothing */
X
Xiaoyu Wang 已提交
1190 1191 1192 1193
    0,  /*       CAST => nothing */
    0,  /*        NOW => nothing */
    0,  /*      TODAY => nothing */
    0,  /*   TIMEZONE => nothing */
1194 1195 1196 1197
    0,  /* CLIENT_VERSION => nothing */
    0,  /* SERVER_VERSION => nothing */
    0,  /* SERVER_STATUS => nothing */
    0,  /* CURRENT_USER => nothing */
X
Xiaoyu Wang 已提交
1198 1199
    0,  /*      COUNT => nothing */
    0,  /*   LAST_ROW => nothing */
X
Xiaoyu Wang 已提交
1200
    0,  /*       CASE => nothing */
1201
  268,  /*        END => ABORT */
X
Xiaoyu Wang 已提交
1202 1203 1204
    0,  /*       WHEN => nothing */
    0,  /*       THEN => nothing */
    0,  /*       ELSE => nothing */
X
Xiaoyu Wang 已提交
1205 1206 1207 1208 1209 1210 1211 1212 1213 1214
    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 */
X
Xiaoyu Wang 已提交
1215
    0,  /*         IN => nothing */
X
Xiaoyu Wang 已提交
1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232
    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,  /*     HAVING => nothing */
X
Xiaoyu Wang 已提交
1233 1234
    0,  /*      RANGE => nothing */
    0,  /*      EVERY => nothing */
X
Xiaoyu Wang 已提交
1235 1236 1237 1238 1239 1240 1241
    0,  /*      ORDER => nothing */
    0,  /*     SLIMIT => nothing */
    0,  /*    SOFFSET => nothing */
    0,  /*      LIMIT => nothing */
    0,  /*     OFFSET => nothing */
    0,  /*        ASC => nothing */
    0,  /*      NULLS => nothing */
X
Xiaoyu Wang 已提交
1242
    0,  /*      ABORT => nothing */
1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 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
  268,  /*      AFTER => ABORT */
  268,  /*     ATTACH => ABORT */
  268,  /*     BEFORE => ABORT */
  268,  /*      BEGIN => ABORT */
  268,  /*     BITAND => ABORT */
  268,  /*     BITNOT => ABORT */
  268,  /*      BITOR => ABORT */
  268,  /*     BLOCKS => ABORT */
  268,  /*     CHANGE => ABORT */
  268,  /*      COMMA => ABORT */
  268,  /*    COMPACT => ABORT */
  268,  /*     CONCAT => ABORT */
  268,  /*   CONFLICT => ABORT */
  268,  /*       COPY => ABORT */
  268,  /*   DEFERRED => ABORT */
  268,  /* DELIMITERS => ABORT */
  268,  /*     DETACH => ABORT */
  268,  /*     DIVIDE => ABORT */
  268,  /*        DOT => ABORT */
  268,  /*       EACH => ABORT */
  268,  /*       FAIL => ABORT */
  268,  /*       FILE => ABORT */
  268,  /*        FOR => ABORT */
  268,  /*       GLOB => ABORT */
  268,  /*         ID => ABORT */
  268,  /*  IMMEDIATE => ABORT */
  268,  /*     IMPORT => ABORT */
  268,  /*  INITIALLY => ABORT */
  268,  /*    INSTEAD => ABORT */
  268,  /*     ISNULL => ABORT */
  268,  /*        KEY => ABORT */
  268,  /*    MODULES => ABORT */
  268,  /*  NK_BITNOT => ABORT */
  268,  /*    NK_SEMI => ABORT */
  268,  /*    NOTNULL => ABORT */
  268,  /*         OF => ABORT */
  268,  /*       PLUS => ABORT */
  268,  /*  PRIVILEGE => ABORT */
  268,  /*      RAISE => ABORT */
  268,  /*    REPLACE => ABORT */
  268,  /*   RESTRICT => ABORT */
  268,  /*        ROW => ABORT */
  268,  /*       SEMI => ABORT */
  268,  /*       STAR => ABORT */
  268,  /*  STATEMENT => ABORT */
  268,  /*     STRICT => ABORT */
  268,  /*     STRING => ABORT */
  268,  /*      TIMES => ABORT */
  268,  /*     UPDATE => ABORT */
  268,  /*     VALUES => ABORT */
  268,  /*   VARIABLE => ABORT */
  268,  /*       VIEW => ABORT */
  268,  /*        WAL => ABORT */
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
};
#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 已提交
1334 1335
  ParseARG_SDECL                /* A place to hold %extra_argument */
  ParseCTX_SDECL                /* A place to hold %extra_context */
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
#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 已提交
1371
void ParseTrace(FILE *TraceFILE, char *zTracePrompt){
1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383
  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 */ "$",
1384 1385
  /*    1 */ "OR",
  /*    2 */ "AND",
1386 1387 1388 1389 1390
  /*    3 */ "UNION",
  /*    4 */ "ALL",
  /*    5 */ "MINUS",
  /*    6 */ "EXCEPT",
  /*    7 */ "INTERSECT",
1391 1392 1393 1394 1395 1396 1397 1398 1399 1400
  /*    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",
1401
  /*   18 */ "CREATE",
1402 1403 1404
  /*   19 */ "ACCOUNT",
  /*   20 */ "NK_ID",
  /*   21 */ "PASS",
1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416
  /*   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",
X
Xiaoyu Wang 已提交
1417 1418 1419 1420 1421 1422 1423 1424 1425
  /*   34 */ "ENABLE",
  /*   35 */ "NK_INTEGER",
  /*   36 */ "SYSINFO",
  /*   37 */ "DROP",
  /*   38 */ "GRANT",
  /*   39 */ "ON",
  /*   40 */ "TO",
  /*   41 */ "REVOKE",
  /*   42 */ "FROM",
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
  /*   43 */ "SUBSCRIBE",
  /*   44 */ "NK_COMMA",
  /*   45 */ "READ",
  /*   46 */ "WRITE",
  /*   47 */ "NK_DOT",
  /*   48 */ "DNODE",
  /*   49 */ "PORT",
  /*   50 */ "DNODES",
  /*   51 */ "NK_IPTOKEN",
  /*   52 */ "FORCE",
  /*   53 */ "LOCAL",
  /*   54 */ "QNODE",
  /*   55 */ "BNODE",
  /*   56 */ "SNODE",
  /*   57 */ "MNODE",
  /*   58 */ "DATABASE",
  /*   59 */ "USE",
  /*   60 */ "FLUSH",
  /*   61 */ "TRIM",
  /*   62 */ "IF",
  /*   63 */ "NOT",
  /*   64 */ "EXISTS",
  /*   65 */ "BUFFER",
  /*   66 */ "CACHEMODEL",
  /*   67 */ "CACHESIZE",
  /*   68 */ "COMP",
  /*   69 */ "DURATION",
  /*   70 */ "NK_VARIABLE",
  /*   71 */ "MAXROWS",
  /*   72 */ "MINROWS",
  /*   73 */ "KEEP",
  /*   74 */ "PAGES",
  /*   75 */ "PAGESIZE",
  /*   76 */ "TSDB_PAGESIZE",
  /*   77 */ "PRECISION",
  /*   78 */ "REPLICA",
1462 1463 1464 1465 1466 1467 1468 1469 1470 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 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 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 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 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697
  /*   79 */ "VGROUPS",
  /*   80 */ "SINGLE_STABLE",
  /*   81 */ "RETENTIONS",
  /*   82 */ "SCHEMALESS",
  /*   83 */ "WAL_LEVEL",
  /*   84 */ "WAL_FSYNC_PERIOD",
  /*   85 */ "WAL_RETENTION_PERIOD",
  /*   86 */ "WAL_RETENTION_SIZE",
  /*   87 */ "WAL_ROLL_PERIOD",
  /*   88 */ "WAL_SEGMENT_SIZE",
  /*   89 */ "STT_TRIGGER",
  /*   90 */ "TABLE_PREFIX",
  /*   91 */ "TABLE_SUFFIX",
  /*   92 */ "NK_COLON",
  /*   93 */ "MAX_SPEED",
  /*   94 */ "TABLE",
  /*   95 */ "NK_LP",
  /*   96 */ "NK_RP",
  /*   97 */ "STABLE",
  /*   98 */ "ADD",
  /*   99 */ "COLUMN",
  /*  100 */ "MODIFY",
  /*  101 */ "RENAME",
  /*  102 */ "TAG",
  /*  103 */ "SET",
  /*  104 */ "NK_EQ",
  /*  105 */ "USING",
  /*  106 */ "TAGS",
  /*  107 */ "COMMENT",
  /*  108 */ "BOOL",
  /*  109 */ "TINYINT",
  /*  110 */ "SMALLINT",
  /*  111 */ "INT",
  /*  112 */ "INTEGER",
  /*  113 */ "BIGINT",
  /*  114 */ "FLOAT",
  /*  115 */ "DOUBLE",
  /*  116 */ "BINARY",
  /*  117 */ "TIMESTAMP",
  /*  118 */ "NCHAR",
  /*  119 */ "UNSIGNED",
  /*  120 */ "JSON",
  /*  121 */ "VARCHAR",
  /*  122 */ "MEDIUMBLOB",
  /*  123 */ "BLOB",
  /*  124 */ "VARBINARY",
  /*  125 */ "DECIMAL",
  /*  126 */ "MAX_DELAY",
  /*  127 */ "WATERMARK",
  /*  128 */ "ROLLUP",
  /*  129 */ "TTL",
  /*  130 */ "SMA",
  /*  131 */ "DELETE_MARK",
  /*  132 */ "FIRST",
  /*  133 */ "LAST",
  /*  134 */ "SHOW",
  /*  135 */ "PRIVILEGES",
  /*  136 */ "DATABASES",
  /*  137 */ "TABLES",
  /*  138 */ "STABLES",
  /*  139 */ "MNODES",
  /*  140 */ "QNODES",
  /*  141 */ "FUNCTIONS",
  /*  142 */ "INDEXES",
  /*  143 */ "ACCOUNTS",
  /*  144 */ "APPS",
  /*  145 */ "CONNECTIONS",
  /*  146 */ "LICENCES",
  /*  147 */ "GRANTS",
  /*  148 */ "QUERIES",
  /*  149 */ "SCORES",
  /*  150 */ "TOPICS",
  /*  151 */ "VARIABLES",
  /*  152 */ "CLUSTER",
  /*  153 */ "BNODES",
  /*  154 */ "SNODES",
  /*  155 */ "TRANSACTIONS",
  /*  156 */ "DISTRIBUTED",
  /*  157 */ "CONSUMERS",
  /*  158 */ "SUBSCRIPTIONS",
  /*  159 */ "VNODES",
  /*  160 */ "LIKE",
  /*  161 */ "TBNAME",
  /*  162 */ "QTAGS",
  /*  163 */ "AS",
  /*  164 */ "INDEX",
  /*  165 */ "FUNCTION",
  /*  166 */ "INTERVAL",
  /*  167 */ "TOPIC",
  /*  168 */ "WITH",
  /*  169 */ "META",
  /*  170 */ "CONSUMER",
  /*  171 */ "GROUP",
  /*  172 */ "DESC",
  /*  173 */ "DESCRIBE",
  /*  174 */ "RESET",
  /*  175 */ "QUERY",
  /*  176 */ "CACHE",
  /*  177 */ "EXPLAIN",
  /*  178 */ "ANALYZE",
  /*  179 */ "VERBOSE",
  /*  180 */ "NK_BOOL",
  /*  181 */ "RATIO",
  /*  182 */ "NK_FLOAT",
  /*  183 */ "OUTPUTTYPE",
  /*  184 */ "AGGREGATE",
  /*  185 */ "BUFSIZE",
  /*  186 */ "STREAM",
  /*  187 */ "INTO",
  /*  188 */ "TRIGGER",
  /*  189 */ "AT_ONCE",
  /*  190 */ "WINDOW_CLOSE",
  /*  191 */ "IGNORE",
  /*  192 */ "EXPIRED",
  /*  193 */ "FILL_HISTORY",
  /*  194 */ "SUBTABLE",
  /*  195 */ "KILL",
  /*  196 */ "CONNECTION",
  /*  197 */ "TRANSACTION",
  /*  198 */ "BALANCE",
  /*  199 */ "VGROUP",
  /*  200 */ "MERGE",
  /*  201 */ "REDISTRIBUTE",
  /*  202 */ "SPLIT",
  /*  203 */ "DELETE",
  /*  204 */ "INSERT",
  /*  205 */ "NULL",
  /*  206 */ "NK_QUESTION",
  /*  207 */ "NK_ARROW",
  /*  208 */ "ROWTS",
  /*  209 */ "QSTART",
  /*  210 */ "QEND",
  /*  211 */ "QDURATION",
  /*  212 */ "WSTART",
  /*  213 */ "WEND",
  /*  214 */ "WDURATION",
  /*  215 */ "IROWTS",
  /*  216 */ "CAST",
  /*  217 */ "NOW",
  /*  218 */ "TODAY",
  /*  219 */ "TIMEZONE",
  /*  220 */ "CLIENT_VERSION",
  /*  221 */ "SERVER_VERSION",
  /*  222 */ "SERVER_STATUS",
  /*  223 */ "CURRENT_USER",
  /*  224 */ "COUNT",
  /*  225 */ "LAST_ROW",
  /*  226 */ "CASE",
  /*  227 */ "END",
  /*  228 */ "WHEN",
  /*  229 */ "THEN",
  /*  230 */ "ELSE",
  /*  231 */ "BETWEEN",
  /*  232 */ "IS",
  /*  233 */ "NK_LT",
  /*  234 */ "NK_GT",
  /*  235 */ "NK_LE",
  /*  236 */ "NK_GE",
  /*  237 */ "NK_NE",
  /*  238 */ "MATCH",
  /*  239 */ "NMATCH",
  /*  240 */ "CONTAINS",
  /*  241 */ "IN",
  /*  242 */ "JOIN",
  /*  243 */ "INNER",
  /*  244 */ "SELECT",
  /*  245 */ "DISTINCT",
  /*  246 */ "WHERE",
  /*  247 */ "PARTITION",
  /*  248 */ "BY",
  /*  249 */ "SESSION",
  /*  250 */ "STATE_WINDOW",
  /*  251 */ "SLIDING",
  /*  252 */ "FILL",
  /*  253 */ "VALUE",
  /*  254 */ "NONE",
  /*  255 */ "PREV",
  /*  256 */ "LINEAR",
  /*  257 */ "NEXT",
  /*  258 */ "HAVING",
  /*  259 */ "RANGE",
  /*  260 */ "EVERY",
  /*  261 */ "ORDER",
  /*  262 */ "SLIMIT",
  /*  263 */ "SOFFSET",
  /*  264 */ "LIMIT",
  /*  265 */ "OFFSET",
  /*  266 */ "ASC",
  /*  267 */ "NULLS",
  /*  268 */ "ABORT",
  /*  269 */ "AFTER",
  /*  270 */ "ATTACH",
  /*  271 */ "BEFORE",
  /*  272 */ "BEGIN",
  /*  273 */ "BITAND",
  /*  274 */ "BITNOT",
  /*  275 */ "BITOR",
  /*  276 */ "BLOCKS",
  /*  277 */ "CHANGE",
  /*  278 */ "COMMA",
  /*  279 */ "COMPACT",
  /*  280 */ "CONCAT",
  /*  281 */ "CONFLICT",
  /*  282 */ "COPY",
  /*  283 */ "DEFERRED",
  /*  284 */ "DELIMITERS",
  /*  285 */ "DETACH",
  /*  286 */ "DIVIDE",
  /*  287 */ "DOT",
  /*  288 */ "EACH",
  /*  289 */ "FAIL",
  /*  290 */ "FILE",
  /*  291 */ "FOR",
  /*  292 */ "GLOB",
  /*  293 */ "ID",
  /*  294 */ "IMMEDIATE",
  /*  295 */ "IMPORT",
  /*  296 */ "INITIALLY",
  /*  297 */ "INSTEAD",
  /*  298 */ "ISNULL",
  /*  299 */ "KEY",
  /*  300 */ "MODULES",
  /*  301 */ "NK_BITNOT",
  /*  302 */ "NK_SEMI",
  /*  303 */ "NOTNULL",
  /*  304 */ "OF",
  /*  305 */ "PLUS",
  /*  306 */ "PRIVILEGE",
  /*  307 */ "RAISE",
  /*  308 */ "REPLACE",
  /*  309 */ "RESTRICT",
  /*  310 */ "ROW",
  /*  311 */ "SEMI",
  /*  312 */ "STAR",
  /*  313 */ "STATEMENT",
  /*  314 */ "STRICT",
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 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762
  /*  315 */ "STRING",
  /*  316 */ "TIMES",
  /*  317 */ "UPDATE",
  /*  318 */ "VALUES",
  /*  319 */ "VARIABLE",
  /*  320 */ "VIEW",
  /*  321 */ "WAL",
  /*  322 */ "cmd",
  /*  323 */ "account_options",
  /*  324 */ "alter_account_options",
  /*  325 */ "literal",
  /*  326 */ "alter_account_option",
  /*  327 */ "user_name",
  /*  328 */ "sysinfo_opt",
  /*  329 */ "privileges",
  /*  330 */ "priv_level",
  /*  331 */ "priv_type_list",
  /*  332 */ "priv_type",
  /*  333 */ "db_name",
  /*  334 */ "topic_name",
  /*  335 */ "dnode_endpoint",
  /*  336 */ "force_opt",
  /*  337 */ "not_exists_opt",
  /*  338 */ "db_options",
  /*  339 */ "exists_opt",
  /*  340 */ "alter_db_options",
  /*  341 */ "speed_opt",
  /*  342 */ "integer_list",
  /*  343 */ "variable_list",
  /*  344 */ "retention_list",
  /*  345 */ "alter_db_option",
  /*  346 */ "retention",
  /*  347 */ "full_table_name",
  /*  348 */ "column_def_list",
  /*  349 */ "tags_def_opt",
  /*  350 */ "table_options",
  /*  351 */ "multi_create_clause",
  /*  352 */ "tags_def",
  /*  353 */ "multi_drop_clause",
  /*  354 */ "alter_table_clause",
  /*  355 */ "alter_table_options",
  /*  356 */ "column_name",
  /*  357 */ "type_name",
  /*  358 */ "signed_literal",
  /*  359 */ "create_subtable_clause",
  /*  360 */ "specific_cols_opt",
  /*  361 */ "expression_list",
  /*  362 */ "drop_table_clause",
  /*  363 */ "col_name_list",
  /*  364 */ "table_name",
  /*  365 */ "column_def",
  /*  366 */ "duration_list",
  /*  367 */ "rollup_func_list",
  /*  368 */ "alter_table_option",
  /*  369 */ "duration_literal",
  /*  370 */ "rollup_func_name",
  /*  371 */ "function_name",
  /*  372 */ "col_name",
  /*  373 */ "db_name_cond_opt",
  /*  374 */ "like_pattern_opt",
  /*  375 */ "table_name_cond",
  /*  376 */ "from_db_opt",
  /*  377 */ "tag_list_opt",
  /*  378 */ "tag_item",
  /*  379 */ "column_alias",
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
  /*  380 */ "full_index_name",
  /*  381 */ "index_options",
  /*  382 */ "index_name",
  /*  383 */ "func_list",
  /*  384 */ "sliding_opt",
  /*  385 */ "sma_stream_opt",
  /*  386 */ "func",
  /*  387 */ "query_or_subquery",
  /*  388 */ "cgroup_name",
  /*  389 */ "analyze_opt",
  /*  390 */ "explain_options",
  /*  391 */ "agg_func_opt",
  /*  392 */ "bufsize_opt",
  /*  393 */ "stream_name",
  /*  394 */ "stream_options",
  /*  395 */ "subtable_opt",
  /*  396 */ "expression",
  /*  397 */ "dnode_list",
  /*  398 */ "where_clause_opt",
  /*  399 */ "signed",
  /*  400 */ "literal_func",
  /*  401 */ "literal_list",
  /*  402 */ "table_alias",
  /*  403 */ "expr_or_subquery",
  /*  404 */ "pseudo_column",
  /*  405 */ "column_reference",
  /*  406 */ "function_expression",
  /*  407 */ "case_when_expression",
  /*  408 */ "star_func",
  /*  409 */ "star_func_para_list",
  /*  410 */ "noarg_func",
  /*  411 */ "other_para_list",
  /*  412 */ "star_func_para",
  /*  413 */ "when_then_list",
  /*  414 */ "case_when_else_opt",
  /*  415 */ "common_expression",
  /*  416 */ "when_then_expr",
  /*  417 */ "predicate",
  /*  418 */ "compare_op",
  /*  419 */ "in_op",
  /*  420 */ "in_predicate_value",
  /*  421 */ "boolean_value_expression",
  /*  422 */ "boolean_primary",
  /*  423 */ "from_clause_opt",
  /*  424 */ "table_reference_list",
  /*  425 */ "table_reference",
  /*  426 */ "table_primary",
  /*  427 */ "joined_table",
  /*  428 */ "alias_opt",
  /*  429 */ "subquery",
  /*  430 */ "parenthesized_joined_table",
  /*  431 */ "join_type",
  /*  432 */ "search_condition",
  /*  433 */ "query_specification",
  /*  434 */ "set_quantifier_opt",
  /*  435 */ "select_list",
  /*  436 */ "partition_by_clause_opt",
  /*  437 */ "range_opt",
  /*  438 */ "every_opt",
  /*  439 */ "fill_opt",
  /*  440 */ "twindow_clause_opt",
  /*  441 */ "group_by_clause_opt",
  /*  442 */ "having_clause_opt",
  /*  443 */ "select_item",
  /*  444 */ "partition_list",
  /*  445 */ "partition_item",
  /*  446 */ "fill_mode",
  /*  447 */ "group_by_list",
  /*  448 */ "query_expression",
  /*  449 */ "query_simple",
  /*  450 */ "order_by_clause_opt",
  /*  451 */ "slimit_clause_opt",
  /*  452 */ "limit_clause_opt",
  /*  453 */ "union_query_expression",
  /*  454 */ "query_simple_or_subquery",
  /*  455 */ "sort_specification_list",
  /*  456 */ "sort_specification",
  /*  457 */ "ordering_specification_opt",
  /*  458 */ "null_ordering_opt",
1842 1843 1844 1845 1846 1847 1848
};
#endif /* defined(YYCOVERAGE) || !defined(NDEBUG) */

#ifndef NDEBUG
/* For tracing reduce actions, the names of all rules are required.
*/
static const char *const yyRuleName[] = {
1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872
 /*   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",
X
Xiaoyu Wang 已提交
1873
 /*  24 */ "cmd ::= CREATE USER user_name PASS NK_STRING sysinfo_opt",
1874
 /*  25 */ "cmd ::= ALTER USER user_name PASS NK_STRING",
X
Xiaoyu Wang 已提交
1875 1876 1877 1878 1879 1880 1881 1882 1883
 /*  26 */ "cmd ::= ALTER USER user_name ENABLE NK_INTEGER",
 /*  27 */ "cmd ::= ALTER USER user_name SYSINFO NK_INTEGER",
 /*  28 */ "cmd ::= DROP USER user_name",
 /*  29 */ "sysinfo_opt ::=",
 /*  30 */ "sysinfo_opt ::= SYSINFO NK_INTEGER",
 /*  31 */ "cmd ::= GRANT privileges ON priv_level TO user_name",
 /*  32 */ "cmd ::= REVOKE privileges ON priv_level FROM user_name",
 /*  33 */ "privileges ::= ALL",
 /*  34 */ "privileges ::= priv_type_list",
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 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940
 /*  35 */ "privileges ::= SUBSCRIBE",
 /*  36 */ "priv_type_list ::= priv_type",
 /*  37 */ "priv_type_list ::= priv_type_list NK_COMMA priv_type",
 /*  38 */ "priv_type ::= READ",
 /*  39 */ "priv_type ::= WRITE",
 /*  40 */ "priv_level ::= NK_STAR NK_DOT NK_STAR",
 /*  41 */ "priv_level ::= db_name NK_DOT NK_STAR",
 /*  42 */ "priv_level ::= topic_name",
 /*  43 */ "cmd ::= CREATE DNODE dnode_endpoint",
 /*  44 */ "cmd ::= CREATE DNODE dnode_endpoint PORT NK_INTEGER",
 /*  45 */ "cmd ::= DROP DNODE NK_INTEGER force_opt",
 /*  46 */ "cmd ::= DROP DNODE dnode_endpoint force_opt",
 /*  47 */ "cmd ::= ALTER DNODE NK_INTEGER NK_STRING",
 /*  48 */ "cmd ::= ALTER DNODE NK_INTEGER NK_STRING NK_STRING",
 /*  49 */ "cmd ::= ALTER ALL DNODES NK_STRING",
 /*  50 */ "cmd ::= ALTER ALL DNODES NK_STRING NK_STRING",
 /*  51 */ "dnode_endpoint ::= NK_STRING",
 /*  52 */ "dnode_endpoint ::= NK_ID",
 /*  53 */ "dnode_endpoint ::= NK_IPTOKEN",
 /*  54 */ "force_opt ::=",
 /*  55 */ "force_opt ::= FORCE",
 /*  56 */ "cmd ::= ALTER LOCAL NK_STRING",
 /*  57 */ "cmd ::= ALTER LOCAL NK_STRING NK_STRING",
 /*  58 */ "cmd ::= CREATE QNODE ON DNODE NK_INTEGER",
 /*  59 */ "cmd ::= DROP QNODE ON DNODE NK_INTEGER",
 /*  60 */ "cmd ::= CREATE BNODE ON DNODE NK_INTEGER",
 /*  61 */ "cmd ::= DROP BNODE ON DNODE NK_INTEGER",
 /*  62 */ "cmd ::= CREATE SNODE ON DNODE NK_INTEGER",
 /*  63 */ "cmd ::= DROP SNODE ON DNODE NK_INTEGER",
 /*  64 */ "cmd ::= CREATE MNODE ON DNODE NK_INTEGER",
 /*  65 */ "cmd ::= DROP MNODE ON DNODE NK_INTEGER",
 /*  66 */ "cmd ::= CREATE DATABASE not_exists_opt db_name db_options",
 /*  67 */ "cmd ::= DROP DATABASE exists_opt db_name",
 /*  68 */ "cmd ::= USE db_name",
 /*  69 */ "cmd ::= ALTER DATABASE db_name alter_db_options",
 /*  70 */ "cmd ::= FLUSH DATABASE db_name",
 /*  71 */ "cmd ::= TRIM DATABASE db_name speed_opt",
 /*  72 */ "not_exists_opt ::= IF NOT EXISTS",
 /*  73 */ "not_exists_opt ::=",
 /*  74 */ "exists_opt ::= IF EXISTS",
 /*  75 */ "exists_opt ::=",
 /*  76 */ "db_options ::=",
 /*  77 */ "db_options ::= db_options BUFFER NK_INTEGER",
 /*  78 */ "db_options ::= db_options CACHEMODEL NK_STRING",
 /*  79 */ "db_options ::= db_options CACHESIZE NK_INTEGER",
 /*  80 */ "db_options ::= db_options COMP NK_INTEGER",
 /*  81 */ "db_options ::= db_options DURATION NK_INTEGER",
 /*  82 */ "db_options ::= db_options DURATION NK_VARIABLE",
 /*  83 */ "db_options ::= db_options MAXROWS NK_INTEGER",
 /*  84 */ "db_options ::= db_options MINROWS NK_INTEGER",
 /*  85 */ "db_options ::= db_options KEEP integer_list",
 /*  86 */ "db_options ::= db_options KEEP variable_list",
 /*  87 */ "db_options ::= db_options PAGES NK_INTEGER",
 /*  88 */ "db_options ::= db_options PAGESIZE NK_INTEGER",
 /*  89 */ "db_options ::= db_options TSDB_PAGESIZE NK_INTEGER",
 /*  90 */ "db_options ::= db_options PRECISION NK_STRING",
 /*  91 */ "db_options ::= db_options REPLICA NK_INTEGER",
1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 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 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 2100 2101 2102 2103 2104 2105 2106 2107 2108
 /*  92 */ "db_options ::= db_options VGROUPS NK_INTEGER",
 /*  93 */ "db_options ::= db_options SINGLE_STABLE NK_INTEGER",
 /*  94 */ "db_options ::= db_options RETENTIONS retention_list",
 /*  95 */ "db_options ::= db_options SCHEMALESS NK_INTEGER",
 /*  96 */ "db_options ::= db_options WAL_LEVEL NK_INTEGER",
 /*  97 */ "db_options ::= db_options WAL_FSYNC_PERIOD NK_INTEGER",
 /*  98 */ "db_options ::= db_options WAL_RETENTION_PERIOD NK_INTEGER",
 /*  99 */ "db_options ::= db_options WAL_RETENTION_PERIOD NK_MINUS NK_INTEGER",
 /* 100 */ "db_options ::= db_options WAL_RETENTION_SIZE NK_INTEGER",
 /* 101 */ "db_options ::= db_options WAL_RETENTION_SIZE NK_MINUS NK_INTEGER",
 /* 102 */ "db_options ::= db_options WAL_ROLL_PERIOD NK_INTEGER",
 /* 103 */ "db_options ::= db_options WAL_SEGMENT_SIZE NK_INTEGER",
 /* 104 */ "db_options ::= db_options STT_TRIGGER NK_INTEGER",
 /* 105 */ "db_options ::= db_options TABLE_PREFIX NK_INTEGER",
 /* 106 */ "db_options ::= db_options TABLE_SUFFIX NK_INTEGER",
 /* 107 */ "alter_db_options ::= alter_db_option",
 /* 108 */ "alter_db_options ::= alter_db_options alter_db_option",
 /* 109 */ "alter_db_option ::= BUFFER NK_INTEGER",
 /* 110 */ "alter_db_option ::= CACHEMODEL NK_STRING",
 /* 111 */ "alter_db_option ::= CACHESIZE NK_INTEGER",
 /* 112 */ "alter_db_option ::= WAL_FSYNC_PERIOD NK_INTEGER",
 /* 113 */ "alter_db_option ::= KEEP integer_list",
 /* 114 */ "alter_db_option ::= KEEP variable_list",
 /* 115 */ "alter_db_option ::= PAGES NK_INTEGER",
 /* 116 */ "alter_db_option ::= REPLICA NK_INTEGER",
 /* 117 */ "alter_db_option ::= WAL_LEVEL NK_INTEGER",
 /* 118 */ "alter_db_option ::= STT_TRIGGER NK_INTEGER",
 /* 119 */ "integer_list ::= NK_INTEGER",
 /* 120 */ "integer_list ::= integer_list NK_COMMA NK_INTEGER",
 /* 121 */ "variable_list ::= NK_VARIABLE",
 /* 122 */ "variable_list ::= variable_list NK_COMMA NK_VARIABLE",
 /* 123 */ "retention_list ::= retention",
 /* 124 */ "retention_list ::= retention_list NK_COMMA retention",
 /* 125 */ "retention ::= NK_VARIABLE NK_COLON NK_VARIABLE",
 /* 126 */ "speed_opt ::=",
 /* 127 */ "speed_opt ::= MAX_SPEED NK_INTEGER",
 /* 128 */ "cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options",
 /* 129 */ "cmd ::= CREATE TABLE multi_create_clause",
 /* 130 */ "cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options",
 /* 131 */ "cmd ::= DROP TABLE multi_drop_clause",
 /* 132 */ "cmd ::= DROP STABLE exists_opt full_table_name",
 /* 133 */ "cmd ::= ALTER TABLE alter_table_clause",
 /* 134 */ "cmd ::= ALTER STABLE alter_table_clause",
 /* 135 */ "alter_table_clause ::= full_table_name alter_table_options",
 /* 136 */ "alter_table_clause ::= full_table_name ADD COLUMN column_name type_name",
 /* 137 */ "alter_table_clause ::= full_table_name DROP COLUMN column_name",
 /* 138 */ "alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name",
 /* 139 */ "alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name",
 /* 140 */ "alter_table_clause ::= full_table_name ADD TAG column_name type_name",
 /* 141 */ "alter_table_clause ::= full_table_name DROP TAG column_name",
 /* 142 */ "alter_table_clause ::= full_table_name MODIFY TAG column_name type_name",
 /* 143 */ "alter_table_clause ::= full_table_name RENAME TAG column_name column_name",
 /* 144 */ "alter_table_clause ::= full_table_name SET TAG column_name NK_EQ signed_literal",
 /* 145 */ "multi_create_clause ::= create_subtable_clause",
 /* 146 */ "multi_create_clause ::= multi_create_clause create_subtable_clause",
 /* 147 */ "create_subtable_clause ::= not_exists_opt full_table_name USING full_table_name specific_cols_opt TAGS NK_LP expression_list NK_RP table_options",
 /* 148 */ "multi_drop_clause ::= drop_table_clause",
 /* 149 */ "multi_drop_clause ::= multi_drop_clause drop_table_clause",
 /* 150 */ "drop_table_clause ::= exists_opt full_table_name",
 /* 151 */ "specific_cols_opt ::=",
 /* 152 */ "specific_cols_opt ::= NK_LP col_name_list NK_RP",
 /* 153 */ "full_table_name ::= table_name",
 /* 154 */ "full_table_name ::= db_name NK_DOT table_name",
 /* 155 */ "column_def_list ::= column_def",
 /* 156 */ "column_def_list ::= column_def_list NK_COMMA column_def",
 /* 157 */ "column_def ::= column_name type_name",
 /* 158 */ "column_def ::= column_name type_name COMMENT NK_STRING",
 /* 159 */ "type_name ::= BOOL",
 /* 160 */ "type_name ::= TINYINT",
 /* 161 */ "type_name ::= SMALLINT",
 /* 162 */ "type_name ::= INT",
 /* 163 */ "type_name ::= INTEGER",
 /* 164 */ "type_name ::= BIGINT",
 /* 165 */ "type_name ::= FLOAT",
 /* 166 */ "type_name ::= DOUBLE",
 /* 167 */ "type_name ::= BINARY NK_LP NK_INTEGER NK_RP",
 /* 168 */ "type_name ::= TIMESTAMP",
 /* 169 */ "type_name ::= NCHAR NK_LP NK_INTEGER NK_RP",
 /* 170 */ "type_name ::= TINYINT UNSIGNED",
 /* 171 */ "type_name ::= SMALLINT UNSIGNED",
 /* 172 */ "type_name ::= INT UNSIGNED",
 /* 173 */ "type_name ::= BIGINT UNSIGNED",
 /* 174 */ "type_name ::= JSON",
 /* 175 */ "type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP",
 /* 176 */ "type_name ::= MEDIUMBLOB",
 /* 177 */ "type_name ::= BLOB",
 /* 178 */ "type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP",
 /* 179 */ "type_name ::= DECIMAL",
 /* 180 */ "type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP",
 /* 181 */ "type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP",
 /* 182 */ "tags_def_opt ::=",
 /* 183 */ "tags_def_opt ::= tags_def",
 /* 184 */ "tags_def ::= TAGS NK_LP column_def_list NK_RP",
 /* 185 */ "table_options ::=",
 /* 186 */ "table_options ::= table_options COMMENT NK_STRING",
 /* 187 */ "table_options ::= table_options MAX_DELAY duration_list",
 /* 188 */ "table_options ::= table_options WATERMARK duration_list",
 /* 189 */ "table_options ::= table_options ROLLUP NK_LP rollup_func_list NK_RP",
 /* 190 */ "table_options ::= table_options TTL NK_INTEGER",
 /* 191 */ "table_options ::= table_options SMA NK_LP col_name_list NK_RP",
 /* 192 */ "table_options ::= table_options DELETE_MARK duration_list",
 /* 193 */ "alter_table_options ::= alter_table_option",
 /* 194 */ "alter_table_options ::= alter_table_options alter_table_option",
 /* 195 */ "alter_table_option ::= COMMENT NK_STRING",
 /* 196 */ "alter_table_option ::= TTL NK_INTEGER",
 /* 197 */ "duration_list ::= duration_literal",
 /* 198 */ "duration_list ::= duration_list NK_COMMA duration_literal",
 /* 199 */ "rollup_func_list ::= rollup_func_name",
 /* 200 */ "rollup_func_list ::= rollup_func_list NK_COMMA rollup_func_name",
 /* 201 */ "rollup_func_name ::= function_name",
 /* 202 */ "rollup_func_name ::= FIRST",
 /* 203 */ "rollup_func_name ::= LAST",
 /* 204 */ "col_name_list ::= col_name",
 /* 205 */ "col_name_list ::= col_name_list NK_COMMA col_name",
 /* 206 */ "col_name ::= column_name",
 /* 207 */ "cmd ::= SHOW DNODES",
 /* 208 */ "cmd ::= SHOW USERS",
 /* 209 */ "cmd ::= SHOW USER PRIVILEGES",
 /* 210 */ "cmd ::= SHOW DATABASES",
 /* 211 */ "cmd ::= SHOW db_name_cond_opt TABLES like_pattern_opt",
 /* 212 */ "cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt",
 /* 213 */ "cmd ::= SHOW db_name_cond_opt VGROUPS",
 /* 214 */ "cmd ::= SHOW MNODES",
 /* 215 */ "cmd ::= SHOW QNODES",
 /* 216 */ "cmd ::= SHOW FUNCTIONS",
 /* 217 */ "cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt",
 /* 218 */ "cmd ::= SHOW STREAMS",
 /* 219 */ "cmd ::= SHOW ACCOUNTS",
 /* 220 */ "cmd ::= SHOW APPS",
 /* 221 */ "cmd ::= SHOW CONNECTIONS",
 /* 222 */ "cmd ::= SHOW LICENCES",
 /* 223 */ "cmd ::= SHOW GRANTS",
 /* 224 */ "cmd ::= SHOW CREATE DATABASE db_name",
 /* 225 */ "cmd ::= SHOW CREATE TABLE full_table_name",
 /* 226 */ "cmd ::= SHOW CREATE STABLE full_table_name",
 /* 227 */ "cmd ::= SHOW QUERIES",
 /* 228 */ "cmd ::= SHOW SCORES",
 /* 229 */ "cmd ::= SHOW TOPICS",
 /* 230 */ "cmd ::= SHOW VARIABLES",
 /* 231 */ "cmd ::= SHOW CLUSTER VARIABLES",
 /* 232 */ "cmd ::= SHOW LOCAL VARIABLES",
 /* 233 */ "cmd ::= SHOW DNODE NK_INTEGER VARIABLES like_pattern_opt",
 /* 234 */ "cmd ::= SHOW BNODES",
 /* 235 */ "cmd ::= SHOW SNODES",
 /* 236 */ "cmd ::= SHOW CLUSTER",
 /* 237 */ "cmd ::= SHOW TRANSACTIONS",
 /* 238 */ "cmd ::= SHOW TABLE DISTRIBUTED full_table_name",
 /* 239 */ "cmd ::= SHOW CONSUMERS",
 /* 240 */ "cmd ::= SHOW SUBSCRIPTIONS",
 /* 241 */ "cmd ::= SHOW TAGS FROM table_name_cond from_db_opt",
 /* 242 */ "cmd ::= SHOW TABLE TAGS tag_list_opt FROM table_name_cond from_db_opt",
 /* 243 */ "cmd ::= SHOW VNODES NK_INTEGER",
 /* 244 */ "cmd ::= SHOW VNODES NK_STRING",
 /* 245 */ "db_name_cond_opt ::=",
 /* 246 */ "db_name_cond_opt ::= db_name NK_DOT",
 /* 247 */ "like_pattern_opt ::=",
 /* 248 */ "like_pattern_opt ::= LIKE NK_STRING",
 /* 249 */ "table_name_cond ::= table_name",
 /* 250 */ "from_db_opt ::=",
 /* 251 */ "from_db_opt ::= FROM db_name",
 /* 252 */ "tag_list_opt ::=",
 /* 253 */ "tag_list_opt ::= tag_item",
 /* 254 */ "tag_list_opt ::= tag_list_opt NK_COMMA tag_item",
 /* 255 */ "tag_item ::= TBNAME",
 /* 256 */ "tag_item ::= QTAGS",
 /* 257 */ "tag_item ::= column_name",
 /* 258 */ "tag_item ::= column_name column_alias",
 /* 259 */ "tag_item ::= column_name AS column_alias",
2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152
 /* 260 */ "cmd ::= CREATE SMA INDEX not_exists_opt full_index_name ON full_table_name index_options",
 /* 261 */ "cmd ::= DROP INDEX exists_opt full_index_name",
 /* 262 */ "full_index_name ::= index_name",
 /* 263 */ "full_index_name ::= db_name NK_DOT index_name",
 /* 264 */ "index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt sma_stream_opt",
 /* 265 */ "index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt sma_stream_opt",
 /* 266 */ "func_list ::= func",
 /* 267 */ "func_list ::= func_list NK_COMMA func",
 /* 268 */ "func ::= function_name NK_LP expression_list NK_RP",
 /* 269 */ "sma_stream_opt ::=",
 /* 270 */ "sma_stream_opt ::= sma_stream_opt WATERMARK duration_literal",
 /* 271 */ "sma_stream_opt ::= sma_stream_opt MAX_DELAY duration_literal",
 /* 272 */ "sma_stream_opt ::= sma_stream_opt DELETE_MARK duration_literal",
 /* 273 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_or_subquery",
 /* 274 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name AS DATABASE db_name",
 /* 275 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS DATABASE db_name",
 /* 276 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name AS STABLE full_table_name",
 /* 277 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS STABLE full_table_name",
 /* 278 */ "cmd ::= DROP TOPIC exists_opt topic_name",
 /* 279 */ "cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name",
 /* 280 */ "cmd ::= DESC full_table_name",
 /* 281 */ "cmd ::= DESCRIBE full_table_name",
 /* 282 */ "cmd ::= RESET QUERY CACHE",
 /* 283 */ "cmd ::= EXPLAIN analyze_opt explain_options query_or_subquery",
 /* 284 */ "analyze_opt ::=",
 /* 285 */ "analyze_opt ::= ANALYZE",
 /* 286 */ "explain_options ::=",
 /* 287 */ "explain_options ::= explain_options VERBOSE NK_BOOL",
 /* 288 */ "explain_options ::= explain_options RATIO NK_FLOAT",
 /* 289 */ "cmd ::= CREATE agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt",
 /* 290 */ "cmd ::= DROP FUNCTION exists_opt function_name",
 /* 291 */ "agg_func_opt ::=",
 /* 292 */ "agg_func_opt ::= AGGREGATE",
 /* 293 */ "bufsize_opt ::=",
 /* 294 */ "bufsize_opt ::= BUFSIZE NK_INTEGER",
 /* 295 */ "cmd ::= CREATE STREAM not_exists_opt stream_name stream_options INTO full_table_name tags_def_opt subtable_opt AS query_or_subquery",
 /* 296 */ "cmd ::= DROP STREAM exists_opt stream_name",
 /* 297 */ "stream_options ::=",
 /* 298 */ "stream_options ::= stream_options TRIGGER AT_ONCE",
 /* 299 */ "stream_options ::= stream_options TRIGGER WINDOW_CLOSE",
 /* 300 */ "stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal",
 /* 301 */ "stream_options ::= stream_options WATERMARK duration_literal",
 /* 302 */ "stream_options ::= stream_options IGNORE EXPIRED NK_INTEGER",
 /* 303 */ "stream_options ::= stream_options FILL_HISTORY NK_INTEGER",
2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 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 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 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 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 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
 /* 304 */ "stream_options ::= stream_options DELETE_MARK duration_literal",
 /* 305 */ "subtable_opt ::=",
 /* 306 */ "subtable_opt ::= SUBTABLE NK_LP expression NK_RP",
 /* 307 */ "cmd ::= KILL CONNECTION NK_INTEGER",
 /* 308 */ "cmd ::= KILL QUERY NK_STRING",
 /* 309 */ "cmd ::= KILL TRANSACTION NK_INTEGER",
 /* 310 */ "cmd ::= BALANCE VGROUP",
 /* 311 */ "cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER",
 /* 312 */ "cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list",
 /* 313 */ "cmd ::= SPLIT VGROUP NK_INTEGER",
 /* 314 */ "dnode_list ::= DNODE NK_INTEGER",
 /* 315 */ "dnode_list ::= dnode_list DNODE NK_INTEGER",
 /* 316 */ "cmd ::= DELETE FROM full_table_name where_clause_opt",
 /* 317 */ "cmd ::= query_or_subquery",
 /* 318 */ "cmd ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery",
 /* 319 */ "cmd ::= INSERT INTO full_table_name query_or_subquery",
 /* 320 */ "literal ::= NK_INTEGER",
 /* 321 */ "literal ::= NK_FLOAT",
 /* 322 */ "literal ::= NK_STRING",
 /* 323 */ "literal ::= NK_BOOL",
 /* 324 */ "literal ::= TIMESTAMP NK_STRING",
 /* 325 */ "literal ::= duration_literal",
 /* 326 */ "literal ::= NULL",
 /* 327 */ "literal ::= NK_QUESTION",
 /* 328 */ "duration_literal ::= NK_VARIABLE",
 /* 329 */ "signed ::= NK_INTEGER",
 /* 330 */ "signed ::= NK_PLUS NK_INTEGER",
 /* 331 */ "signed ::= NK_MINUS NK_INTEGER",
 /* 332 */ "signed ::= NK_FLOAT",
 /* 333 */ "signed ::= NK_PLUS NK_FLOAT",
 /* 334 */ "signed ::= NK_MINUS NK_FLOAT",
 /* 335 */ "signed_literal ::= signed",
 /* 336 */ "signed_literal ::= NK_STRING",
 /* 337 */ "signed_literal ::= NK_BOOL",
 /* 338 */ "signed_literal ::= TIMESTAMP NK_STRING",
 /* 339 */ "signed_literal ::= duration_literal",
 /* 340 */ "signed_literal ::= NULL",
 /* 341 */ "signed_literal ::= literal_func",
 /* 342 */ "signed_literal ::= NK_QUESTION",
 /* 343 */ "literal_list ::= signed_literal",
 /* 344 */ "literal_list ::= literal_list NK_COMMA signed_literal",
 /* 345 */ "db_name ::= NK_ID",
 /* 346 */ "table_name ::= NK_ID",
 /* 347 */ "column_name ::= NK_ID",
 /* 348 */ "function_name ::= NK_ID",
 /* 349 */ "table_alias ::= NK_ID",
 /* 350 */ "column_alias ::= NK_ID",
 /* 351 */ "user_name ::= NK_ID",
 /* 352 */ "topic_name ::= NK_ID",
 /* 353 */ "stream_name ::= NK_ID",
 /* 354 */ "cgroup_name ::= NK_ID",
 /* 355 */ "index_name ::= NK_ID",
 /* 356 */ "expr_or_subquery ::= expression",
 /* 357 */ "expression ::= literal",
 /* 358 */ "expression ::= pseudo_column",
 /* 359 */ "expression ::= column_reference",
 /* 360 */ "expression ::= function_expression",
 /* 361 */ "expression ::= case_when_expression",
 /* 362 */ "expression ::= NK_LP expression NK_RP",
 /* 363 */ "expression ::= NK_PLUS expr_or_subquery",
 /* 364 */ "expression ::= NK_MINUS expr_or_subquery",
 /* 365 */ "expression ::= expr_or_subquery NK_PLUS expr_or_subquery",
 /* 366 */ "expression ::= expr_or_subquery NK_MINUS expr_or_subquery",
 /* 367 */ "expression ::= expr_or_subquery NK_STAR expr_or_subquery",
 /* 368 */ "expression ::= expr_or_subquery NK_SLASH expr_or_subquery",
 /* 369 */ "expression ::= expr_or_subquery NK_REM expr_or_subquery",
 /* 370 */ "expression ::= column_reference NK_ARROW NK_STRING",
 /* 371 */ "expression ::= expr_or_subquery NK_BITAND expr_or_subquery",
 /* 372 */ "expression ::= expr_or_subquery NK_BITOR expr_or_subquery",
 /* 373 */ "expression_list ::= expr_or_subquery",
 /* 374 */ "expression_list ::= expression_list NK_COMMA expr_or_subquery",
 /* 375 */ "column_reference ::= column_name",
 /* 376 */ "column_reference ::= table_name NK_DOT column_name",
 /* 377 */ "pseudo_column ::= ROWTS",
 /* 378 */ "pseudo_column ::= TBNAME",
 /* 379 */ "pseudo_column ::= table_name NK_DOT TBNAME",
 /* 380 */ "pseudo_column ::= QSTART",
 /* 381 */ "pseudo_column ::= QEND",
 /* 382 */ "pseudo_column ::= QDURATION",
 /* 383 */ "pseudo_column ::= WSTART",
 /* 384 */ "pseudo_column ::= WEND",
 /* 385 */ "pseudo_column ::= WDURATION",
 /* 386 */ "pseudo_column ::= IROWTS",
 /* 387 */ "pseudo_column ::= QTAGS",
 /* 388 */ "function_expression ::= function_name NK_LP expression_list NK_RP",
 /* 389 */ "function_expression ::= star_func NK_LP star_func_para_list NK_RP",
 /* 390 */ "function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP",
 /* 391 */ "function_expression ::= literal_func",
 /* 392 */ "literal_func ::= noarg_func NK_LP NK_RP",
 /* 393 */ "literal_func ::= NOW",
 /* 394 */ "noarg_func ::= NOW",
 /* 395 */ "noarg_func ::= TODAY",
 /* 396 */ "noarg_func ::= TIMEZONE",
 /* 397 */ "noarg_func ::= DATABASE",
 /* 398 */ "noarg_func ::= CLIENT_VERSION",
 /* 399 */ "noarg_func ::= SERVER_VERSION",
 /* 400 */ "noarg_func ::= SERVER_STATUS",
 /* 401 */ "noarg_func ::= CURRENT_USER",
 /* 402 */ "noarg_func ::= USER",
 /* 403 */ "star_func ::= COUNT",
 /* 404 */ "star_func ::= FIRST",
 /* 405 */ "star_func ::= LAST",
 /* 406 */ "star_func ::= LAST_ROW",
 /* 407 */ "star_func_para_list ::= NK_STAR",
 /* 408 */ "star_func_para_list ::= other_para_list",
 /* 409 */ "other_para_list ::= star_func_para",
 /* 410 */ "other_para_list ::= other_para_list NK_COMMA star_func_para",
 /* 411 */ "star_func_para ::= expr_or_subquery",
 /* 412 */ "star_func_para ::= table_name NK_DOT NK_STAR",
 /* 413 */ "case_when_expression ::= CASE when_then_list case_when_else_opt END",
 /* 414 */ "case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END",
 /* 415 */ "when_then_list ::= when_then_expr",
 /* 416 */ "when_then_list ::= when_then_list when_then_expr",
 /* 417 */ "when_then_expr ::= WHEN common_expression THEN common_expression",
 /* 418 */ "case_when_else_opt ::=",
 /* 419 */ "case_when_else_opt ::= ELSE common_expression",
 /* 420 */ "predicate ::= expr_or_subquery compare_op expr_or_subquery",
 /* 421 */ "predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery",
 /* 422 */ "predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery",
 /* 423 */ "predicate ::= expr_or_subquery IS NULL",
 /* 424 */ "predicate ::= expr_or_subquery IS NOT NULL",
 /* 425 */ "predicate ::= expr_or_subquery in_op in_predicate_value",
 /* 426 */ "compare_op ::= NK_LT",
 /* 427 */ "compare_op ::= NK_GT",
 /* 428 */ "compare_op ::= NK_LE",
 /* 429 */ "compare_op ::= NK_GE",
 /* 430 */ "compare_op ::= NK_NE",
 /* 431 */ "compare_op ::= NK_EQ",
 /* 432 */ "compare_op ::= LIKE",
 /* 433 */ "compare_op ::= NOT LIKE",
 /* 434 */ "compare_op ::= MATCH",
 /* 435 */ "compare_op ::= NMATCH",
 /* 436 */ "compare_op ::= CONTAINS",
 /* 437 */ "in_op ::= IN",
 /* 438 */ "in_op ::= NOT IN",
 /* 439 */ "in_predicate_value ::= NK_LP literal_list NK_RP",
 /* 440 */ "boolean_value_expression ::= boolean_primary",
 /* 441 */ "boolean_value_expression ::= NOT boolean_primary",
 /* 442 */ "boolean_value_expression ::= boolean_value_expression OR boolean_value_expression",
 /* 443 */ "boolean_value_expression ::= boolean_value_expression AND boolean_value_expression",
 /* 444 */ "boolean_primary ::= predicate",
 /* 445 */ "boolean_primary ::= NK_LP boolean_value_expression NK_RP",
 /* 446 */ "common_expression ::= expr_or_subquery",
 /* 447 */ "common_expression ::= boolean_value_expression",
 /* 448 */ "from_clause_opt ::=",
 /* 449 */ "from_clause_opt ::= FROM table_reference_list",
 /* 450 */ "table_reference_list ::= table_reference",
 /* 451 */ "table_reference_list ::= table_reference_list NK_COMMA table_reference",
 /* 452 */ "table_reference ::= table_primary",
 /* 453 */ "table_reference ::= joined_table",
 /* 454 */ "table_primary ::= table_name alias_opt",
 /* 455 */ "table_primary ::= db_name NK_DOT table_name alias_opt",
 /* 456 */ "table_primary ::= subquery alias_opt",
 /* 457 */ "table_primary ::= parenthesized_joined_table",
 /* 458 */ "alias_opt ::=",
 /* 459 */ "alias_opt ::= table_alias",
 /* 460 */ "alias_opt ::= AS table_alias",
 /* 461 */ "parenthesized_joined_table ::= NK_LP joined_table NK_RP",
 /* 462 */ "parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP",
 /* 463 */ "joined_table ::= table_reference join_type JOIN table_reference ON search_condition",
 /* 464 */ "join_type ::=",
 /* 465 */ "join_type ::= INNER",
 /* 466 */ "query_specification ::= SELECT set_quantifier_opt select_list from_clause_opt where_clause_opt partition_by_clause_opt range_opt every_opt fill_opt twindow_clause_opt group_by_clause_opt having_clause_opt",
 /* 467 */ "set_quantifier_opt ::=",
 /* 468 */ "set_quantifier_opt ::= DISTINCT",
 /* 469 */ "set_quantifier_opt ::= ALL",
 /* 470 */ "select_list ::= select_item",
 /* 471 */ "select_list ::= select_list NK_COMMA select_item",
 /* 472 */ "select_item ::= NK_STAR",
 /* 473 */ "select_item ::= common_expression",
 /* 474 */ "select_item ::= common_expression column_alias",
 /* 475 */ "select_item ::= common_expression AS column_alias",
 /* 476 */ "select_item ::= table_name NK_DOT NK_STAR",
 /* 477 */ "where_clause_opt ::=",
 /* 478 */ "where_clause_opt ::= WHERE search_condition",
 /* 479 */ "partition_by_clause_opt ::=",
 /* 480 */ "partition_by_clause_opt ::= PARTITION BY partition_list",
 /* 481 */ "partition_list ::= partition_item",
 /* 482 */ "partition_list ::= partition_list NK_COMMA partition_item",
 /* 483 */ "partition_item ::= expr_or_subquery",
 /* 484 */ "partition_item ::= expr_or_subquery column_alias",
 /* 485 */ "partition_item ::= expr_or_subquery AS column_alias",
 /* 486 */ "twindow_clause_opt ::=",
 /* 487 */ "twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP",
 /* 488 */ "twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP",
 /* 489 */ "twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt",
 /* 490 */ "twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt",
 /* 491 */ "sliding_opt ::=",
 /* 492 */ "sliding_opt ::= SLIDING NK_LP duration_literal NK_RP",
 /* 493 */ "fill_opt ::=",
 /* 494 */ "fill_opt ::= FILL NK_LP fill_mode NK_RP",
 /* 495 */ "fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP",
 /* 496 */ "fill_mode ::= NONE",
 /* 497 */ "fill_mode ::= PREV",
 /* 498 */ "fill_mode ::= NULL",
 /* 499 */ "fill_mode ::= LINEAR",
 /* 500 */ "fill_mode ::= NEXT",
 /* 501 */ "group_by_clause_opt ::=",
 /* 502 */ "group_by_clause_opt ::= GROUP BY group_by_list",
 /* 503 */ "group_by_list ::= expr_or_subquery",
 /* 504 */ "group_by_list ::= group_by_list NK_COMMA expr_or_subquery",
 /* 505 */ "having_clause_opt ::=",
 /* 506 */ "having_clause_opt ::= HAVING search_condition",
 /* 507 */ "range_opt ::=",
 /* 508 */ "range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP",
 /* 509 */ "every_opt ::=",
 /* 510 */ "every_opt ::= EVERY NK_LP duration_literal NK_RP",
 /* 511 */ "query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt",
 /* 512 */ "query_simple ::= query_specification",
 /* 513 */ "query_simple ::= union_query_expression",
 /* 514 */ "union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery",
 /* 515 */ "union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery",
 /* 516 */ "query_simple_or_subquery ::= query_simple",
 /* 517 */ "query_simple_or_subquery ::= subquery",
 /* 518 */ "query_or_subquery ::= query_expression",
 /* 519 */ "query_or_subquery ::= subquery",
 /* 520 */ "order_by_clause_opt ::=",
 /* 521 */ "order_by_clause_opt ::= ORDER BY sort_specification_list",
 /* 522 */ "slimit_clause_opt ::=",
 /* 523 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER",
 /* 524 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER",
 /* 525 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER",
 /* 526 */ "limit_clause_opt ::=",
 /* 527 */ "limit_clause_opt ::= LIMIT NK_INTEGER",
 /* 528 */ "limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER",
 /* 529 */ "limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER",
 /* 530 */ "subquery ::= NK_LP query_expression NK_RP",
 /* 531 */ "subquery ::= NK_LP subquery NK_RP",
 /* 532 */ "search_condition ::= common_expression",
 /* 533 */ "sort_specification_list ::= sort_specification",
 /* 534 */ "sort_specification_list ::= sort_specification_list NK_COMMA sort_specification",
 /* 535 */ "sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt",
 /* 536 */ "ordering_specification_opt ::=",
 /* 537 */ "ordering_specification_opt ::= ASC",
 /* 538 */ "ordering_specification_opt ::= DESC",
 /* 539 */ "null_ordering_opt ::=",
 /* 540 */ "null_ordering_opt ::= NULLS FIRST",
 /* 541 */ "null_ordering_opt ::= NULLS LAST",
2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407
};
#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 已提交
2408
    pNew = malloc(newSize*sizeof(pNew[0]));
2409 2410
    if( pNew ) pNew[0] = p->yystk0;
  }else{
X
Xiaoyu Wang 已提交
2411
    pNew = realloc(p->yystack, newSize*sizeof(pNew[0]));
2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428
  }
  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 已提交
2429
** second argument to ParseAlloc() below.  This can be changed by
2430 2431 2432 2433 2434 2435 2436 2437 2438
** 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 已提交
2439
void ParseInit(void *yypRawParser ParseCTX_PDECL){
2440
  yyParser *yypParser = (yyParser*)yypRawParser;
X
Xiaoyu Wang 已提交
2441
  ParseCTX_STORE
2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464
#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 已提交
2465
#ifndef Parse_ENGINEALWAYSONSTACK
2466 2467 2468 2469 2470 2471 2472 2473 2474 2475
/* 
** 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 已提交
2476
** to Parse and ParseFree.
2477
*/
X
Xiaoyu Wang 已提交
2478
void *ParseAlloc(void *(*mallocProc)(YYMALLOCARGTYPE) ParseCTX_PDECL){
2479 2480 2481
  yyParser *yypParser;
  yypParser = (yyParser*)(*mallocProc)( (YYMALLOCARGTYPE)sizeof(yyParser) );
  if( yypParser ){
X
Xiaoyu Wang 已提交
2482 2483
    ParseCTX_STORE
    ParseInit(yypParser ParseCTX_PARAM);
2484 2485 2486
  }
  return (void*)yypParser;
}
X
Xiaoyu Wang 已提交
2487
#endif /* Parse_ENGINEALWAYSONSTACK */
2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501


/* 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 已提交
2502 2503
  ParseARG_FETCH
  ParseCTX_FETCH
2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516
  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 */
2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533 2534 2535 2536 2537
    case 322: /* cmd */
    case 325: /* literal */
    case 338: /* db_options */
    case 340: /* alter_db_options */
    case 346: /* retention */
    case 347: /* full_table_name */
    case 350: /* table_options */
    case 354: /* alter_table_clause */
    case 355: /* alter_table_options */
    case 358: /* signed_literal */
    case 359: /* create_subtable_clause */
    case 362: /* drop_table_clause */
    case 365: /* column_def */
    case 369: /* duration_literal */
    case 370: /* rollup_func_name */
    case 372: /* col_name */
    case 373: /* db_name_cond_opt */
    case 374: /* like_pattern_opt */
    case 375: /* table_name_cond */
    case 376: /* from_db_opt */
    case 378: /* tag_item */
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
    case 380: /* full_index_name */
    case 381: /* index_options */
    case 384: /* sliding_opt */
    case 385: /* sma_stream_opt */
    case 386: /* func */
    case 387: /* query_or_subquery */
    case 390: /* explain_options */
    case 394: /* stream_options */
    case 395: /* subtable_opt */
    case 396: /* expression */
    case 398: /* where_clause_opt */
    case 399: /* signed */
    case 400: /* literal_func */
    case 403: /* expr_or_subquery */
    case 404: /* pseudo_column */
    case 405: /* column_reference */
    case 406: /* function_expression */
    case 407: /* case_when_expression */
    case 412: /* star_func_para */
    case 414: /* case_when_else_opt */
    case 415: /* common_expression */
    case 416: /* when_then_expr */
    case 417: /* predicate */
    case 420: /* in_predicate_value */
    case 421: /* boolean_value_expression */
    case 422: /* boolean_primary */
    case 423: /* from_clause_opt */
    case 424: /* table_reference_list */
    case 425: /* table_reference */
    case 426: /* table_primary */
    case 427: /* joined_table */
    case 429: /* subquery */
    case 430: /* parenthesized_joined_table */
    case 432: /* search_condition */
    case 433: /* query_specification */
    case 437: /* range_opt */
    case 438: /* every_opt */
    case 439: /* fill_opt */
    case 440: /* twindow_clause_opt */
    case 442: /* having_clause_opt */
    case 443: /* select_item */
    case 445: /* partition_item */
    case 448: /* query_expression */
    case 449: /* query_simple */
    case 451: /* slimit_clause_opt */
    case 452: /* limit_clause_opt */
    case 453: /* union_query_expression */
    case 454: /* query_simple_or_subquery */
    case 456: /* sort_specification */
X
Xiaoyu Wang 已提交
2587
{
2588
 nodesDestroyNode((yypminor->yy74)); 
X
Xiaoyu Wang 已提交
2589 2590
}
      break;
2591 2592 2593 2594
    case 323: /* account_options */
    case 324: /* alter_account_options */
    case 326: /* alter_account_option */
    case 341: /* speed_opt */
2595
    case 392: /* bufsize_opt */
2596
{
X
Xiaoyu Wang 已提交
2597
 
2598 2599
}
      break;
2600 2601 2602 2603 2604 2605 2606 2607 2608
    case 327: /* user_name */
    case 330: /* priv_level */
    case 333: /* db_name */
    case 334: /* topic_name */
    case 335: /* dnode_endpoint */
    case 356: /* column_name */
    case 364: /* table_name */
    case 371: /* function_name */
    case 379: /* column_alias */
2609 2610 2611 2612 2613 2614 2615
    case 382: /* index_name */
    case 388: /* cgroup_name */
    case 393: /* stream_name */
    case 402: /* table_alias */
    case 408: /* star_func */
    case 410: /* noarg_func */
    case 428: /* alias_opt */
2616
{
2617
 
2618 2619
}
      break;
2620
    case 328: /* sysinfo_opt */
2621
{
2622
 
2623 2624
}
      break;
2625 2626 2627
    case 329: /* privileges */
    case 331: /* priv_type_list */
    case 332: /* priv_type */
2628
{
2629
 
2630 2631
}
      break;
2632 2633 2634
    case 336: /* force_opt */
    case 337: /* not_exists_opt */
    case 339: /* exists_opt */
2635 2636 2637
    case 389: /* analyze_opt */
    case 391: /* agg_func_opt */
    case 434: /* set_quantifier_opt */
2638
{
2639 2640 2641
 
}
      break;
2642 2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655
    case 342: /* integer_list */
    case 343: /* variable_list */
    case 344: /* retention_list */
    case 348: /* column_def_list */
    case 349: /* tags_def_opt */
    case 351: /* multi_create_clause */
    case 352: /* tags_def */
    case 353: /* multi_drop_clause */
    case 360: /* specific_cols_opt */
    case 361: /* expression_list */
    case 363: /* col_name_list */
    case 366: /* duration_list */
    case 367: /* rollup_func_list */
    case 377: /* tag_list_opt */
2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668
    case 383: /* func_list */
    case 397: /* dnode_list */
    case 401: /* literal_list */
    case 409: /* star_func_para_list */
    case 411: /* other_para_list */
    case 413: /* when_then_list */
    case 435: /* select_list */
    case 436: /* partition_by_clause_opt */
    case 441: /* group_by_clause_opt */
    case 444: /* partition_list */
    case 447: /* group_by_list */
    case 450: /* order_by_clause_opt */
    case 455: /* sort_specification_list */
2669
{
2670
 nodesDestroyList((yypminor->yy874)); 
2671 2672
}
      break;
2673 2674
    case 345: /* alter_db_option */
    case 368: /* alter_table_option */
2675
{
X
Xiaoyu Wang 已提交
2676
 
2677 2678
}
      break;
2679
    case 357: /* type_name */
2680
{
2681
 
2682 2683
}
      break;
2684 2685
    case 418: /* compare_op */
    case 419: /* in_op */
2686
{
2687
 
2688 2689
}
      break;
2690
    case 431: /* join_type */
2691
{
2692
 
2693 2694
}
      break;
2695
    case 446: /* fill_mode */
2696
{
2697
 
2698 2699
}
      break;
2700
    case 457: /* ordering_specification_opt */
2701
{
2702
 
2703 2704
}
      break;
2705
    case 458: /* null_ordering_opt */
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
}
      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 已提交
2739
void ParseFinalize(void *p){
2740 2741 2742
  yyParser *pParser = (yyParser*)p;
  while( pParser->yytos>pParser->yystack ) yy_pop_parser_stack(pParser);
#if YYSTACKDEPTH<=0
X
Xiaoyu Wang 已提交
2743
  if( pParser->yystack!=&pParser->yystk0 ) free(pParser->yystack);
2744 2745 2746
#endif
}

X
Xiaoyu Wang 已提交
2747
#ifndef Parse_ENGINEALWAYSONSTACK
2748 2749 2750 2751 2752 2753 2754 2755
/* 
** 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 已提交
2756
void ParseFree(
2757 2758 2759 2760 2761 2762
  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 已提交
2763
  ParseFinalize(p);
2764 2765
  (*freeProc)(p);
}
X
Xiaoyu Wang 已提交
2766
#endif /* Parse_ENGINEALWAYSONSTACK */
2767 2768 2769 2770 2771

/*
** Return the peak depth of the stack for a parser.
*/
#ifdef YYTRACKMAXSTACKDEPTH
X
Xiaoyu Wang 已提交
2772
int ParseStackPeak(void *p){
2773 2774 2775 2776 2777 2778 2779 2780 2781 2782 2783 2784 2785 2786 2787 2788 2789 2790 2791 2792 2793 2794 2795
  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 已提交
2796
int ParseCoverage(FILE *out){
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
  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 );
X
Xiaoyu Wang 已提交
2833
    /* assert( i+YYNTOKEN<=(int)YY_NLOOKAHEAD ); */
2834 2835 2836
    assert( iLookAhead!=YYNOCODE );
    assert( iLookAhead < YYNTOKEN );
    i += iLookAhead;
X
Xiaoyu Wang 已提交
2837
    if( i>=YY_NLOOKAHEAD || yy_lookahead[i]!=iLookAhead ){
2838 2839
#ifdef YYFALLBACK
      YYCODETYPE iFallback;            /* Fallback token */
X
Xiaoyu Wang 已提交
2840 2841
      if( iLookAhead<sizeof(yyFallback)/sizeof(yyFallback[0])
             && (iFallback = yyFallback[iLookAhead])!=0 ){
2842 2843 2844 2845 2846 2847 2848 2849 2850 2851 2852 2853 2854 2855
#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;
X
Xiaoyu Wang 已提交
2856 2857 2858 2859 2860 2861 2862 2863 2864 2865
        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
        ){
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
#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 已提交
2918 2919
   ParseARG_FETCH
   ParseCTX_FETCH
2920 2921 2922 2923 2924 2925 2926 2927 2928 2929
#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 已提交
2930 2931
   ParseARG_STORE /* Suppress warning about unused %extra_argument var */
   ParseCTX_STORE
2932 2933 2934 2935 2936 2937 2938 2939 2940 2941 2942 2943 2944 2945 2946 2947 2948 2949 2950 2951 2952 2953 2954 2955 2956 2957 2958 2959 2960 2961
}

/*
** 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 已提交
2962
  ParseTOKENTYPE yyMinor        /* The minor token to shift in */
2963 2964 2965 2966 2967 2968 2969 2970 2971 2972 2973 2974 2975 2976 2977 2978 2979 2980 2981 2982 2983 2984 2985 2986 2987 2988 2989 2990 2991 2992 2993 2994 2995 2996
){
  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");
}

X
Xiaoyu Wang 已提交
2997 2998 2999 3000 3001 3002 3003
/* 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[] = {
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 3029 3030 3031 3032 3033 3034 3035 3036 3037 3038 3039 3040 3041 3042 3043 3044 3045 3046 3047 3048 3049 3050 3051 3052 3053 3054 3055 3056 3057 3058 3059 3060 3061 3062 3063 3064 3065 3066 3067 3068 3069 3070 3071 3072 3073 3074 3075 3076 3077 3078 3079 3080 3081 3082 3083 3084 3085 3086 3087 3088 3089 3090 3091 3092 3093 3094 3095
  {  322,   -6 }, /* (0) cmd ::= CREATE ACCOUNT NK_ID PASS NK_STRING account_options */
  {  322,   -4 }, /* (1) cmd ::= ALTER ACCOUNT NK_ID alter_account_options */
  {  323,    0 }, /* (2) account_options ::= */
  {  323,   -3 }, /* (3) account_options ::= account_options PPS literal */
  {  323,   -3 }, /* (4) account_options ::= account_options TSERIES literal */
  {  323,   -3 }, /* (5) account_options ::= account_options STORAGE literal */
  {  323,   -3 }, /* (6) account_options ::= account_options STREAMS literal */
  {  323,   -3 }, /* (7) account_options ::= account_options QTIME literal */
  {  323,   -3 }, /* (8) account_options ::= account_options DBS literal */
  {  323,   -3 }, /* (9) account_options ::= account_options USERS literal */
  {  323,   -3 }, /* (10) account_options ::= account_options CONNS literal */
  {  323,   -3 }, /* (11) account_options ::= account_options STATE literal */
  {  324,   -1 }, /* (12) alter_account_options ::= alter_account_option */
  {  324,   -2 }, /* (13) alter_account_options ::= alter_account_options alter_account_option */
  {  326,   -2 }, /* (14) alter_account_option ::= PASS literal */
  {  326,   -2 }, /* (15) alter_account_option ::= PPS literal */
  {  326,   -2 }, /* (16) alter_account_option ::= TSERIES literal */
  {  326,   -2 }, /* (17) alter_account_option ::= STORAGE literal */
  {  326,   -2 }, /* (18) alter_account_option ::= STREAMS literal */
  {  326,   -2 }, /* (19) alter_account_option ::= QTIME literal */
  {  326,   -2 }, /* (20) alter_account_option ::= DBS literal */
  {  326,   -2 }, /* (21) alter_account_option ::= USERS literal */
  {  326,   -2 }, /* (22) alter_account_option ::= CONNS literal */
  {  326,   -2 }, /* (23) alter_account_option ::= STATE literal */
  {  322,   -6 }, /* (24) cmd ::= CREATE USER user_name PASS NK_STRING sysinfo_opt */
  {  322,   -5 }, /* (25) cmd ::= ALTER USER user_name PASS NK_STRING */
  {  322,   -5 }, /* (26) cmd ::= ALTER USER user_name ENABLE NK_INTEGER */
  {  322,   -5 }, /* (27) cmd ::= ALTER USER user_name SYSINFO NK_INTEGER */
  {  322,   -3 }, /* (28) cmd ::= DROP USER user_name */
  {  328,    0 }, /* (29) sysinfo_opt ::= */
  {  328,   -2 }, /* (30) sysinfo_opt ::= SYSINFO NK_INTEGER */
  {  322,   -6 }, /* (31) cmd ::= GRANT privileges ON priv_level TO user_name */
  {  322,   -6 }, /* (32) cmd ::= REVOKE privileges ON priv_level FROM user_name */
  {  329,   -1 }, /* (33) privileges ::= ALL */
  {  329,   -1 }, /* (34) privileges ::= priv_type_list */
  {  329,   -1 }, /* (35) privileges ::= SUBSCRIBE */
  {  331,   -1 }, /* (36) priv_type_list ::= priv_type */
  {  331,   -3 }, /* (37) priv_type_list ::= priv_type_list NK_COMMA priv_type */
  {  332,   -1 }, /* (38) priv_type ::= READ */
  {  332,   -1 }, /* (39) priv_type ::= WRITE */
  {  330,   -3 }, /* (40) priv_level ::= NK_STAR NK_DOT NK_STAR */
  {  330,   -3 }, /* (41) priv_level ::= db_name NK_DOT NK_STAR */
  {  330,   -1 }, /* (42) priv_level ::= topic_name */
  {  322,   -3 }, /* (43) cmd ::= CREATE DNODE dnode_endpoint */
  {  322,   -5 }, /* (44) cmd ::= CREATE DNODE dnode_endpoint PORT NK_INTEGER */
  {  322,   -4 }, /* (45) cmd ::= DROP DNODE NK_INTEGER force_opt */
  {  322,   -4 }, /* (46) cmd ::= DROP DNODE dnode_endpoint force_opt */
  {  322,   -4 }, /* (47) cmd ::= ALTER DNODE NK_INTEGER NK_STRING */
  {  322,   -5 }, /* (48) cmd ::= ALTER DNODE NK_INTEGER NK_STRING NK_STRING */
  {  322,   -4 }, /* (49) cmd ::= ALTER ALL DNODES NK_STRING */
  {  322,   -5 }, /* (50) cmd ::= ALTER ALL DNODES NK_STRING NK_STRING */
  {  335,   -1 }, /* (51) dnode_endpoint ::= NK_STRING */
  {  335,   -1 }, /* (52) dnode_endpoint ::= NK_ID */
  {  335,   -1 }, /* (53) dnode_endpoint ::= NK_IPTOKEN */
  {  336,    0 }, /* (54) force_opt ::= */
  {  336,   -1 }, /* (55) force_opt ::= FORCE */
  {  322,   -3 }, /* (56) cmd ::= ALTER LOCAL NK_STRING */
  {  322,   -4 }, /* (57) cmd ::= ALTER LOCAL NK_STRING NK_STRING */
  {  322,   -5 }, /* (58) cmd ::= CREATE QNODE ON DNODE NK_INTEGER */
  {  322,   -5 }, /* (59) cmd ::= DROP QNODE ON DNODE NK_INTEGER */
  {  322,   -5 }, /* (60) cmd ::= CREATE BNODE ON DNODE NK_INTEGER */
  {  322,   -5 }, /* (61) cmd ::= DROP BNODE ON DNODE NK_INTEGER */
  {  322,   -5 }, /* (62) cmd ::= CREATE SNODE ON DNODE NK_INTEGER */
  {  322,   -5 }, /* (63) cmd ::= DROP SNODE ON DNODE NK_INTEGER */
  {  322,   -5 }, /* (64) cmd ::= CREATE MNODE ON DNODE NK_INTEGER */
  {  322,   -5 }, /* (65) cmd ::= DROP MNODE ON DNODE NK_INTEGER */
  {  322,   -5 }, /* (66) cmd ::= CREATE DATABASE not_exists_opt db_name db_options */
  {  322,   -4 }, /* (67) cmd ::= DROP DATABASE exists_opt db_name */
  {  322,   -2 }, /* (68) cmd ::= USE db_name */
  {  322,   -4 }, /* (69) cmd ::= ALTER DATABASE db_name alter_db_options */
  {  322,   -3 }, /* (70) cmd ::= FLUSH DATABASE db_name */
  {  322,   -4 }, /* (71) cmd ::= TRIM DATABASE db_name speed_opt */
  {  337,   -3 }, /* (72) not_exists_opt ::= IF NOT EXISTS */
  {  337,    0 }, /* (73) not_exists_opt ::= */
  {  339,   -2 }, /* (74) exists_opt ::= IF EXISTS */
  {  339,    0 }, /* (75) exists_opt ::= */
  {  338,    0 }, /* (76) db_options ::= */
  {  338,   -3 }, /* (77) db_options ::= db_options BUFFER NK_INTEGER */
  {  338,   -3 }, /* (78) db_options ::= db_options CACHEMODEL NK_STRING */
  {  338,   -3 }, /* (79) db_options ::= db_options CACHESIZE NK_INTEGER */
  {  338,   -3 }, /* (80) db_options ::= db_options COMP NK_INTEGER */
  {  338,   -3 }, /* (81) db_options ::= db_options DURATION NK_INTEGER */
  {  338,   -3 }, /* (82) db_options ::= db_options DURATION NK_VARIABLE */
  {  338,   -3 }, /* (83) db_options ::= db_options MAXROWS NK_INTEGER */
  {  338,   -3 }, /* (84) db_options ::= db_options MINROWS NK_INTEGER */
  {  338,   -3 }, /* (85) db_options ::= db_options KEEP integer_list */
  {  338,   -3 }, /* (86) db_options ::= db_options KEEP variable_list */
  {  338,   -3 }, /* (87) db_options ::= db_options PAGES NK_INTEGER */
  {  338,   -3 }, /* (88) db_options ::= db_options PAGESIZE NK_INTEGER */
  {  338,   -3 }, /* (89) db_options ::= db_options TSDB_PAGESIZE NK_INTEGER */
  {  338,   -3 }, /* (90) db_options ::= db_options PRECISION NK_STRING */
  {  338,   -3 }, /* (91) db_options ::= db_options REPLICA NK_INTEGER */
3096 3097 3098 3099 3100 3101 3102 3103 3104 3105 3106 3107 3108 3109 3110 3111 3112 3113 3114 3115 3116 3117 3118 3119 3120 3121 3122 3123 3124 3125 3126 3127 3128 3129 3130 3131 3132 3133 3134 3135 3136 3137 3138 3139 3140 3141 3142 3143 3144 3145 3146 3147 3148 3149 3150 3151 3152 3153 3154 3155 3156 3157 3158 3159 3160 3161 3162 3163 3164 3165 3166 3167 3168 3169 3170 3171 3172 3173 3174 3175 3176 3177 3178 3179 3180 3181 3182 3183 3184 3185 3186 3187 3188 3189 3190 3191 3192 3193 3194 3195 3196 3197 3198 3199 3200 3201 3202 3203 3204 3205 3206 3207 3208 3209 3210 3211 3212 3213 3214 3215 3216 3217 3218 3219 3220 3221 3222 3223 3224 3225 3226 3227 3228 3229 3230 3231 3232 3233 3234 3235 3236 3237 3238 3239 3240 3241 3242 3243 3244 3245 3246 3247 3248 3249 3250 3251 3252 3253 3254 3255 3256 3257 3258 3259 3260 3261 3262 3263
  {  338,   -3 }, /* (92) db_options ::= db_options VGROUPS NK_INTEGER */
  {  338,   -3 }, /* (93) db_options ::= db_options SINGLE_STABLE NK_INTEGER */
  {  338,   -3 }, /* (94) db_options ::= db_options RETENTIONS retention_list */
  {  338,   -3 }, /* (95) db_options ::= db_options SCHEMALESS NK_INTEGER */
  {  338,   -3 }, /* (96) db_options ::= db_options WAL_LEVEL NK_INTEGER */
  {  338,   -3 }, /* (97) db_options ::= db_options WAL_FSYNC_PERIOD NK_INTEGER */
  {  338,   -3 }, /* (98) db_options ::= db_options WAL_RETENTION_PERIOD NK_INTEGER */
  {  338,   -4 }, /* (99) db_options ::= db_options WAL_RETENTION_PERIOD NK_MINUS NK_INTEGER */
  {  338,   -3 }, /* (100) db_options ::= db_options WAL_RETENTION_SIZE NK_INTEGER */
  {  338,   -4 }, /* (101) db_options ::= db_options WAL_RETENTION_SIZE NK_MINUS NK_INTEGER */
  {  338,   -3 }, /* (102) db_options ::= db_options WAL_ROLL_PERIOD NK_INTEGER */
  {  338,   -3 }, /* (103) db_options ::= db_options WAL_SEGMENT_SIZE NK_INTEGER */
  {  338,   -3 }, /* (104) db_options ::= db_options STT_TRIGGER NK_INTEGER */
  {  338,   -3 }, /* (105) db_options ::= db_options TABLE_PREFIX NK_INTEGER */
  {  338,   -3 }, /* (106) db_options ::= db_options TABLE_SUFFIX NK_INTEGER */
  {  340,   -1 }, /* (107) alter_db_options ::= alter_db_option */
  {  340,   -2 }, /* (108) alter_db_options ::= alter_db_options alter_db_option */
  {  345,   -2 }, /* (109) alter_db_option ::= BUFFER NK_INTEGER */
  {  345,   -2 }, /* (110) alter_db_option ::= CACHEMODEL NK_STRING */
  {  345,   -2 }, /* (111) alter_db_option ::= CACHESIZE NK_INTEGER */
  {  345,   -2 }, /* (112) alter_db_option ::= WAL_FSYNC_PERIOD NK_INTEGER */
  {  345,   -2 }, /* (113) alter_db_option ::= KEEP integer_list */
  {  345,   -2 }, /* (114) alter_db_option ::= KEEP variable_list */
  {  345,   -2 }, /* (115) alter_db_option ::= PAGES NK_INTEGER */
  {  345,   -2 }, /* (116) alter_db_option ::= REPLICA NK_INTEGER */
  {  345,   -2 }, /* (117) alter_db_option ::= WAL_LEVEL NK_INTEGER */
  {  345,   -2 }, /* (118) alter_db_option ::= STT_TRIGGER NK_INTEGER */
  {  342,   -1 }, /* (119) integer_list ::= NK_INTEGER */
  {  342,   -3 }, /* (120) integer_list ::= integer_list NK_COMMA NK_INTEGER */
  {  343,   -1 }, /* (121) variable_list ::= NK_VARIABLE */
  {  343,   -3 }, /* (122) variable_list ::= variable_list NK_COMMA NK_VARIABLE */
  {  344,   -1 }, /* (123) retention_list ::= retention */
  {  344,   -3 }, /* (124) retention_list ::= retention_list NK_COMMA retention */
  {  346,   -3 }, /* (125) retention ::= NK_VARIABLE NK_COLON NK_VARIABLE */
  {  341,    0 }, /* (126) speed_opt ::= */
  {  341,   -2 }, /* (127) speed_opt ::= MAX_SPEED NK_INTEGER */
  {  322,   -9 }, /* (128) cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options */
  {  322,   -3 }, /* (129) cmd ::= CREATE TABLE multi_create_clause */
  {  322,   -9 }, /* (130) cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options */
  {  322,   -3 }, /* (131) cmd ::= DROP TABLE multi_drop_clause */
  {  322,   -4 }, /* (132) cmd ::= DROP STABLE exists_opt full_table_name */
  {  322,   -3 }, /* (133) cmd ::= ALTER TABLE alter_table_clause */
  {  322,   -3 }, /* (134) cmd ::= ALTER STABLE alter_table_clause */
  {  354,   -2 }, /* (135) alter_table_clause ::= full_table_name alter_table_options */
  {  354,   -5 }, /* (136) alter_table_clause ::= full_table_name ADD COLUMN column_name type_name */
  {  354,   -4 }, /* (137) alter_table_clause ::= full_table_name DROP COLUMN column_name */
  {  354,   -5 }, /* (138) alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name */
  {  354,   -5 }, /* (139) alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name */
  {  354,   -5 }, /* (140) alter_table_clause ::= full_table_name ADD TAG column_name type_name */
  {  354,   -4 }, /* (141) alter_table_clause ::= full_table_name DROP TAG column_name */
  {  354,   -5 }, /* (142) alter_table_clause ::= full_table_name MODIFY TAG column_name type_name */
  {  354,   -5 }, /* (143) alter_table_clause ::= full_table_name RENAME TAG column_name column_name */
  {  354,   -6 }, /* (144) alter_table_clause ::= full_table_name SET TAG column_name NK_EQ signed_literal */
  {  351,   -1 }, /* (145) multi_create_clause ::= create_subtable_clause */
  {  351,   -2 }, /* (146) multi_create_clause ::= multi_create_clause create_subtable_clause */
  {  359,  -10 }, /* (147) create_subtable_clause ::= not_exists_opt full_table_name USING full_table_name specific_cols_opt TAGS NK_LP expression_list NK_RP table_options */
  {  353,   -1 }, /* (148) multi_drop_clause ::= drop_table_clause */
  {  353,   -2 }, /* (149) multi_drop_clause ::= multi_drop_clause drop_table_clause */
  {  362,   -2 }, /* (150) drop_table_clause ::= exists_opt full_table_name */
  {  360,    0 }, /* (151) specific_cols_opt ::= */
  {  360,   -3 }, /* (152) specific_cols_opt ::= NK_LP col_name_list NK_RP */
  {  347,   -1 }, /* (153) full_table_name ::= table_name */
  {  347,   -3 }, /* (154) full_table_name ::= db_name NK_DOT table_name */
  {  348,   -1 }, /* (155) column_def_list ::= column_def */
  {  348,   -3 }, /* (156) column_def_list ::= column_def_list NK_COMMA column_def */
  {  365,   -2 }, /* (157) column_def ::= column_name type_name */
  {  365,   -4 }, /* (158) column_def ::= column_name type_name COMMENT NK_STRING */
  {  357,   -1 }, /* (159) type_name ::= BOOL */
  {  357,   -1 }, /* (160) type_name ::= TINYINT */
  {  357,   -1 }, /* (161) type_name ::= SMALLINT */
  {  357,   -1 }, /* (162) type_name ::= INT */
  {  357,   -1 }, /* (163) type_name ::= INTEGER */
  {  357,   -1 }, /* (164) type_name ::= BIGINT */
  {  357,   -1 }, /* (165) type_name ::= FLOAT */
  {  357,   -1 }, /* (166) type_name ::= DOUBLE */
  {  357,   -4 }, /* (167) type_name ::= BINARY NK_LP NK_INTEGER NK_RP */
  {  357,   -1 }, /* (168) type_name ::= TIMESTAMP */
  {  357,   -4 }, /* (169) type_name ::= NCHAR NK_LP NK_INTEGER NK_RP */
  {  357,   -2 }, /* (170) type_name ::= TINYINT UNSIGNED */
  {  357,   -2 }, /* (171) type_name ::= SMALLINT UNSIGNED */
  {  357,   -2 }, /* (172) type_name ::= INT UNSIGNED */
  {  357,   -2 }, /* (173) type_name ::= BIGINT UNSIGNED */
  {  357,   -1 }, /* (174) type_name ::= JSON */
  {  357,   -4 }, /* (175) type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP */
  {  357,   -1 }, /* (176) type_name ::= MEDIUMBLOB */
  {  357,   -1 }, /* (177) type_name ::= BLOB */
  {  357,   -4 }, /* (178) type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP */
  {  357,   -1 }, /* (179) type_name ::= DECIMAL */
  {  357,   -4 }, /* (180) type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP */
  {  357,   -6 }, /* (181) type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */
  {  349,    0 }, /* (182) tags_def_opt ::= */
  {  349,   -1 }, /* (183) tags_def_opt ::= tags_def */
  {  352,   -4 }, /* (184) tags_def ::= TAGS NK_LP column_def_list NK_RP */
  {  350,    0 }, /* (185) table_options ::= */
  {  350,   -3 }, /* (186) table_options ::= table_options COMMENT NK_STRING */
  {  350,   -3 }, /* (187) table_options ::= table_options MAX_DELAY duration_list */
  {  350,   -3 }, /* (188) table_options ::= table_options WATERMARK duration_list */
  {  350,   -5 }, /* (189) table_options ::= table_options ROLLUP NK_LP rollup_func_list NK_RP */
  {  350,   -3 }, /* (190) table_options ::= table_options TTL NK_INTEGER */
  {  350,   -5 }, /* (191) table_options ::= table_options SMA NK_LP col_name_list NK_RP */
  {  350,   -3 }, /* (192) table_options ::= table_options DELETE_MARK duration_list */
  {  355,   -1 }, /* (193) alter_table_options ::= alter_table_option */
  {  355,   -2 }, /* (194) alter_table_options ::= alter_table_options alter_table_option */
  {  368,   -2 }, /* (195) alter_table_option ::= COMMENT NK_STRING */
  {  368,   -2 }, /* (196) alter_table_option ::= TTL NK_INTEGER */
  {  366,   -1 }, /* (197) duration_list ::= duration_literal */
  {  366,   -3 }, /* (198) duration_list ::= duration_list NK_COMMA duration_literal */
  {  367,   -1 }, /* (199) rollup_func_list ::= rollup_func_name */
  {  367,   -3 }, /* (200) rollup_func_list ::= rollup_func_list NK_COMMA rollup_func_name */
  {  370,   -1 }, /* (201) rollup_func_name ::= function_name */
  {  370,   -1 }, /* (202) rollup_func_name ::= FIRST */
  {  370,   -1 }, /* (203) rollup_func_name ::= LAST */
  {  363,   -1 }, /* (204) col_name_list ::= col_name */
  {  363,   -3 }, /* (205) col_name_list ::= col_name_list NK_COMMA col_name */
  {  372,   -1 }, /* (206) col_name ::= column_name */
  {  322,   -2 }, /* (207) cmd ::= SHOW DNODES */
  {  322,   -2 }, /* (208) cmd ::= SHOW USERS */
  {  322,   -3 }, /* (209) cmd ::= SHOW USER PRIVILEGES */
  {  322,   -2 }, /* (210) cmd ::= SHOW DATABASES */
  {  322,   -4 }, /* (211) cmd ::= SHOW db_name_cond_opt TABLES like_pattern_opt */
  {  322,   -4 }, /* (212) cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt */
  {  322,   -3 }, /* (213) cmd ::= SHOW db_name_cond_opt VGROUPS */
  {  322,   -2 }, /* (214) cmd ::= SHOW MNODES */
  {  322,   -2 }, /* (215) cmd ::= SHOW QNODES */
  {  322,   -2 }, /* (216) cmd ::= SHOW FUNCTIONS */
  {  322,   -5 }, /* (217) cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt */
  {  322,   -2 }, /* (218) cmd ::= SHOW STREAMS */
  {  322,   -2 }, /* (219) cmd ::= SHOW ACCOUNTS */
  {  322,   -2 }, /* (220) cmd ::= SHOW APPS */
  {  322,   -2 }, /* (221) cmd ::= SHOW CONNECTIONS */
  {  322,   -2 }, /* (222) cmd ::= SHOW LICENCES */
  {  322,   -2 }, /* (223) cmd ::= SHOW GRANTS */
  {  322,   -4 }, /* (224) cmd ::= SHOW CREATE DATABASE db_name */
  {  322,   -4 }, /* (225) cmd ::= SHOW CREATE TABLE full_table_name */
  {  322,   -4 }, /* (226) cmd ::= SHOW CREATE STABLE full_table_name */
  {  322,   -2 }, /* (227) cmd ::= SHOW QUERIES */
  {  322,   -2 }, /* (228) cmd ::= SHOW SCORES */
  {  322,   -2 }, /* (229) cmd ::= SHOW TOPICS */
  {  322,   -2 }, /* (230) cmd ::= SHOW VARIABLES */
  {  322,   -3 }, /* (231) cmd ::= SHOW CLUSTER VARIABLES */
  {  322,   -3 }, /* (232) cmd ::= SHOW LOCAL VARIABLES */
  {  322,   -5 }, /* (233) cmd ::= SHOW DNODE NK_INTEGER VARIABLES like_pattern_opt */
  {  322,   -2 }, /* (234) cmd ::= SHOW BNODES */
  {  322,   -2 }, /* (235) cmd ::= SHOW SNODES */
  {  322,   -2 }, /* (236) cmd ::= SHOW CLUSTER */
  {  322,   -2 }, /* (237) cmd ::= SHOW TRANSACTIONS */
  {  322,   -4 }, /* (238) cmd ::= SHOW TABLE DISTRIBUTED full_table_name */
  {  322,   -2 }, /* (239) cmd ::= SHOW CONSUMERS */
  {  322,   -2 }, /* (240) cmd ::= SHOW SUBSCRIPTIONS */
  {  322,   -5 }, /* (241) cmd ::= SHOW TAGS FROM table_name_cond from_db_opt */
  {  322,   -7 }, /* (242) cmd ::= SHOW TABLE TAGS tag_list_opt FROM table_name_cond from_db_opt */
  {  322,   -3 }, /* (243) cmd ::= SHOW VNODES NK_INTEGER */
  {  322,   -3 }, /* (244) cmd ::= SHOW VNODES NK_STRING */
  {  373,    0 }, /* (245) db_name_cond_opt ::= */
  {  373,   -2 }, /* (246) db_name_cond_opt ::= db_name NK_DOT */
  {  374,    0 }, /* (247) like_pattern_opt ::= */
  {  374,   -2 }, /* (248) like_pattern_opt ::= LIKE NK_STRING */
  {  375,   -1 }, /* (249) table_name_cond ::= table_name */
  {  376,    0 }, /* (250) from_db_opt ::= */
  {  376,   -2 }, /* (251) from_db_opt ::= FROM db_name */
  {  377,    0 }, /* (252) tag_list_opt ::= */
  {  377,   -1 }, /* (253) tag_list_opt ::= tag_item */
  {  377,   -3 }, /* (254) tag_list_opt ::= tag_list_opt NK_COMMA tag_item */
  {  378,   -1 }, /* (255) tag_item ::= TBNAME */
  {  378,   -1 }, /* (256) tag_item ::= QTAGS */
  {  378,   -1 }, /* (257) tag_item ::= column_name */
  {  378,   -2 }, /* (258) tag_item ::= column_name column_alias */
  {  378,   -3 }, /* (259) tag_item ::= column_name AS column_alias */
3264 3265 3266 3267 3268 3269 3270 3271 3272 3273 3274 3275 3276 3277 3278 3279 3280 3281 3282 3283 3284 3285 3286 3287 3288 3289 3290 3291 3292 3293 3294 3295 3296 3297 3298 3299 3300 3301 3302 3303 3304 3305 3306 3307
  {  322,   -8 }, /* (260) cmd ::= CREATE SMA INDEX not_exists_opt full_index_name ON full_table_name index_options */
  {  322,   -4 }, /* (261) cmd ::= DROP INDEX exists_opt full_index_name */
  {  380,   -1 }, /* (262) full_index_name ::= index_name */
  {  380,   -3 }, /* (263) full_index_name ::= db_name NK_DOT index_name */
  {  381,  -10 }, /* (264) index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt sma_stream_opt */
  {  381,  -12 }, /* (265) index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt sma_stream_opt */
  {  383,   -1 }, /* (266) func_list ::= func */
  {  383,   -3 }, /* (267) func_list ::= func_list NK_COMMA func */
  {  386,   -4 }, /* (268) func ::= function_name NK_LP expression_list NK_RP */
  {  385,    0 }, /* (269) sma_stream_opt ::= */
  {  385,   -3 }, /* (270) sma_stream_opt ::= sma_stream_opt WATERMARK duration_literal */
  {  385,   -3 }, /* (271) sma_stream_opt ::= sma_stream_opt MAX_DELAY duration_literal */
  {  385,   -3 }, /* (272) sma_stream_opt ::= sma_stream_opt DELETE_MARK duration_literal */
  {  322,   -6 }, /* (273) cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_or_subquery */
  {  322,   -7 }, /* (274) cmd ::= CREATE TOPIC not_exists_opt topic_name AS DATABASE db_name */
  {  322,   -9 }, /* (275) cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS DATABASE db_name */
  {  322,   -7 }, /* (276) cmd ::= CREATE TOPIC not_exists_opt topic_name AS STABLE full_table_name */
  {  322,   -9 }, /* (277) cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS STABLE full_table_name */
  {  322,   -4 }, /* (278) cmd ::= DROP TOPIC exists_opt topic_name */
  {  322,   -7 }, /* (279) cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name */
  {  322,   -2 }, /* (280) cmd ::= DESC full_table_name */
  {  322,   -2 }, /* (281) cmd ::= DESCRIBE full_table_name */
  {  322,   -3 }, /* (282) cmd ::= RESET QUERY CACHE */
  {  322,   -4 }, /* (283) cmd ::= EXPLAIN analyze_opt explain_options query_or_subquery */
  {  389,    0 }, /* (284) analyze_opt ::= */
  {  389,   -1 }, /* (285) analyze_opt ::= ANALYZE */
  {  390,    0 }, /* (286) explain_options ::= */
  {  390,   -3 }, /* (287) explain_options ::= explain_options VERBOSE NK_BOOL */
  {  390,   -3 }, /* (288) explain_options ::= explain_options RATIO NK_FLOAT */
  {  322,  -10 }, /* (289) cmd ::= CREATE agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt */
  {  322,   -4 }, /* (290) cmd ::= DROP FUNCTION exists_opt function_name */
  {  391,    0 }, /* (291) agg_func_opt ::= */
  {  391,   -1 }, /* (292) agg_func_opt ::= AGGREGATE */
  {  392,    0 }, /* (293) bufsize_opt ::= */
  {  392,   -2 }, /* (294) bufsize_opt ::= BUFSIZE NK_INTEGER */
  {  322,  -11 }, /* (295) cmd ::= CREATE STREAM not_exists_opt stream_name stream_options INTO full_table_name tags_def_opt subtable_opt AS query_or_subquery */
  {  322,   -4 }, /* (296) cmd ::= DROP STREAM exists_opt stream_name */
  {  394,    0 }, /* (297) stream_options ::= */
  {  394,   -3 }, /* (298) stream_options ::= stream_options TRIGGER AT_ONCE */
  {  394,   -3 }, /* (299) stream_options ::= stream_options TRIGGER WINDOW_CLOSE */
  {  394,   -4 }, /* (300) stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal */
  {  394,   -3 }, /* (301) stream_options ::= stream_options WATERMARK duration_literal */
  {  394,   -4 }, /* (302) stream_options ::= stream_options IGNORE EXPIRED NK_INTEGER */
  {  394,   -3 }, /* (303) stream_options ::= stream_options FILL_HISTORY NK_INTEGER */
3308 3309 3310 3311 3312 3313 3314 3315 3316 3317 3318 3319 3320 3321 3322 3323 3324 3325 3326 3327 3328 3329 3330 3331 3332 3333 3334 3335 3336 3337 3338 3339 3340 3341 3342 3343 3344 3345 3346 3347 3348 3349 3350 3351 3352 3353 3354 3355 3356 3357 3358 3359 3360 3361 3362 3363 3364 3365 3366 3367 3368 3369 3370 3371 3372 3373 3374 3375 3376 3377 3378 3379 3380 3381 3382 3383 3384 3385 3386 3387 3388 3389 3390 3391 3392 3393 3394 3395 3396 3397 3398 3399 3400 3401 3402 3403 3404 3405 3406 3407 3408 3409 3410 3411 3412 3413 3414 3415 3416 3417 3418 3419 3420 3421 3422 3423 3424 3425 3426 3427 3428 3429 3430 3431 3432 3433 3434 3435 3436 3437 3438 3439 3440 3441 3442 3443 3444 3445 3446 3447 3448 3449 3450 3451 3452 3453 3454 3455 3456 3457 3458 3459 3460 3461 3462 3463 3464 3465 3466 3467 3468 3469 3470 3471 3472 3473 3474 3475 3476 3477 3478 3479 3480 3481 3482 3483 3484 3485 3486 3487 3488 3489 3490 3491 3492 3493 3494 3495 3496 3497 3498 3499 3500 3501 3502 3503 3504 3505 3506 3507 3508 3509 3510 3511 3512 3513 3514 3515 3516 3517 3518 3519 3520 3521 3522 3523 3524 3525 3526 3527 3528 3529 3530 3531 3532 3533 3534 3535 3536 3537 3538 3539 3540 3541 3542 3543 3544 3545
  {  394,   -3 }, /* (304) stream_options ::= stream_options DELETE_MARK duration_literal */
  {  395,    0 }, /* (305) subtable_opt ::= */
  {  395,   -4 }, /* (306) subtable_opt ::= SUBTABLE NK_LP expression NK_RP */
  {  322,   -3 }, /* (307) cmd ::= KILL CONNECTION NK_INTEGER */
  {  322,   -3 }, /* (308) cmd ::= KILL QUERY NK_STRING */
  {  322,   -3 }, /* (309) cmd ::= KILL TRANSACTION NK_INTEGER */
  {  322,   -2 }, /* (310) cmd ::= BALANCE VGROUP */
  {  322,   -4 }, /* (311) cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER */
  {  322,   -4 }, /* (312) cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list */
  {  322,   -3 }, /* (313) cmd ::= SPLIT VGROUP NK_INTEGER */
  {  397,   -2 }, /* (314) dnode_list ::= DNODE NK_INTEGER */
  {  397,   -3 }, /* (315) dnode_list ::= dnode_list DNODE NK_INTEGER */
  {  322,   -4 }, /* (316) cmd ::= DELETE FROM full_table_name where_clause_opt */
  {  322,   -1 }, /* (317) cmd ::= query_or_subquery */
  {  322,   -7 }, /* (318) cmd ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery */
  {  322,   -4 }, /* (319) cmd ::= INSERT INTO full_table_name query_or_subquery */
  {  325,   -1 }, /* (320) literal ::= NK_INTEGER */
  {  325,   -1 }, /* (321) literal ::= NK_FLOAT */
  {  325,   -1 }, /* (322) literal ::= NK_STRING */
  {  325,   -1 }, /* (323) literal ::= NK_BOOL */
  {  325,   -2 }, /* (324) literal ::= TIMESTAMP NK_STRING */
  {  325,   -1 }, /* (325) literal ::= duration_literal */
  {  325,   -1 }, /* (326) literal ::= NULL */
  {  325,   -1 }, /* (327) literal ::= NK_QUESTION */
  {  369,   -1 }, /* (328) duration_literal ::= NK_VARIABLE */
  {  399,   -1 }, /* (329) signed ::= NK_INTEGER */
  {  399,   -2 }, /* (330) signed ::= NK_PLUS NK_INTEGER */
  {  399,   -2 }, /* (331) signed ::= NK_MINUS NK_INTEGER */
  {  399,   -1 }, /* (332) signed ::= NK_FLOAT */
  {  399,   -2 }, /* (333) signed ::= NK_PLUS NK_FLOAT */
  {  399,   -2 }, /* (334) signed ::= NK_MINUS NK_FLOAT */
  {  358,   -1 }, /* (335) signed_literal ::= signed */
  {  358,   -1 }, /* (336) signed_literal ::= NK_STRING */
  {  358,   -1 }, /* (337) signed_literal ::= NK_BOOL */
  {  358,   -2 }, /* (338) signed_literal ::= TIMESTAMP NK_STRING */
  {  358,   -1 }, /* (339) signed_literal ::= duration_literal */
  {  358,   -1 }, /* (340) signed_literal ::= NULL */
  {  358,   -1 }, /* (341) signed_literal ::= literal_func */
  {  358,   -1 }, /* (342) signed_literal ::= NK_QUESTION */
  {  401,   -1 }, /* (343) literal_list ::= signed_literal */
  {  401,   -3 }, /* (344) literal_list ::= literal_list NK_COMMA signed_literal */
  {  333,   -1 }, /* (345) db_name ::= NK_ID */
  {  364,   -1 }, /* (346) table_name ::= NK_ID */
  {  356,   -1 }, /* (347) column_name ::= NK_ID */
  {  371,   -1 }, /* (348) function_name ::= NK_ID */
  {  402,   -1 }, /* (349) table_alias ::= NK_ID */
  {  379,   -1 }, /* (350) column_alias ::= NK_ID */
  {  327,   -1 }, /* (351) user_name ::= NK_ID */
  {  334,   -1 }, /* (352) topic_name ::= NK_ID */
  {  393,   -1 }, /* (353) stream_name ::= NK_ID */
  {  388,   -1 }, /* (354) cgroup_name ::= NK_ID */
  {  382,   -1 }, /* (355) index_name ::= NK_ID */
  {  403,   -1 }, /* (356) expr_or_subquery ::= expression */
  {  396,   -1 }, /* (357) expression ::= literal */
  {  396,   -1 }, /* (358) expression ::= pseudo_column */
  {  396,   -1 }, /* (359) expression ::= column_reference */
  {  396,   -1 }, /* (360) expression ::= function_expression */
  {  396,   -1 }, /* (361) expression ::= case_when_expression */
  {  396,   -3 }, /* (362) expression ::= NK_LP expression NK_RP */
  {  396,   -2 }, /* (363) expression ::= NK_PLUS expr_or_subquery */
  {  396,   -2 }, /* (364) expression ::= NK_MINUS expr_or_subquery */
  {  396,   -3 }, /* (365) expression ::= expr_or_subquery NK_PLUS expr_or_subquery */
  {  396,   -3 }, /* (366) expression ::= expr_or_subquery NK_MINUS expr_or_subquery */
  {  396,   -3 }, /* (367) expression ::= expr_or_subquery NK_STAR expr_or_subquery */
  {  396,   -3 }, /* (368) expression ::= expr_or_subquery NK_SLASH expr_or_subquery */
  {  396,   -3 }, /* (369) expression ::= expr_or_subquery NK_REM expr_or_subquery */
  {  396,   -3 }, /* (370) expression ::= column_reference NK_ARROW NK_STRING */
  {  396,   -3 }, /* (371) expression ::= expr_or_subquery NK_BITAND expr_or_subquery */
  {  396,   -3 }, /* (372) expression ::= expr_or_subquery NK_BITOR expr_or_subquery */
  {  361,   -1 }, /* (373) expression_list ::= expr_or_subquery */
  {  361,   -3 }, /* (374) expression_list ::= expression_list NK_COMMA expr_or_subquery */
  {  405,   -1 }, /* (375) column_reference ::= column_name */
  {  405,   -3 }, /* (376) column_reference ::= table_name NK_DOT column_name */
  {  404,   -1 }, /* (377) pseudo_column ::= ROWTS */
  {  404,   -1 }, /* (378) pseudo_column ::= TBNAME */
  {  404,   -3 }, /* (379) pseudo_column ::= table_name NK_DOT TBNAME */
  {  404,   -1 }, /* (380) pseudo_column ::= QSTART */
  {  404,   -1 }, /* (381) pseudo_column ::= QEND */
  {  404,   -1 }, /* (382) pseudo_column ::= QDURATION */
  {  404,   -1 }, /* (383) pseudo_column ::= WSTART */
  {  404,   -1 }, /* (384) pseudo_column ::= WEND */
  {  404,   -1 }, /* (385) pseudo_column ::= WDURATION */
  {  404,   -1 }, /* (386) pseudo_column ::= IROWTS */
  {  404,   -1 }, /* (387) pseudo_column ::= QTAGS */
  {  406,   -4 }, /* (388) function_expression ::= function_name NK_LP expression_list NK_RP */
  {  406,   -4 }, /* (389) function_expression ::= star_func NK_LP star_func_para_list NK_RP */
  {  406,   -6 }, /* (390) function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP */
  {  406,   -1 }, /* (391) function_expression ::= literal_func */
  {  400,   -3 }, /* (392) literal_func ::= noarg_func NK_LP NK_RP */
  {  400,   -1 }, /* (393) literal_func ::= NOW */
  {  410,   -1 }, /* (394) noarg_func ::= NOW */
  {  410,   -1 }, /* (395) noarg_func ::= TODAY */
  {  410,   -1 }, /* (396) noarg_func ::= TIMEZONE */
  {  410,   -1 }, /* (397) noarg_func ::= DATABASE */
  {  410,   -1 }, /* (398) noarg_func ::= CLIENT_VERSION */
  {  410,   -1 }, /* (399) noarg_func ::= SERVER_VERSION */
  {  410,   -1 }, /* (400) noarg_func ::= SERVER_STATUS */
  {  410,   -1 }, /* (401) noarg_func ::= CURRENT_USER */
  {  410,   -1 }, /* (402) noarg_func ::= USER */
  {  408,   -1 }, /* (403) star_func ::= COUNT */
  {  408,   -1 }, /* (404) star_func ::= FIRST */
  {  408,   -1 }, /* (405) star_func ::= LAST */
  {  408,   -1 }, /* (406) star_func ::= LAST_ROW */
  {  409,   -1 }, /* (407) star_func_para_list ::= NK_STAR */
  {  409,   -1 }, /* (408) star_func_para_list ::= other_para_list */
  {  411,   -1 }, /* (409) other_para_list ::= star_func_para */
  {  411,   -3 }, /* (410) other_para_list ::= other_para_list NK_COMMA star_func_para */
  {  412,   -1 }, /* (411) star_func_para ::= expr_or_subquery */
  {  412,   -3 }, /* (412) star_func_para ::= table_name NK_DOT NK_STAR */
  {  407,   -4 }, /* (413) case_when_expression ::= CASE when_then_list case_when_else_opt END */
  {  407,   -5 }, /* (414) case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END */
  {  413,   -1 }, /* (415) when_then_list ::= when_then_expr */
  {  413,   -2 }, /* (416) when_then_list ::= when_then_list when_then_expr */
  {  416,   -4 }, /* (417) when_then_expr ::= WHEN common_expression THEN common_expression */
  {  414,    0 }, /* (418) case_when_else_opt ::= */
  {  414,   -2 }, /* (419) case_when_else_opt ::= ELSE common_expression */
  {  417,   -3 }, /* (420) predicate ::= expr_or_subquery compare_op expr_or_subquery */
  {  417,   -5 }, /* (421) predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery */
  {  417,   -6 }, /* (422) predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery */
  {  417,   -3 }, /* (423) predicate ::= expr_or_subquery IS NULL */
  {  417,   -4 }, /* (424) predicate ::= expr_or_subquery IS NOT NULL */
  {  417,   -3 }, /* (425) predicate ::= expr_or_subquery in_op in_predicate_value */
  {  418,   -1 }, /* (426) compare_op ::= NK_LT */
  {  418,   -1 }, /* (427) compare_op ::= NK_GT */
  {  418,   -1 }, /* (428) compare_op ::= NK_LE */
  {  418,   -1 }, /* (429) compare_op ::= NK_GE */
  {  418,   -1 }, /* (430) compare_op ::= NK_NE */
  {  418,   -1 }, /* (431) compare_op ::= NK_EQ */
  {  418,   -1 }, /* (432) compare_op ::= LIKE */
  {  418,   -2 }, /* (433) compare_op ::= NOT LIKE */
  {  418,   -1 }, /* (434) compare_op ::= MATCH */
  {  418,   -1 }, /* (435) compare_op ::= NMATCH */
  {  418,   -1 }, /* (436) compare_op ::= CONTAINS */
  {  419,   -1 }, /* (437) in_op ::= IN */
  {  419,   -2 }, /* (438) in_op ::= NOT IN */
  {  420,   -3 }, /* (439) in_predicate_value ::= NK_LP literal_list NK_RP */
  {  421,   -1 }, /* (440) boolean_value_expression ::= boolean_primary */
  {  421,   -2 }, /* (441) boolean_value_expression ::= NOT boolean_primary */
  {  421,   -3 }, /* (442) boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */
  {  421,   -3 }, /* (443) boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */
  {  422,   -1 }, /* (444) boolean_primary ::= predicate */
  {  422,   -3 }, /* (445) boolean_primary ::= NK_LP boolean_value_expression NK_RP */
  {  415,   -1 }, /* (446) common_expression ::= expr_or_subquery */
  {  415,   -1 }, /* (447) common_expression ::= boolean_value_expression */
  {  423,    0 }, /* (448) from_clause_opt ::= */
  {  423,   -2 }, /* (449) from_clause_opt ::= FROM table_reference_list */
  {  424,   -1 }, /* (450) table_reference_list ::= table_reference */
  {  424,   -3 }, /* (451) table_reference_list ::= table_reference_list NK_COMMA table_reference */
  {  425,   -1 }, /* (452) table_reference ::= table_primary */
  {  425,   -1 }, /* (453) table_reference ::= joined_table */
  {  426,   -2 }, /* (454) table_primary ::= table_name alias_opt */
  {  426,   -4 }, /* (455) table_primary ::= db_name NK_DOT table_name alias_opt */
  {  426,   -2 }, /* (456) table_primary ::= subquery alias_opt */
  {  426,   -1 }, /* (457) table_primary ::= parenthesized_joined_table */
  {  428,    0 }, /* (458) alias_opt ::= */
  {  428,   -1 }, /* (459) alias_opt ::= table_alias */
  {  428,   -2 }, /* (460) alias_opt ::= AS table_alias */
  {  430,   -3 }, /* (461) parenthesized_joined_table ::= NK_LP joined_table NK_RP */
  {  430,   -3 }, /* (462) parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */
  {  427,   -6 }, /* (463) joined_table ::= table_reference join_type JOIN table_reference ON search_condition */
  {  431,    0 }, /* (464) join_type ::= */
  {  431,   -1 }, /* (465) join_type ::= INNER */
  {  433,  -12 }, /* (466) query_specification ::= SELECT set_quantifier_opt select_list from_clause_opt where_clause_opt partition_by_clause_opt range_opt every_opt fill_opt twindow_clause_opt group_by_clause_opt having_clause_opt */
  {  434,    0 }, /* (467) set_quantifier_opt ::= */
  {  434,   -1 }, /* (468) set_quantifier_opt ::= DISTINCT */
  {  434,   -1 }, /* (469) set_quantifier_opt ::= ALL */
  {  435,   -1 }, /* (470) select_list ::= select_item */
  {  435,   -3 }, /* (471) select_list ::= select_list NK_COMMA select_item */
  {  443,   -1 }, /* (472) select_item ::= NK_STAR */
  {  443,   -1 }, /* (473) select_item ::= common_expression */
  {  443,   -2 }, /* (474) select_item ::= common_expression column_alias */
  {  443,   -3 }, /* (475) select_item ::= common_expression AS column_alias */
  {  443,   -3 }, /* (476) select_item ::= table_name NK_DOT NK_STAR */
  {  398,    0 }, /* (477) where_clause_opt ::= */
  {  398,   -2 }, /* (478) where_clause_opt ::= WHERE search_condition */
  {  436,    0 }, /* (479) partition_by_clause_opt ::= */
  {  436,   -3 }, /* (480) partition_by_clause_opt ::= PARTITION BY partition_list */
  {  444,   -1 }, /* (481) partition_list ::= partition_item */
  {  444,   -3 }, /* (482) partition_list ::= partition_list NK_COMMA partition_item */
  {  445,   -1 }, /* (483) partition_item ::= expr_or_subquery */
  {  445,   -2 }, /* (484) partition_item ::= expr_or_subquery column_alias */
  {  445,   -3 }, /* (485) partition_item ::= expr_or_subquery AS column_alias */
  {  440,    0 }, /* (486) twindow_clause_opt ::= */
  {  440,   -6 }, /* (487) twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP */
  {  440,   -4 }, /* (488) twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP */
  {  440,   -6 }, /* (489) twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt */
  {  440,   -8 }, /* (490) twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt */
  {  384,    0 }, /* (491) sliding_opt ::= */
  {  384,   -4 }, /* (492) sliding_opt ::= SLIDING NK_LP duration_literal NK_RP */
  {  439,    0 }, /* (493) fill_opt ::= */
  {  439,   -4 }, /* (494) fill_opt ::= FILL NK_LP fill_mode NK_RP */
  {  439,   -6 }, /* (495) fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP */
  {  446,   -1 }, /* (496) fill_mode ::= NONE */
  {  446,   -1 }, /* (497) fill_mode ::= PREV */
  {  446,   -1 }, /* (498) fill_mode ::= NULL */
  {  446,   -1 }, /* (499) fill_mode ::= LINEAR */
  {  446,   -1 }, /* (500) fill_mode ::= NEXT */
  {  441,    0 }, /* (501) group_by_clause_opt ::= */
  {  441,   -3 }, /* (502) group_by_clause_opt ::= GROUP BY group_by_list */
  {  447,   -1 }, /* (503) group_by_list ::= expr_or_subquery */
  {  447,   -3 }, /* (504) group_by_list ::= group_by_list NK_COMMA expr_or_subquery */
  {  442,    0 }, /* (505) having_clause_opt ::= */
  {  442,   -2 }, /* (506) having_clause_opt ::= HAVING search_condition */
  {  437,    0 }, /* (507) range_opt ::= */
  {  437,   -6 }, /* (508) range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP */
  {  438,    0 }, /* (509) every_opt ::= */
  {  438,   -4 }, /* (510) every_opt ::= EVERY NK_LP duration_literal NK_RP */
  {  448,   -4 }, /* (511) query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt */
  {  449,   -1 }, /* (512) query_simple ::= query_specification */
  {  449,   -1 }, /* (513) query_simple ::= union_query_expression */
  {  453,   -4 }, /* (514) union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery */
  {  453,   -3 }, /* (515) union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery */
  {  454,   -1 }, /* (516) query_simple_or_subquery ::= query_simple */
  {  454,   -1 }, /* (517) query_simple_or_subquery ::= subquery */
  {  387,   -1 }, /* (518) query_or_subquery ::= query_expression */
  {  387,   -1 }, /* (519) query_or_subquery ::= subquery */
  {  450,    0 }, /* (520) order_by_clause_opt ::= */
  {  450,   -3 }, /* (521) order_by_clause_opt ::= ORDER BY sort_specification_list */
  {  451,    0 }, /* (522) slimit_clause_opt ::= */
  {  451,   -2 }, /* (523) slimit_clause_opt ::= SLIMIT NK_INTEGER */
  {  451,   -4 }, /* (524) slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */
  {  451,   -4 }, /* (525) slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */
  {  452,    0 }, /* (526) limit_clause_opt ::= */
  {  452,   -2 }, /* (527) limit_clause_opt ::= LIMIT NK_INTEGER */
  {  452,   -4 }, /* (528) limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */
  {  452,   -4 }, /* (529) limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */
  {  429,   -3 }, /* (530) subquery ::= NK_LP query_expression NK_RP */
  {  429,   -3 }, /* (531) subquery ::= NK_LP subquery NK_RP */
  {  432,   -1 }, /* (532) search_condition ::= common_expression */
  {  455,   -1 }, /* (533) sort_specification_list ::= sort_specification */
  {  455,   -3 }, /* (534) sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */
  {  456,   -3 }, /* (535) sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt */
  {  457,    0 }, /* (536) ordering_specification_opt ::= */
  {  457,   -1 }, /* (537) ordering_specification_opt ::= ASC */
  {  457,   -1 }, /* (538) ordering_specification_opt ::= DESC */
  {  458,    0 }, /* (539) null_ordering_opt ::= */
  {  458,   -2 }, /* (540) null_ordering_opt ::= NULLS FIRST */
  {  458,   -2 }, /* (541) null_ordering_opt ::= NULLS LAST */
3546 3547 3548 3549 3550 3551 3552 3553 3554 3555 3556 3557 3558 3559 3560 3561 3562 3563
};

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 已提交
3564 3565
  ParseTOKENTYPE yyLookaheadToken  /* Value of the lookahead token */
  ParseCTX_PDECL                   /* %extra_context */
3566 3567 3568 3569 3570
){
  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 已提交
3571
  ParseARG_FETCH
3572 3573 3574
  (void)yyLookahead;
  (void)yyLookaheadToken;
  yymsp = yypParser->yytos;
X
Xiaoyu Wang 已提交
3575 3576
#ifndef NDEBUG
  if( yyTraceFILE && yyruleno<(int)(sizeof(yyRuleName)/sizeof(yyRuleName[0])) ){
X
Xiaoyu Wang 已提交
3577
    yysize = yyRuleInfo[yyruleno].nrhs;
X
Xiaoyu Wang 已提交
3578
    if( yysize ){
X
Xiaoyu Wang 已提交
3579
      fprintf(yyTraceFILE, "%sReduce %d [%s], go to state %d.\n",
X
Xiaoyu Wang 已提交
3580
        yyTracePrompt,
X
Xiaoyu Wang 已提交
3581
        yyruleno, yyRuleName[yyruleno], yymsp[yysize].stateno);
X
Xiaoyu Wang 已提交
3582
    }else{
X
Xiaoyu Wang 已提交
3583 3584
      fprintf(yyTraceFILE, "%sReduce %d [%s].\n",
        yyTracePrompt, yyruleno, yyRuleName[yyruleno]);
X
Xiaoyu Wang 已提交
3585 3586 3587 3588 3589 3590 3591
    }
  }
#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 */
X
Xiaoyu Wang 已提交
3592
  if( yyRuleInfo[yyruleno].nrhs==0 ){
X
Xiaoyu Wang 已提交
3593 3594 3595 3596 3597 3598 3599 3600 3601 3602 3603 3604 3605 3606 3607 3608 3609 3610 3611 3612 3613 3614 3615 3616 3617 3618 3619
#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
  }
3620 3621 3622 3623 3624 3625 3626 3627 3628 3629 3630 3631

  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;
3632
      case 0: /* cmd ::= CREATE ACCOUNT NK_ID PASS NK_STRING account_options */
3633
{ pCxt->errCode = generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_EXPRIE_STATEMENT); }
3634
  yy_destructor(yypParser,323,&yymsp[0].minor);
3635
        break;
3636
      case 1: /* cmd ::= ALTER ACCOUNT NK_ID alter_account_options */
3637
{ pCxt->errCode = generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_EXPRIE_STATEMENT); }
3638
  yy_destructor(yypParser,324,&yymsp[0].minor);
3639 3640 3641 3642 3643 3644 3645 3646 3647 3648 3649 3650 3651
        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);
3652
{  yy_destructor(yypParser,323,&yymsp[-2].minor);
3653
{ }
3654
  yy_destructor(yypParser,325,&yymsp[0].minor);
3655
}
3656
        break;
3657
      case 12: /* alter_account_options ::= alter_account_option */
3658
{  yy_destructor(yypParser,326,&yymsp[0].minor);
3659 3660 3661
{ }
}
        break;
3662
      case 13: /* alter_account_options ::= alter_account_options alter_account_option */
3663
{  yy_destructor(yypParser,324,&yymsp[-1].minor);
3664
{ }
3665
  yy_destructor(yypParser,326,&yymsp[0].minor);
3666 3667 3668 3669 3670 3671 3672 3673 3674 3675 3676 3677
}
        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);
3678
{ }
3679
  yy_destructor(yypParser,325,&yymsp[0].minor);
3680
        break;
X
Xiaoyu Wang 已提交
3681
      case 24: /* cmd ::= CREATE USER user_name PASS NK_STRING sysinfo_opt */
3682
{ pCxt->pRootNode = createCreateUserStmt(pCxt, &yymsp[-3].minor.yy317, &yymsp[-1].minor.yy0, yymsp[0].minor.yy449); }
3683
        break;
3684
      case 25: /* cmd ::= ALTER USER user_name PASS NK_STRING */
3685
{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy317, TSDB_ALTER_USER_PASSWD, &yymsp[0].minor.yy0); }
3686
        break;
X
Xiaoyu Wang 已提交
3687
      case 26: /* cmd ::= ALTER USER user_name ENABLE NK_INTEGER */
3688
{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy317, TSDB_ALTER_USER_ENABLE, &yymsp[0].minor.yy0); }
3689
        break;
X
Xiaoyu Wang 已提交
3690
      case 27: /* cmd ::= ALTER USER user_name SYSINFO NK_INTEGER */
3691
{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy317, TSDB_ALTER_USER_SYSINFO, &yymsp[0].minor.yy0); }
3692
        break;
X
Xiaoyu Wang 已提交
3693
      case 28: /* cmd ::= DROP USER user_name */
3694
{ pCxt->pRootNode = createDropUserStmt(pCxt, &yymsp[0].minor.yy317); }
3695
        break;
X
Xiaoyu Wang 已提交
3696
      case 29: /* sysinfo_opt ::= */
3697
{ yymsp[1].minor.yy449 = 1; }
3698
        break;
X
Xiaoyu Wang 已提交
3699
      case 30: /* sysinfo_opt ::= SYSINFO NK_INTEGER */
3700
{ yymsp[-1].minor.yy449 = taosStr2Int8(yymsp[0].minor.yy0.z, NULL, 10); }
3701
        break;
X
Xiaoyu Wang 已提交
3702
      case 31: /* cmd ::= GRANT privileges ON priv_level TO user_name */
3703
{ pCxt->pRootNode = createGrantStmt(pCxt, yymsp[-4].minor.yy531, &yymsp[-2].minor.yy317, &yymsp[0].minor.yy317); }
3704
        break;
X
Xiaoyu Wang 已提交
3705
      case 32: /* cmd ::= REVOKE privileges ON priv_level FROM user_name */
3706
{ pCxt->pRootNode = createRevokeStmt(pCxt, yymsp[-4].minor.yy531, &yymsp[-2].minor.yy317, &yymsp[0].minor.yy317); }
3707
        break;
X
Xiaoyu Wang 已提交
3708
      case 33: /* privileges ::= ALL */
3709
{ yymsp[0].minor.yy531 = PRIVILEGE_TYPE_ALL; }
3710
        break;
X
Xiaoyu Wang 已提交
3711
      case 34: /* privileges ::= priv_type_list */
3712
      case 36: /* priv_type_list ::= priv_type */ yytestcase(yyruleno==36);
3713 3714
{ yylhsminor.yy531 = yymsp[0].minor.yy531; }
  yymsp[0].minor.yy531 = yylhsminor.yy531;
3715
        break;
3716
      case 35: /* privileges ::= SUBSCRIBE */
3717
{ yymsp[0].minor.yy531 = PRIVILEGE_TYPE_SUBSCRIBE; }
3718
        break;
3719
      case 37: /* priv_type_list ::= priv_type_list NK_COMMA priv_type */
3720 3721
{ yylhsminor.yy531 = yymsp[-2].minor.yy531 | yymsp[0].minor.yy531; }
  yymsp[-2].minor.yy531 = yylhsminor.yy531;
3722
        break;
3723
      case 38: /* priv_type ::= READ */
3724
{ yymsp[0].minor.yy531 = PRIVILEGE_TYPE_READ; }
3725
        break;
3726
      case 39: /* priv_type ::= WRITE */
3727
{ yymsp[0].minor.yy531 = PRIVILEGE_TYPE_WRITE; }
3728
        break;
3729
      case 40: /* priv_level ::= NK_STAR NK_DOT NK_STAR */
3730 3731
{ yylhsminor.yy317 = yymsp[-2].minor.yy0; }
  yymsp[-2].minor.yy317 = yylhsminor.yy317;
X
Xiaoyu Wang 已提交
3732
        break;
3733
      case 41: /* priv_level ::= db_name NK_DOT NK_STAR */
3734 3735
{ yylhsminor.yy317 = yymsp[-2].minor.yy317; }
  yymsp[-2].minor.yy317 = yylhsminor.yy317;
X
Xiaoyu Wang 已提交
3736
        break;
3737
      case 42: /* priv_level ::= topic_name */
3738
      case 459: /* alias_opt ::= table_alias */ yytestcase(yyruleno==459);
3739 3740
{ yylhsminor.yy317 = yymsp[0].minor.yy317; }
  yymsp[0].minor.yy317 = yylhsminor.yy317;
X
Xiaoyu Wang 已提交
3741
        break;
3742
      case 43: /* cmd ::= CREATE DNODE dnode_endpoint */
3743
{ pCxt->pRootNode = createCreateDnodeStmt(pCxt, &yymsp[0].minor.yy317, NULL); }
3744
        break;
3745
      case 44: /* cmd ::= CREATE DNODE dnode_endpoint PORT NK_INTEGER */
3746
{ pCxt->pRootNode = createCreateDnodeStmt(pCxt, &yymsp[-2].minor.yy317, &yymsp[0].minor.yy0); }
3747
        break;
3748
      case 45: /* cmd ::= DROP DNODE NK_INTEGER force_opt */
3749
{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[-1].minor.yy0, yymsp[0].minor.yy335); }
3750 3751
        break;
      case 46: /* cmd ::= DROP DNODE dnode_endpoint force_opt */
3752
{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[-1].minor.yy317, yymsp[0].minor.yy335); }
3753 3754
        break;
      case 47: /* cmd ::= ALTER DNODE NK_INTEGER NK_STRING */
3755 3756
{ pCxt->pRootNode = createAlterDnodeStmt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0, NULL); }
        break;
3757
      case 48: /* cmd ::= ALTER DNODE NK_INTEGER NK_STRING NK_STRING */
3758 3759
{ pCxt->pRootNode = createAlterDnodeStmt(pCxt, &yymsp[-2].minor.yy0, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0); }
        break;
3760
      case 49: /* cmd ::= ALTER ALL DNODES NK_STRING */
3761 3762
{ pCxt->pRootNode = createAlterDnodeStmt(pCxt, NULL, &yymsp[0].minor.yy0, NULL); }
        break;
3763
      case 50: /* cmd ::= ALTER ALL DNODES NK_STRING NK_STRING */
3764 3765
{ pCxt->pRootNode = createAlterDnodeStmt(pCxt, NULL, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0); }
        break;
3766 3767 3768
      case 51: /* dnode_endpoint ::= NK_STRING */
      case 52: /* dnode_endpoint ::= NK_ID */ yytestcase(yyruleno==52);
      case 53: /* dnode_endpoint ::= NK_IPTOKEN */ yytestcase(yyruleno==53);
3769 3770 3771 3772 3773 3774 3775 3776 3777 3778 3779 3780 3781 3782 3783 3784 3785 3786 3787 3788 3789 3790 3791 3792
      case 345: /* db_name ::= NK_ID */ yytestcase(yyruleno==345);
      case 346: /* table_name ::= NK_ID */ yytestcase(yyruleno==346);
      case 347: /* column_name ::= NK_ID */ yytestcase(yyruleno==347);
      case 348: /* function_name ::= NK_ID */ yytestcase(yyruleno==348);
      case 349: /* table_alias ::= NK_ID */ yytestcase(yyruleno==349);
      case 350: /* column_alias ::= NK_ID */ yytestcase(yyruleno==350);
      case 351: /* user_name ::= NK_ID */ yytestcase(yyruleno==351);
      case 352: /* topic_name ::= NK_ID */ yytestcase(yyruleno==352);
      case 353: /* stream_name ::= NK_ID */ yytestcase(yyruleno==353);
      case 354: /* cgroup_name ::= NK_ID */ yytestcase(yyruleno==354);
      case 355: /* index_name ::= NK_ID */ yytestcase(yyruleno==355);
      case 394: /* noarg_func ::= NOW */ yytestcase(yyruleno==394);
      case 395: /* noarg_func ::= TODAY */ yytestcase(yyruleno==395);
      case 396: /* noarg_func ::= TIMEZONE */ yytestcase(yyruleno==396);
      case 397: /* noarg_func ::= DATABASE */ yytestcase(yyruleno==397);
      case 398: /* noarg_func ::= CLIENT_VERSION */ yytestcase(yyruleno==398);
      case 399: /* noarg_func ::= SERVER_VERSION */ yytestcase(yyruleno==399);
      case 400: /* noarg_func ::= SERVER_STATUS */ yytestcase(yyruleno==400);
      case 401: /* noarg_func ::= CURRENT_USER */ yytestcase(yyruleno==401);
      case 402: /* noarg_func ::= USER */ yytestcase(yyruleno==402);
      case 403: /* star_func ::= COUNT */ yytestcase(yyruleno==403);
      case 404: /* star_func ::= FIRST */ yytestcase(yyruleno==404);
      case 405: /* star_func ::= LAST */ yytestcase(yyruleno==405);
      case 406: /* star_func ::= LAST_ROW */ yytestcase(yyruleno==406);
3793 3794
{ yylhsminor.yy317 = yymsp[0].minor.yy0; }
  yymsp[0].minor.yy317 = yylhsminor.yy317;
3795 3796 3797 3798
        break;
      case 54: /* force_opt ::= */
      case 73: /* not_exists_opt ::= */ yytestcase(yyruleno==73);
      case 75: /* exists_opt ::= */ yytestcase(yyruleno==75);
3799 3800
      case 284: /* analyze_opt ::= */ yytestcase(yyruleno==284);
      case 291: /* agg_func_opt ::= */ yytestcase(yyruleno==291);
3801
      case 467: /* set_quantifier_opt ::= */ yytestcase(yyruleno==467);
3802
{ yymsp[1].minor.yy335 = false; }
3803 3804
        break;
      case 55: /* force_opt ::= FORCE */
3805 3806
      case 285: /* analyze_opt ::= ANALYZE */ yytestcase(yyruleno==285);
      case 292: /* agg_func_opt ::= AGGREGATE */ yytestcase(yyruleno==292);
3807
      case 468: /* set_quantifier_opt ::= DISTINCT */ yytestcase(yyruleno==468);
3808
{ yymsp[0].minor.yy335 = true; }
3809 3810
        break;
      case 56: /* cmd ::= ALTER LOCAL NK_STRING */
3811 3812
{ pCxt->pRootNode = createAlterLocalStmt(pCxt, &yymsp[0].minor.yy0, NULL); }
        break;
3813
      case 57: /* cmd ::= ALTER LOCAL NK_STRING NK_STRING */
3814 3815
{ pCxt->pRootNode = createAlterLocalStmt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0); }
        break;
3816
      case 58: /* cmd ::= CREATE QNODE ON DNODE NK_INTEGER */
3817
{ pCxt->pRootNode = createCreateComponentNodeStmt(pCxt, QUERY_NODE_CREATE_QNODE_STMT, &yymsp[0].minor.yy0); }
X
Xiaoyu Wang 已提交
3818
        break;
3819
      case 59: /* cmd ::= DROP QNODE ON DNODE NK_INTEGER */
3820
{ pCxt->pRootNode = createDropComponentNodeStmt(pCxt, QUERY_NODE_DROP_QNODE_STMT, &yymsp[0].minor.yy0); }
3821
        break;
3822
      case 60: /* cmd ::= CREATE BNODE ON DNODE NK_INTEGER */
3823
{ pCxt->pRootNode = createCreateComponentNodeStmt(pCxt, QUERY_NODE_CREATE_BNODE_STMT, &yymsp[0].minor.yy0); }
X
Xiaoyu Wang 已提交
3824
        break;
3825
      case 61: /* cmd ::= DROP BNODE ON DNODE NK_INTEGER */
3826
{ pCxt->pRootNode = createDropComponentNodeStmt(pCxt, QUERY_NODE_DROP_BNODE_STMT, &yymsp[0].minor.yy0); }
X
Xiaoyu Wang 已提交
3827
        break;
3828
      case 62: /* cmd ::= CREATE SNODE ON DNODE NK_INTEGER */
3829
{ pCxt->pRootNode = createCreateComponentNodeStmt(pCxt, QUERY_NODE_CREATE_SNODE_STMT, &yymsp[0].minor.yy0); }
3830
        break;
3831
      case 63: /* cmd ::= DROP SNODE ON DNODE NK_INTEGER */
3832
{ pCxt->pRootNode = createDropComponentNodeStmt(pCxt, QUERY_NODE_DROP_SNODE_STMT, &yymsp[0].minor.yy0); }
3833
        break;
3834
      case 64: /* cmd ::= CREATE MNODE ON DNODE NK_INTEGER */
3835
{ pCxt->pRootNode = createCreateComponentNodeStmt(pCxt, QUERY_NODE_CREATE_MNODE_STMT, &yymsp[0].minor.yy0); }
3836
        break;
3837
      case 65: /* cmd ::= DROP MNODE ON DNODE NK_INTEGER */
3838
{ pCxt->pRootNode = createDropComponentNodeStmt(pCxt, QUERY_NODE_DROP_MNODE_STMT, &yymsp[0].minor.yy0); }
3839
        break;
3840
      case 66: /* cmd ::= CREATE DATABASE not_exists_opt db_name db_options */
3841
{ pCxt->pRootNode = createCreateDatabaseStmt(pCxt, yymsp[-2].minor.yy335, &yymsp[-1].minor.yy317, yymsp[0].minor.yy74); }
3842
        break;
3843
      case 67: /* cmd ::= DROP DATABASE exists_opt db_name */
3844
{ pCxt->pRootNode = createDropDatabaseStmt(pCxt, yymsp[-1].minor.yy335, &yymsp[0].minor.yy317); }
3845
        break;
3846
      case 68: /* cmd ::= USE db_name */
3847
{ pCxt->pRootNode = createUseDatabaseStmt(pCxt, &yymsp[0].minor.yy317); }
3848
        break;
3849
      case 69: /* cmd ::= ALTER DATABASE db_name alter_db_options */
3850
{ pCxt->pRootNode = createAlterDatabaseStmt(pCxt, &yymsp[-1].minor.yy317, yymsp[0].minor.yy74); }
X
Xiaoyu Wang 已提交
3851
        break;
3852
      case 70: /* cmd ::= FLUSH DATABASE db_name */
3853
{ pCxt->pRootNode = createFlushDatabaseStmt(pCxt, &yymsp[0].minor.yy317); }
X
Xiaoyu Wang 已提交
3854
        break;
3855
      case 71: /* cmd ::= TRIM DATABASE db_name speed_opt */
3856
{ pCxt->pRootNode = createTrimDatabaseStmt(pCxt, &yymsp[-1].minor.yy317, yymsp[0].minor.yy856); }
X
Xiaoyu Wang 已提交
3857
        break;
3858
      case 72: /* not_exists_opt ::= IF NOT EXISTS */
3859
{ yymsp[-2].minor.yy335 = true; }
X
Xiaoyu Wang 已提交
3860
        break;
3861
      case 74: /* exists_opt ::= IF EXISTS */
3862
{ yymsp[-1].minor.yy335 = true; }
X
Xiaoyu Wang 已提交
3863
        break;
3864
      case 76: /* db_options ::= */
3865
{ yymsp[1].minor.yy74 = createDefaultDatabaseOptions(pCxt); }
X
Xiaoyu Wang 已提交
3866
        break;
3867
      case 77: /* db_options ::= db_options BUFFER NK_INTEGER */
3868 3869
{ yylhsminor.yy74 = setDatabaseOption(pCxt, yymsp[-2].minor.yy74, DB_OPTION_BUFFER, &yymsp[0].minor.yy0); }
  yymsp[-2].minor.yy74 = yylhsminor.yy74;
3870
        break;
3871
      case 78: /* db_options ::= db_options CACHEMODEL NK_STRING */
3872 3873
{ yylhsminor.yy74 = setDatabaseOption(pCxt, yymsp[-2].minor.yy74, DB_OPTION_CACHEMODEL, &yymsp[0].minor.yy0); }
  yymsp[-2].minor.yy74 = yylhsminor.yy74;
3874
        break;
3875
      case 79: /* db_options ::= db_options CACHESIZE NK_INTEGER */
3876 3877
{ yylhsminor.yy74 = setDatabaseOption(pCxt, yymsp[-2].minor.yy74, DB_OPTION_CACHESIZE, &yymsp[0].minor.yy0); }
  yymsp[-2].minor.yy74 = yylhsminor.yy74;
3878
        break;
3879
      case 80: /* db_options ::= db_options COMP NK_INTEGER */
3880 3881
{ yylhsminor.yy74 = setDatabaseOption(pCxt, yymsp[-2].minor.yy74, DB_OPTION_COMP, &yymsp[0].minor.yy0); }
  yymsp[-2].minor.yy74 = yylhsminor.yy74;
X
Xiaoyu Wang 已提交
3882
        break;
3883 3884
      case 81: /* db_options ::= db_options DURATION NK_INTEGER */
      case 82: /* db_options ::= db_options DURATION NK_VARIABLE */ yytestcase(yyruleno==82);
3885 3886
{ yylhsminor.yy74 = setDatabaseOption(pCxt, yymsp[-2].minor.yy74, DB_OPTION_DAYS, &yymsp[0].minor.yy0); }
  yymsp[-2].minor.yy74 = yylhsminor.yy74;
3887
        break;
3888
      case 83: /* db_options ::= db_options MAXROWS NK_INTEGER */
3889 3890
{ yylhsminor.yy74 = setDatabaseOption(pCxt, yymsp[-2].minor.yy74, DB_OPTION_MAXROWS, &yymsp[0].minor.yy0); }
  yymsp[-2].minor.yy74 = yylhsminor.yy74;
3891
        break;
3892
      case 84: /* db_options ::= db_options MINROWS NK_INTEGER */
3893 3894
{ yylhsminor.yy74 = setDatabaseOption(pCxt, yymsp[-2].minor.yy74, DB_OPTION_MINROWS, &yymsp[0].minor.yy0); }
  yymsp[-2].minor.yy74 = yylhsminor.yy74;
3895
        break;
3896 3897
      case 85: /* db_options ::= db_options KEEP integer_list */
      case 86: /* db_options ::= db_options KEEP variable_list */ yytestcase(yyruleno==86);
3898 3899
{ yylhsminor.yy74 = setDatabaseOption(pCxt, yymsp[-2].minor.yy74, DB_OPTION_KEEP, yymsp[0].minor.yy874); }
  yymsp[-2].minor.yy74 = yylhsminor.yy74;
3900
        break;
3901
      case 87: /* db_options ::= db_options PAGES NK_INTEGER */
3902 3903
{ yylhsminor.yy74 = setDatabaseOption(pCxt, yymsp[-2].minor.yy74, DB_OPTION_PAGES, &yymsp[0].minor.yy0); }
  yymsp[-2].minor.yy74 = yylhsminor.yy74;
X
Xiaoyu Wang 已提交
3904
        break;
3905
      case 88: /* db_options ::= db_options PAGESIZE NK_INTEGER */
3906 3907
{ yylhsminor.yy74 = setDatabaseOption(pCxt, yymsp[-2].minor.yy74, DB_OPTION_PAGESIZE, &yymsp[0].minor.yy0); }
  yymsp[-2].minor.yy74 = yylhsminor.yy74;
X
Xiaoyu Wang 已提交
3908
        break;
3909
      case 89: /* db_options ::= db_options TSDB_PAGESIZE NK_INTEGER */
3910 3911
{ yylhsminor.yy74 = setDatabaseOption(pCxt, yymsp[-2].minor.yy74, DB_OPTION_TSDB_PAGESIZE, &yymsp[0].minor.yy0); }
  yymsp[-2].minor.yy74 = yylhsminor.yy74;
3912
        break;
3913
      case 90: /* db_options ::= db_options PRECISION NK_STRING */
3914 3915
{ yylhsminor.yy74 = setDatabaseOption(pCxt, yymsp[-2].minor.yy74, DB_OPTION_PRECISION, &yymsp[0].minor.yy0); }
  yymsp[-2].minor.yy74 = yylhsminor.yy74;
X
Xiaoyu Wang 已提交
3916
        break;
3917
      case 91: /* db_options ::= db_options REPLICA NK_INTEGER */
3918 3919
{ yylhsminor.yy74 = setDatabaseOption(pCxt, yymsp[-2].minor.yy74, DB_OPTION_REPLICA, &yymsp[0].minor.yy0); }
  yymsp[-2].minor.yy74 = yylhsminor.yy74;
X
Xiaoyu Wang 已提交
3920
        break;
3921
      case 92: /* db_options ::= db_options VGROUPS NK_INTEGER */
3922 3923
{ yylhsminor.yy74 = setDatabaseOption(pCxt, yymsp[-2].minor.yy74, DB_OPTION_VGROUPS, &yymsp[0].minor.yy0); }
  yymsp[-2].minor.yy74 = yylhsminor.yy74;
X
Xiaoyu Wang 已提交
3924
        break;
3925
      case 93: /* db_options ::= db_options SINGLE_STABLE NK_INTEGER */
3926 3927
{ yylhsminor.yy74 = setDatabaseOption(pCxt, yymsp[-2].minor.yy74, DB_OPTION_SINGLE_STABLE, &yymsp[0].minor.yy0); }
  yymsp[-2].minor.yy74 = yylhsminor.yy74;
X
Xiaoyu Wang 已提交
3928
        break;
3929
      case 94: /* db_options ::= db_options RETENTIONS retention_list */
3930 3931
{ yylhsminor.yy74 = setDatabaseOption(pCxt, yymsp[-2].minor.yy74, DB_OPTION_RETENTIONS, yymsp[0].minor.yy874); }
  yymsp[-2].minor.yy74 = yylhsminor.yy74;
X
Xiaoyu Wang 已提交
3932
        break;
3933
      case 95: /* db_options ::= db_options SCHEMALESS NK_INTEGER */
3934 3935
{ yylhsminor.yy74 = setDatabaseOption(pCxt, yymsp[-2].minor.yy74, DB_OPTION_SCHEMALESS, &yymsp[0].minor.yy0); }
  yymsp[-2].minor.yy74 = yylhsminor.yy74;
X
Xiaoyu Wang 已提交
3936
        break;
3937
      case 96: /* db_options ::= db_options WAL_LEVEL NK_INTEGER */
3938 3939
{ yylhsminor.yy74 = setDatabaseOption(pCxt, yymsp[-2].minor.yy74, DB_OPTION_WAL, &yymsp[0].minor.yy0); }
  yymsp[-2].minor.yy74 = yylhsminor.yy74;
X
Xiaoyu Wang 已提交
3940
        break;
3941
      case 97: /* db_options ::= db_options WAL_FSYNC_PERIOD NK_INTEGER */
3942 3943
{ yylhsminor.yy74 = setDatabaseOption(pCxt, yymsp[-2].minor.yy74, DB_OPTION_FSYNC, &yymsp[0].minor.yy0); }
  yymsp[-2].minor.yy74 = yylhsminor.yy74;
X
Xiaoyu Wang 已提交
3944
        break;
3945
      case 98: /* db_options ::= db_options WAL_RETENTION_PERIOD NK_INTEGER */
3946 3947
{ yylhsminor.yy74 = setDatabaseOption(pCxt, yymsp[-2].minor.yy74, DB_OPTION_WAL_RETENTION_PERIOD, &yymsp[0].minor.yy0); }
  yymsp[-2].minor.yy74 = yylhsminor.yy74;
3948
        break;
3949
      case 99: /* db_options ::= db_options WAL_RETENTION_PERIOD NK_MINUS NK_INTEGER */
X
Xiaoyu Wang 已提交
3950 3951 3952
{ 
                                                                                    SToken t = yymsp[-1].minor.yy0;
                                                                                    t.n = (yymsp[0].minor.yy0.z + yymsp[0].minor.yy0.n) - yymsp[-1].minor.yy0.z;
3953
                                                                                    yylhsminor.yy74 = setDatabaseOption(pCxt, yymsp[-3].minor.yy74, DB_OPTION_WAL_RETENTION_PERIOD, &t);
X
Xiaoyu Wang 已提交
3954
                                                                                  }
3955
  yymsp[-3].minor.yy74 = yylhsminor.yy74;
X
Xiaoyu Wang 已提交
3956
        break;
3957
      case 100: /* db_options ::= db_options WAL_RETENTION_SIZE NK_INTEGER */
3958 3959
{ yylhsminor.yy74 = setDatabaseOption(pCxt, yymsp[-2].minor.yy74, DB_OPTION_WAL_RETENTION_SIZE, &yymsp[0].minor.yy0); }
  yymsp[-2].minor.yy74 = yylhsminor.yy74;
X
Xiaoyu Wang 已提交
3960
        break;
3961
      case 101: /* db_options ::= db_options WAL_RETENTION_SIZE NK_MINUS NK_INTEGER */
X
Xiaoyu Wang 已提交
3962 3963 3964
{ 
                                                                                    SToken t = yymsp[-1].minor.yy0;
                                                                                    t.n = (yymsp[0].minor.yy0.z + yymsp[0].minor.yy0.n) - yymsp[-1].minor.yy0.z;
3965
                                                                                    yylhsminor.yy74 = setDatabaseOption(pCxt, yymsp[-3].minor.yy74, DB_OPTION_WAL_RETENTION_SIZE, &t);
X
Xiaoyu Wang 已提交
3966
                                                                                  }
3967
  yymsp[-3].minor.yy74 = yylhsminor.yy74;
3968
        break;
3969
      case 102: /* db_options ::= db_options WAL_ROLL_PERIOD NK_INTEGER */
3970 3971
{ yylhsminor.yy74 = setDatabaseOption(pCxt, yymsp[-2].minor.yy74, DB_OPTION_WAL_ROLL_PERIOD, &yymsp[0].minor.yy0); }
  yymsp[-2].minor.yy74 = yylhsminor.yy74;
3972
        break;
3973
      case 103: /* db_options ::= db_options WAL_SEGMENT_SIZE NK_INTEGER */
3974 3975
{ yylhsminor.yy74 = setDatabaseOption(pCxt, yymsp[-2].minor.yy74, DB_OPTION_WAL_SEGMENT_SIZE, &yymsp[0].minor.yy0); }
  yymsp[-2].minor.yy74 = yylhsminor.yy74;
3976
        break;
3977
      case 104: /* db_options ::= db_options STT_TRIGGER NK_INTEGER */
3978 3979
{ yylhsminor.yy74 = setDatabaseOption(pCxt, yymsp[-2].minor.yy74, DB_OPTION_STT_TRIGGER, &yymsp[0].minor.yy0); }
  yymsp[-2].minor.yy74 = yylhsminor.yy74;
3980
        break;
3981
      case 105: /* db_options ::= db_options TABLE_PREFIX NK_INTEGER */
3982 3983
{ yylhsminor.yy74 = setDatabaseOption(pCxt, yymsp[-2].minor.yy74, DB_OPTION_TABLE_PREFIX, &yymsp[0].minor.yy0); }
  yymsp[-2].minor.yy74 = yylhsminor.yy74;
3984
        break;
3985
      case 106: /* db_options ::= db_options TABLE_SUFFIX NK_INTEGER */
3986 3987
{ yylhsminor.yy74 = setDatabaseOption(pCxt, yymsp[-2].minor.yy74, DB_OPTION_TABLE_SUFFIX, &yymsp[0].minor.yy0); }
  yymsp[-2].minor.yy74 = yylhsminor.yy74;
3988
        break;
3989
      case 107: /* alter_db_options ::= alter_db_option */
3990 3991
{ yylhsminor.yy74 = createAlterDatabaseOptions(pCxt); yylhsminor.yy74 = setAlterDatabaseOption(pCxt, yylhsminor.yy74, &yymsp[0].minor.yy767); }
  yymsp[0].minor.yy74 = yylhsminor.yy74;
3992
        break;
3993
      case 108: /* alter_db_options ::= alter_db_options alter_db_option */
3994 3995
{ yylhsminor.yy74 = setAlterDatabaseOption(pCxt, yymsp[-1].minor.yy74, &yymsp[0].minor.yy767); }
  yymsp[-1].minor.yy74 = yylhsminor.yy74;
3996
        break;
3997
      case 109: /* alter_db_option ::= BUFFER NK_INTEGER */
3998
{ yymsp[-1].minor.yy767.type = DB_OPTION_BUFFER; yymsp[-1].minor.yy767.val = yymsp[0].minor.yy0; }
3999
        break;
4000
      case 110: /* alter_db_option ::= CACHEMODEL NK_STRING */
4001
{ yymsp[-1].minor.yy767.type = DB_OPTION_CACHEMODEL; yymsp[-1].minor.yy767.val = yymsp[0].minor.yy0; }
4002
        break;
4003
      case 111: /* alter_db_option ::= CACHESIZE NK_INTEGER */
4004
{ yymsp[-1].minor.yy767.type = DB_OPTION_CACHESIZE; yymsp[-1].minor.yy767.val = yymsp[0].minor.yy0; }
4005
        break;
4006
      case 112: /* alter_db_option ::= WAL_FSYNC_PERIOD NK_INTEGER */
4007
{ yymsp[-1].minor.yy767.type = DB_OPTION_FSYNC; yymsp[-1].minor.yy767.val = yymsp[0].minor.yy0; }
4008
        break;
4009 4010
      case 113: /* alter_db_option ::= KEEP integer_list */
      case 114: /* alter_db_option ::= KEEP variable_list */ yytestcase(yyruleno==114);
4011
{ yymsp[-1].minor.yy767.type = DB_OPTION_KEEP; yymsp[-1].minor.yy767.pList = yymsp[0].minor.yy874; }
4012
        break;
4013
      case 115: /* alter_db_option ::= PAGES NK_INTEGER */
4014
{ yymsp[-1].minor.yy767.type = DB_OPTION_PAGES; yymsp[-1].minor.yy767.val = yymsp[0].minor.yy0; }
4015
        break;
4016
      case 116: /* alter_db_option ::= REPLICA NK_INTEGER */
4017
{ yymsp[-1].minor.yy767.type = DB_OPTION_REPLICA; yymsp[-1].minor.yy767.val = yymsp[0].minor.yy0; }
4018
        break;
4019
      case 117: /* alter_db_option ::= WAL_LEVEL NK_INTEGER */
4020
{ yymsp[-1].minor.yy767.type = DB_OPTION_WAL; yymsp[-1].minor.yy767.val = yymsp[0].minor.yy0; }
4021
        break;
4022
      case 118: /* alter_db_option ::= STT_TRIGGER NK_INTEGER */
4023
{ yymsp[-1].minor.yy767.type = DB_OPTION_STT_TRIGGER; yymsp[-1].minor.yy767.val = yymsp[0].minor.yy0; }
4024
        break;
4025
      case 119: /* integer_list ::= NK_INTEGER */
4026 4027
{ yylhsminor.yy874 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); }
  yymsp[0].minor.yy874 = yylhsminor.yy874;
4028
        break;
4029
      case 120: /* integer_list ::= integer_list NK_COMMA NK_INTEGER */
4030
      case 315: /* dnode_list ::= dnode_list DNODE NK_INTEGER */ yytestcase(yyruleno==315);
4031 4032
{ yylhsminor.yy874 = addNodeToList(pCxt, yymsp[-2].minor.yy874, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); }
  yymsp[-2].minor.yy874 = yylhsminor.yy874;
4033
        break;
4034
      case 121: /* variable_list ::= NK_VARIABLE */
4035 4036
{ yylhsminor.yy874 = createNodeList(pCxt, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); }
  yymsp[0].minor.yy874 = yylhsminor.yy874;
4037
        break;
4038
      case 122: /* variable_list ::= variable_list NK_COMMA NK_VARIABLE */
4039 4040
{ yylhsminor.yy874 = addNodeToList(pCxt, yymsp[-2].minor.yy874, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); }
  yymsp[-2].minor.yy874 = yylhsminor.yy874;
4041
        break;
4042 4043 4044 4045 4046 4047 4048
      case 123: /* retention_list ::= retention */
      case 145: /* multi_create_clause ::= create_subtable_clause */ yytestcase(yyruleno==145);
      case 148: /* multi_drop_clause ::= drop_table_clause */ yytestcase(yyruleno==148);
      case 155: /* column_def_list ::= column_def */ yytestcase(yyruleno==155);
      case 199: /* rollup_func_list ::= rollup_func_name */ yytestcase(yyruleno==199);
      case 204: /* col_name_list ::= col_name */ yytestcase(yyruleno==204);
      case 253: /* tag_list_opt ::= tag_item */ yytestcase(yyruleno==253);
4049
      case 266: /* func_list ::= func */ yytestcase(yyruleno==266);
4050 4051 4052 4053 4054 4055
      case 343: /* literal_list ::= signed_literal */ yytestcase(yyruleno==343);
      case 409: /* other_para_list ::= star_func_para */ yytestcase(yyruleno==409);
      case 415: /* when_then_list ::= when_then_expr */ yytestcase(yyruleno==415);
      case 470: /* select_list ::= select_item */ yytestcase(yyruleno==470);
      case 481: /* partition_list ::= partition_item */ yytestcase(yyruleno==481);
      case 533: /* sort_specification_list ::= sort_specification */ yytestcase(yyruleno==533);
4056 4057
{ yylhsminor.yy874 = createNodeList(pCxt, yymsp[0].minor.yy74); }
  yymsp[0].minor.yy874 = yylhsminor.yy874;
4058
        break;
4059 4060 4061 4062 4063
      case 124: /* retention_list ::= retention_list NK_COMMA retention */
      case 156: /* column_def_list ::= column_def_list NK_COMMA column_def */ yytestcase(yyruleno==156);
      case 200: /* rollup_func_list ::= rollup_func_list NK_COMMA rollup_func_name */ yytestcase(yyruleno==200);
      case 205: /* col_name_list ::= col_name_list NK_COMMA col_name */ yytestcase(yyruleno==205);
      case 254: /* tag_list_opt ::= tag_list_opt NK_COMMA tag_item */ yytestcase(yyruleno==254);
4064
      case 267: /* func_list ::= func_list NK_COMMA func */ yytestcase(yyruleno==267);
4065 4066 4067 4068 4069
      case 344: /* literal_list ::= literal_list NK_COMMA signed_literal */ yytestcase(yyruleno==344);
      case 410: /* other_para_list ::= other_para_list NK_COMMA star_func_para */ yytestcase(yyruleno==410);
      case 471: /* select_list ::= select_list NK_COMMA select_item */ yytestcase(yyruleno==471);
      case 482: /* partition_list ::= partition_list NK_COMMA partition_item */ yytestcase(yyruleno==482);
      case 534: /* sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ yytestcase(yyruleno==534);
4070 4071
{ yylhsminor.yy874 = addNodeToList(pCxt, yymsp[-2].minor.yy874, yymsp[0].minor.yy74); }
  yymsp[-2].minor.yy874 = yylhsminor.yy874;
4072
        break;
4073
      case 125: /* retention ::= NK_VARIABLE NK_COLON NK_VARIABLE */
4074 4075
{ yylhsminor.yy74 = createNodeListNodeEx(pCxt, createDurationValueNode(pCxt, &yymsp[-2].minor.yy0), createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); }
  yymsp[-2].minor.yy74 = yylhsminor.yy74;
4076
        break;
4077
      case 126: /* speed_opt ::= */
4078 4079
      case 293: /* bufsize_opt ::= */ yytestcase(yyruleno==293);
{ yymsp[1].minor.yy856 = 0; }
4080
        break;
4081
      case 127: /* speed_opt ::= MAX_SPEED NK_INTEGER */
4082 4083
      case 294: /* bufsize_opt ::= BUFSIZE NK_INTEGER */ yytestcase(yyruleno==294);
{ yymsp[-1].minor.yy856 = taosStr2Int32(yymsp[0].minor.yy0.z, NULL, 10); }
4084
        break;
4085 4086
      case 128: /* cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options */
      case 130: /* cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options */ yytestcase(yyruleno==130);
4087
{ pCxt->pRootNode = createCreateTableStmt(pCxt, yymsp[-6].minor.yy335, yymsp[-5].minor.yy74, yymsp[-3].minor.yy874, yymsp[-1].minor.yy874, yymsp[0].minor.yy74); }
4088
        break;
4089
      case 129: /* cmd ::= CREATE TABLE multi_create_clause */
4090
{ pCxt->pRootNode = createCreateMultiTableStmt(pCxt, yymsp[0].minor.yy874); }
4091
        break;
4092
      case 131: /* cmd ::= DROP TABLE multi_drop_clause */
4093
{ pCxt->pRootNode = createDropTableStmt(pCxt, yymsp[0].minor.yy874); }
4094
        break;
4095
      case 132: /* cmd ::= DROP STABLE exists_opt full_table_name */
4096
{ pCxt->pRootNode = createDropSuperTableStmt(pCxt, yymsp[-1].minor.yy335, yymsp[0].minor.yy74); }
4097
        break;
4098
      case 133: /* cmd ::= ALTER TABLE alter_table_clause */
4099
      case 317: /* cmd ::= query_or_subquery */ yytestcase(yyruleno==317);
4100
{ pCxt->pRootNode = yymsp[0].minor.yy74; }
4101
        break;
4102
      case 134: /* cmd ::= ALTER STABLE alter_table_clause */
4103
{ pCxt->pRootNode = setAlterSuperTableType(yymsp[0].minor.yy74); }
4104
        break;
4105
      case 135: /* alter_table_clause ::= full_table_name alter_table_options */
4106 4107
{ yylhsminor.yy74 = createAlterTableModifyOptions(pCxt, yymsp[-1].minor.yy74, yymsp[0].minor.yy74); }
  yymsp[-1].minor.yy74 = yylhsminor.yy74;
4108
        break;
4109
      case 136: /* alter_table_clause ::= full_table_name ADD COLUMN column_name type_name */
4110 4111
{ yylhsminor.yy74 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy74, TSDB_ALTER_TABLE_ADD_COLUMN, &yymsp[-1].minor.yy317, yymsp[0].minor.yy898); }
  yymsp[-4].minor.yy74 = yylhsminor.yy74;
4112
        break;
4113
      case 137: /* alter_table_clause ::= full_table_name DROP COLUMN column_name */
4114 4115
{ yylhsminor.yy74 = createAlterTableDropCol(pCxt, yymsp[-3].minor.yy74, TSDB_ALTER_TABLE_DROP_COLUMN, &yymsp[0].minor.yy317); }
  yymsp[-3].minor.yy74 = yylhsminor.yy74;
4116
        break;
4117
      case 138: /* alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name */
4118 4119
{ yylhsminor.yy74 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy74, TSDB_ALTER_TABLE_UPDATE_COLUMN_BYTES, &yymsp[-1].minor.yy317, yymsp[0].minor.yy898); }
  yymsp[-4].minor.yy74 = yylhsminor.yy74;
4120
        break;
4121
      case 139: /* alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name */
4122 4123
{ yylhsminor.yy74 = createAlterTableRenameCol(pCxt, yymsp[-4].minor.yy74, TSDB_ALTER_TABLE_UPDATE_COLUMN_NAME, &yymsp[-1].minor.yy317, &yymsp[0].minor.yy317); }
  yymsp[-4].minor.yy74 = yylhsminor.yy74;
4124
        break;
4125
      case 140: /* alter_table_clause ::= full_table_name ADD TAG column_name type_name */
4126 4127
{ yylhsminor.yy74 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy74, TSDB_ALTER_TABLE_ADD_TAG, &yymsp[-1].minor.yy317, yymsp[0].minor.yy898); }
  yymsp[-4].minor.yy74 = yylhsminor.yy74;
4128
        break;
4129
      case 141: /* alter_table_clause ::= full_table_name DROP TAG column_name */
4130 4131
{ yylhsminor.yy74 = createAlterTableDropCol(pCxt, yymsp[-3].minor.yy74, TSDB_ALTER_TABLE_DROP_TAG, &yymsp[0].minor.yy317); }
  yymsp[-3].minor.yy74 = yylhsminor.yy74;
4132
        break;
4133
      case 142: /* alter_table_clause ::= full_table_name MODIFY TAG column_name type_name */
4134 4135
{ yylhsminor.yy74 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy74, TSDB_ALTER_TABLE_UPDATE_TAG_BYTES, &yymsp[-1].minor.yy317, yymsp[0].minor.yy898); }
  yymsp[-4].minor.yy74 = yylhsminor.yy74;
4136
        break;
4137
      case 143: /* alter_table_clause ::= full_table_name RENAME TAG column_name column_name */
4138 4139
{ yylhsminor.yy74 = createAlterTableRenameCol(pCxt, yymsp[-4].minor.yy74, TSDB_ALTER_TABLE_UPDATE_TAG_NAME, &yymsp[-1].minor.yy317, &yymsp[0].minor.yy317); }
  yymsp[-4].minor.yy74 = yylhsminor.yy74;
4140
        break;
4141
      case 144: /* alter_table_clause ::= full_table_name SET TAG column_name NK_EQ signed_literal */
4142 4143
{ yylhsminor.yy74 = createAlterTableSetTag(pCxt, yymsp[-5].minor.yy74, &yymsp[-2].minor.yy317, yymsp[0].minor.yy74); }
  yymsp[-5].minor.yy74 = yylhsminor.yy74;
4144
        break;
4145 4146
      case 146: /* multi_create_clause ::= multi_create_clause create_subtable_clause */
      case 149: /* multi_drop_clause ::= multi_drop_clause drop_table_clause */ yytestcase(yyruleno==149);
4147
      case 416: /* when_then_list ::= when_then_list when_then_expr */ yytestcase(yyruleno==416);
4148 4149
{ yylhsminor.yy874 = addNodeToList(pCxt, yymsp[-1].minor.yy874, yymsp[0].minor.yy74); }
  yymsp[-1].minor.yy874 = yylhsminor.yy874;
4150
        break;
4151
      case 147: /* create_subtable_clause ::= not_exists_opt full_table_name USING full_table_name specific_cols_opt TAGS NK_LP expression_list NK_RP table_options */
4152 4153
{ yylhsminor.yy74 = createCreateSubTableClause(pCxt, yymsp[-9].minor.yy335, yymsp[-8].minor.yy74, yymsp[-6].minor.yy74, yymsp[-5].minor.yy874, yymsp[-2].minor.yy874, yymsp[0].minor.yy74); }
  yymsp[-9].minor.yy74 = yylhsminor.yy74;
4154
        break;
4155
      case 150: /* drop_table_clause ::= exists_opt full_table_name */
4156 4157
{ yylhsminor.yy74 = createDropTableClause(pCxt, yymsp[-1].minor.yy335, yymsp[0].minor.yy74); }
  yymsp[-1].minor.yy74 = yylhsminor.yy74;
4158
        break;
4159 4160 4161
      case 151: /* specific_cols_opt ::= */
      case 182: /* tags_def_opt ::= */ yytestcase(yyruleno==182);
      case 252: /* tag_list_opt ::= */ yytestcase(yyruleno==252);
4162 4163 4164
      case 479: /* partition_by_clause_opt ::= */ yytestcase(yyruleno==479);
      case 501: /* group_by_clause_opt ::= */ yytestcase(yyruleno==501);
      case 520: /* order_by_clause_opt ::= */ yytestcase(yyruleno==520);
4165
{ yymsp[1].minor.yy874 = NULL; }
4166
        break;
4167
      case 152: /* specific_cols_opt ::= NK_LP col_name_list NK_RP */
4168
{ yymsp[-2].minor.yy874 = yymsp[-1].minor.yy874; }
4169
        break;
4170
      case 153: /* full_table_name ::= table_name */
4171 4172
{ yylhsminor.yy74 = createRealTableNode(pCxt, NULL, &yymsp[0].minor.yy317, NULL); }
  yymsp[0].minor.yy74 = yylhsminor.yy74;
4173
        break;
4174
      case 154: /* full_table_name ::= db_name NK_DOT table_name */
4175 4176
{ yylhsminor.yy74 = createRealTableNode(pCxt, &yymsp[-2].minor.yy317, &yymsp[0].minor.yy317, NULL); }
  yymsp[-2].minor.yy74 = yylhsminor.yy74;
4177
        break;
4178
      case 157: /* column_def ::= column_name type_name */
4179 4180
{ yylhsminor.yy74 = createColumnDefNode(pCxt, &yymsp[-1].minor.yy317, yymsp[0].minor.yy898, NULL); }
  yymsp[-1].minor.yy74 = yylhsminor.yy74;
4181
        break;
4182
      case 158: /* column_def ::= column_name type_name COMMENT NK_STRING */
4183 4184
{ yylhsminor.yy74 = createColumnDefNode(pCxt, &yymsp[-3].minor.yy317, yymsp[-2].minor.yy898, &yymsp[0].minor.yy0); }
  yymsp[-3].minor.yy74 = yylhsminor.yy74;
4185
        break;
4186
      case 159: /* type_name ::= BOOL */
4187
{ yymsp[0].minor.yy898 = createDataType(TSDB_DATA_TYPE_BOOL); }
4188
        break;
4189
      case 160: /* type_name ::= TINYINT */
4190
{ yymsp[0].minor.yy898 = createDataType(TSDB_DATA_TYPE_TINYINT); }
4191
        break;
4192
      case 161: /* type_name ::= SMALLINT */
4193
{ yymsp[0].minor.yy898 = createDataType(TSDB_DATA_TYPE_SMALLINT); }
4194
        break;
4195 4196
      case 162: /* type_name ::= INT */
      case 163: /* type_name ::= INTEGER */ yytestcase(yyruleno==163);
4197
{ yymsp[0].minor.yy898 = createDataType(TSDB_DATA_TYPE_INT); }
4198
        break;
4199
      case 164: /* type_name ::= BIGINT */
4200
{ yymsp[0].minor.yy898 = createDataType(TSDB_DATA_TYPE_BIGINT); }
4201
        break;
4202
      case 165: /* type_name ::= FLOAT */
4203
{ yymsp[0].minor.yy898 = createDataType(TSDB_DATA_TYPE_FLOAT); }
4204
        break;
4205
      case 166: /* type_name ::= DOUBLE */
4206
{ yymsp[0].minor.yy898 = createDataType(TSDB_DATA_TYPE_DOUBLE); }
4207
        break;
4208
      case 167: /* type_name ::= BINARY NK_LP NK_INTEGER NK_RP */
4209
{ yymsp[-3].minor.yy898 = createVarLenDataType(TSDB_DATA_TYPE_BINARY, &yymsp[-1].minor.yy0); }
4210
        break;
4211
      case 168: /* type_name ::= TIMESTAMP */
4212
{ yymsp[0].minor.yy898 = createDataType(TSDB_DATA_TYPE_TIMESTAMP); }
4213
        break;
4214
      case 169: /* type_name ::= NCHAR NK_LP NK_INTEGER NK_RP */
4215
{ yymsp[-3].minor.yy898 = createVarLenDataType(TSDB_DATA_TYPE_NCHAR, &yymsp[-1].minor.yy0); }
4216
        break;
4217
      case 170: /* type_name ::= TINYINT UNSIGNED */
4218
{ yymsp[-1].minor.yy898 = createDataType(TSDB_DATA_TYPE_UTINYINT); }
4219
        break;
4220
      case 171: /* type_name ::= SMALLINT UNSIGNED */
4221
{ yymsp[-1].minor.yy898 = createDataType(TSDB_DATA_TYPE_USMALLINT); }
4222
        break;
4223
      case 172: /* type_name ::= INT UNSIGNED */
4224
{ yymsp[-1].minor.yy898 = createDataType(TSDB_DATA_TYPE_UINT); }
4225
        break;
4226
      case 173: /* type_name ::= BIGINT UNSIGNED */
4227
{ yymsp[-1].minor.yy898 = createDataType(TSDB_DATA_TYPE_UBIGINT); }
4228
        break;
4229
      case 174: /* type_name ::= JSON */
4230
{ yymsp[0].minor.yy898 = createDataType(TSDB_DATA_TYPE_JSON); }
4231
        break;
4232
      case 175: /* type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP */
4233
{ yymsp[-3].minor.yy898 = createVarLenDataType(TSDB_DATA_TYPE_VARCHAR, &yymsp[-1].minor.yy0); }
4234
        break;
4235
      case 176: /* type_name ::= MEDIUMBLOB */
4236
{ yymsp[0].minor.yy898 = createDataType(TSDB_DATA_TYPE_MEDIUMBLOB); }
4237
        break;
4238
      case 177: /* type_name ::= BLOB */
4239
{ yymsp[0].minor.yy898 = createDataType(TSDB_DATA_TYPE_BLOB); }
4240
        break;
4241
      case 178: /* type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP */
4242
{ yymsp[-3].minor.yy898 = createVarLenDataType(TSDB_DATA_TYPE_VARBINARY, &yymsp[-1].minor.yy0); }
4243
        break;
4244
      case 179: /* type_name ::= DECIMAL */
4245
{ yymsp[0].minor.yy898 = createDataType(TSDB_DATA_TYPE_DECIMAL); }
4246
        break;
4247
      case 180: /* type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP */
4248
{ yymsp[-3].minor.yy898 = createDataType(TSDB_DATA_TYPE_DECIMAL); }
4249
        break;
4250
      case 181: /* type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */
4251
{ yymsp[-5].minor.yy898 = createDataType(TSDB_DATA_TYPE_DECIMAL); }
4252
        break;
4253
      case 183: /* tags_def_opt ::= tags_def */
4254
      case 408: /* star_func_para_list ::= other_para_list */ yytestcase(yyruleno==408);
4255 4256
{ yylhsminor.yy874 = yymsp[0].minor.yy874; }
  yymsp[0].minor.yy874 = yylhsminor.yy874;
4257
        break;
4258
      case 184: /* tags_def ::= TAGS NK_LP column_def_list NK_RP */
4259
{ yymsp[-3].minor.yy874 = yymsp[-1].minor.yy874; }
4260
        break;
4261
      case 185: /* table_options ::= */
4262
{ yymsp[1].minor.yy74 = createDefaultTableOptions(pCxt); }
X
Xiaoyu Wang 已提交
4263
        break;
4264
      case 186: /* table_options ::= table_options COMMENT NK_STRING */
4265 4266
{ yylhsminor.yy74 = setTableOption(pCxt, yymsp[-2].minor.yy74, TABLE_OPTION_COMMENT, &yymsp[0].minor.yy0); }
  yymsp[-2].minor.yy74 = yylhsminor.yy74;
4267
        break;
4268
      case 187: /* table_options ::= table_options MAX_DELAY duration_list */
4269 4270
{ yylhsminor.yy74 = setTableOption(pCxt, yymsp[-2].minor.yy74, TABLE_OPTION_MAXDELAY, yymsp[0].minor.yy874); }
  yymsp[-2].minor.yy74 = yylhsminor.yy74;
4271
        break;
4272
      case 188: /* table_options ::= table_options WATERMARK duration_list */
4273 4274
{ yylhsminor.yy74 = setTableOption(pCxt, yymsp[-2].minor.yy74, TABLE_OPTION_WATERMARK, yymsp[0].minor.yy874); }
  yymsp[-2].minor.yy74 = yylhsminor.yy74;
4275
        break;
4276
      case 189: /* table_options ::= table_options ROLLUP NK_LP rollup_func_list NK_RP */
4277 4278
{ yylhsminor.yy74 = setTableOption(pCxt, yymsp[-4].minor.yy74, TABLE_OPTION_ROLLUP, yymsp[-1].minor.yy874); }
  yymsp[-4].minor.yy74 = yylhsminor.yy74;
4279
        break;
4280
      case 190: /* table_options ::= table_options TTL NK_INTEGER */
4281 4282
{ yylhsminor.yy74 = setTableOption(pCxt, yymsp[-2].minor.yy74, TABLE_OPTION_TTL, &yymsp[0].minor.yy0); }
  yymsp[-2].minor.yy74 = yylhsminor.yy74;
4283
        break;
4284
      case 191: /* table_options ::= table_options SMA NK_LP col_name_list NK_RP */
4285 4286
{ yylhsminor.yy74 = setTableOption(pCxt, yymsp[-4].minor.yy74, TABLE_OPTION_SMA, yymsp[-1].minor.yy874); }
  yymsp[-4].minor.yy74 = yylhsminor.yy74;
4287
        break;
4288
      case 192: /* table_options ::= table_options DELETE_MARK duration_list */
4289 4290
{ yylhsminor.yy74 = setTableOption(pCxt, yymsp[-2].minor.yy74, TABLE_OPTION_DELETE_MARK, yymsp[0].minor.yy874); }
  yymsp[-2].minor.yy74 = yylhsminor.yy74;
4291
        break;
4292
      case 193: /* alter_table_options ::= alter_table_option */
4293 4294
{ yylhsminor.yy74 = createAlterTableOptions(pCxt); yylhsminor.yy74 = setTableOption(pCxt, yylhsminor.yy74, yymsp[0].minor.yy767.type, &yymsp[0].minor.yy767.val); }
  yymsp[0].minor.yy74 = yylhsminor.yy74;
4295
        break;
4296
      case 194: /* alter_table_options ::= alter_table_options alter_table_option */
4297 4298
{ yylhsminor.yy74 = setTableOption(pCxt, yymsp[-1].minor.yy74, yymsp[0].minor.yy767.type, &yymsp[0].minor.yy767.val); }
  yymsp[-1].minor.yy74 = yylhsminor.yy74;
X
Xiaoyu Wang 已提交
4299
        break;
4300
      case 195: /* alter_table_option ::= COMMENT NK_STRING */
4301
{ yymsp[-1].minor.yy767.type = TABLE_OPTION_COMMENT; yymsp[-1].minor.yy767.val = yymsp[0].minor.yy0; }
X
Xiaoyu Wang 已提交
4302
        break;
4303
      case 196: /* alter_table_option ::= TTL NK_INTEGER */
4304
{ yymsp[-1].minor.yy767.type = TABLE_OPTION_TTL; yymsp[-1].minor.yy767.val = yymsp[0].minor.yy0; }
X
Xiaoyu Wang 已提交
4305
        break;
4306
      case 197: /* duration_list ::= duration_literal */
4307
      case 373: /* expression_list ::= expr_or_subquery */ yytestcase(yyruleno==373);
4308 4309
{ yylhsminor.yy874 = createNodeList(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy74)); }
  yymsp[0].minor.yy874 = yylhsminor.yy874;
X
Xiaoyu Wang 已提交
4310
        break;
4311
      case 198: /* duration_list ::= duration_list NK_COMMA duration_literal */
4312
      case 374: /* expression_list ::= expression_list NK_COMMA expr_or_subquery */ yytestcase(yyruleno==374);
4313 4314
{ yylhsminor.yy874 = addNodeToList(pCxt, yymsp[-2].minor.yy874, releaseRawExprNode(pCxt, yymsp[0].minor.yy74)); }
  yymsp[-2].minor.yy874 = yylhsminor.yy874;
4315
        break;
4316
      case 201: /* rollup_func_name ::= function_name */
4317 4318
{ yylhsminor.yy74 = createFunctionNode(pCxt, &yymsp[0].minor.yy317, NULL); }
  yymsp[0].minor.yy74 = yylhsminor.yy74;
4319
        break;
4320 4321 4322
      case 202: /* rollup_func_name ::= FIRST */
      case 203: /* rollup_func_name ::= LAST */ yytestcase(yyruleno==203);
      case 256: /* tag_item ::= QTAGS */ yytestcase(yyruleno==256);
4323 4324
{ yylhsminor.yy74 = createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL); }
  yymsp[0].minor.yy74 = yylhsminor.yy74;
4325
        break;
4326 4327
      case 206: /* col_name ::= column_name */
      case 257: /* tag_item ::= column_name */ yytestcase(yyruleno==257);
4328 4329
{ yylhsminor.yy74 = createColumnNode(pCxt, NULL, &yymsp[0].minor.yy317); }
  yymsp[0].minor.yy74 = yylhsminor.yy74;
4330
        break;
4331
      case 207: /* cmd ::= SHOW DNODES */
4332
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_DNODES_STMT); }
4333
        break;
4334
      case 208: /* cmd ::= SHOW USERS */
4335
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_USERS_STMT); }
4336
        break;
4337
      case 209: /* cmd ::= SHOW USER PRIVILEGES */
4338 4339
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_USER_PRIVILEGES_STMT); }
        break;
4340
      case 210: /* cmd ::= SHOW DATABASES */
4341
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_DATABASES_STMT); }
4342
        break;
4343
      case 211: /* cmd ::= SHOW db_name_cond_opt TABLES like_pattern_opt */
4344
{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_TABLES_STMT, yymsp[-2].minor.yy74, yymsp[0].minor.yy74, OP_TYPE_LIKE); }
4345
        break;
4346
      case 212: /* cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt */
4347
{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_STABLES_STMT, yymsp[-2].minor.yy74, yymsp[0].minor.yy74, OP_TYPE_LIKE); }
4348
        break;
4349
      case 213: /* cmd ::= SHOW db_name_cond_opt VGROUPS */
4350
{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_VGROUPS_STMT, yymsp[-1].minor.yy74, NULL, OP_TYPE_LIKE); }
4351
        break;
4352
      case 214: /* cmd ::= SHOW MNODES */
4353
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_MNODES_STMT); }
4354
        break;
4355
      case 215: /* cmd ::= SHOW QNODES */
4356
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_QNODES_STMT); }
4357
        break;
4358
      case 216: /* cmd ::= SHOW FUNCTIONS */
4359
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_FUNCTIONS_STMT); }
4360
        break;
4361
      case 217: /* cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt */
4362
{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_INDEXES_STMT, yymsp[0].minor.yy74, yymsp[-1].minor.yy74, OP_TYPE_EQUAL); }
4363
        break;
4364
      case 218: /* cmd ::= SHOW STREAMS */
4365
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_STREAMS_STMT); }
4366
        break;
4367
      case 219: /* cmd ::= SHOW ACCOUNTS */
4368
{ pCxt->errCode = generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_EXPRIE_STATEMENT); }
4369
        break;
4370
      case 220: /* cmd ::= SHOW APPS */
4371
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_APPS_STMT); }
4372
        break;
4373
      case 221: /* cmd ::= SHOW CONNECTIONS */
4374
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_CONNECTIONS_STMT); }
4375
        break;
4376 4377
      case 222: /* cmd ::= SHOW LICENCES */
      case 223: /* cmd ::= SHOW GRANTS */ yytestcase(yyruleno==223);
X
Xiaoyu Wang 已提交
4378
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_LICENCES_STMT); }
4379
        break;
4380
      case 224: /* cmd ::= SHOW CREATE DATABASE db_name */
4381
{ pCxt->pRootNode = createShowCreateDatabaseStmt(pCxt, &yymsp[0].minor.yy317); }
4382
        break;
4383
      case 225: /* cmd ::= SHOW CREATE TABLE full_table_name */
4384
{ pCxt->pRootNode = createShowCreateTableStmt(pCxt, QUERY_NODE_SHOW_CREATE_TABLE_STMT, yymsp[0].minor.yy74); }
4385
        break;
4386
      case 226: /* cmd ::= SHOW CREATE STABLE full_table_name */
4387
{ pCxt->pRootNode = createShowCreateTableStmt(pCxt, QUERY_NODE_SHOW_CREATE_STABLE_STMT, yymsp[0].minor.yy74); }
4388
        break;
4389
      case 227: /* cmd ::= SHOW QUERIES */
4390
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_QUERIES_STMT); }
4391
        break;
4392
      case 228: /* cmd ::= SHOW SCORES */
4393
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_SCORES_STMT); }
4394
        break;
4395
      case 229: /* cmd ::= SHOW TOPICS */
4396
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_TOPICS_STMT); }
4397
        break;
4398 4399
      case 230: /* cmd ::= SHOW VARIABLES */
      case 231: /* cmd ::= SHOW CLUSTER VARIABLES */ yytestcase(yyruleno==231);
4400
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_VARIABLES_STMT); }
X
Xiaoyu Wang 已提交
4401
        break;
4402
      case 232: /* cmd ::= SHOW LOCAL VARIABLES */
4403 4404
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_LOCAL_VARIABLES_STMT); }
        break;
4405
      case 233: /* cmd ::= SHOW DNODE NK_INTEGER VARIABLES like_pattern_opt */
4406
{ pCxt->pRootNode = createShowDnodeVariablesStmt(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[-2].minor.yy0), yymsp[0].minor.yy74); }
4407
        break;
4408
      case 234: /* cmd ::= SHOW BNODES */
4409
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_BNODES_STMT); }
4410
        break;
4411
      case 235: /* cmd ::= SHOW SNODES */
4412
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_SNODES_STMT); }
4413
        break;
4414
      case 236: /* cmd ::= SHOW CLUSTER */
4415
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_CLUSTER_STMT); }
4416
        break;
4417
      case 237: /* cmd ::= SHOW TRANSACTIONS */
4418 4419
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_TRANSACTIONS_STMT); }
        break;
4420
      case 238: /* cmd ::= SHOW TABLE DISTRIBUTED full_table_name */
4421
{ pCxt->pRootNode = createShowTableDistributedStmt(pCxt, yymsp[0].minor.yy74); }
X
Xiaoyu Wang 已提交
4422
        break;
4423
      case 239: /* cmd ::= SHOW CONSUMERS */
4424
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_CONSUMERS_STMT); }
X
Xiaoyu Wang 已提交
4425
        break;
4426
      case 240: /* cmd ::= SHOW SUBSCRIPTIONS */
4427
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_SUBSCRIPTIONS_STMT); }
X
Xiaoyu Wang 已提交
4428
        break;
4429
      case 241: /* cmd ::= SHOW TAGS FROM table_name_cond from_db_opt */
4430
{ pCxt->pRootNode = createShowStmtWithCond(pCxt, QUERY_NODE_SHOW_TAGS_STMT, yymsp[0].minor.yy74, yymsp[-1].minor.yy74, OP_TYPE_EQUAL); }
4431
        break;
4432
      case 242: /* cmd ::= SHOW TABLE TAGS tag_list_opt FROM table_name_cond from_db_opt */
4433
{ pCxt->pRootNode = createShowTableTagsStmt(pCxt, yymsp[-1].minor.yy74, yymsp[0].minor.yy74, yymsp[-3].minor.yy874); }
4434
        break;
4435
      case 243: /* cmd ::= SHOW VNODES NK_INTEGER */
4436 4437
{ pCxt->pRootNode = createShowVnodesStmt(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0), NULL); }
        break;
4438
      case 244: /* cmd ::= SHOW VNODES NK_STRING */
4439
{ pCxt->pRootNode = createShowVnodesStmt(pCxt, NULL, createValueNode(pCxt, TSDB_DATA_TYPE_VARCHAR, &yymsp[0].minor.yy0)); }
4440
        break;
4441 4442
      case 245: /* db_name_cond_opt ::= */
      case 250: /* from_db_opt ::= */ yytestcase(yyruleno==250);
4443
{ yymsp[1].minor.yy74 = createDefaultDatabaseCondValue(pCxt); }
4444
        break;
4445
      case 246: /* db_name_cond_opt ::= db_name NK_DOT */
4446 4447
{ yylhsminor.yy74 = createIdentifierValueNode(pCxt, &yymsp[-1].minor.yy317); }
  yymsp[-1].minor.yy74 = yylhsminor.yy74;
X
Xiaoyu Wang 已提交
4448
        break;
4449
      case 247: /* like_pattern_opt ::= */
4450 4451 4452 4453 4454 4455 4456 4457 4458 4459 4460 4461
      case 305: /* subtable_opt ::= */ yytestcase(yyruleno==305);
      case 418: /* case_when_else_opt ::= */ yytestcase(yyruleno==418);
      case 448: /* from_clause_opt ::= */ yytestcase(yyruleno==448);
      case 477: /* where_clause_opt ::= */ yytestcase(yyruleno==477);
      case 486: /* twindow_clause_opt ::= */ yytestcase(yyruleno==486);
      case 491: /* sliding_opt ::= */ yytestcase(yyruleno==491);
      case 493: /* fill_opt ::= */ yytestcase(yyruleno==493);
      case 505: /* having_clause_opt ::= */ yytestcase(yyruleno==505);
      case 507: /* range_opt ::= */ yytestcase(yyruleno==507);
      case 509: /* every_opt ::= */ yytestcase(yyruleno==509);
      case 522: /* slimit_clause_opt ::= */ yytestcase(yyruleno==522);
      case 526: /* limit_clause_opt ::= */ yytestcase(yyruleno==526);
4462
{ yymsp[1].minor.yy74 = NULL; }
X
Xiaoyu Wang 已提交
4463
        break;
4464
      case 248: /* like_pattern_opt ::= LIKE NK_STRING */
4465
{ yymsp[-1].minor.yy74 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0); }
X
Xiaoyu Wang 已提交
4466
        break;
4467
      case 249: /* table_name_cond ::= table_name */
4468 4469
{ yylhsminor.yy74 = createIdentifierValueNode(pCxt, &yymsp[0].minor.yy317); }
  yymsp[0].minor.yy74 = yylhsminor.yy74;
X
Xiaoyu Wang 已提交
4470
        break;
4471
      case 251: /* from_db_opt ::= FROM db_name */
4472
{ yymsp[-1].minor.yy74 = createIdentifierValueNode(pCxt, &yymsp[0].minor.yy317); }
X
Xiaoyu Wang 已提交
4473
        break;
4474
      case 255: /* tag_item ::= TBNAME */
4475 4476
{ yylhsminor.yy74 = setProjectionAlias(pCxt, createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL), &yymsp[0].minor.yy0); }
  yymsp[0].minor.yy74 = yylhsminor.yy74;
4477
        break;
4478
      case 258: /* tag_item ::= column_name column_alias */
4479 4480
{ yylhsminor.yy74 = setProjectionAlias(pCxt, createColumnNode(pCxt, NULL, &yymsp[-1].minor.yy317), &yymsp[0].minor.yy317); }
  yymsp[-1].minor.yy74 = yylhsminor.yy74;
4481
        break;
4482
      case 259: /* tag_item ::= column_name AS column_alias */
4483 4484
{ yylhsminor.yy74 = setProjectionAlias(pCxt, createColumnNode(pCxt, NULL, &yymsp[-2].minor.yy317), &yymsp[0].minor.yy317); }
  yymsp[-2].minor.yy74 = yylhsminor.yy74;
4485
        break;
4486 4487
      case 260: /* cmd ::= CREATE SMA INDEX not_exists_opt full_index_name ON full_table_name index_options */
{ pCxt->pRootNode = createCreateIndexStmt(pCxt, INDEX_TYPE_SMA, yymsp[-4].minor.yy335, yymsp[-3].minor.yy74, yymsp[-1].minor.yy74, NULL, yymsp[0].minor.yy74); }
X
Xiaoyu Wang 已提交
4488
        break;
4489 4490
      case 261: /* cmd ::= DROP INDEX exists_opt full_index_name */
{ pCxt->pRootNode = createDropIndexStmt(pCxt, yymsp[-1].minor.yy335, yymsp[0].minor.yy74); }
X
Xiaoyu Wang 已提交
4491
        break;
4492 4493 4494
      case 262: /* full_index_name ::= index_name */
{ yylhsminor.yy74 = createRealTableNodeForIndexName(pCxt, NULL, &yymsp[0].minor.yy317); }
  yymsp[0].minor.yy74 = yylhsminor.yy74;
X
Xiaoyu Wang 已提交
4495
        break;
4496 4497 4498
      case 263: /* full_index_name ::= db_name NK_DOT index_name */
{ yylhsminor.yy74 = createRealTableNodeForIndexName(pCxt, &yymsp[-2].minor.yy317, &yymsp[0].minor.yy317); }
  yymsp[-2].minor.yy74 = yylhsminor.yy74;
X
Xiaoyu Wang 已提交
4499
        break;
4500 4501
      case 264: /* index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt sma_stream_opt */
{ yymsp[-9].minor.yy74 = createIndexOption(pCxt, yymsp[-7].minor.yy874, releaseRawExprNode(pCxt, yymsp[-3].minor.yy74), NULL, yymsp[-1].minor.yy74, yymsp[0].minor.yy74); }
4502
        break;
4503 4504
      case 265: /* index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt sma_stream_opt */
{ yymsp[-11].minor.yy74 = createIndexOption(pCxt, yymsp[-9].minor.yy874, releaseRawExprNode(pCxt, yymsp[-5].minor.yy74), releaseRawExprNode(pCxt, yymsp[-3].minor.yy74), yymsp[-1].minor.yy74, yymsp[0].minor.yy74); }
4505
        break;
4506 4507 4508
      case 268: /* func ::= function_name NK_LP expression_list NK_RP */
{ yylhsminor.yy74 = createFunctionNode(pCxt, &yymsp[-3].minor.yy317, yymsp[-1].minor.yy874); }
  yymsp[-3].minor.yy74 = yylhsminor.yy74;
X
Xiaoyu Wang 已提交
4509
        break;
4510 4511 4512
      case 269: /* sma_stream_opt ::= */
      case 297: /* stream_options ::= */ yytestcase(yyruleno==297);
{ yymsp[1].minor.yy74 = createStreamOptions(pCxt); }
X
Xiaoyu Wang 已提交
4513
        break;
4514 4515 4516 4517
      case 270: /* sma_stream_opt ::= sma_stream_opt WATERMARK duration_literal */
      case 301: /* stream_options ::= stream_options WATERMARK duration_literal */ yytestcase(yyruleno==301);
{ ((SStreamOptions*)yymsp[-2].minor.yy74)->pWatermark = releaseRawExprNode(pCxt, yymsp[0].minor.yy74); yylhsminor.yy74 = yymsp[-2].minor.yy74; }
  yymsp[-2].minor.yy74 = yylhsminor.yy74;
X
Xiaoyu Wang 已提交
4518
        break;
4519 4520 4521
      case 271: /* sma_stream_opt ::= sma_stream_opt MAX_DELAY duration_literal */
{ ((SStreamOptions*)yymsp[-2].minor.yy74)->pDelay = releaseRawExprNode(pCxt, yymsp[0].minor.yy74); yylhsminor.yy74 = yymsp[-2].minor.yy74; }
  yymsp[-2].minor.yy74 = yylhsminor.yy74;
X
Xiaoyu Wang 已提交
4522
        break;
4523
      case 272: /* sma_stream_opt ::= sma_stream_opt DELETE_MARK duration_literal */
4524
      case 304: /* stream_options ::= stream_options DELETE_MARK duration_literal */ yytestcase(yyruleno==304);
4525 4526
{ ((SStreamOptions*)yymsp[-2].minor.yy74)->pDeleteMark = releaseRawExprNode(pCxt, yymsp[0].minor.yy74); yylhsminor.yy74 = yymsp[-2].minor.yy74; }
  yymsp[-2].minor.yy74 = yylhsminor.yy74;
4527
        break;
4528 4529
      case 273: /* cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_or_subquery */
{ pCxt->pRootNode = createCreateTopicStmtUseQuery(pCxt, yymsp[-3].minor.yy335, &yymsp[-2].minor.yy317, yymsp[0].minor.yy74); }
X
Xiaoyu Wang 已提交
4530
        break;
4531 4532
      case 274: /* cmd ::= CREATE TOPIC not_exists_opt topic_name AS DATABASE db_name */
{ pCxt->pRootNode = createCreateTopicStmtUseDb(pCxt, yymsp[-4].minor.yy335, &yymsp[-3].minor.yy317, &yymsp[0].minor.yy317, false); }
4533
        break;
4534 4535
      case 275: /* cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS DATABASE db_name */
{ pCxt->pRootNode = createCreateTopicStmtUseDb(pCxt, yymsp[-6].minor.yy335, &yymsp[-5].minor.yy317, &yymsp[0].minor.yy317, true); }
4536
        break;
4537 4538
      case 276: /* cmd ::= CREATE TOPIC not_exists_opt topic_name AS STABLE full_table_name */
{ pCxt->pRootNode = createCreateTopicStmtUseTable(pCxt, yymsp[-4].minor.yy335, &yymsp[-3].minor.yy317, yymsp[0].minor.yy74, false); }
4539
        break;
4540 4541
      case 277: /* cmd ::= CREATE TOPIC not_exists_opt topic_name WITH META AS STABLE full_table_name */
{ pCxt->pRootNode = createCreateTopicStmtUseTable(pCxt, yymsp[-6].minor.yy335, &yymsp[-5].minor.yy317, yymsp[0].minor.yy74, true); }
4542
        break;
4543 4544
      case 278: /* cmd ::= DROP TOPIC exists_opt topic_name */
{ pCxt->pRootNode = createDropTopicStmt(pCxt, yymsp[-1].minor.yy335, &yymsp[0].minor.yy317); }
4545
        break;
4546 4547 4548 4549 4550 4551 4552 4553
      case 279: /* cmd ::= DROP CONSUMER GROUP exists_opt cgroup_name ON topic_name */
{ pCxt->pRootNode = createDropCGroupStmt(pCxt, yymsp[-3].minor.yy335, &yymsp[-2].minor.yy317, &yymsp[0].minor.yy317); }
        break;
      case 280: /* cmd ::= DESC full_table_name */
      case 281: /* cmd ::= DESCRIBE full_table_name */ yytestcase(yyruleno==281);
{ pCxt->pRootNode = createDescribeStmt(pCxt, yymsp[0].minor.yy74); }
        break;
      case 282: /* cmd ::= RESET QUERY CACHE */
4554
{ pCxt->pRootNode = createResetQueryCacheStmt(pCxt); }
4555
        break;
4556 4557
      case 283: /* cmd ::= EXPLAIN analyze_opt explain_options query_or_subquery */
{ pCxt->pRootNode = createExplainStmt(pCxt, yymsp[-2].minor.yy335, yymsp[-1].minor.yy74, yymsp[0].minor.yy74); }
4558
        break;
4559 4560
      case 286: /* explain_options ::= */
{ yymsp[1].minor.yy74 = createDefaultExplainOptions(pCxt); }
4561
        break;
4562 4563 4564
      case 287: /* explain_options ::= explain_options VERBOSE NK_BOOL */
{ yylhsminor.yy74 = setExplainVerbose(pCxt, yymsp[-2].minor.yy74, &yymsp[0].minor.yy0); }
  yymsp[-2].minor.yy74 = yylhsminor.yy74;
4565
        break;
4566 4567 4568
      case 288: /* explain_options ::= explain_options RATIO NK_FLOAT */
{ yylhsminor.yy74 = setExplainRatio(pCxt, yymsp[-2].minor.yy74, &yymsp[0].minor.yy0); }
  yymsp[-2].minor.yy74 = yylhsminor.yy74;
4569
        break;
4570 4571
      case 289: /* cmd ::= CREATE agg_func_opt FUNCTION not_exists_opt function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt */
{ pCxt->pRootNode = createCreateFunctionStmt(pCxt, yymsp[-6].minor.yy335, yymsp[-8].minor.yy335, &yymsp[-5].minor.yy317, &yymsp[-3].minor.yy0, yymsp[-1].minor.yy898, yymsp[0].minor.yy856); }
4572
        break;
4573 4574
      case 290: /* cmd ::= DROP FUNCTION exists_opt function_name */
{ pCxt->pRootNode = createDropFunctionStmt(pCxt, yymsp[-1].minor.yy335, &yymsp[0].minor.yy317); }
4575
        break;
4576 4577
      case 295: /* cmd ::= CREATE STREAM not_exists_opt stream_name stream_options INTO full_table_name tags_def_opt subtable_opt AS query_or_subquery */
{ pCxt->pRootNode = createCreateStreamStmt(pCxt, yymsp[-8].minor.yy335, &yymsp[-7].minor.yy317, yymsp[-4].minor.yy74, yymsp[-6].minor.yy74, yymsp[-3].minor.yy874, yymsp[-2].minor.yy74, yymsp[0].minor.yy74); }
4578
        break;
4579 4580
      case 296: /* cmd ::= DROP STREAM exists_opt stream_name */
{ pCxt->pRootNode = createDropStreamStmt(pCxt, yymsp[-1].minor.yy335, &yymsp[0].minor.yy317); }
4581
        break;
4582 4583 4584
      case 298: /* stream_options ::= stream_options TRIGGER AT_ONCE */
{ ((SStreamOptions*)yymsp[-2].minor.yy74)->triggerType = STREAM_TRIGGER_AT_ONCE; yylhsminor.yy74 = yymsp[-2].minor.yy74; }
  yymsp[-2].minor.yy74 = yylhsminor.yy74;
4585
        break;
4586 4587 4588
      case 299: /* stream_options ::= stream_options TRIGGER WINDOW_CLOSE */
{ ((SStreamOptions*)yymsp[-2].minor.yy74)->triggerType = STREAM_TRIGGER_WINDOW_CLOSE; yylhsminor.yy74 = yymsp[-2].minor.yy74; }
  yymsp[-2].minor.yy74 = yylhsminor.yy74;
4589
        break;
4590 4591 4592
      case 300: /* stream_options ::= stream_options TRIGGER MAX_DELAY duration_literal */
{ ((SStreamOptions*)yymsp[-3].minor.yy74)->triggerType = STREAM_TRIGGER_MAX_DELAY; ((SStreamOptions*)yymsp[-3].minor.yy74)->pDelay = releaseRawExprNode(pCxt, yymsp[0].minor.yy74); yylhsminor.yy74 = yymsp[-3].minor.yy74; }
  yymsp[-3].minor.yy74 = yylhsminor.yy74;
4593
        break;
4594 4595 4596
      case 302: /* stream_options ::= stream_options IGNORE EXPIRED NK_INTEGER */
{ ((SStreamOptions*)yymsp[-3].minor.yy74)->ignoreExpired = taosStr2Int8(yymsp[0].minor.yy0.z, NULL, 10); yylhsminor.yy74 = yymsp[-3].minor.yy74; }
  yymsp[-3].minor.yy74 = yylhsminor.yy74;
4597
        break;
4598 4599 4600
      case 303: /* stream_options ::= stream_options FILL_HISTORY NK_INTEGER */
{ ((SStreamOptions*)yymsp[-2].minor.yy74)->fillHistory = taosStr2Int8(yymsp[0].minor.yy0.z, NULL, 10); yylhsminor.yy74 = yymsp[-2].minor.yy74; }
  yymsp[-2].minor.yy74 = yylhsminor.yy74;
4601
        break;
4602 4603 4604
      case 306: /* subtable_opt ::= SUBTABLE NK_LP expression NK_RP */
      case 492: /* sliding_opt ::= SLIDING NK_LP duration_literal NK_RP */ yytestcase(yyruleno==492);
      case 510: /* every_opt ::= EVERY NK_LP duration_literal NK_RP */ yytestcase(yyruleno==510);
4605
{ yymsp[-3].minor.yy74 = releaseRawExprNode(pCxt, yymsp[-1].minor.yy74); }
4606
        break;
4607
      case 307: /* cmd ::= KILL CONNECTION NK_INTEGER */
4608 4609
{ pCxt->pRootNode = createKillStmt(pCxt, QUERY_NODE_KILL_CONNECTION_STMT, &yymsp[0].minor.yy0); }
        break;
4610
      case 308: /* cmd ::= KILL QUERY NK_STRING */
X
Xiaoyu Wang 已提交
4611
{ pCxt->pRootNode = createKillQueryStmt(pCxt, &yymsp[0].minor.yy0); }
4612
        break;
4613
      case 309: /* cmd ::= KILL TRANSACTION NK_INTEGER */
4614 4615
{ pCxt->pRootNode = createKillStmt(pCxt, QUERY_NODE_KILL_TRANSACTION_STMT, &yymsp[0].minor.yy0); }
        break;
4616
      case 310: /* cmd ::= BALANCE VGROUP */
X
Xiaoyu Wang 已提交
4617 4618
{ pCxt->pRootNode = createBalanceVgroupStmt(pCxt); }
        break;
4619
      case 311: /* cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER */
4620 4621
{ pCxt->pRootNode = createMergeVgroupStmt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0); }
        break;
4622
      case 312: /* cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list */
4623
{ pCxt->pRootNode = createRedistributeVgroupStmt(pCxt, &yymsp[-1].minor.yy0, yymsp[0].minor.yy874); }
4624
        break;
4625
      case 313: /* cmd ::= SPLIT VGROUP NK_INTEGER */
4626 4627
{ pCxt->pRootNode = createSplitVgroupStmt(pCxt, &yymsp[0].minor.yy0); }
        break;
4628
      case 314: /* dnode_list ::= DNODE NK_INTEGER */
4629 4630
{ yymsp[-1].minor.yy874 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); }
        break;
4631
      case 316: /* cmd ::= DELETE FROM full_table_name where_clause_opt */
4632 4633
{ pCxt->pRootNode = createDeleteStmt(pCxt, yymsp[-1].minor.yy74, yymsp[0].minor.yy74); }
        break;
4634
      case 318: /* cmd ::= INSERT INTO full_table_name NK_LP col_name_list NK_RP query_or_subquery */
4635 4636
{ pCxt->pRootNode = createInsertStmt(pCxt, yymsp[-4].minor.yy74, yymsp[-2].minor.yy874, yymsp[0].minor.yy74); }
        break;
4637
      case 319: /* cmd ::= INSERT INTO full_table_name query_or_subquery */
4638 4639
{ pCxt->pRootNode = createInsertStmt(pCxt, yymsp[-1].minor.yy74, NULL, yymsp[0].minor.yy74); }
        break;
4640
      case 320: /* literal ::= NK_INTEGER */
4641 4642 4643
{ yylhsminor.yy74 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0)); }
  yymsp[0].minor.yy74 = yylhsminor.yy74;
        break;
4644
      case 321: /* literal ::= NK_FLOAT */
4645 4646 4647
{ yylhsminor.yy74 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0)); }
  yymsp[0].minor.yy74 = yylhsminor.yy74;
        break;
4648
      case 322: /* literal ::= NK_STRING */
4649 4650 4651
{ yylhsminor.yy74 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0)); }
  yymsp[0].minor.yy74 = yylhsminor.yy74;
        break;
4652
      case 323: /* literal ::= NK_BOOL */
4653 4654 4655
{ yylhsminor.yy74 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0)); }
  yymsp[0].minor.yy74 = yylhsminor.yy74;
        break;
4656
      case 324: /* literal ::= TIMESTAMP NK_STRING */
4657 4658 4659
{ yylhsminor.yy74 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0)); }
  yymsp[-1].minor.yy74 = yylhsminor.yy74;
        break;
4660 4661 4662 4663 4664 4665 4666 4667 4668 4669 4670 4671 4672 4673 4674 4675 4676 4677 4678 4679 4680
      case 325: /* literal ::= duration_literal */
      case 335: /* signed_literal ::= signed */ yytestcase(yyruleno==335);
      case 356: /* expr_or_subquery ::= expression */ yytestcase(yyruleno==356);
      case 357: /* expression ::= literal */ yytestcase(yyruleno==357);
      case 358: /* expression ::= pseudo_column */ yytestcase(yyruleno==358);
      case 359: /* expression ::= column_reference */ yytestcase(yyruleno==359);
      case 360: /* expression ::= function_expression */ yytestcase(yyruleno==360);
      case 361: /* expression ::= case_when_expression */ yytestcase(yyruleno==361);
      case 391: /* function_expression ::= literal_func */ yytestcase(yyruleno==391);
      case 440: /* boolean_value_expression ::= boolean_primary */ yytestcase(yyruleno==440);
      case 444: /* boolean_primary ::= predicate */ yytestcase(yyruleno==444);
      case 446: /* common_expression ::= expr_or_subquery */ yytestcase(yyruleno==446);
      case 447: /* common_expression ::= boolean_value_expression */ yytestcase(yyruleno==447);
      case 450: /* table_reference_list ::= table_reference */ yytestcase(yyruleno==450);
      case 452: /* table_reference ::= table_primary */ yytestcase(yyruleno==452);
      case 453: /* table_reference ::= joined_table */ yytestcase(yyruleno==453);
      case 457: /* table_primary ::= parenthesized_joined_table */ yytestcase(yyruleno==457);
      case 512: /* query_simple ::= query_specification */ yytestcase(yyruleno==512);
      case 513: /* query_simple ::= union_query_expression */ yytestcase(yyruleno==513);
      case 516: /* query_simple_or_subquery ::= query_simple */ yytestcase(yyruleno==516);
      case 518: /* query_or_subquery ::= query_expression */ yytestcase(yyruleno==518);
4681 4682 4683
{ yylhsminor.yy74 = yymsp[0].minor.yy74; }
  yymsp[0].minor.yy74 = yylhsminor.yy74;
        break;
4684
      case 326: /* literal ::= NULL */
4685 4686 4687
{ yylhsminor.yy74 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_NULL, &yymsp[0].minor.yy0)); }
  yymsp[0].minor.yy74 = yylhsminor.yy74;
        break;
4688
      case 327: /* literal ::= NK_QUESTION */
4689 4690 4691
{ yylhsminor.yy74 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createPlaceholderValueNode(pCxt, &yymsp[0].minor.yy0)); }
  yymsp[0].minor.yy74 = yylhsminor.yy74;
        break;
4692
      case 328: /* duration_literal ::= NK_VARIABLE */
4693 4694 4695
{ yylhsminor.yy74 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); }
  yymsp[0].minor.yy74 = yylhsminor.yy74;
        break;
4696
      case 329: /* signed ::= NK_INTEGER */
4697 4698 4699
{ yylhsminor.yy74 = createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0); }
  yymsp[0].minor.yy74 = yylhsminor.yy74;
        break;
4700
      case 330: /* signed ::= NK_PLUS NK_INTEGER */
4701 4702
{ yymsp[-1].minor.yy74 = createValueNode(pCxt, TSDB_DATA_TYPE_UBIGINT, &yymsp[0].minor.yy0); }
        break;
4703
      case 331: /* signed ::= NK_MINUS NK_INTEGER */
X
Xiaoyu Wang 已提交
4704 4705 4706
{ 
                                                                                    SToken t = yymsp[-1].minor.yy0;
                                                                                    t.n = (yymsp[0].minor.yy0.z + yymsp[0].minor.yy0.n) - yymsp[-1].minor.yy0.z;
4707
                                                                                    yylhsminor.yy74 = createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &t);
X
Xiaoyu Wang 已提交
4708
                                                                                  }
4709
  yymsp[-1].minor.yy74 = yylhsminor.yy74;
X
Xiaoyu Wang 已提交
4710
        break;
4711
      case 332: /* signed ::= NK_FLOAT */
4712 4713
{ yylhsminor.yy74 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0); }
  yymsp[0].minor.yy74 = yylhsminor.yy74;
X
Xiaoyu Wang 已提交
4714
        break;
4715
      case 333: /* signed ::= NK_PLUS NK_FLOAT */
4716
{ yymsp[-1].minor.yy74 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0); }
X
Xiaoyu Wang 已提交
4717
        break;
4718
      case 334: /* signed ::= NK_MINUS NK_FLOAT */
X
Xiaoyu Wang 已提交
4719 4720 4721
{ 
                                                                                    SToken t = yymsp[-1].minor.yy0;
                                                                                    t.n = (yymsp[0].minor.yy0.z + yymsp[0].minor.yy0.n) - yymsp[-1].minor.yy0.z;
4722
                                                                                    yylhsminor.yy74 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &t);
X
Xiaoyu Wang 已提交
4723
                                                                                  }
4724 4725
  yymsp[-1].minor.yy74 = yylhsminor.yy74;
        break;
4726
      case 336: /* signed_literal ::= NK_STRING */
4727 4728 4729
{ yylhsminor.yy74 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0); }
  yymsp[0].minor.yy74 = yylhsminor.yy74;
        break;
4730
      case 337: /* signed_literal ::= NK_BOOL */
4731 4732 4733
{ yylhsminor.yy74 = createValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0); }
  yymsp[0].minor.yy74 = yylhsminor.yy74;
        break;
4734
      case 338: /* signed_literal ::= TIMESTAMP NK_STRING */
4735 4736
{ yymsp[-1].minor.yy74 = createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0); }
        break;
4737 4738 4739 4740 4741 4742 4743 4744
      case 339: /* signed_literal ::= duration_literal */
      case 341: /* signed_literal ::= literal_func */ yytestcase(yyruleno==341);
      case 411: /* star_func_para ::= expr_or_subquery */ yytestcase(yyruleno==411);
      case 473: /* select_item ::= common_expression */ yytestcase(yyruleno==473);
      case 483: /* partition_item ::= expr_or_subquery */ yytestcase(yyruleno==483);
      case 517: /* query_simple_or_subquery ::= subquery */ yytestcase(yyruleno==517);
      case 519: /* query_or_subquery ::= subquery */ yytestcase(yyruleno==519);
      case 532: /* search_condition ::= common_expression */ yytestcase(yyruleno==532);
4745 4746 4747
{ yylhsminor.yy74 = releaseRawExprNode(pCxt, yymsp[0].minor.yy74); }
  yymsp[0].minor.yy74 = yylhsminor.yy74;
        break;
4748
      case 340: /* signed_literal ::= NULL */
4749 4750 4751
{ yylhsminor.yy74 = createValueNode(pCxt, TSDB_DATA_TYPE_NULL, &yymsp[0].minor.yy0); }
  yymsp[0].minor.yy74 = yylhsminor.yy74;
        break;
4752
      case 342: /* signed_literal ::= NK_QUESTION */
4753 4754 4755
{ yylhsminor.yy74 = createPlaceholderValueNode(pCxt, &yymsp[0].minor.yy0); }
  yymsp[0].minor.yy74 = yylhsminor.yy74;
        break;
4756 4757 4758
      case 362: /* expression ::= NK_LP expression NK_RP */
      case 445: /* boolean_primary ::= NK_LP boolean_value_expression NK_RP */ yytestcase(yyruleno==445);
      case 531: /* subquery ::= NK_LP subquery NK_RP */ yytestcase(yyruleno==531);
4759 4760 4761
{ yylhsminor.yy74 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, releaseRawExprNode(pCxt, yymsp[-1].minor.yy74)); }
  yymsp[-2].minor.yy74 = yylhsminor.yy74;
        break;
4762
      case 363: /* expression ::= NK_PLUS expr_or_subquery */
X
Xiaoyu Wang 已提交
4763
{
4764 4765
                                                                                    SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy74);
                                                                                    yylhsminor.yy74 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, releaseRawExprNode(pCxt, yymsp[0].minor.yy74));
X
Xiaoyu Wang 已提交
4766
                                                                                  }
4767
  yymsp[-1].minor.yy74 = yylhsminor.yy74;
X
Xiaoyu Wang 已提交
4768
        break;
4769
      case 364: /* expression ::= NK_MINUS expr_or_subquery */
X
Xiaoyu Wang 已提交
4770
{
4771 4772
                                                                                    SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy74);
                                                                                    yylhsminor.yy74 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, createOperatorNode(pCxt, OP_TYPE_MINUS, releaseRawExprNode(pCxt, yymsp[0].minor.yy74), NULL));
X
Xiaoyu Wang 已提交
4773
                                                                                  }
4774
  yymsp[-1].minor.yy74 = yylhsminor.yy74;
4775
        break;
4776
      case 365: /* expression ::= expr_or_subquery NK_PLUS expr_or_subquery */
4777
{
4778 4779 4780
                                                                                    SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy74);
                                                                                    SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy74);
                                                                                    yylhsminor.yy74 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_ADD, releaseRawExprNode(pCxt, yymsp[-2].minor.yy74), releaseRawExprNode(pCxt, yymsp[0].minor.yy74))); 
4781
                                                                                  }
4782
  yymsp[-2].minor.yy74 = yylhsminor.yy74;
X
Xiaoyu Wang 已提交
4783
        break;
4784
      case 366: /* expression ::= expr_or_subquery NK_MINUS expr_or_subquery */
4785
{
4786 4787 4788
                                                                                    SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy74);
                                                                                    SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy74);
                                                                                    yylhsminor.yy74 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_SUB, releaseRawExprNode(pCxt, yymsp[-2].minor.yy74), releaseRawExprNode(pCxt, yymsp[0].minor.yy74))); 
4789
                                                                                  }
4790
  yymsp[-2].minor.yy74 = yylhsminor.yy74;
4791
        break;
4792
      case 367: /* expression ::= expr_or_subquery NK_STAR expr_or_subquery */
4793
{
4794 4795 4796
                                                                                    SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy74);
                                                                                    SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy74);
                                                                                    yylhsminor.yy74 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_MULTI, releaseRawExprNode(pCxt, yymsp[-2].minor.yy74), releaseRawExprNode(pCxt, yymsp[0].minor.yy74))); 
4797
                                                                                  }
4798
  yymsp[-2].minor.yy74 = yylhsminor.yy74;
4799
        break;
4800
      case 368: /* expression ::= expr_or_subquery NK_SLASH expr_or_subquery */
4801
{
4802 4803 4804
                                                                                    SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy74);
                                                                                    SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy74);
                                                                                    yylhsminor.yy74 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_DIV, releaseRawExprNode(pCxt, yymsp[-2].minor.yy74), releaseRawExprNode(pCxt, yymsp[0].minor.yy74))); 
4805
                                                                                  }
4806
  yymsp[-2].minor.yy74 = yylhsminor.yy74;
4807
        break;
4808
      case 369: /* expression ::= expr_or_subquery NK_REM expr_or_subquery */
4809
{
4810 4811 4812
                                                                                    SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy74);
                                                                                    SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy74);
                                                                                    yylhsminor.yy74 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_REM, releaseRawExprNode(pCxt, yymsp[-2].minor.yy74), releaseRawExprNode(pCxt, yymsp[0].minor.yy74)));
4813
                                                                                  }
4814
  yymsp[-2].minor.yy74 = yylhsminor.yy74;
4815
        break;
4816
      case 370: /* expression ::= column_reference NK_ARROW NK_STRING */
4817
{
4818 4819
                                                                                    SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy74);
                                                                                    yylhsminor.yy74 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_JSON_GET_VALUE, releaseRawExprNode(pCxt, yymsp[-2].minor.yy74), createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0))); 
4820
                                                                                  }
4821
  yymsp[-2].minor.yy74 = yylhsminor.yy74;
4822
        break;
4823
      case 371: /* expression ::= expr_or_subquery NK_BITAND expr_or_subquery */
4824
{
4825 4826 4827
                                                                                    SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy74);
                                                                                    SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy74);
                                                                                    yylhsminor.yy74 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_BIT_AND, releaseRawExprNode(pCxt, yymsp[-2].minor.yy74), releaseRawExprNode(pCxt, yymsp[0].minor.yy74)));
4828
                                                                                  }
4829
  yymsp[-2].minor.yy74 = yylhsminor.yy74;
4830
        break;
4831
      case 372: /* expression ::= expr_or_subquery NK_BITOR expr_or_subquery */
4832
{
4833 4834 4835
                                                                                    SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy74);
                                                                                    SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy74);
                                                                                    yylhsminor.yy74 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_BIT_OR, releaseRawExprNode(pCxt, yymsp[-2].minor.yy74), releaseRawExprNode(pCxt, yymsp[0].minor.yy74)));
4836
                                                                                  }
4837 4838
  yymsp[-2].minor.yy74 = yylhsminor.yy74;
        break;
4839
      case 375: /* column_reference ::= column_name */
4840 4841 4842
{ yylhsminor.yy74 = createRawExprNode(pCxt, &yymsp[0].minor.yy317, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy317)); }
  yymsp[0].minor.yy74 = yylhsminor.yy74;
        break;
4843
      case 376: /* column_reference ::= table_name NK_DOT column_name */
4844 4845 4846
{ yylhsminor.yy74 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy317, &yymsp[0].minor.yy317, createColumnNode(pCxt, &yymsp[-2].minor.yy317, &yymsp[0].minor.yy317)); }
  yymsp[-2].minor.yy74 = yylhsminor.yy74;
        break;
4847 4848 4849 4850 4851 4852 4853 4854 4855 4856 4857
      case 377: /* pseudo_column ::= ROWTS */
      case 378: /* pseudo_column ::= TBNAME */ yytestcase(yyruleno==378);
      case 380: /* pseudo_column ::= QSTART */ yytestcase(yyruleno==380);
      case 381: /* pseudo_column ::= QEND */ yytestcase(yyruleno==381);
      case 382: /* pseudo_column ::= QDURATION */ yytestcase(yyruleno==382);
      case 383: /* pseudo_column ::= WSTART */ yytestcase(yyruleno==383);
      case 384: /* pseudo_column ::= WEND */ yytestcase(yyruleno==384);
      case 385: /* pseudo_column ::= WDURATION */ yytestcase(yyruleno==385);
      case 386: /* pseudo_column ::= IROWTS */ yytestcase(yyruleno==386);
      case 387: /* pseudo_column ::= QTAGS */ yytestcase(yyruleno==387);
      case 393: /* literal_func ::= NOW */ yytestcase(yyruleno==393);
4858 4859 4860
{ yylhsminor.yy74 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL)); }
  yymsp[0].minor.yy74 = yylhsminor.yy74;
        break;
4861
      case 379: /* pseudo_column ::= table_name NK_DOT TBNAME */
4862 4863 4864
{ yylhsminor.yy74 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy317, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[0].minor.yy0, createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[-2].minor.yy317)))); }
  yymsp[-2].minor.yy74 = yylhsminor.yy74;
        break;
4865 4866
      case 388: /* function_expression ::= function_name NK_LP expression_list NK_RP */
      case 389: /* function_expression ::= star_func NK_LP star_func_para_list NK_RP */ yytestcase(yyruleno==389);
4867 4868 4869
{ yylhsminor.yy74 = createRawExprNodeExt(pCxt, &yymsp[-3].minor.yy317, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-3].minor.yy317, yymsp[-1].minor.yy874)); }
  yymsp[-3].minor.yy74 = yylhsminor.yy74;
        break;
4870
      case 390: /* function_expression ::= CAST NK_LP expr_or_subquery AS type_name NK_RP */
4871 4872 4873
{ yylhsminor.yy74 = createRawExprNodeExt(pCxt, &yymsp[-5].minor.yy0, &yymsp[0].minor.yy0, createCastFunctionNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy74), yymsp[-1].minor.yy898)); }
  yymsp[-5].minor.yy74 = yylhsminor.yy74;
        break;
4874
      case 392: /* literal_func ::= noarg_func NK_LP NK_RP */
4875 4876 4877
{ yylhsminor.yy74 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy317, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-2].minor.yy317, NULL)); }
  yymsp[-2].minor.yy74 = yylhsminor.yy74;
        break;
4878
      case 407: /* star_func_para_list ::= NK_STAR */
4879 4880 4881
{ yylhsminor.yy874 = createNodeList(pCxt, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy0)); }
  yymsp[0].minor.yy874 = yylhsminor.yy874;
        break;
4882 4883
      case 412: /* star_func_para ::= table_name NK_DOT NK_STAR */
      case 476: /* select_item ::= table_name NK_DOT NK_STAR */ yytestcase(yyruleno==476);
4884 4885 4886
{ yylhsminor.yy74 = createColumnNode(pCxt, &yymsp[-2].minor.yy317, &yymsp[0].minor.yy0); }
  yymsp[-2].minor.yy74 = yylhsminor.yy74;
        break;
4887
      case 413: /* case_when_expression ::= CASE when_then_list case_when_else_opt END */
4888 4889 4890
{ yylhsminor.yy74 = createRawExprNodeExt(pCxt, &yymsp[-3].minor.yy0, &yymsp[0].minor.yy0, createCaseWhenNode(pCxt, NULL, yymsp[-2].minor.yy874, yymsp[-1].minor.yy74)); }
  yymsp[-3].minor.yy74 = yylhsminor.yy74;
        break;
4891
      case 414: /* case_when_expression ::= CASE common_expression when_then_list case_when_else_opt END */
4892 4893 4894
{ yylhsminor.yy74 = createRawExprNodeExt(pCxt, &yymsp[-4].minor.yy0, &yymsp[0].minor.yy0, createCaseWhenNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy74), yymsp[-2].minor.yy874, yymsp[-1].minor.yy74)); }
  yymsp[-4].minor.yy74 = yylhsminor.yy74;
        break;
4895
      case 417: /* when_then_expr ::= WHEN common_expression THEN common_expression */
4896 4897
{ yymsp[-3].minor.yy74 = createWhenThenNode(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy74), releaseRawExprNode(pCxt, yymsp[0].minor.yy74)); }
        break;
4898
      case 419: /* case_when_else_opt ::= ELSE common_expression */
4899 4900
{ yymsp[-1].minor.yy74 = releaseRawExprNode(pCxt, yymsp[0].minor.yy74); }
        break;
4901 4902
      case 420: /* predicate ::= expr_or_subquery compare_op expr_or_subquery */
      case 425: /* predicate ::= expr_or_subquery in_op in_predicate_value */ yytestcase(yyruleno==425);
4903
{
4904 4905 4906
                                                                                    SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy74);
                                                                                    SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy74);
                                                                                    yylhsminor.yy74 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, yymsp[-1].minor.yy20, releaseRawExprNode(pCxt, yymsp[-2].minor.yy74), releaseRawExprNode(pCxt, yymsp[0].minor.yy74)));
4907
                                                                                  }
4908
  yymsp[-2].minor.yy74 = yylhsminor.yy74;
4909
        break;
4910
      case 421: /* predicate ::= expr_or_subquery BETWEEN expr_or_subquery AND expr_or_subquery */
4911
{
4912 4913 4914
                                                                                    SToken s = getTokenFromRawExprNode(pCxt, yymsp[-4].minor.yy74);
                                                                                    SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy74);
                                                                                    yylhsminor.yy74 = createRawExprNodeExt(pCxt, &s, &e, createBetweenAnd(pCxt, releaseRawExprNode(pCxt, yymsp[-4].minor.yy74), releaseRawExprNode(pCxt, yymsp[-2].minor.yy74), releaseRawExprNode(pCxt, yymsp[0].minor.yy74)));
4915
                                                                                  }
4916
  yymsp[-4].minor.yy74 = yylhsminor.yy74;
4917
        break;
4918
      case 422: /* predicate ::= expr_or_subquery NOT BETWEEN expr_or_subquery AND expr_or_subquery */
4919
{
4920 4921 4922
                                                                                    SToken s = getTokenFromRawExprNode(pCxt, yymsp[-5].minor.yy74);
                                                                                    SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy74);
                                                                                    yylhsminor.yy74 = createRawExprNodeExt(pCxt, &s, &e, createNotBetweenAnd(pCxt, releaseRawExprNode(pCxt, yymsp[-5].minor.yy74), releaseRawExprNode(pCxt, yymsp[-2].minor.yy74), releaseRawExprNode(pCxt, yymsp[0].minor.yy74)));
4923
                                                                                  }
4924
  yymsp[-5].minor.yy74 = yylhsminor.yy74;
4925
        break;
4926
      case 423: /* predicate ::= expr_or_subquery IS NULL */
4927
{
4928 4929
                                                                                    SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy74);
                                                                                    yylhsminor.yy74 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NULL, releaseRawExprNode(pCxt, yymsp[-2].minor.yy74), NULL));
4930
                                                                                  }
4931
  yymsp[-2].minor.yy74 = yylhsminor.yy74;
4932
        break;
4933
      case 424: /* predicate ::= expr_or_subquery IS NOT NULL */
4934
{
4935 4936
                                                                                    SToken s = getTokenFromRawExprNode(pCxt, yymsp[-3].minor.yy74);
                                                                                    yylhsminor.yy74 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NOT_NULL, releaseRawExprNode(pCxt, yymsp[-3].minor.yy74), NULL));
4937
                                                                                  }
4938
  yymsp[-3].minor.yy74 = yylhsminor.yy74;
4939
        break;
4940
      case 426: /* compare_op ::= NK_LT */
4941
{ yymsp[0].minor.yy20 = OP_TYPE_LOWER_THAN; }
4942
        break;
4943
      case 427: /* compare_op ::= NK_GT */
4944
{ yymsp[0].minor.yy20 = OP_TYPE_GREATER_THAN; }
4945
        break;
4946
      case 428: /* compare_op ::= NK_LE */
4947
{ yymsp[0].minor.yy20 = OP_TYPE_LOWER_EQUAL; }
4948
        break;
4949
      case 429: /* compare_op ::= NK_GE */
4950
{ yymsp[0].minor.yy20 = OP_TYPE_GREATER_EQUAL; }
4951
        break;
4952
      case 430: /* compare_op ::= NK_NE */
4953
{ yymsp[0].minor.yy20 = OP_TYPE_NOT_EQUAL; }
4954
        break;
4955
      case 431: /* compare_op ::= NK_EQ */
4956
{ yymsp[0].minor.yy20 = OP_TYPE_EQUAL; }
4957
        break;
4958
      case 432: /* compare_op ::= LIKE */
4959
{ yymsp[0].minor.yy20 = OP_TYPE_LIKE; }
4960
        break;
4961
      case 433: /* compare_op ::= NOT LIKE */
4962
{ yymsp[-1].minor.yy20 = OP_TYPE_NOT_LIKE; }
4963
        break;
4964
      case 434: /* compare_op ::= MATCH */
4965
{ yymsp[0].minor.yy20 = OP_TYPE_MATCH; }
4966
        break;
4967
      case 435: /* compare_op ::= NMATCH */
4968
{ yymsp[0].minor.yy20 = OP_TYPE_NMATCH; }
4969
        break;
4970
      case 436: /* compare_op ::= CONTAINS */
4971
{ yymsp[0].minor.yy20 = OP_TYPE_JSON_CONTAINS; }
4972
        break;
4973
      case 437: /* in_op ::= IN */
4974
{ yymsp[0].minor.yy20 = OP_TYPE_IN; }
4975
        break;
4976
      case 438: /* in_op ::= NOT IN */
4977
{ yymsp[-1].minor.yy20 = OP_TYPE_NOT_IN; }
4978
        break;
4979
      case 439: /* in_predicate_value ::= NK_LP literal_list NK_RP */
4980 4981
{ yylhsminor.yy74 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, createNodeListNode(pCxt, yymsp[-1].minor.yy874)); }
  yymsp[-2].minor.yy74 = yylhsminor.yy74;
4982
        break;
4983
      case 441: /* boolean_value_expression ::= NOT boolean_primary */
4984
{
4985 4986
                                                                                    SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy74);
                                                                                    yylhsminor.yy74 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_NOT, releaseRawExprNode(pCxt, yymsp[0].minor.yy74), NULL));
4987
                                                                                  }
4988
  yymsp[-1].minor.yy74 = yylhsminor.yy74;
4989
        break;
4990
      case 442: /* boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */
4991
{
4992 4993 4994
                                                                                    SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy74);
                                                                                    SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy74);
                                                                                    yylhsminor.yy74 = createRawExprNodeExt(pCxt, &s, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_OR, releaseRawExprNode(pCxt, yymsp[-2].minor.yy74), releaseRawExprNode(pCxt, yymsp[0].minor.yy74)));
4995
                                                                                  }
4996
  yymsp[-2].minor.yy74 = yylhsminor.yy74;
4997
        break;
4998
      case 443: /* boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */
4999
{
5000 5001 5002
                                                                                    SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy74);
                                                                                    SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy74);
                                                                                    yylhsminor.yy74 = createRawExprNodeExt(pCxt, &s, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_AND, releaseRawExprNode(pCxt, yymsp[-2].minor.yy74), releaseRawExprNode(pCxt, yymsp[0].minor.yy74)));
5003
                                                                                  }
5004
  yymsp[-2].minor.yy74 = yylhsminor.yy74;
5005
        break;
5006 5007 5008
      case 449: /* from_clause_opt ::= FROM table_reference_list */
      case 478: /* where_clause_opt ::= WHERE search_condition */ yytestcase(yyruleno==478);
      case 506: /* having_clause_opt ::= HAVING search_condition */ yytestcase(yyruleno==506);
5009
{ yymsp[-1].minor.yy74 = yymsp[0].minor.yy74; }
5010
        break;
5011
      case 451: /* table_reference_list ::= table_reference_list NK_COMMA table_reference */
5012 5013
{ yylhsminor.yy74 = createJoinTableNode(pCxt, JOIN_TYPE_INNER, yymsp[-2].minor.yy74, yymsp[0].minor.yy74, NULL); }
  yymsp[-2].minor.yy74 = yylhsminor.yy74;
5014
        break;
5015
      case 454: /* table_primary ::= table_name alias_opt */
5016 5017
{ yylhsminor.yy74 = createRealTableNode(pCxt, NULL, &yymsp[-1].minor.yy317, &yymsp[0].minor.yy317); }
  yymsp[-1].minor.yy74 = yylhsminor.yy74;
5018
        break;
5019
      case 455: /* table_primary ::= db_name NK_DOT table_name alias_opt */
5020 5021
{ yylhsminor.yy74 = createRealTableNode(pCxt, &yymsp[-3].minor.yy317, &yymsp[-1].minor.yy317, &yymsp[0].minor.yy317); }
  yymsp[-3].minor.yy74 = yylhsminor.yy74;
5022
        break;
5023
      case 456: /* table_primary ::= subquery alias_opt */
5024 5025
{ yylhsminor.yy74 = createTempTableNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy74), &yymsp[0].minor.yy317); }
  yymsp[-1].minor.yy74 = yylhsminor.yy74;
5026
        break;
5027
      case 458: /* alias_opt ::= */
5028
{ yymsp[1].minor.yy317 = nil_token;  }
5029
        break;
5030
      case 460: /* alias_opt ::= AS table_alias */
5031
{ yymsp[-1].minor.yy317 = yymsp[0].minor.yy317; }
5032
        break;
5033 5034
      case 461: /* parenthesized_joined_table ::= NK_LP joined_table NK_RP */
      case 462: /* parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ yytestcase(yyruleno==462);
5035
{ yymsp[-2].minor.yy74 = yymsp[-1].minor.yy74; }
5036
        break;
5037
      case 463: /* joined_table ::= table_reference join_type JOIN table_reference ON search_condition */
5038 5039
{ yylhsminor.yy74 = createJoinTableNode(pCxt, yymsp[-4].minor.yy630, yymsp[-5].minor.yy74, yymsp[-2].minor.yy74, yymsp[0].minor.yy74); }
  yymsp[-5].minor.yy74 = yylhsminor.yy74;
5040
        break;
5041
      case 464: /* join_type ::= */
5042
{ yymsp[1].minor.yy630 = JOIN_TYPE_INNER; }
5043
        break;
5044
      case 465: /* join_type ::= INNER */
5045
{ yymsp[0].minor.yy630 = JOIN_TYPE_INNER; }
5046
        break;
5047
      case 466: /* query_specification ::= SELECT set_quantifier_opt select_list from_clause_opt where_clause_opt partition_by_clause_opt range_opt every_opt fill_opt twindow_clause_opt group_by_clause_opt having_clause_opt */
5048
{ 
5049 5050 5051 5052 5053 5054 5055 5056 5057
                                                                                    yymsp[-11].minor.yy74 = createSelectStmt(pCxt, yymsp[-10].minor.yy335, yymsp[-9].minor.yy874, yymsp[-8].minor.yy74);
                                                                                    yymsp[-11].minor.yy74 = addWhereClause(pCxt, yymsp[-11].minor.yy74, yymsp[-7].minor.yy74);
                                                                                    yymsp[-11].minor.yy74 = addPartitionByClause(pCxt, yymsp[-11].minor.yy74, yymsp[-6].minor.yy874);
                                                                                    yymsp[-11].minor.yy74 = addWindowClauseClause(pCxt, yymsp[-11].minor.yy74, yymsp[-2].minor.yy74);
                                                                                    yymsp[-11].minor.yy74 = addGroupByClause(pCxt, yymsp[-11].minor.yy74, yymsp[-1].minor.yy874);
                                                                                    yymsp[-11].minor.yy74 = addHavingClause(pCxt, yymsp[-11].minor.yy74, yymsp[0].minor.yy74);
                                                                                    yymsp[-11].minor.yy74 = addRangeClause(pCxt, yymsp[-11].minor.yy74, yymsp[-5].minor.yy74);
                                                                                    yymsp[-11].minor.yy74 = addEveryClause(pCxt, yymsp[-11].minor.yy74, yymsp[-4].minor.yy74);
                                                                                    yymsp[-11].minor.yy74 = addFillClause(pCxt, yymsp[-11].minor.yy74, yymsp[-3].minor.yy74);
5058 5059
                                                                                  }
        break;
5060
      case 469: /* set_quantifier_opt ::= ALL */
5061
{ yymsp[0].minor.yy335 = false; }
5062
        break;
5063
      case 472: /* select_item ::= NK_STAR */
5064 5065
{ yylhsminor.yy74 = createColumnNode(pCxt, NULL, &yymsp[0].minor.yy0); }
  yymsp[0].minor.yy74 = yylhsminor.yy74;
5066
        break;
5067 5068
      case 474: /* select_item ::= common_expression column_alias */
      case 484: /* partition_item ::= expr_or_subquery column_alias */ yytestcase(yyruleno==484);
5069 5070
{ yylhsminor.yy74 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy74), &yymsp[0].minor.yy317); }
  yymsp[-1].minor.yy74 = yylhsminor.yy74;
5071
        break;
5072 5073
      case 475: /* select_item ::= common_expression AS column_alias */
      case 485: /* partition_item ::= expr_or_subquery AS column_alias */ yytestcase(yyruleno==485);
5074 5075
{ yylhsminor.yy74 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy74), &yymsp[0].minor.yy317); }
  yymsp[-2].minor.yy74 = yylhsminor.yy74;
5076
        break;
5077 5078 5079
      case 480: /* partition_by_clause_opt ::= PARTITION BY partition_list */
      case 502: /* group_by_clause_opt ::= GROUP BY group_by_list */ yytestcase(yyruleno==502);
      case 521: /* order_by_clause_opt ::= ORDER BY sort_specification_list */ yytestcase(yyruleno==521);
5080
{ yymsp[-2].minor.yy874 = yymsp[0].minor.yy874; }
5081
        break;
5082
      case 487: /* twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP */
5083
{ yymsp[-5].minor.yy74 = createSessionWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy74), releaseRawExprNode(pCxt, yymsp[-1].minor.yy74)); }
5084
        break;
5085
      case 488: /* twindow_clause_opt ::= STATE_WINDOW NK_LP expr_or_subquery NK_RP */
5086
{ yymsp[-3].minor.yy74 = createStateWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy74)); }
5087
        break;
5088
      case 489: /* twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt */
5089
{ yymsp[-5].minor.yy74 = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy74), NULL, yymsp[-1].minor.yy74, yymsp[0].minor.yy74); }
5090
        break;
5091
      case 490: /* twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt */
5092
{ yymsp[-7].minor.yy74 = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-5].minor.yy74), releaseRawExprNode(pCxt, yymsp[-3].minor.yy74), yymsp[-1].minor.yy74, yymsp[0].minor.yy74); }
5093
        break;
5094
      case 494: /* fill_opt ::= FILL NK_LP fill_mode NK_RP */
5095
{ yymsp[-3].minor.yy74 = createFillNode(pCxt, yymsp[-1].minor.yy828, NULL); }
5096
        break;
5097
      case 495: /* fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP */
5098
{ yymsp[-5].minor.yy74 = createFillNode(pCxt, FILL_MODE_VALUE, createNodeListNode(pCxt, yymsp[-1].minor.yy874)); }
5099
        break;
5100
      case 496: /* fill_mode ::= NONE */
5101
{ yymsp[0].minor.yy828 = FILL_MODE_NONE; }
5102
        break;
5103
      case 497: /* fill_mode ::= PREV */
5104
{ yymsp[0].minor.yy828 = FILL_MODE_PREV; }
5105
        break;
5106
      case 498: /* fill_mode ::= NULL */
5107
{ yymsp[0].minor.yy828 = FILL_MODE_NULL; }
5108
        break;
5109
      case 499: /* fill_mode ::= LINEAR */
5110
{ yymsp[0].minor.yy828 = FILL_MODE_LINEAR; }
5111
        break;
5112
      case 500: /* fill_mode ::= NEXT */
5113
{ yymsp[0].minor.yy828 = FILL_MODE_NEXT; }
5114
        break;
5115
      case 503: /* group_by_list ::= expr_or_subquery */
5116 5117
{ yylhsminor.yy874 = createNodeList(pCxt, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy74))); }
  yymsp[0].minor.yy874 = yylhsminor.yy874;
5118
        break;
5119
      case 504: /* group_by_list ::= group_by_list NK_COMMA expr_or_subquery */
5120 5121
{ yylhsminor.yy874 = addNodeToList(pCxt, yymsp[-2].minor.yy874, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy74))); }
  yymsp[-2].minor.yy874 = yylhsminor.yy874;
X
Xiaoyu Wang 已提交
5122
        break;
5123
      case 508: /* range_opt ::= RANGE NK_LP expr_or_subquery NK_COMMA expr_or_subquery NK_RP */
5124
{ yymsp[-5].minor.yy74 = createInterpTimeRange(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy74), releaseRawExprNode(pCxt, yymsp[-1].minor.yy74)); }
5125
        break;
5126
      case 511: /* query_expression ::= query_simple order_by_clause_opt slimit_clause_opt limit_clause_opt */
X
Xiaoyu Wang 已提交
5127
{
5128 5129 5130
                                                                                    yylhsminor.yy74 = addOrderByClause(pCxt, yymsp[-3].minor.yy74, yymsp[-2].minor.yy874);
                                                                                    yylhsminor.yy74 = addSlimitClause(pCxt, yylhsminor.yy74, yymsp[-1].minor.yy74);
                                                                                    yylhsminor.yy74 = addLimitClause(pCxt, yylhsminor.yy74, yymsp[0].minor.yy74);
5131
                                                                                  }
5132
  yymsp[-3].minor.yy74 = yylhsminor.yy74;
5133
        break;
5134
      case 514: /* union_query_expression ::= query_simple_or_subquery UNION ALL query_simple_or_subquery */
5135 5136
{ yylhsminor.yy74 = createSetOperator(pCxt, SET_OP_TYPE_UNION_ALL, yymsp[-3].minor.yy74, yymsp[0].minor.yy74); }
  yymsp[-3].minor.yy74 = yylhsminor.yy74;
X
Xiaoyu Wang 已提交
5137
        break;
5138
      case 515: /* union_query_expression ::= query_simple_or_subquery UNION query_simple_or_subquery */
5139 5140
{ yylhsminor.yy74 = createSetOperator(pCxt, SET_OP_TYPE_UNION, yymsp[-2].minor.yy74, yymsp[0].minor.yy74); }
  yymsp[-2].minor.yy74 = yylhsminor.yy74;
X
Xiaoyu Wang 已提交
5141
        break;
5142 5143
      case 523: /* slimit_clause_opt ::= SLIMIT NK_INTEGER */
      case 527: /* limit_clause_opt ::= LIMIT NK_INTEGER */ yytestcase(yyruleno==527);
5144
{ yymsp[-1].minor.yy74 = createLimitNode(pCxt, &yymsp[0].minor.yy0, NULL); }
5145
        break;
5146 5147
      case 524: /* slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */
      case 528: /* limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ yytestcase(yyruleno==528);
5148
{ yymsp[-3].minor.yy74 = createLimitNode(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0); }
5149
        break;
5150 5151
      case 525: /* slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */
      case 529: /* limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ yytestcase(yyruleno==529);
5152
{ yymsp[-3].minor.yy74 = createLimitNode(pCxt, &yymsp[0].minor.yy0, &yymsp[-2].minor.yy0); }
5153
        break;
5154
      case 530: /* subquery ::= NK_LP query_expression NK_RP */
5155 5156
{ yylhsminor.yy74 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, yymsp[-1].minor.yy74); }
  yymsp[-2].minor.yy74 = yylhsminor.yy74;
5157
        break;
5158
      case 535: /* sort_specification ::= expr_or_subquery ordering_specification_opt null_ordering_opt */
5159 5160
{ yylhsminor.yy74 = createOrderByExprNode(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy74), yymsp[-1].minor.yy326, yymsp[0].minor.yy109); }
  yymsp[-2].minor.yy74 = yylhsminor.yy74;
5161
        break;
5162
      case 536: /* ordering_specification_opt ::= */
5163
{ yymsp[1].minor.yy326 = ORDER_ASC; }
5164
        break;
5165
      case 537: /* ordering_specification_opt ::= ASC */
5166
{ yymsp[0].minor.yy326 = ORDER_ASC; }
5167
        break;
5168
      case 538: /* ordering_specification_opt ::= DESC */
5169
{ yymsp[0].minor.yy326 = ORDER_DESC; }
5170
        break;
5171
      case 539: /* null_ordering_opt ::= */
5172
{ yymsp[1].minor.yy109 = NULL_ORDER_DEFAULT; }
5173
        break;
5174
      case 540: /* null_ordering_opt ::= NULLS FIRST */
5175
{ yymsp[-1].minor.yy109 = NULL_ORDER_FIRST; }
5176
        break;
5177
      case 541: /* null_ordering_opt ::= NULLS LAST */
5178
{ yymsp[-1].minor.yy109 = NULL_ORDER_LAST; }
5179 5180 5181 5182 5183
        break;
      default:
        break;
/********** End reduce actions ************************************************/
  };
X
Xiaoyu Wang 已提交
5184 5185 5186
  assert( yyruleno<sizeof(yyRuleInfo)/sizeof(yyRuleInfo[0]) );
  yygoto = yyRuleInfo[yyruleno].lhs;
  yysize = yyRuleInfo[yyruleno].nrhs;
5187 5188 5189 5190 5191 5192 5193 5194 5195 5196 5197 5198 5199 5200 5201 5202 5203 5204 5205 5206 5207 5208 5209 5210
  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 已提交
5211 5212
  ParseARG_FETCH
  ParseCTX_FETCH
5213 5214 5215 5216 5217 5218 5219 5220 5221 5222
#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 已提交
5223 5224
  ParseARG_STORE /* Suppress warning about unused %extra_argument variable */
  ParseCTX_STORE
5225 5226 5227 5228 5229 5230 5231 5232 5233
}
#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 已提交
5234
  ParseTOKENTYPE yyminor         /* The minor type of the error token */
5235
){
X
Xiaoyu Wang 已提交
5236 5237
  ParseARG_FETCH
  ParseCTX_FETCH
5238 5239
#define TOKEN yyminor
/************ Begin %syntax_error code ****************************************/
5240

5241
  if (TSDB_CODE_SUCCESS == pCxt->errCode) {
5242
    if(TOKEN.z) {
5243
      pCxt->errCode = generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_SYNTAX_ERROR, TOKEN.z);
5244
    } else {
5245
      pCxt->errCode = generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_INCOMPLETE_SQL);
5246
    }
5247 5248
  } else if (TSDB_CODE_PAR_DB_NOT_SPECIFIED == pCxt->errCode && TK_NK_FLOAT == TOKEN.type) {
    pCxt->errCode = generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_SYNTAX_ERROR, TOKEN.z);
5249 5250
  }
/************ End %syntax_error code ******************************************/
X
Xiaoyu Wang 已提交
5251 5252
  ParseARG_STORE /* Suppress warning about unused %extra_argument variable */
  ParseCTX_STORE
5253 5254 5255 5256 5257 5258 5259 5260
}

/*
** The following is executed when the parser accepts
*/
static void yy_accept(
  yyParser *yypParser           /* The parser */
){
X
Xiaoyu Wang 已提交
5261 5262
  ParseARG_FETCH
  ParseCTX_FETCH
5263 5264 5265 5266 5267 5268 5269 5270 5271 5272 5273 5274 5275
#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 已提交
5276 5277
  ParseARG_STORE /* Suppress warning about unused %extra_argument variable */
  ParseCTX_STORE
5278 5279 5280 5281
}

/* The main parser program.
** The first argument is a pointer to a structure obtained from
X
Xiaoyu Wang 已提交
5282
** "ParseAlloc" which describes the current state of the parser.
5283 5284 5285 5286 5287 5288 5289 5290 5291 5292 5293 5294 5295 5296 5297 5298
** 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 已提交
5299
void Parse(
5300 5301
  void *yyp,                   /* The parser */
  int yymajor,                 /* The major token code number */
X
Xiaoyu Wang 已提交
5302 5303
  ParseTOKENTYPE yyminor       /* The value for the token */
  ParseARG_PDECL               /* Optional %extra_argument parameter */
5304 5305 5306 5307 5308 5309 5310 5311 5312 5313
){
  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 已提交
5314 5315
  ParseCTX_FETCH
  ParseARG_STORE
5316 5317 5318 5319 5320 5321 5322 5323 5324 5325 5326 5327 5328 5329 5330 5331 5332 5333 5334

  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

X
Xiaoyu Wang 已提交
5335
  do{
5336 5337 5338
    assert( yyact==yypParser->yytos->stateno );
    yyact = yy_find_shift_action((YYCODETYPE)yymajor,yyact);
    if( yyact >= YY_MIN_REDUCE ){
X
Xiaoyu Wang 已提交
5339 5340
      yyact = yy_reduce(yypParser,yyact-YY_MIN_REDUCE,yymajor,
                        yyminor ParseCTX_PARAM);
5341 5342 5343 5344 5345 5346 5347 5348 5349 5350 5351 5352 5353 5354 5355 5356 5357 5358 5359 5360 5361 5362 5363 5364 5365 5366 5367 5368 5369 5370 5371 5372 5373 5374 5375 5376 5377 5378 5379 5380 5381 5382 5383 5384 5385 5386 5387 5388 5389 5390 5391 5392 5393 5394 5395
    }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{
X
Xiaoyu Wang 已提交
5396 5397 5398 5399 5400
        while( yypParser->yytos >= yypParser->yystack
            && (yyact = yy_find_reduce_action(
                        yypParser->yytos->stateno,
                        YYERRORSYMBOL)) > YY_MAX_SHIFTREDUCE
        ){
5401 5402
          yy_pop_parser_stack(yypParser);
        }
X
Xiaoyu Wang 已提交
5403
        if( yypParser->yytos < yypParser->yystack || yymajor==0 ){
5404 5405 5406 5407 5408 5409 5410 5411 5412 5413 5414 5415 5416 5417 5418 5419 5420 5421 5422 5423 5424 5425 5426 5427 5428 5429 5430 5431 5432 5433 5434 5435 5436 5437 5438 5439 5440 5441 5442 5443 5444 5445 5446 5447 5448 5449 5450 5451 5452
          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
    }
X
Xiaoyu Wang 已提交
5453
  }while( yypParser->yytos>yypParser->yystack );
5454 5455 5456 5457 5458 5459 5460 5461 5462 5463 5464 5465 5466 5467 5468 5469 5470 5471 5472
#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 已提交
5473
int ParseFallback(int iToken){
5474
#ifdef YYFALLBACK
X
Xiaoyu Wang 已提交
5475 5476 5477
  if( iToken<(int)(sizeof(yyFallback)/sizeof(yyFallback[0])) ){
    return yyFallback[iToken];
  }
5478 5479
#else
  (void)iToken;
D
dapan1121 已提交
5480
#endif
X
Xiaoyu Wang 已提交
5481
  return 0;
5482
}