sql.c 219.0 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
/*
** 2000-05-29
**
** The author disclaims copyright to this source code.  In place of
** a legal notice, here is a blessing:
**
**    May you do good and not evil.
**    May you find forgiveness for yourself and forgive others.
**    May you share freely, never taking more than you give.
**
*************************************************************************
** Driver template for the LEMON parser generator.
**
** The "lemon" program processes an LALR(1) input grammar file, then uses
** this template to construct a parser.  The "lemon" program inserts text
** at each "%%" line.  Also, any "P-a-r-s-e" identifer prefix (without the
** interstitial "-" characters) contained in this template is changed into
** the value of the %name directive from the grammar.  Otherwise, the content
** of this template is copied straight through into the generate parser
** source file.
**
** The following is the concatenation of all %include directives from the
** input grammar file:
*/
#include <stdio.h>
#include <assert.h>
/************ Begin %include sections from the grammar ************************/

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

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

/* The next sections is a series of control #defines.
** various aspects of the generated parser.
**    YYCODETYPE         is the data type used to store the integer codes
**                       that represent terminal and non-terminal symbols.
**                       "unsigned char" is used if there are fewer than
**                       256 symbols.  Larger types otherwise.
**    YYNOCODE           is a number of type YYCODETYPE that is not used for
**                       any terminal or nonterminal symbol.
**    YYFALLBACK         If defined, this indicates that one or more tokens
**                       (also known as: "terminal symbols") have fall-back
**                       values which should be used if the original symbol
**                       would not parse.  This permits keywords to sometimes
**                       be used as identifiers, for example.
**    YYACTIONTYPE       is the data type used for "action codes" - numbers
**                       that indicate what to do in response to the next
**                       token.
X
Xiaoyu Wang 已提交
63
**    ParseTOKENTYPE     is the data type used for minor type for terminal
64 65 66 67 68 69 70 71 72 73
**                       symbols.  Background: A "minor type" is a semantic
**                       value associated with a terminal or non-terminal
**                       symbols.  For example, for an "ID" terminal symbol,
**                       the minor type might be the name of the identifier.
**                       Each non-terminal can have a different minor type.
**                       Terminal symbols all have the same minor type, though.
**                       This macros defines the minor type for terminal 
**                       symbols.
**    YYMINORTYPE        is the data type used for all minor types.
**                       This is typically a union of many types, one of
X
Xiaoyu Wang 已提交
74
**                       which is ParseTOKENTYPE.  The entry in the union
75 76
**                       for terminal symbols is called "yy0".
**    YYSTACKDEPTH       is the maximum depth of the parser's stack.  If
X
Xiaoyu Wang 已提交
77
**                       zero the stack is dynamically sized using realloc()
X
Xiaoyu Wang 已提交
78 79 80 81 82 83
**    ParseARG_SDECL     A static variable declaration for the %extra_argument
**    ParseARG_PDECL     A parameter declaration for the %extra_argument
**    ParseARG_PARAM     Code to pass %extra_argument as a subroutine parameter
**    ParseARG_STORE     Code to store %extra_argument into yypParser
**    ParseARG_FETCH     Code to extract %extra_argument from yypParser
**    ParseCTX_*         As ParseARG_ except for %extra_context
84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101
**    YYERRORSYMBOL      is the code number of the error symbol.  If not
**                       defined, then do no error processing.
**    YYNSTATE           the combined number of states.
**    YYNRULE            the number of rules in the grammar
**    YYNTOKEN           Number of terminal symbols
**    YY_MAX_SHIFT       Maximum value for shift actions
**    YY_MIN_SHIFTREDUCE Minimum value for shift-reduce actions
**    YY_MAX_SHIFTREDUCE Maximum value for shift-reduce actions
**    YY_ERROR_ACTION    The yy_action[] code for syntax error
**    YY_ACCEPT_ACTION   The yy_action[] code for accept
**    YY_NO_ACTION       The yy_action[] code for no-op
**    YY_MIN_REDUCE      Minimum value for reduce actions
**    YY_MAX_REDUCE      Maximum value for reduce actions
*/
#ifndef INTERFACE
# define INTERFACE 1
#endif
/************* Begin control #defines *****************************************/
X
Xiaoyu Wang 已提交
102
#define YYCODETYPE unsigned short int
103
#define YYNOCODE 332
104
#define YYACTIONTYPE unsigned short int
X
Xiaoyu Wang 已提交
105
#define ParseTOKENTYPE  SToken 
106 107
typedef union {
  int yyinit;
X
Xiaoyu Wang 已提交
108
  ParseTOKENTYPE yy0;
109 110 111 112 113 114 115 116 117 118 119 120
  SNodeList* yy64;
  int32_t yy116;
  SNode* yy192;
  ENullOrder yy225;
  bool yy273;
  SAlterOption yy277;
  SToken yy353;
  EFillMode yy358;
  EJoinType yy372;
  EOperatorType yy412;
  EOrder yy530;
  SDataType yy536;
121 122 123 124
} YYMINORTYPE;
#ifndef YYSTACKDEPTH
#define YYSTACKDEPTH 100
#endif
X
Xiaoyu Wang 已提交
125 126 127 128 129 130 131 132 133 134
#define ParseARG_SDECL  SAstCreateContext* pCxt ;
#define ParseARG_PDECL , SAstCreateContext* pCxt 
#define ParseARG_PARAM ,pCxt 
#define ParseARG_FETCH  SAstCreateContext* pCxt =yypParser->pCxt ;
#define ParseARG_STORE yypParser->pCxt =pCxt ;
#define ParseCTX_SDECL
#define ParseCTX_PDECL
#define ParseCTX_PARAM
#define ParseCTX_FETCH
#define ParseCTX_STORE
135 136 137 138 139 140 141 142 143 144 145
#define YYNSTATE             566
#define YYNRULE              431
#define YYNTOKEN             219
#define YY_MAX_SHIFT         565
#define YY_MIN_SHIFTREDUCE   839
#define YY_MAX_SHIFTREDUCE   1269
#define YY_ERROR_ACTION      1270
#define YY_ACCEPT_ACTION     1271
#define YY_NO_ACTION         1272
#define YY_MIN_REDUCE        1273
#define YY_MAX_REDUCE        1703
146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211
/************* 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 **********************************************/
212
#define YY_ACTTAB_COUNT (1905)
213
static const YYACTIONTYPE yy_action[] = {
214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404
 /*     0 */   268, 1543,  285, 1573, 1557,  317,   26,  203,   53,  123,
 /*    10 */   464, 1285,   33,   31,  480, 1539, 1546, 1543,  288, 1543,
 /*    20 */   277,   99, 1092,   77,  479, 1476, 1478,   69, 1573, 1388,
 /*    30 */   380, 1539, 1545, 1539, 1545,  444, 1442,  409, 1090, 1393,
 /*    40 */  1117,  105,  267, 1682,  434,  463, 1370, 1440, 1385, 1529,
 /*    50 */    12,   33,   31, 1212, 1557,  121,  136, 1098,  359,  277,
 /*    60 */  1680, 1092,  441, 1396,  143, 1113, 1682,   73, 1558,  466,
 /*    70 */  1560, 1561,  462,  479,    1, 1682, 1621, 1090, 1573, 1681,
 /*    80 */   270, 1617,  131, 1680,  323,  464,  927,  104,  136,   12,
 /*    90 */    51, 1473, 1680,   50,  199,  463, 1098,  562,  145, 1529,
 /*   100 */   424, 1648,   33,   31,  445,  929,  445,  106,  281, 1091,
 /*   110 */   277,  511, 1092,    1,  248, 1115,  121,   72, 1558,  466,
 /*   120 */  1560, 1561,  462,  102, 1395,  480, 1621,   36, 1090,  467,
 /*   130 */   249, 1617,  280,  514,  321, 1485,  562,  196, 1628,  440,
 /*   140 */    12,  439, 1682,  876, 1682,  875, 1093, 1098, 1091, 1384,
 /*   150 */  1393, 1176,  510,  509,  508,  136,  507,  136,  198, 1680,
 /*   160 */  1557, 1680,  124,  877,    1,  516, 1351, 1096, 1097, 1181,
 /*   170 */  1141, 1142, 1143, 1144, 1145, 1146, 1147, 1148, 1149,  459,
 /*   180 */  1153, 1154, 1155, 1156, 1573, 1093,  395,  562,  389,   55,
 /*   190 */   266,  464,  394,  174, 1529,  101,  137,  390,  388, 1091,
 /*   200 */   391,  463, 1296,   23,  435, 1529, 1096, 1097,  425, 1141,
 /*   210 */  1142, 1143, 1144, 1145, 1146, 1147, 1148, 1149,  459, 1153,
 /*   220 */  1154, 1155, 1156,  246, 1558,  466, 1560, 1561,  462,   33,
 /*   230 */    31,   34,   32,   30,   29,   28, 1093,  277,   53, 1092,
 /*   240 */   287,  137,   34,   32,   30,   29,   28, 1529,  121,  137,
 /*   250 */    34,   32,   30,   29,   28, 1090, 1395, 1096, 1097, 1389,
 /*   260 */  1141, 1142, 1143, 1144, 1145, 1146, 1147, 1148, 1149,  459,
 /*   270 */  1153, 1154, 1155, 1156, 1098,   33,   31, 1157,  479,  480,
 /*   280 */   250, 1371,  316,  277,  315, 1092, 1322,  308,  322,   87,
 /*   290 */  1550,    7,   86,   85,   84,   83,   82,   81,   80,   79,
 /*   300 */    78, 1090, 1548,  480, 1393, 1128,  310,   34,   32,   30,
 /*   310 */    29,   28,   77, 1174,  562, 1369,  431,  100, 1442,  387,
 /*   320 */  1098,  383,  558,  557,  282,  137, 1091, 1236, 1393, 1440,
 /*   330 */   359,  260,   36,  137,   30,   29,   28,    7,  538,  537,
 /*   340 */   536,  535,  292,  386,  534,  533,  532,  107,  527,  526,
 /*   350 */   525,  524,  523,  522,  521,  520,  114,  100,    9,    8,
 /*   360 */   562,  383, 1175, 1093,  516,  428, 1234, 1235, 1237, 1238,
 /*   370 */  1226,  225, 1091,  261, 1423,  259,  258, 1266,  382,  345,
 /*   380 */  1180,  436,  432,  386, 1096, 1097, 1116, 1141, 1142, 1143,
 /*   390 */  1144, 1145, 1146, 1147, 1148, 1149,  459, 1153, 1154, 1155,
 /*   400 */  1156, 1271,   33,   31,  441, 1325,  385,  384, 1295, 1093,
 /*   410 */   277,  875, 1092,  137,   25,  275, 1169, 1170, 1171, 1172,
 /*   420 */  1173, 1177, 1178, 1179, 1118,  147,  146,  378, 1090,  104,
 /*   430 */  1096, 1097, 1188, 1141, 1142, 1143, 1144, 1145, 1146, 1147,
 /*   440 */  1148, 1149,  459, 1153, 1154, 1155, 1156, 1098,   33,   31,
 /*   450 */   284,  283,  480, 1529,  293, 1265,  277,  395, 1092,  389,
 /*   460 */  1106,  330,  506,  394,    7,  102,  101, 1312,  390,  388,
 /*   470 */    62,  391,  448,  480, 1090, 1442, 1099, 1393,  443,  132,
 /*   480 */  1628, 1629,  331, 1633,  530,  127, 1477,  562,  311,  396,
 /*   490 */    22, 1386, 1682, 1098, 1294, 1098, 1434,  480, 1393, 1091,
 /*   500 */    34,   32,   30,   29,   28,  136,  358,  393,  392, 1680,
 /*   510 */     1,  965,  503,  502,  501,  969,  500,  971,  972,  499,
 /*   520 */   974,  496, 1393,  980,  493,  982,  983,  490,  487,  247,
 /*   530 */  1293, 1113,  290,  562,  480,  481, 1093,  449,  338, 1529,
 /*   540 */   121,  350,  184, 1390,  519, 1091, 1365, 1102, 1395, 1292,
 /*   550 */   351,   34,   32,   30,   29,   28, 1291, 1096, 1097, 1393,
 /*   560 */  1141, 1142, 1143, 1144, 1145, 1146, 1147, 1148, 1149,  459,
 /*   570 */  1153, 1154, 1155, 1156,  452, 1529, 1290,  480,  513,  512,
 /*   580 */  1289, 1442, 1093,    6, 1107,   24, 1510,  531,  529,  250,
 /*   590 */  1640, 1207, 1441, 1114, 1529,   34,   32,   30,   29,   28,
 /*   600 */   518, 1529, 1393, 1096, 1097, 1110, 1141, 1142, 1143, 1144,
 /*   610 */  1145, 1146, 1147, 1148, 1149,  459, 1153, 1154, 1155, 1156,
 /*   620 */  1557, 1529, 1174,  349, 1288, 1529,  344,  343,  342,  341,
 /*   630 */   340,  416,  337,  336,  335,  334,  333,  329,  328,  327,
 /*   640 */   326,  325,  324, 1635, 1573,  122, 1287, 1211,  480,  480,
 /*   650 */   231,  444,   34,   32,   30,   29,   28,  477,  478, 1635,
 /*   660 */   112,  463,  229, 1518,  420, 1529, 1632, 1635,  480, 1529,
 /*   670 */   480, 1175, 1368, 1393, 1393,  148, 1273,  217,  417,  291,
 /*   680 */   450,  447, 1631,   73, 1558,  466, 1560, 1561,  462, 1180,
 /*   690 */  1630, 1529, 1621, 1393,  456, 1393,  270, 1617,  131,  300,
 /*   700 */    96,   95,   94,   93,   92,   91,   90,   89,   88, 1382,
 /*   710 */    34,   32,   30,   29,   28, 1128, 1284, 1649, 1274,  453,
 /*   720 */  1283,  407,  418,   25,  275, 1169, 1170, 1171, 1172, 1173,
 /*   730 */  1177, 1178, 1179,  106,  405, 1207, 1307,  511,   71,   87,
 /*   740 */  1557, 1282,   86,   85,   84,   83,   82,   81,   80,   79,
 /*   750 */    78, 1442, 1281, 1280, 1305, 1279, 1278,  289,  398,  514,
 /*   760 */  1682, 1529, 1440,  467, 1573, 1529,   49,   48,  320, 1486,
 /*   770 */   142,  464, 1378,  136, 1277,  314,  401, 1680,  510,  509,
 /*   780 */   508,  463,  507, 1276,   47, 1529, 1529,  256, 1233,  306,
 /*   790 */  1557,  302,  298,  139, 1092, 1380, 1219, 1529, 1529,  441,
 /*   800 */  1529, 1529, 1115,   73, 1558,  466, 1560, 1561,  462, 1162,
 /*   810 */  1090, 1166, 1621,  901, 1573, 1115,  270, 1617, 1694, 1529,
 /*   820 */  1352,  464,  165,  137,  104,  163, 1101, 1655, 1529, 1098,
 /*   830 */   167,  463,  902,  166,  169, 1529,  120,  168,  171, 1557,
 /*   840 */  1210,  170, 1078, 1079, 1376,  187,  177,    9,    8,  189,
 /*   850 */  1268, 1269,  458,   73, 1558,  466, 1560, 1561,  462,  505,
 /*   860 */   102,   35, 1621, 1573, 1100, 1182,  270, 1617, 1694,  562,
 /*   870 */   464, 1286,  200,  565,  133, 1628, 1629, 1678, 1633,   35,
 /*   880 */   463, 1091,   35, 1150, 1529,  429, 1053,  221, 1557,  206,
 /*   890 */    98,  109, 1435,  208,  410,  472,  554, 1104,  550,  546,
 /*   900 */   542,  220,   73, 1558,  466, 1560, 1561,  462,  193,  110,
 /*   910 */   112, 1621, 1573,  214,  958,  270, 1617, 1694, 1093,  464,
 /*   920 */    47,  441,  377, 1651,  953, 1574, 1639,   70,  442,  463,
 /*   930 */   215,  202,  400, 1529,    2, 1103, 1113,  485,  445, 1096,
 /*   940 */  1097,  986,  295,  299,  255, 1062,  104,  408,  927, 1557,
 /*   950 */   222,  238, 1558,  466, 1560, 1561,  462,  257,  110,  111,
 /*   960 */   476,  173,  990,  997,  403,  332, 1475,  112,  110,  397,
 /*   970 */   144,  996,  113, 1573,   68,  172, 1682,  339,  346,  347,
 /*   980 */   464,  348,  102,  352,   64, 1122,  353, 1557,  423,  136,
 /*   990 */   463,  180,  149, 1680, 1529,  354,  134, 1628, 1629, 1121,
 /*  1000 */  1633,   45,  355,  152,   44, 1120, 1070,  357,  176,  155,
 /*  1010 */   356, 1573,   74, 1558,  466, 1560, 1561,  462,  464,   52,
 /*  1020 */   360, 1621, 1119,  158,  379, 1620, 1617,  381,  463, 1383,
 /*  1030 */   162, 1379, 1529,  164,   97, 1098,  265, 1557, 1514,  411,
 /*  1040 */   115,  223,  116, 1381, 1377,  117, 1557,  419,  118,  175,
 /*  1050 */    74, 1558,  466, 1560, 1561,  462,  412,  179,  421, 1621,
 /*  1060 */   182, 1573, 1118,  455, 1617,  430,  415, 1662,  461, 1661,
 /*  1070 */  1573,  422,  470,    5,  438, 1652,  427,  464,  463,  426,
 /*  1080 */  1642,  185, 1529,  192,  188,  160,  269,  463,  130,    4,
 /*  1090 */   433, 1529,  129, 1557,  376,  103,  372,  368,  364,  159,
 /*  1100 */   245, 1558,  466, 1560, 1561,  462,  460,  457, 1593,  125,
 /*  1110 */  1558,  466, 1560, 1561,  462, 1207, 1117, 1573, 1636,   37,
 /*  1120 */   271,  454,  195,  194,  464,   54,  451,   16,  157, 1602,
 /*  1130 */   473, 1484,  468,   63,  463, 1697, 1483,  469, 1529,  279,
 /*  1140 */  1679,  474,  201,  210,  212,  475,  224, 1394,   61, 1557,
 /*  1150 */   483, 1366,  446, 1695,  226,  561,   74, 1558,  466, 1560,
 /*  1160 */  1561,  462,  219,   43,  232, 1621,  228,  230, 1523,  233,
 /*  1170 */  1618,  128, 1522, 1573,  294, 1519,  296, 1557,  297, 1086,
 /*  1180 */   464, 1087,  140,  301, 1517,  156,  303,  151,  305,  153,
 /*  1190 */   463,  304, 1516,  307, 1529, 1515,  309, 1500,  141,  312,
 /*  1200 */   313, 1573, 1065, 1064, 1494, 1493,  150,  318,  464,  319,
 /*  1210 */  1492, 1491,  241, 1558,  466, 1560, 1561,  462,  463, 1036,
 /*  1220 */  1468, 1467, 1529, 1466, 1465, 1464, 1463, 1462, 1461, 1557,
 /*  1230 */  1460, 1459, 1458, 1457, 1456, 1557,  108, 1452, 1451, 1450,
 /*  1240 */   125, 1558,  466, 1560, 1561,  462, 1455, 1454, 1453,  437,
 /*  1250 */  1449, 1448, 1447, 1573, 1446, 1445, 1444, 1038, 1443, 1573,
 /*  1260 */   464, 1324, 1508, 1502, 1490, 1481,  461, 1372,  894, 1323,
 /*  1270 */   463, 1321,  154, 1319, 1529, 1317,  463,  274,  361,  362,
 /*  1280 */  1529, 1315, 1304,  365, 1696,  366, 1557,  363, 1303, 1300,
 /*  1290 */  1374,  369,  246, 1558,  466, 1560, 1561,  462,  245, 1558,
 /*  1300 */   466, 1560, 1561,  462,  370,   76, 1594, 1002,  374,  367,
 /*  1310 */  1573, 1373,  373,  371, 1557, 1005,  926,  464,  925,  375,
 /*  1320 */  1313,  924,  161,  262,  923,  920, 1308,  463,  528,  919,
 /*  1330 */   530, 1529,  263,  399,  276, 1306,  264,  402, 1573,  404,
 /*  1340 */  1298,  406,   75, 1507,   46,  464, 1299, 1072, 1501,  246,
 /*  1350 */  1558,  466, 1560, 1561,  462,  463,  413,  414,  119, 1529,
 /*  1360 */  1489, 1557,  278, 1488, 1480,   13,   56,  181,    3,   35,
 /*  1370 */   186,   41, 1557,   14,  191,   21,  126,  246, 1558,  466,
 /*  1380 */  1560, 1561,  462, 1232,   38, 1573,  190,   20,   58,   11,
 /*  1390 */  1225, 1548,  464, 1204, 1254,  178, 1573,   57,   39, 1253,
 /*  1400 */  1203,   15,  463,  464, 1259,  272, 1529,  197, 1258, 1257,
 /*  1410 */  1557,  273,  183,  463,  135,    8,   17, 1529,  138, 1152,
 /*  1420 */  1136,   27,   40,   10,  234, 1558,  466, 1560, 1561,  462,
 /*  1430 */  1151,   18, 1479,   19, 1573,  240, 1558,  466, 1560, 1561,
 /*  1440 */   462,  464,  471,  205,  204,  211,   64, 1230,  207,  209,
 /*  1450 */    59,  463,   60, 1108,   42, 1529,  484,  987, 1557,  286,
 /*  1460 */   486,  488,  482, 1167, 1557, 1547,  213,  216,  984,  489,
 /*  1470 */   964,  981,  491,  242, 1558,  466, 1560, 1561,  462,  492,
 /*  1480 */   494,  975, 1573,  495,  497,  465,  973,  979, 1573,  464,
 /*  1490 */   498,  978,  999,  977,  504,  464,   65,  995,  976,  463,
 /*  1500 */   998,   66,   67, 1529,  992,  463,  892,  515,  933, 1529,
 /*  1510 */   517,  218,  908,  915,  914, 1557,  913,  912,  911,  910,
 /*  1520 */   930,  235, 1558,  466, 1560, 1561,  462,  243, 1558,  466,
 /*  1530 */  1560, 1561,  462,  909,  928,  905,  904,  903,  900, 1573,
 /*  1540 */   899,  898,  897, 1320,  539,  540,  464, 1318,  541,  543,
 /*  1550 */   544,  545, 1316,  547,  548,  549,  463,  551,  552,  553,
 /*  1560 */  1529, 1557, 1314, 1302,  555,  556, 1301, 1297,  559,  560,
 /*  1570 */   564, 1094, 1557,  227,  563, 1272, 1272, 1272,  236, 1558,
 /*  1580 */   466, 1560, 1561,  462, 1272, 1573, 1272, 1272, 1272, 1272,
 /*  1590 */  1272, 1272,  464, 1272, 1272, 1272, 1573, 1272, 1272, 1272,
 /*  1600 */  1272, 1272,  463,  464, 1272, 1272, 1529, 1272, 1272, 1272,
 /*  1610 */  1272, 1272, 1272,  463, 1272, 1272, 1272, 1529, 1272, 1557,
 /*  1620 */  1272, 1272, 1272, 1272,  244, 1558,  466, 1560, 1561,  462,
 /*  1630 */  1272, 1272, 1272, 1272, 1272,  237, 1558,  466, 1560, 1561,
 /*  1640 */   462, 1272, 1272, 1573, 1272, 1272, 1272, 1557, 1272, 1272,
 /*  1650 */   464, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272,
 /*  1660 */   463, 1272, 1272, 1272, 1529, 1272, 1272, 1272, 1272, 1272,
 /*  1670 */  1272, 1573, 1272, 1272, 1272, 1272, 1272, 1272,  464, 1272,
 /*  1680 */  1272, 1272, 1569, 1558,  466, 1560, 1561,  462,  463, 1272,
 /*  1690 */  1272, 1272, 1529, 1272, 1272, 1272, 1557, 1272, 1272, 1272,
 /*  1700 */  1272, 1272, 1272, 1272, 1272, 1557, 1272, 1272, 1272, 1272,
 /*  1710 */  1568, 1558,  466, 1560, 1561,  462, 1272, 1272, 1272, 1272,
 /*  1720 */  1573, 1272, 1272, 1272, 1272, 1272, 1272,  464, 1272, 1573,
 /*  1730 */  1272, 1272, 1272, 1272, 1272, 1272,  464,  463, 1272, 1272,
 /*  1740 */  1272, 1529, 1272, 1272, 1272, 1272,  463, 1272, 1272, 1272,
 /*  1750 */  1529, 1557, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1567,
 /*  1760 */  1558,  466, 1560, 1561,  462, 1272, 1272, 1272,  253, 1558,
 /*  1770 */   466, 1560, 1561,  462, 1272, 1573, 1272, 1272, 1272, 1557,
 /*  1780 */  1272, 1272,  464, 1272, 1272, 1272, 1272, 1272, 1272, 1272,
 /*  1790 */  1272, 1272,  463, 1272, 1272, 1272, 1529, 1272, 1272, 1272,
 /*  1800 */  1272, 1272, 1272, 1573, 1272, 1272, 1272, 1272, 1557, 1272,
 /*  1810 */   464, 1272, 1272, 1272,  252, 1558,  466, 1560, 1561,  462,
 /*  1820 */   463, 1272, 1272, 1272, 1529, 1272, 1272, 1272, 1272, 1272,
 /*  1830 */  1272, 1272, 1573, 1272, 1272, 1272, 1557, 1272, 1272,  464,
 /*  1840 */  1272, 1272,  254, 1558,  466, 1560, 1561,  462, 1272,  463,
 /*  1850 */  1272, 1272, 1272, 1529, 1272, 1272, 1272, 1272, 1272, 1272,
 /*  1860 */  1573, 1272, 1272, 1272, 1272, 1272, 1272,  464, 1272, 1272,
 /*  1870 */  1272,  251, 1558,  466, 1560, 1561,  462,  463, 1272, 1272,
 /*  1880 */  1272, 1529, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272,
 /*  1890 */  1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272, 1272,  239,
 /*  1900 */  1558,  466, 1560, 1561,  462,
405 406
};
static const YYCODETYPE yy_lookahead[] = {
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 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597
 /*     0 */   250,  267,  250,  246,  222,  272,  295,  296,  230,  221,
 /*    10 */   253,  223,   12,   13,  228,  281,  282,  267,  255,  267,
 /*    20 */    20,  243,   22,  237,   20,  262,  263,  227,  246,  251,
 /*    30 */   244,  281,  282,  281,  282,  253,  246,  272,   38,  253,
 /*    40 */    20,  241,  252,  310,  287,  263,    0,  257,  248,  267,
 /*    50 */    50,   12,   13,   14,  222,  246,  323,   57,   49,   20,
 /*    60 */   327,   22,  228,  254,   47,   20,  310,  285,  286,  287,
 /*    70 */   288,  289,  290,   20,   74,  310,  294,   38,  246,  323,
 /*    80 */   298,  299,  300,  327,  228,  253,   38,  253,  323,   50,
 /*    90 */    73,  253,  327,   76,  312,  263,   57,   97,  260,  267,
 /*   100 */   318,  319,   12,   13,  272,   57,  272,   61,  238,  109,
 /*   110 */    20,   65,   22,   74,  258,   20,  246,  285,  286,  287,
 /*   120 */   288,  289,  290,  289,  254,  228,  294,   74,   38,  263,
 /*   130 */   298,  299,  266,   87,  237,  269,   97,  303,  304,  305,
 /*   140 */    50,  307,  310,   20,  310,   22,  146,   57,  109,  222,
 /*   150 */   253,  132,  106,  107,  108,  323,  110,  323,  138,  327,
 /*   160 */   222,  327,  231,   40,   74,   49,  235,  167,  168,  150,
 /*   170 */   170,  171,  172,  173,  174,  175,  176,  177,  178,  179,
 /*   180 */   180,  181,  182,  183,  246,  146,   52,   97,   54,  155,
 /*   190 */   156,  253,   58,  159,  267,   61,  196,   63,   64,  109,
 /*   200 */    66,  263,  222,  184,   20,  267,  167,  168,  270,  170,
 /*   210 */   171,  172,  173,  174,  175,  176,  177,  178,  179,  180,
 /*   220 */   181,  182,  183,  285,  286,  287,  288,  289,  290,   12,
 /*   230 */    13,   12,   13,   14,   15,   16,  146,   20,  230,   22,
 /*   240 */   238,  196,   12,   13,   14,   15,   16,  267,  246,  196,
 /*   250 */    12,   13,   14,   15,   16,   38,  254,  167,  168,  251,
 /*   260 */   170,  171,  172,  173,  174,  175,  176,  177,  178,  179,
 /*   270 */   180,  181,  182,  183,   57,   12,   13,   14,   20,  228,
 /*   280 */    50,    0,  145,   20,  147,   22,    0,  142,  237,   21,
 /*   290 */    74,   74,   24,   25,   26,   27,   28,   29,   30,   31,
 /*   300 */    32,   38,   86,  228,  253,   75,  161,   12,   13,   14,
 /*   310 */    15,   16,  237,   83,   97,    0,  136,   61,  246,  244,
 /*   320 */    57,   65,  225,  226,  252,  196,  109,  167,  253,  257,
 /*   330 */    49,   35,   74,  196,   14,   15,   16,   74,   52,   53,
 /*   340 */    54,   55,   56,   87,   58,   59,   60,   61,   62,   63,
 /*   350 */    64,   65,   66,   67,   68,   69,   70,   61,    1,    2,
 /*   360 */    97,   65,  132,  146,   49,  205,  206,  207,  208,  209,
 /*   370 */    75,  239,  109,   77,  242,   79,   80,  139,   82,   67,
 /*   380 */   150,  201,  202,   87,  167,  168,   20,  170,  171,  172,
 /*   390 */   173,  174,  175,  176,  177,  178,  179,  180,  181,  182,
 /*   400 */   183,  219,   12,   13,  228,    0,  232,  233,  222,  146,
 /*   410 */    20,   22,   22,  196,  184,  185,  186,  187,  188,  189,
 /*   420 */   190,  191,  192,  193,   20,  113,  114,   38,   38,  253,
 /*   430 */   167,  168,   75,  170,  171,  172,  173,  174,  175,  176,
 /*   440 */   177,  178,  179,  180,  181,  182,  183,   57,   12,   13,
 /*   450 */    12,   13,  228,  267,  272,  217,   20,   52,   22,   54,
 /*   460 */    22,  237,   85,   58,   74,  289,   61,    0,   63,   64,
 /*   470 */   227,   66,    3,  228,   38,  246,   38,  253,  302,  303,
 /*   480 */   304,  305,  237,  307,   71,  245,  257,   97,   75,   22,
 /*   490 */     2,  248,  310,   57,  222,   57,  256,  228,  253,  109,
 /*   500 */    12,   13,   14,   15,   16,  323,  237,  232,  233,  327,
 /*   510 */    74,   88,   89,   90,   91,   92,   93,   94,   95,   96,
 /*   520 */    97,   98,  253,  100,  101,  102,  103,  104,  105,   18,
 /*   530 */   222,   20,  238,   97,  228,   97,  146,   71,   27,  267,
 /*   540 */   246,   30,  138,  237,  234,  109,  236,  109,  254,  222,
 /*   550 */    39,   12,   13,   14,   15,   16,  222,  167,  168,  253,
 /*   560 */   170,  171,  172,  173,  174,  175,  176,  177,  178,  179,
 /*   570 */   180,  181,  182,  183,   71,  267,  222,  228,  232,  233,
 /*   580 */   222,  246,  146,   43,  146,    2,  237,  232,  233,   50,
 /*   590 */   194,  195,  257,   20,  267,   12,   13,   14,   15,   16,
 /*   600 */    57,  267,  253,  167,  168,  167,  170,  171,  172,  173,
 /*   610 */   174,  175,  176,  177,  178,  179,  180,  181,  182,  183,
 /*   620 */   222,  267,   83,  112,  222,  267,  115,  116,  117,  118,
 /*   630 */   119,  275,  121,  122,  123,  124,  125,  126,  127,  128,
 /*   640 */   129,  130,  131,  283,  246,   18,  222,    4,  228,  228,
 /*   650 */    23,  253,   12,   13,   14,   15,   16,  237,  237,  283,
 /*   660 */    71,  263,   35,    0,   75,  267,  306,  283,  228,  267,
 /*   670 */   228,  132,    0,  253,  253,   48,    0,  237,  228,  237,
 /*   680 */   214,  212,  306,  285,  286,  287,  288,  289,  290,  150,
 /*   690 */   306,  267,  294,  253,   50,  253,  298,  299,  300,   36,
 /*   700 */    24,   25,   26,   27,   28,   29,   30,   31,   32,  247,
 /*   710 */    12,   13,   14,   15,   16,   75,  222,  319,    0,  216,
 /*   720 */   222,   21,  272,  184,  185,  186,  187,  188,  189,  190,
 /*   730 */   191,  192,  193,   61,   34,  195,    0,   65,  111,   21,
 /*   740 */   222,  222,   24,   25,   26,   27,   28,   29,   30,   31,
 /*   750 */    32,  246,  222,  222,    0,  222,  222,  252,   22,   87,
 /*   760 */   310,  267,  257,  263,  246,  267,  139,  140,  141,  269,
 /*   770 */   143,  253,  247,  323,  222,  148,   22,  327,  106,  107,
 /*   780 */   108,  263,  110,  222,   71,  267,  267,  160,   75,  162,
 /*   790 */   222,  164,  165,  166,   22,  247,   14,  267,  267,  228,
 /*   800 */   267,  267,   20,  285,  286,  287,  288,  289,  290,   14,
 /*   810 */    38,  167,  294,   38,  246,   20,  298,  299,  300,  267,
 /*   820 */   235,  253,   78,  196,  253,   81,   38,  309,  267,   57,
 /*   830 */    78,  263,   57,   81,   78,  267,  138,   81,   78,  222,
 /*   840 */   197,   81,  157,  158,  247,   71,  247,    1,    2,   75,
 /*   850 */   181,  182,  247,  285,  286,  287,  288,  289,  290,  247,
 /*   860 */   289,   71,  294,  246,   38,   75,  298,  299,  300,   97,
 /*   870 */   253,  223,  330,   19,  303,  304,  305,  309,  307,   71,
 /*   880 */   263,  109,   71,   75,  267,  321,   75,   33,  222,   71,
 /*   890 */    36,   71,  256,   75,  279,   75,   42,  109,   44,   45,
 /*   900 */    46,   47,  285,  286,  287,  288,  289,  290,  315,   71,
 /*   910 */    71,  294,  246,   75,   75,  298,  299,  300,  146,  253,
 /*   920 */    71,  228,  225,  284,   75,  246,  309,   73,  308,  263,
 /*   930 */    76,  324,    4,  267,  311,  109,   20,   71,  272,  167,
 /*   940 */   168,   75,  228,   36,  280,  144,  253,   19,   38,  222,
 /*   950 */   273,  285,  286,  287,  288,  289,  290,  232,   71,   71,
 /*   960 */   106,   33,   75,   75,   36,  228,  228,   71,   71,   41,
 /*   970 */   120,   75,   75,  246,   74,   47,  310,  261,  259,  132,
 /*   980 */   253,  259,  289,  228,   84,   20,  277,  222,  134,  323,
 /*   990 */   263,  137,  230,  327,  267,  263,  303,  304,  305,   20,
 /*  1000 */   307,   73,  271,  230,   76,   20,  152,  264,  154,  230,
 /*  1010 */   253,  246,  285,  286,  287,  288,  289,  290,  253,  230,
 /*  1020 */   228,  294,   20,  230,  224,  298,  299,  246,  263,  246,
 /*  1030 */   246,  246,  267,  246,  228,   57,  224,  222,  267,  153,
 /*  1040 */   246,  277,  246,  246,  246,  246,  222,  271,  246,  227,
 /*  1050 */   285,  286,  287,  288,  289,  290,  276,  227,  253,  294,
 /*  1060 */   227,  246,   20,  298,  299,  204,  263,  320,  253,  320,
 /*  1070 */   246,  264,  203,  211,  210,  284,  267,  253,  263,  199,
 /*  1080 */   317,  268,  267,  316,  268,   33,  267,  263,   36,  198,
 /*  1090 */   267,  267,  314,  222,   42,  253,   44,   45,   46,   47,
 /*  1100 */   285,  286,  287,  288,  289,  290,  291,  292,  293,  285,
 /*  1110 */   286,  287,  288,  289,  290,  195,   20,  246,  283,  120,
 /*  1120 */   218,  215,  301,  313,  253,   73,  213,   74,   76,  297,
 /*  1130 */   135,  268,  267,   74,  263,  331,  268,  267,  267,  267,
 /*  1140 */   326,  265,  325,  253,  227,  264,  242,  253,  227,  222,
 /*  1150 */   249,  236,  328,  329,  228,  224,  285,  286,  287,  288,
 /*  1160 */   289,  290,  227,  274,  240,  294,  229,  220,    0,  240,
 /*  1170 */   299,  278,    0,  246,   64,    0,   38,  222,  163,   38,
 /*  1180 */   253,   38,   38,  163,    0,  133,   38,  135,  163,  137,
 /*  1190 */   263,   38,    0,   38,  267,    0,   38,    0,   74,  150,
 /*  1200 */   149,  246,  109,  146,    0,    0,  154,   53,  253,  142,
 /*  1210 */     0,    0,  285,  286,  287,  288,  289,  290,  263,   86,
 /*  1220 */     0,    0,  267,    0,    0,    0,    0,    0,    0,  222,
 /*  1230 */     0,    0,    0,    0,    0,  222,  120,    0,    0,    0,
 /*  1240 */   285,  286,  287,  288,  289,  290,    0,    0,    0,  322,
 /*  1250 */     0,    0,    0,  246,    0,    0,    0,   22,    0,  246,
 /*  1260 */   253,    0,    0,    0,    0,    0,  253,    0,   51,    0,
 /*  1270 */   263,    0,   43,    0,  267,    0,  263,  270,   38,   36,
 /*  1280 */   267,    0,    0,   38,  329,   36,  222,   43,    0,    0,
 /*  1290 */     0,   38,  285,  286,  287,  288,  289,  290,  285,  286,
 /*  1300 */   287,  288,  289,  290,   36,   83,  293,   22,   36,   43,
 /*  1310 */   246,    0,   38,   43,  222,   38,   38,  253,   38,   43,
 /*  1320 */     0,   38,   81,   22,   38,   38,    0,  263,   71,   38,
 /*  1330 */    71,  267,   22,   39,  270,    0,   22,   38,  246,   22,
 /*  1340 */     0,   22,   20,    0,  138,  253,    0,   38,    0,  285,
 /*  1350 */   286,  287,  288,  289,  290,  263,   22,  138,  151,  267,
 /*  1360 */     0,  222,  270,    0,    0,  200,   74,   43,   71,   71,
 /*  1370 */    75,   71,  222,  200,   71,   71,   74,  285,  286,  287,
 /*  1380 */   288,  289,  290,   75,  194,  246,   74,   74,    4,  200,
 /*  1390 */    75,   86,  253,   75,   38,  135,  246,   74,   71,   38,
 /*  1400 */    75,   71,  263,  253,   75,   38,  267,   86,   38,   38,
 /*  1410 */   222,   38,  133,  263,   86,    2,   71,  267,   86,   75,
 /*  1420 */    22,   74,  138,   74,  285,  286,  287,  288,  289,  290,
 /*  1430 */    75,   74,    0,   74,  246,  285,  286,  287,  288,  289,
 /*  1440 */   290,  253,  136,   75,   86,   43,   84,   75,   74,   74,
 /*  1450 */    74,  263,   74,   22,   74,  267,   38,   75,  222,   38,
 /*  1460 */    74,   38,   85,  167,  222,   86,  133,   86,   75,   74,
 /*  1470 */    22,   75,   38,  285,  286,  287,  288,  289,  290,   74,
 /*  1480 */    38,   75,  246,   74,   38,  169,   75,   99,  246,  253,
 /*  1490 */    74,   99,   38,   99,   87,  253,   74,   38,   99,  263,
 /*  1500 */   109,   74,   74,  267,   22,  263,   51,   50,   57,  267,
 /*  1510 */    72,   71,   22,   38,   38,  222,   38,   38,   38,   38,
 /*  1520 */    57,  285,  286,  287,  288,  289,  290,  285,  286,  287,
 /*  1530 */   288,  289,  290,   38,   38,   38,   38,   38,   38,  246,
 /*  1540 */    38,   38,   38,    0,   38,   36,  253,    0,   43,   38,
 /*  1550 */    36,   43,    0,   38,   36,   43,  263,   38,   36,   43,
 /*  1560 */   267,  222,    0,    0,   38,   37,    0,    0,   22,   21,
 /*  1570 */    20,   22,  222,   22,   21,  332,  332,  332,  285,  286,
 /*  1580 */   287,  288,  289,  290,  332,  246,  332,  332,  332,  332,
 /*  1590 */   332,  332,  253,  332,  332,  332,  246,  332,  332,  332,
 /*  1600 */   332,  332,  263,  253,  332,  332,  267,  332,  332,  332,
 /*  1610 */   332,  332,  332,  263,  332,  332,  332,  267,  332,  222,
 /*  1620 */   332,  332,  332,  332,  285,  286,  287,  288,  289,  290,
 /*  1630 */   332,  332,  332,  332,  332,  285,  286,  287,  288,  289,
 /*  1640 */   290,  332,  332,  246,  332,  332,  332,  222,  332,  332,
 /*  1650 */   253,  332,  332,  332,  332,  332,  332,  332,  332,  332,
 /*  1660 */   263,  332,  332,  332,  267,  332,  332,  332,  332,  332,
 /*  1670 */   332,  246,  332,  332,  332,  332,  332,  332,  253,  332,
 /*  1680 */   332,  332,  285,  286,  287,  288,  289,  290,  263,  332,
 /*  1690 */   332,  332,  267,  332,  332,  332,  222,  332,  332,  332,
 /*  1700 */   332,  332,  332,  332,  332,  222,  332,  332,  332,  332,
 /*  1710 */   285,  286,  287,  288,  289,  290,  332,  332,  332,  332,
 /*  1720 */   246,  332,  332,  332,  332,  332,  332,  253,  332,  246,
 /*  1730 */   332,  332,  332,  332,  332,  332,  253,  263,  332,  332,
 /*  1740 */   332,  267,  332,  332,  332,  332,  263,  332,  332,  332,
 /*  1750 */   267,  222,  332,  332,  332,  332,  332,  332,  332,  285,
 /*  1760 */   286,  287,  288,  289,  290,  332,  332,  332,  285,  286,
 /*  1770 */   287,  288,  289,  290,  332,  246,  332,  332,  332,  222,
 /*  1780 */   332,  332,  253,  332,  332,  332,  332,  332,  332,  332,
 /*  1790 */   332,  332,  263,  332,  332,  332,  267,  332,  332,  332,
 /*  1800 */   332,  332,  332,  246,  332,  332,  332,  332,  222,  332,
 /*  1810 */   253,  332,  332,  332,  285,  286,  287,  288,  289,  290,
 /*  1820 */   263,  332,  332,  332,  267,  332,  332,  332,  332,  332,
 /*  1830 */   332,  332,  246,  332,  332,  332,  222,  332,  332,  253,
 /*  1840 */   332,  332,  285,  286,  287,  288,  289,  290,  332,  263,
 /*  1850 */   332,  332,  332,  267,  332,  332,  332,  332,  332,  332,
 /*  1860 */   246,  332,  332,  332,  332,  332,  332,  253,  332,  332,
 /*  1870 */   332,  285,  286,  287,  288,  289,  290,  263,  332,  332,
 /*  1880 */   332,  267,  332,  332,  332,  332,  332,  332,  332,  332,
 /*  1890 */   332,  332,  332,  332,  332,  332,  332,  332,  332,  285,
 /*  1900 */   286,  287,  288,  289,  290,
598
};
599
#define YY_SHIFT_COUNT    (565)
600
#define YY_SHIFT_MIN      (0)
601
#define YY_SHIFT_MAX      (1567)
602
static const unsigned short int yy_shift_ofst[] = {
603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659
 /*     0 */   627,    0,   39,   90,   90,   90,   90,  217,   90,   90,
 /*    10 */   263,  390,  436,  390,  390,  390,  390,  390,  390,  390,
 /*    20 */   390,  390,  390,  390,  390,  390,  390,  390,  390,  390,
 /*    30 */   390,  390,  390,  390,  390,  390,   53,  258,  258,  258,
 /*    40 */    45,  438,  438,  137,    4,    4,  129,  438,    4,    4,
 /*    50 */     4,    4,    4,    4,    9,    4,   95,  184,  129,  366,
 /*    60 */    95,    4,    4,   95,    4,   95,  366,   95,   95,    4,
 /*    70 */   116,  511,  230,  539,  539,  268,  772,  296,  772,  772,
 /*    80 */   772,  772,  772,  772,  772,  772,  772,  772,  772,  772,
 /*    90 */   772,  772,  772,  772,  772,  772,  772,  134,  123,  281,
 /*   100 */    48,   48,   20,   20,   20,  315,   48,   48,  573,  366,
 /*   110 */    95,   95,   95,  377,  543,  423,  423,  423,  423,  423,
 /*   120 */   423,  423,  854,  718,  405,  238,  160,  256,   34,  180,
 /*   130 */   389,  404,  396,  540,  396,  782,  469,  643,  795,  916,
 /*   140 */   907,  910,  801,  916,  916,  850,  847,  847,  916,  965,
 /*   150 */     9,  366,  979,    9,  573,  985,    9,    9,  916,    9,
 /*   160 */  1002,   95,   95,   95,   95,   95,   95,   95,   95,   95,
 /*   170 */    95,   95,  916, 1002,  978,  965,  116,  886,  366,  979,
 /*   180 */   116,  573,  985,  116, 1042,  861,  869,  978,  861,  869,
 /*   190 */   978,  978,  862,  864,  880,  891,  920,  573, 1096,  999,
 /*   200 */   902,  906,  913, 1053,   95,  869,  978,  978,  869,  978,
 /*   210 */   995,  573,  985,  116,  377,  116,  573, 1059,  543,  916,
 /*   220 */   116, 1002, 1905, 1905, 1905, 1905, 1905, 1905,  286, 1052,
 /*   230 */   676,  928,   46,  672,  295,  488,  583,  698,  640,  219,
 /*   240 */   219,  219,  219,  219,  219,  219,  219,   17,  312,  357,
 /*   250 */    19,  320,  320,  320,  320,  663,  145,  413,  744,  752,
 /*   260 */   756,  760,  467,  736,  754,  700,  685,  589,  713,  774,
 /*   270 */   846,  669,  466,  503,  790,  644,  808,  216,  811,  818,
 /*   280 */   820,  838,  839,  788,  826,  849,  866,  887,  888,  896,
 /*   290 */   897,  900,  775, 1168, 1172, 1110, 1175, 1138, 1015, 1141,
 /*   300 */  1143, 1144, 1020, 1184, 1148, 1153, 1025, 1192, 1155, 1195,
 /*   310 */  1158, 1197, 1124, 1049, 1051, 1093, 1057, 1204, 1205, 1154,
 /*   320 */  1067, 1210, 1211, 1133, 1220, 1221, 1223, 1224, 1225, 1226,
 /*   330 */  1227, 1228, 1230, 1231, 1232, 1233, 1234, 1246, 1247, 1248,
 /*   340 */  1116, 1237, 1238, 1239, 1250, 1251, 1252, 1235, 1254, 1255,
 /*   350 */  1256, 1258, 1261, 1262, 1263, 1264, 1265, 1229, 1267, 1217,
 /*   360 */  1269, 1271, 1240, 1243, 1244, 1273, 1245, 1249, 1266, 1275,
 /*   370 */  1253, 1268, 1270, 1281, 1274, 1272, 1276, 1282, 1288, 1289,
 /*   380 */  1290, 1222, 1241, 1277, 1257, 1259, 1285, 1311, 1278, 1280,
 /*   390 */  1283, 1286, 1257, 1259, 1287, 1291, 1320, 1301, 1326, 1310,
 /*   400 */  1294, 1335, 1314, 1299, 1346, 1317, 1340, 1319, 1322, 1343,
 /*   410 */  1206, 1309, 1348, 1207, 1334, 1219, 1260, 1360, 1363, 1284,
 /*   420 */  1364, 1292, 1324, 1279, 1297, 1298, 1165, 1295, 1300, 1308,
 /*   430 */  1302, 1312, 1313, 1315, 1303, 1305, 1323, 1304, 1173, 1318,
 /*   440 */  1325, 1321, 1190, 1327, 1328, 1329, 1330, 1189, 1384, 1356,
 /*   450 */  1361, 1367, 1370, 1371, 1373, 1413, 1296, 1345, 1344, 1347,
 /*   460 */  1355, 1332, 1349, 1357, 1358, 1398, 1316, 1359, 1368, 1372,
 /*   470 */  1374, 1375, 1306, 1376, 1432, 1402, 1333, 1378, 1362, 1379,
 /*   480 */  1381, 1431, 1380, 1377, 1382, 1418, 1421, 1386, 1393, 1423,
 /*   490 */  1395, 1396, 1434, 1405, 1406, 1442, 1409, 1411, 1446, 1416,
 /*   500 */  1388, 1392, 1394, 1399, 1448, 1407, 1422, 1454, 1391, 1427,
 /*   510 */  1428, 1459, 1257, 1259, 1482, 1455, 1457, 1451, 1438, 1440,
 /*   520 */  1475, 1476, 1478, 1479, 1480, 1481, 1495, 1490, 1463, 1257,
 /*   530 */  1496, 1259, 1497, 1498, 1499, 1500, 1502, 1503, 1504, 1543,
 /*   540 */  1506, 1509, 1505, 1547, 1511, 1514, 1508, 1552, 1515, 1518,
 /*   550 */  1512, 1562, 1519, 1522, 1516, 1563, 1526, 1528, 1566, 1567,
 /*   560 */  1546, 1548, 1549, 1551, 1553, 1550,
660
};
661 662 663
#define YY_REDUCE_COUNT (227)
#define YY_REDUCE_MIN   (-289)
#define YY_REDUCE_MAX   (1614)
664
static const short yy_reduce_ofst[] = {
665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687
 /*     0 */   182, -168, -218,  398,  518,  568,  617,  666,  727,  765,
 /*    10 */   815,  824,  871,  -62,  927,  955, 1007, 1013, 1064, 1092,
 /*    20 */  1139, 1150, 1188, 1236, 1242, 1293, 1339, 1350, 1397, 1425,
 /*    30 */  1474, 1483, 1529, 1557, 1586, 1614, -166,  176,  571,  693,
 /*    40 */   450, -250, -248, -267, -214,   75, -235, -266, -103,   51,
 /*    50 */   224,  245,  269,  306, -222,  349, -210, -243, -244, -134,
 /*    60 */  -130,  420,  421,   72,  440,    2, -237,  505,  294,  442,
 /*    70 */  -200, -144, -289, -289, -289, -212,  -73,  240,  -20,  186,
 /*    80 */   272,  308,  327,  334,  354,  358,  402,  424,  494,  498,
 /*    90 */   519,  530,  531,  533,  534,  552,  561,  -69,   97,    8,
 /*   100 */   174,  275,  360,  376,  384,  243,  346,  355, -162,  500,
 /*   110 */  -191,  229,  335,  132,  310,  462,  525,  548,  597,  599,
 /*   120 */   605,  612,  356,  648,  585,  542,  564,  636,  615,  593,
 /*   130 */   697,  639,  620,  620,  620,  679,  607,  623,  679,  714,
 /*   140 */   664,  725,  677,  737,  738,  716,  719,  722,  755,  709,
 /*   150 */   762,  732,  731,  773,  757,  743,  779,  789,  792,  793,
 /*   160 */   800,  781,  783,  784,  785,  787,  794,  796,  797,  798,
 /*   170 */   799,  802,  806,  812,  771,  764,  822,  780,  803,  776,
 /*   180 */   830,  805,  807,  833,  791,  747,  813,  809,  749,  816,
 /*   190 */   819,  823,  763,  767,  778,  810,  620,  842,  835,  821,
 /*   200 */   804,  814,  817,  832,  679,  863,  865,  870,  868,  872,
 /*   210 */   876,  890,  881,  917,  904,  921,  894,  901,  915,  926,
 /*   220 */   935,  931,  889,  893,  924,  929,  937,  947,
688 689
};
static const YYACTIONTYPE yy_default[] = {
690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 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
 /*     0 */  1270, 1270, 1270, 1270, 1270, 1270, 1270, 1270, 1270, 1270,
 /*    10 */  1270, 1270, 1270, 1270, 1270, 1270, 1270, 1270, 1270, 1270,
 /*    20 */  1270, 1270, 1270, 1270, 1270, 1270, 1270, 1270, 1270, 1270,
 /*    30 */  1270, 1270, 1270, 1270, 1270, 1270, 1270, 1270, 1270, 1270,
 /*    40 */  1270, 1270, 1270, 1270, 1270, 1270, 1270, 1270, 1270, 1270,
 /*    50 */  1270, 1270, 1270, 1270, 1329, 1270, 1270, 1270, 1270, 1270,
 /*    60 */  1270, 1270, 1270, 1270, 1270, 1270, 1270, 1270, 1270, 1270,
 /*    70 */  1327, 1469, 1270, 1623, 1270, 1270, 1270, 1270, 1270, 1270,
 /*    80 */  1270, 1270, 1270, 1270, 1270, 1270, 1270, 1270, 1270, 1270,
 /*    90 */  1270, 1270, 1270, 1270, 1270, 1270, 1270, 1270, 1270, 1329,
 /*   100 */  1270, 1270, 1634, 1634, 1634, 1327, 1270, 1270, 1270, 1270,
 /*   110 */  1270, 1270, 1270, 1422, 1270, 1270, 1270, 1270, 1270, 1270,
 /*   120 */  1270, 1270, 1503, 1270, 1270, 1698, 1270, 1375, 1509, 1658,
 /*   130 */  1270, 1650, 1626, 1640, 1627, 1270, 1683, 1643, 1270, 1270,
 /*   140 */  1270, 1270, 1495, 1270, 1270, 1474, 1471, 1471, 1270, 1270,
 /*   150 */  1329, 1270, 1270, 1329, 1270, 1270, 1329, 1329, 1270, 1329,
 /*   160 */  1270, 1270, 1270, 1270, 1270, 1270, 1270, 1270, 1270, 1270,
 /*   170 */  1270, 1270, 1270, 1270, 1270, 1270, 1327, 1505, 1270, 1270,
 /*   180 */  1327, 1270, 1270, 1327, 1270, 1665, 1663, 1270, 1665, 1663,
 /*   190 */  1270, 1270, 1677, 1673, 1656, 1654, 1640, 1270, 1270, 1270,
 /*   200 */  1701, 1689, 1685, 1270, 1270, 1663, 1270, 1270, 1663, 1270,
 /*   210 */  1482, 1270, 1270, 1327, 1270, 1327, 1270, 1391, 1270, 1270,
 /*   220 */  1327, 1270, 1497, 1511, 1425, 1425, 1330, 1275, 1270, 1270,
 /*   230 */  1270, 1270, 1270, 1270, 1270, 1270, 1270, 1270, 1270, 1572,
 /*   240 */  1676, 1675, 1599, 1598, 1597, 1595, 1571, 1270, 1270, 1270,
 /*   250 */  1270, 1565, 1566, 1564, 1563, 1270, 1270, 1270, 1270, 1270,
 /*   260 */  1270, 1270, 1270, 1270, 1270, 1270, 1270, 1270, 1270, 1270,
 /*   270 */  1624, 1270, 1686, 1690, 1270, 1270, 1270, 1549, 1270, 1270,
 /*   280 */  1270, 1270, 1270, 1270, 1270, 1270, 1270, 1270, 1270, 1270,
 /*   290 */  1270, 1270, 1270, 1270, 1270, 1270, 1270, 1270, 1270, 1270,
 /*   300 */  1270, 1270, 1270, 1270, 1270, 1270, 1270, 1270, 1270, 1270,
 /*   310 */  1270, 1270, 1270, 1270, 1270, 1270, 1270, 1270, 1270, 1270,
 /*   320 */  1270, 1270, 1270, 1270, 1270, 1270, 1270, 1270, 1270, 1270,
 /*   330 */  1270, 1270, 1270, 1270, 1270, 1270, 1270, 1270, 1270, 1270,
 /*   340 */  1270, 1270, 1270, 1270, 1270, 1270, 1270, 1270, 1270, 1270,
 /*   350 */  1270, 1270, 1270, 1270, 1270, 1270, 1270, 1270, 1270, 1270,
 /*   360 */  1270, 1270, 1270, 1270, 1270, 1270, 1270, 1270, 1270, 1270,
 /*   370 */  1270, 1270, 1270, 1270, 1270, 1270, 1270, 1270, 1270, 1270,
 /*   380 */  1270, 1270, 1270, 1270, 1438, 1437, 1270, 1270, 1270, 1270,
 /*   390 */  1270, 1270, 1356, 1355, 1270, 1270, 1270, 1270, 1270, 1270,
 /*   400 */  1270, 1270, 1270, 1270, 1270, 1270, 1270, 1270, 1270, 1270,
 /*   410 */  1270, 1270, 1270, 1270, 1270, 1270, 1270, 1270, 1270, 1270,
 /*   420 */  1270, 1270, 1270, 1270, 1647, 1657, 1270, 1270, 1270, 1270,
 /*   430 */  1270, 1270, 1270, 1270, 1270, 1549, 1270, 1674, 1270, 1633,
 /*   440 */  1629, 1270, 1270, 1625, 1270, 1270, 1684, 1270, 1270, 1270,
 /*   450 */  1270, 1270, 1270, 1270, 1270, 1619, 1270, 1592, 1270, 1270,
 /*   460 */  1270, 1270, 1270, 1270, 1270, 1270, 1559, 1270, 1270, 1270,
 /*   470 */  1270, 1270, 1270, 1270, 1270, 1270, 1270, 1270, 1270, 1548,
 /*   480 */  1270, 1270, 1270, 1270, 1270, 1270, 1270, 1419, 1270, 1270,
 /*   490 */  1270, 1270, 1270, 1270, 1270, 1270, 1270, 1270, 1270, 1270,
 /*   500 */  1404, 1402, 1401, 1400, 1270, 1397, 1270, 1270, 1270, 1270,
 /*   510 */  1270, 1270, 1428, 1427, 1270, 1270, 1270, 1270, 1270, 1350,
 /*   520 */  1270, 1270, 1270, 1270, 1270, 1270, 1270, 1270, 1270, 1341,
 /*   530 */  1270, 1340, 1270, 1270, 1270, 1270, 1270, 1270, 1270, 1270,
 /*   540 */  1270, 1270, 1270, 1270, 1270, 1270, 1270, 1270, 1270, 1270,
 /*   550 */  1270, 1270, 1270, 1270, 1270, 1270, 1270, 1270, 1270, 1270,
 /*   560 */  1270, 1270, 1270, 1270, 1270, 1270,
747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803
};
/********** 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[] = {
};
#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 已提交
804 805
  ParseARG_SDECL                /* A place to hold %extra_argument */
  ParseCTX_SDECL                /* A place to hold %extra_context */
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
#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 已提交
841
void ParseTrace(FILE *TraceFILE, char *zTracePrompt){
842 843 844 845 846 847 848 849 850 851 852 853
  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 */ "$",
854 855
  /*    1 */ "OR",
  /*    2 */ "AND",
856 857 858 859 860
  /*    3 */ "UNION",
  /*    4 */ "ALL",
  /*    5 */ "MINUS",
  /*    6 */ "EXCEPT",
  /*    7 */ "INTERSECT",
861 862 863 864 865 866 867 868 869 870
  /*    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",
871
  /*   18 */ "CREATE",
872 873 874
  /*   19 */ "ACCOUNT",
  /*   20 */ "NK_ID",
  /*   21 */ "PASS",
875 876 877 878 879 880 881 882 883 884 885 886
  /*   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",
887 888
  /*   34 */ "PRIVILEGE",
  /*   35 */ "DROP",
X
Xiaoyu Wang 已提交
889 890 891 892 893 894 895 896
  /*   36 */ "DNODE",
  /*   37 */ "PORT",
  /*   38 */ "NK_INTEGER",
  /*   39 */ "DNODES",
  /*   40 */ "NK_IPTOKEN",
  /*   41 */ "LOCAL",
  /*   42 */ "QNODE",
  /*   43 */ "ON",
897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977
  /*   44 */ "BNODE",
  /*   45 */ "SNODE",
  /*   46 */ "MNODE",
  /*   47 */ "DATABASE",
  /*   48 */ "USE",
  /*   49 */ "IF",
  /*   50 */ "NOT",
  /*   51 */ "EXISTS",
  /*   52 */ "BLOCKS",
  /*   53 */ "CACHE",
  /*   54 */ "CACHELAST",
  /*   55 */ "COMP",
  /*   56 */ "DAYS",
  /*   57 */ "NK_VARIABLE",
  /*   58 */ "FSYNC",
  /*   59 */ "MAXROWS",
  /*   60 */ "MINROWS",
  /*   61 */ "KEEP",
  /*   62 */ "PRECISION",
  /*   63 */ "QUORUM",
  /*   64 */ "REPLICA",
  /*   65 */ "TTL",
  /*   66 */ "WAL",
  /*   67 */ "VGROUPS",
  /*   68 */ "SINGLE_STABLE",
  /*   69 */ "STREAM_MODE",
  /*   70 */ "RETENTIONS",
  /*   71 */ "NK_COMMA",
  /*   72 */ "NK_COLON",
  /*   73 */ "TABLE",
  /*   74 */ "NK_LP",
  /*   75 */ "NK_RP",
  /*   76 */ "STABLE",
  /*   77 */ "ADD",
  /*   78 */ "COLUMN",
  /*   79 */ "MODIFY",
  /*   80 */ "RENAME",
  /*   81 */ "TAG",
  /*   82 */ "SET",
  /*   83 */ "NK_EQ",
  /*   84 */ "USING",
  /*   85 */ "TAGS",
  /*   86 */ "NK_DOT",
  /*   87 */ "COMMENT",
  /*   88 */ "BOOL",
  /*   89 */ "TINYINT",
  /*   90 */ "SMALLINT",
  /*   91 */ "INT",
  /*   92 */ "INTEGER",
  /*   93 */ "BIGINT",
  /*   94 */ "FLOAT",
  /*   95 */ "DOUBLE",
  /*   96 */ "BINARY",
  /*   97 */ "TIMESTAMP",
  /*   98 */ "NCHAR",
  /*   99 */ "UNSIGNED",
  /*  100 */ "JSON",
  /*  101 */ "VARCHAR",
  /*  102 */ "MEDIUMBLOB",
  /*  103 */ "BLOB",
  /*  104 */ "VARBINARY",
  /*  105 */ "DECIMAL",
  /*  106 */ "SMA",
  /*  107 */ "ROLLUP",
  /*  108 */ "FILE_FACTOR",
  /*  109 */ "NK_FLOAT",
  /*  110 */ "DELAY",
  /*  111 */ "SHOW",
  /*  112 */ "DATABASES",
  /*  113 */ "TABLES",
  /*  114 */ "STABLES",
  /*  115 */ "MNODES",
  /*  116 */ "MODULES",
  /*  117 */ "QNODES",
  /*  118 */ "FUNCTIONS",
  /*  119 */ "INDEXES",
  /*  120 */ "FROM",
  /*  121 */ "ACCOUNTS",
  /*  122 */ "APPS",
  /*  123 */ "CONNECTIONS",
  /*  124 */ "LICENCE",
978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008
  /*  125 */ "GRANTS",
  /*  126 */ "QUERIES",
  /*  127 */ "SCORES",
  /*  128 */ "TOPICS",
  /*  129 */ "VARIABLES",
  /*  130 */ "BNODES",
  /*  131 */ "SNODES",
  /*  132 */ "LIKE",
  /*  133 */ "INDEX",
  /*  134 */ "FULLTEXT",
  /*  135 */ "FUNCTION",
  /*  136 */ "INTERVAL",
  /*  137 */ "TOPIC",
  /*  138 */ "AS",
  /*  139 */ "DESC",
  /*  140 */ "DESCRIBE",
  /*  141 */ "RESET",
  /*  142 */ "QUERY",
  /*  143 */ "EXPLAIN",
  /*  144 */ "ANALYZE",
  /*  145 */ "VERBOSE",
  /*  146 */ "NK_BOOL",
  /*  147 */ "RATIO",
  /*  148 */ "COMPACT",
  /*  149 */ "VNODES",
  /*  150 */ "IN",
  /*  151 */ "OUTPUTTYPE",
  /*  152 */ "AGGREGATE",
  /*  153 */ "BUFSIZE",
  /*  154 */ "STREAM",
  /*  155 */ "INTO",
1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 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 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184
  /*  156 */ "TRIGGER",
  /*  157 */ "AT_ONCE",
  /*  158 */ "WINDOW_CLOSE",
  /*  159 */ "WATERMARK",
  /*  160 */ "KILL",
  /*  161 */ "CONNECTION",
  /*  162 */ "MERGE",
  /*  163 */ "VGROUP",
  /*  164 */ "REDISTRIBUTE",
  /*  165 */ "SPLIT",
  /*  166 */ "SYNCDB",
  /*  167 */ "NULL",
  /*  168 */ "NK_QUESTION",
  /*  169 */ "NK_ARROW",
  /*  170 */ "NOW",
  /*  171 */ "TODAY",
  /*  172 */ "ROWTS",
  /*  173 */ "TBNAME",
  /*  174 */ "QSTARTTS",
  /*  175 */ "QENDTS",
  /*  176 */ "WSTARTTS",
  /*  177 */ "WENDTS",
  /*  178 */ "WDURATION",
  /*  179 */ "CAST",
  /*  180 */ "COUNT",
  /*  181 */ "FIRST",
  /*  182 */ "LAST",
  /*  183 */ "LAST_ROW",
  /*  184 */ "BETWEEN",
  /*  185 */ "IS",
  /*  186 */ "NK_LT",
  /*  187 */ "NK_GT",
  /*  188 */ "NK_LE",
  /*  189 */ "NK_GE",
  /*  190 */ "NK_NE",
  /*  191 */ "MATCH",
  /*  192 */ "NMATCH",
  /*  193 */ "CONTAINS",
  /*  194 */ "JOIN",
  /*  195 */ "INNER",
  /*  196 */ "SELECT",
  /*  197 */ "DISTINCT",
  /*  198 */ "WHERE",
  /*  199 */ "PARTITION",
  /*  200 */ "BY",
  /*  201 */ "SESSION",
  /*  202 */ "STATE_WINDOW",
  /*  203 */ "SLIDING",
  /*  204 */ "FILL",
  /*  205 */ "VALUE",
  /*  206 */ "NONE",
  /*  207 */ "PREV",
  /*  208 */ "LINEAR",
  /*  209 */ "NEXT",
  /*  210 */ "GROUP",
  /*  211 */ "HAVING",
  /*  212 */ "ORDER",
  /*  213 */ "SLIMIT",
  /*  214 */ "SOFFSET",
  /*  215 */ "LIMIT",
  /*  216 */ "OFFSET",
  /*  217 */ "ASC",
  /*  218 */ "NULLS",
  /*  219 */ "cmd",
  /*  220 */ "account_options",
  /*  221 */ "alter_account_options",
  /*  222 */ "literal",
  /*  223 */ "alter_account_option",
  /*  224 */ "user_name",
  /*  225 */ "dnode_endpoint",
  /*  226 */ "dnode_host_name",
  /*  227 */ "not_exists_opt",
  /*  228 */ "db_name",
  /*  229 */ "db_options",
  /*  230 */ "exists_opt",
  /*  231 */ "alter_db_options",
  /*  232 */ "integer_list",
  /*  233 */ "variable_list",
  /*  234 */ "retention_list",
  /*  235 */ "alter_db_option",
  /*  236 */ "retention",
  /*  237 */ "full_table_name",
  /*  238 */ "column_def_list",
  /*  239 */ "tags_def_opt",
  /*  240 */ "table_options",
  /*  241 */ "multi_create_clause",
  /*  242 */ "tags_def",
  /*  243 */ "multi_drop_clause",
  /*  244 */ "alter_table_clause",
  /*  245 */ "alter_table_options",
  /*  246 */ "column_name",
  /*  247 */ "type_name",
  /*  248 */ "create_subtable_clause",
  /*  249 */ "specific_tags_opt",
  /*  250 */ "literal_list",
  /*  251 */ "drop_table_clause",
  /*  252 */ "col_name_list",
  /*  253 */ "table_name",
  /*  254 */ "column_def",
  /*  255 */ "func_name_list",
  /*  256 */ "alter_table_option",
  /*  257 */ "col_name",
  /*  258 */ "db_name_cond_opt",
  /*  259 */ "like_pattern_opt",
  /*  260 */ "table_name_cond",
  /*  261 */ "from_db_opt",
  /*  262 */ "func_name",
  /*  263 */ "function_name",
  /*  264 */ "index_name",
  /*  265 */ "index_options",
  /*  266 */ "func_list",
  /*  267 */ "duration_literal",
  /*  268 */ "sliding_opt",
  /*  269 */ "func",
  /*  270 */ "expression_list",
  /*  271 */ "topic_name",
  /*  272 */ "query_expression",
  /*  273 */ "analyze_opt",
  /*  274 */ "explain_options",
  /*  275 */ "agg_func_opt",
  /*  276 */ "bufsize_opt",
  /*  277 */ "stream_name",
  /*  278 */ "stream_options",
  /*  279 */ "into_opt",
  /*  280 */ "dnode_list",
  /*  281 */ "signed",
  /*  282 */ "signed_literal",
  /*  283 */ "table_alias",
  /*  284 */ "column_alias",
  /*  285 */ "expression",
  /*  286 */ "pseudo_column",
  /*  287 */ "column_reference",
  /*  288 */ "function_expression",
  /*  289 */ "subquery",
  /*  290 */ "star_func",
  /*  291 */ "star_func_para_list",
  /*  292 */ "other_para_list",
  /*  293 */ "star_func_para",
  /*  294 */ "predicate",
  /*  295 */ "compare_op",
  /*  296 */ "in_op",
  /*  297 */ "in_predicate_value",
  /*  298 */ "boolean_value_expression",
  /*  299 */ "boolean_primary",
  /*  300 */ "common_expression",
  /*  301 */ "from_clause",
  /*  302 */ "table_reference_list",
  /*  303 */ "table_reference",
  /*  304 */ "table_primary",
  /*  305 */ "joined_table",
  /*  306 */ "alias_opt",
  /*  307 */ "parenthesized_joined_table",
  /*  308 */ "join_type",
  /*  309 */ "search_condition",
  /*  310 */ "query_specification",
  /*  311 */ "set_quantifier_opt",
  /*  312 */ "select_list",
  /*  313 */ "where_clause_opt",
  /*  314 */ "partition_by_clause_opt",
  /*  315 */ "twindow_clause_opt",
  /*  316 */ "group_by_clause_opt",
  /*  317 */ "having_clause_opt",
  /*  318 */ "select_sublist",
  /*  319 */ "select_item",
  /*  320 */ "fill_opt",
  /*  321 */ "fill_mode",
  /*  322 */ "group_by_list",
  /*  323 */ "query_expression_body",
  /*  324 */ "order_by_clause_opt",
  /*  325 */ "slimit_clause_opt",
  /*  326 */ "limit_clause_opt",
  /*  327 */ "query_primary",
  /*  328 */ "sort_specification_list",
  /*  329 */ "sort_specification",
  /*  330 */ "ordering_specification_opt",
  /*  331 */ "null_ordering_opt",
1185 1186 1187 1188 1189 1190 1191
};
#endif /* defined(YYCOVERAGE) || !defined(NDEBUG) */

