sql.c 184.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 268
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
  EOrder yy106;
  EFillMode yy142;
  SNode* yy176;
  SToken yy225;
  EJoinType yy236;
  SAlterOption yy325;
  EOperatorType yy404;
  SDataType yy448;
  ENullOrder yy465;
  bool yy505;
  int32_t yy508;
  SNodeList* yy512;
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             432
#define YYNRULE              346
#define YYNTOKEN             172
#define YY_MAX_SHIFT         431
#define YY_MIN_SHIFTREDUCE   673
#define YY_MAX_SHIFTREDUCE   1018
#define YY_ERROR_ACTION      1019
#define YY_ACCEPT_ACTION     1020
#define YY_NO_ACTION         1021
#define YY_MIN_REDUCE        1022
#define YY_MAX_REDUCE        1367
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 (1291)
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
 /*     0 */  1225,   43,  306, 1237, 1114,  350, 1221, 1227,  238, 1110,
 /*    10 */    89, 1201,   31,   29,   27,   26,   25, 1253, 1120,   24,
 /*    20 */   170, 1346,  226, 1253,  347,   31,   29,   27,   26,   25,
 /*    30 */   347,  363,  363, 1103, 1345,  362,   66,  270, 1344, 1225,
 /*    40 */   349, 1237,  307,  280, 1213, 1221, 1226,  212, 1065,  335,
 /*    50 */   321,  362, 1125, 1125,   61, 1238, 1239, 1242, 1285,  879,
 /*    60 */   212, 1253,  211, 1281,  246,  363,  271, 1346,  347,  894,
 /*    70 */  1122, 1192, 1194,  239, 1346,  106, 1092,  924,  349,  271,
 /*    80 */   117,  104, 1213,   12, 1344,  189, 1125,  117, 1155, 1127,
 /*    90 */   924, 1344,  107, 1238, 1239, 1242, 1023,  416,  415,  414,
 /*   100 */   413,  412,  411,  410,  409,  408,  407,  406,  405,  404,
 /*   110 */   403,  402,  401,  400,  399,   43,  925,   78,  926,  346,
 /*   120 */    77,   76,   75,   74,   73,   72,   71,   70,   69,  925,
 /*   130 */   336, 1359, 1121,   23,  233,   21,  919,  920,  921,  922,
 /*   140 */   923,  927,  928,  929,  883,  930,   23,  233, 1102,  919,
 /*   150 */   920,  921,  922,  923,  927,  928,  929,    9,    8, 1237,
 /*   160 */   362,  782,  386,  385,  384,  786,  383,  788,  789,  382,
 /*   170 */   791,  379,  309,  797,  376,  799,  800,  373,  370, 1253,
 /*   180 */    30,   28,  363, 1172,   98,  118,  334,  360,  235,  225,
 /*   190 */   861,   30,   28,  961, 1170,  105,  349, 1034,  284,  235,
 /*   200 */  1213,  861,  283, 1125, 1237,  395,  859,  916,   12,  394,
 /*   210 */    62, 1238, 1239, 1242, 1285,   11,  251,  859,  228, 1281,
 /*   220 */   112, 1253,  363,  285, 1253,  937,   11,   66,  347, 1116,
 /*   230 */   396,  334,  166,  881,  286,   52,    1,  109,  313, 1312,
 /*   240 */   219,  349,  210, 1125,  243, 1213,  165,    1, 1165,  393,
 /*   250 */   392,  391, 1118,  390,  324,   62, 1238, 1239, 1242, 1285,
 /*   260 */   428, 1225,  284,  228, 1281,  112,  283, 1221, 1226, 1172,
 /*   270 */  1213,  428,  860,  325, 1237,  240,  220,  104,  218,  217,
 /*   280 */  1170,  282,  118,  860, 1313, 1128,  118,  285,  710, 1299,
 /*   290 */   709,  862,  865,  201, 1253,  907,   31,   29,   27,   26,
 /*   300 */    25,  347,  862,  865,  201,  882,  907, 1296,  711, 1101,
 /*   310 */  1237,  349, 1045,   78,  118, 1213,   77,   76,   75,   74,
 /*   320 */    73,   72,   71,   70,   69,   62, 1238, 1239, 1242, 1285,
 /*   330 */  1253,  424,  423,  228, 1281, 1358,  363,  347,  245,  350,
 /*   340 */  1237,  361,   30,   28, 1319, 1202,  104,  349,   30,   28,
 /*   350 */   235, 1213,  861, 1213, 1127,  398,  235, 1125,  861,  709,
 /*   360 */  1253,   62, 1238, 1239, 1242, 1285,  985,  347,  859,  228,
 /*   370 */  1281, 1358,  968, 1172,  859,  278,  338,  349,  881,  247,
 /*   380 */  1342, 1213,  320,   11, 1170, 1044,  317,  983,  984,  986,
 /*   390 */   987,   62, 1238, 1239, 1242, 1285, 1237,  398,    7,  228,
 /*   400 */  1281, 1358,  339,  906,    1,  908,  909,  910,  911,  912,
 /*   410 */  1303,  880, 1299,  326,  322,  342, 1253,   30,   28,  348,
 /*   420 */  1068,   59,  428,  347, 1172,  235, 1213,  861,  428, 1043,
 /*   430 */  1295,   93, 1189,  349,  860, 1193,  960, 1213, 1117,  120,
 /*   440 */   860,  363,  335,  859, 1304,  956,  184,  202, 1238, 1239,
 /*   450 */  1242, 1014, 1015,  862,  865,  201,  248,  907,  389,  862,
 /*   460 */   865,  201, 1125,  907,  104,  259, 1112, 1346,  879,  292,
 /*   470 */  1213,  287, 1127,    7,  291,  252,  118,  290,  264,  288,
 /*   480 */   117, 1035,  289,  982, 1344,  340, 1237,  265,   31,   29,
 /*   490 */    27,   26,   25,   30,   28,   41, 1299,  428,    6,  363,
 /*   500 */   343,  235,  137,  861,  249,  135, 1253,   30,   28,  860,
 /*   510 */   122,  121, 1061,  347, 1294,  235, 1237,  861,  139,  859,
 /*   520 */  1125,  138,  884,  349,   27,   26,   25, 1213,  862,  865,
 /*   530 */   201, 1108,  907,  859,  293,  337, 1253,   63, 1238, 1239,
 /*   540 */  1242, 1285, 1056,  347,  388, 1284, 1281, 1042, 1093,    7,
 /*   550 */  1054,  318,  167,  349, 1172,  263, 1041, 1213,  258,  257,
 /*   560 */   256,  255,  254,    1,  295, 1171,  431,   63, 1238, 1239,
 /*   570 */  1242, 1285,  298,  428, 1237,  345, 1281,  868,  141,  959,
 /*   580 */   187,  140, 1040,   88,  160,  860,  277,  428, 1213,  420,
 /*   590 */  1039,  186,  331, 1166, 1253,  156, 1038, 1213, 1037,  860,
 /*   600 */   956,  347, 1100,  304,  862,  865,  201,  154,  907,    9,
 /*   610 */     8,  349, 1315,   92,   60, 1213,  302,  182,  862,  865,
 /*   620 */   201,  332,  907, 1213,  151,   63, 1238, 1239, 1242, 1285,
 /*   630 */   143, 1213,  335,  142, 1282, 1237, 1036, 1213, 1254, 1213,
 /*   640 */    90, 1017, 1018,  871, 1237,  169,   58,  867,  359, 1033,
 /*   650 */   163, 1292,  330, 1032,  329, 1253,   54, 1346, 1031,  395,
 /*   660 */  1030,  879,  347,  394, 1253,  312,  931, 1029,  147,    2,
 /*   670 */   117,  347,  349, 1237, 1344, 1028, 1213, 1213,   32,  234,
 /*   680 */  1020,  349, 1237,  119,  396, 1213,  206, 1238, 1239, 1242,
 /*   690 */  1213, 1237, 1191, 1253, 1213,  204, 1238, 1239, 1242, 1213,
 /*   700 */   347, 1213, 1253,  393,  392,  391,  253,  390, 1213,  347,
 /*   710 */   349, 1253, 1027,  870, 1213,  261, 1213,  314,  347,  349,
 /*   720 */   887, 1237,  260, 1213,  206, 1238, 1239, 1242,  349,  250,
 /*   730 */   262,  124, 1213,  205, 1238, 1239, 1242,  242,  241, 1237,
 /*   740 */   266, 1253,  107, 1238, 1239, 1242, 1026,  873,  347,  267,
 /*   750 */   886,  268,  194, 1213, 1346,  127,  331,  196,  349, 1253,
 /*   760 */    42, 1025, 1213,  866,  269,  327,  347,  117, 1237,  195,
 /*   770 */   891, 1344,  207, 1238, 1239, 1242,  349,   92,  130,  123,
 /*   780 */  1213, 1360,   32,  232,  272,  885,   20, 1213, 1253,  854,
 /*   790 */   206, 1238, 1239, 1242,  279,  347,   31,   29,   27,   26,
 /*   800 */    25,   32, 1213,   68,   90,  349, 1022,  281, 1115, 1213,
 /*   810 */   134, 1231,  236,  333,  113, 1292, 1293,  364, 1297,  206,
 /*   820 */  1238, 1239, 1242, 1229, 1237, 1111,  136,  100,  101,  869,
 /*   830 */    87,   86,   85,   84,   83,   82,   81,   80,   79,  861,
 /*   840 */    64,  175,  355, 1113, 1253,  181, 1237,  132,  874,  865,
 /*   850 */   111,  347, 1237,  173,   95,  859,  276,   96,  131,  775,
 /*   860 */  1109,  349,  102,  103,  224, 1213, 1253,  308,  146,  311,
 /*   870 */   770,   98, 1253,  347, 1237,  199, 1238, 1239, 1242,  347,
 /*   880 */   118,   44,   41,  349,  129,  310,  331, 1213,  149,  349,
 /*   890 */   884, 1316,  319, 1213, 1253, 1326,  152,  208, 1238, 1239,
 /*   900 */  1242,  347, 1237,  200, 1238, 1239, 1242,   92,  803,  428,
 /*   910 */  1237,  349,  807,  353,  316, 1213,  865, 1325,    5,  155,
 /*   920 */   368,  860, 1253,  227,   96,  209, 1238, 1239, 1242,  347,
 /*   930 */  1253,  128,  323, 1306,   90,  125,  159,  347, 1237,  349,
 /*   940 */   862,  865,  315, 1213,  114, 1292, 1293,  349, 1297,  328,
 /*   950 */     4, 1213,  161, 1250, 1238, 1239, 1242, 1237, 1253,   22,
 /*   960 */   110, 1249, 1238, 1239, 1242,  347, 1237,  956,  813,   31,
 /*   970 */    29,   27,   26,   25,  883,  349,  812, 1253, 1300, 1213,
 /*   980 */    97,   91,   33,  162,  347, 1237, 1253,  229,   98, 1248,
 /*   990 */  1238, 1239, 1242,  347,  349, 1361,  344,  341, 1213, 1343,
 /*  1000 */   168,   17, 1267,  349,   99, 1253,  356, 1213,  215, 1238,
 /*  1010 */  1239, 1242,  347, 1237, 1200,  351,   96,  214, 1238, 1239,
 /*  1020 */  1242,  352,  349,  177, 1199,  237, 1213,  357,  331,  358,
 /*  1030 */   179,  188,   51, 1253, 1126,   53,  216, 1238, 1239, 1242,
 /*  1040 */   347, 1237,  366,  297,  190,  185,  427,  197,  198,   92,
 /*  1050 */   349,  193, 1207,  192, 1213,  837, 1184, 1183,  305,   94,
 /*  1060 */  1182, 1253, 1181, 1180,  213, 1238, 1239, 1242,  347, 1179,
 /*  1070 */  1178, 1177,  145, 1176, 1175,  300,   90,  839,  349, 1174,
 /*  1080 */   294, 1173, 1213,  144, 1067, 1206,  115, 1292, 1293, 1197,
 /*  1090 */  1297,  126,  203, 1238, 1239, 1242, 1104,  722, 1066, 1064,
 /*  1100 */   292,  275,  287,  273,  274,  291,   40, 1053,  290,   39,
 /*  1110 */   288, 1052, 1049,  289, 1106,   31,   29,   27,   26,   25,
 /*  1120 */    67,  133,  818, 1105,  820,  819,  750, 1062,  749,  748,
 /*  1130 */   747,  746,  745, 1057,  296,  221, 1055,  222,  223,  299,
 /*  1140 */  1048,  301, 1047,  303,   65, 1205, 1204,   36, 1196,  148,
 /*  1150 */    45,  150,   14,    3,   15,   34,   32,   37,  158,   19,
 /*  1160 */  1229,   48,   10,  164,    8,  917,  153, 1003, 1002,  230,
 /*  1170 */  1007,  981,  894,  108,  354, 1006,  157,  231,  975,  974,
 /*  1180 */  1195,  180,  875, 1021,  116,   46,   47, 1021, 1021,  953,
 /*  1190 */  1021,  952, 1021, 1021,  178, 1008, 1063, 1051, 1050,  367,
 /*  1200 */  1021,  244, 1021,  371,  892,  781,   35,  172, 1021,   16,
 /*  1210 */   979,   13,   18,  374,  171,  174,  377,  176,   49,  380,
 /*  1220 */    50,  425, 1021, 1021,   38,  815,  809,  426,  804,  742,
 /*  1230 */   811,   54,  369,  810, 1228,  183,  801,  365,  372, 1021,
 /*  1240 */   798,  375,  734,  792,  378,  422,  790,  381,  741,  740,
 /*  1250 */   720,  739,  397,   55,  738,  737,  736,  735,   56,  733,
 /*  1260 */   796,  418,  795,  794,  387,  732,  793,  731,   57,  730,
 /*  1270 */   729,  728,  727,  726,  725,  417, 1046,  421,  863,  191,
 /*  1280 */   429,  419,  430, 1021, 1021, 1021, 1021, 1021, 1021, 1021,
 /*  1290 */   814,