#ifndef NDEBUG
/* For tracing reduce actions, the names of all rules are required.
*/
static const char *const yyRuleName[] = {
1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219
 /*   0 */ "cmd ::= CREATE ACCOUNT NK_ID PASS NK_STRING account_options",
 /*   1 */ "cmd ::= ALTER ACCOUNT NK_ID alter_account_options",
 /*   2 */ "account_options ::=",
 /*   3 */ "account_options ::= account_options PPS literal",
 /*   4 */ "account_options ::= account_options TSERIES literal",
 /*   5 */ "account_options ::= account_options STORAGE literal",
 /*   6 */ "account_options ::= account_options STREAMS literal",
 /*   7 */ "account_options ::= account_options QTIME literal",
 /*   8 */ "account_options ::= account_options DBS literal",
 /*   9 */ "account_options ::= account_options USERS literal",
 /*  10 */ "account_options ::= account_options CONNS literal",
 /*  11 */ "account_options ::= account_options STATE literal",
 /*  12 */ "alter_account_options ::= alter_account_option",
 /*  13 */ "alter_account_options ::= alter_account_options alter_account_option",
 /*  14 */ "alter_account_option ::= PASS literal",
 /*  15 */ "alter_account_option ::= PPS literal",
 /*  16 */ "alter_account_option ::= TSERIES literal",
 /*  17 */ "alter_account_option ::= STORAGE literal",
 /*  18 */ "alter_account_option ::= STREAMS literal",
 /*  19 */ "alter_account_option ::= QTIME literal",
 /*  20 */ "alter_account_option ::= DBS literal",
 /*  21 */ "alter_account_option ::= USERS literal",
 /*  22 */ "alter_account_option ::= CONNS literal",
 /*  23 */ "alter_account_option ::= STATE literal",
 /*  24 */ "cmd ::= CREATE USER user_name PASS NK_STRING",
 /*  25 */ "cmd ::= ALTER USER user_name PASS NK_STRING",
 /*  26 */ "cmd ::= ALTER USER user_name PRIVILEGE NK_STRING",
 /*  27 */ "cmd ::= DROP USER user_name",
X
Xiaoyu Wang 已提交
1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234
 /*  28 */ "cmd ::= CREATE DNODE dnode_endpoint",
 /*  29 */ "cmd ::= CREATE DNODE dnode_host_name PORT NK_INTEGER",
 /*  30 */ "cmd ::= DROP DNODE NK_INTEGER",
 /*  31 */ "cmd ::= DROP DNODE dnode_endpoint",
 /*  32 */ "cmd ::= ALTER DNODE NK_INTEGER NK_STRING",
 /*  33 */ "cmd ::= ALTER DNODE NK_INTEGER NK_STRING NK_STRING",
 /*  34 */ "cmd ::= ALTER ALL DNODES NK_STRING",
 /*  35 */ "cmd ::= ALTER ALL DNODES NK_STRING NK_STRING",
 /*  36 */ "dnode_endpoint ::= NK_STRING",
 /*  37 */ "dnode_host_name ::= NK_ID",
 /*  38 */ "dnode_host_name ::= NK_IPTOKEN",
 /*  39 */ "cmd ::= ALTER LOCAL NK_STRING",
 /*  40 */ "cmd ::= ALTER LOCAL NK_STRING NK_STRING",
 /*  41 */ "cmd ::= CREATE QNODE ON DNODE NK_INTEGER",
 /*  42 */ "cmd ::= DROP QNODE ON DNODE NK_INTEGER",
1235 1236 1237 1238 1239 1240 1241 1242 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 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346
 /*  43 */ "cmd ::= CREATE BNODE ON DNODE NK_INTEGER",
 /*  44 */ "cmd ::= DROP BNODE ON DNODE NK_INTEGER",
 /*  45 */ "cmd ::= CREATE SNODE ON DNODE NK_INTEGER",
 /*  46 */ "cmd ::= DROP SNODE ON DNODE NK_INTEGER",
 /*  47 */ "cmd ::= CREATE MNODE ON DNODE NK_INTEGER",
 /*  48 */ "cmd ::= DROP MNODE ON DNODE NK_INTEGER",
 /*  49 */ "cmd ::= CREATE DATABASE not_exists_opt db_name db_options",
 /*  50 */ "cmd ::= DROP DATABASE exists_opt db_name",
 /*  51 */ "cmd ::= USE db_name",
 /*  52 */ "cmd ::= ALTER DATABASE db_name alter_db_options",
 /*  53 */ "not_exists_opt ::= IF NOT EXISTS",
 /*  54 */ "not_exists_opt ::=",
 /*  55 */ "exists_opt ::= IF EXISTS",
 /*  56 */ "exists_opt ::=",
 /*  57 */ "db_options ::=",
 /*  58 */ "db_options ::= db_options BLOCKS NK_INTEGER",
 /*  59 */ "db_options ::= db_options CACHE NK_INTEGER",
 /*  60 */ "db_options ::= db_options CACHELAST NK_INTEGER",
 /*  61 */ "db_options ::= db_options COMP NK_INTEGER",
 /*  62 */ "db_options ::= db_options DAYS NK_INTEGER",
 /*  63 */ "db_options ::= db_options DAYS NK_VARIABLE",
 /*  64 */ "db_options ::= db_options FSYNC NK_INTEGER",
 /*  65 */ "db_options ::= db_options MAXROWS NK_INTEGER",
 /*  66 */ "db_options ::= db_options MINROWS NK_INTEGER",
 /*  67 */ "db_options ::= db_options KEEP integer_list",
 /*  68 */ "db_options ::= db_options KEEP variable_list",
 /*  69 */ "db_options ::= db_options PRECISION NK_STRING",
 /*  70 */ "db_options ::= db_options QUORUM NK_INTEGER",
 /*  71 */ "db_options ::= db_options REPLICA NK_INTEGER",
 /*  72 */ "db_options ::= db_options TTL NK_INTEGER",
 /*  73 */ "db_options ::= db_options WAL NK_INTEGER",
 /*  74 */ "db_options ::= db_options VGROUPS NK_INTEGER",
 /*  75 */ "db_options ::= db_options SINGLE_STABLE NK_INTEGER",
 /*  76 */ "db_options ::= db_options STREAM_MODE NK_INTEGER",
 /*  77 */ "db_options ::= db_options RETENTIONS retention_list",
 /*  78 */ "alter_db_options ::= alter_db_option",
 /*  79 */ "alter_db_options ::= alter_db_options alter_db_option",
 /*  80 */ "alter_db_option ::= BLOCKS NK_INTEGER",
 /*  81 */ "alter_db_option ::= FSYNC NK_INTEGER",
 /*  82 */ "alter_db_option ::= KEEP integer_list",
 /*  83 */ "alter_db_option ::= KEEP variable_list",
 /*  84 */ "alter_db_option ::= WAL NK_INTEGER",
 /*  85 */ "alter_db_option ::= QUORUM NK_INTEGER",
 /*  86 */ "alter_db_option ::= CACHELAST NK_INTEGER",
 /*  87 */ "alter_db_option ::= REPLICA NK_INTEGER",
 /*  88 */ "integer_list ::= NK_INTEGER",
 /*  89 */ "integer_list ::= integer_list NK_COMMA NK_INTEGER",
 /*  90 */ "variable_list ::= NK_VARIABLE",
 /*  91 */ "variable_list ::= variable_list NK_COMMA NK_VARIABLE",
 /*  92 */ "retention_list ::= retention",
 /*  93 */ "retention_list ::= retention_list NK_COMMA retention",
 /*  94 */ "retention ::= NK_VARIABLE NK_COLON NK_VARIABLE",
 /*  95 */ "cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options",
 /*  96 */ "cmd ::= CREATE TABLE multi_create_clause",
 /*  97 */ "cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options",
 /*  98 */ "cmd ::= DROP TABLE multi_drop_clause",
 /*  99 */ "cmd ::= DROP STABLE exists_opt full_table_name",
 /* 100 */ "cmd ::= ALTER TABLE alter_table_clause",
 /* 101 */ "cmd ::= ALTER STABLE alter_table_clause",
 /* 102 */ "alter_table_clause ::= full_table_name alter_table_options",
 /* 103 */ "alter_table_clause ::= full_table_name ADD COLUMN column_name type_name",
 /* 104 */ "alter_table_clause ::= full_table_name DROP COLUMN column_name",
 /* 105 */ "alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name",
 /* 106 */ "alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name",
 /* 107 */ "alter_table_clause ::= full_table_name ADD TAG column_name type_name",
 /* 108 */ "alter_table_clause ::= full_table_name DROP TAG column_name",
 /* 109 */ "alter_table_clause ::= full_table_name MODIFY TAG column_name type_name",
 /* 110 */ "alter_table_clause ::= full_table_name RENAME TAG column_name column_name",
 /* 111 */ "alter_table_clause ::= full_table_name SET TAG column_name NK_EQ literal",
 /* 112 */ "multi_create_clause ::= create_subtable_clause",
 /* 113 */ "multi_create_clause ::= multi_create_clause create_subtable_clause",
 /* 114 */ "create_subtable_clause ::= not_exists_opt full_table_name USING full_table_name specific_tags_opt TAGS NK_LP literal_list NK_RP",
 /* 115 */ "multi_drop_clause ::= drop_table_clause",
 /* 116 */ "multi_drop_clause ::= multi_drop_clause drop_table_clause",
 /* 117 */ "drop_table_clause ::= exists_opt full_table_name",
 /* 118 */ "specific_tags_opt ::=",
 /* 119 */ "specific_tags_opt ::= NK_LP col_name_list NK_RP",
 /* 120 */ "full_table_name ::= table_name",
 /* 121 */ "full_table_name ::= db_name NK_DOT table_name",
 /* 122 */ "column_def_list ::= column_def",
 /* 123 */ "column_def_list ::= column_def_list NK_COMMA column_def",
 /* 124 */ "column_def ::= column_name type_name",
 /* 125 */ "column_def ::= column_name type_name COMMENT NK_STRING",
 /* 126 */ "type_name ::= BOOL",
 /* 127 */ "type_name ::= TINYINT",
 /* 128 */ "type_name ::= SMALLINT",
 /* 129 */ "type_name ::= INT",
 /* 130 */ "type_name ::= INTEGER",
 /* 131 */ "type_name ::= BIGINT",
 /* 132 */ "type_name ::= FLOAT",
 /* 133 */ "type_name ::= DOUBLE",
 /* 134 */ "type_name ::= BINARY NK_LP NK_INTEGER NK_RP",
 /* 135 */ "type_name ::= TIMESTAMP",
 /* 136 */ "type_name ::= NCHAR NK_LP NK_INTEGER NK_RP",
 /* 137 */ "type_name ::= TINYINT UNSIGNED",
 /* 138 */ "type_name ::= SMALLINT UNSIGNED",
 /* 139 */ "type_name ::= INT UNSIGNED",
 /* 140 */ "type_name ::= BIGINT UNSIGNED",
 /* 141 */ "type_name ::= JSON",
 /* 142 */ "type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP",
 /* 143 */ "type_name ::= MEDIUMBLOB",
 /* 144 */ "type_name ::= BLOB",
 /* 145 */ "type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP",
 /* 146 */ "type_name ::= DECIMAL",
 /* 147 */ "type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP",
 /* 148 */ "type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP",
 /* 149 */ "tags_def_opt ::=",
 /* 150 */ "tags_def_opt ::= tags_def",
 /* 151 */ "tags_def ::= TAGS NK_LP column_def_list NK_RP",
 /* 152 */ "table_options ::=",
 /* 153 */ "table_options ::= table_options COMMENT NK_STRING",
 /* 154 */ "table_options ::= table_options KEEP integer_list",
1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 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
 /* 155 */ "table_options ::= table_options KEEP variable_list",
 /* 156 */ "table_options ::= table_options TTL NK_INTEGER",
 /* 157 */ "table_options ::= table_options SMA NK_LP col_name_list NK_RP",
 /* 158 */ "table_options ::= table_options ROLLUP NK_LP func_name_list NK_RP",
 /* 159 */ "table_options ::= table_options FILE_FACTOR NK_FLOAT",
 /* 160 */ "table_options ::= table_options DELAY NK_INTEGER",
 /* 161 */ "alter_table_options ::= alter_table_option",
 /* 162 */ "alter_table_options ::= alter_table_options alter_table_option",
 /* 163 */ "alter_table_option ::= COMMENT NK_STRING",
 /* 164 */ "alter_table_option ::= KEEP integer_list",
 /* 165 */ "alter_table_option ::= KEEP variable_list",
 /* 166 */ "alter_table_option ::= TTL NK_INTEGER",
 /* 167 */ "col_name_list ::= col_name",
 /* 168 */ "col_name_list ::= col_name_list NK_COMMA col_name",
 /* 169 */ "col_name ::= column_name",
 /* 170 */ "cmd ::= SHOW DNODES",
 /* 171 */ "cmd ::= SHOW USERS",
 /* 172 */ "cmd ::= SHOW DATABASES",
 /* 173 */ "cmd ::= SHOW db_name_cond_opt TABLES like_pattern_opt",
 /* 174 */ "cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt",
 /* 175 */ "cmd ::= SHOW db_name_cond_opt VGROUPS",
 /* 176 */ "cmd ::= SHOW MNODES",
 /* 177 */ "cmd ::= SHOW MODULES",
 /* 178 */ "cmd ::= SHOW QNODES",
 /* 179 */ "cmd ::= SHOW FUNCTIONS",
 /* 180 */ "cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt",
 /* 181 */ "cmd ::= SHOW STREAMS",
 /* 182 */ "cmd ::= SHOW ACCOUNTS",
 /* 183 */ "cmd ::= SHOW APPS",
 /* 184 */ "cmd ::= SHOW CONNECTIONS",
 /* 185 */ "cmd ::= SHOW LICENCE",
 /* 186 */ "cmd ::= SHOW GRANTS",
 /* 187 */ "cmd ::= SHOW CREATE DATABASE db_name",
 /* 188 */ "cmd ::= SHOW CREATE TABLE full_table_name",
 /* 189 */ "cmd ::= SHOW CREATE STABLE full_table_name",
 /* 190 */ "cmd ::= SHOW QUERIES",
 /* 191 */ "cmd ::= SHOW SCORES",
 /* 192 */ "cmd ::= SHOW TOPICS",
 /* 193 */ "cmd ::= SHOW VARIABLES",
 /* 194 */ "cmd ::= SHOW BNODES",
 /* 195 */ "cmd ::= SHOW SNODES",
 /* 196 */ "db_name_cond_opt ::=",
 /* 197 */ "db_name_cond_opt ::= db_name NK_DOT",
 /* 198 */ "like_pattern_opt ::=",
 /* 199 */ "like_pattern_opt ::= LIKE NK_STRING",
 /* 200 */ "table_name_cond ::= table_name",
 /* 201 */ "from_db_opt ::=",
 /* 202 */ "from_db_opt ::= FROM db_name",
 /* 203 */ "func_name_list ::= func_name",
 /* 204 */ "func_name_list ::= func_name_list NK_COMMA col_name",
 /* 205 */ "func_name ::= function_name",
 /* 206 */ "cmd ::= CREATE SMA INDEX not_exists_opt index_name ON table_name index_options",
 /* 207 */ "cmd ::= CREATE FULLTEXT INDEX not_exists_opt index_name ON table_name NK_LP col_name_list NK_RP",
 /* 208 */ "cmd ::= DROP INDEX exists_opt index_name ON table_name",
 /* 209 */ "index_options ::=",
 /* 210 */ "index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt",
 /* 211 */ "index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt",
 /* 212 */ "func_list ::= func",
 /* 213 */ "func_list ::= func_list NK_COMMA func",
 /* 214 */ "func ::= function_name NK_LP expression_list NK_RP",
 /* 215 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_expression",
 /* 216 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name AS db_name",
 /* 217 */ "cmd ::= DROP TOPIC exists_opt topic_name",
 /* 218 */ "cmd ::= DESC full_table_name",
 /* 219 */ "cmd ::= DESCRIBE full_table_name",
 /* 220 */ "cmd ::= RESET QUERY CACHE",
 /* 221 */ "cmd ::= EXPLAIN analyze_opt explain_options query_expression",
 /* 222 */ "analyze_opt ::=",
 /* 223 */ "analyze_opt ::= ANALYZE",
 /* 224 */ "explain_options ::=",
 /* 225 */ "explain_options ::= explain_options VERBOSE NK_BOOL",
 /* 226 */ "explain_options ::= explain_options RATIO NK_FLOAT",
 /* 227 */ "cmd ::= COMPACT VNODES IN NK_LP integer_list NK_RP",
 /* 228 */ "cmd ::= CREATE agg_func_opt FUNCTION function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt",
 /* 229 */ "cmd ::= DROP FUNCTION function_name",
 /* 230 */ "agg_func_opt ::=",
 /* 231 */ "agg_func_opt ::= AGGREGATE",
 /* 232 */ "bufsize_opt ::=",
 /* 233 */ "bufsize_opt ::= BUFSIZE NK_INTEGER",
 /* 234 */ "cmd ::= CREATE STREAM not_exists_opt stream_name stream_options into_opt AS query_expression",
 /* 235 */ "cmd ::= DROP STREAM exists_opt stream_name",
 /* 236 */ "into_opt ::=",
 /* 237 */ "into_opt ::= INTO full_table_name",
 /* 238 */ "stream_options ::=",
 /* 239 */ "stream_options ::= stream_options TRIGGER AT_ONCE",
 /* 240 */ "stream_options ::= stream_options TRIGGER WINDOW_CLOSE",
 /* 241 */ "stream_options ::= stream_options WATERMARK duration_literal",
 /* 242 */ "cmd ::= KILL CONNECTION NK_INTEGER",
 /* 243 */ "cmd ::= KILL QUERY NK_INTEGER",
 /* 244 */ "cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER",
 /* 245 */ "cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list",
 /* 246 */ "cmd ::= SPLIT VGROUP NK_INTEGER",
 /* 247 */ "dnode_list ::= DNODE NK_INTEGER",
 /* 248 */ "dnode_list ::= dnode_list DNODE NK_INTEGER",
 /* 249 */ "cmd ::= SYNCDB db_name REPLICA",
 /* 250 */ "cmd ::= query_expression",
 /* 251 */ "literal ::= NK_INTEGER",
 /* 252 */ "literal ::= NK_FLOAT",
 /* 253 */ "literal ::= NK_STRING",
 /* 254 */ "literal ::= NK_BOOL",
 /* 255 */ "literal ::= TIMESTAMP NK_STRING",
 /* 256 */ "literal ::= duration_literal",
 /* 257 */ "literal ::= NULL",
 /* 258 */ "literal ::= NK_QUESTION",
 /* 259 */ "duration_literal ::= NK_VARIABLE",
 /* 260 */ "signed ::= NK_INTEGER",
 /* 261 */ "signed ::= NK_PLUS NK_INTEGER",
 /* 262 */ "signed ::= NK_MINUS NK_INTEGER",
 /* 263 */ "signed ::= NK_FLOAT",
 /* 264 */ "signed ::= NK_PLUS NK_FLOAT",
 /* 265 */ "signed ::= NK_MINUS NK_FLOAT",
 /* 266 */ "signed_literal ::= signed",
 /* 267 */ "signed_literal ::= NK_STRING",
 /* 268 */ "signed_literal ::= NK_BOOL",
 /* 269 */ "signed_literal ::= TIMESTAMP NK_STRING",
 /* 270 */ "signed_literal ::= duration_literal",
 /* 271 */ "signed_literal ::= NULL",
 /* 272 */ "literal_list ::= signed_literal",
 /* 273 */ "literal_list ::= literal_list NK_COMMA signed_literal",
 /* 274 */ "db_name ::= NK_ID",
 /* 275 */ "table_name ::= NK_ID",
 /* 276 */ "column_name ::= NK_ID",
 /* 277 */ "function_name ::= NK_ID",
 /* 278 */ "table_alias ::= NK_ID",
 /* 279 */ "column_alias ::= NK_ID",
 /* 280 */ "user_name ::= NK_ID",
 /* 281 */ "index_name ::= NK_ID",
 /* 282 */ "topic_name ::= NK_ID",
 /* 283 */ "stream_name ::= NK_ID",
 /* 284 */ "expression ::= literal",
 /* 285 */ "expression ::= pseudo_column",
 /* 286 */ "expression ::= column_reference",
 /* 287 */ "expression ::= function_expression",
 /* 288 */ "expression ::= subquery",
 /* 289 */ "expression ::= NK_LP expression NK_RP",
 /* 290 */ "expression ::= NK_PLUS expression",
 /* 291 */ "expression ::= NK_MINUS expression",
 /* 292 */ "expression ::= expression NK_PLUS expression",
 /* 293 */ "expression ::= expression NK_MINUS expression",
 /* 294 */ "expression ::= expression NK_STAR expression",
 /* 295 */ "expression ::= expression NK_SLASH expression",
 /* 296 */ "expression ::= expression NK_REM expression",
 /* 297 */ "expression ::= column_reference NK_ARROW NK_STRING",
 /* 298 */ "expression_list ::= expression",
 /* 299 */ "expression_list ::= expression_list NK_COMMA expression",
 /* 300 */ "column_reference ::= column_name",
 /* 301 */ "column_reference ::= table_name NK_DOT column_name",
 /* 302 */ "pseudo_column ::= NOW",
 /* 303 */ "pseudo_column ::= TODAY",
 /* 304 */ "pseudo_column ::= ROWTS",
 /* 305 */ "pseudo_column ::= TBNAME",
 /* 306 */ "pseudo_column ::= QSTARTTS",
 /* 307 */ "pseudo_column ::= QENDTS",
 /* 308 */ "pseudo_column ::= WSTARTTS",
 /* 309 */ "pseudo_column ::= WENDTS",
 /* 310 */ "pseudo_column ::= WDURATION",
 /* 311 */ "function_expression ::= function_name NK_LP expression_list NK_RP",
 /* 312 */ "function_expression ::= star_func NK_LP star_func_para_list NK_RP",
 /* 313 */ "function_expression ::= CAST NK_LP expression AS type_name NK_RP",
 /* 314 */ "star_func ::= COUNT",
 /* 315 */ "star_func ::= FIRST",
 /* 316 */ "star_func ::= LAST",
 /* 317 */ "star_func ::= LAST_ROW",
 /* 318 */ "star_func_para_list ::= NK_STAR",
 /* 319 */ "star_func_para_list ::= other_para_list",
 /* 320 */ "other_para_list ::= star_func_para",
 /* 321 */ "other_para_list ::= other_para_list NK_COMMA star_func_para",
 /* 322 */ "star_func_para ::= expression",
 /* 323 */ "star_func_para ::= table_name NK_DOT NK_STAR",
 /* 324 */ "predicate ::= expression compare_op expression",
 /* 325 */ "predicate ::= expression BETWEEN expression AND expression",
 /* 326 */ "predicate ::= expression NOT BETWEEN expression AND expression",
 /* 327 */ "predicate ::= expression IS NULL",
 /* 328 */ "predicate ::= expression IS NOT NULL",
 /* 329 */ "predicate ::= expression in_op in_predicate_value",
 /* 330 */ "compare_op ::= NK_LT",
 /* 331 */ "compare_op ::= NK_GT",
 /* 332 */ "compare_op ::= NK_LE",
 /* 333 */ "compare_op ::= NK_GE",
 /* 334 */ "compare_op ::= NK_NE",
 /* 335 */ "compare_op ::= NK_EQ",
 /* 336 */ "compare_op ::= LIKE",
 /* 337 */ "compare_op ::= NOT LIKE",
 /* 338 */ "compare_op ::= MATCH",
 /* 339 */ "compare_op ::= NMATCH",
 /* 340 */ "compare_op ::= CONTAINS",
 /* 341 */ "in_op ::= IN",
 /* 342 */ "in_op ::= NOT IN",
 /* 343 */ "in_predicate_value ::= NK_LP expression_list NK_RP",
 /* 344 */ "boolean_value_expression ::= boolean_primary",
 /* 345 */ "boolean_value_expression ::= NOT boolean_primary",
 /* 346 */ "boolean_value_expression ::= boolean_value_expression OR boolean_value_expression",
 /* 347 */ "boolean_value_expression ::= boolean_value_expression AND boolean_value_expression",
 /* 348 */ "boolean_primary ::= predicate",
 /* 349 */ "boolean_primary ::= NK_LP boolean_value_expression NK_RP",
 /* 350 */ "common_expression ::= expression",
 /* 351 */ "common_expression ::= boolean_value_expression",
 /* 352 */ "from_clause ::= FROM table_reference_list",
 /* 353 */ "table_reference_list ::= table_reference",
 /* 354 */ "table_reference_list ::= table_reference_list NK_COMMA table_reference",
 /* 355 */ "table_reference ::= table_primary",
 /* 356 */ "table_reference ::= joined_table",
 /* 357 */ "table_primary ::= table_name alias_opt",
 /* 358 */ "table_primary ::= db_name NK_DOT table_name alias_opt",
 /* 359 */ "table_primary ::= subquery alias_opt",
 /* 360 */ "table_primary ::= parenthesized_joined_table",
 /* 361 */ "alias_opt ::=",
 /* 362 */ "alias_opt ::= table_alias",
 /* 363 */ "alias_opt ::= AS table_alias",
 /* 364 */ "parenthesized_joined_table ::= NK_LP joined_table NK_RP",
 /* 365 */ "parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP",
 /* 366 */ "joined_table ::= table_reference join_type JOIN table_reference ON search_condition",
 /* 367 */ "join_type ::=",
 /* 368 */ "join_type ::= INNER",
 /* 369 */ "query_specification ::= SELECT set_quantifier_opt select_list from_clause where_clause_opt partition_by_clause_opt twindow_clause_opt group_by_clause_opt having_clause_opt",
 /* 370 */ "set_quantifier_opt ::=",
 /* 371 */ "set_quantifier_opt ::= DISTINCT",
 /* 372 */ "set_quantifier_opt ::= ALL",
 /* 373 */ "select_list ::= NK_STAR",
 /* 374 */ "select_list ::= select_sublist",
 /* 375 */ "select_sublist ::= select_item",
 /* 376 */ "select_sublist ::= select_sublist NK_COMMA select_item",
 /* 377 */ "select_item ::= common_expression",
 /* 378 */ "select_item ::= common_expression column_alias",
 /* 379 */ "select_item ::= common_expression AS column_alias",
 /* 380 */ "select_item ::= table_name NK_DOT NK_STAR",
 /* 381 */ "where_clause_opt ::=",
 /* 382 */ "where_clause_opt ::= WHERE search_condition",
 /* 383 */ "partition_by_clause_opt ::=",
 /* 384 */ "partition_by_clause_opt ::= PARTITION BY expression_list",
 /* 385 */ "twindow_clause_opt ::=",
 /* 386 */ "twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP",
 /* 387 */ "twindow_clause_opt ::= STATE_WINDOW NK_LP expression NK_RP",
 /* 388 */ "twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt",
 /* 389 */ "twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt",
 /* 390 */ "sliding_opt ::=",
 /* 391 */ "sliding_opt ::= SLIDING NK_LP duration_literal NK_RP",
 /* 392 */ "fill_opt ::=",
 /* 393 */ "fill_opt ::= FILL NK_LP fill_mode NK_RP",
 /* 394 */ "fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP",
 /* 395 */ "fill_mode ::= NONE",
 /* 396 */ "fill_mode ::= PREV",
 /* 397 */ "fill_mode ::= NULL",
 /* 398 */ "fill_mode ::= LINEAR",
 /* 399 */ "fill_mode ::= NEXT",
 /* 400 */ "group_by_clause_opt ::=",
 /* 401 */ "group_by_clause_opt ::= GROUP BY group_by_list",
 /* 402 */ "group_by_list ::= expression",
 /* 403 */ "group_by_list ::= group_by_list NK_COMMA expression",
 /* 404 */ "having_clause_opt ::=",
 /* 405 */ "having_clause_opt ::= HAVING search_condition",
 /* 406 */ "query_expression ::= query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt",
 /* 407 */ "query_expression_body ::= query_primary",
 /* 408 */ "query_expression_body ::= query_expression_body UNION ALL query_expression_body",
 /* 409 */ "query_primary ::= query_specification",
 /* 410 */ "order_by_clause_opt ::=",
 /* 411 */ "order_by_clause_opt ::= ORDER BY sort_specification_list",
 /* 412 */ "slimit_clause_opt ::=",
 /* 413 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER",
 /* 414 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER",
 /* 415 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER",
 /* 416 */ "limit_clause_opt ::=",
 /* 417 */ "limit_clause_opt ::= LIMIT NK_INTEGER",
 /* 418 */ "limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER",
 /* 419 */ "limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER",
 /* 420 */ "subquery ::= NK_LP query_expression NK_RP",
 /* 421 */ "search_condition ::= common_expression",
 /* 422 */ "sort_specification_list ::= sort_specification",
 /* 423 */ "sort_specification_list ::= sort_specification_list NK_COMMA sort_specification",
 /* 424 */ "sort_specification ::= expression ordering_specification_opt null_ordering_opt",
 /* 425 */ "ordering_specification_opt ::=",
 /* 426 */ "ordering_specification_opt ::= ASC",
 /* 427 */ "ordering_specification_opt ::= DESC",
 /* 428 */ "null_ordering_opt ::=",
 /* 429 */ "null_ordering_opt ::= NULLS FIRST",
 /* 430 */ "null_ordering_opt ::= NULLS LAST",
1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639
};
#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 已提交
1640
    pNew = malloc(newSize*sizeof(pNew[0]));
1641 1642
    if( pNew ) pNew[0] = p->yystk0;
  }else{
X
Xiaoyu Wang 已提交
1643
    pNew = realloc(p->yystack, newSize*sizeof(pNew[0]));
1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660
  }
  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 已提交
1661
** second argument to ParseAlloc() below.  This can be changed by
1662 1663 1664 1665 1666 1667 1668 1669 1670
** 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 已提交
1671
void ParseInit(void *yypRawParser ParseCTX_PDECL){
1672
  yyParser *yypParser = (yyParser*)yypRawParser;
X
Xiaoyu Wang 已提交
1673
  ParseCTX_STORE
1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696
#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 已提交
1697
#ifndef Parse_ENGINEALWAYSONSTACK
1698 1699 1700 1701 1702 1703 1704 1705 1706 1707
/* 
** 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 已提交
1708
** to Parse and ParseFree.
1709
*/
X
Xiaoyu Wang 已提交
1710
void *ParseAlloc(void *(*mallocProc)(YYMALLOCARGTYPE) ParseCTX_PDECL){
1711 1712 1713
  yyParser *yypParser;
  yypParser = (yyParser*)(*mallocProc)( (YYMALLOCARGTYPE)sizeof(yyParser) );
  if( yypParser ){
X
Xiaoyu Wang 已提交
1714 1715
    ParseCTX_STORE
    ParseInit(yypParser ParseCTX_PARAM);
1716 1717 1718
  }
  return (void*)yypParser;
}
X
Xiaoyu Wang 已提交
1719
#endif /* Parse_ENGINEALWAYSONSTACK */
1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733


/* 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 已提交
1734 1735
  ParseARG_FETCH
  ParseCTX_FETCH
1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748
  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 */
1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805
    case 219: /* cmd */
    case 222: /* literal */
    case 229: /* db_options */
    case 231: /* alter_db_options */
    case 236: /* retention */
    case 237: /* full_table_name */
    case 240: /* table_options */
    case 244: /* alter_table_clause */
    case 245: /* alter_table_options */
    case 248: /* create_subtable_clause */
    case 251: /* drop_table_clause */
    case 254: /* column_def */
    case 257: /* col_name */
    case 258: /* db_name_cond_opt */
    case 259: /* like_pattern_opt */
    case 260: /* table_name_cond */
    case 261: /* from_db_opt */
    case 262: /* func_name */
    case 265: /* index_options */
    case 267: /* duration_literal */
    case 268: /* sliding_opt */
    case 269: /* func */
    case 272: /* query_expression */
    case 274: /* explain_options */
    case 278: /* stream_options */
    case 279: /* into_opt */
    case 281: /* signed */
    case 282: /* signed_literal */
    case 285: /* expression */
    case 286: /* pseudo_column */
    case 287: /* column_reference */
    case 288: /* function_expression */
    case 289: /* subquery */
    case 293: /* star_func_para */
    case 294: /* predicate */
    case 297: /* in_predicate_value */
    case 298: /* boolean_value_expression */
    case 299: /* boolean_primary */
    case 300: /* common_expression */
    case 301: /* from_clause */
    case 302: /* table_reference_list */
    case 303: /* table_reference */
    case 304: /* table_primary */
    case 305: /* joined_table */
    case 307: /* parenthesized_joined_table */
    case 309: /* search_condition */
    case 310: /* query_specification */
    case 313: /* where_clause_opt */
    case 315: /* twindow_clause_opt */
    case 317: /* having_clause_opt */
    case 319: /* select_item */
    case 320: /* fill_opt */
    case 323: /* query_expression_body */
    case 325: /* slimit_clause_opt */
    case 326: /* limit_clause_opt */
    case 327: /* query_primary */
    case 329: /* sort_specification */
1806
{
1807
 nodesDestroyNode((yypminor->yy192)); 
1808 1809
}
      break;
1810 1811 1812 1813
    case 220: /* account_options */
    case 221: /* alter_account_options */
    case 223: /* alter_account_option */
    case 276: /* bufsize_opt */
1814
{
1815
 
1816 1817
}
      break;
1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831
    case 224: /* user_name */
    case 225: /* dnode_endpoint */
    case 226: /* dnode_host_name */
    case 228: /* db_name */
    case 246: /* column_name */
    case 253: /* table_name */
    case 263: /* function_name */
    case 264: /* index_name */
    case 271: /* topic_name */
    case 277: /* stream_name */
    case 283: /* table_alias */
    case 284: /* column_alias */
    case 290: /* star_func */
    case 306: /* alias_opt */
1832
{
1833
 
1834 1835
}
      break;
1836 1837 1838 1839 1840
    case 227: /* not_exists_opt */
    case 230: /* exists_opt */
    case 273: /* analyze_opt */
    case 275: /* agg_func_opt */
    case 311: /* set_quantifier_opt */
1841
{
1842 1843 1844
 
}
      break;
1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868
    case 232: /* integer_list */
    case 233: /* variable_list */
    case 234: /* retention_list */
    case 238: /* column_def_list */
    case 239: /* tags_def_opt */
    case 241: /* multi_create_clause */
    case 242: /* tags_def */
    case 243: /* multi_drop_clause */
    case 249: /* specific_tags_opt */
    case 250: /* literal_list */
    case 252: /* col_name_list */
    case 255: /* func_name_list */
    case 266: /* func_list */
    case 270: /* expression_list */
    case 280: /* dnode_list */
    case 291: /* star_func_para_list */
    case 292: /* other_para_list */
    case 312: /* select_list */
    case 314: /* partition_by_clause_opt */
    case 316: /* group_by_clause_opt */
    case 318: /* select_sublist */
    case 322: /* group_by_list */
    case 324: /* order_by_clause_opt */
    case 328: /* sort_specification_list */
1869
{
1870
 nodesDestroyList((yypminor->yy64)); 
1871 1872
}
      break;
1873 1874
    case 235: /* alter_db_option */
    case 256: /* alter_table_option */
1875
{
X
Xiaoyu Wang 已提交
1876
 
1877 1878
}
      break;
1879
    case 247: /* type_name */
1880
{
1881
 
1882 1883
}
      break;
1884 1885
    case 295: /* compare_op */
    case 296: /* in_op */
1886
{
1887
 
1888 1889
}
      break;
1890
    case 308: /* join_type */
1891
{
1892
 
1893 1894
}
      break;
1895
    case 321: /* fill_mode */
1896
{
1897
 
1898 1899
}
      break;
1900
    case 330: /* ordering_specification_opt */
1901
{
1902
 
1903 1904
}
      break;
1905
    case 331: /* null_ordering_opt */
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
}
      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 已提交