344 345
};
static const YYCODETYPE yy_lookahead[] = {
346 347 348 349 350 351 352 353 354 355
 /*     0 */   216,  183,  181,  175,  196,  212,  222,  223,  215,  196,
 /*    10 */   192,  218,   12,   13,   14,   15,   16,  195,  200,  231,
 /*    20 */   232,  246,  199,  195,  202,   12,   13,   14,   15,   16,
 /*    30 */   202,  181,  181,    0,  259,   20,  186,  186,  263,  216,
 /*    40 */   212,  175,  221,  193,  216,  222,  223,   47,    0,  221,
 /*    50 */   228,   20,  202,  202,  226,  227,  228,  229,  230,   20,
 /*    60 */    47,  195,  234,  235,  204,  181,   46,  246,  202,   69,
 /*    70 */   186,  211,  212,  187,  246,  184,  185,   77,  212,   46,
 /*    80 */   259,  195,  216,   68,  263,  188,  202,  259,  191,  203,
 /*    90 */    77,  263,  226,  227,  228,  229,    0,   49,   50,   51,
X
Xiaoyu Wang 已提交
356
 /*   100 */    52,   53,   54,   55,   56,   57,   58,   59,   60,   61,
357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492
 /*   110 */    62,   63,   64,   65,   66,  183,  116,   21,  116,   47,
 /*   120 */    24,   25,   26,   27,   28,   29,   30,   31,   32,  116,
 /*   130 */   264,  265,  200,  133,  134,  133,  136,  137,  138,  139,
 /*   140 */   140,  141,  142,  143,   20,  143,  133,  134,    0,  136,
 /*   150 */   137,  138,  139,  140,  141,  142,  143,    1,    2,  175,
 /*   160 */    20,   83,   84,   85,   86,   87,   88,   89,   90,   91,
 /*   170 */    92,   93,   69,   95,   96,   97,   98,   99,  100,  195,
 /*   180 */    12,   13,  181,  195,   81,  146,  202,  186,   20,  201,
 /*   190 */    22,   12,   13,   14,  206,  174,  212,  176,   57,   20,
 /*   200 */   216,   22,   61,  202,  175,   57,   38,  135,   68,   61,
 /*   210 */   226,  227,  228,  229,  230,   47,  181,   38,  234,  235,
 /*   220 */   236,  195,  181,   82,  195,   69,   47,  186,  202,  175,
 /*   230 */    82,  202,  248,   20,  193,  180,   68,  194,  254,  255,
 /*   240 */    35,  212,  207,  202,  199,  216,  122,   68,  205,  101,
 /*   250 */   102,  103,  197,  105,  228,  226,  227,  228,  229,  230,
 /*   260 */    92,  216,   57,  234,  235,  236,   61,  222,  223,  195,
 /*   270 */   216,   92,  104,   20,  175,  201,   71,  195,   73,   74,
 /*   280 */   206,   76,  146,  104,  255,  203,  146,   82,   20,  224,
 /*   290 */    22,  123,  124,  125,  195,  127,   12,   13,   14,   15,
 /*   300 */    16,  202,  123,  124,  125,   20,  127,  242,   40,    0,
 /*   310 */   175,  212,  175,   21,  146,  216,   24,   25,   26,   27,
 /*   320 */    28,   29,   30,   31,   32,  226,  227,  228,  229,  230,
 /*   330 */   195,  178,  179,  234,  235,  236,  181,  202,  187,  212,
 /*   340 */   175,  186,   12,   13,  245,  218,  195,  212,   12,   13,
 /*   350 */    20,  216,   22,  216,  203,   46,   20,  202,   22,   22,
 /*   360 */   195,  226,  227,  228,  229,  230,  135,  202,   38,  234,
 /*   370 */   235,  236,   14,  195,   38,   38,    3,  212,   20,  201,
 /*   380 */   245,  216,  120,   47,  206,  175,  155,  156,  157,  158,
 /*   390 */   159,  226,  227,  228,  229,  230,  175,   46,   68,  234,
 /*   400 */   235,  236,   81,  126,   68,  128,  129,  130,  131,  132,
 /*   410 */   245,   20,  224,  151,  152,   81,  195,   12,   13,   14,
 /*   420 */     0,  180,   92,  202,  195,   20,  216,   22,   92,  175,
 /*   430 */   242,  190,  202,  212,  104,  206,    4,  216,  197,  209,
 /*   440 */   104,  181,  221,   38,  144,  145,  186,  226,  227,  228,
 /*   450 */   229,  167,  168,  123,  124,  125,  187,  127,   79,  123,
 /*   460 */   124,  125,  202,  127,  195,   63,  196,  246,   20,   49,
 /*   470 */   216,   51,  203,   68,   54,   27,  146,   57,   30,   59,
 /*   480 */   259,  176,   62,   69,  263,  164,  175,   39,   12,   13,
 /*   490 */    14,   15,   16,   12,   13,   81,  224,   92,   43,  181,
 /*   500 */   166,   20,   72,   22,  186,   75,  195,   12,   13,  104,
 /*   510 */   108,  109,    0,  202,  242,   20,  175,   22,   72,   38,
 /*   520 */   202,   75,   20,  212,   14,   15,   16,  216,  123,  124,
 /*   530 */   125,  196,  127,   38,   22,  162,  195,  226,  227,  228,
 /*   540 */   229,  230,    0,  202,  196,  234,  235,  175,  185,   68,
 /*   550 */     0,  257,  266,  212,  195,  107,  175,  216,  110,  111,
 /*   560 */   112,  113,  114,   68,   22,  206,   19,  226,  227,  228,
 /*   570 */   229,  230,   22,   92,  175,  234,  235,   38,   72,  147,
 /*   580 */    33,   75,  175,   36,  251,  104,  178,   92,  216,   42,
 /*   590 */   175,   44,  181,  205,  195,   69,  175,  216,  175,  104,
 /*   600 */   145,  202,    0,   21,  123,  124,  125,   81,  127,    1,
 /*   610 */     2,  212,  225,  202,   67,  216,   34,   70,  123,  124,
 /*   620 */   125,  244,  127,  216,  122,  226,  227,  228,  229,  230,
 /*   630 */    72,  216,  221,   75,  235,  175,  175,  216,  195,  216,
 /*   640 */   229,  170,  171,  104,  175,  260,   68,   38,  101,  175,
 /*   650 */   239,  240,  241,  175,  243,  195,   78,  246,  175,   57,
 /*   660 */   175,   20,  202,   61,  195,  118,   69,  175,  121,  247,
 /*   670 */   259,  202,  212,  175,  263,  175,  216,  216,   81,  219,
 /*   680 */   172,  212,  175,  115,   82,  216,  226,  227,  228,  229,
 /*   690 */   216,  175,  181,  195,  216,  226,  227,  228,  229,  216,
 /*   700 */   202,  216,  195,  101,  102,  103,  210,  105,  216,  202,
 /*   710 */   212,  195,  175,  104,  216,  116,  216,  219,  202,  212,
 /*   720 */    20,  175,  208,  216,  226,  227,  228,  229,  212,  221,
 /*   730 */   208,  183,  216,  226,  227,  228,  229,   12,   13,  175,
 /*   740 */   181,  195,  226,  227,  228,  229,  175,   22,  202,  220,
 /*   750 */    20,  202,   18,  216,  246,  183,  181,   23,  212,  195,
 /*   760 */   183,  175,  216,   38,  213,  258,  202,  259,  175,   35,
 /*   770 */    69,  263,  226,  227,  228,  229,  212,  202,  183,   45,
 /*   780 */   216,  265,   81,  219,  181,   20,    2,  216,  195,   69,
 /*   790 */   226,  227,  228,  229,  177,  202,   12,   13,   14,   15,
 /*   800 */    16,   81,  216,  181,  229,  212,    0,  195,  195,  216,
 /*   810 */   195,   68,  219,  238,  239,  240,  241,   92,  243,  226,
 /*   820 */   227,  228,  229,   80,  175,  195,  195,  195,  195,  104,
 /*   830 */    24,   25,   26,   27,   28,   29,   30,   31,   32,   22,
 /*   840 */   106,   69,   69,  195,  195,   69,  175,   33,  123,  124,
 /*   850 */    36,  202,  175,   81,   81,   38,   42,   81,   44,   69,
 /*   860 */   195,  212,  195,  195,  177,  216,  195,  220,  180,  213,
 /*   870 */    69,   81,  195,  202,  175,  226,  227,  228,  229,  202,
 /*   880 */   146,   67,   81,  212,   70,  202,  181,  216,  180,  212,
 /*   890 */    20,  225,  154,  216,  195,  256,  217,  226,  227,  228,
 /*   900 */   229,  202,  175,  226,  227,  228,  229,  202,   69,   92,
 /*   910 */   175,  212,   69,  153,  216,  216,  124,  256,  161,  217,
 /*   920 */    81,  104,  195,  216,   81,  226,  227,  228,  229,  202,
 /*   930 */   195,  117,  216,  253,  229,  121,  252,  202,  175,  212,
 /*   940 */   123,  124,  149,  216,  239,  240,  241,  212,  243,  160,
 /*   950 */   148,  216,  249,  226,  227,  228,  229,  175,  195,    2,
 /*   960 */   250,  226,  227,  228,  229,  202,  175,  145,   69,   12,
 /*   970 */    13,   14,   15,   16,   20,  212,   69,  195,  224,  216,
 /*   980 */    81,  202,  115,  237,  202,  175,  195,  169,   81,  226,
 /*   990 */   227,  228,  229,  202,  212,  267,  165,  163,  216,  262,
 /*  1000 */   261,   68,  233,  212,   69,  195,  119,  216,  226,  227,
 /*  1010 */   228,  229,  202,  175,  217,  216,   81,  226,  227,  228,
 /*  1020 */   229,  216,  212,  202,  217,  216,  216,  214,  181,  213,
 /*  1030 */   180,  191,  180,  195,  202,   68,  226,  227,  228,  229,
 /*  1040 */   202,  175,  198,    4,  181,  180,  177,  189,  189,  202,
 /*  1050 */   212,  173,    0,  182,  216,   80,    0,    0,   19,  115,
 /*  1060 */     0,  195,    0,    0,  226,  227,  228,  229,  202,    0,
 /*  1070 */     0,    0,   33,    0,    0,   36,  229,   22,  212,    0,
 /*  1080 */    41,    0,  216,   44,    0,    0,  239,  240,  241,    0,
 /*  1090 */   243,   43,  226,  227,  228,  229,    0,   48,    0,    0,
 /*  1100 */    49,   43,   51,   38,   36,   54,   67,    0,   57,   70,
 /*  1110 */    59,    0,    0,   62,    0,   12,   13,   14,   15,   16,
 /*  1120 */    77,   75,   22,    0,   38,   38,   38,    0,   38,   38,
 /*  1130 */    38,   38,   38,    0,   39,   22,    0,   22,   22,   38,
 /*  1140 */     0,   22,    0,   22,   20,    0,    0,  122,    0,   43,
 /*  1150 */    68,  117,  150,   81,  150,  144,   81,   81,   81,   81,
 /*  1160 */    80,    4,  150,   80,    2,  135,   69,   38,   38,   38,
 /*  1170 */    38,   69,   69,   68,  120,   38,   68,   38,   69,   69,
 /*  1180 */     0,  117,   22,  268,   80,   68,   68,  268,  268,   69,
 /*  1190 */   268,   69,  268,  268,   43,   69,    0,    0,    0,   38,
 /*  1200 */   268,   38,  268,   38,   69,   22,   81,   69,  268,   81,
 /*  1210 */    69,   68,   68,   38,   80,   68,   38,   68,   68,   38,
 /*  1220 */    68,   22,  268,  268,   68,   38,   22,   21,   69,   22,
 /*  1230 */    38,   78,   68,   38,   80,   80,   69,   79,   68,  268,
 /*  1240 */    69,   68,   22,   69,   68,   37,   69,   68,   38,   38,
 /*  1250 */    48,   38,   47,   68,   38,   38,   38,   38,   68,   38,
 /*  1260 */    94,   36,   94,   94,   82,   38,   94,   38,   68,   38,
 /*  1270 */    38,   38,   38,   38,   38,   38,    0,   38,   22,   22,
 /*  1280 */    21,   43,   20,  268,  268,  268,  268,  268,  268,  268,
 /*  1290 */   104,  268,  268,  268,  268,  268,  268,  268,  268,  268,
 /*  1300 */   268,  268,  268,  268,  268,  268,  268,  268,  268,  268,
 /*  1310 */   268,  268,  268,  268,  268,  268,  268,  268,  268,  268,
 /*  1320 */   268,  268,  268,  268,  268,  268,  268,  268,  268,  268,
 /*  1330 */   268,  268,  268,  268,  268,  268,  268,  268,  268,  268,
 /*  1340 */   268,  268,  268,  268,  268,  268,  268,  268,  268,  268,
 /*  1350 */   268,  268,  268,  268,  268,  268,  268,  268,  268,  268,
 /*  1360 */   268,  268,  268,  268,  268,  268,  268,  268,  268,  268,
 /*  1370 */   268,  268,  268,  268,  268,  268,  268,  268,  268,  268,
 /*  1380 */   268,  268,  268,  268,  268,  268,  268,  268,  268,  268,
 /*  1390 */   268,  268,  268,  268,  268,  268,  268,  268,  268,  268,
 /*  1400 */   268,  268,  268,  268,  268,  268,  268,  268,  268,  268,
 /*  1410 */   268,  268,  268,  268,  268,  268,  268,  268,  268,  268,
 /*  1420 */   268,  268,  268,  268,  268,  268,  268,  268,  268,  268,
 /*  1430 */   268,  268,  268,  268,  268,  268,  268,  268,  268,  268,
 /*  1440 */   268,  268,  268,  268,  268,  268,  268,  268,  268,  268,
 /*  1450 */   268,  268,  268,  268,  268,  268,  268,  268,  268,  268,
 /*  1460 */   268,  268,  268,
493
};
494
#define YY_SHIFT_COUNT    (431)
495
#define YY_SHIFT_MIN      (0)
496
#define YY_SHIFT_MAX      (1276)
497
static const unsigned short int yy_shift_ofst[] = {
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
 /*     0 */   734,  168,  179,  336,  336,  336,  336,  330,  336,  336,
 /*    10 */   481,  495,  140,  405,  481,  481,  481,  481,  481,  481,
 /*    20 */   481,  481,  481,  481,  481,  481,  481,  481,  481,  481,
 /*    30 */   481,  481,  481,   15,   15,   15,   39,  725,  725,   31,
 /*    40 */    31,  725,   31,   31,   20,  213,  253,  253,  136,  285,
 /*    50 */   213,   31,   31,  213,   31,  213,  285,  213,  213,   31,
 /*    60 */   351,    0,   13,   13,  448,  292,  205,  817, 1051,  817,
 /*    70 */   817,  817,  817,  817,  817,  817,  817,  817,  817,  817,
 /*    80 */   817,  817,  817,  817,  817,  817,  817,  817,  268,   33,
 /*    90 */   124,  124,  124,  309,  391,  285,  213,  213,  213,  379,
 /*   100 */    78,   78,   78,   78,   78,   96,  420,  284,  231,  141,
 /*   110 */   262,  337,  502,  300,  455,  300,  358,  373,  432,  641,
 /*   120 */   568,  599,  599,  641,  700,   20,  391,  730,   20,   20,
 /*   130 */   641,   20,  765,  213,  213,  213,  213,  213,  213,  213,
 /*   140 */   213,  213,  213,  213,  641,  765,  700,  351,  391,  730,
 /*   150 */   351,  870,  738,  760,  792,  738,  760,  792,  792,  757,
 /*   160 */   789,  793,  802,  822,  391,  954,  867,  818,  831,  834,
 /*   170 */   933,  213,  760,  792,  792,  760,  792,  887,  391,  730,
 /*   180 */   351,  379,  351,  391,  967,  641,  351,  765, 1291, 1291,
 /*   190 */  1291, 1291,   48,  806,  547,  814, 1039,  148,  602,  784,
 /*   200 */   957,  277, 1103,  476,  476,  476,  476,  476,  476,  476,
 /*   210 */   402,  156,    2,  510,  510,  510,  510,  430,  446,  506,
 /*   220 */   558,  512,  542,  550,  582,  103,  414,  526,  608,  471,
 /*   230 */   321,  334,  597,   72,  701,  743,  720,  772,  773,  776,
 /*   240 */   790,  539,  609,  801,  839,  843,  899,  907,  935,  578,
 /*   250 */  1052,  975, 1056, 1057,  944, 1060, 1062, 1063, 1069, 1070,
 /*   260 */  1071, 1055, 1073, 1074, 1079, 1081, 1084, 1085, 1089, 1048,
 /*   270 */  1096, 1049, 1098, 1099, 1065, 1068, 1058, 1107, 1111, 1112,
 /*   280 */  1114, 1043, 1046, 1086, 1087, 1100, 1123, 1088, 1090, 1091,
 /*   290 */  1092, 1093, 1094, 1127, 1113, 1133, 1115, 1095, 1136, 1116,
 /*   300 */  1101, 1140, 1119, 1142, 1121, 1124, 1145, 1146, 1025, 1148,
 /*   310 */  1082, 1106, 1034, 1072, 1075, 1002, 1097, 1076, 1102, 1105,
 /*   320 */  1108, 1109, 1117, 1110, 1077, 1080, 1118, 1078, 1004, 1120,
 /*   330 */  1122, 1083, 1011, 1125, 1104, 1126, 1128, 1012, 1157, 1129,
 /*   340 */  1130, 1131, 1132, 1137, 1139, 1162, 1030, 1134, 1135, 1143,
 /*   350 */  1144, 1138, 1141, 1147, 1149, 1054, 1150, 1180, 1151, 1064,
 /*   360 */  1152, 1153, 1154, 1155, 1160, 1156, 1158, 1159, 1161, 1163,
 /*   370 */  1164, 1167, 1165, 1170, 1171, 1175, 1173, 1174, 1178, 1176,
 /*   380 */  1177, 1181, 1179, 1166, 1168, 1169, 1172, 1183, 1182, 1185,
 /*   390 */  1187, 1186, 1190, 1200, 1192, 1195, 1204, 1202, 1205, 1207,
 /*   400 */  1210, 1211, 1213, 1216, 1217, 1218, 1219, 1220, 1221, 1227,
 /*   410 */  1229, 1231, 1232, 1233, 1234, 1235, 1236, 1196, 1237, 1225,
 /*   420 */  1238, 1197, 1239, 1208, 1198, 1276, 1199, 1206, 1256, 1257,
 /*   430 */  1259, 1262,
542
};
X
Xiaoyu Wang 已提交
543
#define YY_REDUCE_COUNT (191)
544 545
#define YY_REDUCE_MIN   (-225)
#define YY_REDUCE_MAX   (878)
546
static const short yy_reduce_ofst[] = {
547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566
 /*     0 */   508, -172,  -16,   29,   99,  135,  165,  221,  311,  341,
 /*    10 */  -134,  399,  411,  460,  498,  507,  516,  564,  593,  469,
 /*    20 */   546,  649,  671,  677,  699,  727,  735,  763,  782,  791,
 /*    30 */   810,  838,  866,  575,  705,  847, -179, -177,   45, -150,
 /*    40 */    41, -216, -149, -116, -182,  -12, -178,   26, -225, -207,
 /*    50 */  -114,    1,  155,   74,  260,  151, -140,  178,  269,  318,
 /*    60 */   241, -212, -212, -212,   35,   21,   43,   54, -109,  137,
 /*    70 */   210,  254,  372,  381,  407,  415,  421,  423,  461,  474,
 /*    80 */   478,  483,  485,  492,  500,  537,  571,  586,  153,  -68,
 /*    90 */    65,  188,  272,   55,  230,  127,   82,  229,  359, -103,
 /*   100 */  -192, -187,  270,  335,  348,  305,  363,  286,  294,  388,
 /*   110 */   333,  408,  387,  377,  377,  377,  443,  385,  422,  511,
 /*   120 */   496,  514,  522,  559,  529,  548,  549,  551,  572,  577,
 /*   130 */   603,  595,  617,  612,  613,  615,  630,  631,  632,  633,
 /*   140 */   648,  665,  667,  668,  622,  687,  647,  688,  683,  656,
 /*   150 */   708,  666,  639,  679,  698,  661,  702,  707,  716,  680,
 /*   160 */   684,  710,  703,  377,  779,  754,  746,  728,  737,  739,
 /*   170 */   769,  443,  797,  799,  805,  807,  809,  813,  821,  816,
 /*   180 */   850,  840,  852,  832,  844,  863,  865,  869,  858,  859,
 /*   190 */   871,  878,
567 568
};
static const YYACTIONTYPE yy_default[] = {
569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612
 /*     0 */  1019, 1019, 1019, 1019, 1019, 1019, 1019, 1019, 1019, 1019,
 /*    10 */  1019, 1019, 1019, 1019, 1019, 1019, 1019, 1019, 1019, 1019,
 /*    20 */  1019, 1019, 1019, 1019, 1019, 1019, 1019, 1019, 1019, 1019,
 /*    30 */  1019, 1019, 1019, 1019, 1019, 1019, 1019, 1019, 1019, 1019,
 /*    40 */  1019, 1019, 1019, 1019, 1072, 1019, 1019, 1019, 1019, 1019,
 /*    50 */  1019, 1019, 1019, 1019, 1019, 1019, 1019, 1019, 1019, 1019,
 /*    60 */  1070, 1019, 1287, 1019, 1185, 1019, 1019, 1019, 1019, 1019,
 /*    70 */  1019, 1019, 1019, 1019, 1019, 1019, 1019, 1019, 1019, 1019,
 /*    80 */  1019, 1019, 1019, 1019, 1019, 1019, 1019, 1019, 1019, 1072,
 /*    90 */  1298, 1298, 1298, 1070, 1019, 1019, 1019, 1019, 1019, 1154,
 /*   100 */  1019, 1019, 1019, 1019, 1019, 1019, 1019, 1362, 1019, 1107,
 /*   110 */  1322, 1019, 1314, 1290, 1304, 1291, 1019, 1347, 1307, 1019,
 /*   120 */  1190, 1187, 1187, 1019, 1019, 1072, 1019, 1019, 1072, 1072,
 /*   130 */  1019, 1072, 1019, 1019, 1019, 1019, 1019, 1019, 1019, 1019,
 /*   140 */  1019, 1019, 1019, 1019, 1019, 1019, 1019, 1070, 1019, 1019,
 /*   150 */  1070, 1019, 1329, 1327, 1019, 1329, 1327, 1019, 1019, 1341,
 /*   160 */  1337, 1320, 1318, 1304, 1019, 1019, 1019, 1365, 1353, 1349,
 /*   170 */  1019, 1019, 1327, 1019, 1019, 1327, 1019, 1198, 1019, 1019,
 /*   180 */  1070, 1019, 1070, 1019, 1123, 1019, 1070, 1019, 1157, 1157,
 /*   190 */  1073, 1024, 1019, 1019, 1019, 1019, 1019, 1019, 1019, 1019,
 /*   200 */  1019, 1019, 1019, 1252, 1340, 1339, 1251, 1264, 1263, 1262,
 /*   210 */  1019, 1019, 1019, 1246, 1247, 1245, 1244, 1019, 1019, 1019,
 /*   220 */  1019, 1019, 1019, 1019, 1019, 1019, 1019, 1019, 1288, 1019,
 /*   230 */  1350, 1354, 1019, 1019, 1019, 1230, 1019, 1019, 1019, 1019,
 /*   240 */  1019, 1019, 1019, 1019, 1019, 1019, 1019, 1019, 1019, 1019,
 /*   250 */  1019, 1019, 1019, 1019, 1019, 1019, 1019, 1019, 1019, 1019,
 /*   260 */  1019, 1019, 1019, 1019, 1019, 1019, 1019, 1019, 1019, 1019,
 /*   270 */  1019, 1019, 1019, 1019, 1019, 1019, 1019, 1019, 1019, 1019,
 /*   280 */  1019, 1019, 1019, 1019, 1019, 1019, 1019, 1019, 1019, 1019,
 /*   290 */  1019, 1019, 1019, 1019, 1019, 1019, 1019, 1019, 1019, 1019,
 /*   300 */  1019, 1019, 1019, 1019, 1019, 1019, 1019, 1019, 1019, 1019,
 /*   310 */  1019, 1019, 1019, 1311, 1321, 1019, 1019, 1019, 1019, 1019,
 /*   320 */  1019, 1019, 1019, 1019, 1019, 1230, 1019, 1338, 1019, 1297,
 /*   330 */  1293, 1019, 1019, 1289, 1019, 1019, 1348, 1019, 1019, 1019,
 /*   340 */  1019, 1019, 1019, 1019, 1019, 1283, 1019, 1019, 1019, 1019,
 /*   350 */  1019, 1019, 1019, 1019, 1019, 1019, 1019, 1019, 1019, 1019,
 /*   360 */  1019, 1019, 1229, 1019, 1019, 1019, 1019, 1019, 1019, 1019,
 /*   370 */  1151, 1019, 1019, 1019, 1019, 1019, 1019, 1019, 1019, 1019,
 /*   380 */  1019, 1019, 1019, 1136, 1134, 1133, 1132, 1019, 1129, 1019,
 /*   390 */  1019, 1019, 1019, 1019, 1019, 1019, 1019, 1019, 1019, 1019,
 /*   400 */  1019, 1019, 1019, 1019, 1019, 1019, 1019, 1019, 1019, 1019,
 /*   410 */  1019, 1019, 1019, 1019, 1019, 1019, 1019, 1019, 1019, 1019,
 /*   420 */  1019, 1019, 1019, 1019, 1019, 1019, 1019, 1019, 1019, 1019,
 /*   430 */  1019, 1019,
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 660 661 662 663 664 665 666 667 668 669
};
/********** 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 已提交
670 671
  ParseARG_SDECL                /* A place to hold %extra_argument */
  ParseCTX_SDECL                /* A place to hold %extra_context */
672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706
#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 已提交
707
void ParseTrace(FILE *TraceFILE, char *zTracePrompt){
708 709 710 711 712 713 714 715 716 717 718 719
  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 */ "$",
720 721
  /*    1 */ "OR",
  /*    2 */ "AND",
722 723 724 725 726
  /*    3 */ "UNION",
  /*    4 */ "ALL",
  /*    5 */ "MINUS",
  /*    6 */ "EXCEPT",
  /*    7 */ "INTERSECT",
727 728 729 730 731 732 733 734 735 736
  /*    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",
737
  /*   18 */ "CREATE",
738 739 740
  /*   19 */ "ACCOUNT",
  /*   20 */ "NK_ID",
  /*   21 */ "PASS",
741 742 743 744 745 746 747 748 749 750 751 752
  /*   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",
753 754
  /*   34 */ "PRIVILEGE",
  /*   35 */ "DROP",
X
Xiaoyu Wang 已提交
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
  /*   36 */ "DNODE",
  /*   37 */ "PORT",
  /*   38 */ "NK_INTEGER",
  /*   39 */ "DNODES",
  /*   40 */ "NK_IPTOKEN",
  /*   41 */ "LOCAL",
  /*   42 */ "QNODE",
  /*   43 */ "ON",
  /*   44 */ "DATABASE",
  /*   45 */ "USE",
  /*   46 */ "IF",
  /*   47 */ "NOT",
  /*   48 */ "EXISTS",
  /*   49 */ "BLOCKS",
  /*   50 */ "CACHE",
  /*   51 */ "CACHELAST",
  /*   52 */ "COMP",
  /*   53 */ "DAYS",
  /*   54 */ "FSYNC",
  /*   55 */ "MAXROWS",
  /*   56 */ "MINROWS",
  /*   57 */ "KEEP",
  /*   58 */ "PRECISION",
  /*   59 */ "QUORUM",
  /*   60 */ "REPLICA",
  /*   61 */ "TTL",
  /*   62 */ "WAL",
  /*   63 */ "VGROUPS",
  /*   64 */ "SINGLE_STABLE",
  /*   65 */ "STREAM_MODE",
  /*   66 */ "RETENTIONS",
X
Xiaoyu Wang 已提交
786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843
  /*   67 */ "TABLE",
  /*   68 */ "NK_LP",
  /*   69 */ "NK_RP",
  /*   70 */ "STABLE",
  /*   71 */ "ADD",
  /*   72 */ "COLUMN",
  /*   73 */ "MODIFY",
  /*   74 */ "RENAME",
  /*   75 */ "TAG",
  /*   76 */ "SET",
  /*   77 */ "NK_EQ",
  /*   78 */ "USING",
  /*   79 */ "TAGS",
  /*   80 */ "NK_DOT",
  /*   81 */ "NK_COMMA",
  /*   82 */ "COMMENT",
  /*   83 */ "BOOL",
  /*   84 */ "TINYINT",
  /*   85 */ "SMALLINT",
  /*   86 */ "INT",
  /*   87 */ "INTEGER",
  /*   88 */ "BIGINT",
  /*   89 */ "FLOAT",
  /*   90 */ "DOUBLE",
  /*   91 */ "BINARY",
  /*   92 */ "TIMESTAMP",
  /*   93 */ "NCHAR",
  /*   94 */ "UNSIGNED",
  /*   95 */ "JSON",
  /*   96 */ "VARCHAR",
  /*   97 */ "MEDIUMBLOB",
  /*   98 */ "BLOB",
  /*   99 */ "VARBINARY",
  /*  100 */ "DECIMAL",
  /*  101 */ "SMA",
  /*  102 */ "ROLLUP",
  /*  103 */ "FILE_FACTOR",
  /*  104 */ "NK_FLOAT",
  /*  105 */ "DELAY",
  /*  106 */ "SHOW",
  /*  107 */ "DATABASES",
  /*  108 */ "TABLES",
  /*  109 */ "STABLES",
  /*  110 */ "MNODES",
  /*  111 */ "MODULES",
  /*  112 */ "QNODES",
  /*  113 */ "FUNCTIONS",
  /*  114 */ "INDEXES",
  /*  115 */ "FROM",
  /*  116 */ "LIKE",
  /*  117 */ "INDEX",
  /*  118 */ "FULLTEXT",
  /*  119 */ "FUNCTION",
  /*  120 */ "INTERVAL",
  /*  121 */ "TOPIC",
  /*  122 */ "AS",
  /*  123 */ "NK_BOOL",
  /*  124 */ "NK_VARIABLE",
844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986
  /*  125 */ "NK_UNDERLINE",
  /*  126 */ "ROWTS",
  /*  127 */ "TBNAME",
  /*  128 */ "QSTARTTS",
  /*  129 */ "QENDTS",
  /*  130 */ "WSTARTTS",
  /*  131 */ "WENDTS",
  /*  132 */ "WDURATION",
  /*  133 */ "BETWEEN",
  /*  134 */ "IS",
  /*  135 */ "NULL",
  /*  136 */ "NK_LT",
  /*  137 */ "NK_GT",
  /*  138 */ "NK_LE",
  /*  139 */ "NK_GE",
  /*  140 */ "NK_NE",
  /*  141 */ "MATCH",
  /*  142 */ "NMATCH",
  /*  143 */ "IN",
  /*  144 */ "JOIN",
  /*  145 */ "INNER",
  /*  146 */ "SELECT",
  /*  147 */ "DISTINCT",
  /*  148 */ "WHERE",
  /*  149 */ "PARTITION",
  /*  150 */ "BY",
  /*  151 */ "SESSION",
  /*  152 */ "STATE_WINDOW",
  /*  153 */ "SLIDING",
  /*  154 */ "FILL",
  /*  155 */ "VALUE",
  /*  156 */ "NONE",
  /*  157 */ "PREV",
  /*  158 */ "LINEAR",
  /*  159 */ "NEXT",
  /*  160 */ "GROUP",
  /*  161 */ "HAVING",
  /*  162 */ "ORDER",
  /*  163 */ "SLIMIT",
  /*  164 */ "SOFFSET",
  /*  165 */ "LIMIT",
  /*  166 */ "OFFSET",
  /*  167 */ "ASC",
  /*  168 */ "DESC",
  /*  169 */ "NULLS",
  /*  170 */ "FIRST",
  /*  171 */ "LAST",
  /*  172 */ "cmd",
  /*  173 */ "account_options",
  /*  174 */ "alter_account_options",
  /*  175 */ "literal",
  /*  176 */ "alter_account_option",
  /*  177 */ "user_name",
  /*  178 */ "dnode_endpoint",
  /*  179 */ "dnode_host_name",
  /*  180 */ "not_exists_opt",
  /*  181 */ "db_name",
  /*  182 */ "db_options",
  /*  183 */ "exists_opt",
  /*  184 */ "alter_db_options",
  /*  185 */ "alter_db_option",
  /*  186 */ "full_table_name",
  /*  187 */ "column_def_list",
  /*  188 */ "tags_def_opt",
  /*  189 */ "table_options",
  /*  190 */ "multi_create_clause",
  /*  191 */ "tags_def",
  /*  192 */ "multi_drop_clause",
  /*  193 */ "alter_table_clause",
  /*  194 */ "alter_table_options",
  /*  195 */ "column_name",
  /*  196 */ "type_name",
  /*  197 */ "create_subtable_clause",
  /*  198 */ "specific_tags_opt",
  /*  199 */ "literal_list",
  /*  200 */ "drop_table_clause",
  /*  201 */ "col_name_list",
  /*  202 */ "table_name",
  /*  203 */ "column_def",
  /*  204 */ "func_name_list",
  /*  205 */ "alter_table_option",
  /*  206 */ "col_name",
  /*  207 */ "db_name_cond_opt",
  /*  208 */ "like_pattern_opt",
  /*  209 */ "table_name_cond",
  /*  210 */ "from_db_opt",
  /*  211 */ "func_name",
  /*  212 */ "function_name",
  /*  213 */ "index_name",
  /*  214 */ "index_options",
  /*  215 */ "func_list",
  /*  216 */ "duration_literal",
  /*  217 */ "sliding_opt",
  /*  218 */ "func",
  /*  219 */ "expression_list",
  /*  220 */ "topic_name",
  /*  221 */ "query_expression",
  /*  222 */ "signed",
  /*  223 */ "signed_literal",
  /*  224 */ "table_alias",
  /*  225 */ "column_alias",
  /*  226 */ "expression",
  /*  227 */ "pseudo_column",
  /*  228 */ "column_reference",
  /*  229 */ "subquery",
  /*  230 */ "predicate",
  /*  231 */ "compare_op",
  /*  232 */ "in_op",
  /*  233 */ "in_predicate_value",
  /*  234 */ "boolean_value_expression",
  /*  235 */ "boolean_primary",
  /*  236 */ "common_expression",
  /*  237 */ "from_clause",
  /*  238 */ "table_reference_list",
  /*  239 */ "table_reference",
  /*  240 */ "table_primary",
  /*  241 */ "joined_table",
  /*  242 */ "alias_opt",
  /*  243 */ "parenthesized_joined_table",
  /*  244 */ "join_type",
  /*  245 */ "search_condition",
  /*  246 */ "query_specification",
  /*  247 */ "set_quantifier_opt",
  /*  248 */ "select_list",
  /*  249 */ "where_clause_opt",
  /*  250 */ "partition_by_clause_opt",
  /*  251 */ "twindow_clause_opt",
  /*  252 */ "group_by_clause_opt",
  /*  253 */ "having_clause_opt",
  /*  254 */ "select_sublist",
  /*  255 */ "select_item",
  /*  256 */ "fill_opt",
  /*  257 */ "fill_mode",
  /*  258 */ "group_by_list",
  /*  259 */ "query_expression_body",
  /*  260 */ "order_by_clause_opt",
  /*  261 */ "slimit_clause_opt",
  /*  262 */ "limit_clause_opt",
  /*  263 */ "query_primary",
  /*  264 */ "sort_specification_list",
  /*  265 */ "sort_specification",
  /*  266 */ "ordering_specification_opt",
  /*  267 */ "null_ordering_opt",
987 988 989 990 991 992 993
};
#endif /* defined(YYCOVERAGE) || !defined(NDEBUG) */