1939
void ParseFinalize(void *p){
1940 1941 1942
  yyParser *pParser = (yyParser*)p;
  while( pParser->yytos>pParser->yystack ) yy_pop_parser_stack(pParser);
#if YYSTACKDEPTH<=0
X
Xiaoyu Wang 已提交
1943
  if( pParser->yystack!=&pParser->yystk0 ) free(pParser->yystack);
1944 1945 1946
#endif
}

X
Xiaoyu Wang 已提交
1947
#ifndef Parse_ENGINEALWAYSONSTACK
1948 1949 1950 1951 1952 1953 1954 1955
/* 
** 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 已提交
1956
void ParseFree(
1957 1958 1959 1960 1961 1962
  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 已提交
1963
  ParseFinalize(p);
1964 1965
  (*freeProc)(p);
}
X
Xiaoyu Wang 已提交
1966
#endif /* Parse_ENGINEALWAYSONSTACK */
1967 1968 1969 1970 1971

/*
** Return the peak depth of the stack for a parser.
*/
#ifdef YYTRACKMAXSTACKDEPTH
X
Xiaoyu Wang 已提交
1972
int ParseStackPeak(void *p){
1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995
  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 已提交
1996
int ParseCoverage(FILE *out){
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
  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 );
2033
    /* assert( i+YYNTOKEN<=(int)YY_NLOOKAHEAD ); */
2034 2035 2036
    assert( iLookAhead!=YYNOCODE );
    assert( iLookAhead < YYNTOKEN );
    i += iLookAhead;
2037
    if( i>=YY_NLOOKAHEAD || yy_lookahead[i]!=iLookAhead ){
2038 2039
#ifdef YYFALLBACK
      YYCODETYPE iFallback;            /* Fallback token */
2040 2041
      if( iLookAhead<sizeof(yyFallback)/sizeof(yyFallback[0])
             && (iFallback = yyFallback[iLookAhead])!=0 ){
2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055
#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;
2056 2057 2058 2059 2060 2061 2062 2063 2064 2065
        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
        ){
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 2109 2110 2111 2112 2113 2114 2115 2116 2117
#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 已提交
2118 2119
   ParseARG_FETCH
   ParseCTX_FETCH
2120 2121 2122 2123 2124 2125 2126 2127 2128 2129
#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 已提交
2130 2131
   ParseARG_STORE /* Suppress warning about unused %extra_argument var */
   ParseCTX_STORE
2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161
}

/*
** 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 已提交
2162
  ParseTOKENTYPE yyMinor        /* The minor token to shift in */
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
){
  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");
}

2197 2198 2199 2200 2201 2202 2203
/* 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[] = {
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 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 2570 2571 2572 2573 2574 2575 2576 2577 2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 2619 2620 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634
  {  219,   -6 }, /* (0) cmd ::= CREATE ACCOUNT NK_ID PASS NK_STRING account_options */
  {  219,   -4 }, /* (1) cmd ::= ALTER ACCOUNT NK_ID alter_account_options */
  {  220,    0 }, /* (2) account_options ::= */
  {  220,   -3 }, /* (3) account_options ::= account_options PPS literal */
  {  220,   -3 }, /* (4) account_options ::= account_options TSERIES literal */
  {  220,   -3 }, /* (5) account_options ::= account_options STORAGE literal */
  {  220,   -3 }, /* (6) account_options ::= account_options STREAMS literal */
  {  220,   -3 }, /* (7) account_options ::= account_options QTIME literal */
  {  220,   -3 }, /* (8) account_options ::= account_options DBS literal */
  {  220,   -3 }, /* (9) account_options ::= account_options USERS literal */
  {  220,   -3 }, /* (10) account_options ::= account_options CONNS literal */
  {  220,   -3 }, /* (11) account_options ::= account_options STATE literal */
  {  221,   -1 }, /* (12) alter_account_options ::= alter_account_option */
  {  221,   -2 }, /* (13) alter_account_options ::= alter_account_options alter_account_option */
  {  223,   -2 }, /* (14) alter_account_option ::= PASS literal */
  {  223,   -2 }, /* (15) alter_account_option ::= PPS literal */
  {  223,   -2 }, /* (16) alter_account_option ::= TSERIES literal */
  {  223,   -2 }, /* (17) alter_account_option ::= STORAGE literal */
  {  223,   -2 }, /* (18) alter_account_option ::= STREAMS literal */
  {  223,   -2 }, /* (19) alter_account_option ::= QTIME literal */
  {  223,   -2 }, /* (20) alter_account_option ::= DBS literal */
  {  223,   -2 }, /* (21) alter_account_option ::= USERS literal */
  {  223,   -2 }, /* (22) alter_account_option ::= CONNS literal */
  {  223,   -2 }, /* (23) alter_account_option ::= STATE literal */
  {  219,   -5 }, /* (24) cmd ::= CREATE USER user_name PASS NK_STRING */
  {  219,   -5 }, /* (25) cmd ::= ALTER USER user_name PASS NK_STRING */
  {  219,   -5 }, /* (26) cmd ::= ALTER USER user_name PRIVILEGE NK_STRING */
  {  219,   -3 }, /* (27) cmd ::= DROP USER user_name */
  {  219,   -3 }, /* (28) cmd ::= CREATE DNODE dnode_endpoint */
  {  219,   -5 }, /* (29) cmd ::= CREATE DNODE dnode_host_name PORT NK_INTEGER */
  {  219,   -3 }, /* (30) cmd ::= DROP DNODE NK_INTEGER */
  {  219,   -3 }, /* (31) cmd ::= DROP DNODE dnode_endpoint */
  {  219,   -4 }, /* (32) cmd ::= ALTER DNODE NK_INTEGER NK_STRING */
  {  219,   -5 }, /* (33) cmd ::= ALTER DNODE NK_INTEGER NK_STRING NK_STRING */
  {  219,   -4 }, /* (34) cmd ::= ALTER ALL DNODES NK_STRING */
  {  219,   -5 }, /* (35) cmd ::= ALTER ALL DNODES NK_STRING NK_STRING */
  {  225,   -1 }, /* (36) dnode_endpoint ::= NK_STRING */
  {  226,   -1 }, /* (37) dnode_host_name ::= NK_ID */
  {  226,   -1 }, /* (38) dnode_host_name ::= NK_IPTOKEN */
  {  219,   -3 }, /* (39) cmd ::= ALTER LOCAL NK_STRING */
  {  219,   -4 }, /* (40) cmd ::= ALTER LOCAL NK_STRING NK_STRING */
  {  219,   -5 }, /* (41) cmd ::= CREATE QNODE ON DNODE NK_INTEGER */
  {  219,   -5 }, /* (42) cmd ::= DROP QNODE ON DNODE NK_INTEGER */
  {  219,   -5 }, /* (43) cmd ::= CREATE BNODE ON DNODE NK_INTEGER */
  {  219,   -5 }, /* (44) cmd ::= DROP BNODE ON DNODE NK_INTEGER */
  {  219,   -5 }, /* (45) cmd ::= CREATE SNODE ON DNODE NK_INTEGER */
  {  219,   -5 }, /* (46) cmd ::= DROP SNODE ON DNODE NK_INTEGER */
  {  219,   -5 }, /* (47) cmd ::= CREATE MNODE ON DNODE NK_INTEGER */
  {  219,   -5 }, /* (48) cmd ::= DROP MNODE ON DNODE NK_INTEGER */
  {  219,   -5 }, /* (49) cmd ::= CREATE DATABASE not_exists_opt db_name db_options */
  {  219,   -4 }, /* (50) cmd ::= DROP DATABASE exists_opt db_name */
  {  219,   -2 }, /* (51) cmd ::= USE db_name */
  {  219,   -4 }, /* (52) cmd ::= ALTER DATABASE db_name alter_db_options */
  {  227,   -3 }, /* (53) not_exists_opt ::= IF NOT EXISTS */
  {  227,    0 }, /* (54) not_exists_opt ::= */
  {  230,   -2 }, /* (55) exists_opt ::= IF EXISTS */
  {  230,    0 }, /* (56) exists_opt ::= */
  {  229,    0 }, /* (57) db_options ::= */
  {  229,   -3 }, /* (58) db_options ::= db_options BLOCKS NK_INTEGER */
  {  229,   -3 }, /* (59) db_options ::= db_options CACHE NK_INTEGER */
  {  229,   -3 }, /* (60) db_options ::= db_options CACHELAST NK_INTEGER */
  {  229,   -3 }, /* (61) db_options ::= db_options COMP NK_INTEGER */
  {  229,   -3 }, /* (62) db_options ::= db_options DAYS NK_INTEGER */
  {  229,   -3 }, /* (63) db_options ::= db_options DAYS NK_VARIABLE */
  {  229,   -3 }, /* (64) db_options ::= db_options FSYNC NK_INTEGER */
  {  229,   -3 }, /* (65) db_options ::= db_options MAXROWS NK_INTEGER */
  {  229,   -3 }, /* (66) db_options ::= db_options MINROWS NK_INTEGER */
  {  229,   -3 }, /* (67) db_options ::= db_options KEEP integer_list */
  {  229,   -3 }, /* (68) db_options ::= db_options KEEP variable_list */
  {  229,   -3 }, /* (69) db_options ::= db_options PRECISION NK_STRING */
  {  229,   -3 }, /* (70) db_options ::= db_options QUORUM NK_INTEGER */
  {  229,   -3 }, /* (71) db_options ::= db_options REPLICA NK_INTEGER */
  {  229,   -3 }, /* (72) db_options ::= db_options TTL NK_INTEGER */
  {  229,   -3 }, /* (73) db_options ::= db_options WAL NK_INTEGER */
  {  229,   -3 }, /* (74) db_options ::= db_options VGROUPS NK_INTEGER */
  {  229,   -3 }, /* (75) db_options ::= db_options SINGLE_STABLE NK_INTEGER */
  {  229,   -3 }, /* (76) db_options ::= db_options STREAM_MODE NK_INTEGER */
  {  229,   -3 }, /* (77) db_options ::= db_options RETENTIONS retention_list */
  {  231,   -1 }, /* (78) alter_db_options ::= alter_db_option */
  {  231,   -2 }, /* (79) alter_db_options ::= alter_db_options alter_db_option */
  {  235,   -2 }, /* (80) alter_db_option ::= BLOCKS NK_INTEGER */
  {  235,   -2 }, /* (81) alter_db_option ::= FSYNC NK_INTEGER */
  {  235,   -2 }, /* (82) alter_db_option ::= KEEP integer_list */
  {  235,   -2 }, /* (83) alter_db_option ::= KEEP variable_list */
  {  235,   -2 }, /* (84) alter_db_option ::= WAL NK_INTEGER */
  {  235,   -2 }, /* (85) alter_db_option ::= QUORUM NK_INTEGER */
  {  235,   -2 }, /* (86) alter_db_option ::= CACHELAST NK_INTEGER */
  {  235,   -2 }, /* (87) alter_db_option ::= REPLICA NK_INTEGER */
  {  232,   -1 }, /* (88) integer_list ::= NK_INTEGER */
  {  232,   -3 }, /* (89) integer_list ::= integer_list NK_COMMA NK_INTEGER */
  {  233,   -1 }, /* (90) variable_list ::= NK_VARIABLE */
  {  233,   -3 }, /* (91) variable_list ::= variable_list NK_COMMA NK_VARIABLE */
  {  234,   -1 }, /* (92) retention_list ::= retention */
  {  234,   -3 }, /* (93) retention_list ::= retention_list NK_COMMA retention */
  {  236,   -3 }, /* (94) retention ::= NK_VARIABLE NK_COLON NK_VARIABLE */
  {  219,   -9 }, /* (95) cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options */
  {  219,   -3 }, /* (96) cmd ::= CREATE TABLE multi_create_clause */
  {  219,   -9 }, /* (97) cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options */
  {  219,   -3 }, /* (98) cmd ::= DROP TABLE multi_drop_clause */
  {  219,   -4 }, /* (99) cmd ::= DROP STABLE exists_opt full_table_name */
  {  219,   -3 }, /* (100) cmd ::= ALTER TABLE alter_table_clause */
  {  219,   -3 }, /* (101) cmd ::= ALTER STABLE alter_table_clause */
  {  244,   -2 }, /* (102) alter_table_clause ::= full_table_name alter_table_options */
  {  244,   -5 }, /* (103) alter_table_clause ::= full_table_name ADD COLUMN column_name type_name */
  {  244,   -4 }, /* (104) alter_table_clause ::= full_table_name DROP COLUMN column_name */
  {  244,   -5 }, /* (105) alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name */
  {  244,   -5 }, /* (106) alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name */
  {  244,   -5 }, /* (107) alter_table_clause ::= full_table_name ADD TAG column_name type_name */
  {  244,   -4 }, /* (108) alter_table_clause ::= full_table_name DROP TAG column_name */
  {  244,   -5 }, /* (109) alter_table_clause ::= full_table_name MODIFY TAG column_name type_name */
  {  244,   -5 }, /* (110) alter_table_clause ::= full_table_name RENAME TAG column_name column_name */
  {  244,   -6 }, /* (111) alter_table_clause ::= full_table_name SET TAG column_name NK_EQ literal */
  {  241,   -1 }, /* (112) multi_create_clause ::= create_subtable_clause */
  {  241,   -2 }, /* (113) multi_create_clause ::= multi_create_clause create_subtable_clause */
  {  248,   -9 }, /* (114) create_subtable_clause ::= not_exists_opt full_table_name USING full_table_name specific_tags_opt TAGS NK_LP literal_list NK_RP */
  {  243,   -1 }, /* (115) multi_drop_clause ::= drop_table_clause */
  {  243,   -2 }, /* (116) multi_drop_clause ::= multi_drop_clause drop_table_clause */
  {  251,   -2 }, /* (117) drop_table_clause ::= exists_opt full_table_name */
  {  249,    0 }, /* (118) specific_tags_opt ::= */
  {  249,   -3 }, /* (119) specific_tags_opt ::= NK_LP col_name_list NK_RP */
  {  237,   -1 }, /* (120) full_table_name ::= table_name */
  {  237,   -3 }, /* (121) full_table_name ::= db_name NK_DOT table_name */
  {  238,   -1 }, /* (122) column_def_list ::= column_def */
  {  238,   -3 }, /* (123) column_def_list ::= column_def_list NK_COMMA column_def */
  {  254,   -2 }, /* (124) column_def ::= column_name type_name */
  {  254,   -4 }, /* (125) column_def ::= column_name type_name COMMENT NK_STRING */
  {  247,   -1 }, /* (126) type_name ::= BOOL */
  {  247,   -1 }, /* (127) type_name ::= TINYINT */
  {  247,   -1 }, /* (128) type_name ::= SMALLINT */
  {  247,   -1 }, /* (129) type_name ::= INT */
  {  247,   -1 }, /* (130) type_name ::= INTEGER */
  {  247,   -1 }, /* (131) type_name ::= BIGINT */
  {  247,   -1 }, /* (132) type_name ::= FLOAT */
  {  247,   -1 }, /* (133) type_name ::= DOUBLE */
  {  247,   -4 }, /* (134) type_name ::= BINARY NK_LP NK_INTEGER NK_RP */
  {  247,   -1 }, /* (135) type_name ::= TIMESTAMP */
  {  247,   -4 }, /* (136) type_name ::= NCHAR NK_LP NK_INTEGER NK_RP */
  {  247,   -2 }, /* (137) type_name ::= TINYINT UNSIGNED */
  {  247,   -2 }, /* (138) type_name ::= SMALLINT UNSIGNED */
  {  247,   -2 }, /* (139) type_name ::= INT UNSIGNED */
  {  247,   -2 }, /* (140) type_name ::= BIGINT UNSIGNED */
  {  247,   -1 }, /* (141) type_name ::= JSON */
  {  247,   -4 }, /* (142) type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP */
  {  247,   -1 }, /* (143) type_name ::= MEDIUMBLOB */
  {  247,   -1 }, /* (144) type_name ::= BLOB */
  {  247,   -4 }, /* (145) type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP */
  {  247,   -1 }, /* (146) type_name ::= DECIMAL */
  {  247,   -4 }, /* (147) type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP */
  {  247,   -6 }, /* (148) type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */
  {  239,    0 }, /* (149) tags_def_opt ::= */
  {  239,   -1 }, /* (150) tags_def_opt ::= tags_def */
  {  242,   -4 }, /* (151) tags_def ::= TAGS NK_LP column_def_list NK_RP */
  {  240,    0 }, /* (152) table_options ::= */
  {  240,   -3 }, /* (153) table_options ::= table_options COMMENT NK_STRING */
  {  240,   -3 }, /* (154) table_options ::= table_options KEEP integer_list */
  {  240,   -3 }, /* (155) table_options ::= table_options KEEP variable_list */
  {  240,   -3 }, /* (156) table_options ::= table_options TTL NK_INTEGER */
  {  240,   -5 }, /* (157) table_options ::= table_options SMA NK_LP col_name_list NK_RP */
  {  240,   -5 }, /* (158) table_options ::= table_options ROLLUP NK_LP func_name_list NK_RP */
  {  240,   -3 }, /* (159) table_options ::= table_options FILE_FACTOR NK_FLOAT */
  {  240,   -3 }, /* (160) table_options ::= table_options DELAY NK_INTEGER */
  {  245,   -1 }, /* (161) alter_table_options ::= alter_table_option */
  {  245,   -2 }, /* (162) alter_table_options ::= alter_table_options alter_table_option */
  {  256,   -2 }, /* (163) alter_table_option ::= COMMENT NK_STRING */
  {  256,   -2 }, /* (164) alter_table_option ::= KEEP integer_list */
  {  256,   -2 }, /* (165) alter_table_option ::= KEEP variable_list */
  {  256,   -2 }, /* (166) alter_table_option ::= TTL NK_INTEGER */
  {  252,   -1 }, /* (167) col_name_list ::= col_name */
  {  252,   -3 }, /* (168) col_name_list ::= col_name_list NK_COMMA col_name */
  {  257,   -1 }, /* (169) col_name ::= column_name */
  {  219,   -2 }, /* (170) cmd ::= SHOW DNODES */
  {  219,   -2 }, /* (171) cmd ::= SHOW USERS */
  {  219,   -2 }, /* (172) cmd ::= SHOW DATABASES */
  {  219,   -4 }, /* (173) cmd ::= SHOW db_name_cond_opt TABLES like_pattern_opt */
  {  219,   -4 }, /* (174) cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt */
  {  219,   -3 }, /* (175) cmd ::= SHOW db_name_cond_opt VGROUPS */
  {  219,   -2 }, /* (176) cmd ::= SHOW MNODES */
  {  219,   -2 }, /* (177) cmd ::= SHOW MODULES */
  {  219,   -2 }, /* (178) cmd ::= SHOW QNODES */
  {  219,   -2 }, /* (179) cmd ::= SHOW FUNCTIONS */
  {  219,   -5 }, /* (180) cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt */
  {  219,   -2 }, /* (181) cmd ::= SHOW STREAMS */
  {  219,   -2 }, /* (182) cmd ::= SHOW ACCOUNTS */
  {  219,   -2 }, /* (183) cmd ::= SHOW APPS */
  {  219,   -2 }, /* (184) cmd ::= SHOW CONNECTIONS */
  {  219,   -2 }, /* (185) cmd ::= SHOW LICENCE */
  {  219,   -2 }, /* (186) cmd ::= SHOW GRANTS */
  {  219,   -4 }, /* (187) cmd ::= SHOW CREATE DATABASE db_name */
  {  219,   -4 }, /* (188) cmd ::= SHOW CREATE TABLE full_table_name */
  {  219,   -4 }, /* (189) cmd ::= SHOW CREATE STABLE full_table_name */
  {  219,   -2 }, /* (190) cmd ::= SHOW QUERIES */
  {  219,   -2 }, /* (191) cmd ::= SHOW SCORES */
  {  219,   -2 }, /* (192) cmd ::= SHOW TOPICS */
  {  219,   -2 }, /* (193) cmd ::= SHOW VARIABLES */
  {  219,   -2 }, /* (194) cmd ::= SHOW BNODES */
  {  219,   -2 }, /* (195) cmd ::= SHOW SNODES */
  {  258,    0 }, /* (196) db_name_cond_opt ::= */
  {  258,   -2 }, /* (197) db_name_cond_opt ::= db_name NK_DOT */
  {  259,    0 }, /* (198) like_pattern_opt ::= */
  {  259,   -2 }, /* (199) like_pattern_opt ::= LIKE NK_STRING */
  {  260,   -1 }, /* (200) table_name_cond ::= table_name */
  {  261,    0 }, /* (201) from_db_opt ::= */
  {  261,   -2 }, /* (202) from_db_opt ::= FROM db_name */
  {  255,   -1 }, /* (203) func_name_list ::= func_name */
  {  255,   -3 }, /* (204) func_name_list ::= func_name_list NK_COMMA col_name */
  {  262,   -1 }, /* (205) func_name ::= function_name */
  {  219,   -8 }, /* (206) cmd ::= CREATE SMA INDEX not_exists_opt index_name ON table_name index_options */
  {  219,  -10 }, /* (207) cmd ::= CREATE FULLTEXT INDEX not_exists_opt index_name ON table_name NK_LP col_name_list NK_RP */
  {  219,   -6 }, /* (208) cmd ::= DROP INDEX exists_opt index_name ON table_name */
  {  265,    0 }, /* (209) index_options ::= */
  {  265,   -9 }, /* (210) index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt */
  {  265,  -11 }, /* (211) index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt */
  {  266,   -1 }, /* (212) func_list ::= func */
  {  266,   -3 }, /* (213) func_list ::= func_list NK_COMMA func */
  {  269,   -4 }, /* (214) func ::= function_name NK_LP expression_list NK_RP */
  {  219,   -6 }, /* (215) cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_expression */
  {  219,   -6 }, /* (216) cmd ::= CREATE TOPIC not_exists_opt topic_name AS db_name */
  {  219,   -4 }, /* (217) cmd ::= DROP TOPIC exists_opt topic_name */
  {  219,   -2 }, /* (218) cmd ::= DESC full_table_name */
  {  219,   -2 }, /* (219) cmd ::= DESCRIBE full_table_name */
  {  219,   -3 }, /* (220) cmd ::= RESET QUERY CACHE */
  {  219,   -4 }, /* (221) cmd ::= EXPLAIN analyze_opt explain_options query_expression */
  {  273,    0 }, /* (222) analyze_opt ::= */
  {  273,   -1 }, /* (223) analyze_opt ::= ANALYZE */
  {  274,    0 }, /* (224) explain_options ::= */
  {  274,   -3 }, /* (225) explain_options ::= explain_options VERBOSE NK_BOOL */
  {  274,   -3 }, /* (226) explain_options ::= explain_options RATIO NK_FLOAT */
  {  219,   -6 }, /* (227) cmd ::= COMPACT VNODES IN NK_LP integer_list NK_RP */
  {  219,   -9 }, /* (228) cmd ::= CREATE agg_func_opt FUNCTION function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt */
  {  219,   -3 }, /* (229) cmd ::= DROP FUNCTION function_name */
  {  275,    0 }, /* (230) agg_func_opt ::= */
  {  275,   -1 }, /* (231) agg_func_opt ::= AGGREGATE */
  {  276,    0 }, /* (232) bufsize_opt ::= */
  {  276,   -2 }, /* (233) bufsize_opt ::= BUFSIZE NK_INTEGER */
  {  219,   -8 }, /* (234) cmd ::= CREATE STREAM not_exists_opt stream_name stream_options into_opt AS query_expression */
  {  219,   -4 }, /* (235) cmd ::= DROP STREAM exists_opt stream_name */
  {  279,    0 }, /* (236) into_opt ::= */
  {  279,   -2 }, /* (237) into_opt ::= INTO full_table_name */
  {  278,    0 }, /* (238) stream_options ::= */
  {  278,   -3 }, /* (239) stream_options ::= stream_options TRIGGER AT_ONCE */
  {  278,   -3 }, /* (240) stream_options ::= stream_options TRIGGER WINDOW_CLOSE */
  {  278,   -3 }, /* (241) stream_options ::= stream_options WATERMARK duration_literal */
  {  219,   -3 }, /* (242) cmd ::= KILL CONNECTION NK_INTEGER */
  {  219,   -3 }, /* (243) cmd ::= KILL QUERY NK_INTEGER */
  {  219,   -4 }, /* (244) cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER */
  {  219,   -4 }, /* (245) cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list */
  {  219,   -3 }, /* (246) cmd ::= SPLIT VGROUP NK_INTEGER */
  {  280,   -2 }, /* (247) dnode_list ::= DNODE NK_INTEGER */
  {  280,   -3 }, /* (248) dnode_list ::= dnode_list DNODE NK_INTEGER */
  {  219,   -3 }, /* (249) cmd ::= SYNCDB db_name REPLICA */
  {  219,   -1 }, /* (250) cmd ::= query_expression */
  {  222,   -1 }, /* (251) literal ::= NK_INTEGER */
  {  222,   -1 }, /* (252) literal ::= NK_FLOAT */
  {  222,   -1 }, /* (253) literal ::= NK_STRING */
  {  222,   -1 }, /* (254) literal ::= NK_BOOL */
  {  222,   -2 }, /* (255) literal ::= TIMESTAMP NK_STRING */
  {  222,   -1 }, /* (256) literal ::= duration_literal */
  {  222,   -1 }, /* (257) literal ::= NULL */
  {  222,   -1 }, /* (258) literal ::= NK_QUESTION */
  {  267,   -1 }, /* (259) duration_literal ::= NK_VARIABLE */
  {  281,   -1 }, /* (260) signed ::= NK_INTEGER */
  {  281,   -2 }, /* (261) signed ::= NK_PLUS NK_INTEGER */
  {  281,   -2 }, /* (262) signed ::= NK_MINUS NK_INTEGER */
  {  281,   -1 }, /* (263) signed ::= NK_FLOAT */
  {  281,   -2 }, /* (264) signed ::= NK_PLUS NK_FLOAT */
  {  281,   -2 }, /* (265) signed ::= NK_MINUS NK_FLOAT */
  {  282,   -1 }, /* (266) signed_literal ::= signed */
  {  282,   -1 }, /* (267) signed_literal ::= NK_STRING */
  {  282,   -1 }, /* (268) signed_literal ::= NK_BOOL */
  {  282,   -2 }, /* (269) signed_literal ::= TIMESTAMP NK_STRING */
  {  282,   -1 }, /* (270) signed_literal ::= duration_literal */
  {  282,   -1 }, /* (271) signed_literal ::= NULL */
  {  250,   -1 }, /* (272) literal_list ::= signed_literal */
  {  250,   -3 }, /* (273) literal_list ::= literal_list NK_COMMA signed_literal */
  {  228,   -1 }, /* (274) db_name ::= NK_ID */
  {  253,   -1 }, /* (275) table_name ::= NK_ID */
  {  246,   -1 }, /* (276) column_name ::= NK_ID */
  {  263,   -1 }, /* (277) function_name ::= NK_ID */
  {  283,   -1 }, /* (278) table_alias ::= NK_ID */
  {  284,   -1 }, /* (279) column_alias ::= NK_ID */
  {  224,   -1 }, /* (280) user_name ::= NK_ID */
  {  264,   -1 }, /* (281) index_name ::= NK_ID */
  {  271,   -1 }, /* (282) topic_name ::= NK_ID */
  {  277,   -1 }, /* (283) stream_name ::= NK_ID */
  {  285,   -1 }, /* (284) expression ::= literal */
  {  285,   -1 }, /* (285) expression ::= pseudo_column */
  {  285,   -1 }, /* (286) expression ::= column_reference */
  {  285,   -1 }, /* (287) expression ::= function_expression */
  {  285,   -1 }, /* (288) expression ::= subquery */
  {  285,   -3 }, /* (289) expression ::= NK_LP expression NK_RP */
  {  285,   -2 }, /* (290) expression ::= NK_PLUS expression */
  {  285,   -2 }, /* (291) expression ::= NK_MINUS expression */
  {  285,   -3 }, /* (292) expression ::= expression NK_PLUS expression */
  {  285,   -3 }, /* (293) expression ::= expression NK_MINUS expression */
  {  285,   -3 }, /* (294) expression ::= expression NK_STAR expression */
  {  285,   -3 }, /* (295) expression ::= expression NK_SLASH expression */
  {  285,   -3 }, /* (296) expression ::= expression NK_REM expression */
  {  285,   -3 }, /* (297) expression ::= column_reference NK_ARROW NK_STRING */
  {  270,   -1 }, /* (298) expression_list ::= expression */
  {  270,   -3 }, /* (299) expression_list ::= expression_list NK_COMMA expression */
  {  287,   -1 }, /* (300) column_reference ::= column_name */
  {  287,   -3 }, /* (301) column_reference ::= table_name NK_DOT column_name */
  {  286,   -1 }, /* (302) pseudo_column ::= NOW */
  {  286,   -1 }, /* (303) pseudo_column ::= TODAY */
  {  286,   -1 }, /* (304) pseudo_column ::= ROWTS */
  {  286,   -1 }, /* (305) pseudo_column ::= TBNAME */
  {  286,   -1 }, /* (306) pseudo_column ::= QSTARTTS */
  {  286,   -1 }, /* (307) pseudo_column ::= QENDTS */
  {  286,   -1 }, /* (308) pseudo_column ::= WSTARTTS */
  {  286,   -1 }, /* (309) pseudo_column ::= WENDTS */
  {  286,   -1 }, /* (310) pseudo_column ::= WDURATION */
  {  288,   -4 }, /* (311) function_expression ::= function_name NK_LP expression_list NK_RP */
  {  288,   -4 }, /* (312) function_expression ::= star_func NK_LP star_func_para_list NK_RP */
  {  288,   -6 }, /* (313) function_expression ::= CAST NK_LP expression AS type_name NK_RP */
  {  290,   -1 }, /* (314) star_func ::= COUNT */
  {  290,   -1 }, /* (315) star_func ::= FIRST */
  {  290,   -1 }, /* (316) star_func ::= LAST */
  {  290,   -1 }, /* (317) star_func ::= LAST_ROW */
  {  291,   -1 }, /* (318) star_func_para_list ::= NK_STAR */
  {  291,   -1 }, /* (319) star_func_para_list ::= other_para_list */
  {  292,   -1 }, /* (320) other_para_list ::= star_func_para */
  {  292,   -3 }, /* (321) other_para_list ::= other_para_list NK_COMMA star_func_para */
  {  293,   -1 }, /* (322) star_func_para ::= expression */
  {  293,   -3 }, /* (323) star_func_para ::= table_name NK_DOT NK_STAR */
  {  294,   -3 }, /* (324) predicate ::= expression compare_op expression */
  {  294,   -5 }, /* (325) predicate ::= expression BETWEEN expression AND expression */
  {  294,   -6 }, /* (326) predicate ::= expression NOT BETWEEN expression AND expression */
  {  294,   -3 }, /* (327) predicate ::= expression IS NULL */
  {  294,   -4 }, /* (328) predicate ::= expression IS NOT NULL */
  {  294,   -3 }, /* (329) predicate ::= expression in_op in_predicate_value */
  {  295,   -1 }, /* (330) compare_op ::= NK_LT */
  {  295,   -1 }, /* (331) compare_op ::= NK_GT */
  {  295,   -1 }, /* (332) compare_op ::= NK_LE */
  {  295,   -1 }, /* (333) compare_op ::= NK_GE */
  {  295,   -1 }, /* (334) compare_op ::= NK_NE */
  {  295,   -1 }, /* (335) compare_op ::= NK_EQ */
  {  295,   -1 }, /* (336) compare_op ::= LIKE */
  {  295,   -2 }, /* (337) compare_op ::= NOT LIKE */
  {  295,   -1 }, /* (338) compare_op ::= MATCH */
  {  295,   -1 }, /* (339) compare_op ::= NMATCH */
  {  295,   -1 }, /* (340) compare_op ::= CONTAINS */
  {  296,   -1 }, /* (341) in_op ::= IN */
  {  296,   -2 }, /* (342) in_op ::= NOT IN */
  {  297,   -3 }, /* (343) in_predicate_value ::= NK_LP expression_list NK_RP */
  {  298,   -1 }, /* (344) boolean_value_expression ::= boolean_primary */
  {  298,   -2 }, /* (345) boolean_value_expression ::= NOT boolean_primary */
  {  298,   -3 }, /* (346) boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */
  {  298,   -3 }, /* (347) boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */
  {  299,   -1 }, /* (348) boolean_primary ::= predicate */
  {  299,   -3 }, /* (349) boolean_primary ::= NK_LP boolean_value_expression NK_RP */
  {  300,   -1 }, /* (350) common_expression ::= expression */
  {  300,   -1 }, /* (351) common_expression ::= boolean_value_expression */
  {  301,   -2 }, /* (352) from_clause ::= FROM table_reference_list */
  {  302,   -1 }, /* (353) table_reference_list ::= table_reference */
  {  302,   -3 }, /* (354) table_reference_list ::= table_reference_list NK_COMMA table_reference */
  {  303,   -1 }, /* (355) table_reference ::= table_primary */
  {  303,   -1 }, /* (356) table_reference ::= joined_table */
  {  304,   -2 }, /* (357) table_primary ::= table_name alias_opt */
  {  304,   -4 }, /* (358) table_primary ::= db_name NK_DOT table_name alias_opt */
  {  304,   -2 }, /* (359) table_primary ::= subquery alias_opt */
  {  304,   -1 }, /* (360) table_primary ::= parenthesized_joined_table */
  {  306,    0 }, /* (361) alias_opt ::= */
  {  306,   -1 }, /* (362) alias_opt ::= table_alias */
  {  306,   -2 }, /* (363) alias_opt ::= AS table_alias */
  {  307,   -3 }, /* (364) parenthesized_joined_table ::= NK_LP joined_table NK_RP */
  {  307,   -3 }, /* (365) parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */
  {  305,   -6 }, /* (366) joined_table ::= table_reference join_type JOIN table_reference ON search_condition */
  {  308,    0 }, /* (367) join_type ::= */
  {  308,   -1 }, /* (368) join_type ::= INNER */
  {  310,   -9 }, /* (369) query_specification ::= SELECT set_quantifier_opt select_list from_clause where_clause_opt partition_by_clause_opt twindow_clause_opt group_by_clause_opt having_clause_opt */
  {  311,    0 }, /* (370) set_quantifier_opt ::= */
  {  311,   -1 }, /* (371) set_quantifier_opt ::= DISTINCT */
  {  311,   -1 }, /* (372) set_quantifier_opt ::= ALL */
  {  312,   -1 }, /* (373) select_list ::= NK_STAR */
  {  312,   -1 }, /* (374) select_list ::= select_sublist */
  {  318,   -1 }, /* (375) select_sublist ::= select_item */
  {  318,   -3 }, /* (376) select_sublist ::= select_sublist NK_COMMA select_item */
  {  319,   -1 }, /* (377) select_item ::= common_expression */
  {  319,   -2 }, /* (378) select_item ::= common_expression column_alias */
  {  319,   -3 }, /* (379) select_item ::= common_expression AS column_alias */
  {  319,   -3 }, /* (380) select_item ::= table_name NK_DOT NK_STAR */
  {  313,    0 }, /* (381) where_clause_opt ::= */
  {  313,   -2 }, /* (382) where_clause_opt ::= WHERE search_condition */
  {  314,    0 }, /* (383) partition_by_clause_opt ::= */
  {  314,   -3 }, /* (384) partition_by_clause_opt ::= PARTITION BY expression_list */
  {  315,    0 }, /* (385) twindow_clause_opt ::= */
  {  315,   -6 }, /* (386) twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP */
  {  315,   -4 }, /* (387) twindow_clause_opt ::= STATE_WINDOW NK_LP expression NK_RP */
  {  315,   -6 }, /* (388) twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt */
  {  315,   -8 }, /* (389) twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt */
  {  268,    0 }, /* (390) sliding_opt ::= */
  {  268,   -4 }, /* (391) sliding_opt ::= SLIDING NK_LP duration_literal NK_RP */
  {  320,    0 }, /* (392) fill_opt ::= */
  {  320,   -4 }, /* (393) fill_opt ::= FILL NK_LP fill_mode NK_RP */
  {  320,   -6 }, /* (394) fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP */
  {  321,   -1 }, /* (395) fill_mode ::= NONE */
  {  321,   -1 }, /* (396) fill_mode ::= PREV */
  {  321,   -1 }, /* (397) fill_mode ::= NULL */
  {  321,   -1 }, /* (398) fill_mode ::= LINEAR */
  {  321,   -1 }, /* (399) fill_mode ::= NEXT */
  {  316,    0 }, /* (400) group_by_clause_opt ::= */
  {  316,   -3 }, /* (401) group_by_clause_opt ::= GROUP BY group_by_list */
  {  322,   -1 }, /* (402) group_by_list ::= expression */
  {  322,   -3 }, /* (403) group_by_list ::= group_by_list NK_COMMA expression */
  {  317,    0 }, /* (404) having_clause_opt ::= */
  {  317,   -2 }, /* (405) having_clause_opt ::= HAVING search_condition */
  {  272,   -4 }, /* (406) query_expression ::= query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt */
  {  323,   -1 }, /* (407) query_expression_body ::= query_primary */
  {  323,   -4 }, /* (408) query_expression_body ::= query_expression_body UNION ALL query_expression_body */
  {  327,   -1 }, /* (409) query_primary ::= query_specification */
  {  324,    0 }, /* (410) order_by_clause_opt ::= */
  {  324,   -3 }, /* (411) order_by_clause_opt ::= ORDER BY sort_specification_list */
  {  325,    0 }, /* (412) slimit_clause_opt ::= */
  {  325,   -2 }, /* (413) slimit_clause_opt ::= SLIMIT NK_INTEGER */
  {  325,   -4 }, /* (414) slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */
  {  325,   -4 }, /* (415) slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */
  {  326,    0 }, /* (416) limit_clause_opt ::= */
  {  326,   -2 }, /* (417) limit_clause_opt ::= LIMIT NK_INTEGER */
  {  326,   -4 }, /* (418) limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */
  {  326,   -4 }, /* (419) limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */
  {  289,   -3 }, /* (420) subquery ::= NK_LP query_expression NK_RP */
  {  309,   -1 }, /* (421) search_condition ::= common_expression */
  {  328,   -1 }, /* (422) sort_specification_list ::= sort_specification */
  {  328,   -3 }, /* (423) sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */
  {  329,   -3 }, /* (424) sort_specification ::= expression ordering_specification_opt null_ordering_opt */
  {  330,    0 }, /* (425) ordering_specification_opt ::= */
  {  330,   -1 }, /* (426) ordering_specification_opt ::= ASC */
  {  330,   -1 }, /* (427) ordering_specification_opt ::= DESC */
  {  331,    0 }, /* (428) null_ordering_opt ::= */
  {  331,   -2 }, /* (429) null_ordering_opt ::= NULLS FIRST */
  {  331,   -2 }, /* (430) null_ordering_opt ::= NULLS LAST */
2635 2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 2651 2652
};

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 已提交
2653 2654
  ParseTOKENTYPE yyLookaheadToken  /* Value of the lookahead token */
  ParseCTX_PDECL                   /* %extra_context */
2655 2656 2657 2658 2659
){
  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 已提交
2660
  ParseARG_FETCH
2661 2662 2663 2664 2665
  (void)yyLookahead;
  (void)yyLookaheadToken;
  yymsp = yypParser->yytos;
#ifndef NDEBUG
  if( yyTraceFILE && yyruleno<(int)(sizeof(yyRuleName)/sizeof(yyRuleName[0])) ){
2666
    yysize = yyRuleInfo[yyruleno].nrhs;
2667
    if( yysize ){
2668
      fprintf(yyTraceFILE, "%sReduce %d [%s], go to state %d.\n",
2669
        yyTracePrompt,
2670
        yyruleno, yyRuleName[yyruleno], yymsp[yysize].stateno);
2671
    }else{
2672 2673
      fprintf(yyTraceFILE, "%sReduce %d [%s].\n",
        yyTracePrompt, yyruleno, yyRuleName[yyruleno]);
2674 2675 2676 2677 2678 2679 2680
    }
  }
#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 */
2681
  if( yyRuleInfo[yyruleno].nrhs==0 ){
2682 2683 2684 2685 2686 2687 2688 2689 2690 2691 2692 2693 2694 2695 2696 2697 2698 2699 2700 2701 2702 2703 2704 2705 2706 2707 2708 2709 2710 2711 2712 2713 2714 2715 2716 2717 2718 2719 2720
#ifdef YYTRACKMAXSTACKDEPTH
    if( (int)(yypParser->yytos - yypParser->yystack)>yypParser->yyhwm ){
      yypParser->yyhwm++;
      assert( yypParser->yyhwm == (int)(yypParser->yytos - yypParser->yystack));
    }
#endif
#if YYSTACKDEPTH>0 
    if( yypParser->yytos>=yypParser->yystackEnd ){
      yyStackOverflow(yypParser);
      /* The call to yyStackOverflow() above pops the stack until it is
      ** empty, causing the main parser loop to exit.  So the return value
      ** is never used and does not matter. */
      return 0;
    }
#else
    if( yypParser->yytos>=&yypParser->yystack[yypParser->yystksz-1] ){
      if( yyGrowStack(yypParser) ){
        yyStackOverflow(yypParser);
        /* The call to yyStackOverflow() above pops the stack until it is
        ** empty, causing the main parser loop to exit.  So the return value
        ** is never used and does not matter. */
        return 0;
      }
      yymsp = yypParser->yytos;
    }
#endif
  }

  switch( yyruleno ){
  /* Beginning here are the reduction cases.  A typical example
  ** follows:
  **   case 0:
  **  #line <lineno> <grammarfile>
  **     { ... }           // User supplied code
  **  #line <lineno> <thisfile>
  **     break;
  */
/********** Begin reduce actions **********************************************/
        YYMINORTYPE yylhsminor;
2721
      case 0: /* cmd ::= CREATE ACCOUNT NK_ID PASS NK_STRING account_options */
2722
{ pCxt->valid = false; generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_EXPRIE_STATEMENT); }
2723
  yy_destructor(yypParser,220,&yymsp[0].minor);
2724
        break;
2725 2726
      case 1: /* cmd ::= ALTER ACCOUNT NK_ID alter_account_options */
{ pCxt->valid = false; generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_EXPRIE_STATEMENT); }
2727
  yy_destructor(yypParser,221,&yymsp[0].minor);
2728 2729 2730 2731 2732 2733 2734 2735 2736 2737 2738 2739 2740
        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);
2741
{  yy_destructor(yypParser,220,&yymsp[-2].minor);
2742
{ }
2743
  yy_destructor(yypParser,222,&yymsp[0].minor);
2744
}
2745
        break;
2746
      case 12: /* alter_account_options ::= alter_account_option */
2747
{  yy_destructor(yypParser,223,&yymsp[0].minor);
2748 2749 2750
{ }
}
        break;
2751
      case 13: /* alter_account_options ::= alter_account_options alter_account_option */
2752
{  yy_destructor(yypParser,221,&yymsp[-1].minor);
2753
{ }
2754
  yy_destructor(yypParser,223,&yymsp[0].minor);
2755 2756 2757 2758 2759 2760 2761 2762 2763 2764 2765 2766
}
        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);
2767
{ }
2768
  yy_destructor(yypParser,222,&yymsp[0].minor);
2769
        break;
2770
      case 24: /* cmd ::= CREATE USER user_name PASS NK_STRING */
2771
{ pCxt->pRootNode = createCreateUserStmt(pCxt, &yymsp[-2].minor.yy353, &yymsp[0].minor.yy0); }
2772
        break;
2773
      case 25: /* cmd ::= ALTER USER user_name PASS NK_STRING */
2774
{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy353, TSDB_ALTER_USER_PASSWD, &yymsp[0].minor.yy0); }
2775
        break;
2776
      case 26: /* cmd ::= ALTER USER user_name PRIVILEGE NK_STRING */
2777
{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy353, TSDB_ALTER_USER_PRIVILEGES, &yymsp[0].minor.yy0); }
2778
        break;
2779
      case 27: /* cmd ::= DROP USER user_name */
2780
{ pCxt->pRootNode = createDropUserStmt(pCxt, &yymsp[0].minor.yy353); }
2781
        break;
X
Xiaoyu Wang 已提交
2782
      case 28: /* cmd ::= CREATE DNODE dnode_endpoint */
2783
{ pCxt->pRootNode = createCreateDnodeStmt(pCxt, &yymsp[0].minor.yy353, NULL); }
2784
        break;
X
Xiaoyu Wang 已提交
2785
      case 29: /* cmd ::= CREATE DNODE dnode_host_name PORT NK_INTEGER */
2786
{ pCxt->pRootNode = createCreateDnodeStmt(pCxt, &yymsp[-2].minor.yy353, &yymsp[0].minor.yy0); }
2787
        break;
X
Xiaoyu Wang 已提交
2788
      case 30: /* cmd ::= DROP DNODE NK_INTEGER */
2789
{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[0].minor.yy0); }
2790
        break;
X
Xiaoyu Wang 已提交
2791
      case 31: /* cmd ::= DROP DNODE dnode_endpoint */
2792
{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[0].minor.yy353); }
2793
        break;
X
Xiaoyu Wang 已提交
2794
      case 32: /* cmd ::= ALTER DNODE NK_INTEGER NK_STRING */
2795 2796
{ pCxt->pRootNode = createAlterDnodeStmt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0, NULL); }
        break;
X
Xiaoyu Wang 已提交
2797
      case 33: /* cmd ::= ALTER DNODE NK_INTEGER NK_STRING NK_STRING */
2798 2799
{ pCxt->pRootNode = createAlterDnodeStmt(pCxt, &yymsp[-2].minor.yy0, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0); }
        break;
X
Xiaoyu Wang 已提交
2800
      case 34: /* cmd ::= ALTER ALL DNODES NK_STRING */
2801 2802
{ pCxt->pRootNode = createAlterDnodeStmt(pCxt, NULL, &yymsp[0].minor.yy0, NULL); }
        break;
X
Xiaoyu Wang 已提交
2803
      case 35: /* cmd ::= ALTER ALL DNODES NK_STRING NK_STRING */
2804 2805
{ pCxt->pRootNode = createAlterDnodeStmt(pCxt, NULL, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0); }
        break;
X
Xiaoyu Wang 已提交
2806 2807 2808
      case 36: /* dnode_endpoint ::= NK_STRING */
      case 37: /* dnode_host_name ::= NK_ID */ yytestcase(yyruleno==37);
      case 38: /* dnode_host_name ::= NK_IPTOKEN */ yytestcase(yyruleno==38);
2809 2810 2811 2812 2813 2814 2815 2816 2817 2818 2819 2820 2821 2822 2823 2824
      case 274: /* db_name ::= NK_ID */ yytestcase(yyruleno==274);
      case 275: /* table_name ::= NK_ID */ yytestcase(yyruleno==275);
      case 276: /* column_name ::= NK_ID */ yytestcase(yyruleno==276);
      case 277: /* function_name ::= NK_ID */ yytestcase(yyruleno==277);
      case 278: /* table_alias ::= NK_ID */ yytestcase(yyruleno==278);
      case 279: /* column_alias ::= NK_ID */ yytestcase(yyruleno==279);
      case 280: /* user_name ::= NK_ID */ yytestcase(yyruleno==280);
      case 281: /* index_name ::= NK_ID */ yytestcase(yyruleno==281);
      case 282: /* topic_name ::= NK_ID */ yytestcase(yyruleno==282);
      case 283: /* stream_name ::= NK_ID */ yytestcase(yyruleno==283);
      case 314: /* star_func ::= COUNT */ yytestcase(yyruleno==314);
      case 315: /* star_func ::= FIRST */ yytestcase(yyruleno==315);
      case 316: /* star_func ::= LAST */ yytestcase(yyruleno==316);
      case 317: /* star_func ::= LAST_ROW */ yytestcase(yyruleno==317);
{ yylhsminor.yy353 = yymsp[0].minor.yy0; }
  yymsp[0].minor.yy353 = yylhsminor.yy353;
X
Xiaoyu Wang 已提交
2825 2826
        break;
      case 39: /* cmd ::= ALTER LOCAL NK_STRING */
2827 2828
{ pCxt->pRootNode = createAlterLocalStmt(pCxt, &yymsp[0].minor.yy0, NULL); }
        break;
X
Xiaoyu Wang 已提交
2829
      case 40: /* cmd ::= ALTER LOCAL NK_STRING NK_STRING */
2830 2831
{ pCxt->pRootNode = createAlterLocalStmt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0); }
        break;
X
Xiaoyu Wang 已提交
2832
      case 41: /* cmd ::= CREATE QNODE ON DNODE NK_INTEGER */
2833
{ pCxt->pRootNode = createCreateComponentNodeStmt(pCxt, QUERY_NODE_CREATE_QNODE_STMT, &yymsp[0].minor.yy0); }
X
Xiaoyu Wang 已提交
2834
        break;
X
Xiaoyu Wang 已提交
2835
      case 42: /* cmd ::= DROP QNODE ON DNODE NK_INTEGER */
2836
{ pCxt->pRootNode = createDropComponentNodeStmt(pCxt, QUERY_NODE_DROP_QNODE_STMT, &yymsp[0].minor.yy0); }
2837
        break;
2838 2839
      case 43: /* cmd ::= CREATE BNODE ON DNODE NK_INTEGER */
{ pCxt->pRootNode = createCreateComponentNodeStmt(pCxt, QUERY_NODE_CREATE_BNODE_STMT, &yymsp[0].minor.yy0); }
X
Xiaoyu Wang 已提交
2840
        break;
2841 2842
      case 44: /* cmd ::= DROP BNODE ON DNODE NK_INTEGER */
{ pCxt->pRootNode = createDropComponentNodeStmt(pCxt, QUERY_NODE_DROP_BNODE_STMT, &yymsp[0].minor.yy0); }
X
Xiaoyu Wang 已提交
2843
        break;
2844 2845
      case 45: /* cmd ::= CREATE SNODE ON DNODE NK_INTEGER */
{ pCxt->pRootNode = createCreateComponentNodeStmt(pCxt, QUERY_NODE_CREATE_SNODE_STMT, &yymsp[0].minor.yy0); }
2846
        break;
2847 2848
      case 46: /* cmd ::= DROP SNODE ON DNODE NK_INTEGER */
{ pCxt->pRootNode = createDropComponentNodeStmt(pCxt, QUERY_NODE_DROP_SNODE_STMT, &yymsp[0].minor.yy0); }
2849
        break;
2850 2851
      case 47: /* cmd ::= CREATE MNODE ON DNODE NK_INTEGER */
{ pCxt->pRootNode = createCreateComponentNodeStmt(pCxt, QUERY_NODE_CREATE_MNODE_STMT, &yymsp[0].minor.yy0); }
2852
        break;
2853 2854
      case 48: /* cmd ::= DROP MNODE ON DNODE NK_INTEGER */
{ pCxt->pRootNode = createDropComponentNodeStmt(pCxt, QUERY_NODE_DROP_MNODE_STMT, &yymsp[0].minor.yy0); }
2855
        break;