#ifndef NDEBUG
/* For tracing reduce actions, the names of all rules are required.
*/
static const char *const yyRuleName[] = {
994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021
 /*   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 已提交
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
 /*  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",
 /*  43 */ "cmd ::= CREATE DATABASE not_exists_opt db_name db_options",
 /*  44 */ "cmd ::= DROP DATABASE exists_opt db_name",
 /*  45 */ "cmd ::= USE db_name",
 /*  46 */ "cmd ::= ALTER DATABASE db_name alter_db_options",
 /*  47 */ "not_exists_opt ::= IF NOT EXISTS",
 /*  48 */ "not_exists_opt ::=",
 /*  49 */ "exists_opt ::= IF EXISTS",
 /*  50 */ "exists_opt ::=",
 /*  51 */ "db_options ::=",
 /*  52 */ "db_options ::= db_options BLOCKS NK_INTEGER",
 /*  53 */ "db_options ::= db_options CACHE NK_INTEGER",
 /*  54 */ "db_options ::= db_options CACHELAST NK_INTEGER",
 /*  55 */ "db_options ::= db_options COMP NK_INTEGER",
 /*  56 */ "db_options ::= db_options DAYS NK_INTEGER",
 /*  57 */ "db_options ::= db_options FSYNC NK_INTEGER",
 /*  58 */ "db_options ::= db_options MAXROWS NK_INTEGER",
 /*  59 */ "db_options ::= db_options MINROWS NK_INTEGER",
 /*  60 */ "db_options ::= db_options KEEP NK_INTEGER",
 /*  61 */ "db_options ::= db_options PRECISION NK_STRING",
 /*  62 */ "db_options ::= db_options QUORUM NK_INTEGER",
 /*  63 */ "db_options ::= db_options REPLICA NK_INTEGER",
 /*  64 */ "db_options ::= db_options TTL NK_INTEGER",
 /*  65 */ "db_options ::= db_options WAL NK_INTEGER",
 /*  66 */ "db_options ::= db_options VGROUPS NK_INTEGER",
 /*  67 */ "db_options ::= db_options SINGLE_STABLE NK_INTEGER",
 /*  68 */ "db_options ::= db_options STREAM_MODE NK_INTEGER",
 /*  69 */ "db_options ::= db_options RETENTIONS NK_STRING",
X
Xiaoyu Wang 已提交
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 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209
 /*  70 */ "alter_db_options ::= alter_db_option",
 /*  71 */ "alter_db_options ::= alter_db_options alter_db_option",
 /*  72 */ "alter_db_option ::= BLOCKS NK_INTEGER",
 /*  73 */ "alter_db_option ::= FSYNC NK_INTEGER",
 /*  74 */ "alter_db_option ::= KEEP NK_INTEGER",
 /*  75 */ "alter_db_option ::= WAL NK_INTEGER",
 /*  76 */ "alter_db_option ::= QUORUM NK_INTEGER",
 /*  77 */ "alter_db_option ::= CACHELAST NK_INTEGER",
 /*  78 */ "cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options",
 /*  79 */ "cmd ::= CREATE TABLE multi_create_clause",
 /*  80 */ "cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options",
 /*  81 */ "cmd ::= DROP TABLE multi_drop_clause",
 /*  82 */ "cmd ::= DROP STABLE exists_opt full_table_name",
 /*  83 */ "cmd ::= ALTER TABLE alter_table_clause",
 /*  84 */ "cmd ::= ALTER STABLE alter_table_clause",
 /*  85 */ "alter_table_clause ::= full_table_name alter_table_options",
 /*  86 */ "alter_table_clause ::= full_table_name ADD COLUMN column_name type_name",
 /*  87 */ "alter_table_clause ::= full_table_name DROP COLUMN column_name",
 /*  88 */ "alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name",
 /*  89 */ "alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name",
 /*  90 */ "alter_table_clause ::= full_table_name ADD TAG column_name type_name",
 /*  91 */ "alter_table_clause ::= full_table_name DROP TAG column_name",
 /*  92 */ "alter_table_clause ::= full_table_name MODIFY TAG column_name type_name",
 /*  93 */ "alter_table_clause ::= full_table_name RENAME TAG column_name column_name",
 /*  94 */ "alter_table_clause ::= full_table_name SET TAG column_name NK_EQ literal",
 /*  95 */ "multi_create_clause ::= create_subtable_clause",
 /*  96 */ "multi_create_clause ::= multi_create_clause create_subtable_clause",
 /*  97 */ "create_subtable_clause ::= not_exists_opt full_table_name USING full_table_name specific_tags_opt TAGS NK_LP literal_list NK_RP",
 /*  98 */ "multi_drop_clause ::= drop_table_clause",
 /*  99 */ "multi_drop_clause ::= multi_drop_clause drop_table_clause",
 /* 100 */ "drop_table_clause ::= exists_opt full_table_name",
 /* 101 */ "specific_tags_opt ::=",
 /* 102 */ "specific_tags_opt ::= NK_LP col_name_list NK_RP",
 /* 103 */ "full_table_name ::= table_name",
 /* 104 */ "full_table_name ::= db_name NK_DOT table_name",
 /* 105 */ "column_def_list ::= column_def",
 /* 106 */ "column_def_list ::= column_def_list NK_COMMA column_def",
 /* 107 */ "column_def ::= column_name type_name",
 /* 108 */ "column_def ::= column_name type_name COMMENT NK_STRING",
 /* 109 */ "type_name ::= BOOL",
 /* 110 */ "type_name ::= TINYINT",
 /* 111 */ "type_name ::= SMALLINT",
 /* 112 */ "type_name ::= INT",
 /* 113 */ "type_name ::= INTEGER",
 /* 114 */ "type_name ::= BIGINT",
 /* 115 */ "type_name ::= FLOAT",
 /* 116 */ "type_name ::= DOUBLE",
 /* 117 */ "type_name ::= BINARY NK_LP NK_INTEGER NK_RP",
 /* 118 */ "type_name ::= TIMESTAMP",
 /* 119 */ "type_name ::= NCHAR NK_LP NK_INTEGER NK_RP",
 /* 120 */ "type_name ::= TINYINT UNSIGNED",
 /* 121 */ "type_name ::= SMALLINT UNSIGNED",
 /* 122 */ "type_name ::= INT UNSIGNED",
 /* 123 */ "type_name ::= BIGINT UNSIGNED",
 /* 124 */ "type_name ::= JSON",
 /* 125 */ "type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP",
 /* 126 */ "type_name ::= MEDIUMBLOB",
 /* 127 */ "type_name ::= BLOB",
 /* 128 */ "type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP",
 /* 129 */ "type_name ::= DECIMAL",
 /* 130 */ "type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP",
 /* 131 */ "type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP",
 /* 132 */ "tags_def_opt ::=",
 /* 133 */ "tags_def_opt ::= tags_def",
 /* 134 */ "tags_def ::= TAGS NK_LP column_def_list NK_RP",
 /* 135 */ "table_options ::=",
 /* 136 */ "table_options ::= table_options COMMENT NK_STRING",
 /* 137 */ "table_options ::= table_options KEEP NK_INTEGER",
 /* 138 */ "table_options ::= table_options TTL NK_INTEGER",
 /* 139 */ "table_options ::= table_options SMA NK_LP col_name_list NK_RP",
 /* 140 */ "table_options ::= table_options ROLLUP NK_LP func_name_list NK_RP",
 /* 141 */ "table_options ::= table_options FILE_FACTOR NK_FLOAT",
 /* 142 */ "table_options ::= table_options DELAY NK_INTEGER",
 /* 143 */ "alter_table_options ::= alter_table_option",
 /* 144 */ "alter_table_options ::= alter_table_options alter_table_option",
 /* 145 */ "alter_table_option ::= COMMENT NK_STRING",
 /* 146 */ "alter_table_option ::= KEEP NK_INTEGER",
 /* 147 */ "alter_table_option ::= TTL NK_INTEGER",
 /* 148 */ "col_name_list ::= col_name",
 /* 149 */ "col_name_list ::= col_name_list NK_COMMA col_name",
 /* 150 */ "col_name ::= column_name",
 /* 151 */ "cmd ::= SHOW DNODES",
 /* 152 */ "cmd ::= SHOW USERS",
 /* 153 */ "cmd ::= SHOW DATABASES",
 /* 154 */ "cmd ::= SHOW db_name_cond_opt TABLES like_pattern_opt",
 /* 155 */ "cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt",
 /* 156 */ "cmd ::= SHOW db_name_cond_opt VGROUPS",
 /* 157 */ "cmd ::= SHOW MNODES",
 /* 158 */ "cmd ::= SHOW MODULES",
 /* 159 */ "cmd ::= SHOW QNODES",
 /* 160 */ "cmd ::= SHOW FUNCTIONS",
 /* 161 */ "cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt",
 /* 162 */ "cmd ::= SHOW STREAMS",
 /* 163 */ "db_name_cond_opt ::=",
 /* 164 */ "db_name_cond_opt ::= db_name NK_DOT",
 /* 165 */ "like_pattern_opt ::=",
 /* 166 */ "like_pattern_opt ::= LIKE NK_STRING",
 /* 167 */ "table_name_cond ::= table_name",
 /* 168 */ "from_db_opt ::=",
 /* 169 */ "from_db_opt ::= FROM db_name",
 /* 170 */ "func_name_list ::= func_name",
 /* 171 */ "func_name_list ::= func_name_list NK_COMMA col_name",
 /* 172 */ "func_name ::= function_name",
 /* 173 */ "cmd ::= CREATE SMA INDEX not_exists_opt index_name ON table_name index_options",
 /* 174 */ "cmd ::= CREATE FULLTEXT INDEX not_exists_opt index_name ON table_name NK_LP col_name_list NK_RP",
 /* 175 */ "cmd ::= DROP INDEX exists_opt index_name ON table_name",
 /* 176 */ "index_options ::=",
 /* 177 */ "index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt",
 /* 178 */ "index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt",
 /* 179 */ "func_list ::= func",
 /* 180 */ "func_list ::= func_list NK_COMMA func",
 /* 181 */ "func ::= function_name NK_LP expression_list NK_RP",
 /* 182 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_expression",
 /* 183 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name AS db_name",
 /* 184 */ "cmd ::= DROP TOPIC exists_opt topic_name",
 /* 185 */ "cmd ::= query_expression",
 /* 186 */ "literal ::= NK_INTEGER",
 /* 187 */ "literal ::= NK_FLOAT",
 /* 188 */ "literal ::= NK_STRING",
 /* 189 */ "literal ::= NK_BOOL",
 /* 190 */ "literal ::= TIMESTAMP NK_STRING",
 /* 191 */ "literal ::= duration_literal",
 /* 192 */ "duration_literal ::= NK_VARIABLE",
 /* 193 */ "signed ::= NK_INTEGER",
 /* 194 */ "signed ::= NK_PLUS NK_INTEGER",
 /* 195 */ "signed ::= NK_MINUS NK_INTEGER",
 /* 196 */ "signed ::= NK_FLOAT",
 /* 197 */ "signed ::= NK_PLUS NK_FLOAT",
 /* 198 */ "signed ::= NK_MINUS NK_FLOAT",
 /* 199 */ "signed_literal ::= signed",
 /* 200 */ "signed_literal ::= NK_STRING",
 /* 201 */ "signed_literal ::= NK_BOOL",
 /* 202 */ "signed_literal ::= TIMESTAMP NK_STRING",
 /* 203 */ "signed_literal ::= duration_literal",
 /* 204 */ "literal_list ::= signed_literal",
 /* 205 */ "literal_list ::= literal_list NK_COMMA signed_literal",
 /* 206 */ "db_name ::= NK_ID",
 /* 207 */ "table_name ::= NK_ID",
 /* 208 */ "column_name ::= NK_ID",
 /* 209 */ "function_name ::= NK_ID",
 /* 210 */ "table_alias ::= NK_ID",
 /* 211 */ "column_alias ::= NK_ID",
 /* 212 */ "user_name ::= NK_ID",
 /* 213 */ "index_name ::= NK_ID",
 /* 214 */ "topic_name ::= NK_ID",
 /* 215 */ "expression ::= literal",
1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 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
 /* 216 */ "expression ::= pseudo_column",
 /* 217 */ "expression ::= column_reference",
 /* 218 */ "expression ::= function_name NK_LP expression_list NK_RP",
 /* 219 */ "expression ::= function_name NK_LP NK_STAR NK_RP",
 /* 220 */ "expression ::= subquery",
 /* 221 */ "expression ::= NK_LP expression NK_RP",
 /* 222 */ "expression ::= NK_PLUS expression",
 /* 223 */ "expression ::= NK_MINUS expression",
 /* 224 */ "expression ::= expression NK_PLUS expression",
 /* 225 */ "expression ::= expression NK_MINUS expression",
 /* 226 */ "expression ::= expression NK_STAR expression",
 /* 227 */ "expression ::= expression NK_SLASH expression",
 /* 228 */ "expression ::= expression NK_REM expression",
 /* 229 */ "expression_list ::= expression",
 /* 230 */ "expression_list ::= expression_list NK_COMMA expression",
 /* 231 */ "column_reference ::= column_name",
 /* 232 */ "column_reference ::= table_name NK_DOT column_name",
 /* 233 */ "pseudo_column ::= NK_UNDERLINE ROWTS",
 /* 234 */ "pseudo_column ::= TBNAME",
 /* 235 */ "pseudo_column ::= NK_UNDERLINE QSTARTTS",
 /* 236 */ "pseudo_column ::= NK_UNDERLINE QENDTS",
 /* 237 */ "pseudo_column ::= NK_UNDERLINE WSTARTTS",
 /* 238 */ "pseudo_column ::= NK_UNDERLINE WENDTS",
 /* 239 */ "pseudo_column ::= NK_UNDERLINE WDURATION",
 /* 240 */ "predicate ::= expression compare_op expression",
 /* 241 */ "predicate ::= expression BETWEEN expression AND expression",
 /* 242 */ "predicate ::= expression NOT BETWEEN expression AND expression",
 /* 243 */ "predicate ::= expression IS NULL",
 /* 244 */ "predicate ::= expression IS NOT NULL",
 /* 245 */ "predicate ::= expression in_op in_predicate_value",
 /* 246 */ "compare_op ::= NK_LT",
 /* 247 */ "compare_op ::= NK_GT",
 /* 248 */ "compare_op ::= NK_LE",
 /* 249 */ "compare_op ::= NK_GE",
 /* 250 */ "compare_op ::= NK_NE",
 /* 251 */ "compare_op ::= NK_EQ",
 /* 252 */ "compare_op ::= LIKE",
 /* 253 */ "compare_op ::= NOT LIKE",
 /* 254 */ "compare_op ::= MATCH",
 /* 255 */ "compare_op ::= NMATCH",
 /* 256 */ "in_op ::= IN",
 /* 257 */ "in_op ::= NOT IN",
 /* 258 */ "in_predicate_value ::= NK_LP expression_list NK_RP",
 /* 259 */ "boolean_value_expression ::= boolean_primary",
 /* 260 */ "boolean_value_expression ::= NOT boolean_primary",
 /* 261 */ "boolean_value_expression ::= boolean_value_expression OR boolean_value_expression",
 /* 262 */ "boolean_value_expression ::= boolean_value_expression AND boolean_value_expression",
 /* 263 */ "boolean_primary ::= predicate",
 /* 264 */ "boolean_primary ::= NK_LP boolean_value_expression NK_RP",
 /* 265 */ "common_expression ::= expression",
 /* 266 */ "common_expression ::= boolean_value_expression",
 /* 267 */ "from_clause ::= FROM table_reference_list",
 /* 268 */ "table_reference_list ::= table_reference",
 /* 269 */ "table_reference_list ::= table_reference_list NK_COMMA table_reference",
 /* 270 */ "table_reference ::= table_primary",
 /* 271 */ "table_reference ::= joined_table",
 /* 272 */ "table_primary ::= table_name alias_opt",
 /* 273 */ "table_primary ::= db_name NK_DOT table_name alias_opt",
 /* 274 */ "table_primary ::= subquery alias_opt",
 /* 275 */ "table_primary ::= parenthesized_joined_table",
 /* 276 */ "alias_opt ::=",
 /* 277 */ "alias_opt ::= table_alias",
 /* 278 */ "alias_opt ::= AS table_alias",
 /* 279 */ "parenthesized_joined_table ::= NK_LP joined_table NK_RP",
 /* 280 */ "parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP",
 /* 281 */ "joined_table ::= table_reference join_type JOIN table_reference ON search_condition",
 /* 282 */ "join_type ::=",
 /* 283 */ "join_type ::= INNER",
 /* 284 */ "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",
 /* 285 */ "set_quantifier_opt ::=",
 /* 286 */ "set_quantifier_opt ::= DISTINCT",
 /* 287 */ "set_quantifier_opt ::= ALL",
 /* 288 */ "select_list ::= NK_STAR",
 /* 289 */ "select_list ::= select_sublist",
 /* 290 */ "select_sublist ::= select_item",
 /* 291 */ "select_sublist ::= select_sublist NK_COMMA select_item",
 /* 292 */ "select_item ::= common_expression",
 /* 293 */ "select_item ::= common_expression column_alias",
 /* 294 */ "select_item ::= common_expression AS column_alias",
 /* 295 */ "select_item ::= table_name NK_DOT NK_STAR",
 /* 296 */ "where_clause_opt ::=",
 /* 297 */ "where_clause_opt ::= WHERE search_condition",
 /* 298 */ "partition_by_clause_opt ::=",
 /* 299 */ "partition_by_clause_opt ::= PARTITION BY expression_list",
 /* 300 */ "twindow_clause_opt ::=",
 /* 301 */ "twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP",
 /* 302 */ "twindow_clause_opt ::= STATE_WINDOW NK_LP column_reference NK_RP",
 /* 303 */ "twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt",
 /* 304 */ "twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt",
 /* 305 */ "sliding_opt ::=",
 /* 306 */ "sliding_opt ::= SLIDING NK_LP duration_literal NK_RP",
 /* 307 */ "fill_opt ::=",
 /* 308 */ "fill_opt ::= FILL NK_LP fill_mode NK_RP",
 /* 309 */ "fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP",
 /* 310 */ "fill_mode ::= NONE",
 /* 311 */ "fill_mode ::= PREV",
 /* 312 */ "fill_mode ::= NULL",
 /* 313 */ "fill_mode ::= LINEAR",
 /* 314 */ "fill_mode ::= NEXT",
 /* 315 */ "group_by_clause_opt ::=",
 /* 316 */ "group_by_clause_opt ::= GROUP BY group_by_list",
 /* 317 */ "group_by_list ::= expression",
 /* 318 */ "group_by_list ::= group_by_list NK_COMMA expression",
 /* 319 */ "having_clause_opt ::=",
 /* 320 */ "having_clause_opt ::= HAVING search_condition",
 /* 321 */ "query_expression ::= query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt",
 /* 322 */ "query_expression_body ::= query_primary",
 /* 323 */ "query_expression_body ::= query_expression_body UNION ALL query_expression_body",
 /* 324 */ "query_primary ::= query_specification",
 /* 325 */ "order_by_clause_opt ::=",
 /* 326 */ "order_by_clause_opt ::= ORDER BY sort_specification_list",
 /* 327 */ "slimit_clause_opt ::=",
 /* 328 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER",
 /* 329 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER",
 /* 330 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER",
 /* 331 */ "limit_clause_opt ::=",
 /* 332 */ "limit_clause_opt ::= LIMIT NK_INTEGER",
 /* 333 */ "limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER",
 /* 334 */ "limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER",
 /* 335 */ "subquery ::= NK_LP query_expression NK_RP",
 /* 336 */ "search_condition ::= common_expression",
 /* 337 */ "sort_specification_list ::= sort_specification",
 /* 338 */ "sort_specification_list ::= sort_specification_list NK_COMMA sort_specification",
 /* 339 */ "sort_specification ::= expression ordering_specification_opt null_ordering_opt",
 /* 340 */ "ordering_specification_opt ::=",
 /* 341 */ "ordering_specification_opt ::= ASC",
 /* 342 */ "ordering_specification_opt ::= DESC",
 /* 343 */ "null_ordering_opt ::=",
 /* 344 */ "null_ordering_opt ::= NULLS FIRST",
 /* 345 */ "null_ordering_opt ::= NULLS LAST",
1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356
};
#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 已提交
1357
    pNew = malloc(newSize*sizeof(pNew[0]));
1358 1359
    if( pNew ) pNew[0] = p->yystk0;
  }else{
X
Xiaoyu Wang 已提交
1360
    pNew = realloc(p->yystack, newSize*sizeof(pNew[0]));
1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377
  }
  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 已提交