2856
      case 49: /* cmd ::= CREATE DATABASE not_exists_opt db_name db_options */
2857
{ pCxt->pRootNode = createCreateDatabaseStmt(pCxt, yymsp[-2].minor.yy273, &yymsp[-1].minor.yy353, yymsp[0].minor.yy192); }
2858
        break;
2859
      case 50: /* cmd ::= DROP DATABASE exists_opt db_name */
2860
{ pCxt->pRootNode = createDropDatabaseStmt(pCxt, yymsp[-1].minor.yy273, &yymsp[0].minor.yy353); }
2861
        break;
2862
      case 51: /* cmd ::= USE db_name */
2863
{ pCxt->pRootNode = createUseDatabaseStmt(pCxt, &yymsp[0].minor.yy353); }
2864
        break;
2865
      case 52: /* cmd ::= ALTER DATABASE db_name alter_db_options */
2866
{ pCxt->pRootNode = createAlterDatabaseStmt(pCxt, &yymsp[-1].minor.yy353, yymsp[0].minor.yy192); }
2867
        break;
2868
      case 53: /* not_exists_opt ::= IF NOT EXISTS */
2869
{ yymsp[-2].minor.yy273 = true; }
2870
        break;
2871 2872
      case 54: /* not_exists_opt ::= */
      case 56: /* exists_opt ::= */ yytestcase(yyruleno==56);
2873 2874 2875 2876
      case 222: /* analyze_opt ::= */ yytestcase(yyruleno==222);
      case 230: /* agg_func_opt ::= */ yytestcase(yyruleno==230);
      case 370: /* set_quantifier_opt ::= */ yytestcase(yyruleno==370);
{ yymsp[1].minor.yy273 = false; }
2877
        break;
2878
      case 55: /* exists_opt ::= IF EXISTS */
2879
{ yymsp[-1].minor.yy273 = true; }
X
Xiaoyu Wang 已提交
2880
        break;
2881
      case 57: /* db_options ::= */
2882
{ yymsp[1].minor.yy192 = createDatabaseOptions(pCxt); }
2883
        break;
2884
      case 58: /* db_options ::= db_options BLOCKS NK_INTEGER */
2885 2886
{ ((SDatabaseOptions*)yymsp[-2].minor.yy192)->pNumOfBlocks = (SValueNode*)createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); yylhsminor.yy192 = yymsp[-2].minor.yy192; }
  yymsp[-2].minor.yy192 = yylhsminor.yy192;
2887
        break;
2888
      case 59: /* db_options ::= db_options CACHE NK_INTEGER */
2889 2890
{ ((SDatabaseOptions*)yymsp[-2].minor.yy192)->pCacheBlockSize = (SValueNode*)createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); yylhsminor.yy192 = yymsp[-2].minor.yy192; }
  yymsp[-2].minor.yy192 = yylhsminor.yy192;
X
Xiaoyu Wang 已提交
2891
        break;
2892
      case 60: /* db_options ::= db_options CACHELAST NK_INTEGER */
2893 2894
{ ((SDatabaseOptions*)yymsp[-2].minor.yy192)->pCachelast = (SValueNode*)createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); yylhsminor.yy192 = yymsp[-2].minor.yy192; }
  yymsp[-2].minor.yy192 = yylhsminor.yy192;
X
Xiaoyu Wang 已提交
2895
        break;
2896
      case 61: /* db_options ::= db_options COMP NK_INTEGER */
2897 2898
{ ((SDatabaseOptions*)yymsp[-2].minor.yy192)->pCompressionLevel = (SValueNode*)createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); yylhsminor.yy192 = yymsp[-2].minor.yy192; }
  yymsp[-2].minor.yy192 = yylhsminor.yy192;
X
Xiaoyu Wang 已提交
2899
        break;
2900
      case 62: /* db_options ::= db_options DAYS NK_INTEGER */
2901 2902
{ ((SDatabaseOptions*)yymsp[-2].minor.yy192)->pDaysPerFile = (SValueNode*)createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); yylhsminor.yy192 = yymsp[-2].minor.yy192; }
  yymsp[-2].minor.yy192 = yylhsminor.yy192;
X
Xiaoyu Wang 已提交
2903
        break;
2904
      case 63: /* db_options ::= db_options DAYS NK_VARIABLE */
2905 2906
{ ((SDatabaseOptions*)yymsp[-2].minor.yy192)->pDaysPerFile = (SValueNode*)createDurationValueNode(pCxt, &yymsp[0].minor.yy0); yylhsminor.yy192 = yymsp[-2].minor.yy192; }
  yymsp[-2].minor.yy192 = yylhsminor.yy192;
X
Xiaoyu Wang 已提交
2907
        break;
2908
      case 64: /* db_options ::= db_options FSYNC NK_INTEGER */
2909 2910
{ ((SDatabaseOptions*)yymsp[-2].minor.yy192)->pFsyncPeriod = (SValueNode*)createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); yylhsminor.yy192 = yymsp[-2].minor.yy192; }
  yymsp[-2].minor.yy192 = yylhsminor.yy192;
X
Xiaoyu Wang 已提交
2911
        break;
2912
      case 65: /* db_options ::= db_options MAXROWS NK_INTEGER */
2913 2914
{ ((SDatabaseOptions*)yymsp[-2].minor.yy192)->pMaxRowsPerBlock = (SValueNode*)createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); yylhsminor.yy192 = yymsp[-2].minor.yy192; }
  yymsp[-2].minor.yy192 = yylhsminor.yy192;
X
Xiaoyu Wang 已提交
2915
        break;
2916
      case 66: /* db_options ::= db_options MINROWS NK_INTEGER */
2917 2918
{ ((SDatabaseOptions*)yymsp[-2].minor.yy192)->pMinRowsPerBlock = (SValueNode*)createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); yylhsminor.yy192 = yymsp[-2].minor.yy192; }
  yymsp[-2].minor.yy192 = yylhsminor.yy192;
X
Xiaoyu Wang 已提交
2919
        break;
2920 2921
      case 67: /* db_options ::= db_options KEEP integer_list */
      case 68: /* db_options ::= db_options KEEP variable_list */ yytestcase(yyruleno==68);
2922 2923
{ ((SDatabaseOptions*)yymsp[-2].minor.yy192)->pKeep = yymsp[0].minor.yy64; yylhsminor.yy192 = yymsp[-2].minor.yy192; }
  yymsp[-2].minor.yy192 = yylhsminor.yy192;
X
Xiaoyu Wang 已提交
2924
        break;
2925
      case 69: /* db_options ::= db_options PRECISION NK_STRING */
2926 2927
{ ((SDatabaseOptions*)yymsp[-2].minor.yy192)->pPrecision = (SValueNode*)createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0); yylhsminor.yy192 = yymsp[-2].minor.yy192; }
  yymsp[-2].minor.yy192 = yylhsminor.yy192;
2928
        break;
2929
      case 70: /* db_options ::= db_options QUORUM NK_INTEGER */
2930 2931
{ ((SDatabaseOptions*)yymsp[-2].minor.yy192)->pQuorum = (SValueNode*)createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); yylhsminor.yy192 = yymsp[-2].minor.yy192; }
  yymsp[-2].minor.yy192 = yylhsminor.yy192;
2932
        break;
2933
      case 71: /* db_options ::= db_options REPLICA NK_INTEGER */
2934 2935
{ ((SDatabaseOptions*)yymsp[-2].minor.yy192)->pReplica = (SValueNode*)createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); yylhsminor.yy192 = yymsp[-2].minor.yy192; }
  yymsp[-2].minor.yy192 = yylhsminor.yy192;
2936
        break;
2937
      case 72: /* db_options ::= db_options TTL NK_INTEGER */
2938 2939
{ ((SDatabaseOptions*)yymsp[-2].minor.yy192)->pTtl = (SValueNode*)createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); yylhsminor.yy192 = yymsp[-2].minor.yy192; }
  yymsp[-2].minor.yy192 = yylhsminor.yy192;
2940
        break;
2941
      case 73: /* db_options ::= db_options WAL NK_INTEGER */
2942 2943
{ ((SDatabaseOptions*)yymsp[-2].minor.yy192)->pWalLevel = (SValueNode*)createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); yylhsminor.yy192 = yymsp[-2].minor.yy192; }
  yymsp[-2].minor.yy192 = yylhsminor.yy192;
2944 2945
        break;
      case 74: /* db_options ::= db_options VGROUPS NK_INTEGER */
2946 2947
{ ((SDatabaseOptions*)yymsp[-2].minor.yy192)->pNumOfVgroups = (SValueNode*)createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); yylhsminor.yy192 = yymsp[-2].minor.yy192; }
  yymsp[-2].minor.yy192 = yylhsminor.yy192;
2948
        break;
2949
      case 75: /* db_options ::= db_options SINGLE_STABLE NK_INTEGER */
2950 2951
{ ((SDatabaseOptions*)yymsp[-2].minor.yy192)->pSingleStable = (SValueNode*)createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); yylhsminor.yy192 = yymsp[-2].minor.yy192; }
  yymsp[-2].minor.yy192 = yylhsminor.yy192;
2952 2953
        break;
      case 76: /* db_options ::= db_options STREAM_MODE NK_INTEGER */
2954 2955
{ ((SDatabaseOptions*)yymsp[-2].minor.yy192)->pStreamMode = (SValueNode*)createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); yylhsminor.yy192 = yymsp[-2].minor.yy192; }
  yymsp[-2].minor.yy192 = yylhsminor.yy192;
2956 2957
        break;
      case 77: /* db_options ::= db_options RETENTIONS retention_list */
2958 2959
{ ((SDatabaseOptions*)yymsp[-2].minor.yy192)->pRetentions = yymsp[0].minor.yy64; yylhsminor.yy192 = yymsp[-2].minor.yy192; }
  yymsp[-2].minor.yy192 = yylhsminor.yy192;
2960 2961
        break;
      case 78: /* alter_db_options ::= alter_db_option */
2962 2963
{ yylhsminor.yy192 = createDatabaseOptions(pCxt); yylhsminor.yy192 = setDatabaseAlterOption(pCxt, yylhsminor.yy192, &yymsp[0].minor.yy277); }
  yymsp[0].minor.yy192 = yylhsminor.yy192;
2964 2965
        break;
      case 79: /* alter_db_options ::= alter_db_options alter_db_option */
2966 2967
{ yylhsminor.yy192 = setDatabaseAlterOption(pCxt, yymsp[-1].minor.yy192, &yymsp[0].minor.yy277); }
  yymsp[-1].minor.yy192 = yylhsminor.yy192;
2968 2969
        break;
      case 80: /* alter_db_option ::= BLOCKS NK_INTEGER */
2970
{ yymsp[-1].minor.yy277.type = DB_OPTION_BLOCKS; yymsp[-1].minor.yy277.pVal = (SValueNode*)createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); }
2971 2972
        break;
      case 81: /* alter_db_option ::= FSYNC NK_INTEGER */
2973
{ yymsp[-1].minor.yy277.type = DB_OPTION_FSYNC; yymsp[-1].minor.yy277.pVal = (SValueNode*)createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); }
2974 2975 2976
        break;
      case 82: /* alter_db_option ::= KEEP integer_list */
      case 83: /* alter_db_option ::= KEEP variable_list */ yytestcase(yyruleno==83);
2977
{ yymsp[-1].minor.yy277.type = DB_OPTION_KEEP; yymsp[-1].minor.yy277.pList = yymsp[0].minor.yy64; }
2978 2979
        break;
      case 84: /* alter_db_option ::= WAL NK_INTEGER */
2980
{ yymsp[-1].minor.yy277.type = DB_OPTION_WAL; yymsp[-1].minor.yy277.pVal = (SValueNode*)createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); }
2981 2982
        break;
      case 85: /* alter_db_option ::= QUORUM NK_INTEGER */
2983
{ yymsp[-1].minor.yy277.type = DB_OPTION_QUORUM; yymsp[-1].minor.yy277.pVal = (SValueNode*)createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); }
2984 2985
        break;
      case 86: /* alter_db_option ::= CACHELAST NK_INTEGER */
2986
{ yymsp[-1].minor.yy277.type = DB_OPTION_CACHELAST; yymsp[-1].minor.yy277.pVal = (SValueNode*)createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); }
2987 2988
        break;
      case 87: /* alter_db_option ::= REPLICA NK_INTEGER */
2989
{ yymsp[-1].minor.yy277.type = DB_OPTION_REPLICA; yymsp[-1].minor.yy277.pVal = (SValueNode*)createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); }
2990 2991
        break;
      case 88: /* integer_list ::= NK_INTEGER */
2992 2993
{ yylhsminor.yy64 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); }
  yymsp[0].minor.yy64 = yylhsminor.yy64;
2994 2995
        break;
      case 89: /* integer_list ::= integer_list NK_COMMA NK_INTEGER */
2996 2997 2998
      case 248: /* dnode_list ::= dnode_list DNODE NK_INTEGER */ yytestcase(yyruleno==248);
{ yylhsminor.yy64 = addNodeToList(pCxt, yymsp[-2].minor.yy64, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); }
  yymsp[-2].minor.yy64 = yylhsminor.yy64;
2999 3000
        break;
      case 90: /* variable_list ::= NK_VARIABLE */
3001 3002
{ yylhsminor.yy64 = createNodeList(pCxt, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); }
  yymsp[0].minor.yy64 = yylhsminor.yy64;
3003 3004
        break;
      case 91: /* variable_list ::= variable_list NK_COMMA NK_VARIABLE */
3005 3006
{ yylhsminor.yy64 = addNodeToList(pCxt, yymsp[-2].minor.yy64, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); }
  yymsp[-2].minor.yy64 = yylhsminor.yy64;
3007 3008 3009 3010 3011
        break;
      case 92: /* retention_list ::= retention */
      case 112: /* multi_create_clause ::= create_subtable_clause */ yytestcase(yyruleno==112);
      case 115: /* multi_drop_clause ::= drop_table_clause */ yytestcase(yyruleno==115);
      case 122: /* column_def_list ::= column_def */ yytestcase(yyruleno==122);
3012 3013 3014 3015 3016 3017 3018 3019 3020
      case 167: /* col_name_list ::= col_name */ yytestcase(yyruleno==167);
      case 203: /* func_name_list ::= func_name */ yytestcase(yyruleno==203);
      case 212: /* func_list ::= func */ yytestcase(yyruleno==212);
      case 272: /* literal_list ::= signed_literal */ yytestcase(yyruleno==272);
      case 320: /* other_para_list ::= star_func_para */ yytestcase(yyruleno==320);
      case 375: /* select_sublist ::= select_item */ yytestcase(yyruleno==375);
      case 422: /* sort_specification_list ::= sort_specification */ yytestcase(yyruleno==422);
{ yylhsminor.yy64 = createNodeList(pCxt, yymsp[0].minor.yy192); }
  yymsp[0].minor.yy64 = yylhsminor.yy64;
3021 3022 3023
        break;
      case 93: /* retention_list ::= retention_list NK_COMMA retention */
      case 123: /* column_def_list ::= column_def_list NK_COMMA column_def */ yytestcase(yyruleno==123);
3024 3025 3026 3027 3028 3029 3030 3031 3032
      case 168: /* col_name_list ::= col_name_list NK_COMMA col_name */ yytestcase(yyruleno==168);
      case 204: /* func_name_list ::= func_name_list NK_COMMA col_name */ yytestcase(yyruleno==204);
      case 213: /* func_list ::= func_list NK_COMMA func */ yytestcase(yyruleno==213);
      case 273: /* literal_list ::= literal_list NK_COMMA signed_literal */ yytestcase(yyruleno==273);
      case 321: /* other_para_list ::= other_para_list NK_COMMA star_func_para */ yytestcase(yyruleno==321);
      case 376: /* select_sublist ::= select_sublist NK_COMMA select_item */ yytestcase(yyruleno==376);
      case 423: /* sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ yytestcase(yyruleno==423);
{ yylhsminor.yy64 = addNodeToList(pCxt, yymsp[-2].minor.yy64, yymsp[0].minor.yy192); }
  yymsp[-2].minor.yy64 = yylhsminor.yy64;
3033 3034
        break;
      case 94: /* retention ::= NK_VARIABLE NK_COLON NK_VARIABLE */
3035 3036
{ yylhsminor.yy192 = createNodeListNodeEx(pCxt, createDurationValueNode(pCxt, &yymsp[-2].minor.yy0), createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); }
  yymsp[-2].minor.yy192 = yylhsminor.yy192;
3037 3038 3039
        break;
      case 95: /* cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options */
      case 97: /* cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options */ yytestcase(yyruleno==97);
3040
{ pCxt->pRootNode = createCreateTableStmt(pCxt, yymsp[-6].minor.yy273, yymsp[-5].minor.yy192, yymsp[-3].minor.yy64, yymsp[-1].minor.yy64, yymsp[0].minor.yy192); }
3041 3042
        break;
      case 96: /* cmd ::= CREATE TABLE multi_create_clause */
3043
{ pCxt->pRootNode = createCreateMultiTableStmt(pCxt, yymsp[0].minor.yy64); }
3044 3045
        break;
      case 98: /* cmd ::= DROP TABLE multi_drop_clause */
3046
{ pCxt->pRootNode = createDropTableStmt(pCxt, yymsp[0].minor.yy64); }
3047 3048
        break;
      case 99: /* cmd ::= DROP STABLE exists_opt full_table_name */
3049
{ pCxt->pRootNode = createDropSuperTableStmt(pCxt, yymsp[-1].minor.yy273, yymsp[0].minor.yy192); }
3050 3051 3052
        break;
      case 100: /* cmd ::= ALTER TABLE alter_table_clause */
      case 101: /* cmd ::= ALTER STABLE alter_table_clause */ yytestcase(yyruleno==101);
3053 3054
      case 250: /* cmd ::= query_expression */ yytestcase(yyruleno==250);
{ pCxt->pRootNode = yymsp[0].minor.yy192; }
3055 3056
        break;
      case 102: /* alter_table_clause ::= full_table_name alter_table_options */
3057 3058
{ yylhsminor.yy192 = createAlterTableOption(pCxt, yymsp[-1].minor.yy192, yymsp[0].minor.yy192); }
  yymsp[-1].minor.yy192 = yylhsminor.yy192;
3059 3060
        break;
      case 103: /* alter_table_clause ::= full_table_name ADD COLUMN column_name type_name */
3061 3062
{ yylhsminor.yy192 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy192, TSDB_ALTER_TABLE_ADD_COLUMN, &yymsp[-1].minor.yy353, yymsp[0].minor.yy536); }
  yymsp[-4].minor.yy192 = yylhsminor.yy192;
3063 3064
        break;
      case 104: /* alter_table_clause ::= full_table_name DROP COLUMN column_name */
3065 3066
{ yylhsminor.yy192 = createAlterTableDropCol(pCxt, yymsp[-3].minor.yy192, TSDB_ALTER_TABLE_DROP_COLUMN, &yymsp[0].minor.yy353); }
  yymsp[-3].minor.yy192 = yylhsminor.yy192;
3067 3068
        break;
      case 105: /* alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name */
3069 3070
{ yylhsminor.yy192 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy192, TSDB_ALTER_TABLE_UPDATE_COLUMN_BYTES, &yymsp[-1].minor.yy353, yymsp[0].minor.yy536); }
  yymsp[-4].minor.yy192 = yylhsminor.yy192;
3071
        break;
3072
      case 106: /* alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name */
3073 3074
{ yylhsminor.yy192 = createAlterTableRenameCol(pCxt, yymsp[-4].minor.yy192, TSDB_ALTER_TABLE_UPDATE_COLUMN_NAME, &yymsp[-1].minor.yy353, &yymsp[0].minor.yy353); }
  yymsp[-4].minor.yy192 = yylhsminor.yy192;
3075
        break;
3076
      case 107: /* alter_table_clause ::= full_table_name ADD TAG column_name type_name */
3077 3078
{ yylhsminor.yy192 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy192, TSDB_ALTER_TABLE_ADD_TAG, &yymsp[-1].minor.yy353, yymsp[0].minor.yy536); }
  yymsp[-4].minor.yy192 = yylhsminor.yy192;
3079
        break;
3080
      case 108: /* alter_table_clause ::= full_table_name DROP TAG column_name */
3081 3082
{ yylhsminor.yy192 = createAlterTableDropCol(pCxt, yymsp[-3].minor.yy192, TSDB_ALTER_TABLE_DROP_TAG, &yymsp[0].minor.yy353); }
  yymsp[-3].minor.yy192 = yylhsminor.yy192;
3083
        break;
3084
      case 109: /* alter_table_clause ::= full_table_name MODIFY TAG column_name type_name */
3085 3086
{ yylhsminor.yy192 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy192, TSDB_ALTER_TABLE_UPDATE_TAG_BYTES, &yymsp[-1].minor.yy353, yymsp[0].minor.yy536); }
  yymsp[-4].minor.yy192 = yylhsminor.yy192;
3087
        break;
3088
      case 110: /* alter_table_clause ::= full_table_name RENAME TAG column_name column_name */
3089 3090
{ yylhsminor.yy192 = createAlterTableRenameCol(pCxt, yymsp[-4].minor.yy192, TSDB_ALTER_TABLE_UPDATE_TAG_NAME, &yymsp[-1].minor.yy353, &yymsp[0].minor.yy353); }
  yymsp[-4].minor.yy192 = yylhsminor.yy192;
3091
        break;
3092
      case 111: /* alter_table_clause ::= full_table_name SET TAG column_name NK_EQ literal */
3093 3094
{ yylhsminor.yy192 = createAlterTableSetTag(pCxt, yymsp[-5].minor.yy192, &yymsp[-2].minor.yy353, yymsp[0].minor.yy192); }
  yymsp[-5].minor.yy192 = yylhsminor.yy192;
3095
        break;
3096 3097
      case 113: /* multi_create_clause ::= multi_create_clause create_subtable_clause */
      case 116: /* multi_drop_clause ::= multi_drop_clause drop_table_clause */ yytestcase(yyruleno==116);
3098 3099
{ yylhsminor.yy64 = addNodeToList(pCxt, yymsp[-1].minor.yy64, yymsp[0].minor.yy192); }
  yymsp[-1].minor.yy64 = yylhsminor.yy64;
3100
        break;
3101
      case 114: /* create_subtable_clause ::= not_exists_opt full_table_name USING full_table_name specific_tags_opt TAGS NK_LP literal_list NK_RP */
3102 3103
{ yylhsminor.yy192 = createCreateSubTableClause(pCxt, yymsp[-8].minor.yy273, yymsp[-7].minor.yy192, yymsp[-5].minor.yy192, yymsp[-4].minor.yy64, yymsp[-1].minor.yy64); }
  yymsp[-8].minor.yy192 = yylhsminor.yy192;
3104
        break;
3105
      case 117: /* drop_table_clause ::= exists_opt full_table_name */
3106 3107
{ yylhsminor.yy192 = createDropTableClause(pCxt, yymsp[-1].minor.yy273, yymsp[0].minor.yy192); }
  yymsp[-1].minor.yy192 = yylhsminor.yy192;
3108
        break;
3109 3110
      case 118: /* specific_tags_opt ::= */
      case 149: /* tags_def_opt ::= */ yytestcase(yyruleno==149);
3111 3112 3113 3114
      case 383: /* partition_by_clause_opt ::= */ yytestcase(yyruleno==383);
      case 400: /* group_by_clause_opt ::= */ yytestcase(yyruleno==400);
      case 410: /* order_by_clause_opt ::= */ yytestcase(yyruleno==410);
{ yymsp[1].minor.yy64 = NULL; }
3115
        break;
3116
      case 119: /* specific_tags_opt ::= NK_LP col_name_list NK_RP */
3117
{ yymsp[-2].minor.yy64 = yymsp[-1].minor.yy64; }
3118
        break;
3119
      case 120: /* full_table_name ::= table_name */
3120 3121
{ yylhsminor.yy192 = createRealTableNode(pCxt, NULL, &yymsp[0].minor.yy353, NULL); }
  yymsp[0].minor.yy192 = yylhsminor.yy192;
3122
        break;
3123
      case 121: /* full_table_name ::= db_name NK_DOT table_name */
3124 3125
{ yylhsminor.yy192 = createRealTableNode(pCxt, &yymsp[-2].minor.yy353, &yymsp[0].minor.yy353, NULL); }
  yymsp[-2].minor.yy192 = yylhsminor.yy192;
3126
        break;
3127
      case 124: /* column_def ::= column_name type_name */
3128 3129
{ yylhsminor.yy192 = createColumnDefNode(pCxt, &yymsp[-1].minor.yy353, yymsp[0].minor.yy536, NULL); }
  yymsp[-1].minor.yy192 = yylhsminor.yy192;
3130
        break;
3131
      case 125: /* column_def ::= column_name type_name COMMENT NK_STRING */
3132 3133
{ yylhsminor.yy192 = createColumnDefNode(pCxt, &yymsp[-3].minor.yy353, yymsp[-2].minor.yy536, &yymsp[0].minor.yy0); }
  yymsp[-3].minor.yy192 = yylhsminor.yy192;
3134
        break;
3135
      case 126: /* type_name ::= BOOL */
3136
{ yymsp[0].minor.yy536 = createDataType(TSDB_DATA_TYPE_BOOL); }
3137
        break;
3138
      case 127: /* type_name ::= TINYINT */
3139
{ yymsp[0].minor.yy536 = createDataType(TSDB_DATA_TYPE_TINYINT); }
3140
        break;
3141
      case 128: /* type_name ::= SMALLINT */
3142
{ yymsp[0].minor.yy536 = createDataType(TSDB_DATA_TYPE_SMALLINT); }
3143
        break;
3144 3145
      case 129: /* type_name ::= INT */
      case 130: /* type_name ::= INTEGER */ yytestcase(yyruleno==130);
3146
{ yymsp[0].minor.yy536 = createDataType(TSDB_DATA_TYPE_INT); }
3147
        break;
3148
      case 131: /* type_name ::= BIGINT */
3149
{ yymsp[0].minor.yy536 = createDataType(TSDB_DATA_TYPE_BIGINT); }
3150
        break;
3151
      case 132: /* type_name ::= FLOAT */
3152
{ yymsp[0].minor.yy536 = createDataType(TSDB_DATA_TYPE_FLOAT); }
3153
        break;
3154
      case 133: /* type_name ::= DOUBLE */
3155
{ yymsp[0].minor.yy536 = createDataType(TSDB_DATA_TYPE_DOUBLE); }
3156
        break;
3157
      case 134: /* type_name ::= BINARY NK_LP NK_INTEGER NK_RP */
3158
{ yymsp[-3].minor.yy536 = createVarLenDataType(TSDB_DATA_TYPE_BINARY, &yymsp[-1].minor.yy0); }
3159
        break;
3160
      case 135: /* type_name ::= TIMESTAMP */
3161
{ yymsp[0].minor.yy536 = createDataType(TSDB_DATA_TYPE_TIMESTAMP); }
3162
        break;
3163
      case 136: /* type_name ::= NCHAR NK_LP NK_INTEGER NK_RP */
3164
{ yymsp[-3].minor.yy536 = createVarLenDataType(TSDB_DATA_TYPE_NCHAR, &yymsp[-1].minor.yy0); }
3165
        break;
3166
      case 137: /* type_name ::= TINYINT UNSIGNED */
3167
{ yymsp[-1].minor.yy536 = createDataType(TSDB_DATA_TYPE_UTINYINT); }
3168
        break;
3169
      case 138: /* type_name ::= SMALLINT UNSIGNED */
3170
{ yymsp[-1].minor.yy536 = createDataType(TSDB_DATA_TYPE_USMALLINT); }
3171
        break;
3172
      case 139: /* type_name ::= INT UNSIGNED */
3173
{ yymsp[-1].minor.yy536 = createDataType(TSDB_DATA_TYPE_UINT); }
3174
        break;
3175
      case 140: /* type_name ::= BIGINT UNSIGNED */
3176
{ yymsp[-1].minor.yy536 = createDataType(TSDB_DATA_TYPE_UBIGINT); }
3177
        break;
3178
      case 141: /* type_name ::= JSON */
3179
{ yymsp[0].minor.yy536 = createDataType(TSDB_DATA_TYPE_JSON); }
3180
        break;
3181
      case 142: /* type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP */
3182
{ yymsp[-3].minor.yy536 = createVarLenDataType(TSDB_DATA_TYPE_VARCHAR, &yymsp[-1].minor.yy0); }
3183
        break;
3184
      case 143: /* type_name ::= MEDIUMBLOB */
3185
{ yymsp[0].minor.yy536 = createDataType(TSDB_DATA_TYPE_MEDIUMBLOB); }
3186
        break;
3187
      case 144: /* type_name ::= BLOB */
3188
{ yymsp[0].minor.yy536 = createDataType(TSDB_DATA_TYPE_BLOB); }
3189
        break;
3190
      case 145: /* type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP */
3191
{ yymsp[-3].minor.yy536 = createVarLenDataType(TSDB_DATA_TYPE_VARBINARY, &yymsp[-1].minor.yy0); }
3192
        break;
3193
      case 146: /* type_name ::= DECIMAL */
3194
{ yymsp[0].minor.yy536 = createDataType(TSDB_DATA_TYPE_DECIMAL); }
3195
        break;
3196
      case 147: /* type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP */
3197
{ yymsp[-3].minor.yy536 = createDataType(TSDB_DATA_TYPE_DECIMAL); }
3198
        break;
3199
      case 148: /* type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */
3200
{ yymsp[-5].minor.yy536 = createDataType(TSDB_DATA_TYPE_DECIMAL); }
3201
        break;
3202
      case 150: /* tags_def_opt ::= tags_def */
3203 3204 3205 3206
      case 319: /* star_func_para_list ::= other_para_list */ yytestcase(yyruleno==319);
      case 374: /* select_list ::= select_sublist */ yytestcase(yyruleno==374);
{ yylhsminor.yy64 = yymsp[0].minor.yy64; }
  yymsp[0].minor.yy64 = yylhsminor.yy64;
3207
        break;
3208
      case 151: /* tags_def ::= TAGS NK_LP column_def_list NK_RP */
3209
{ yymsp[-3].minor.yy64 = yymsp[-1].minor.yy64; }
3210
        break;
3211
      case 152: /* table_options ::= */
3212
{ yymsp[1].minor.yy192 = createTableOptions(pCxt); }
3213
        break;
3214
      case 153: /* table_options ::= table_options COMMENT NK_STRING */
3215 3216
{ ((STableOptions*)yymsp[-2].minor.yy192)->pComments = (SValueNode*)createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0); yylhsminor.yy192 = yymsp[-2].minor.yy192; }
  yymsp[-2].minor.yy192 = yylhsminor.yy192;
3217
        break;
3218
      case 154: /* table_options ::= table_options KEEP integer_list */
3219 3220 3221
      case 155: /* table_options ::= table_options KEEP variable_list */ yytestcase(yyruleno==155);
{ ((STableOptions*)yymsp[-2].minor.yy192)->pKeep = yymsp[0].minor.yy64; yylhsminor.yy192 = yymsp[-2].minor.yy192; }
  yymsp[-2].minor.yy192 = yylhsminor.yy192;
3222
        break;
3223 3224 3225
      case 156: /* table_options ::= table_options TTL NK_INTEGER */
{ ((STableOptions*)yymsp[-2].minor.yy192)->pTtl = (SValueNode*)createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); yylhsminor.yy192 = yymsp[-2].minor.yy192; }
  yymsp[-2].minor.yy192 = yylhsminor.yy192;
3226
        break;
3227 3228 3229
      case 157: /* table_options ::= table_options SMA NK_LP col_name_list NK_RP */
{ ((STableOptions*)yymsp[-4].minor.yy192)->pSma = yymsp[-1].minor.yy64; yylhsminor.yy192 = yymsp[-4].minor.yy192; }
  yymsp[-4].minor.yy192 = yylhsminor.yy192;
3230
        break;
3231 3232 3233
      case 158: /* table_options ::= table_options ROLLUP NK_LP func_name_list NK_RP */
{ ((STableOptions*)yymsp[-4].minor.yy192)->pFuncs = yymsp[-1].minor.yy64; yylhsminor.yy192 = yymsp[-4].minor.yy192; }
  yymsp[-4].minor.yy192 = yylhsminor.yy192;
3234
        break;
3235 3236 3237
      case 159: /* table_options ::= table_options FILE_FACTOR NK_FLOAT */
{ ((STableOptions*)yymsp[-2].minor.yy192)->pFilesFactor = (SValueNode*)createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0); yylhsminor.yy192 = yymsp[-2].minor.yy192; }
  yymsp[-2].minor.yy192 = yylhsminor.yy192;
3238
        break;
3239 3240 3241
      case 160: /* table_options ::= table_options DELAY NK_INTEGER */
{ ((STableOptions*)yymsp[-2].minor.yy192)->pDelay = (SValueNode*)createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); yylhsminor.yy192 = yymsp[-2].minor.yy192; }
  yymsp[-2].minor.yy192 = yylhsminor.yy192;
3242
        break;
3243 3244 3245
      case 161: /* alter_table_options ::= alter_table_option */
{ yylhsminor.yy192 = createTableOptions(pCxt); yylhsminor.yy192 = setTableAlterOption(pCxt, yylhsminor.yy192, &yymsp[0].minor.yy277); }
  yymsp[0].minor.yy192 = yylhsminor.yy192;
3246
        break;
3247 3248 3249
      case 162: /* alter_table_options ::= alter_table_options alter_table_option */
{ yylhsminor.yy192 = setTableAlterOption(pCxt, yymsp[-1].minor.yy192, &yymsp[0].minor.yy277); }
  yymsp[-1].minor.yy192 = yylhsminor.yy192;
3250
        break;
3251 3252
      case 163: /* alter_table_option ::= COMMENT NK_STRING */
{ yymsp[-1].minor.yy277.type = TABLE_OPTION_COMMENT; yymsp[-1].minor.yy277.pVal = (SValueNode*)createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0); }
3253
        break;
3254 3255 3256
      case 164: /* alter_table_option ::= KEEP integer_list */
      case 165: /* alter_table_option ::= KEEP variable_list */ yytestcase(yyruleno==165);
{ yymsp[-1].minor.yy277.type = TABLE_OPTION_KEEP; yymsp[-1].minor.yy277.pList = yymsp[0].minor.yy64; }
3257
        break;
3258 3259
      case 166: /* alter_table_option ::= TTL NK_INTEGER */
{ yymsp[-1].minor.yy277.type = TABLE_OPTION_TTL; yymsp[-1].minor.yy277.pVal = (SValueNode*)createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); }
3260
        break;
3261 3262 3263
      case 169: /* col_name ::= column_name */
{ yylhsminor.yy192 = createColumnNode(pCxt, NULL, &yymsp[0].minor.yy353); }
  yymsp[0].minor.yy192 = yylhsminor.yy192;
3264
        break;
3265
      case 170: /* cmd ::= SHOW DNODES */
X
Xiaoyu Wang 已提交
3266
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_DNODES_STMT, NULL, NULL); }
3267
        break;
3268
      case 171: /* cmd ::= SHOW USERS */
X
Xiaoyu Wang 已提交
3269
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_USERS_STMT, NULL, NULL); }
3270
        break;
3271
      case 172: /* cmd ::= SHOW DATABASES */
X
Xiaoyu Wang 已提交
3272
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_DATABASES_STMT, NULL, NULL); }
3273
        break;
3274 3275
      case 173: /* cmd ::= SHOW db_name_cond_opt TABLES like_pattern_opt */
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_TABLES_STMT, yymsp[-2].minor.yy192, yymsp[0].minor.yy192); }
3276
        break;
3277 3278
      case 174: /* cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt */
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_STABLES_STMT, yymsp[-2].minor.yy192, yymsp[0].minor.yy192); }
3279
        break;
3280 3281
      case 175: /* cmd ::= SHOW db_name_cond_opt VGROUPS */
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_VGROUPS_STMT, yymsp[-1].minor.yy192, NULL); }
3282
        break;
3283
      case 176: /* cmd ::= SHOW MNODES */
X
Xiaoyu Wang 已提交
3284
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_MNODES_STMT, NULL, NULL); }
3285
        break;
3286
      case 177: /* cmd ::= SHOW MODULES */
X
Xiaoyu Wang 已提交
3287
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_MODULES_STMT, NULL, NULL); }
3288
        break;
3289
      case 178: /* cmd ::= SHOW QNODES */
X
Xiaoyu Wang 已提交
3290
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_QNODES_STMT, NULL, NULL); }
3291
        break;
3292
      case 179: /* cmd ::= SHOW FUNCTIONS */
X
Xiaoyu Wang 已提交
3293
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_FUNCTIONS_STMT, NULL, NULL); }
3294
        break;
3295 3296
      case 180: /* cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt */
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_INDEXES_STMT, yymsp[-1].minor.yy192, yymsp[0].minor.yy192); }
3297
        break;
3298
      case 181: /* cmd ::= SHOW STREAMS */
X
Xiaoyu Wang 已提交
3299
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_STREAMS_STMT, NULL, NULL); }
3300
        break;
3301
      case 182: /* cmd ::= SHOW ACCOUNTS */
3302 3303
{ pCxt->valid = false; generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_EXPRIE_STATEMENT); }
        break;
3304 3305
      case 183: /* cmd ::= SHOW APPS */
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_APPS_STMT, NULL, NULL); }
3306
        break;
3307
      case 184: /* cmd ::= SHOW CONNECTIONS */
3308 3309
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_CONNECTIONS_STMT, NULL, NULL); }
        break;
3310 3311
      case 185: /* cmd ::= SHOW LICENCE */
      case 186: /* cmd ::= SHOW GRANTS */ yytestcase(yyruleno==186);
3312 3313
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_LICENCE_STMT, NULL, NULL); }
        break;
3314 3315
      case 187: /* cmd ::= SHOW CREATE DATABASE db_name */
{ pCxt->pRootNode = createShowCreateDatabaseStmt(pCxt, &yymsp[0].minor.yy353); }
3316
        break;
3317 3318
      case 188: /* cmd ::= SHOW CREATE TABLE full_table_name */
{ pCxt->pRootNode = createShowCreateTableStmt(pCxt, QUERY_NODE_SHOW_CREATE_TABLE_STMT, yymsp[0].minor.yy192); }
3319
        break;
3320 3321
      case 189: /* cmd ::= SHOW CREATE STABLE full_table_name */
{ pCxt->pRootNode = createShowCreateTableStmt(pCxt, QUERY_NODE_SHOW_CREATE_STABLE_STMT, yymsp[0].minor.yy192); }
3322
        break;
3323
      case 190: /* cmd ::= SHOW QUERIES */
3324 3325
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_QUERIES_STMT, NULL, NULL); }
        break;
3326 3327
      case 191: /* cmd ::= SHOW SCORES */
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_SCORES_STMT, NULL, NULL); }
3328
        break;
3329
      case 192: /* cmd ::= SHOW TOPICS */
3330 3331
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_TOPICS_STMT, NULL, NULL); }
        break;
3332 3333
      case 193: /* cmd ::= SHOW VARIABLES */
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_VARIABLE_STMT, NULL, NULL); }
X
Xiaoyu Wang 已提交
3334
        break;
3335
      case 194: /* cmd ::= SHOW BNODES */
3336 3337
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_BNODES_STMT, NULL, NULL); }
        break;
3338
      case 195: /* cmd ::= SHOW SNODES */
3339 3340
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_SNODES_STMT, NULL, NULL); }
        break;
3341 3342 3343
      case 196: /* db_name_cond_opt ::= */
      case 201: /* from_db_opt ::= */ yytestcase(yyruleno==201);
{ yymsp[1].minor.yy192 = createDefaultDatabaseCondValue(pCxt); }
X
Xiaoyu Wang 已提交
3344
        break;
3345 3346 3347
      case 197: /* db_name_cond_opt ::= db_name NK_DOT */
{ yylhsminor.yy192 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[-1].minor.yy353); }
  yymsp[-1].minor.yy192 = yylhsminor.yy192;
X
Xiaoyu Wang 已提交
3348
        break;
3349 3350 3351 3352 3353 3354 3355 3356 3357 3358 3359
      case 198: /* like_pattern_opt ::= */
      case 209: /* index_options ::= */ yytestcase(yyruleno==209);
      case 236: /* into_opt ::= */ yytestcase(yyruleno==236);
      case 381: /* where_clause_opt ::= */ yytestcase(yyruleno==381);
      case 385: /* twindow_clause_opt ::= */ yytestcase(yyruleno==385);
      case 390: /* sliding_opt ::= */ yytestcase(yyruleno==390);
      case 392: /* fill_opt ::= */ yytestcase(yyruleno==392);
      case 404: /* having_clause_opt ::= */ yytestcase(yyruleno==404);
      case 412: /* slimit_clause_opt ::= */ yytestcase(yyruleno==412);
      case 416: /* limit_clause_opt ::= */ yytestcase(yyruleno==416);
{ yymsp[1].minor.yy192 = NULL; }
X
Xiaoyu Wang 已提交
3360
        break;
3361 3362
      case 199: /* like_pattern_opt ::= LIKE NK_STRING */
{ yymsp[-1].minor.yy192 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0); }
X
Xiaoyu Wang 已提交
3363
        break;
3364 3365 3366
      case 200: /* table_name_cond ::= table_name */
{ yylhsminor.yy192 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy353); }
  yymsp[0].minor.yy192 = yylhsminor.yy192;
X
Xiaoyu Wang 已提交
3367
        break;
3368 3369
      case 202: /* from_db_opt ::= FROM db_name */
{ yymsp[-1].minor.yy192 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy353); }
X
Xiaoyu Wang 已提交
3370
        break;
3371 3372 3373
      case 205: /* func_name ::= function_name */
{ yylhsminor.yy192 = createFunctionNode(pCxt, &yymsp[0].minor.yy353, NULL); }
  yymsp[0].minor.yy192 = yylhsminor.yy192;
X
Xiaoyu Wang 已提交
3374
        break;
3375 3376
      case 206: /* cmd ::= CREATE SMA INDEX not_exists_opt index_name ON table_name index_options */
{ pCxt->pRootNode = createCreateIndexStmt(pCxt, INDEX_TYPE_SMA, yymsp[-4].minor.yy273, &yymsp[-3].minor.yy353, &yymsp[-1].minor.yy353, NULL, yymsp[0].minor.yy192); }
X
Xiaoyu Wang 已提交
3377
        break;
3378 3379
      case 207: /* cmd ::= CREATE FULLTEXT INDEX not_exists_opt index_name ON table_name NK_LP col_name_list NK_RP */
{ pCxt->pRootNode = createCreateIndexStmt(pCxt, INDEX_TYPE_FULLTEXT, yymsp[-6].minor.yy273, &yymsp[-5].minor.yy353, &yymsp[-3].minor.yy353, yymsp[-1].minor.yy64, NULL); }
X
Xiaoyu Wang 已提交
3380
        break;
3381 3382
      case 208: /* cmd ::= DROP INDEX exists_opt index_name ON table_name */
{ pCxt->pRootNode = createDropIndexStmt(pCxt, yymsp[-3].minor.yy273, &yymsp[-2].minor.yy353, &yymsp[0].minor.yy353); }
X
Xiaoyu Wang 已提交
3383
        break;
3384 3385
      case 210: /* index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt */
{ yymsp[-8].minor.yy192 = createIndexOption(pCxt, yymsp[-6].minor.yy64, releaseRawExprNode(pCxt, yymsp[-2].minor.yy192), NULL, yymsp[0].minor.yy192); }
X
Xiaoyu Wang 已提交
3386
        break;
3387 3388
      case 211: /* index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt */
{ yymsp[-10].minor.yy192 = createIndexOption(pCxt, yymsp[-8].minor.yy64, releaseRawExprNode(pCxt, yymsp[-4].minor.yy192), releaseRawExprNode(pCxt, yymsp[-2].minor.yy192), yymsp[0].minor.yy192); }
X
Xiaoyu Wang 已提交
3389
        break;
3390 3391 3392
      case 214: /* func ::= function_name NK_LP expression_list NK_RP */
{ yylhsminor.yy192 = createFunctionNode(pCxt, &yymsp[-3].minor.yy353, yymsp[-1].minor.yy64); }
  yymsp[-3].minor.yy192 = yylhsminor.yy192;
X
Xiaoyu Wang 已提交
3393
        break;
3394 3395
      case 215: /* cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_expression */
{ pCxt->pRootNode = createCreateTopicStmt(pCxt, yymsp[-3].minor.yy273, &yymsp[-2].minor.yy353, yymsp[0].minor.yy192, NULL); }
X
Xiaoyu Wang 已提交
3396
        break;
3397 3398
      case 216: /* cmd ::= CREATE TOPIC not_exists_opt topic_name AS db_name */
{ pCxt->pRootNode = createCreateTopicStmt(pCxt, yymsp[-3].minor.yy273, &yymsp[-2].minor.yy353, NULL, &yymsp[0].minor.yy353); }
3399
        break;
3400 3401
      case 217: /* cmd ::= DROP TOPIC exists_opt topic_name */
{ pCxt->pRootNode = createDropTopicStmt(pCxt, yymsp[-1].minor.yy273, &yymsp[0].minor.yy353); }
3402
        break;
3403 3404 3405
      case 218: /* cmd ::= DESC full_table_name */
      case 219: /* cmd ::= DESCRIBE full_table_name */ yytestcase(yyruleno==219);
{ pCxt->pRootNode = createDescribeStmt(pCxt, yymsp[0].minor.yy192); }
3406
        break;
3407
      case 220: /* cmd ::= RESET QUERY CACHE */
3408 3409
{ pCxt->pRootNode = createResetQueryCacheStmt(pCxt); }
        break;
3410 3411
      case 221: /* cmd ::= EXPLAIN analyze_opt explain_options query_expression */
{ pCxt->pRootNode = createExplainStmt(pCxt, yymsp[-2].minor.yy273, yymsp[-1].minor.yy192, yymsp[0].minor.yy192); }
3412
        break;
3413 3414 3415 3416
      case 223: /* analyze_opt ::= ANALYZE */
      case 231: /* agg_func_opt ::= AGGREGATE */ yytestcase(yyruleno==231);
      case 371: /* set_quantifier_opt ::= DISTINCT */ yytestcase(yyruleno==371);
{ yymsp[0].minor.yy273 = true; }
3417
        break;
3418 3419
      case 224: /* explain_options ::= */
{ yymsp[1].minor.yy192 = createDefaultExplainOptions(pCxt); }
3420
        break;
3421 3422 3423
      case 225: /* explain_options ::= explain_options VERBOSE NK_BOOL */
{ yylhsminor.yy192 = setExplainVerbose(pCxt, yymsp[-2].minor.yy192, &yymsp[0].minor.yy0); }
  yymsp[-2].minor.yy192 = yylhsminor.yy192;
3424
        break;
3425 3426 3427
      case 226: /* explain_options ::= explain_options RATIO NK_FLOAT */
{ yylhsminor.yy192 = setExplainRatio(pCxt, yymsp[-2].minor.yy192, &yymsp[0].minor.yy0); }
  yymsp[-2].minor.yy192 = yylhsminor.yy192;
3428
        break;
3429 3430
      case 227: /* cmd ::= COMPACT VNODES IN NK_LP integer_list NK_RP */
{ pCxt->pRootNode = createCompactStmt(pCxt, yymsp[-1].minor.yy64); }
3431
        break;
3432 3433
      case 228: /* cmd ::= CREATE agg_func_opt FUNCTION function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt */
{ pCxt->pRootNode = createCreateFunctionStmt(pCxt, yymsp[-7].minor.yy273, &yymsp[-5].minor.yy353, &yymsp[-3].minor.yy0, yymsp[-1].minor.yy536, yymsp[0].minor.yy116); }
3434
        break;
3435 3436
      case 229: /* cmd ::= DROP FUNCTION function_name */
{ pCxt->pRootNode = createDropFunctionStmt(pCxt, &yymsp[0].minor.yy353); }
3437
        break;
3438 3439
      case 232: /* bufsize_opt ::= */
{ yymsp[1].minor.yy116 = 0; }
3440
        break;
3441 3442
      case 233: /* bufsize_opt ::= BUFSIZE NK_INTEGER */
{ yymsp[-1].minor.yy116 = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
3443
        break;
3444 3445
      case 234: /* cmd ::= CREATE STREAM not_exists_opt stream_name stream_options into_opt AS query_expression */
{ pCxt->pRootNode = createCreateStreamStmt(pCxt, yymsp[-5].minor.yy273, &yymsp[-4].minor.yy353, yymsp[-3].minor.yy192, yymsp[-2].minor.yy192, yymsp[0].minor.yy192); }
3446
        break;
3447 3448
      case 235: /* cmd ::= DROP STREAM exists_opt stream_name */
{ pCxt->pRootNode = createDropStreamStmt(pCxt, yymsp[-1].minor.yy273, &yymsp[0].minor.yy353); }
3449
        break;
3450 3451 3452 3453 3454 3455 3456 3457 3458 3459 3460 3461 3462 3463 3464 3465 3466 3467 3468 3469 3470 3471
      case 237: /* into_opt ::= INTO full_table_name */
      case 352: /* from_clause ::= FROM table_reference_list */ yytestcase(yyruleno==352);
      case 382: /* where_clause_opt ::= WHERE search_condition */ yytestcase(yyruleno==382);
      case 405: /* having_clause_opt ::= HAVING search_condition */ yytestcase(yyruleno==405);
{ yymsp[-1].minor.yy192 = yymsp[0].minor.yy192; }
        break;
      case 238: /* stream_options ::= */
{ yymsp[1].minor.yy192 = createStreamOptions(pCxt); }
        break;
      case 239: /* stream_options ::= stream_options TRIGGER AT_ONCE */
{ ((SStreamOptions*)yymsp[-2].minor.yy192)->triggerType = STREAM_TRIGGER_AT_ONCE; yylhsminor.yy192 = yymsp[-2].minor.yy192; }
  yymsp[-2].minor.yy192 = yylhsminor.yy192;
        break;
      case 240: /* stream_options ::= stream_options TRIGGER WINDOW_CLOSE */
{ ((SStreamOptions*)yymsp[-2].minor.yy192)->triggerType = STREAM_TRIGGER_WINDOW_CLOSE; yylhsminor.yy192 = yymsp[-2].minor.yy192; }
  yymsp[-2].minor.yy192 = yylhsminor.yy192;
        break;
      case 241: /* stream_options ::= stream_options WATERMARK duration_literal */
{ ((SStreamOptions*)yymsp[-2].minor.yy192)->pWatermark = releaseRawExprNode(pCxt, yymsp[0].minor.yy192); yylhsminor.yy192 = yymsp[-2].minor.yy192; }
  yymsp[-2].minor.yy192 = yylhsminor.yy192;
        break;
      case 242: /* cmd ::= KILL CONNECTION NK_INTEGER */
3472 3473
{ pCxt->pRootNode = createKillStmt(pCxt, QUERY_NODE_KILL_CONNECTION_STMT, &yymsp[0].minor.yy0); }
        break;
3474
      case 243: /* cmd ::= KILL QUERY NK_INTEGER */
3475 3476
{ pCxt->pRootNode = createKillStmt(pCxt, QUERY_NODE_KILL_QUERY_STMT, &yymsp[0].minor.yy0); }
        break;
3477
      case 244: /* cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER */
3478 3479
{ pCxt->pRootNode = createMergeVgroupStmt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0); }
        break;
3480 3481
      case 245: /* cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list */
{ pCxt->pRootNode = createRedistributeVgroupStmt(pCxt, &yymsp[-1].minor.yy0, yymsp[0].minor.yy64); }
3482
        break;
3483
      case 246: /* cmd ::= SPLIT VGROUP NK_INTEGER */
3484 3485
{ pCxt->pRootNode = createSplitVgroupStmt(pCxt, &yymsp[0].minor.yy0); }
        break;
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 3546 3547 3548 3549 3550 3551
      case 247: /* dnode_list ::= DNODE NK_INTEGER */
{ yymsp[-1].minor.yy64 = createNodeList(pCxt, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); }
        break;
      case 249: /* cmd ::= SYNCDB db_name REPLICA */
{ pCxt->pRootNode = createSyncdbStmt(pCxt, &yymsp[-1].minor.yy353); }
        break;
      case 251: /* literal ::= NK_INTEGER */
{ yylhsminor.yy192 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); }
  yymsp[0].minor.yy192 = yylhsminor.yy192;
        break;
      case 252: /* literal ::= NK_FLOAT */
{ yylhsminor.yy192 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0)); }
  yymsp[0].minor.yy192 = yylhsminor.yy192;
        break;
      case 253: /* literal ::= NK_STRING */
{ yylhsminor.yy192 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0)); }
  yymsp[0].minor.yy192 = yylhsminor.yy192;
        break;
      case 254: /* literal ::= NK_BOOL */
{ yylhsminor.yy192 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0)); }
  yymsp[0].minor.yy192 = yylhsminor.yy192;
        break;
      case 255: /* literal ::= TIMESTAMP NK_STRING */
{ yylhsminor.yy192 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0)); }
  yymsp[-1].minor.yy192 = yylhsminor.yy192;
        break;
      case 256: /* literal ::= duration_literal */
      case 266: /* signed_literal ::= signed */ yytestcase(yyruleno==266);
      case 284: /* expression ::= literal */ yytestcase(yyruleno==284);
      case 285: /* expression ::= pseudo_column */ yytestcase(yyruleno==285);
      case 286: /* expression ::= column_reference */ yytestcase(yyruleno==286);
      case 287: /* expression ::= function_expression */ yytestcase(yyruleno==287);
      case 288: /* expression ::= subquery */ yytestcase(yyruleno==288);
      case 344: /* boolean_value_expression ::= boolean_primary */ yytestcase(yyruleno==344);
      case 348: /* boolean_primary ::= predicate */ yytestcase(yyruleno==348);
      case 350: /* common_expression ::= expression */ yytestcase(yyruleno==350);
      case 351: /* common_expression ::= boolean_value_expression */ yytestcase(yyruleno==351);
      case 353: /* table_reference_list ::= table_reference */ yytestcase(yyruleno==353);
      case 355: /* table_reference ::= table_primary */ yytestcase(yyruleno==355);
      case 356: /* table_reference ::= joined_table */ yytestcase(yyruleno==356);
      case 360: /* table_primary ::= parenthesized_joined_table */ yytestcase(yyruleno==360);
      case 407: /* query_expression_body ::= query_primary */ yytestcase(yyruleno==407);
      case 409: /* query_primary ::= query_specification */ yytestcase(yyruleno==409);
{ yylhsminor.yy192 = yymsp[0].minor.yy192; }
  yymsp[0].minor.yy192 = yylhsminor.yy192;
        break;
      case 257: /* literal ::= NULL */
{ yylhsminor.yy192 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_NULL, NULL)); }
  yymsp[0].minor.yy192 = yylhsminor.yy192;
        break;
      case 258: /* literal ::= NK_QUESTION */
{ yylhsminor.yy192 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createPlaceholderValueNode(pCxt)); }
  yymsp[0].minor.yy192 = yylhsminor.yy192;
        break;
      case 259: /* duration_literal ::= NK_VARIABLE */
{ yylhsminor.yy192 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); }
  yymsp[0].minor.yy192 = yylhsminor.yy192;
        break;
      case 260: /* signed ::= NK_INTEGER */
{ yylhsminor.yy192 = createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); }
  yymsp[0].minor.yy192 = yylhsminor.yy192;
        break;
      case 261: /* signed ::= NK_PLUS NK_INTEGER */
{ yymsp[-1].minor.yy192 = createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); }
        break;
      case 262: /* signed ::= NK_MINUS NK_INTEGER */
X
Xiaoyu Wang 已提交
3552 3553 3554
{ 
                                                                                    SToken t = yymsp[-1].minor.yy0;
                                                                                    t.n = (yymsp[0].minor.yy0.z + yymsp[0].minor.yy0.n) - yymsp[-1].minor.yy0.z;
3555
                                                                                    yylhsminor.yy192 = createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &t);
X
Xiaoyu Wang 已提交
3556
                                                                                  }
3557
  yymsp[-1].minor.yy192 = yylhsminor.yy192;
X
Xiaoyu Wang 已提交
3558
        break;
3559 3560 3561
      case 263: /* signed ::= NK_FLOAT */
{ yylhsminor.yy192 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0); }
  yymsp[0].minor.yy192 = yylhsminor.yy192;
X
Xiaoyu Wang 已提交
3562
        break;
3563 3564
      case 264: /* signed ::= NK_PLUS NK_FLOAT */
{ yymsp[-1].minor.yy192 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0); }
X
Xiaoyu Wang 已提交
3565
        break;
3566
      case 265: /* signed ::= NK_MINUS NK_FLOAT */
X
Xiaoyu Wang 已提交
3567 3568 3569
{ 
                                                                                    SToken t = yymsp[-1].minor.yy0;
                                                                                    t.n = (yymsp[0].minor.yy0.z + yymsp[0].minor.yy0.n) - yymsp[-1].minor.yy0.z;
3570
                                                                                    yylhsminor.yy192 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &t);
X
Xiaoyu Wang 已提交
3571
                                                                                  }
3572
  yymsp[-1].minor.yy192 = yylhsminor.yy192;
3573
        break;
3574 3575 3576
      case 267: /* signed_literal ::= NK_STRING */
{ yylhsminor.yy192 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0); }
  yymsp[0].minor.yy192 = yylhsminor.yy192;
3577
        break;
3578 3579 3580
      case 268: /* signed_literal ::= NK_BOOL */
{ yylhsminor.yy192 = createValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0); }
  yymsp[0].minor.yy192 = yylhsminor.yy192;
3581
        break;
3582 3583
      case 269: /* signed_literal ::= TIMESTAMP NK_STRING */
{ yymsp[-1].minor.yy192 = createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0); }
X
Xiaoyu Wang 已提交
3584
        break;
3585 3586 3587 3588 3589 3590
      case 270: /* signed_literal ::= duration_literal */
      case 322: /* star_func_para ::= expression */ yytestcase(yyruleno==322);
      case 377: /* select_item ::= common_expression */ yytestcase(yyruleno==377);
      case 421: /* search_condition ::= common_expression */ yytestcase(yyruleno==421);
{ yylhsminor.yy192 = releaseRawExprNode(pCxt, yymsp[0].minor.yy192); }
  yymsp[0].minor.yy192 = yylhsminor.yy192;
X
Xiaoyu Wang 已提交
3591
        break;
3592 3593
      case 271: /* signed_literal ::= NULL */
{ yymsp[0].minor.yy192 = createValueNode(pCxt, TSDB_DATA_TYPE_NULL, NULL); }
X
Xiaoyu Wang 已提交
3594
        break;
3595 3596 3597 3598
      case 289: /* expression ::= NK_LP expression NK_RP */
      case 349: /* boolean_primary ::= NK_LP boolean_value_expression NK_RP */ yytestcase(yyruleno==349);
{ yylhsminor.yy192 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, releaseRawExprNode(pCxt, yymsp[-1].minor.yy192)); }
  yymsp[-2].minor.yy192 = yylhsminor.yy192;
X
Xiaoyu Wang 已提交
3599
        break;
3600 3601 3602 3603 3604 3605
      case 290: /* expression ::= NK_PLUS expression */
{
                                                                                    SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy192);
                                                                                    yylhsminor.yy192 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, releaseRawExprNode(pCxt, yymsp[0].minor.yy192));
                                                                                  }
  yymsp[-1].minor.yy192 = yylhsminor.yy192;
X
Xiaoyu Wang 已提交
3606
        break;
3607
      case 291: /* expression ::= NK_MINUS expression */
3608
{
3609 3610
                                                                                    SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy192);
                                                                                    yylhsminor.yy192 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, createOperatorNode(pCxt, OP_TYPE_MINUS, releaseRawExprNode(pCxt, yymsp[0].minor.yy192), NULL));
3611
                                                                                  }
3612
  yymsp[-1].minor.yy192 = yylhsminor.yy192;
3613
        break;
3614
      case 292: /* expression ::= expression NK_PLUS expression */
3615
{
3616 3617 3618
                                                                                    SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy192);
                                                                                    SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy192);
                                                                                    yylhsminor.yy192 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_ADD, releaseRawExprNode(pCxt, yymsp[-2].minor.yy192), releaseRawExprNode(pCxt, yymsp[0].minor.yy192))); 
3619
                                                                                  }
3620
  yymsp[-2].minor.yy192 = yylhsminor.yy192;
3621
        break;
3622
      case 293: /* expression ::= expression NK_MINUS expression */
3623
{
3624 3625 3626
                                                                                    SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy192);
                                                                                    SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy192);
                                                                                    yylhsminor.yy192 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_SUB, releaseRawExprNode(pCxt, yymsp[-2].minor.yy192), releaseRawExprNode(pCxt, yymsp[0].minor.yy192))); 
3627
                                                                                  }
3628
  yymsp[-2].minor.yy192 = yylhsminor.yy192;
3629
        break;
3630
      case 294: /* expression ::= expression NK_STAR expression */
3631
{
3632 3633 3634
                                                                                    SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy192);
                                                                                    SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy192);
                                                                                    yylhsminor.yy192 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_MULTI, releaseRawExprNode(pCxt, yymsp[-2].minor.yy192), releaseRawExprNode(pCxt, yymsp[0].minor.yy192))); 
3635
                                                                                  }
3636
  yymsp[-2].minor.yy192 = yylhsminor.yy192;
3637
        break;
3638
      case 295: /* expression ::= expression NK_SLASH expression */
3639
{
3640 3641 3642
                                                                                    SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy192);
                                                                                    SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy192);
                                                                                    yylhsminor.yy192 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_DIV, releaseRawExprNode(pCxt, yymsp[-2].minor.yy192), releaseRawExprNode(pCxt, yymsp[0].minor.yy192))); 
3643
                                                                                  }
3644
  yymsp[-2].minor.yy192 = yylhsminor.yy192;
3645
        break;
3646
      case 296: /* expression ::= expression NK_REM expression */
3647
{
3648 3649 3650
                                                                                    SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy192);
                                                                                    SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy192);
                                                                                    yylhsminor.yy192 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_MOD, releaseRawExprNode(pCxt, yymsp[-2].minor.yy192), releaseRawExprNode(pCxt, yymsp[0].minor.yy192))); 
3651
                                                                                  }
3652
  yymsp[-2].minor.yy192 = yylhsminor.yy192;
3653
        break;
3654
      case 297: /* expression ::= column_reference NK_ARROW NK_STRING */
3655
{
3656 3657
                                                                                    SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy192);
                                                                                    yylhsminor.yy192 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_JSON_GET_VALUE, releaseRawExprNode(pCxt, yymsp[-2].minor.yy192), createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0))); 
3658
                                                                                  }