1378
** second argument to ParseAlloc() below.  This can be changed by
1379 1380 1381 1382 1383 1384 1385 1386 1387
** 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 已提交
1388
void ParseInit(void *yypRawParser ParseCTX_PDECL){
1389
  yyParser *yypParser = (yyParser*)yypRawParser;
X
Xiaoyu Wang 已提交
1390
  ParseCTX_STORE
1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413
#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 已提交
1414
#ifndef Parse_ENGINEALWAYSONSTACK
1415 1416 1417 1418 1419 1420 1421 1422 1423 1424
/* 
** 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 已提交
1425
** to Parse and ParseFree.
1426
*/
X
Xiaoyu Wang 已提交
1427
void *ParseAlloc(void *(*mallocProc)(YYMALLOCARGTYPE) ParseCTX_PDECL){
1428 1429 1430
  yyParser *yypParser;
  yypParser = (yyParser*)(*mallocProc)( (YYMALLOCARGTYPE)sizeof(yyParser) );
  if( yypParser ){
X
Xiaoyu Wang 已提交
1431 1432
    ParseCTX_STORE
    ParseInit(yypParser ParseCTX_PARAM);
1433 1434 1435
  }
  return (void*)yypParser;
}
X
Xiaoyu Wang 已提交
1436
#endif /* Parse_ENGINEALWAYSONSTACK */
1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450


/* 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 已提交
1451 1452
  ParseARG_FETCH
  ParseCTX_FETCH
1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465
  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 */
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
    case 172: /* cmd */
    case 175: /* literal */
    case 182: /* db_options */
    case 184: /* alter_db_options */
    case 186: /* full_table_name */
    case 189: /* table_options */
    case 193: /* alter_table_clause */
    case 194: /* alter_table_options */
    case 197: /* create_subtable_clause */
    case 200: /* drop_table_clause */
    case 203: /* column_def */
    case 206: /* col_name */
    case 207: /* db_name_cond_opt */
    case 208: /* like_pattern_opt */
    case 209: /* table_name_cond */
    case 210: /* from_db_opt */
    case 211: /* func_name */
    case 214: /* index_options */
    case 216: /* duration_literal */
    case 217: /* sliding_opt */
    case 218: /* func */
    case 221: /* query_expression */
    case 222: /* signed */
    case 223: /* signed_literal */
    case 226: /* expression */
    case 227: /* pseudo_column */
    case 228: /* column_reference */
    case 229: /* subquery */
    case 230: /* predicate */
    case 233: /* in_predicate_value */
    case 234: /* boolean_value_expression */
    case 235: /* boolean_primary */
    case 236: /* common_expression */
    case 237: /* from_clause */
    case 238: /* table_reference_list */
    case 239: /* table_reference */
    case 240: /* table_primary */
    case 241: /* joined_table */
    case 243: /* parenthesized_joined_table */
    case 245: /* search_condition */
    case 246: /* query_specification */
    case 249: /* where_clause_opt */
    case 251: /* twindow_clause_opt */
    case 253: /* having_clause_opt */
    case 255: /* select_item */
    case 256: /* fill_opt */
    case 259: /* query_expression_body */
    case 261: /* slimit_clause_opt */
    case 262: /* limit_clause_opt */
    case 263: /* query_primary */
    case 265: /* sort_specification */
1517
{
1518
 nodesDestroyNode((yypminor->yy176)); 
1519 1520
}
      break;
1521 1522 1523
    case 173: /* account_options */
    case 174: /* alter_account_options */
    case 176: /* alter_account_option */
1524
{
1525
 
1526 1527
}
      break;
1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539
    case 177: /* user_name */
    case 178: /* dnode_endpoint */
    case 179: /* dnode_host_name */
    case 181: /* db_name */
    case 195: /* column_name */
    case 202: /* table_name */
    case 212: /* function_name */
    case 213: /* index_name */
    case 220: /* topic_name */
    case 224: /* table_alias */
    case 225: /* column_alias */
    case 242: /* alias_opt */
1540
{
1541
 
1542 1543
}
      break;
1544 1545 1546
    case 180: /* not_exists_opt */
    case 183: /* exists_opt */
    case 247: /* set_quantifier_opt */
1547
{
1548 1549 1550
 
}
      break;
1551 1552
    case 185: /* alter_db_option */
    case 205: /* alter_table_option */
1553 1554
{
 
1555 1556
}
      break;
1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574
    case 187: /* column_def_list */
    case 188: /* tags_def_opt */
    case 190: /* multi_create_clause */
    case 191: /* tags_def */
    case 192: /* multi_drop_clause */
    case 198: /* specific_tags_opt */
    case 199: /* literal_list */
    case 201: /* col_name_list */
    case 204: /* func_name_list */
    case 215: /* func_list */
    case 219: /* expression_list */
    case 248: /* select_list */
    case 250: /* partition_by_clause_opt */
    case 252: /* group_by_clause_opt */
    case 254: /* select_sublist */
    case 258: /* group_by_list */
    case 260: /* order_by_clause_opt */
    case 264: /* sort_specification_list */
1575
{
1576
 nodesDestroyList((yypminor->yy512)); 
1577 1578
}
      break;
1579
    case 196: /* type_name */
1580
{
1581
 
1582 1583
}
      break;
1584 1585
    case 231: /* compare_op */
    case 232: /* in_op */
1586
{
1587
 
1588 1589
}
      break;
1590
    case 244: /* join_type */
1591
{
1592
 
1593 1594
}
      break;
1595
    case 257: /* fill_mode */
1596
{
1597
 
1598 1599
}
      break;
1600
    case 266: /* ordering_specification_opt */
1601
{
1602
 
1603 1604
}
      break;
1605
    case 267: /* null_ordering_opt */
1606
{
1607
 
1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638
}
      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 已提交
1639
void ParseFinalize(void *p){
1640 1641 1642
  yyParser *pParser = (yyParser*)p;
  while( pParser->yytos>pParser->yystack ) yy_pop_parser_stack(pParser);
#if YYSTACKDEPTH<=0
X
Xiaoyu Wang 已提交
1643
  if( pParser->yystack!=&pParser->yystk0 ) free(pParser->yystack);
1644 1645 1646
#endif
}

X
Xiaoyu Wang 已提交
1647
#ifndef Parse_ENGINEALWAYSONSTACK
1648 1649 1650 1651 1652 1653 1654 1655
/* 
** 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 已提交
1656
void ParseFree(
1657 1658 1659 1660 1661 1662
  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 已提交
1663
  ParseFinalize(p);
1664 1665
  (*freeProc)(p);
}
X
Xiaoyu Wang 已提交
1666
#endif /* Parse_ENGINEALWAYSONSTACK */
1667 1668 1669 1670 1671

/*
** Return the peak depth of the stack for a parser.
*/
#ifdef YYTRACKMAXSTACKDEPTH
X
Xiaoyu Wang 已提交
1672
int ParseStackPeak(void *p){
1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695
  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 已提交
1696
int ParseCoverage(FILE *out){
1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817
  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 );
    /* assert( i+YYNTOKEN<=(int)YY_NLOOKAHEAD ); */
    assert( iLookAhead!=YYNOCODE );
    assert( iLookAhead < YYNTOKEN );
    i += iLookAhead;
    if( i>=YY_NLOOKAHEAD || yy_lookahead[i]!=iLookAhead ){
#ifdef YYFALLBACK
      YYCODETYPE iFallback;            /* Fallback token */
      if( iLookAhead<sizeof(yyFallback)/sizeof(yyFallback[0])
             && (iFallback = yyFallback[iLookAhead])!=0 ){
#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;
        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
        ){
#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 已提交
1818 1819
   ParseARG_FETCH
   ParseCTX_FETCH
1820 1821 1822 1823 1824 1825 1826 1827 1828 1829
#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 已提交
1830 1831
   ParseARG_STORE /* Suppress warning about unused %extra_argument var */
   ParseCTX_STORE
1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861
}

/*
** 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 已提交
1862
  ParseTOKENTYPE yyMinor        /* The minor token to shift in */
1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903
){
  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");
}

/* 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[] = {
1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249
  {  172,   -6 }, /* (0) cmd ::= CREATE ACCOUNT NK_ID PASS NK_STRING account_options */
  {  172,   -4 }, /* (1) cmd ::= ALTER ACCOUNT NK_ID alter_account_options */
  {  173,    0 }, /* (2) account_options ::= */
  {  173,   -3 }, /* (3) account_options ::= account_options PPS literal */
  {  173,   -3 }, /* (4) account_options ::= account_options TSERIES literal */
  {  173,   -3 }, /* (5) account_options ::= account_options STORAGE literal */
  {  173,   -3 }, /* (6) account_options ::= account_options STREAMS literal */
  {  173,   -3 }, /* (7) account_options ::= account_options QTIME literal */
  {  173,   -3 }, /* (8) account_options ::= account_options DBS literal */
  {  173,   -3 }, /* (9) account_options ::= account_options USERS literal */
  {  173,   -3 }, /* (10) account_options ::= account_options CONNS literal */
  {  173,   -3 }, /* (11) account_options ::= account_options STATE literal */
  {  174,   -1 }, /* (12) alter_account_options ::= alter_account_option */
  {  174,   -2 }, /* (13) alter_account_options ::= alter_account_options alter_account_option */
  {  176,   -2 }, /* (14) alter_account_option ::= PASS literal */
  {  176,   -2 }, /* (15) alter_account_option ::= PPS literal */
  {  176,   -2 }, /* (16) alter_account_option ::= TSERIES literal */
  {  176,   -2 }, /* (17) alter_account_option ::= STORAGE literal */
  {  176,   -2 }, /* (18) alter_account_option ::= STREAMS literal */
  {  176,   -2 }, /* (19) alter_account_option ::= QTIME literal */
  {  176,   -2 }, /* (20) alter_account_option ::= DBS literal */
  {  176,   -2 }, /* (21) alter_account_option ::= USERS literal */
  {  176,   -2 }, /* (22) alter_account_option ::= CONNS literal */
  {  176,   -2 }, /* (23) alter_account_option ::= STATE literal */
  {  172,   -5 }, /* (24) cmd ::= CREATE USER user_name PASS NK_STRING */
  {  172,   -5 }, /* (25) cmd ::= ALTER USER user_name PASS NK_STRING */
  {  172,   -5 }, /* (26) cmd ::= ALTER USER user_name PRIVILEGE NK_STRING */
  {  172,   -3 }, /* (27) cmd ::= DROP USER user_name */
  {  172,   -3 }, /* (28) cmd ::= CREATE DNODE dnode_endpoint */
  {  172,   -5 }, /* (29) cmd ::= CREATE DNODE dnode_host_name PORT NK_INTEGER */
  {  172,   -3 }, /* (30) cmd ::= DROP DNODE NK_INTEGER */
  {  172,   -3 }, /* (31) cmd ::= DROP DNODE dnode_endpoint */
  {  172,   -4 }, /* (32) cmd ::= ALTER DNODE NK_INTEGER NK_STRING */
  {  172,   -5 }, /* (33) cmd ::= ALTER DNODE NK_INTEGER NK_STRING NK_STRING */
  {  172,   -4 }, /* (34) cmd ::= ALTER ALL DNODES NK_STRING */
  {  172,   -5 }, /* (35) cmd ::= ALTER ALL DNODES NK_STRING NK_STRING */
  {  178,   -1 }, /* (36) dnode_endpoint ::= NK_STRING */
  {  179,   -1 }, /* (37) dnode_host_name ::= NK_ID */
  {  179,   -1 }, /* (38) dnode_host_name ::= NK_IPTOKEN */
  {  172,   -3 }, /* (39) cmd ::= ALTER LOCAL NK_STRING */
  {  172,   -4 }, /* (40) cmd ::= ALTER LOCAL NK_STRING NK_STRING */
  {  172,   -5 }, /* (41) cmd ::= CREATE QNODE ON DNODE NK_INTEGER */
  {  172,   -5 }, /* (42) cmd ::= DROP QNODE ON DNODE NK_INTEGER */
  {  172,   -5 }, /* (43) cmd ::= CREATE DATABASE not_exists_opt db_name db_options */
  {  172,   -4 }, /* (44) cmd ::= DROP DATABASE exists_opt db_name */
  {  172,   -2 }, /* (45) cmd ::= USE db_name */
  {  172,   -4 }, /* (46) cmd ::= ALTER DATABASE db_name alter_db_options */
  {  180,   -3 }, /* (47) not_exists_opt ::= IF NOT EXISTS */
  {  180,    0 }, /* (48) not_exists_opt ::= */
  {  183,   -2 }, /* (49) exists_opt ::= IF EXISTS */
  {  183,    0 }, /* (50) exists_opt ::= */
  {  182,    0 }, /* (51) db_options ::= */
  {  182,   -3 }, /* (52) db_options ::= db_options BLOCKS NK_INTEGER */
  {  182,   -3 }, /* (53) db_options ::= db_options CACHE NK_INTEGER */
  {  182,   -3 }, /* (54) db_options ::= db_options CACHELAST NK_INTEGER */
  {  182,   -3 }, /* (55) db_options ::= db_options COMP NK_INTEGER */
  {  182,   -3 }, /* (56) db_options ::= db_options DAYS NK_INTEGER */
  {  182,   -3 }, /* (57) db_options ::= db_options FSYNC NK_INTEGER */
  {  182,   -3 }, /* (58) db_options ::= db_options MAXROWS NK_INTEGER */
  {  182,   -3 }, /* (59) db_options ::= db_options MINROWS NK_INTEGER */
  {  182,   -3 }, /* (60) db_options ::= db_options KEEP NK_INTEGER */
  {  182,   -3 }, /* (61) db_options ::= db_options PRECISION NK_STRING */
  {  182,   -3 }, /* (62) db_options ::= db_options QUORUM NK_INTEGER */
  {  182,   -3 }, /* (63) db_options ::= db_options REPLICA NK_INTEGER */
  {  182,   -3 }, /* (64) db_options ::= db_options TTL NK_INTEGER */
  {  182,   -3 }, /* (65) db_options ::= db_options WAL NK_INTEGER */
  {  182,   -3 }, /* (66) db_options ::= db_options VGROUPS NK_INTEGER */
  {  182,   -3 }, /* (67) db_options ::= db_options SINGLE_STABLE NK_INTEGER */
  {  182,   -3 }, /* (68) db_options ::= db_options STREAM_MODE NK_INTEGER */
  {  182,   -3 }, /* (69) db_options ::= db_options RETENTIONS NK_STRING */
  {  184,   -1 }, /* (70) alter_db_options ::= alter_db_option */
  {  184,   -2 }, /* (71) alter_db_options ::= alter_db_options alter_db_option */
  {  185,   -2 }, /* (72) alter_db_option ::= BLOCKS NK_INTEGER */
  {  185,   -2 }, /* (73) alter_db_option ::= FSYNC NK_INTEGER */
  {  185,   -2 }, /* (74) alter_db_option ::= KEEP NK_INTEGER */
  {  185,   -2 }, /* (75) alter_db_option ::= WAL NK_INTEGER */
  {  185,   -2 }, /* (76) alter_db_option ::= QUORUM NK_INTEGER */
  {  185,   -2 }, /* (77) alter_db_option ::= CACHELAST NK_INTEGER */
  {  172,   -9 }, /* (78) cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options */
  {  172,   -3 }, /* (79) cmd ::= CREATE TABLE multi_create_clause */
  {  172,   -9 }, /* (80) cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options */
  {  172,   -3 }, /* (81) cmd ::= DROP TABLE multi_drop_clause */
  {  172,   -4 }, /* (82) cmd ::= DROP STABLE exists_opt full_table_name */
  {  172,   -3 }, /* (83) cmd ::= ALTER TABLE alter_table_clause */
  {  172,   -3 }, /* (84) cmd ::= ALTER STABLE alter_table_clause */
  {  193,   -2 }, /* (85) alter_table_clause ::= full_table_name alter_table_options */
  {  193,   -5 }, /* (86) alter_table_clause ::= full_table_name ADD COLUMN column_name type_name */
  {  193,   -4 }, /* (87) alter_table_clause ::= full_table_name DROP COLUMN column_name */
  {  193,   -5 }, /* (88) alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name */
  {  193,   -5 }, /* (89) alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name */
  {  193,   -5 }, /* (90) alter_table_clause ::= full_table_name ADD TAG column_name type_name */
  {  193,   -4 }, /* (91) alter_table_clause ::= full_table_name DROP TAG column_name */
  {  193,   -5 }, /* (92) alter_table_clause ::= full_table_name MODIFY TAG column_name type_name */
  {  193,   -5 }, /* (93) alter_table_clause ::= full_table_name RENAME TAG column_name column_name */
  {  193,   -6 }, /* (94) alter_table_clause ::= full_table_name SET TAG column_name NK_EQ literal */
  {  190,   -1 }, /* (95) multi_create_clause ::= create_subtable_clause */
  {  190,   -2 }, /* (96) multi_create_clause ::= multi_create_clause create_subtable_clause */
  {  197,   -9 }, /* (97) create_subtable_clause ::= not_exists_opt full_table_name USING full_table_name specific_tags_opt TAGS NK_LP literal_list NK_RP */
  {  192,   -1 }, /* (98) multi_drop_clause ::= drop_table_clause */
  {  192,   -2 }, /* (99) multi_drop_clause ::= multi_drop_clause drop_table_clause */
  {  200,   -2 }, /* (100) drop_table_clause ::= exists_opt full_table_name */
  {  198,    0 }, /* (101) specific_tags_opt ::= */
  {  198,   -3 }, /* (102) specific_tags_opt ::= NK_LP col_name_list NK_RP */
  {  186,   -1 }, /* (103) full_table_name ::= table_name */
  {  186,   -3 }, /* (104) full_table_name ::= db_name NK_DOT table_name */
  {  187,   -1 }, /* (105) column_def_list ::= column_def */
  {  187,   -3 }, /* (106) column_def_list ::= column_def_list NK_COMMA column_def */
  {  203,   -2 }, /* (107) column_def ::= column_name type_name */
  {  203,   -4 }, /* (108) column_def ::= column_name type_name COMMENT NK_STRING */
  {  196,   -1 }, /* (109) type_name ::= BOOL */
  {  196,   -1 }, /* (110) type_name ::= TINYINT */
  {  196,   -1 }, /* (111) type_name ::= SMALLINT */
  {  196,   -1 }, /* (112) type_name ::= INT */
  {  196,   -1 }, /* (113) type_name ::= INTEGER */
  {  196,   -1 }, /* (114) type_name ::= BIGINT */
  {  196,   -1 }, /* (115) type_name ::= FLOAT */
  {  196,   -1 }, /* (116) type_name ::= DOUBLE */
  {  196,   -4 }, /* (117) type_name ::= BINARY NK_LP NK_INTEGER NK_RP */
  {  196,   -1 }, /* (118) type_name ::= TIMESTAMP */
  {  196,   -4 }, /* (119) type_name ::= NCHAR NK_LP NK_INTEGER NK_RP */
  {  196,   -2 }, /* (120) type_name ::= TINYINT UNSIGNED */
  {  196,   -2 }, /* (121) type_name ::= SMALLINT UNSIGNED */
  {  196,   -2 }, /* (122) type_name ::= INT UNSIGNED */
  {  196,   -2 }, /* (123) type_name ::= BIGINT UNSIGNED */
  {  196,   -1 }, /* (124) type_name ::= JSON */
  {  196,   -4 }, /* (125) type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP */
  {  196,   -1 }, /* (126) type_name ::= MEDIUMBLOB */
  {  196,   -1 }, /* (127) type_name ::= BLOB */
  {  196,   -4 }, /* (128) type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP */
  {  196,   -1 }, /* (129) type_name ::= DECIMAL */
  {  196,   -4 }, /* (130) type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP */
  {  196,   -6 }, /* (131) type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */
  {  188,    0 }, /* (132) tags_def_opt ::= */
  {  188,   -1 }, /* (133) tags_def_opt ::= tags_def */
  {  191,   -4 }, /* (134) tags_def ::= TAGS NK_LP column_def_list NK_RP */
  {  189,    0 }, /* (135) table_options ::= */
  {  189,   -3 }, /* (136) table_options ::= table_options COMMENT NK_STRING */
  {  189,   -3 }, /* (137) table_options ::= table_options KEEP NK_INTEGER */
  {  189,   -3 }, /* (138) table_options ::= table_options TTL NK_INTEGER */
  {  189,   -5 }, /* (139) table_options ::= table_options SMA NK_LP col_name_list NK_RP */
  {  189,   -5 }, /* (140) table_options ::= table_options ROLLUP NK_LP func_name_list NK_RP */
  {  189,   -3 }, /* (141) table_options ::= table_options FILE_FACTOR NK_FLOAT */
  {  189,   -3 }, /* (142) table_options ::= table_options DELAY NK_INTEGER */
  {  194,   -1 }, /* (143) alter_table_options ::= alter_table_option */
  {  194,   -2 }, /* (144) alter_table_options ::= alter_table_options alter_table_option */
  {  205,   -2 }, /* (145) alter_table_option ::= COMMENT NK_STRING */
  {  205,   -2 }, /* (146) alter_table_option ::= KEEP NK_INTEGER */
  {  205,   -2 }, /* (147) alter_table_option ::= TTL NK_INTEGER */
  {  201,   -1 }, /* (148) col_name_list ::= col_name */
  {  201,   -3 }, /* (149) col_name_list ::= col_name_list NK_COMMA col_name */
  {  206,   -1 }, /* (150) col_name ::= column_name */
  {  172,   -2 }, /* (151) cmd ::= SHOW DNODES */
  {  172,   -2 }, /* (152) cmd ::= SHOW USERS */
  {  172,   -2 }, /* (153) cmd ::= SHOW DATABASES */
  {  172,   -4 }, /* (154) cmd ::= SHOW db_name_cond_opt TABLES like_pattern_opt */
  {  172,   -4 }, /* (155) cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt */
  {  172,   -3 }, /* (156) cmd ::= SHOW db_name_cond_opt VGROUPS */
  {  172,   -2 }, /* (157) cmd ::= SHOW MNODES */
  {  172,   -2 }, /* (158) cmd ::= SHOW MODULES */
  {  172,   -2 }, /* (159) cmd ::= SHOW QNODES */
  {  172,   -2 }, /* (160) cmd ::= SHOW FUNCTIONS */
  {  172,   -5 }, /* (161) cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt */
  {  172,   -2 }, /* (162) cmd ::= SHOW STREAMS */
  {  207,    0 }, /* (163) db_name_cond_opt ::= */
  {  207,   -2 }, /* (164) db_name_cond_opt ::= db_name NK_DOT */
  {  208,    0 }, /* (165) like_pattern_opt ::= */
  {  208,   -2 }, /* (166) like_pattern_opt ::= LIKE NK_STRING */
  {  209,   -1 }, /* (167) table_name_cond ::= table_name */
  {  210,    0 }, /* (168) from_db_opt ::= */
  {  210,   -2 }, /* (169) from_db_opt ::= FROM db_name */
  {  204,   -1 }, /* (170) func_name_list ::= func_name */
  {  204,   -3 }, /* (171) func_name_list ::= func_name_list NK_COMMA col_name */
  {  211,   -1 }, /* (172) func_name ::= function_name */
  {  172,   -8 }, /* (173) cmd ::= CREATE SMA INDEX not_exists_opt index_name ON table_name index_options */
  {  172,  -10 }, /* (174) cmd ::= CREATE FULLTEXT INDEX not_exists_opt index_name ON table_name NK_LP col_name_list NK_RP */
  {  172,   -6 }, /* (175) cmd ::= DROP INDEX exists_opt index_name ON table_name */
  {  214,    0 }, /* (176) index_options ::= */
  {  214,   -9 }, /* (177) index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt */
  {  214,  -11 }, /* (178) index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt */
  {  215,   -1 }, /* (179) func_list ::= func */
  {  215,   -3 }, /* (180) func_list ::= func_list NK_COMMA func */
  {  218,   -4 }, /* (181) func ::= function_name NK_LP expression_list NK_RP */
  {  172,   -6 }, /* (182) cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_expression */
  {  172,   -6 }, /* (183) cmd ::= CREATE TOPIC not_exists_opt topic_name AS db_name */
  {  172,   -4 }, /* (184) cmd ::= DROP TOPIC exists_opt topic_name */
  {  172,   -1 }, /* (185) cmd ::= query_expression */
  {  175,   -1 }, /* (186) literal ::= NK_INTEGER */
  {  175,   -1 }, /* (187) literal ::= NK_FLOAT */
  {  175,   -1 }, /* (188) literal ::= NK_STRING */
  {  175,   -1 }, /* (189) literal ::= NK_BOOL */
  {  175,   -2 }, /* (190) literal ::= TIMESTAMP NK_STRING */
  {  175,   -1 }, /* (191) literal ::= duration_literal */
  {  216,   -1 }, /* (192) duration_literal ::= NK_VARIABLE */
  {  222,   -1 }, /* (193) signed ::= NK_INTEGER */
  {  222,   -2 }, /* (194) signed ::= NK_PLUS NK_INTEGER */
  {  222,   -2 }, /* (195) signed ::= NK_MINUS NK_INTEGER */
  {  222,   -1 }, /* (196) signed ::= NK_FLOAT */
  {  222,   -2 }, /* (197) signed ::= NK_PLUS NK_FLOAT */
  {  222,   -2 }, /* (198) signed ::= NK_MINUS NK_FLOAT */
  {  223,   -1 }, /* (199) signed_literal ::= signed */
  {  223,   -1 }, /* (200) signed_literal ::= NK_STRING */
  {  223,   -1 }, /* (201) signed_literal ::= NK_BOOL */
  {  223,   -2 }, /* (202) signed_literal ::= TIMESTAMP NK_STRING */
  {  223,   -1 }, /* (203) signed_literal ::= duration_literal */
  {  199,   -1 }, /* (204) literal_list ::= signed_literal */
  {  199,   -3 }, /* (205) literal_list ::= literal_list NK_COMMA signed_literal */
  {  181,   -1 }, /* (206) db_name ::= NK_ID */
  {  202,   -1 }, /* (207) table_name ::= NK_ID */
  {  195,   -1 }, /* (208) column_name ::= NK_ID */
  {  212,   -1 }, /* (209) function_name ::= NK_ID */
  {  224,   -1 }, /* (210) table_alias ::= NK_ID */
  {  225,   -1 }, /* (211) column_alias ::= NK_ID */
  {  177,   -1 }, /* (212) user_name ::= NK_ID */
  {  213,   -1 }, /* (213) index_name ::= NK_ID */
  {  220,   -1 }, /* (214) topic_name ::= NK_ID */
  {  226,   -1 }, /* (215) expression ::= literal */
  {  226,   -1 }, /* (216) expression ::= pseudo_column */
  {  226,   -1 }, /* (217) expression ::= column_reference */
  {  226,   -4 }, /* (218) expression ::= function_name NK_LP expression_list NK_RP */
  {  226,   -4 }, /* (219) expression ::= function_name NK_LP NK_STAR NK_RP */
  {  226,   -1 }, /* (220) expression ::= subquery */
  {  226,   -3 }, /* (221) expression ::= NK_LP expression NK_RP */
  {  226,   -2 }, /* (222) expression ::= NK_PLUS expression */
  {  226,   -2 }, /* (223) expression ::= NK_MINUS expression */
  {  226,   -3 }, /* (224) expression ::= expression NK_PLUS expression */
  {  226,   -3 }, /* (225) expression ::= expression NK_MINUS expression */
  {  226,   -3 }, /* (226) expression ::= expression NK_STAR expression */
  {  226,   -3 }, /* (227) expression ::= expression NK_SLASH expression */
  {  226,   -3 }, /* (228) expression ::= expression NK_REM expression */
  {  219,   -1 }, /* (229) expression_list ::= expression */
  {  219,   -3 }, /* (230) expression_list ::= expression_list NK_COMMA expression */
  {  228,   -1 }, /* (231) column_reference ::= column_name */
  {  228,   -3 }, /* (232) column_reference ::= table_name NK_DOT column_name */
  {  227,   -2 }, /* (233) pseudo_column ::= NK_UNDERLINE ROWTS */
  {  227,   -1 }, /* (234) pseudo_column ::= TBNAME */
  {  227,   -2 }, /* (235) pseudo_column ::= NK_UNDERLINE QSTARTTS */
  {  227,   -2 }, /* (236) pseudo_column ::= NK_UNDERLINE QENDTS */
  {  227,   -2 }, /* (237) pseudo_column ::= NK_UNDERLINE WSTARTTS */
  {  227,   -2 }, /* (238) pseudo_column ::= NK_UNDERLINE WENDTS */
  {  227,   -2 }, /* (239) pseudo_column ::= NK_UNDERLINE WDURATION */
  {  230,   -3 }, /* (240) predicate ::= expression compare_op expression */
  {  230,   -5 }, /* (241) predicate ::= expression BETWEEN expression AND expression */
  {  230,   -6 }, /* (242) predicate ::= expression NOT BETWEEN expression AND expression */
  {  230,   -3 }, /* (243) predicate ::= expression IS NULL */
  {  230,   -4 }, /* (244) predicate ::= expression IS NOT NULL */
  {  230,   -3 }, /* (245) predicate ::= expression in_op in_predicate_value */
  {  231,   -1 }, /* (246) compare_op ::= NK_LT */
  {  231,   -1 }, /* (247) compare_op ::= NK_GT */
  {  231,   -1 }, /* (248) compare_op ::= NK_LE */
  {  231,   -1 }, /* (249) compare_op ::= NK_GE */
  {  231,   -1 }, /* (250) compare_op ::= NK_NE */
  {  231,   -1 }, /* (251) compare_op ::= NK_EQ */
  {  231,   -1 }, /* (252) compare_op ::= LIKE */
  {  231,   -2 }, /* (253) compare_op ::= NOT LIKE */
  {  231,   -1 }, /* (254) compare_op ::= MATCH */
  {  231,   -1 }, /* (255) compare_op ::= NMATCH */
  {  232,   -1 }, /* (256) in_op ::= IN */
  {  232,   -2 }, /* (257) in_op ::= NOT IN */
  {  233,   -3 }, /* (258) in_predicate_value ::= NK_LP expression_list NK_RP */
  {  234,   -1 }, /* (259) boolean_value_expression ::= boolean_primary */
  {  234,   -2 }, /* (260) boolean_value_expression ::= NOT boolean_primary */
  {  234,   -3 }, /* (261) boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */
  {  234,   -3 }, /* (262) boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */
  {  235,   -1 }, /* (263) boolean_primary ::= predicate */
  {  235,   -3 }, /* (264) boolean_primary ::= NK_LP boolean_value_expression NK_RP */
  {  236,   -1 }, /* (265) common_expression ::= expression */
  {  236,   -1 }, /* (266) common_expression ::= boolean_value_expression */
  {  237,   -2 }, /* (267) from_clause ::= FROM table_reference_list */
  {  238,   -1 }, /* (268) table_reference_list ::= table_reference */
  {  238,   -3 }, /* (269) table_reference_list ::= table_reference_list NK_COMMA table_reference */
  {  239,   -1 }, /* (270) table_reference ::= table_primary */
  {  239,   -1 }, /* (271) table_reference ::= joined_table */
  {  240,   -2 }, /* (272) table_primary ::= table_name alias_opt */
  {  240,   -4 }, /* (273) table_primary ::= db_name NK_DOT table_name alias_opt */
  {  240,   -2 }, /* (274) table_primary ::= subquery alias_opt */
  {  240,   -1 }, /* (275) table_primary ::= parenthesized_joined_table */
  {  242,    0 }, /* (276) alias_opt ::= */
  {  242,   -1 }, /* (277) alias_opt ::= table_alias */
  {  242,   -2 }, /* (278) alias_opt ::= AS table_alias */
  {  243,   -3 }, /* (279) parenthesized_joined_table ::= NK_LP joined_table NK_RP */
  {  243,   -3 }, /* (280) parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */
  {  241,   -6 }, /* (281) joined_table ::= table_reference join_type JOIN table_reference ON search_condition */
  {  244,    0 }, /* (282) join_type ::= */
  {  244,   -1 }, /* (283) join_type ::= INNER */
  {  246,   -9 }, /* (284) 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 */
  {  247,    0 }, /* (285) set_quantifier_opt ::= */
  {  247,   -1 }, /* (286) set_quantifier_opt ::= DISTINCT */
  {  247,   -1 }, /* (287) set_quantifier_opt ::= ALL */
  {  248,   -1 }, /* (288) select_list ::= NK_STAR */
  {  248,   -1 }, /* (289) select_list ::= select_sublist */
  {  254,   -1 }, /* (290) select_sublist ::= select_item */
  {  254,   -3 }, /* (291) select_sublist ::= select_sublist NK_COMMA select_item */
  {  255,   -1 }, /* (292) select_item ::= common_expression */
  {  255,   -2 }, /* (293) select_item ::= common_expression column_alias */
  {  255,   -3 }, /* (294) select_item ::= common_expression AS column_alias */
  {  255,   -3 }, /* (295) select_item ::= table_name NK_DOT NK_STAR */
  {  249,    0 }, /* (296) where_clause_opt ::= */
  {  249,   -2 }, /* (297) where_clause_opt ::= WHERE search_condition */
  {  250,    0 }, /* (298) partition_by_clause_opt ::= */
  {  250,   -3 }, /* (299) partition_by_clause_opt ::= PARTITION BY expression_list */
  {  251,    0 }, /* (300) twindow_clause_opt ::= */
  {  251,   -6 }, /* (301) twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP */
  {  251,   -4 }, /* (302) twindow_clause_opt ::= STATE_WINDOW NK_LP column_reference NK_RP */
  {  251,   -6 }, /* (303) twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt */
  {  251,   -8 }, /* (304) twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt */
  {  217,    0 }, /* (305) sliding_opt ::= */
  {  217,   -4 }, /* (306) sliding_opt ::= SLIDING NK_LP duration_literal NK_RP */
  {  256,    0 }, /* (307) fill_opt ::= */
  {  256,   -4 }, /* (308) fill_opt ::= FILL NK_LP fill_mode NK_RP */
  {  256,   -6 }, /* (309) fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP */
  {  257,   -1 }, /* (310) fill_mode ::= NONE */
  {  257,   -1 }, /* (311) fill_mode ::= PREV */
  {  257,   -1 }, /* (312) fill_mode ::= NULL */
  {  257,   -1 }, /* (313) fill_mode ::= LINEAR */
  {  257,   -1 }, /* (314) fill_mode ::= NEXT */
  {  252,    0 }, /* (315) group_by_clause_opt ::= */
  {  252,   -3 }, /* (316) group_by_clause_opt ::= GROUP BY group_by_list */
  {  258,   -1 }, /* (317) group_by_list ::= expression */
  {  258,   -3 }, /* (318) group_by_list ::= group_by_list NK_COMMA expression */
  {  253,    0 }, /* (319) having_clause_opt ::= */
  {  253,   -2 }, /* (320) having_clause_opt ::= HAVING search_condition */
  {  221,   -4 }, /* (321) query_expression ::= query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt */
  {  259,   -1 }, /* (322) query_expression_body ::= query_primary */
  {  259,   -4 }, /* (323) query_expression_body ::= query_expression_body UNION ALL query_expression_body */
  {  263,   -1 }, /* (324) query_primary ::= query_specification */
  {  260,    0 }, /* (325) order_by_clause_opt ::= */
  {  260,   -3 }, /* (326) order_by_clause_opt ::= ORDER BY sort_specification_list */
  {  261,    0 }, /* (327) slimit_clause_opt ::= */
  {  261,   -2 }, /* (328) slimit_clause_opt ::= SLIMIT NK_INTEGER */
  {  261,   -4 }, /* (329) slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */
  {  261,   -4 }, /* (330) slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */
  {  262,    0 }, /* (331) limit_clause_opt ::= */
  {  262,   -2 }, /* (332) limit_clause_opt ::= LIMIT NK_INTEGER */
  {  262,   -4 }, /* (333) limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */
  {  262,   -4 }, /* (334) limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */
  {  229,   -3 }, /* (335) subquery ::= NK_LP query_expression NK_RP */
  {  245,   -1 }, /* (336) search_condition ::= common_expression */
  {  264,   -1 }, /* (337) sort_specification_list ::= sort_specification */
  {  264,   -3 }, /* (338) sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */
  {  265,   -3 }, /* (339) sort_specification ::= expression ordering_specification_opt null_ordering_opt */
  {  266,    0 }, /* (340) ordering_specification_opt ::= */
  {  266,   -1 }, /* (341) ordering_specification_opt ::= ASC */
  {  266,   -1 }, /* (342) ordering_specification_opt ::= DESC */
  {  267,    0 }, /* (343) null_ordering_opt ::= */
  {  267,   -2 }, /* (344) null_ordering_opt ::= NULLS FIRST */
  {  267,   -2 }, /* (345) null_ordering_opt ::= NULLS LAST */
2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267
};

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 已提交
2268 2269
  ParseTOKENTYPE yyLookaheadToken  /* Value of the lookahead token */
  ParseCTX_PDECL                   /* %extra_context */
2270 2271 2272 2273 2274
){
  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 已提交
2275
  ParseARG_FETCH
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
  (void)yyLookahead;
  (void)yyLookaheadToken;
  yymsp = yypParser->yytos;
#ifndef NDEBUG
  if( yyTraceFILE && yyruleno<(int)(sizeof(yyRuleName)/sizeof(yyRuleName[0])) ){
    yysize = yyRuleInfo[yyruleno].nrhs;
    if( yysize ){
      fprintf(yyTraceFILE, "%sReduce %d [%s], go to state %d.\n",
        yyTracePrompt,
        yyruleno, yyRuleName[yyruleno], yymsp[yysize].stateno);
    }else{
      fprintf(yyTraceFILE, "%sReduce %d [%s].\n",
        yyTracePrompt, yyruleno, yyRuleName[yyruleno]);
    }
  }
#endif /* NDEBUG */

  /* Check that the stack is large enough to grow by a single entry
  ** if the RHS of the rule is empty.  This ensures that there is room
  ** enough on the stack to push the LHS value */
  if( yyRuleInfo[yyruleno].nrhs==0 ){
#ifdef YYTRACKMAXSTACKDEPTH
    if( (int)(yypParser->yytos - yypParser->yystack)>yypParser->yyhwm ){
      yypParser->yyhwm++;
      assert( yypParser->yyhwm == (int)(yypParser->yytos - yypParser->yystack));
    }
#endif
#if YYSTACKDEPTH>0 
    if( yypParser->yytos>=yypParser->yystackEnd ){
      yyStackOverflow(yypParser);
      /* The call to yyStackOverflow() above pops the stack until it is
      ** empty, causing the main parser loop to exit.  So the return value
      ** is never used and does not matter. */
      return 0;
    }
#else
    if( yypParser->yytos>=&yypParser->yystack[yypParser->yystksz-1] ){
      if( yyGrowStack(yypParser) ){
        yyStackOverflow(yypParser);
        /* The call to yyStackOverflow() above pops the stack until it is
        ** empty, causing the main parser loop to exit.  So the return value
        ** is never used and does not matter. */
        return 0;
      }
      yymsp = yypParser->yytos;
    }
#endif
  }

  switch( yyruleno ){
  /* Beginning here are the reduction cases.  A typical example
  ** follows:
  **   case 0:
  **  #line <lineno> <grammarfile>
  **     { ... }           // User supplied code
  **  #line <lineno> <thisfile>
  **     break;
  */
/********** Begin reduce actions **********************************************/
        YYMINORTYPE yylhsminor;
2336
      case 0: /* cmd ::= CREATE ACCOUNT NK_ID PASS NK_STRING account_options */
2337
{ pCxt->valid = false; generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_EXPRIE_STATEMENT); }
2338
  yy_destructor(yypParser,173,&yymsp[0].minor);
2339
        break;
2340 2341
      case 1: /* cmd ::= ALTER ACCOUNT NK_ID alter_account_options */
{ pCxt->valid = false; generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_EXPRIE_STATEMENT); }
2342
  yy_destructor(yypParser,174,&yymsp[0].minor);