3659 3660 3661 3662 3663 3664 3665 3666 3667 3668 3669 3670 3671 3672 3673 3674 3675 3676 3677 3678 3679 3680 3681 3682 3683 3684 3685 3686 3687 3688 3689 3690 3691 3692 3693 3694 3695 3696 3697 3698 3699 3700 3701 3702 3703 3704 3705 3706 3707 3708
  yymsp[-2].minor.yy192 = yylhsminor.yy192;
        break;
      case 298: /* expression_list ::= expression */
{ yylhsminor.yy64 = createNodeList(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy192)); }
  yymsp[0].minor.yy64 = yylhsminor.yy64;
        break;
      case 299: /* expression_list ::= expression_list NK_COMMA expression */
{ yylhsminor.yy64 = addNodeToList(pCxt, yymsp[-2].minor.yy64, releaseRawExprNode(pCxt, yymsp[0].minor.yy192)); }
  yymsp[-2].minor.yy64 = yylhsminor.yy64;
        break;
      case 300: /* column_reference ::= column_name */
{ yylhsminor.yy192 = createRawExprNode(pCxt, &yymsp[0].minor.yy353, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy353)); }
  yymsp[0].minor.yy192 = yylhsminor.yy192;
        break;
      case 301: /* column_reference ::= table_name NK_DOT column_name */
{ yylhsminor.yy192 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy353, &yymsp[0].minor.yy353, createColumnNode(pCxt, &yymsp[-2].minor.yy353, &yymsp[0].minor.yy353)); }
  yymsp[-2].minor.yy192 = yylhsminor.yy192;
        break;
      case 302: /* pseudo_column ::= NOW */
      case 303: /* pseudo_column ::= TODAY */ yytestcase(yyruleno==303);
      case 304: /* pseudo_column ::= ROWTS */ yytestcase(yyruleno==304);
      case 305: /* pseudo_column ::= TBNAME */ yytestcase(yyruleno==305);
      case 306: /* pseudo_column ::= QSTARTTS */ yytestcase(yyruleno==306);
      case 307: /* pseudo_column ::= QENDTS */ yytestcase(yyruleno==307);
      case 308: /* pseudo_column ::= WSTARTTS */ yytestcase(yyruleno==308);
      case 309: /* pseudo_column ::= WENDTS */ yytestcase(yyruleno==309);
      case 310: /* pseudo_column ::= WDURATION */ yytestcase(yyruleno==310);
{ yylhsminor.yy192 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL)); }
  yymsp[0].minor.yy192 = yylhsminor.yy192;
        break;
      case 311: /* function_expression ::= function_name NK_LP expression_list NK_RP */
      case 312: /* function_expression ::= star_func NK_LP star_func_para_list NK_RP */ yytestcase(yyruleno==312);
{ yylhsminor.yy192 = createRawExprNodeExt(pCxt, &yymsp[-3].minor.yy353, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-3].minor.yy353, yymsp[-1].minor.yy64)); }
  yymsp[-3].minor.yy192 = yylhsminor.yy192;
        break;
      case 313: /* function_expression ::= CAST NK_LP expression AS type_name NK_RP */
{ yylhsminor.yy192 = createRawExprNodeExt(pCxt, &yymsp[-5].minor.yy0, &yymsp[0].minor.yy0, createCastFunctionNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy192), yymsp[-1].minor.yy536)); }
  yymsp[-5].minor.yy192 = yylhsminor.yy192;
        break;
      case 318: /* star_func_para_list ::= NK_STAR */
{ yylhsminor.yy64 = createNodeList(pCxt, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy0)); }
  yymsp[0].minor.yy64 = yylhsminor.yy64;
        break;
      case 323: /* star_func_para ::= table_name NK_DOT NK_STAR */
      case 380: /* select_item ::= table_name NK_DOT NK_STAR */ yytestcase(yyruleno==380);
{ yylhsminor.yy192 = createColumnNode(pCxt, &yymsp[-2].minor.yy353, &yymsp[0].minor.yy0); }
  yymsp[-2].minor.yy192 = yylhsminor.yy192;
        break;
      case 324: /* predicate ::= expression compare_op expression */
      case 329: /* predicate ::= expression in_op in_predicate_value */ yytestcase(yyruleno==329);
3709
{
3710 3711 3712
                                                                                    SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy192);
                                                                                    SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy192);
                                                                                    yylhsminor.yy192 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, yymsp[-1].minor.yy412, releaseRawExprNode(pCxt, yymsp[-2].minor.yy192), releaseRawExprNode(pCxt, yymsp[0].minor.yy192)));
3713
                                                                                  }
3714
  yymsp[-2].minor.yy192 = yylhsminor.yy192;
3715
        break;
3716
      case 325: /* predicate ::= expression BETWEEN expression AND expression */
3717
{
3718 3719 3720
                                                                                    SToken s = getTokenFromRawExprNode(pCxt, yymsp[-4].minor.yy192);
                                                                                    SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy192);
                                                                                    yylhsminor.yy192 = createRawExprNodeExt(pCxt, &s, &e, createBetweenAnd(pCxt, releaseRawExprNode(pCxt, yymsp[-4].minor.yy192), releaseRawExprNode(pCxt, yymsp[-2].minor.yy192), releaseRawExprNode(pCxt, yymsp[0].minor.yy192)));
3721
                                                                                  }
3722
  yymsp[-4].minor.yy192 = yylhsminor.yy192;
3723
        break;
3724
      case 326: /* predicate ::= expression NOT BETWEEN expression AND expression */
3725
{
3726 3727 3728
                                                                                    SToken s = getTokenFromRawExprNode(pCxt, yymsp[-5].minor.yy192);
                                                                                    SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy192);
                                                                                    yylhsminor.yy192 = createRawExprNodeExt(pCxt, &s, &e, createNotBetweenAnd(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy192), releaseRawExprNode(pCxt, yymsp[-5].minor.yy192), releaseRawExprNode(pCxt, yymsp[0].minor.yy192)));
3729
                                                                                  }
3730
  yymsp[-5].minor.yy192 = yylhsminor.yy192;
3731
        break;
3732
      case 327: /* predicate ::= expression IS NULL */
3733
{
3734 3735
                                                                                    SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy192);
                                                                                    yylhsminor.yy192 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NULL, releaseRawExprNode(pCxt, yymsp[-2].minor.yy192), NULL));
3736
                                                                                  }
3737
  yymsp[-2].minor.yy192 = yylhsminor.yy192;
3738
        break;
3739
      case 328: /* predicate ::= expression IS NOT NULL */
3740
{
3741 3742
                                                                                    SToken s = getTokenFromRawExprNode(pCxt, yymsp[-3].minor.yy192);
                                                                                    yylhsminor.yy192 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NOT_NULL, releaseRawExprNode(pCxt, yymsp[-3].minor.yy192), NULL));
3743
                                                                                  }
3744
  yymsp[-3].minor.yy192 = yylhsminor.yy192;
3745
        break;
3746 3747
      case 330: /* compare_op ::= NK_LT */
{ yymsp[0].minor.yy412 = OP_TYPE_LOWER_THAN; }
3748
        break;
3749 3750
      case 331: /* compare_op ::= NK_GT */
{ yymsp[0].minor.yy412 = OP_TYPE_GREATER_THAN; }
3751
        break;
3752 3753
      case 332: /* compare_op ::= NK_LE */
{ yymsp[0].minor.yy412 = OP_TYPE_LOWER_EQUAL; }
3754
        break;
3755 3756
      case 333: /* compare_op ::= NK_GE */
{ yymsp[0].minor.yy412 = OP_TYPE_GREATER_EQUAL; }
3757
        break;
3758 3759
      case 334: /* compare_op ::= NK_NE */
{ yymsp[0].minor.yy412 = OP_TYPE_NOT_EQUAL; }
3760
        break;
3761 3762
      case 335: /* compare_op ::= NK_EQ */
{ yymsp[0].minor.yy412 = OP_TYPE_EQUAL; }
3763
        break;
3764 3765
      case 336: /* compare_op ::= LIKE */
{ yymsp[0].minor.yy412 = OP_TYPE_LIKE; }
3766
        break;
3767 3768
      case 337: /* compare_op ::= NOT LIKE */
{ yymsp[-1].minor.yy412 = OP_TYPE_NOT_LIKE; }
3769
        break;
3770 3771
      case 338: /* compare_op ::= MATCH */
{ yymsp[0].minor.yy412 = OP_TYPE_MATCH; }
3772
        break;
3773 3774
      case 339: /* compare_op ::= NMATCH */
{ yymsp[0].minor.yy412 = OP_TYPE_NMATCH; }
3775
        break;
3776 3777
      case 340: /* compare_op ::= CONTAINS */
{ yymsp[0].minor.yy412 = OP_TYPE_JSON_CONTAINS; }
3778
        break;
3779 3780
      case 341: /* in_op ::= IN */
{ yymsp[0].minor.yy412 = OP_TYPE_IN; }
3781
        break;
3782 3783
      case 342: /* in_op ::= NOT IN */
{ yymsp[-1].minor.yy412 = OP_TYPE_NOT_IN; }
3784
        break;
3785 3786 3787 3788 3789
      case 343: /* in_predicate_value ::= NK_LP expression_list NK_RP */
{ yylhsminor.yy192 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, createNodeListNode(pCxt, yymsp[-1].minor.yy64)); }
  yymsp[-2].minor.yy192 = yylhsminor.yy192;
        break;
      case 345: /* boolean_value_expression ::= NOT boolean_primary */
3790
{
3791 3792
                                                                                    SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy192);
                                                                                    yylhsminor.yy192 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_NOT, releaseRawExprNode(pCxt, yymsp[0].minor.yy192), NULL));
3793
                                                                                  }
3794
  yymsp[-1].minor.yy192 = yylhsminor.yy192;
3795
        break;
3796
      case 346: /* boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */
3797
{
3798 3799 3800
                                                                                    SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy192);
                                                                                    SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy192);
                                                                                    yylhsminor.yy192 = createRawExprNodeExt(pCxt, &s, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_OR, releaseRawExprNode(pCxt, yymsp[-2].minor.yy192), releaseRawExprNode(pCxt, yymsp[0].minor.yy192)));
3801
                                                                                  }
3802
  yymsp[-2].minor.yy192 = yylhsminor.yy192;
3803
        break;
3804
      case 347: /* boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */
3805
{
3806 3807 3808
                                                                                    SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy192);
                                                                                    SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy192);
                                                                                    yylhsminor.yy192 = createRawExprNodeExt(pCxt, &s, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_AND, releaseRawExprNode(pCxt, yymsp[-2].minor.yy192), releaseRawExprNode(pCxt, yymsp[0].minor.yy192)));
3809
                                                                                  }
3810
  yymsp[-2].minor.yy192 = yylhsminor.yy192;
3811
        break;
3812 3813 3814
      case 354: /* table_reference_list ::= table_reference_list NK_COMMA table_reference */
{ yylhsminor.yy192 = createJoinTableNode(pCxt, JOIN_TYPE_INNER, yymsp[-2].minor.yy192, yymsp[0].minor.yy192, NULL); }
  yymsp[-2].minor.yy192 = yylhsminor.yy192;
3815
        break;
3816 3817 3818
      case 357: /* table_primary ::= table_name alias_opt */
{ yylhsminor.yy192 = createRealTableNode(pCxt, NULL, &yymsp[-1].minor.yy353, &yymsp[0].minor.yy353); }
  yymsp[-1].minor.yy192 = yylhsminor.yy192;
3819
        break;
3820 3821 3822
      case 358: /* table_primary ::= db_name NK_DOT table_name alias_opt */
{ yylhsminor.yy192 = createRealTableNode(pCxt, &yymsp[-3].minor.yy353, &yymsp[-1].minor.yy353, &yymsp[0].minor.yy353); }
  yymsp[-3].minor.yy192 = yylhsminor.yy192;
3823
        break;
3824 3825 3826
      case 359: /* table_primary ::= subquery alias_opt */
{ yylhsminor.yy192 = createTempTableNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy192), &yymsp[0].minor.yy353); }
  yymsp[-1].minor.yy192 = yylhsminor.yy192;
3827
        break;
3828 3829
      case 361: /* alias_opt ::= */
{ yymsp[1].minor.yy353 = nil_token;  }
3830
        break;
3831 3832 3833
      case 362: /* alias_opt ::= table_alias */
{ yylhsminor.yy353 = yymsp[0].minor.yy353; }
  yymsp[0].minor.yy353 = yylhsminor.yy353;
3834
        break;
3835 3836
      case 363: /* alias_opt ::= AS table_alias */
{ yymsp[-1].minor.yy353 = yymsp[0].minor.yy353; }
3837
        break;
3838 3839 3840
      case 364: /* parenthesized_joined_table ::= NK_LP joined_table NK_RP */
      case 365: /* parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ yytestcase(yyruleno==365);
{ yymsp[-2].minor.yy192 = yymsp[-1].minor.yy192; }
3841
        break;
3842 3843 3844
      case 366: /* joined_table ::= table_reference join_type JOIN table_reference ON search_condition */
{ yylhsminor.yy192 = createJoinTableNode(pCxt, yymsp[-4].minor.yy372, yymsp[-5].minor.yy192, yymsp[-2].minor.yy192, yymsp[0].minor.yy192); }
  yymsp[-5].minor.yy192 = yylhsminor.yy192;
3845
        break;
3846 3847
      case 367: /* join_type ::= */
{ yymsp[1].minor.yy372 = JOIN_TYPE_INNER; }
3848
        break;
3849 3850
      case 368: /* join_type ::= INNER */
{ yymsp[0].minor.yy372 = JOIN_TYPE_INNER; }
3851
        break;
3852
      case 369: /* query_specification ::= SELECT set_quantifier_opt select_list from_clause where_clause_opt partition_by_clause_opt twindow_clause_opt group_by_clause_opt having_clause_opt */
3853
{ 
3854 3855 3856 3857 3858 3859
                                                                                    yymsp[-8].minor.yy192 = createSelectStmt(pCxt, yymsp[-7].minor.yy273, yymsp[-6].minor.yy64, yymsp[-5].minor.yy192);
                                                                                    yymsp[-8].minor.yy192 = addWhereClause(pCxt, yymsp[-8].minor.yy192, yymsp[-4].minor.yy192);
                                                                                    yymsp[-8].minor.yy192 = addPartitionByClause(pCxt, yymsp[-8].minor.yy192, yymsp[-3].minor.yy64);
                                                                                    yymsp[-8].minor.yy192 = addWindowClauseClause(pCxt, yymsp[-8].minor.yy192, yymsp[-2].minor.yy192);
                                                                                    yymsp[-8].minor.yy192 = addGroupByClause(pCxt, yymsp[-8].minor.yy192, yymsp[-1].minor.yy64);
                                                                                    yymsp[-8].minor.yy192 = addHavingClause(pCxt, yymsp[-8].minor.yy192, yymsp[0].minor.yy192);
3860 3861
                                                                                  }
        break;
3862 3863
      case 372: /* set_quantifier_opt ::= ALL */
{ yymsp[0].minor.yy273 = false; }
3864
        break;
3865 3866
      case 373: /* select_list ::= NK_STAR */
{ yymsp[0].minor.yy64 = NULL; }
3867
        break;
3868 3869 3870
      case 378: /* select_item ::= common_expression column_alias */
{ yylhsminor.yy192 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy192), &yymsp[0].minor.yy353); }
  yymsp[-1].minor.yy192 = yylhsminor.yy192;
3871
        break;
3872 3873 3874
      case 379: /* select_item ::= common_expression AS column_alias */
{ yylhsminor.yy192 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy192), &yymsp[0].minor.yy353); }
  yymsp[-2].minor.yy192 = yylhsminor.yy192;
3875
        break;
3876 3877 3878 3879
      case 384: /* partition_by_clause_opt ::= PARTITION BY expression_list */
      case 401: /* group_by_clause_opt ::= GROUP BY group_by_list */ yytestcase(yyruleno==401);
      case 411: /* order_by_clause_opt ::= ORDER BY sort_specification_list */ yytestcase(yyruleno==411);
{ yymsp[-2].minor.yy64 = yymsp[0].minor.yy64; }
3880
        break;
3881 3882
      case 386: /* twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP */
{ yymsp[-5].minor.yy192 = createSessionWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy192), releaseRawExprNode(pCxt, yymsp[-1].minor.yy192)); }
3883
        break;
3884 3885
      case 387: /* twindow_clause_opt ::= STATE_WINDOW NK_LP expression NK_RP */
{ yymsp[-3].minor.yy192 = createStateWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy192)); }
3886
        break;
3887 3888
      case 388: /* twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt */
{ yymsp[-5].minor.yy192 = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy192), NULL, yymsp[-1].minor.yy192, yymsp[0].minor.yy192); }
3889
        break;
3890 3891
      case 389: /* twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt */
{ yymsp[-7].minor.yy192 = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-5].minor.yy192), releaseRawExprNode(pCxt, yymsp[-3].minor.yy192), yymsp[-1].minor.yy192, yymsp[0].minor.yy192); }
3892
        break;
3893 3894
      case 391: /* sliding_opt ::= SLIDING NK_LP duration_literal NK_RP */
{ yymsp[-3].minor.yy192 = releaseRawExprNode(pCxt, yymsp[-1].minor.yy192); }
3895
        break;
3896 3897
      case 393: /* fill_opt ::= FILL NK_LP fill_mode NK_RP */
{ yymsp[-3].minor.yy192 = createFillNode(pCxt, yymsp[-1].minor.yy358, NULL); }
3898
        break;
3899 3900
      case 394: /* fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP */
{ yymsp[-5].minor.yy192 = createFillNode(pCxt, FILL_MODE_VALUE, createNodeListNode(pCxt, yymsp[-1].minor.yy64)); }
3901
        break;
3902 3903
      case 395: /* fill_mode ::= NONE */
{ yymsp[0].minor.yy358 = FILL_MODE_NONE; }
3904
        break;
3905 3906
      case 396: /* fill_mode ::= PREV */
{ yymsp[0].minor.yy358 = FILL_MODE_PREV; }
3907
        break;
3908 3909
      case 397: /* fill_mode ::= NULL */
{ yymsp[0].minor.yy358 = FILL_MODE_NULL; }
3910
        break;
3911 3912
      case 398: /* fill_mode ::= LINEAR */
{ yymsp[0].minor.yy358 = FILL_MODE_LINEAR; }
3913
        break;
3914 3915
      case 399: /* fill_mode ::= NEXT */
{ yymsp[0].minor.yy358 = FILL_MODE_NEXT; }
3916
        break;
3917 3918 3919
      case 402: /* group_by_list ::= expression */
{ yylhsminor.yy64 = createNodeList(pCxt, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy192))); }
  yymsp[0].minor.yy64 = yylhsminor.yy64;
3920
        break;
3921 3922 3923
      case 403: /* group_by_list ::= group_by_list NK_COMMA expression */
{ yylhsminor.yy64 = addNodeToList(pCxt, yymsp[-2].minor.yy64, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy192))); }
  yymsp[-2].minor.yy64 = yylhsminor.yy64;
3924
        break;
3925
      case 406: /* query_expression ::= query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt */
3926
{ 
3927 3928 3929
                                                                                    yylhsminor.yy192 = addOrderByClause(pCxt, yymsp[-3].minor.yy192, yymsp[-2].minor.yy64);
                                                                                    yylhsminor.yy192 = addSlimitClause(pCxt, yylhsminor.yy192, yymsp[-1].minor.yy192);
                                                                                    yylhsminor.yy192 = addLimitClause(pCxt, yylhsminor.yy192, yymsp[0].minor.yy192);
3930
                                                                                  }
3931
  yymsp[-3].minor.yy192 = yylhsminor.yy192;
3932
        break;
3933 3934 3935
      case 408: /* query_expression_body ::= query_expression_body UNION ALL query_expression_body */
{ yylhsminor.yy192 = createSetOperator(pCxt, SET_OP_TYPE_UNION_ALL, yymsp[-3].minor.yy192, yymsp[0].minor.yy192); }
  yymsp[-3].minor.yy192 = yylhsminor.yy192;
3936
        break;
3937 3938 3939
      case 413: /* slimit_clause_opt ::= SLIMIT NK_INTEGER */
      case 417: /* limit_clause_opt ::= LIMIT NK_INTEGER */ yytestcase(yyruleno==417);
{ yymsp[-1].minor.yy192 = createLimitNode(pCxt, &yymsp[0].minor.yy0, NULL); }
3940
        break;
3941 3942 3943
      case 414: /* slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */
      case 418: /* limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ yytestcase(yyruleno==418);
{ yymsp[-3].minor.yy192 = createLimitNode(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0); }
3944
        break;
3945 3946 3947
      case 415: /* slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */
      case 419: /* limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ yytestcase(yyruleno==419);
{ yymsp[-3].minor.yy192 = createLimitNode(pCxt, &yymsp[0].minor.yy0, &yymsp[-2].minor.yy0); }
3948
        break;
3949 3950 3951
      case 420: /* subquery ::= NK_LP query_expression NK_RP */
{ yylhsminor.yy192 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, yymsp[-1].minor.yy192); }
  yymsp[-2].minor.yy192 = yylhsminor.yy192;
3952
        break;
3953 3954 3955
      case 424: /* sort_specification ::= expression ordering_specification_opt null_ordering_opt */
{ yylhsminor.yy192 = createOrderByExprNode(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy192), yymsp[-1].minor.yy530, yymsp[0].minor.yy225); }
  yymsp[-2].minor.yy192 = yylhsminor.yy192;
3956
        break;
3957 3958
      case 425: /* ordering_specification_opt ::= */
{ yymsp[1].minor.yy530 = ORDER_ASC; }
3959
        break;
3960 3961
      case 426: /* ordering_specification_opt ::= ASC */
{ yymsp[0].minor.yy530 = ORDER_ASC; }
3962
        break;
3963 3964
      case 427: /* ordering_specification_opt ::= DESC */
{ yymsp[0].minor.yy530 = ORDER_DESC; }
3965
        break;
3966 3967
      case 428: /* null_ordering_opt ::= */
{ yymsp[1].minor.yy225 = NULL_ORDER_DEFAULT; }
3968
        break;
3969 3970
      case 429: /* null_ordering_opt ::= NULLS FIRST */
{ yymsp[-1].minor.yy225 = NULL_ORDER_FIRST; }
3971
        break;
3972 3973
      case 430: /* null_ordering_opt ::= NULLS LAST */
{ yymsp[-1].minor.yy225 = NULL_ORDER_LAST; }
3974 3975 3976 3977 3978
        break;
      default:
        break;
/********** End reduce actions ************************************************/
  };
3979 3980 3981
  assert( yyruleno<sizeof(yyRuleInfo)/sizeof(yyRuleInfo[0]) );
  yygoto = yyRuleInfo[yyruleno].lhs;
  yysize = yyRuleInfo[yyruleno].nrhs;
3982 3983 3984 3985 3986 3987 3988 3989 3990 3991 3992 3993 3994 3995 3996 3997 3998 3999 4000 4001 4002 4003 4004 4005
  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 已提交
4006 4007
  ParseARG_FETCH
  ParseCTX_FETCH
4008 4009 4010 4011 4012 4013 4014 4015 4016 4017
#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 已提交
4018 4019
  ParseARG_STORE /* Suppress warning about unused %extra_argument variable */
  ParseCTX_STORE
4020 4021 4022 4023 4024 4025 4026 4027 4028
}
#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 已提交
4029
  ParseTOKENTYPE yyminor         /* The minor type of the error token */
4030
){
X
Xiaoyu Wang 已提交
4031 4032
  ParseARG_FETCH
  ParseCTX_FETCH
4033 4034
#define TOKEN yyminor
/************ Begin %syntax_error code ****************************************/
4035 4036 4037 4038 4039 4040 4041 4042

  if (pCxt->valid) {
    if(TOKEN.z) {
      generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_SYNTAX_ERROR, TOKEN.z);
    } else {
      generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_INCOMPLETE_SQL);
    }
    pCxt->valid = false;
4043 4044
  }
/************ End %syntax_error code ******************************************/
X
Xiaoyu Wang 已提交
4045 4046
  ParseARG_STORE /* Suppress warning about unused %extra_argument variable */
  ParseCTX_STORE
4047 4048 4049 4050 4051 4052 4053 4054
}

/*
** The following is executed when the parser accepts
*/
static void yy_accept(
  yyParser *yypParser           /* The parser */
){
X
Xiaoyu Wang 已提交
4055 4056
  ParseARG_FETCH
  ParseCTX_FETCH
4057 4058 4059 4060 4061 4062 4063 4064 4065 4066 4067 4068 4069
#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 已提交
4070 4071
  ParseARG_STORE /* Suppress warning about unused %extra_argument variable */
  ParseCTX_STORE
4072 4073 4074 4075
}

/* The main parser program.
** The first argument is a pointer to a structure obtained from
X
Xiaoyu Wang 已提交
4076
** "ParseAlloc" which describes the current state of the parser.
4077 4078 4079 4080 4081 4082 4083 4084 4085 4086 4087 4088 4089 4090 4091 4092
** 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 已提交
4093
void Parse(
4094 4095
  void *yyp,                   /* The parser */
  int yymajor,                 /* The major token code number */
X
Xiaoyu Wang 已提交
4096 4097
  ParseTOKENTYPE yyminor       /* The value for the token */
  ParseARG_PDECL               /* Optional %extra_argument parameter */
4098 4099 4100 4101 4102 4103 4104 4105 4106 4107
){
  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 已提交
4108 4109
  ParseCTX_FETCH
  ParseARG_STORE
4110 4111 4112 4113 4114 4115 4116 4117 4118 4119 4120 4121 4122 4123 4124 4125 4126 4127 4128 4129 4130 4131 4132 4133

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

  yyact = yypParser->yytos->stateno;
#ifndef NDEBUG
  if( yyTraceFILE ){
    if( yyact < YY_MIN_REDUCE ){
      fprintf(yyTraceFILE,"%sInput '%s' in state %d\n",
              yyTracePrompt,yyTokenName[yymajor],yyact);
    }else{
      fprintf(yyTraceFILE,"%sInput '%s' with pending reduce %d\n",
              yyTracePrompt,yyTokenName[yymajor],yyact-YY_MIN_REDUCE);
    }
  }
#endif

  do{
    assert( yyact==yypParser->yytos->stateno );
    yyact = yy_find_shift_action((YYCODETYPE)yymajor,yyact);
    if( yyact >= YY_MIN_REDUCE ){
      yyact = yy_reduce(yypParser,yyact-YY_MIN_REDUCE,yymajor,
X
Xiaoyu Wang 已提交
4134
                        yyminor ParseCTX_PARAM);
4135 4136 4137 4138 4139 4140 4141 4142 4143 4144 4145 4146 4147 4148 4149 4150 4151 4152 4153 4154 4155 4156 4157 4158 4159 4160 4161 4162 4163 4164 4165 4166 4167 4168 4169 4170 4171 4172 4173 4174 4175 4176 4177 4178 4179 4180 4181 4182 4183 4184 4185 4186 4187 4188 4189 4190 4191 4192 4193 4194 4195 4196 4197 4198 4199 4200 4201 4202 4203 4204 4205 4206 4207 4208 4209 4210 4211 4212 4213 4214 4215 4216 4217 4218 4219 4220 4221 4222 4223 4224 4225 4226 4227 4228 4229 4230 4231 4232 4233 4234 4235 4236 4237 4238 4239 4240 4241 4242 4243 4244 4245 4246 4247 4248 4249 4250 4251 4252 4253 4254 4255 4256 4257 4258 4259 4260 4261 4262 4263 4264 4265 4266
    }else if( yyact <= YY_MAX_SHIFTREDUCE ){
      yy_shift(yypParser,yyact,(YYCODETYPE)yymajor,yyminor);
#ifndef YYNOERRORRECOVERY
      yypParser->yyerrcnt--;
#endif
      break;
    }else if( yyact==YY_ACCEPT_ACTION ){
      yypParser->yytos--;
      yy_accept(yypParser);
      return;
    }else{
      assert( yyact == YY_ERROR_ACTION );
      yyminorunion.yy0 = yyminor;
#ifdef YYERRORSYMBOL
      int yymx;
#endif
#ifndef NDEBUG
      if( yyTraceFILE ){
        fprintf(yyTraceFILE,"%sSyntax Error!\n",yyTracePrompt);
      }
#endif
#ifdef YYERRORSYMBOL
      /* A syntax error has occurred.
      ** The response to an error depends upon whether or not the
      ** grammar defines an error token "ERROR".  
      **
      ** This is what we do if the grammar does define ERROR:
      **
      **  * Call the %syntax_error function.
      **
      **  * Begin popping the stack until we enter a state where
      **    it is legal to shift the error symbol, then shift
      **    the error symbol.
      **
      **  * Set the error count to three.
      **
      **  * Begin accepting and shifting new tokens.  No new error
      **    processing will occur until three tokens have been
      **    shifted successfully.
      **
      */
      if( yypParser->yyerrcnt<0 ){
        yy_syntax_error(yypParser,yymajor,yyminor);
      }
      yymx = yypParser->yytos->major;
      if( yymx==YYERRORSYMBOL || yyerrorhit ){
#ifndef NDEBUG
        if( yyTraceFILE ){
          fprintf(yyTraceFILE,"%sDiscard input token %s\n",
             yyTracePrompt,yyTokenName[yymajor]);
        }
#endif
        yy_destructor(yypParser, (YYCODETYPE)yymajor, &yyminorunion);
        yymajor = YYNOCODE;
      }else{
        while( yypParser->yytos >= yypParser->yystack
            && (yyact = yy_find_reduce_action(
                        yypParser->yytos->stateno,
                        YYERRORSYMBOL)) > YY_MAX_SHIFTREDUCE
        ){
          yy_pop_parser_stack(yypParser);
        }
        if( yypParser->yytos < yypParser->yystack || yymajor==0 ){
          yy_destructor(yypParser,(YYCODETYPE)yymajor,&yyminorunion);
          yy_parse_failed(yypParser);
#ifndef YYNOERRORRECOVERY
          yypParser->yyerrcnt = -1;
#endif
          yymajor = YYNOCODE;
        }else if( yymx!=YYERRORSYMBOL ){
          yy_shift(yypParser,yyact,YYERRORSYMBOL,yyminor);
        }
      }
      yypParser->yyerrcnt = 3;
      yyerrorhit = 1;
      if( yymajor==YYNOCODE ) break;
      yyact = yypParser->yytos->stateno;
#elif defined(YYNOERRORRECOVERY)
      /* If the YYNOERRORRECOVERY macro is defined, then do not attempt to
      ** do any kind of error recovery.  Instead, simply invoke the syntax
      ** error routine and continue going as if nothing had happened.
      **
      ** Applications can set this macro (for example inside %include) if
      ** they intend to abandon the parse upon the first syntax error seen.
      */
      yy_syntax_error(yypParser,yymajor, yyminor);
      yy_destructor(yypParser,(YYCODETYPE)yymajor,&yyminorunion);
      break;
#else  /* YYERRORSYMBOL is not defined */
      /* This is what we do if the grammar does not define ERROR:
      **
      **  * Report an error message, and throw away the input token.
      **
      **  * If the input token is $, then fail the parse.
      **
      ** As before, subsequent error messages are suppressed until
      ** three input tokens have been successfully shifted.
      */
      if( yypParser->yyerrcnt<=0 ){
        yy_syntax_error(yypParser,yymajor, yyminor);
      }
      yypParser->yyerrcnt = 3;
      yy_destructor(yypParser,(YYCODETYPE)yymajor,&yyminorunion);
      if( yyendofinput ){
        yy_parse_failed(yypParser);
#ifndef YYNOERRORRECOVERY
        yypParser->yyerrcnt = -1;
#endif
      }
      break;
#endif
    }
  }while( yypParser->yytos>yypParser->yystack );
#ifndef NDEBUG
  if( yyTraceFILE ){
    yyStackEntry *i;
    char cDiv = '[';
    fprintf(yyTraceFILE,"%sReturn. Stack=",yyTracePrompt);
    for(i=&yypParser->yystack[1]; i<=yypParser->yytos; i++){
      fprintf(yyTraceFILE,"%c%s", cDiv, yyTokenName[i->major]);
      cDiv = ' ';
    }
    fprintf(yyTraceFILE,"]\n");
  }
#endif
  return;
}

/*
** Return the fallback token corresponding to canonical token iToken, or
** 0 if iToken has no fallback.
*/
X
Xiaoyu Wang 已提交
4267
int ParseFallback(int iToken){
4268
#ifdef YYFALLBACK
4269 4270 4271
  if( iToken<(int)(sizeof(yyFallback)/sizeof(yyFallback[0])) ){
    return yyFallback[iToken];
  }
4272 4273
#else
  (void)iToken;
4274
#endif
4275
  return 0;
4276
}