2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355
        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);
2356
{  yy_destructor(yypParser,173,&yymsp[-2].minor);
2357
{ }
2358
  yy_destructor(yypParser,175,&yymsp[0].minor);
2359
}
2360
        break;
2361
      case 12: /* alter_account_options ::= alter_account_option */
2362
{  yy_destructor(yypParser,176,&yymsp[0].minor);
2363 2364 2365
{ }
}
        break;
2366
      case 13: /* alter_account_options ::= alter_account_options alter_account_option */
2367
{  yy_destructor(yypParser,174,&yymsp[-1].minor);
2368
{ }
2369
  yy_destructor(yypParser,176,&yymsp[0].minor);
2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381
}
        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);
2382
{ }
2383
  yy_destructor(yypParser,175,&yymsp[0].minor);
2384
        break;
2385
      case 24: /* cmd ::= CREATE USER user_name PASS NK_STRING */
2386
{ pCxt->pRootNode = createCreateUserStmt(pCxt, &yymsp[-2].minor.yy225, &yymsp[0].minor.yy0); }
2387
        break;
2388
      case 25: /* cmd ::= ALTER USER user_name PASS NK_STRING */
2389
{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy225, TSDB_ALTER_USER_PASSWD, &yymsp[0].minor.yy0); }
2390
        break;
2391
      case 26: /* cmd ::= ALTER USER user_name PRIVILEGE NK_STRING */
2392
{ pCxt->pRootNode = createAlterUserStmt(pCxt, &yymsp[-2].minor.yy225, TSDB_ALTER_USER_PRIVILEGES, &yymsp[0].minor.yy0); }
2393
        break;
2394
      case 27: /* cmd ::= DROP USER user_name */
2395
{ pCxt->pRootNode = createDropUserStmt(pCxt, &yymsp[0].minor.yy225); }
2396
        break;
X
Xiaoyu Wang 已提交
2397
      case 28: /* cmd ::= CREATE DNODE dnode_endpoint */
2398
{ pCxt->pRootNode = createCreateDnodeStmt(pCxt, &yymsp[0].minor.yy225, NULL); }
2399
        break;
X
Xiaoyu Wang 已提交
2400
      case 29: /* cmd ::= CREATE DNODE dnode_host_name PORT NK_INTEGER */
2401
{ pCxt->pRootNode = createCreateDnodeStmt(pCxt, &yymsp[-2].minor.yy225, &yymsp[0].minor.yy0); }
2402
        break;
X
Xiaoyu Wang 已提交
2403
      case 30: /* cmd ::= DROP DNODE NK_INTEGER */
2404
{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[0].minor.yy0); }
2405
        break;
X
Xiaoyu Wang 已提交
2406
      case 31: /* cmd ::= DROP DNODE dnode_endpoint */
2407
{ pCxt->pRootNode = createDropDnodeStmt(pCxt, &yymsp[0].minor.yy225); }
2408
        break;
X
Xiaoyu Wang 已提交
2409
      case 32: /* cmd ::= ALTER DNODE NK_INTEGER NK_STRING */
2410 2411
{ pCxt->pRootNode = createAlterDnodeStmt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0, NULL); }
        break;
X
Xiaoyu Wang 已提交
2412
      case 33: /* cmd ::= ALTER DNODE NK_INTEGER NK_STRING NK_STRING */
2413 2414
{ pCxt->pRootNode = createAlterDnodeStmt(pCxt, &yymsp[-2].minor.yy0, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0); }
        break;
X
Xiaoyu Wang 已提交
2415
      case 34: /* cmd ::= ALTER ALL DNODES NK_STRING */
2416 2417
{ pCxt->pRootNode = createAlterDnodeStmt(pCxt, NULL, &yymsp[0].minor.yy0, NULL); }
        break;
X
Xiaoyu Wang 已提交
2418
      case 35: /* cmd ::= ALTER ALL DNODES NK_STRING NK_STRING */
2419 2420
{ pCxt->pRootNode = createAlterDnodeStmt(pCxt, NULL, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0); }
        break;
X
Xiaoyu Wang 已提交
2421 2422 2423
      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);
X
Xiaoyu Wang 已提交
2424 2425 2426 2427 2428 2429 2430 2431 2432
      case 206: /* db_name ::= NK_ID */ yytestcase(yyruleno==206);
      case 207: /* table_name ::= NK_ID */ yytestcase(yyruleno==207);
      case 208: /* column_name ::= NK_ID */ yytestcase(yyruleno==208);
      case 209: /* function_name ::= NK_ID */ yytestcase(yyruleno==209);
      case 210: /* table_alias ::= NK_ID */ yytestcase(yyruleno==210);
      case 211: /* column_alias ::= NK_ID */ yytestcase(yyruleno==211);
      case 212: /* user_name ::= NK_ID */ yytestcase(yyruleno==212);
      case 213: /* index_name ::= NK_ID */ yytestcase(yyruleno==213);
      case 214: /* topic_name ::= NK_ID */ yytestcase(yyruleno==214);
2433 2434
{ yylhsminor.yy225 = yymsp[0].minor.yy0; }
  yymsp[0].minor.yy225 = yylhsminor.yy225;
X
Xiaoyu Wang 已提交
2435 2436
        break;
      case 39: /* cmd ::= ALTER LOCAL NK_STRING */
2437 2438
{ pCxt->pRootNode = createAlterLocalStmt(pCxt, &yymsp[0].minor.yy0, NULL); }
        break;
X
Xiaoyu Wang 已提交
2439
      case 40: /* cmd ::= ALTER LOCAL NK_STRING NK_STRING */
2440 2441
{ pCxt->pRootNode = createAlterLocalStmt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0); }
        break;
X
Xiaoyu Wang 已提交
2442
      case 41: /* cmd ::= CREATE QNODE ON DNODE NK_INTEGER */
X
Xiaoyu Wang 已提交
2443 2444
{ pCxt->pRootNode = createCreateQnodeStmt(pCxt, &yymsp[0].minor.yy0); }
        break;
X
Xiaoyu Wang 已提交
2445
      case 42: /* cmd ::= DROP QNODE ON DNODE NK_INTEGER */
2446 2447
{ pCxt->pRootNode = createDropQnodeStmt(pCxt, &yymsp[0].minor.yy0); }
        break;
X
Xiaoyu Wang 已提交
2448
      case 43: /* cmd ::= CREATE DATABASE not_exists_opt db_name db_options */
2449
{ pCxt->pRootNode = createCreateDatabaseStmt(pCxt, yymsp[-2].minor.yy505, &yymsp[-1].minor.yy225, yymsp[0].minor.yy176); }
X
Xiaoyu Wang 已提交
2450
        break;
X
Xiaoyu Wang 已提交
2451
      case 44: /* cmd ::= DROP DATABASE exists_opt db_name */
2452
{ pCxt->pRootNode = createDropDatabaseStmt(pCxt, yymsp[-1].minor.yy505, &yymsp[0].minor.yy225); }
X
Xiaoyu Wang 已提交
2453
        break;
X
Xiaoyu Wang 已提交
2454
      case 45: /* cmd ::= USE db_name */
2455
{ pCxt->pRootNode = createUseDatabaseStmt(pCxt, &yymsp[0].minor.yy225); }
2456
        break;
X
Xiaoyu Wang 已提交
2457
      case 46: /* cmd ::= ALTER DATABASE db_name alter_db_options */
2458
{ pCxt->pRootNode = createAlterDatabaseStmt(pCxt, &yymsp[-1].minor.yy225, yymsp[0].minor.yy176); }
2459
        break;
X
Xiaoyu Wang 已提交
2460
      case 47: /* not_exists_opt ::= IF NOT EXISTS */
2461
{ yymsp[-2].minor.yy505 = true; }
2462
        break;
X
Xiaoyu Wang 已提交
2463 2464
      case 48: /* not_exists_opt ::= */
      case 50: /* exists_opt ::= */ yytestcase(yyruleno==50);
2465 2466
      case 285: /* set_quantifier_opt ::= */ yytestcase(yyruleno==285);
{ yymsp[1].minor.yy505 = false; }
2467
        break;
X
Xiaoyu Wang 已提交
2468
      case 49: /* exists_opt ::= IF EXISTS */
2469
{ yymsp[-1].minor.yy505 = true; }
2470
        break;
X
Xiaoyu Wang 已提交
2471
      case 51: /* db_options ::= */
2472
{ yymsp[1].minor.yy176 = createDefaultDatabaseOptions(pCxt); }
2473
        break;
X
Xiaoyu Wang 已提交
2474
      case 52: /* db_options ::= db_options BLOCKS NK_INTEGER */
2475 2476
{ yylhsminor.yy176 = setDatabaseOption(pCxt, yymsp[-2].minor.yy176, DB_OPTION_BLOCKS, &yymsp[0].minor.yy0); }
  yymsp[-2].minor.yy176 = yylhsminor.yy176;
2477
        break;
X
Xiaoyu Wang 已提交
2478
      case 53: /* db_options ::= db_options CACHE NK_INTEGER */
2479 2480
{ yylhsminor.yy176 = setDatabaseOption(pCxt, yymsp[-2].minor.yy176, DB_OPTION_CACHE, &yymsp[0].minor.yy0); }
  yymsp[-2].minor.yy176 = yylhsminor.yy176;
2481
        break;
X
Xiaoyu Wang 已提交
2482
      case 54: /* db_options ::= db_options CACHELAST NK_INTEGER */
2483 2484
{ yylhsminor.yy176 = setDatabaseOption(pCxt, yymsp[-2].minor.yy176, DB_OPTION_CACHELAST, &yymsp[0].minor.yy0); }
  yymsp[-2].minor.yy176 = yylhsminor.yy176;
2485
        break;
X
Xiaoyu Wang 已提交
2486
      case 55: /* db_options ::= db_options COMP NK_INTEGER */
2487 2488
{ yylhsminor.yy176 = setDatabaseOption(pCxt, yymsp[-2].minor.yy176, DB_OPTION_COMP, &yymsp[0].minor.yy0); }
  yymsp[-2].minor.yy176 = yylhsminor.yy176;
2489
        break;
X
Xiaoyu Wang 已提交
2490
      case 56: /* db_options ::= db_options DAYS NK_INTEGER */
2491 2492
{ yylhsminor.yy176 = setDatabaseOption(pCxt, yymsp[-2].minor.yy176, DB_OPTION_DAYS, &yymsp[0].minor.yy0); }
  yymsp[-2].minor.yy176 = yylhsminor.yy176;
2493
        break;
X
Xiaoyu Wang 已提交
2494
      case 57: /* db_options ::= db_options FSYNC NK_INTEGER */
2495 2496
{ yylhsminor.yy176 = setDatabaseOption(pCxt, yymsp[-2].minor.yy176, DB_OPTION_FSYNC, &yymsp[0].minor.yy0); }
  yymsp[-2].minor.yy176 = yylhsminor.yy176;
2497
        break;
X
Xiaoyu Wang 已提交
2498
      case 58: /* db_options ::= db_options MAXROWS NK_INTEGER */
2499 2500
{ yylhsminor.yy176 = setDatabaseOption(pCxt, yymsp[-2].minor.yy176, DB_OPTION_MAXROWS, &yymsp[0].minor.yy0); }
  yymsp[-2].minor.yy176 = yylhsminor.yy176;
2501
        break;
X
Xiaoyu Wang 已提交
2502
      case 59: /* db_options ::= db_options MINROWS NK_INTEGER */
2503 2504
{ yylhsminor.yy176 = setDatabaseOption(pCxt, yymsp[-2].minor.yy176, DB_OPTION_MINROWS, &yymsp[0].minor.yy0); }
  yymsp[-2].minor.yy176 = yylhsminor.yy176;
2505
        break;
X
Xiaoyu Wang 已提交
2506
      case 60: /* db_options ::= db_options KEEP NK_INTEGER */
2507 2508
{ yylhsminor.yy176 = setDatabaseOption(pCxt, yymsp[-2].minor.yy176, DB_OPTION_KEEP, &yymsp[0].minor.yy0); }
  yymsp[-2].minor.yy176 = yylhsminor.yy176;
2509
        break;
X
Xiaoyu Wang 已提交
2510
      case 61: /* db_options ::= db_options PRECISION NK_STRING */
2511 2512
{ yylhsminor.yy176 = setDatabaseOption(pCxt, yymsp[-2].minor.yy176, DB_OPTION_PRECISION, &yymsp[0].minor.yy0); }
  yymsp[-2].minor.yy176 = yylhsminor.yy176;
2513
        break;
X
Xiaoyu Wang 已提交
2514
      case 62: /* db_options ::= db_options QUORUM NK_INTEGER */
2515 2516
{ yylhsminor.yy176 = setDatabaseOption(pCxt, yymsp[-2].minor.yy176, DB_OPTION_QUORUM, &yymsp[0].minor.yy0); }
  yymsp[-2].minor.yy176 = yylhsminor.yy176;
2517
        break;
X
Xiaoyu Wang 已提交
2518
      case 63: /* db_options ::= db_options REPLICA NK_INTEGER */
2519 2520
{ yylhsminor.yy176 = setDatabaseOption(pCxt, yymsp[-2].minor.yy176, DB_OPTION_REPLICA, &yymsp[0].minor.yy0); }
  yymsp[-2].minor.yy176 = yylhsminor.yy176;
2521
        break;
X
Xiaoyu Wang 已提交
2522
      case 64: /* db_options ::= db_options TTL NK_INTEGER */
2523 2524
{ yylhsminor.yy176 = setDatabaseOption(pCxt, yymsp[-2].minor.yy176, DB_OPTION_TTL, &yymsp[0].minor.yy0); }
  yymsp[-2].minor.yy176 = yylhsminor.yy176;
2525
        break;
X
Xiaoyu Wang 已提交
2526
      case 65: /* db_options ::= db_options WAL NK_INTEGER */
2527 2528
{ yylhsminor.yy176 = setDatabaseOption(pCxt, yymsp[-2].minor.yy176, DB_OPTION_WAL, &yymsp[0].minor.yy0); }
  yymsp[-2].minor.yy176 = yylhsminor.yy176;
2529
        break;
X
Xiaoyu Wang 已提交
2530
      case 66: /* db_options ::= db_options VGROUPS NK_INTEGER */
2531 2532
{ yylhsminor.yy176 = setDatabaseOption(pCxt, yymsp[-2].minor.yy176, DB_OPTION_VGROUPS, &yymsp[0].minor.yy0); }
  yymsp[-2].minor.yy176 = yylhsminor.yy176;
2533
        break;
X
Xiaoyu Wang 已提交
2534
      case 67: /* db_options ::= db_options SINGLE_STABLE NK_INTEGER */
2535 2536
{ yylhsminor.yy176 = setDatabaseOption(pCxt, yymsp[-2].minor.yy176, DB_OPTION_SINGLE_STABLE, &yymsp[0].minor.yy0); }
  yymsp[-2].minor.yy176 = yylhsminor.yy176;
2537
        break;
X
Xiaoyu Wang 已提交
2538
      case 68: /* db_options ::= db_options STREAM_MODE NK_INTEGER */
2539 2540
{ yylhsminor.yy176 = setDatabaseOption(pCxt, yymsp[-2].minor.yy176, DB_OPTION_STREAM_MODE, &yymsp[0].minor.yy0); }
  yymsp[-2].minor.yy176 = yylhsminor.yy176;
2541
        break;
X
Xiaoyu Wang 已提交
2542
      case 69: /* db_options ::= db_options RETENTIONS NK_STRING */
2543 2544
{ yylhsminor.yy176 = setDatabaseOption(pCxt, yymsp[-2].minor.yy176, DB_OPTION_RETENTIONS, &yymsp[0].minor.yy0); }
  yymsp[-2].minor.yy176 = yylhsminor.yy176;
X
Xiaoyu Wang 已提交
2545 2546
        break;
      case 70: /* alter_db_options ::= alter_db_option */
2547 2548
{ yylhsminor.yy176 = createDefaultAlterDatabaseOptions(pCxt); yylhsminor.yy176 = setDatabaseOption(pCxt, yylhsminor.yy176, yymsp[0].minor.yy325.type, &yymsp[0].minor.yy325.val); }
  yymsp[0].minor.yy176 = yylhsminor.yy176;
2549
        break;
X
Xiaoyu Wang 已提交
2550
      case 71: /* alter_db_options ::= alter_db_options alter_db_option */
2551 2552
{ yylhsminor.yy176 = setDatabaseOption(pCxt, yymsp[-1].minor.yy176, yymsp[0].minor.yy325.type, &yymsp[0].minor.yy325.val); }
  yymsp[-1].minor.yy176 = yylhsminor.yy176;
2553
        break;
X
Xiaoyu Wang 已提交
2554
      case 72: /* alter_db_option ::= BLOCKS NK_INTEGER */
2555
{ yymsp[-1].minor.yy325.type = DB_OPTION_BLOCKS; yymsp[-1].minor.yy325.val = yymsp[0].minor.yy0; }
2556
        break;
X
Xiaoyu Wang 已提交
2557
      case 73: /* alter_db_option ::= FSYNC NK_INTEGER */
2558
{ yymsp[-1].minor.yy325.type = DB_OPTION_FSYNC; yymsp[-1].minor.yy325.val = yymsp[0].minor.yy0; }
X
Xiaoyu Wang 已提交
2559 2560
        break;
      case 74: /* alter_db_option ::= KEEP NK_INTEGER */
2561
{ yymsp[-1].minor.yy325.type = DB_OPTION_KEEP; yymsp[-1].minor.yy325.val = yymsp[0].minor.yy0; }
X
Xiaoyu Wang 已提交
2562 2563
        break;
      case 75: /* alter_db_option ::= WAL NK_INTEGER */
2564
{ yymsp[-1].minor.yy325.type = DB_OPTION_WAL; yymsp[-1].minor.yy325.val = yymsp[0].minor.yy0; }
2565
        break;
X
Xiaoyu Wang 已提交
2566
      case 76: /* alter_db_option ::= QUORUM NK_INTEGER */
2567
{ yymsp[-1].minor.yy325.type = DB_OPTION_QUORUM; yymsp[-1].minor.yy325.val = yymsp[0].minor.yy0; }
2568
        break;
X
Xiaoyu Wang 已提交
2569
      case 77: /* alter_db_option ::= CACHELAST NK_INTEGER */
2570
{ yymsp[-1].minor.yy325.type = DB_OPTION_CACHELAST; yymsp[-1].minor.yy325.val = yymsp[0].minor.yy0; }
X
Xiaoyu Wang 已提交
2571 2572 2573
        break;
      case 78: /* cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options */
      case 80: /* cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options */ yytestcase(yyruleno==80);
2574
{ pCxt->pRootNode = createCreateTableStmt(pCxt, yymsp[-6].minor.yy505, yymsp[-5].minor.yy176, yymsp[-3].minor.yy512, yymsp[-1].minor.yy512, yymsp[0].minor.yy176); }
X
Xiaoyu Wang 已提交
2575 2576
        break;
      case 79: /* cmd ::= CREATE TABLE multi_create_clause */
2577
{ pCxt->pRootNode = createCreateMultiTableStmt(pCxt, yymsp[0].minor.yy512); }
X
Xiaoyu Wang 已提交
2578 2579
        break;
      case 81: /* cmd ::= DROP TABLE multi_drop_clause */
2580
{ pCxt->pRootNode = createDropTableStmt(pCxt, yymsp[0].minor.yy512); }
X
Xiaoyu Wang 已提交
2581 2582
        break;
      case 82: /* cmd ::= DROP STABLE exists_opt full_table_name */
2583
{ pCxt->pRootNode = createDropSuperTableStmt(pCxt, yymsp[-1].minor.yy505, yymsp[0].minor.yy176); }
X
Xiaoyu Wang 已提交
2584 2585 2586 2587
        break;
      case 83: /* cmd ::= ALTER TABLE alter_table_clause */
      case 84: /* cmd ::= ALTER STABLE alter_table_clause */ yytestcase(yyruleno==84);
      case 185: /* cmd ::= query_expression */ yytestcase(yyruleno==185);
2588
{ pCxt->pRootNode = yymsp[0].minor.yy176; }
X
Xiaoyu Wang 已提交
2589 2590
        break;
      case 85: /* alter_table_clause ::= full_table_name alter_table_options */
2591 2592
{ yylhsminor.yy176 = createAlterTableOption(pCxt, yymsp[-1].minor.yy176, yymsp[0].minor.yy176); }
  yymsp[-1].minor.yy176 = yylhsminor.yy176;
X
Xiaoyu Wang 已提交
2593 2594
        break;
      case 86: /* alter_table_clause ::= full_table_name ADD COLUMN column_name type_name */
2595 2596
{ yylhsminor.yy176 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy176, TSDB_ALTER_TABLE_ADD_COLUMN, &yymsp[-1].minor.yy225, yymsp[0].minor.yy448); }
  yymsp[-4].minor.yy176 = yylhsminor.yy176;
X
Xiaoyu Wang 已提交
2597 2598
        break;
      case 87: /* alter_table_clause ::= full_table_name DROP COLUMN column_name */
2599 2600
{ yylhsminor.yy176 = createAlterTableDropCol(pCxt, yymsp[-3].minor.yy176, TSDB_ALTER_TABLE_DROP_COLUMN, &yymsp[0].minor.yy225); }
  yymsp[-3].minor.yy176 = yylhsminor.yy176;
X
Xiaoyu Wang 已提交
2601 2602
        break;
      case 88: /* alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name */
2603 2604
{ yylhsminor.yy176 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy176, TSDB_ALTER_TABLE_UPDATE_COLUMN_BYTES, &yymsp[-1].minor.yy225, yymsp[0].minor.yy448); }
  yymsp[-4].minor.yy176 = yylhsminor.yy176;
X
Xiaoyu Wang 已提交
2605 2606
        break;
      case 89: /* alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name */
2607 2608
{ yylhsminor.yy176 = createAlterTableRenameCol(pCxt, yymsp[-4].minor.yy176, TSDB_ALTER_TABLE_UPDATE_COLUMN_NAME, &yymsp[-1].minor.yy225, &yymsp[0].minor.yy225); }
  yymsp[-4].minor.yy176 = yylhsminor.yy176;
2609
        break;
X
Xiaoyu Wang 已提交
2610
      case 90: /* alter_table_clause ::= full_table_name ADD TAG column_name type_name */
2611 2612
{ yylhsminor.yy176 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy176, TSDB_ALTER_TABLE_ADD_TAG, &yymsp[-1].minor.yy225, yymsp[0].minor.yy448); }
  yymsp[-4].minor.yy176 = yylhsminor.yy176;
2613
        break;
X
Xiaoyu Wang 已提交
2614
      case 91: /* alter_table_clause ::= full_table_name DROP TAG column_name */
2615 2616
{ yylhsminor.yy176 = createAlterTableDropCol(pCxt, yymsp[-3].minor.yy176, TSDB_ALTER_TABLE_DROP_TAG, &yymsp[0].minor.yy225); }
  yymsp[-3].minor.yy176 = yylhsminor.yy176;
2617
        break;
X
Xiaoyu Wang 已提交
2618
      case 92: /* alter_table_clause ::= full_table_name MODIFY TAG column_name type_name */
2619 2620
{ yylhsminor.yy176 = createAlterTableAddModifyCol(pCxt, yymsp[-4].minor.yy176, TSDB_ALTER_TABLE_UPDATE_TAG_BYTES, &yymsp[-1].minor.yy225, yymsp[0].minor.yy448); }
  yymsp[-4].minor.yy176 = yylhsminor.yy176;
2621
        break;
X
Xiaoyu Wang 已提交
2622
      case 93: /* alter_table_clause ::= full_table_name RENAME TAG column_name column_name */
2623 2624
{ yylhsminor.yy176 = createAlterTableRenameCol(pCxt, yymsp[-4].minor.yy176, TSDB_ALTER_TABLE_UPDATE_TAG_NAME, &yymsp[-1].minor.yy225, &yymsp[0].minor.yy225); }
  yymsp[-4].minor.yy176 = yylhsminor.yy176;
2625
        break;
X
Xiaoyu Wang 已提交
2626
      case 94: /* alter_table_clause ::= full_table_name SET TAG column_name NK_EQ literal */
2627 2628
{ yylhsminor.yy176 = createAlterTableSetTag(pCxt, yymsp[-5].minor.yy176, &yymsp[-2].minor.yy225, yymsp[0].minor.yy176); }
  yymsp[-5].minor.yy176 = yylhsminor.yy176;
X
Xiaoyu Wang 已提交
2629
        break;
X
Xiaoyu Wang 已提交
2630 2631 2632 2633 2634 2635 2636
      case 95: /* multi_create_clause ::= create_subtable_clause */
      case 98: /* multi_drop_clause ::= drop_table_clause */ yytestcase(yyruleno==98);
      case 105: /* column_def_list ::= column_def */ yytestcase(yyruleno==105);
      case 148: /* col_name_list ::= col_name */ yytestcase(yyruleno==148);
      case 170: /* func_name_list ::= func_name */ yytestcase(yyruleno==170);
      case 179: /* func_list ::= func */ yytestcase(yyruleno==179);
      case 204: /* literal_list ::= signed_literal */ yytestcase(yyruleno==204);
2637 2638 2639 2640
      case 290: /* select_sublist ::= select_item */ yytestcase(yyruleno==290);
      case 337: /* sort_specification_list ::= sort_specification */ yytestcase(yyruleno==337);
{ yylhsminor.yy512 = createNodeList(pCxt, yymsp[0].minor.yy176); }
  yymsp[0].minor.yy512 = yylhsminor.yy512;
2641
        break;
X
Xiaoyu Wang 已提交
2642 2643
      case 96: /* multi_create_clause ::= multi_create_clause create_subtable_clause */
      case 99: /* multi_drop_clause ::= multi_drop_clause drop_table_clause */ yytestcase(yyruleno==99);
2644 2645
{ yylhsminor.yy512 = addNodeToList(pCxt, yymsp[-1].minor.yy512, yymsp[0].minor.yy176); }
  yymsp[-1].minor.yy512 = yylhsminor.yy512;
2646
        break;
X
Xiaoyu Wang 已提交
2647
      case 97: /* create_subtable_clause ::= not_exists_opt full_table_name USING full_table_name specific_tags_opt TAGS NK_LP literal_list NK_RP */
2648 2649
{ yylhsminor.yy176 = createCreateSubTableClause(pCxt, yymsp[-8].minor.yy505, yymsp[-7].minor.yy176, yymsp[-5].minor.yy176, yymsp[-4].minor.yy512, yymsp[-1].minor.yy512); }
  yymsp[-8].minor.yy176 = yylhsminor.yy176;
2650
        break;
X
Xiaoyu Wang 已提交
2651
      case 100: /* drop_table_clause ::= exists_opt full_table_name */
2652 2653
{ yylhsminor.yy176 = createDropTableClause(pCxt, yymsp[-1].minor.yy505, yymsp[0].minor.yy176); }
  yymsp[-1].minor.yy176 = yylhsminor.yy176;
2654
        break;
X
Xiaoyu Wang 已提交
2655 2656
      case 101: /* specific_tags_opt ::= */
      case 132: /* tags_def_opt ::= */ yytestcase(yyruleno==132);
2657 2658 2659 2660
      case 298: /* partition_by_clause_opt ::= */ yytestcase(yyruleno==298);
      case 315: /* group_by_clause_opt ::= */ yytestcase(yyruleno==315);
      case 325: /* order_by_clause_opt ::= */ yytestcase(yyruleno==325);
{ yymsp[1].minor.yy512 = NULL; }
2661
        break;
X
Xiaoyu Wang 已提交
2662
      case 102: /* specific_tags_opt ::= NK_LP col_name_list NK_RP */
2663
{ yymsp[-2].minor.yy512 = yymsp[-1].minor.yy512; }
2664
        break;
X
Xiaoyu Wang 已提交
2665
      case 103: /* full_table_name ::= table_name */
2666 2667
{ yylhsminor.yy176 = createRealTableNode(pCxt, NULL, &yymsp[0].minor.yy225, NULL); }
  yymsp[0].minor.yy176 = yylhsminor.yy176;
2668
        break;
X
Xiaoyu Wang 已提交
2669
      case 104: /* full_table_name ::= db_name NK_DOT table_name */
2670 2671
{ yylhsminor.yy176 = createRealTableNode(pCxt, &yymsp[-2].minor.yy225, &yymsp[0].minor.yy225, NULL); }
  yymsp[-2].minor.yy176 = yylhsminor.yy176;
2672
        break;
X
Xiaoyu Wang 已提交
2673 2674 2675 2676 2677
      case 106: /* column_def_list ::= column_def_list NK_COMMA column_def */
      case 149: /* col_name_list ::= col_name_list NK_COMMA col_name */ yytestcase(yyruleno==149);
      case 171: /* func_name_list ::= func_name_list NK_COMMA col_name */ yytestcase(yyruleno==171);
      case 180: /* func_list ::= func_list NK_COMMA func */ yytestcase(yyruleno==180);
      case 205: /* literal_list ::= literal_list NK_COMMA signed_literal */ yytestcase(yyruleno==205);
2678 2679 2680 2681
      case 291: /* select_sublist ::= select_sublist NK_COMMA select_item */ yytestcase(yyruleno==291);
      case 338: /* sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ yytestcase(yyruleno==338);
{ yylhsminor.yy512 = addNodeToList(pCxt, yymsp[-2].minor.yy512, yymsp[0].minor.yy176); }
  yymsp[-2].minor.yy512 = yylhsminor.yy512;
2682
        break;
X
Xiaoyu Wang 已提交
2683
      case 107: /* column_def ::= column_name type_name */
2684 2685
{ yylhsminor.yy176 = createColumnDefNode(pCxt, &yymsp[-1].minor.yy225, yymsp[0].minor.yy448, NULL); }
  yymsp[-1].minor.yy176 = yylhsminor.yy176;
2686
        break;
X
Xiaoyu Wang 已提交
2687
      case 108: /* column_def ::= column_name type_name COMMENT NK_STRING */
2688 2689
{ yylhsminor.yy176 = createColumnDefNode(pCxt, &yymsp[-3].minor.yy225, yymsp[-2].minor.yy448, &yymsp[0].minor.yy0); }
  yymsp[-3].minor.yy176 = yylhsminor.yy176;
2690
        break;
X
Xiaoyu Wang 已提交
2691
      case 109: /* type_name ::= BOOL */
2692
{ yymsp[0].minor.yy448 = createDataType(TSDB_DATA_TYPE_BOOL); }
2693
        break;
X
Xiaoyu Wang 已提交
2694
      case 110: /* type_name ::= TINYINT */
2695
{ yymsp[0].minor.yy448 = createDataType(TSDB_DATA_TYPE_TINYINT); }
2696
        break;
X
Xiaoyu Wang 已提交
2697
      case 111: /* type_name ::= SMALLINT */
2698
{ yymsp[0].minor.yy448 = createDataType(TSDB_DATA_TYPE_SMALLINT); }
2699
        break;
X
Xiaoyu Wang 已提交
2700 2701
      case 112: /* type_name ::= INT */
      case 113: /* type_name ::= INTEGER */ yytestcase(yyruleno==113);
2702
{ yymsp[0].minor.yy448 = createDataType(TSDB_DATA_TYPE_INT); }
2703
        break;
X
Xiaoyu Wang 已提交
2704
      case 114: /* type_name ::= BIGINT */
2705
{ yymsp[0].minor.yy448 = createDataType(TSDB_DATA_TYPE_BIGINT); }
2706
        break;
X
Xiaoyu Wang 已提交
2707
      case 115: /* type_name ::= FLOAT */
2708
{ yymsp[0].minor.yy448 = createDataType(TSDB_DATA_TYPE_FLOAT); }
2709
        break;
X
Xiaoyu Wang 已提交
2710
      case 116: /* type_name ::= DOUBLE */
2711
{ yymsp[0].minor.yy448 = createDataType(TSDB_DATA_TYPE_DOUBLE); }
2712
        break;
X
Xiaoyu Wang 已提交
2713
      case 117: /* type_name ::= BINARY NK_LP NK_INTEGER NK_RP */
2714
{ yymsp[-3].minor.yy448 = createVarLenDataType(TSDB_DATA_TYPE_BINARY, &yymsp[-1].minor.yy0); }
2715
        break;
X
Xiaoyu Wang 已提交
2716
      case 118: /* type_name ::= TIMESTAMP */
2717
{ yymsp[0].minor.yy448 = createDataType(TSDB_DATA_TYPE_TIMESTAMP); }
2718
        break;
X
Xiaoyu Wang 已提交
2719
      case 119: /* type_name ::= NCHAR NK_LP NK_INTEGER NK_RP */
2720
{ yymsp[-3].minor.yy448 = createVarLenDataType(TSDB_DATA_TYPE_NCHAR, &yymsp[-1].minor.yy0); }
2721
        break;
X
Xiaoyu Wang 已提交
2722
      case 120: /* type_name ::= TINYINT UNSIGNED */
2723
{ yymsp[-1].minor.yy448 = createDataType(TSDB_DATA_TYPE_UTINYINT); }
2724
        break;
X
Xiaoyu Wang 已提交
2725
      case 121: /* type_name ::= SMALLINT UNSIGNED */
2726
{ yymsp[-1].minor.yy448 = createDataType(TSDB_DATA_TYPE_USMALLINT); }
2727
        break;
X
Xiaoyu Wang 已提交
2728
      case 122: /* type_name ::= INT UNSIGNED */
2729
{ yymsp[-1].minor.yy448 = createDataType(TSDB_DATA_TYPE_UINT); }
2730
        break;
X
Xiaoyu Wang 已提交
2731
      case 123: /* type_name ::= BIGINT UNSIGNED */
2732
{ yymsp[-1].minor.yy448 = createDataType(TSDB_DATA_TYPE_UBIGINT); }
2733
        break;
X
Xiaoyu Wang 已提交
2734
      case 124: /* type_name ::= JSON */
2735
{ yymsp[0].minor.yy448 = createDataType(TSDB_DATA_TYPE_JSON); }
2736
        break;
X
Xiaoyu Wang 已提交
2737
      case 125: /* type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP */
2738
{ yymsp[-3].minor.yy448 = createVarLenDataType(TSDB_DATA_TYPE_VARCHAR, &yymsp[-1].minor.yy0); }
2739
        break;
X
Xiaoyu Wang 已提交
2740
      case 126: /* type_name ::= MEDIUMBLOB */
2741
{ yymsp[0].minor.yy448 = createDataType(TSDB_DATA_TYPE_MEDIUMBLOB); }
2742
        break;
X
Xiaoyu Wang 已提交
2743
      case 127: /* type_name ::= BLOB */
2744
{ yymsp[0].minor.yy448 = createDataType(TSDB_DATA_TYPE_BLOB); }
2745
        break;
X
Xiaoyu Wang 已提交
2746
      case 128: /* type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP */
2747
{ yymsp[-3].minor.yy448 = createVarLenDataType(TSDB_DATA_TYPE_VARBINARY, &yymsp[-1].minor.yy0); }
2748
        break;
X
Xiaoyu Wang 已提交
2749
      case 129: /* type_name ::= DECIMAL */
2750
{ yymsp[0].minor.yy448 = createDataType(TSDB_DATA_TYPE_DECIMAL); }
2751
        break;
X
Xiaoyu Wang 已提交
2752
      case 130: /* type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP */
2753
{ yymsp[-3].minor.yy448 = createDataType(TSDB_DATA_TYPE_DECIMAL); }
2754
        break;
X
Xiaoyu Wang 已提交
2755
      case 131: /* type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */
2756
{ yymsp[-5].minor.yy448 = createDataType(TSDB_DATA_TYPE_DECIMAL); }
2757
        break;
X
Xiaoyu Wang 已提交
2758
      case 133: /* tags_def_opt ::= tags_def */
2759 2760 2761
      case 289: /* select_list ::= select_sublist */ yytestcase(yyruleno==289);
{ yylhsminor.yy512 = yymsp[0].minor.yy512; }
  yymsp[0].minor.yy512 = yylhsminor.yy512;
2762
        break;
X
Xiaoyu Wang 已提交
2763
      case 134: /* tags_def ::= TAGS NK_LP column_def_list NK_RP */
2764
{ yymsp[-3].minor.yy512 = yymsp[-1].minor.yy512; }
2765
        break;
X
Xiaoyu Wang 已提交
2766
      case 135: /* table_options ::= */
2767
{ yymsp[1].minor.yy176 = createDefaultTableOptions(pCxt); }
2768
        break;
X
Xiaoyu Wang 已提交
2769
      case 136: /* table_options ::= table_options COMMENT NK_STRING */
2770 2771
{ yylhsminor.yy176 = setTableOption(pCxt, yymsp[-2].minor.yy176, TABLE_OPTION_COMMENT, &yymsp[0].minor.yy0); }
  yymsp[-2].minor.yy176 = yylhsminor.yy176;
2772
        break;
X
Xiaoyu Wang 已提交
2773
      case 137: /* table_options ::= table_options KEEP NK_INTEGER */
2774 2775
{ yylhsminor.yy176 = setTableOption(pCxt, yymsp[-2].minor.yy176, TABLE_OPTION_KEEP, &yymsp[0].minor.yy0); }
  yymsp[-2].minor.yy176 = yylhsminor.yy176;
2776
        break;
X
Xiaoyu Wang 已提交
2777
      case 138: /* table_options ::= table_options TTL NK_INTEGER */
2778 2779
{ yylhsminor.yy176 = setTableOption(pCxt, yymsp[-2].minor.yy176, TABLE_OPTION_TTL, &yymsp[0].minor.yy0); }
  yymsp[-2].minor.yy176 = yylhsminor.yy176;
2780
        break;
X
Xiaoyu Wang 已提交
2781
      case 139: /* table_options ::= table_options SMA NK_LP col_name_list NK_RP */
2782 2783
{ yylhsminor.yy176 = setTableSmaOption(pCxt, yymsp[-4].minor.yy176, yymsp[-1].minor.yy512); }
  yymsp[-4].minor.yy176 = yylhsminor.yy176;
2784
        break;
X
Xiaoyu Wang 已提交
2785
      case 140: /* table_options ::= table_options ROLLUP NK_LP func_name_list NK_RP */
2786 2787
{ yylhsminor.yy176 = setTableRollupOption(pCxt, yymsp[-4].minor.yy176, yymsp[-1].minor.yy512); }
  yymsp[-4].minor.yy176 = yylhsminor.yy176;
2788
        break;
X
Xiaoyu Wang 已提交
2789
      case 141: /* table_options ::= table_options FILE_FACTOR NK_FLOAT */
2790 2791
{ yylhsminor.yy176 = setTableOption(pCxt, yymsp[-2].minor.yy176, TABLE_OPTION_FILE_FACTOR, &yymsp[0].minor.yy0); }
  yymsp[-2].minor.yy176 = yylhsminor.yy176;
2792
        break;
X
Xiaoyu Wang 已提交
2793
      case 142: /* table_options ::= table_options DELAY NK_INTEGER */
2794 2795
{ yylhsminor.yy176 = setTableOption(pCxt, yymsp[-2].minor.yy176, TABLE_OPTION_DELAY, &yymsp[0].minor.yy0); }
  yymsp[-2].minor.yy176 = yylhsminor.yy176;
2796
        break;
X
Xiaoyu Wang 已提交
2797
      case 143: /* alter_table_options ::= alter_table_option */
2798 2799
{ yylhsminor.yy176 = createDefaultAlterTableOptions(pCxt); yylhsminor.yy176 = setTableOption(pCxt, yylhsminor.yy176, yymsp[0].minor.yy325.type, &yymsp[0].minor.yy325.val); }
  yymsp[0].minor.yy176 = yylhsminor.yy176;
2800
        break;
X
Xiaoyu Wang 已提交
2801
      case 144: /* alter_table_options ::= alter_table_options alter_table_option */
2802 2803
{ yylhsminor.yy176 = setTableOption(pCxt, yymsp[-1].minor.yy176, yymsp[0].minor.yy325.type, &yymsp[0].minor.yy325.val); }
  yymsp[-1].minor.yy176 = yylhsminor.yy176;
2804
        break;
X
Xiaoyu Wang 已提交
2805
      case 145: /* alter_table_option ::= COMMENT NK_STRING */
2806
{ yymsp[-1].minor.yy325.type = TABLE_OPTION_COMMENT; yymsp[-1].minor.yy325.val = yymsp[0].minor.yy0; }
2807
        break;
X
Xiaoyu Wang 已提交
2808
      case 146: /* alter_table_option ::= KEEP NK_INTEGER */
2809
{ yymsp[-1].minor.yy325.type = TABLE_OPTION_KEEP; yymsp[-1].minor.yy325.val = yymsp[0].minor.yy0; }
2810
        break;
X
Xiaoyu Wang 已提交
2811
      case 147: /* alter_table_option ::= TTL NK_INTEGER */
2812
{ yymsp[-1].minor.yy325.type = TABLE_OPTION_TTL; yymsp[-1].minor.yy325.val = yymsp[0].minor.yy0; }
2813
        break;
X
Xiaoyu Wang 已提交
2814
      case 150: /* col_name ::= column_name */
2815 2816
{ yylhsminor.yy176 = createColumnNode(pCxt, NULL, &yymsp[0].minor.yy225); }
  yymsp[0].minor.yy176 = yylhsminor.yy176;
2817
        break;
X
Xiaoyu Wang 已提交
2818
      case 151: /* cmd ::= SHOW DNODES */
X
Xiaoyu Wang 已提交
2819
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_DNODES_STMT, NULL, NULL); }
2820
        break;
X
Xiaoyu Wang 已提交
2821
      case 152: /* cmd ::= SHOW USERS */
X
Xiaoyu Wang 已提交
2822
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_USERS_STMT, NULL, NULL); }
2823
        break;
X
Xiaoyu Wang 已提交
2824
      case 153: /* cmd ::= SHOW DATABASES */
X
Xiaoyu Wang 已提交
2825
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_DATABASES_STMT, NULL, NULL); }
2826
        break;
X
Xiaoyu Wang 已提交
2827
      case 154: /* cmd ::= SHOW db_name_cond_opt TABLES like_pattern_opt */
2828
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_TABLES_STMT, yymsp[-2].minor.yy176, yymsp[0].minor.yy176); }
2829
        break;
X
Xiaoyu Wang 已提交
2830
      case 155: /* cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt */
2831
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_STABLES_STMT, yymsp[-2].minor.yy176, yymsp[0].minor.yy176); }
2832
        break;
X
Xiaoyu Wang 已提交
2833
      case 156: /* cmd ::= SHOW db_name_cond_opt VGROUPS */
2834
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_VGROUPS_STMT, yymsp[-1].minor.yy176, NULL); }
2835
        break;
X
Xiaoyu Wang 已提交
2836
      case 157: /* cmd ::= SHOW MNODES */
X
Xiaoyu Wang 已提交
2837
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_MNODES_STMT, NULL, NULL); }
2838
        break;
X
Xiaoyu Wang 已提交
2839
      case 158: /* cmd ::= SHOW MODULES */
X
Xiaoyu Wang 已提交
2840
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_MODULES_STMT, NULL, NULL); }
2841
        break;
X
Xiaoyu Wang 已提交
2842
      case 159: /* cmd ::= SHOW QNODES */
X
Xiaoyu Wang 已提交
2843
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_QNODES_STMT, NULL, NULL); }
2844
        break;
X
Xiaoyu Wang 已提交
2845
      case 160: /* cmd ::= SHOW FUNCTIONS */
X
Xiaoyu Wang 已提交
2846
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_FUNCTIONS_STMT, NULL, NULL); }
2847
        break;
X
Xiaoyu Wang 已提交
2848
      case 161: /* cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt */
2849
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_INDEXES_STMT, yymsp[-1].minor.yy176, yymsp[0].minor.yy176); }
2850
        break;
X
Xiaoyu Wang 已提交
2851
      case 162: /* cmd ::= SHOW STREAMS */
X
Xiaoyu Wang 已提交
2852
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_STREAMS_STMT, NULL, NULL); }
2853
        break;
X
Xiaoyu Wang 已提交
2854 2855
      case 163: /* db_name_cond_opt ::= */
      case 168: /* from_db_opt ::= */ yytestcase(yyruleno==168);
2856
{ yymsp[1].minor.yy176 = createDefaultDatabaseCondValue(pCxt); }
X
Xiaoyu Wang 已提交
2857 2858
        break;
      case 164: /* db_name_cond_opt ::= db_name NK_DOT */
2859 2860
{ yylhsminor.yy176 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[-1].minor.yy225); }
  yymsp[-1].minor.yy176 = yylhsminor.yy176;
X
Xiaoyu Wang 已提交
2861 2862 2863
        break;
      case 165: /* like_pattern_opt ::= */
      case 176: /* index_options ::= */ yytestcase(yyruleno==176);
2864 2865 2866 2867 2868 2869 2870 2871
      case 296: /* where_clause_opt ::= */ yytestcase(yyruleno==296);
      case 300: /* twindow_clause_opt ::= */ yytestcase(yyruleno==300);
      case 305: /* sliding_opt ::= */ yytestcase(yyruleno==305);
      case 307: /* fill_opt ::= */ yytestcase(yyruleno==307);
      case 319: /* having_clause_opt ::= */ yytestcase(yyruleno==319);
      case 327: /* slimit_clause_opt ::= */ yytestcase(yyruleno==327);
      case 331: /* limit_clause_opt ::= */ yytestcase(yyruleno==331);
{ yymsp[1].minor.yy176 = NULL; }
X
Xiaoyu Wang 已提交
2872 2873
        break;
      case 166: /* like_pattern_opt ::= LIKE NK_STRING */
2874
{ yymsp[-1].minor.yy176 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0); }
X
Xiaoyu Wang 已提交
2875 2876
        break;
      case 167: /* table_name_cond ::= table_name */
2877 2878
{ yylhsminor.yy176 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy225); }
  yymsp[0].minor.yy176 = yylhsminor.yy176;
X
Xiaoyu Wang 已提交
2879 2880
        break;
      case 169: /* from_db_opt ::= FROM db_name */
2881
{ yymsp[-1].minor.yy176 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy225); }
X
Xiaoyu Wang 已提交
2882 2883
        break;
      case 172: /* func_name ::= function_name */
2884 2885
{ yylhsminor.yy176 = createFunctionNode(pCxt, &yymsp[0].minor.yy225, NULL); }
  yymsp[0].minor.yy176 = yylhsminor.yy176;
X
Xiaoyu Wang 已提交
2886 2887
        break;
      case 173: /* cmd ::= CREATE SMA INDEX not_exists_opt index_name ON table_name index_options */
2888
{ pCxt->pRootNode = createCreateIndexStmt(pCxt, INDEX_TYPE_SMA, yymsp[-4].minor.yy505, &yymsp[-3].minor.yy225, &yymsp[-1].minor.yy225, NULL, yymsp[0].minor.yy176); }
X
Xiaoyu Wang 已提交
2889 2890
        break;
      case 174: /* cmd ::= CREATE FULLTEXT INDEX not_exists_opt index_name ON table_name NK_LP col_name_list NK_RP */
2891
{ pCxt->pRootNode = createCreateIndexStmt(pCxt, INDEX_TYPE_FULLTEXT, yymsp[-6].minor.yy505, &yymsp[-5].minor.yy225, &yymsp[-3].minor.yy225, yymsp[-1].minor.yy512, NULL); }
X
Xiaoyu Wang 已提交
2892 2893
        break;
      case 175: /* cmd ::= DROP INDEX exists_opt index_name ON table_name */
2894
{ pCxt->pRootNode = createDropIndexStmt(pCxt, yymsp[-3].minor.yy505, &yymsp[-2].minor.yy225, &yymsp[0].minor.yy225); }
X
Xiaoyu Wang 已提交
2895 2896
        break;
      case 177: /* index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt */
2897
{ yymsp[-8].minor.yy176 = createIndexOption(pCxt, yymsp[-6].minor.yy512, releaseRawExprNode(pCxt, yymsp[-2].minor.yy176), NULL, yymsp[0].minor.yy176); }
X
Xiaoyu Wang 已提交
2898 2899
        break;
      case 178: /* index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt */
2900
{ yymsp[-10].minor.yy176 = createIndexOption(pCxt, yymsp[-8].minor.yy512, releaseRawExprNode(pCxt, yymsp[-4].minor.yy176), releaseRawExprNode(pCxt, yymsp[-2].minor.yy176), yymsp[0].minor.yy176); }
X
Xiaoyu Wang 已提交
2901 2902
        break;
      case 181: /* func ::= function_name NK_LP expression_list NK_RP */
2903 2904
{ yylhsminor.yy176 = createFunctionNode(pCxt, &yymsp[-3].minor.yy225, yymsp[-1].minor.yy512); }
  yymsp[-3].minor.yy176 = yylhsminor.yy176;
X
Xiaoyu Wang 已提交
2905 2906
        break;
      case 182: /* cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_expression */
2907
{ pCxt->pRootNode = createCreateTopicStmt(pCxt, yymsp[-3].minor.yy505, &yymsp[-2].minor.yy225, yymsp[0].minor.yy176, NULL); }
X
Xiaoyu Wang 已提交
2908 2909
        break;
      case 183: /* cmd ::= CREATE TOPIC not_exists_opt topic_name AS db_name */
2910
{ pCxt->pRootNode = createCreateTopicStmt(pCxt, yymsp[-3].minor.yy505, &yymsp[-2].minor.yy225, NULL, &yymsp[0].minor.yy225); }
X
Xiaoyu Wang 已提交
2911 2912
        break;
      case 184: /* cmd ::= DROP TOPIC exists_opt topic_name */
2913
{ pCxt->pRootNode = createDropTopicStmt(pCxt, yymsp[-1].minor.yy505, &yymsp[0].minor.yy225); }
X
Xiaoyu Wang 已提交
2914 2915
        break;
      case 186: /* literal ::= NK_INTEGER */
2916 2917
{ yylhsminor.yy176 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); }
  yymsp[0].minor.yy176 = yylhsminor.yy176;
X
Xiaoyu Wang 已提交
2918 2919
        break;
      case 187: /* literal ::= NK_FLOAT */
2920 2921
{ yylhsminor.yy176 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0)); }
  yymsp[0].minor.yy176 = yylhsminor.yy176;
X
Xiaoyu Wang 已提交
2922 2923
        break;
      case 188: /* literal ::= NK_STRING */
2924 2925
{ yylhsminor.yy176 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0)); }
  yymsp[0].minor.yy176 = yylhsminor.yy176;
X
Xiaoyu Wang 已提交
2926 2927
        break;
      case 189: /* literal ::= NK_BOOL */
2928 2929
{ yylhsminor.yy176 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0)); }
  yymsp[0].minor.yy176 = yylhsminor.yy176;
X
Xiaoyu Wang 已提交
2930 2931
        break;
      case 190: /* literal ::= TIMESTAMP NK_STRING */
2932 2933
{ yylhsminor.yy176 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0)); }
  yymsp[-1].minor.yy176 = yylhsminor.yy176;
X
Xiaoyu Wang 已提交
2934 2935 2936 2937
        break;
      case 191: /* literal ::= duration_literal */
      case 199: /* signed_literal ::= signed */ yytestcase(yyruleno==199);
      case 215: /* expression ::= literal */ yytestcase(yyruleno==215);
2938 2939 2940 2941 2942 2943 2944 2945 2946 2947 2948 2949 2950 2951 2952
      case 216: /* expression ::= pseudo_column */ yytestcase(yyruleno==216);
      case 217: /* expression ::= column_reference */ yytestcase(yyruleno==217);
      case 220: /* expression ::= subquery */ yytestcase(yyruleno==220);
      case 259: /* boolean_value_expression ::= boolean_primary */ yytestcase(yyruleno==259);
      case 263: /* boolean_primary ::= predicate */ yytestcase(yyruleno==263);
      case 265: /* common_expression ::= expression */ yytestcase(yyruleno==265);
      case 266: /* common_expression ::= boolean_value_expression */ yytestcase(yyruleno==266);
      case 268: /* table_reference_list ::= table_reference */ yytestcase(yyruleno==268);
      case 270: /* table_reference ::= table_primary */ yytestcase(yyruleno==270);
      case 271: /* table_reference ::= joined_table */ yytestcase(yyruleno==271);
      case 275: /* table_primary ::= parenthesized_joined_table */ yytestcase(yyruleno==275);
      case 322: /* query_expression_body ::= query_primary */ yytestcase(yyruleno==322);
      case 324: /* query_primary ::= query_specification */ yytestcase(yyruleno==324);
{ yylhsminor.yy176 = yymsp[0].minor.yy176; }
  yymsp[0].minor.yy176 = yylhsminor.yy176;
X
Xiaoyu Wang 已提交
2953 2954
        break;
      case 192: /* duration_literal ::= NK_VARIABLE */
2955 2956
{ yylhsminor.yy176 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); }
  yymsp[0].minor.yy176 = yylhsminor.yy176;
X
Xiaoyu Wang 已提交
2957 2958
        break;
      case 193: /* signed ::= NK_INTEGER */
2959 2960
{ yylhsminor.yy176 = createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); }
  yymsp[0].minor.yy176 = yylhsminor.yy176;
X
Xiaoyu Wang 已提交
2961 2962
        break;
      case 194: /* signed ::= NK_PLUS NK_INTEGER */
2963
{ yymsp[-1].minor.yy176 = createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0); }
X
Xiaoyu Wang 已提交
2964 2965
        break;
      case 195: /* signed ::= NK_MINUS NK_INTEGER */
X
Xiaoyu Wang 已提交
2966 2967 2968
{ 
                                                                                    SToken t = yymsp[-1].minor.yy0;
                                                                                    t.n = (yymsp[0].minor.yy0.z + yymsp[0].minor.yy0.n) - yymsp[-1].minor.yy0.z;
2969
                                                                                    yylhsminor.yy176 = createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &t);
X
Xiaoyu Wang 已提交
2970
                                                                                  }
2971
  yymsp[-1].minor.yy176 = yylhsminor.yy176;
X
Xiaoyu Wang 已提交
2972
        break;
X
Xiaoyu Wang 已提交
2973
      case 196: /* signed ::= NK_FLOAT */
2974 2975
{ yylhsminor.yy176 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0); }
  yymsp[0].minor.yy176 = yylhsminor.yy176;
X
Xiaoyu Wang 已提交
2976
        break;
X
Xiaoyu Wang 已提交
2977
      case 197: /* signed ::= NK_PLUS NK_FLOAT */
2978
{ yymsp[-1].minor.yy176 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0); }
X
Xiaoyu Wang 已提交
2979
        break;
X
Xiaoyu Wang 已提交
2980
      case 198: /* signed ::= NK_MINUS NK_FLOAT */
X
Xiaoyu Wang 已提交
2981 2982 2983
{ 
                                                                                    SToken t = yymsp[-1].minor.yy0;
                                                                                    t.n = (yymsp[0].minor.yy0.z + yymsp[0].minor.yy0.n) - yymsp[-1].minor.yy0.z;
2984
                                                                                    yylhsminor.yy176 = createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &t);
X
Xiaoyu Wang 已提交
2985
                                                                                  }
2986
  yymsp[-1].minor.yy176 = yylhsminor.yy176;
X
Xiaoyu Wang 已提交
2987
        break;
X
Xiaoyu Wang 已提交
2988
      case 200: /* signed_literal ::= NK_STRING */
2989 2990
{ yylhsminor.yy176 = createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0); }
  yymsp[0].minor.yy176 = yylhsminor.yy176;
2991
        break;
X
Xiaoyu Wang 已提交
2992
      case 201: /* signed_literal ::= NK_BOOL */
2993 2994
{ yylhsminor.yy176 = createValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0); }
  yymsp[0].minor.yy176 = yylhsminor.yy176;
2995
        break;
X
Xiaoyu Wang 已提交
2996
      case 202: /* signed_literal ::= TIMESTAMP NK_STRING */
2997
{ yymsp[-1].minor.yy176 = createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0); }
2998
        break;
X
Xiaoyu Wang 已提交
2999
      case 203: /* signed_literal ::= duration_literal */
3000 3001 3002
      case 336: /* search_condition ::= common_expression */ yytestcase(yyruleno==336);
{ yylhsminor.yy176 = releaseRawExprNode(pCxt, yymsp[0].minor.yy176); }
  yymsp[0].minor.yy176 = yylhsminor.yy176;
X
Xiaoyu Wang 已提交
3003
        break;
3004 3005 3006
      case 218: /* expression ::= function_name NK_LP expression_list NK_RP */
{ yylhsminor.yy176 = createRawExprNodeExt(pCxt, &yymsp[-3].minor.yy225, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-3].minor.yy225, yymsp[-1].minor.yy512)); }
  yymsp[-3].minor.yy176 = yylhsminor.yy176;
X
Xiaoyu Wang 已提交
3007
        break;
3008 3009 3010
      case 219: /* expression ::= function_name NK_LP NK_STAR NK_RP */
{ yylhsminor.yy176 = createRawExprNodeExt(pCxt, &yymsp[-3].minor.yy225, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-3].minor.yy225, createNodeList(pCxt, createColumnNode(pCxt, NULL, &yymsp[-1].minor.yy0)))); }
  yymsp[-3].minor.yy176 = yylhsminor.yy176;
X
Xiaoyu Wang 已提交
3011
        break;
3012 3013 3014 3015
      case 221: /* expression ::= NK_LP expression NK_RP */
      case 264: /* boolean_primary ::= NK_LP boolean_value_expression NK_RP */ yytestcase(yyruleno==264);
{ yylhsminor.yy176 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, releaseRawExprNode(pCxt, yymsp[-1].minor.yy176)); }
  yymsp[-2].minor.yy176 = yylhsminor.yy176;
X
Xiaoyu Wang 已提交
3016
        break;
3017
      case 222: /* expression ::= NK_PLUS expression */
3018
{
3019 3020
                                                                                    SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy176);
                                                                                    yylhsminor.yy176 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, releaseRawExprNode(pCxt, yymsp[0].minor.yy176));
3021
                                                                                  }
3022
  yymsp[-1].minor.yy176 = yylhsminor.yy176;
3023
        break;
3024
      case 223: /* expression ::= NK_MINUS expression */
3025
{
3026 3027
                                                                                    SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy176);
                                                                                    yylhsminor.yy176 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, createOperatorNode(pCxt, OP_TYPE_SUB, releaseRawExprNode(pCxt, yymsp[0].minor.yy176), NULL));
3028
                                                                                  }
3029
  yymsp[-1].minor.yy176 = yylhsminor.yy176;
3030
        break;
3031
      case 224: /* expression ::= expression NK_PLUS expression */
3032
{
3033 3034 3035
                                                                                    SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy176);
                                                                                    SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy176);
                                                                                    yylhsminor.yy176 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_ADD, releaseRawExprNode(pCxt, yymsp[-2].minor.yy176), releaseRawExprNode(pCxt, yymsp[0].minor.yy176))); 
3036
                                                                                  }
3037
  yymsp[-2].minor.yy176 = yylhsminor.yy176;
3038
        break;
3039
      case 225: /* expression ::= expression NK_MINUS expression */
3040
{
3041 3042 3043
                                                                                    SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy176);
                                                                                    SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy176);
                                                                                    yylhsminor.yy176 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_SUB, releaseRawExprNode(pCxt, yymsp[-2].minor.yy176), releaseRawExprNode(pCxt, yymsp[0].minor.yy176))); 
3044
                                                                                  }
3045
  yymsp[-2].minor.yy176 = yylhsminor.yy176;
3046
        break;
3047
      case 226: /* expression ::= expression NK_STAR expression */
3048
{
3049 3050 3051
                                                                                    SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy176);
                                                                                    SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy176);
                                                                                    yylhsminor.yy176 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_MULTI, releaseRawExprNode(pCxt, yymsp[-2].minor.yy176), releaseRawExprNode(pCxt, yymsp[0].minor.yy176))); 
3052
                                                                                  }
3053
  yymsp[-2].minor.yy176 = yylhsminor.yy176;
3054
        break;
3055
      case 227: /* expression ::= expression NK_SLASH expression */
3056
{
3057 3058 3059
                                                                                    SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy176);
                                                                                    SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy176);
                                                                                    yylhsminor.yy176 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_DIV, releaseRawExprNode(pCxt, yymsp[-2].minor.yy176), releaseRawExprNode(pCxt, yymsp[0].minor.yy176))); 
3060
                                                                                  }
3061
  yymsp[-2].minor.yy176 = yylhsminor.yy176;
3062
        break;
3063
      case 228: /* expression ::= expression NK_REM expression */
3064
{
3065 3066 3067
                                                                                    SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy176);
                                                                                    SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy176);
                                                                                    yylhsminor.yy176 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_MOD, releaseRawExprNode(pCxt, yymsp[-2].minor.yy176), releaseRawExprNode(pCxt, yymsp[0].minor.yy176))); 
3068
                                                                                  }
3069 3070 3071 3072 3073 3074 3075 3076 3077 3078 3079 3080 3081 3082 3083 3084 3085 3086 3087 3088 3089 3090 3091 3092 3093 3094 3095 3096 3097 3098
  yymsp[-2].minor.yy176 = yylhsminor.yy176;
        break;
      case 229: /* expression_list ::= expression */
{ yylhsminor.yy512 = createNodeList(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy176)); }
  yymsp[0].minor.yy512 = yylhsminor.yy512;
        break;
      case 230: /* expression_list ::= expression_list NK_COMMA expression */
{ yylhsminor.yy512 = addNodeToList(pCxt, yymsp[-2].minor.yy512, releaseRawExprNode(pCxt, yymsp[0].minor.yy176)); }
  yymsp[-2].minor.yy512 = yylhsminor.yy512;
        break;
      case 231: /* column_reference ::= column_name */
{ yylhsminor.yy176 = createRawExprNode(pCxt, &yymsp[0].minor.yy225, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy225)); }
  yymsp[0].minor.yy176 = yylhsminor.yy176;
        break;
      case 232: /* column_reference ::= table_name NK_DOT column_name */
{ yylhsminor.yy176 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy225, &yymsp[0].minor.yy225, createColumnNode(pCxt, &yymsp[-2].minor.yy225, &yymsp[0].minor.yy225)); }
  yymsp[-2].minor.yy176 = yylhsminor.yy176;
        break;
      case 233: /* pseudo_column ::= NK_UNDERLINE ROWTS */
      case 235: /* pseudo_column ::= NK_UNDERLINE QSTARTTS */ yytestcase(yyruleno==235);
      case 236: /* pseudo_column ::= NK_UNDERLINE QENDTS */ yytestcase(yyruleno==236);
      case 237: /* pseudo_column ::= NK_UNDERLINE WSTARTTS */ yytestcase(yyruleno==237);
      case 238: /* pseudo_column ::= NK_UNDERLINE WENDTS */ yytestcase(yyruleno==238);
      case 239: /* pseudo_column ::= NK_UNDERLINE WDURATION */ yytestcase(yyruleno==239);
{
                                                                                    SToken t = yymsp[-1].minor.yy0;
                                                                                    t.n = (yymsp[0].minor.yy0.z + yymsp[0].minor.yy0.n) - yymsp[-1].minor.yy0.z;
                                                                                    yylhsminor.yy176 = createRawExprNode(pCxt, &t, createFunctionNode(pCxt, &t, NULL));
                                                                                  }
  yymsp[-1].minor.yy176 = yylhsminor.yy176;
X
Xiaoyu Wang 已提交
3099
        break;
3100 3101 3102
      case 234: /* pseudo_column ::= TBNAME */
{ yylhsminor.yy176 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[0].minor.yy0, NULL)); }
  yymsp[0].minor.yy176 = yylhsminor.yy176;
X
Xiaoyu Wang 已提交
3103
        break;
3104 3105
      case 240: /* predicate ::= expression compare_op expression */
      case 245: /* predicate ::= expression in_op in_predicate_value */ yytestcase(yyruleno==245);
3106
{
3107 3108 3109
                                                                                    SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy176);
                                                                                    SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy176);
                                                                                    yylhsminor.yy176 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, yymsp[-1].minor.yy404, releaseRawExprNode(pCxt, yymsp[-2].minor.yy176), releaseRawExprNode(pCxt, yymsp[0].minor.yy176)));
3110
                                                                                  }
3111
  yymsp[-2].minor.yy176 = yylhsminor.yy176;
3112
        break;
3113
      case 241: /* predicate ::= expression BETWEEN expression AND expression */
3114
{
3115 3116 3117
                                                                                    SToken s = getTokenFromRawExprNode(pCxt, yymsp[-4].minor.yy176);
                                                                                    SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy176);
                                                                                    yylhsminor.yy176 = createRawExprNodeExt(pCxt, &s, &e, createBetweenAnd(pCxt, releaseRawExprNode(pCxt, yymsp[-4].minor.yy176), releaseRawExprNode(pCxt, yymsp[-2].minor.yy176), releaseRawExprNode(pCxt, yymsp[0].minor.yy176)));
3118
                                                                                  }
3119
  yymsp[-4].minor.yy176 = yylhsminor.yy176;
3120
        break;
3121
      case 242: /* predicate ::= expression NOT BETWEEN expression AND expression */
3122
{
3123 3124 3125
                                                                                    SToken s = getTokenFromRawExprNode(pCxt, yymsp[-5].minor.yy176);
                                                                                    SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy176);
                                                                                    yylhsminor.yy176 = createRawExprNodeExt(pCxt, &s, &e, createNotBetweenAnd(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy176), releaseRawExprNode(pCxt, yymsp[-5].minor.yy176), releaseRawExprNode(pCxt, yymsp[0].minor.yy176)));
3126
                                                                                  }
3127
  yymsp[-5].minor.yy176 = yylhsminor.yy176;
3128
        break;
3129
      case 243: /* predicate ::= expression IS NULL */
3130
{
3131 3132
                                                                                    SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy176);
                                                                                    yylhsminor.yy176 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NULL, releaseRawExprNode(pCxt, yymsp[-2].minor.yy176), NULL));
3133
                                                                                  }
3134
  yymsp[-2].minor.yy176 = yylhsminor.yy176;
3135
        break;
3136
      case 244: /* predicate ::= expression IS NOT NULL */
3137
{
3138 3139
                                                                                    SToken s = getTokenFromRawExprNode(pCxt, yymsp[-3].minor.yy176);
                                                                                    yylhsminor.yy176 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NOT_NULL, releaseRawExprNode(pCxt, yymsp[-3].minor.yy176), NULL));
3140
                                                                                  }
3141
  yymsp[-3].minor.yy176 = yylhsminor.yy176;
3142
        break;
3143 3144
      case 246: /* compare_op ::= NK_LT */
{ yymsp[0].minor.yy404 = OP_TYPE_LOWER_THAN; }
3145
        break;
3146 3147
      case 247: /* compare_op ::= NK_GT */
{ yymsp[0].minor.yy404 = OP_TYPE_GREATER_THAN; }
3148
        break;
3149 3150
      case 248: /* compare_op ::= NK_LE */
{ yymsp[0].minor.yy404 = OP_TYPE_LOWER_EQUAL; }
3151
        break;
3152 3153
      case 249: /* compare_op ::= NK_GE */
{ yymsp[0].minor.yy404 = OP_TYPE_GREATER_EQUAL; }
3154
        break;
3155 3156
      case 250: /* compare_op ::= NK_NE */
{ yymsp[0].minor.yy404 = OP_TYPE_NOT_EQUAL; }
3157
        break;
3158 3159
      case 251: /* compare_op ::= NK_EQ */
{ yymsp[0].minor.yy404 = OP_TYPE_EQUAL; }
3160
        break;
3161 3162
      case 252: /* compare_op ::= LIKE */
{ yymsp[0].minor.yy404 = OP_TYPE_LIKE; }
3163
        break;
3164 3165
      case 253: /* compare_op ::= NOT LIKE */
{ yymsp[-1].minor.yy404 = OP_TYPE_NOT_LIKE; }
3166
        break;
3167 3168
      case 254: /* compare_op ::= MATCH */
{ yymsp[0].minor.yy404 = OP_TYPE_MATCH; }
3169
        break;
3170 3171
      case 255: /* compare_op ::= NMATCH */
{ yymsp[0].minor.yy404 = OP_TYPE_NMATCH; }
3172
        break;
3173 3174
      case 256: /* in_op ::= IN */
{ yymsp[0].minor.yy404 = OP_TYPE_IN; }
3175
        break;
3176 3177
      case 257: /* in_op ::= NOT IN */
{ yymsp[-1].minor.yy404 = OP_TYPE_NOT_IN; }
3178
        break;
3179 3180 3181
      case 258: /* in_predicate_value ::= NK_LP expression_list NK_RP */
{ yylhsminor.yy176 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, createNodeListNode(pCxt, yymsp[-1].minor.yy512)); }
  yymsp[-2].minor.yy176 = yylhsminor.yy176;
3182
        break;
3183
      case 260: /* boolean_value_expression ::= NOT boolean_primary */
3184
{
3185 3186
                                                                                    SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy176);
                                                                                    yylhsminor.yy176 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_NOT, releaseRawExprNode(pCxt, yymsp[0].minor.yy176), NULL));
3187
                                                                                  }
3188
  yymsp[-1].minor.yy176 = yylhsminor.yy176;
3189
        break;
3190
      case 261: /* boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */
3191
{
3192 3193 3194
                                                                                    SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy176);
                                                                                    SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy176);
                                                                                    yylhsminor.yy176 = createRawExprNodeExt(pCxt, &s, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_OR, releaseRawExprNode(pCxt, yymsp[-2].minor.yy176), releaseRawExprNode(pCxt, yymsp[0].minor.yy176)));
3195
                                                                                  }
3196
  yymsp[-2].minor.yy176 = yylhsminor.yy176;
3197
        break;
3198
      case 262: /* boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */
3199
{
3200 3201 3202
                                                                                    SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy176);
                                                                                    SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy176);
                                                                                    yylhsminor.yy176 = createRawExprNodeExt(pCxt, &s, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_AND, releaseRawExprNode(pCxt, yymsp[-2].minor.yy176), releaseRawExprNode(pCxt, yymsp[0].minor.yy176)));
3203
                                                                                  }
3204
  yymsp[-2].minor.yy176 = yylhsminor.yy176;
3205
        break;
3206 3207 3208 3209
      case 267: /* from_clause ::= FROM table_reference_list */
      case 297: /* where_clause_opt ::= WHERE search_condition */ yytestcase(yyruleno==297);
      case 320: /* having_clause_opt ::= HAVING search_condition */ yytestcase(yyruleno==320);
{ yymsp[-1].minor.yy176 = yymsp[0].minor.yy176; }
3210
        break;
3211 3212 3213
      case 269: /* table_reference_list ::= table_reference_list NK_COMMA table_reference */
{ yylhsminor.yy176 = createJoinTableNode(pCxt, JOIN_TYPE_INNER, yymsp[-2].minor.yy176, yymsp[0].minor.yy176, NULL); }
  yymsp[-2].minor.yy176 = yylhsminor.yy176;
3214
        break;
3215 3216 3217
      case 272: /* table_primary ::= table_name alias_opt */
{ yylhsminor.yy176 = createRealTableNode(pCxt, NULL, &yymsp[-1].minor.yy225, &yymsp[0].minor.yy225); }
  yymsp[-1].minor.yy176 = yylhsminor.yy176;
3218
        break;
3219 3220 3221
      case 273: /* table_primary ::= db_name NK_DOT table_name alias_opt */
{ yylhsminor.yy176 = createRealTableNode(pCxt, &yymsp[-3].minor.yy225, &yymsp[-1].minor.yy225, &yymsp[0].minor.yy225); }
  yymsp[-3].minor.yy176 = yylhsminor.yy176;
3222
        break;
3223 3224 3225
      case 274: /* table_primary ::= subquery alias_opt */
{ yylhsminor.yy176 = createTempTableNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy176), &yymsp[0].minor.yy225); }
  yymsp[-1].minor.yy176 = yylhsminor.yy176;
3226
        break;
3227 3228
      case 276: /* alias_opt ::= */
{ yymsp[1].minor.yy225 = nil_token;  }
3229
        break;
3230 3231 3232
      case 277: /* alias_opt ::= table_alias */
{ yylhsminor.yy225 = yymsp[0].minor.yy225; }
  yymsp[0].minor.yy225 = yylhsminor.yy225;
3233
        break;
3234 3235
      case 278: /* alias_opt ::= AS table_alias */
{ yymsp[-1].minor.yy225 = yymsp[0].minor.yy225; }
3236
        break;
3237 3238 3239
      case 279: /* parenthesized_joined_table ::= NK_LP joined_table NK_RP */
      case 280: /* parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ yytestcase(yyruleno==280);
{ yymsp[-2].minor.yy176 = yymsp[-1].minor.yy176; }
3240
        break;
3241 3242 3243
      case 281: /* joined_table ::= table_reference join_type JOIN table_reference ON search_condition */
{ yylhsminor.yy176 = createJoinTableNode(pCxt, yymsp[-4].minor.yy236, yymsp[-5].minor.yy176, yymsp[-2].minor.yy176, yymsp[0].minor.yy176); }
  yymsp[-5].minor.yy176 = yylhsminor.yy176;
3244
        break;
3245 3246
      case 282: /* join_type ::= */
{ yymsp[1].minor.yy236 = JOIN_TYPE_INNER; }
3247
        break;
3248 3249
      case 283: /* join_type ::= INNER */
{ yymsp[0].minor.yy236 = JOIN_TYPE_INNER; }
3250
        break;
3251
      case 284: /* 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 */
3252
{ 
3253 3254 3255 3256 3257 3258
                                                                                    yymsp[-8].minor.yy176 = createSelectStmt(pCxt, yymsp[-7].minor.yy505, yymsp[-6].minor.yy512, yymsp[-5].minor.yy176);
                                                                                    yymsp[-8].minor.yy176 = addWhereClause(pCxt, yymsp[-8].minor.yy176, yymsp[-4].minor.yy176);
                                                                                    yymsp[-8].minor.yy176 = addPartitionByClause(pCxt, yymsp[-8].minor.yy176, yymsp[-3].minor.yy512);
                                                                                    yymsp[-8].minor.yy176 = addWindowClauseClause(pCxt, yymsp[-8].minor.yy176, yymsp[-2].minor.yy176);
                                                                                    yymsp[-8].minor.yy176 = addGroupByClause(pCxt, yymsp[-8].minor.yy176, yymsp[-1].minor.yy512);
                                                                                    yymsp[-8].minor.yy176 = addHavingClause(pCxt, yymsp[-8].minor.yy176, yymsp[0].minor.yy176);
3259 3260
                                                                                  }
        break;
3261 3262
      case 286: /* set_quantifier_opt ::= DISTINCT */
{ yymsp[0].minor.yy505 = true; }
3263
        break;
3264 3265
      case 287: /* set_quantifier_opt ::= ALL */
{ yymsp[0].minor.yy505 = false; }
3266
        break;
3267 3268
      case 288: /* select_list ::= NK_STAR */
{ yymsp[0].minor.yy512 = NULL; }
3269
        break;
3270
      case 292: /* select_item ::= common_expression */
3271
{
3272 3273
                                                                                    SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy176);
                                                                                    yylhsminor.yy176 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy176), &t);
3274
                                                                                  }
3275
  yymsp[0].minor.yy176 = yylhsminor.yy176;
3276
        break;
3277 3278 3279
      case 293: /* select_item ::= common_expression column_alias */
{ yylhsminor.yy176 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy176), &yymsp[0].minor.yy225); }
  yymsp[-1].minor.yy176 = yylhsminor.yy176;
3280
        break;
3281 3282 3283
      case 294: /* select_item ::= common_expression AS column_alias */
{ yylhsminor.yy176 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy176), &yymsp[0].minor.yy225); }
  yymsp[-2].minor.yy176 = yylhsminor.yy176;
3284
        break;
3285 3286 3287
      case 295: /* select_item ::= table_name NK_DOT NK_STAR */
{ yylhsminor.yy176 = createColumnNode(pCxt, &yymsp[-2].minor.yy225, &yymsp[0].minor.yy0); }
  yymsp[-2].minor.yy176 = yylhsminor.yy176;
3288
        break;
3289 3290 3291 3292
      case 299: /* partition_by_clause_opt ::= PARTITION BY expression_list */
      case 316: /* group_by_clause_opt ::= GROUP BY group_by_list */ yytestcase(yyruleno==316);
      case 326: /* order_by_clause_opt ::= ORDER BY sort_specification_list */ yytestcase(yyruleno==326);
{ yymsp[-2].minor.yy512 = yymsp[0].minor.yy512; }
3293
        break;
3294 3295
      case 301: /* twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP */
{ yymsp[-5].minor.yy176 = createSessionWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy176), releaseRawExprNode(pCxt, yymsp[-1].minor.yy176)); }
3296
        break;
3297 3298
      case 302: /* twindow_clause_opt ::= STATE_WINDOW NK_LP column_reference NK_RP */
{ yymsp[-3].minor.yy176 = createStateWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy176)); }
3299
        break;
3300 3301
      case 303: /* twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt */
{ yymsp[-5].minor.yy176 = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy176), NULL, yymsp[-1].minor.yy176, yymsp[0].minor.yy176); }
3302
        break;
3303 3304
      case 304: /* twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt */
{ yymsp[-7].minor.yy176 = createIntervalWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-5].minor.yy176), releaseRawExprNode(pCxt, yymsp[-3].minor.yy176), yymsp[-1].minor.yy176, yymsp[0].minor.yy176); }
3305
        break;
3306 3307
      case 306: /* sliding_opt ::= SLIDING NK_LP duration_literal NK_RP */
{ yymsp[-3].minor.yy176 = releaseRawExprNode(pCxt, yymsp[-1].minor.yy176); }
3308
        break;
3309 3310
      case 308: /* fill_opt ::= FILL NK_LP fill_mode NK_RP */
{ yymsp[-3].minor.yy176 = createFillNode(pCxt, yymsp[-1].minor.yy142, NULL); }
3311
        break;
3312 3313
      case 309: /* fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP */
{ yymsp[-5].minor.yy176 = createFillNode(pCxt, FILL_MODE_VALUE, createNodeListNode(pCxt, yymsp[-1].minor.yy512)); }
3314
        break;
3315 3316
      case 310: /* fill_mode ::= NONE */
{ yymsp[0].minor.yy142 = FILL_MODE_NONE; }
3317
        break;
3318 3319
      case 311: /* fill_mode ::= PREV */
{ yymsp[0].minor.yy142 = FILL_MODE_PREV; }
3320
        break;
3321 3322
      case 312: /* fill_mode ::= NULL */
{ yymsp[0].minor.yy142 = FILL_MODE_NULL; }
3323
        break;
3324 3325
      case 313: /* fill_mode ::= LINEAR */
{ yymsp[0].minor.yy142 = FILL_MODE_LINEAR; }
3326
        break;
3327 3328
      case 314: /* fill_mode ::= NEXT */
{ yymsp[0].minor.yy142 = FILL_MODE_NEXT; }
3329
        break;
3330 3331 3332
      case 317: /* group_by_list ::= expression */
{ yylhsminor.yy512 = createNodeList(pCxt, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy176))); }
  yymsp[0].minor.yy512 = yylhsminor.yy512;
3333
        break;
3334 3335 3336
      case 318: /* group_by_list ::= group_by_list NK_COMMA expression */
{ yylhsminor.yy512 = addNodeToList(pCxt, yymsp[-2].minor.yy512, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy176))); }
  yymsp[-2].minor.yy512 = yylhsminor.yy512;
3337
        break;
3338
      case 321: /* query_expression ::= query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt */
3339
{ 
3340 3341 3342
                                                                                    yylhsminor.yy176 = addOrderByClause(pCxt, yymsp[-3].minor.yy176, yymsp[-2].minor.yy512);
                                                                                    yylhsminor.yy176 = addSlimitClause(pCxt, yylhsminor.yy176, yymsp[-1].minor.yy176);
                                                                                    yylhsminor.yy176 = addLimitClause(pCxt, yylhsminor.yy176, yymsp[0].minor.yy176);
3343
                                                                                  }
3344
  yymsp[-3].minor.yy176 = yylhsminor.yy176;
3345
        break;
3346 3347 3348
      case 323: /* query_expression_body ::= query_expression_body UNION ALL query_expression_body */
{ yylhsminor.yy176 = createSetOperator(pCxt, SET_OP_TYPE_UNION_ALL, yymsp[-3].minor.yy176, yymsp[0].minor.yy176); }
  yymsp[-3].minor.yy176 = yylhsminor.yy176;
3349
        break;
3350 3351 3352
      case 328: /* slimit_clause_opt ::= SLIMIT NK_INTEGER */
      case 332: /* limit_clause_opt ::= LIMIT NK_INTEGER */ yytestcase(yyruleno==332);
{ yymsp[-1].minor.yy176 = createLimitNode(pCxt, &yymsp[0].minor.yy0, NULL); }
3353
        break;
3354 3355 3356
      case 329: /* slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */
      case 333: /* limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ yytestcase(yyruleno==333);
{ yymsp[-3].minor.yy176 = createLimitNode(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0); }
3357
        break;
3358 3359 3360
      case 330: /* slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */
      case 334: /* limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ yytestcase(yyruleno==334);
{ yymsp[-3].minor.yy176 = createLimitNode(pCxt, &yymsp[0].minor.yy0, &yymsp[-2].minor.yy0); }
3361
        break;
3362 3363 3364
      case 335: /* subquery ::= NK_LP query_expression NK_RP */
{ yylhsminor.yy176 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, yymsp[-1].minor.yy176); }
  yymsp[-2].minor.yy176 = yylhsminor.yy176;
3365
        break;
3366 3367 3368
      case 339: /* sort_specification ::= expression ordering_specification_opt null_ordering_opt */
{ yylhsminor.yy176 = createOrderByExprNode(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy176), yymsp[-1].minor.yy106, yymsp[0].minor.yy465); }
  yymsp[-2].minor.yy176 = yylhsminor.yy176;
3369
        break;
3370 3371
      case 340: /* ordering_specification_opt ::= */
{ yymsp[1].minor.yy106 = ORDER_ASC; }
3372
        break;
3373 3374
      case 341: /* ordering_specification_opt ::= ASC */
{ yymsp[0].minor.yy106 = ORDER_ASC; }
3375
        break;
3376 3377
      case 342: /* ordering_specification_opt ::= DESC */
{ yymsp[0].minor.yy106 = ORDER_DESC; }
3378
        break;
3379 3380
      case 343: /* null_ordering_opt ::= */
{ yymsp[1].minor.yy465 = NULL_ORDER_DEFAULT; }
3381
        break;
3382 3383
      case 344: /* null_ordering_opt ::= NULLS FIRST */
{ yymsp[-1].minor.yy465 = NULL_ORDER_FIRST; }
3384
        break;
3385 3386
      case 345: /* null_ordering_opt ::= NULLS LAST */
{ yymsp[-1].minor.yy465 = NULL_ORDER_LAST; }
3387 3388 3389 3390 3391 3392 3393 3394 3395 3396 3397 3398 3399 3400 3401 3402 3403 3404 3405 3406 3407 3408 3409 3410 3411 3412 3413 3414 3415 3416 3417 3418
        break;
      default:
        break;
/********** End reduce actions ************************************************/
  };
  assert( yyruleno<sizeof(yyRuleInfo)/sizeof(yyRuleInfo[0]) );
  yygoto = yyRuleInfo[yyruleno].lhs;
  yysize = yyRuleInfo[yyruleno].nrhs;
  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 已提交
3419 3420
  ParseARG_FETCH
  ParseCTX_FETCH
3421 3422 3423 3424 3425 3426 3427 3428 3429 3430
#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 已提交
3431 3432
  ParseARG_STORE /* Suppress warning about unused %extra_argument variable */
  ParseCTX_STORE
3433 3434 3435 3436 3437 3438 3439 3440 3441
}
#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 已提交
3442
  ParseTOKENTYPE yyminor         /* The minor type of the error token */
3443
){
X
Xiaoyu Wang 已提交
3444 3445
  ParseARG_FETCH
  ParseCTX_FETCH
3446 3447
#define TOKEN yyminor
/************ Begin %syntax_error code ****************************************/
3448 3449 3450 3451 3452 3453 3454 3455

  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;
3456 3457
  }
/************ End %syntax_error code ******************************************/
X
Xiaoyu Wang 已提交
3458 3459
  ParseARG_STORE /* Suppress warning about unused %extra_argument variable */
  ParseCTX_STORE
3460 3461 3462 3463 3464 3465 3466 3467
}

/*
** The following is executed when the parser accepts
*/
static void yy_accept(
  yyParser *yypParser           /* The parser */
){
X
Xiaoyu Wang 已提交
3468 3469
  ParseARG_FETCH
  ParseCTX_FETCH
3470 3471 3472 3473 3474 3475 3476 3477 3478 3479 3480 3481 3482
#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 已提交
3483 3484
  ParseARG_STORE /* Suppress warning about unused %extra_argument variable */
  ParseCTX_STORE
3485 3486 3487 3488
}

/* The main parser program.
** The first argument is a pointer to a structure obtained from
X
Xiaoyu Wang 已提交
3489
** "ParseAlloc" which describes the current state of the parser.
3490 3491 3492 3493 3494 3495 3496 3497 3498 3499 3500 3501 3502 3503 3504 3505
** 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 已提交
3506
void Parse(
3507 3508
  void *yyp,                   /* The parser */
  int yymajor,                 /* The major token code number */
X
Xiaoyu Wang 已提交
3509 3510
  ParseTOKENTYPE yyminor       /* The value for the token */
  ParseARG_PDECL               /* Optional %extra_argument parameter */
3511 3512 3513 3514 3515 3516 3517 3518 3519 3520
){
  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 已提交
3521 3522
  ParseCTX_FETCH
  ParseARG_STORE
3523 3524 3525 3526 3527 3528 3529 3530 3531 3532 3533 3534 3535 3536 3537 3538 3539 3540 3541 3542 3543 3544 3545 3546

  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 已提交
3547
                        yyminor ParseCTX_PARAM);
3548 3549 3550 3551 3552 3553 3554 3555 3556 3557 3558 3559 3560 3561 3562 3563 3564 3565 3566 3567 3568 3569 3570 3571 3572 3573 3574 3575 3576 3577 3578 3579 3580 3581 3582 3583 3584 3585 3586 3587 3588 3589 3590 3591 3592 3593 3594 3595 3596 3597 3598 3599 3600 3601 3602 3603 3604 3605 3606 3607 3608 3609 3610 3611 3612 3613 3614 3615 3616 3617 3618 3619 3620 3621 3622 3623 3624 3625 3626 3627 3628 3629 3630 3631 3632 3633 3634 3635 3636 3637 3638 3639 3640 3641 3642 3643 3644 3645 3646 3647 3648 3649 3650 3651 3652 3653 3654 3655 3656 3657 3658 3659 3660 3661 3662 3663 3664 3665 3666 3667 3668 3669 3670 3671 3672 3673 3674 3675 3676 3677 3678 3679
    }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 已提交
3680
int ParseFallback(int iToken){
3681 3682 3683 3684 3685 3686 3687 3688 3689
#ifdef YYFALLBACK
  if( iToken<(int)(sizeof(yyFallback)/sizeof(yyFallback[0])) ){
    return yyFallback[iToken];
  }
#else
  (void)iToken;
#endif
  return 0;
}