sql.c 226.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
X
Xiaoyu Wang 已提交
103
#define YYNOCODE 308
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;
X
Xiaoyu Wang 已提交
109 110 111 112 113 114 115 116 117 118 119 120
  ENullOrder yy81;
  SNode* yy168;
  SDataType yy224;
  SAlterOption yy277;
  SNodeList* yy376;
  EFillMode yy382;
  SToken yy393;
  EOperatorType yy436;
  int32_t yy508;
  bool yy537;
  EOrder yy554;
  EJoinType yy596;
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
#define YYNSTATE             521
#define YYNRULE              401
#define YYNRULE_WITH_ACTION  401
X
Xiaoyu Wang 已提交
138
#define YYNTOKEN             202
139 140 141 142 143 144 145 146
#define YY_MAX_SHIFT         520
#define YY_MIN_SHIFTREDUCE   780
#define YY_MAX_SHIFTREDUCE   1180
#define YY_ERROR_ACTION      1181
#define YY_ACCEPT_ACTION     1182
#define YY_NO_ACTION         1183
#define YY_MIN_REDUCE        1184
#define YY_MAX_REDUCE        1584
147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212
/************* End control #defines *******************************************/
#define YY_NLOOKAHEAD ((int)(sizeof(yy_lookahead)/sizeof(yy_lookahead[0])))

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


/* Next are the tables used to determine what action to take based on the
** current state and lookahead token.  These tables are used to implement
** functions that take a state number and lookahead value and return an
** action integer.  
**
** Suppose the action integer is N.  Then the action is determined as
** follows
**
**   0 <= N <= YY_MAX_SHIFT             Shift N.  That is, push the lookahead
**                                      token onto the stack and goto state N.
**
**   N between YY_MIN_SHIFTREDUCE       Shift to an arbitrary state then
**     and YY_MAX_SHIFTREDUCE           reduce by rule N-YY_MIN_SHIFTREDUCE.
**
**   N == YY_ERROR_ACTION               A syntax error has occurred.
**
**   N == YY_ACCEPT_ACTION              The parser accepts its input.
**
**   N == YY_NO_ACTION                  No such action.  Denotes unused
**                                      slots in the yy_action[] table.
**
**   N between YY_MIN_REDUCE            Reduce by rule N-YY_MIN_REDUCE
**     and YY_MAX_REDUCE
**
** The action table is constructed as a single large table named yy_action[].
** Given state S and lookahead X, the action is computed as either:
**
**    (A)   N = yy_action[ yy_shift_ofst[S] + X ]
**    (B)   N = yy_default[S]
**
** The (A) formula is preferred.  The B formula is used instead if
** yy_lookahead[yy_shift_ofst[S]+X] is not equal to X.
**
** The formulas above are for computing the action when the lookahead is
** a terminal symbol.  If the lookahead is a non-terminal (as occurs after
** a reduce action) then the yy_reduce_ofst[] array is used in place of
** the yy_shift_ofst[] array.
**
** The following are the tables generated in this section:
**
**  yy_action[]        A single table containing all actions.
**  yy_lookahead[]     A table containing the lookahead for each entry in
**                     yy_action.  Used to detect hash collisions.
**  yy_shift_ofst[]    For each state, the offset into yy_action for
**                     shifting terminals.
**  yy_reduce_ofst[]   For each state, the offset into yy_action for
**                     shifting non-terminals after a reduce.
**  yy_default[]       Default action for each state.
**
*********** Begin parsing tables **********************************************/
213
#define YY_ACTTAB_COUNT (1496)
214
static const YYACTIONTYPE yy_action[] = {
215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364
 /*     0 */   257,  435,  274, 1452,  269,   52, 1223, 1385,  277,   25,
 /*    10 */   194,  306,   30,   28,  122, 1376, 1378, 1436,   96, 1436,
 /*    20 */   266,  447, 1016, 1436,  448, 1338, 1293, 1469,  369, 1432,
 /*    30 */  1438, 1432, 1438,   72,  431, 1432, 1439,  118, 1014, 1345,
 /*    40 */   354, 1256, 1563,  312,  434,  256, 1289,   11, 1423, 1298,
 /*    50 */  1343,  265, 1230,  415, 1021,  131,  817,  435,  816, 1561,
 /*    60 */    30,   28, 1123, 1386,  229, 1453, 1454, 1458,  266, 1275,
 /*    70 */  1016,    1,   12,  238,   30,   28,  818,  447,  100, 1345,
 /*    80 */   415,  447,  266,  448, 1016,  271, 1014,  345,   30,   28,
 /*    90 */  1343, 1423,   72, 1039,  517,   11,  266,  419, 1016,  360,
 /*   100 */  1014,  368, 1021,  362,  862,  100, 1015,  367, 1298,   11,
 /*   110 */    97,   98,  363,  361, 1014,  364, 1021, 1038, 1345,    1,
 /*   120 */   864,  187, 1509,  414,  278,  413,  448,  209, 1563, 1343,
 /*   130 */  1021,  479,   12,    1, 1227,  310, 1469,  117,   98, 1196,
 /*   140 */  1017,  131,  517,  431, 1036, 1561,  448,    7,  128, 1509,
 /*   150 */  1510, 1298, 1514,  481, 1015,  311,  517, 1020, 1040, 1041,
 /*   160 */  1067, 1068, 1069, 1070, 1071, 1072, 1073, 1074, 1015,  485,
 /*   170 */   517, 1298,  478,  477,  476,  408,  475,  164, 1122,  132,
 /*   180 */   132,  357, 1015,  505,  504,  503,  502,  281, 1017,  501,
 /*   190 */   500,  499,  102,  494,  493,  492,  491,  490,  489,  488,
 /*   200 */   487,  108, 1017,  359,    6, 1020, 1040, 1041, 1067, 1068,
 /*   210 */  1069, 1070, 1071, 1072, 1073, 1074, 1017,  513,  512, 1020,
 /*   220 */  1040, 1041, 1067, 1068, 1069, 1070, 1071, 1072, 1073, 1074,
 /*   230 */  1042, 1040, 1041, 1020, 1040, 1041, 1067, 1068, 1069, 1070,
 /*   240 */  1071, 1072, 1073, 1074, 1147, 1276,   30,   28,  433,   32,
 /*   250 */    31,   29,   27,   26,  266,  132, 1016,  137,  409,   30,
 /*   260 */    28,  237,  305, 1036,  304,  448,   65,  266, 1185, 1016,
 /*   270 */   324,  405, 1014,  336,  317,  402, 1145, 1146, 1148, 1149,
 /*   280 */   101,  132,  337,   50, 1207, 1014,   49, 1290, 1021,   84,
 /*   290 */  1298,  345,   83,   82,   81,   80,   79,   78,   77,   76,
 /*   300 */    75, 1021,  132,  132,  331,    7,  483,  900,  471,  470,
 /*   310 */   469,  904,  468,  906,  907,  467,  909,  464,    7,  915,
 /*   320 */   461,  917,  918,  458,  455,  410,  406,   84,  517, 1423,
 /*   330 */    83,   82,   81,   80,   79,   78,   77,   76,   75, 1118,
 /*   340 */  1015,  517,  189,   32,   31,   29,   27,   26,  366,  365,
 /*   350 */   141,  140,  335, 1015, 1121,  330,  329,  328,  327,  326,
 /*   360 */   448,  323,  322,  321,  320,  316,  315,  314,  313,  318,
 /*   370 */  1177,   29,   27,   26, 1017,   32,   31,   29,   27,   26,
 /*   380 */    32,   31,   29,   27,   26, 1298, 1206, 1017,  486, 1205,
 /*   390 */  1270, 1020, 1040, 1041, 1067, 1068, 1069, 1070, 1071, 1072,
 /*   400 */  1073, 1074,  423, 1137, 1020, 1040, 1041, 1067, 1068, 1069,
 /*   410 */  1070, 1071, 1072, 1073, 1074,  241, 1037,   30,   28,   32,
 /*   420 */    31,   29,   27,   26,  368,  266,  362, 1016, 1204, 1452,
 /*   430 */   367, 1423,  373,   97, 1423,  363,  361, 1176,  364, 1287,
 /*   440 */  1055,  448,   52, 1014, 1452, 1563,  448,  381, 1086,  270,
 /*   450 */   344, 1274,  382, 1469,  241, 1295,  474,  115, 1562, 1021,
 /*   460 */   431,  166, 1561, 1294,  376, 1300, 1298,   59, 1469,  370,
 /*   470 */   434, 1298,  165, 1423, 1423,  418,    1,  448,  497,  419,
 /*   480 */  1203, 1202,  300, 1563, 1201,  434,  445, 1086, 1291, 1423,
 /*   490 */   228, 1453, 1454, 1458, 1087,  114,  131,  483,   42,  517,
 /*   500 */  1561,   41, 1298, 1200, 1088,   69, 1453, 1454, 1458, 1502,
 /*   510 */  1563, 1015, 1091,  259, 1498,  126,  276, 1283,    9,    8,
 /*   520 */  1182, 1373, 1092,  131,  115, 1423, 1423, 1561,  139, 1423,
 /*   530 */   116,  424, 1300, 1087, 1530,  222,   24,  264, 1081, 1082,
 /*   540 */  1083, 1084, 1085, 1089, 1090, 1017,   22,  220, 1423, 1199,
 /*   550 */  1198, 1091,   32,   31,   29,   27,   26,  142,  498,  496,
 /*   560 */  1285, 1452, 1020, 1040, 1041, 1067, 1068, 1069, 1070, 1071,
 /*   570 */  1072, 1073, 1074,  282, 1452,   24,  264, 1081, 1082, 1083,
 /*   580 */  1084, 1085, 1089, 1090,  422, 1469,  390,  273,  272, 1099,
 /*   590 */  1516,  448,  431,  115, 1423, 1423, 1516, 1029, 1469, 1345,
 /*   600 */   446, 1301,  434,  415, 1563,  431, 1423, 1195, 1513,  448,
 /*   610 */  1377,  419, 1055, 1022, 1512,  434, 1298,  131,  208, 1423,
 /*   620 */    67, 1561,   68, 1453, 1454, 1458, 1502, 1043,  100, 1021,
 /*   630 */   240, 1498,  279, 1281, 1298,   70, 1453, 1454, 1458, 1502,
 /*   640 */   115,  816, 1563, 1501, 1498,   48,   47,  309, 1300,  136,
 /*   650 */  1194,  169, 1423, 1193,  303,  131, 1218,  352, 1192, 1561,
 /*   660 */   250,   98,  246,  520,  295, 1452,  291,  287,  133,  449,
 /*   670 */   417,  127, 1509, 1510,  432, 1514, 1516,  213,  371, 1345,
 /*   680 */    95, 1025, 1412,  164, 1521, 1118,  509,  357,  212, 1469,
 /*   690 */  1344,  132, 1191, 1190, 1511, 1423,  418,  426, 1423,  251,
 /*   700 */  1452,  249,  248, 1423,  356, 1189,  434, 1188,  430,  359,
 /*   710 */  1423, 1187,  380,  216,   66, 1030, 1328,  206,  289,   32,
 /*   720 */    31,   29,   27,   26, 1469,  378,   69, 1453, 1454, 1458,
 /*   730 */  1502,  431, 1033,  473,  259, 1498,  126, 1423, 1423,  175,
 /*   740 */   157,  434, 1452,  155,  297, 1423, 1216,  444,  190,  448,
 /*   750 */  1423, 1130, 1423, 1452,  398, 1529, 1423, 1038,  280,  299,
 /*   760 */  1197,   69, 1453, 1454, 1458, 1502, 1469, 1257,  374,  259,
 /*   770 */  1498, 1575,  397,  431, 1298,  171,  421, 1469, 1452,  159,
 /*   780 */  1536,  191,  158,  434,  431,  161,  163, 1423,  160,  162,
 /*   790 */  1000,  106,  168,  403,  434,  394,    9,    8, 1423,  415,
 /*   800 */   391,  399, 1469,   69, 1453, 1454, 1458, 1502,  340,  431,
 /*   810 */  1024,  259, 1498, 1575,  233, 1453, 1454, 1458, 1078,  434,
 /*   820 */   389, 1452, 1559, 1423,  100,   44,  178,   33,  427, 1144,
 /*   830 */   180, 1093, 1452,   33, 1179, 1180, 1023, 1051, 1016,   69,
 /*   840 */  1453, 1454, 1458, 1502,  392, 1469,   33,  259, 1498, 1575,
 /*   850 */   983,  197,  431, 1339, 1014,  199, 1469,   98, 1520,  184,
 /*   860 */  1443,   94,  434,  431, 1532,  440, 1423,  129, 1509, 1510,
 /*   870 */  1021, 1514, 1441,  434, 1452, 1563,  104, 1423, 1027,  351,
 /*   880 */   205,  416,   70, 1453, 1454, 1458, 1502, 1470,  131,    2,
 /*   890 */   429, 1498, 1561,  119, 1453, 1454, 1458,  106, 1469,   44,
 /*   900 */   193,  893, 1452,  888, 1026,  431, 1036,  453,  104,  105,
 /*   910 */   517,  921,  925,  931,  284,  434,  106,  288,  152, 1423,
 /*   920 */   930,  125, 1015,  245,  104,  836, 1469,  350,  107,  151,
 /*   930 */  1452,  420, 1576,  431,  862,   70, 1453, 1454, 1458, 1502,
 /*   940 */    64,  837,  247,  434, 1499,  992,  214, 1423,  333,  319,
 /*   950 */    61, 1375,  138,  325, 1469,   53, 1017,  332,  149, 1452,
 /*   960 */   334,  431,  338,  232, 1453, 1454, 1458,   21, 1047, 1046,
 /*   970 */   341,  434,  339, 1020,  144, 1423, 1045,   32,   31,   29,
 /*   980 */    27,   26,  343, 1469, 1452,  342,  147,   51,  346,  150,
 /*   990 */   431,  119, 1453, 1454, 1458,  411, 1044,  353,  355, 1288,
 /*  1000 */   434,  358,   74,  255, 1423,  384,  385,  263, 1469,  154,
 /*  1010 */  1284,  156,  148,  109,  121,  431,  145,  110, 1452,  386,
 /*  1020 */   233, 1453, 1454, 1458,   23,  434, 1184,  170, 1286, 1423,
 /*  1030 */  1577, 1282,  267,  143,   32,   31,   29,   27,   26,  111,
 /*  1040 */   112,  383, 1469,  173,  396,  233, 1453, 1454, 1458,  431,
 /*  1050 */    93,   92,   91,   90,   89,   88,   87,   86,   85,  434,
 /*  1060 */   393,  395, 1452, 1423, 1043, 1533,  404, 1543, 1452,  438,
 /*  1070 */   176, 1021,  179,  401,  258,  412,  407,  183,    5,  225,
 /*  1080 */  1453, 1454, 1458, 1542,  400, 1523, 1469,    4, 1118,   99,
 /*  1090 */  1042,  124, 1469,  431, 1517,   34, 1452,  186,  185,  431,
 /*  1100 */    17,  260,  428,  434, 1452,  425, 1560, 1423,  436,  434,
 /*  1110 */  1578, 1484, 1384, 1423,  437,  192, 1383,  268,  441,  442,
 /*  1120 */  1469,  443,  203,  231, 1453, 1454, 1458,  431, 1469,  234,
 /*  1130 */  1453, 1454, 1458,  201,   58,  431,  215,  434, 1452, 1299,
 /*  1140 */   451, 1423,   60,  480, 1271,  434, 1273,  217,  211, 1423,
 /*  1150 */  1452,  516,   40,  223,  224,  219,  221,  226, 1453, 1454,
 /*  1160 */  1458, 1417, 1469, 1416,  283,  235, 1453, 1454, 1458,  431,
 /*  1170 */  1413,  285,  286, 1010, 1469, 1011,  134,  290, 1411,  434,
 /*  1180 */   292,  431,  293, 1423,  294, 1410,  296, 1409,  298, 1400,
 /*  1190 */   135,  434,  301,  302,  995, 1423, 1452,  994, 1394,  227,
 /*  1200 */  1453, 1454, 1458, 1393,  209,  307, 1392, 1391,  479,  308,
 /*  1210 */   966,  236, 1453, 1454, 1458, 1368, 1367, 1366, 1365, 1364,
 /*  1220 */  1469, 1452, 1363, 1362, 1361, 1360, 1359,  431, 1358, 1357,
 /*  1230 */   481, 1356, 1452,  103, 1355, 1354, 1353,  434, 1352, 1351,
 /*  1240 */  1350, 1423,  968, 1349, 1348, 1469, 1347, 1346, 1229,  478,
 /*  1250 */   477,  476,  431,  475, 1408, 1402, 1469, 1466, 1453, 1454,
 /*  1260 */  1458, 1390,  434,  431, 1381, 1277, 1423, 1228, 1452,  829,
 /*  1270 */   146, 1226, 1215,  434, 1452,  347,  349, 1423,  348, 1214,
 /*  1280 */  1211, 1279, 1465, 1453, 1454, 1458, 1278,  153,   73,  938,
 /*  1290 */   936,  861, 1469,  243, 1453, 1454, 1458,  860, 1469,  431,
 /*  1300 */   497,  859, 1452, 1224,  858,  431,  252,  855,  854,  434,
 /*  1310 */  1452, 1219,  253, 1423,  372,  434, 1217,  495,  254, 1423,
 /*  1320 */   375, 1210,  377, 1209,  379,   71, 1469, 1407,   43, 1464,
 /*  1330 */  1453, 1454, 1458,  431, 1469,  244, 1453, 1454, 1458,  167,
 /*  1340 */  1401,  431, 1002,  434, 1452,  113,  387, 1423, 1389, 1388,
 /*  1350 */  1380,  434,  172,    3,   54, 1423,   33,   14,   15,  177,
 /*  1360 */    38, 1143,  388,  242, 1453, 1454, 1458, 1136, 1469,  120,
 /*  1370 */   123,  239, 1453, 1454, 1458,  431,  182,   37,  181,  174,
 /*  1380 */  1441,   19,   20,   55,  188,  434,   56, 1115,   35, 1423,
 /*  1390 */  1114, 1170, 1165,   36,   16,   10,  130, 1164,  261, 1169,
 /*  1400 */  1168,  262,    8,  195, 1053,  230, 1453, 1454, 1458, 1052,
 /*  1410 */    13, 1379,   18, 1079,  196, 1141,  198,  200,   45,  202,
 /*  1420 */   204,  439,   57, 1031,  452,   61,   39,  275,  456,  922,
 /*  1430 */   919,  459,  462,  465,  914, 1440,  207,  454,  450,  457,
 /*  1440 */   899,  916,  460,  933,  910,  463,  929,  908,  466,   62,
 /*  1450 */    46,   63,  927,  482,  472,  827,  868,  484,  850,  210,
 /*  1460 */   913,  912,  849,  911,  848,  847,  846,  845,  843,  844,
 /*  1470 */   865,  863,  840,  839,  838,  835,  834,  833,  832,  932,
 /*  1480 */  1225,  506, 1213,  507,  508, 1212,  510,  511, 1208,  514,
 /*  1490 */   515, 1183, 1018,  218,  518,  519,
365 366
};
static const YYCODETYPE yy_lookahead[] = {
X
Xiaoyu Wang 已提交
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
 /*     0 */   233,  246,  233,  205,  249,  213,    0,  252,  238,  271,
 /*    10 */   272,  255,   12,   13,  228,  245,  246,  250,  226,  250,
 /*    20 */    20,   20,   22,  250,  211,  239,  234,  229,   22,  262,
 /*    30 */   263,  262,  263,  220,  236,  262,  263,  214,   38,  229,
 /*    40 */   227,  218,  286,  211,  246,  235,  205,   47,  250,  236,
 /*    50 */   240,  253,    0,  211,   54,  299,   20,  246,   22,  303,
 /*    60 */    12,   13,   14,  252,  266,  267,  268,  269,   20,    0,
 /*    70 */    22,   71,   71,  241,   12,   13,   40,   20,  236,  229,
 /*    80 */   211,   20,   20,  211,   22,  235,   38,   46,   12,   13,
 /*    90 */   240,  250,  220,   20,   94,   47,   20,  255,   22,  227,
 /*   100 */    38,   49,   54,   51,   38,  236,  106,   55,  236,   47,
 /*   110 */    58,  269,   60,   61,   38,   63,   54,   20,  229,   71,
 /*   120 */    54,  279,  280,  281,  235,  283,  211,   58,  286,  240,
 /*   130 */    54,   62,   71,   71,    0,  220,  229,  204,  269,  206,
 /*   140 */   140,  299,   94,  236,   20,  303,  211,   71,  279,  280,
 /*   150 */   281,  236,  283,   84,  106,  220,   94,  157,  158,  159,
 /*   160 */   160,  161,  162,  163,  164,  165,  166,  167,  106,   54,
 /*   170 */    94,  236,  103,  104,  105,  268,  107,   58,    4,  179,
 /*   180 */   179,   62,  106,   49,   50,   51,   52,   53,  140,   55,
 /*   190 */    56,   57,   58,   59,   60,   61,   62,   63,   64,   65,
 /*   200 */    66,   67,  140,   84,   43,  157,  158,  159,  160,  161,
 /*   210 */   162,  163,  164,  165,  166,  167,  140,  208,  209,  157,
 /*   220 */   158,  159,  160,  161,  162,  163,  164,  165,  166,  167,
 /*   230 */    20,  158,  159,  157,  158,  159,  160,  161,  162,  163,
 /*   240 */   164,  165,  166,  167,  157,    0,   12,   13,   14,   12,
 /*   250 */    13,   14,   15,   16,   20,  179,   22,   44,   20,   12,
 /*   260 */    13,   18,  139,   20,  141,  211,  210,   20,    0,   22,
 /*   270 */    27,  130,   38,   30,  220,  188,  189,  190,  191,  192,
 /*   280 */   224,  179,   39,   70,  205,   38,   73,  231,   54,   21,
 /*   290 */   236,   46,   24,   25,   26,   27,   28,   29,   30,   31,
 /*   300 */    32,   54,  179,  179,   64,   71,   46,   85,   86,   87,
 /*   310 */    88,   89,   90,   91,   92,   93,   94,   95,   71,   97,
 /*   320 */    98,   99,  100,  101,  102,  184,  185,   21,   94,  250,
 /*   330 */    24,   25,   26,   27,   28,   29,   30,   31,   32,  178,
 /*   340 */   106,   94,  132,   12,   13,   14,   15,   16,  215,  216,
 /*   350 */   110,  111,  109,  106,  180,  112,  113,  114,  115,  116,
 /*   360 */   211,  118,  119,  120,  121,  122,  123,  124,  125,  220,
404
 /*   370 */   133,   14,   15,   16,  140,   12,   13,   14,   15,   16,
X
Xiaoyu Wang 已提交
405 406 407
 /*   380 */    12,   13,   14,   15,   16,  236,  205,  140,  217,  205,
 /*   390 */   219,  157,  158,  159,  160,  161,  162,  163,  164,  165,
 /*   400 */   166,  167,   68,   72,  157,  158,  159,  160,  161,  162,
408
 /*   410 */   163,  164,  165,  166,  167,   47,   20,   12,   13,   12,
X
Xiaoyu Wang 已提交
409
 /*   420 */    13,   14,   15,   16,   49,   20,   51,   22,  205,  205,
410 411 412 413 414 415 416
 /*   430 */    55,  250,    4,   58,  250,   60,   61,  200,   63,  230,
 /*   440 */    72,  211,  213,   38,  205,  286,  211,   19,   80,  221,
 /*   450 */   220,    0,  255,  229,   47,  220,   82,  229,  299,   54,
 /*   460 */   236,   33,  303,  234,   36,  237,  236,  210,  229,   41,
 /*   470 */   246,  236,   44,  250,  250,  236,   71,  211,   68,  255,
 /*   480 */   205,  205,   72,  286,  205,  246,  220,   80,  231,  250,
 /*   490 */   266,  267,  268,  269,  126,  132,  299,   46,   70,   94,
X
Xiaoyu Wang 已提交
417
 /*   500 */   303,   73,  236,  205,  126,  266,  267,  268,  269,  270,
418 419
 /*   510 */   286,  106,  144,  274,  275,  276,  221,  230,    1,    2,
 /*   520 */   202,  236,  144,  299,  229,  250,  250,  303,  243,  250,
X
Xiaoyu Wang 已提交
420 421
 /*   530 */    18,  197,  237,  126,  295,   23,  168,  169,  170,  171,
 /*   540 */   172,  173,  174,  175,  176,  140,  168,   35,  250,  205,
422
 /*   550 */   205,  144,   12,   13,   14,   15,   16,   45,  215,  216,
X
Xiaoyu Wang 已提交
423 424
 /*   560 */   230,  205,  157,  158,  159,  160,  161,  162,  163,  164,
 /*   570 */   165,  166,  167,  255,  205,  168,  169,  170,  171,  172,
425 426
 /*   580 */   173,  174,  175,  176,    3,  229,  258,   12,   13,   72,
 /*   590 */   264,  211,  236,  229,  250,  250,  264,   22,  229,  229,
X
Xiaoyu Wang 已提交
427
 /*   600 */   220,  237,  246,  211,  286,  236,  250,  205,  282,  211,
428 429 430
 /*   610 */   240,  255,   72,   38,  282,  246,  236,  299,  220,  250,
 /*   620 */   108,  303,  266,  267,  268,  269,  270,   20,  236,   54,
 /*   630 */   274,  275,  221,  230,  236,  266,  267,  268,  269,  270,
X
Xiaoyu Wang 已提交
431
 /*   640 */   229,   22,  286,  274,  275,  133,  134,  135,  237,  137,
432
 /*   650 */   205,  230,  250,  205,  142,  299,    0,   38,  205,  303,
X
Xiaoyu Wang 已提交
433
 /*   660 */    35,  269,  150,   19,  152,  205,  154,  155,  156,   94,
434 435 436 437 438 439 440 441 442 443 444 445 446 447
 /*   670 */   278,  279,  280,  281,  230,  283,  264,   33,   22,  229,
 /*   680 */    36,  106,    0,   58,  177,  178,   42,   62,   44,  229,
 /*   690 */   240,  179,  205,  205,  282,  250,  236,   68,  250,   74,
 /*   700 */   205,   76,   77,  250,   79,  205,  246,  205,   47,   84,
 /*   710 */   250,  205,   21,  222,   70,  140,  225,   73,   36,   12,
 /*   720 */    13,   14,   15,   16,  229,   34,  266,  267,  268,  269,
 /*   730 */   270,  236,  157,  230,  274,  275,  276,  250,  250,  132,
 /*   740 */    75,  246,  205,   78,  136,  250,    0,  103,  288,  211,
 /*   750 */   250,   14,  250,  205,  294,  295,  250,   20,  220,  151,
 /*   760 */   206,  266,  267,  268,  269,  270,  229,  218,   22,  274,
 /*   770 */   275,  276,  128,  236,  236,  131,  195,  229,  205,   75,
 /*   780 */   285,  306,   78,  246,  236,   75,   75,  250,   78,   78,
 /*   790 */   146,   68,  148,  297,  246,   72,    1,    2,  250,  211,
 /*   800 */   211,  253,  229,  266,  267,  268,  269,  270,  246,  236,
X
Xiaoyu Wang 已提交
448
 /*   810 */    38,  274,  275,  276,  266,  267,  268,  269,  157,  246,
449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471
 /*   820 */   246,  205,  285,  250,  236,   68,   68,   68,  199,   72,
 /*   830 */    72,   72,  205,   68,  158,  159,   38,   72,   22,  266,
 /*   840 */   267,  268,  269,  270,  255,  229,   68,  274,  275,  276,
 /*   850 */    72,   68,  236,  239,   38,   72,  229,  269,  285,  291,
 /*   860 */    71,   68,  246,  236,  265,   72,  250,  279,  280,  281,
 /*   870 */    54,  283,   83,  246,  205,  286,   68,  250,  106,  208,
 /*   880 */    72,  284,  266,  267,  268,  269,  270,  229,  299,  287,
 /*   890 */   274,  275,  303,  266,  267,  268,  269,   68,  229,   68,
 /*   900 */   300,   72,  205,   72,  106,  236,   20,   68,   68,   68,
 /*   910 */    94,   72,   72,   72,  211,  246,   68,   36,   33,  250,
 /*   920 */    72,   36,  106,  261,   68,   38,  229,   42,   72,   44,
 /*   930 */   205,  304,  305,  236,   38,  266,  267,  268,  269,  270,
 /*   940 */    71,   54,  215,  246,  275,  138,  256,  250,  126,  211,
 /*   950 */    81,  211,  117,  244,  229,   70,  140,  242,   73,  205,
 /*   960 */   242,  236,  211,  266,  267,  268,  269,    2,   20,   20,
 /*   970 */   254,  246,  260,  157,  213,  250,   20,   12,   13,   14,
 /*   980 */    15,   16,  247,  229,  205,  236,  213,  213,  211,  213,
 /*   990 */   236,  266,  267,  268,  269,  298,   20,  207,  229,  229,
 /*  1000 */   246,  215,  211,  207,  250,  260,  147,  253,  229,  229,
 /*  1010 */   229,  229,  127,  229,  129,  236,  131,  229,  205,  259,
 /*  1020 */   266,  267,  268,  269,    2,  246,    0,  210,  229,  250,
 /*  1030 */   305,  229,  253,  148,   12,   13,   14,   15,   16,  229,
 /*  1040 */   229,  236,  229,  210,  247,  266,  267,  268,  269,  236,
X
Xiaoyu Wang 已提交
472
 /*  1050 */    24,   25,   26,   27,   28,   29,   30,   31,   32,  246,
473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491
 /*  1060 */   254,  236,  205,  250,   20,  265,  187,  296,  205,  186,
 /*  1070 */   251,   54,  251,  250,  250,  193,  250,  292,  194,  266,
 /*  1080 */   267,  268,  269,  296,  182,  293,  229,  181,  178,  236,
 /*  1090 */    20,  290,  229,  236,  264,  117,  205,  277,  289,  236,
 /*  1100 */    71,  201,  198,  246,  205,  196,  302,  250,  250,  246,
 /*  1110 */   307,  273,  251,  250,  250,  301,  251,  250,  129,  248,
 /*  1120 */   229,  247,  210,  266,  267,  268,  269,  236,  229,  266,
 /*  1130 */   267,  268,  269,  236,  210,  236,  225,  246,  205,  236,
 /*  1140 */   232,  250,   71,  215,  219,  246,    0,  211,  210,  250,
 /*  1150 */   205,  207,  257,  223,  223,  212,  203,  266,  267,  268,
 /*  1160 */   269,    0,  229,    0,   61,  266,  267,  268,  269,  236,
 /*  1170 */     0,   38,  153,   38,  229,   38,   38,  153,    0,  246,
 /*  1180 */    38,  236,   38,  250,  153,    0,   38,    0,   38,    0,
 /*  1190 */    71,  246,  144,  143,  106,  250,  205,  140,    0,  266,
 /*  1200 */   267,  268,  269,    0,   58,   50,    0,    0,   62,  136,
 /*  1210 */    83,  266,  267,  268,  269,    0,    0,    0,    0,    0,
 /*  1220 */   229,  205,    0,    0,    0,    0,    0,  236,    0,    0,
 /*  1230 */    84,    0,  205,  117,    0,    0,    0,  246,    0,    0,
 /*  1240 */     0,  250,   22,    0,    0,  229,    0,    0,    0,  103,
X
Xiaoyu Wang 已提交
492
 /*  1250 */   104,  105,  236,  107,    0,    0,  229,  266,  267,  268,
493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516
 /*  1260 */   269,    0,  246,  236,    0,    0,  250,    0,  205,   48,
 /*  1270 */    43,    0,    0,  246,  205,   38,   43,  250,   36,    0,
 /*  1280 */     0,    0,  266,  267,  268,  269,    0,   78,   80,   38,
 /*  1290 */    22,   38,  229,  266,  267,  268,  269,   38,  229,  236,
 /*  1300 */    68,   38,  205,    0,   38,  236,   22,   38,   38,  246,
 /*  1310 */   205,    0,   22,  250,   39,  246,    0,   68,   22,  250,
 /*  1320 */    38,    0,   22,    0,   22,   20,  229,    0,  132,  266,
 /*  1330 */   267,  268,  269,  236,  229,  266,  267,  268,  269,  149,
 /*  1340 */     0,  236,   38,  246,  205,  145,   22,  250,    0,    0,
 /*  1350 */     0,  246,   43,   68,   71,  250,   68,  183,  183,   72,
 /*  1360 */    68,   72,  132,  266,  267,  268,  269,   72,  229,   71,
 /*  1370 */   129,  266,  267,  268,  269,  236,   68,  132,   71,  127,
 /*  1380 */    83,   71,   68,   71,   83,  246,    4,   72,  177,  250,
 /*  1390 */    72,   72,   38,   68,   68,  183,   83,   38,   38,   38,
 /*  1400 */    38,   38,    2,   83,   72,  266,  267,  268,  269,   72,
 /*  1410 */    71,    0,   71,  157,   72,   72,   71,   71,   71,   43,
 /*  1420 */   127,  130,   71,   22,   38,   81,   71,   38,   38,   72,
 /*  1430 */    72,   38,   38,   38,   96,   83,   83,   71,   82,   71,
 /*  1440 */    22,   72,   71,   38,   72,   71,   38,   72,   71,   71,
 /*  1450 */    71,   71,   22,   47,   84,   48,   54,   69,   38,   68,
 /*  1460 */    96,   96,   38,   96,   38,   38,   38,   38,   22,   38,
 /*  1470 */    54,   38,   38,   38,   38,   38,   38,   38,   38,  106,
 /*  1480 */     0,   38,    0,   36,   43,    0,   38,   37,    0,   22,
 /*  1490 */    21,  308,   22,   22,   21,   20,  308,  308,  308,  308,
X
Xiaoyu Wang 已提交
517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533
 /*  1500 */   308,  308,  308,  308,  308,  308,  308,  308,  308,  308,
 /*  1510 */   308,  308,  308,  308,  308,  308,  308,  308,  308,  308,
 /*  1520 */   308,  308,  308,  308,  308,  308,  308,  308,  308,  308,
 /*  1530 */   308,  308,  308,  308,  308,  308,  308,  308,  308,  308,
 /*  1540 */   308,  308,  308,  308,  308,  308,  308,  308,  308,  308,
 /*  1550 */   308,  308,  308,  308,  308,  308,  308,  308,  308,  308,
 /*  1560 */   308,  308,  308,  308,  308,  308,  308,  308,  308,  308,
 /*  1570 */   308,  308,  308,  308,  308,  308,  308,  308,  308,  308,
 /*  1580 */   308,  308,  308,  308,  308,  308,  308,  308,  308,  308,
 /*  1590 */   308,  308,  308,  308,  308,  308,  308,  308,  308,  308,
 /*  1600 */   308,  308,  308,  308,  308,  308,  308,  308,  308,  308,
 /*  1610 */   308,  308,  308,  308,  308,  308,  308,  308,  308,  308,
 /*  1620 */   308,  308,  308,  308,  308,  308,  308,  308,  308,  308,
 /*  1630 */   308,  308,  308,  308,  308,  308,  308,  308,  308,  308,
 /*  1640 */   308,  308,  308,  308,  308,  308,  308,  308,  308,  308,
 /*  1650 */   308,  308,  308,  308,  308,  308,  308,  308,  308,  308,
 /*  1660 */   308,  308,  308,  308,  308,  308,  308,  308,  308,  308,
X
Xiaoyu Wang 已提交
534 535
 /*  1670 */   308,  308,  308,  308,  308,  308,  308,  308,  308,  308,
 /*  1680 */   308,  308,  308,  308,  308,  308,  308,  308,  308,  308,
536
 /*  1690 */   308,  308,  308,  308,  308,  308,  308,  308,
537
};
538
#define YY_SHIFT_COUNT    (520)
539
#define YY_SHIFT_MIN      (0)
540
#define YY_SHIFT_MAX      (1488)
541
static const unsigned short int yy_shift_ofst[] = {
X
Xiaoyu Wang 已提交
542 543 544 545 546 547 548 549 550 551
 /*     0 */   512,    0,   48,   62,   62,   62,   62,   76,   62,   62,
 /*    10 */   247,  405,    1,  234,  247,  247,  247,  247,  247,  247,
 /*    20 */   247,  247,  247,  247,  247,  247,  247,  247,  247,  247,
 /*    30 */   247,  247,  247,  247,   61,   61,   61,  124,  575,  575,
 /*    40 */   123,   57,   57,  102,  575,   73,   73,   57,   57,   57,
 /*    50 */    57,   57,   57,   41,   97,  238,  102,   97,   57,   57,
 /*    60 */    97,   57,   97,   97,   97,   57,  260,  243,  368,  407,
 /*    70 */   407,  306,  625,  816,  375,  816,  816,  816,  816,  816,
 /*    80 */   816,  816,  816,  816,  816,  816,  816,  816,  816,  816,
 /*    90 */   816,  816,  816,  816,   73,   36,  245,   66,  210,  210,
552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594
 /*   100 */   210,  451,   66,  396,   97,   97,   97,  374,  115,  222,
 /*   110 */   222,  222,  222,  222,  222,  222,  644,  268,   52,  237,
 /*   120 */    87,   73,  119,   73,  141,  619,  607,  507,  161,  507,
 /*   130 */   737,  581,  174,  886,  881,  896,  807,  886,  886,  835,
 /*   140 */   822,  822,  886,  948,  949,   41,  396,  956,   41,   41,
 /*   150 */   886,   41,  976,   97,   97,   97,   97,   97,   97,   97,
 /*   160 */    97,   97,   97,   97,  896,  886,  976,  396,  948,  859,
 /*   170 */   949,  260,  396,  956,  260, 1044,  879,  883, 1017,  879,
 /*   180 */   883, 1017, 1017,  884,  882,  902,  906,  910,  396, 1070,
 /*   190 */   978,  900,  904,  909, 1029,   97,  883, 1017, 1017,  883,
 /*   200 */  1017,  989,  396,  956,  260,  374,  260,  396, 1071,  896,
 /*   210 */   115,  886,  260,  976, 1496, 1496, 1496, 1496, 1496,  134,
 /*   220 */   885, 1026,  428,   69, 1146,  331,  965, 1022,  540,  363,
 /*   230 */   707,  707,  707,  707,  707,  707,  707,  213,  240,  357,
 /*   240 */   517,  378,  357,  357,  357,  682,  608,  410,  665,  704,
 /*   250 */   710,  711,    6,  656,  746,  691,  723,  757,  758,  795,
 /*   260 */   676,  334,  629,  759,  661,  765,  789,  778,  783,  793,
 /*   270 */   808,  829,  772,  798,  831,  839,  840,  841,  848,  856,
 /*   280 */   869,  887, 1161, 1163, 1103, 1170, 1133, 1019, 1135, 1137,
 /*   290 */  1138, 1024, 1178, 1142, 1144, 1031, 1185, 1148, 1187, 1150,
 /*   300 */  1189, 1119, 1048, 1050, 1088, 1057, 1198, 1203, 1155, 1073,
 /*   310 */  1206, 1207, 1127, 1215, 1216, 1217, 1218, 1219, 1222, 1223,
 /*   320 */  1224, 1225, 1226, 1228, 1229, 1231, 1116, 1234, 1235, 1236,
 /*   330 */  1238, 1239, 1240, 1220, 1243, 1244, 1246, 1247, 1248, 1254,
 /*   340 */  1255, 1261, 1264, 1227, 1265, 1221, 1267, 1271, 1237, 1242,
 /*   350 */  1233, 1272, 1279, 1280, 1281, 1208, 1209, 1251, 1232, 1268,
 /*   360 */  1286, 1253, 1259, 1263, 1266, 1249, 1232, 1269, 1270, 1303,
 /*   370 */  1284, 1311, 1290, 1275, 1316, 1296, 1282, 1321, 1300, 1323,
 /*   380 */  1302, 1305, 1327, 1196, 1190, 1304, 1340, 1200, 1324, 1230,
 /*   390 */  1241, 1348, 1349, 1245, 1350, 1283, 1309, 1252, 1285, 1288,
 /*   400 */  1174, 1287, 1292, 1289, 1298, 1307, 1310, 1295, 1308, 1297,
 /*   410 */  1312, 1314, 1175, 1315, 1318, 1301, 1211, 1325, 1313, 1319,
 /*   420 */  1326, 1212, 1382, 1354, 1359, 1360, 1361, 1362, 1363, 1400,
 /*   430 */  1256, 1320, 1332, 1337, 1339, 1341, 1342, 1343, 1345, 1346,
 /*   440 */  1291, 1347, 1411, 1376, 1293, 1351, 1344, 1352, 1353, 1401,
 /*   450 */  1355, 1356, 1357, 1386, 1389, 1366, 1358, 1390, 1368, 1369,
 /*   460 */  1393, 1371, 1372, 1394, 1374, 1375, 1395, 1377, 1338, 1364,
 /*   470 */  1365, 1367, 1418, 1370, 1378, 1405, 1373, 1379, 1380, 1408,
 /*   480 */  1232, 1430, 1407, 1406, 1402, 1388, 1391, 1420, 1424, 1426,
 /*   490 */  1427, 1428, 1429, 1431, 1446, 1416, 1249, 1433, 1232, 1434,
 /*   500 */  1435, 1436, 1437, 1438, 1439, 1440, 1480, 1443, 1447, 1441,
 /*   510 */  1482, 1448, 1450, 1485, 1488, 1467, 1469, 1470, 1471, 1473,
 /*   520 */  1475,
595
};
596
#define YY_REDUCE_COUNT (218)
X
Xiaoyu Wang 已提交
597 598
#define YY_REDUCE_MIN   (-262)
#define YY_REDUCE_MAX   (1139)
599
static const short yy_reduce_ofst[] = {
X
Xiaoyu Wang 已提交
600 601 602 603 604 605
 /*     0 */   318,  356,  460,  239,  495,  537,  573,  224,  369,  616,
 /*    10 */   627,  669, -158, -202,  548,  697,  725,  754,  779,  813,
 /*    20 */   857,  863,  891,  899,  933,  945,  991, 1016, 1027, 1063,
 /*    30 */  1069, 1097, 1105, 1139,  392, -131,  588,  589, -233, -231,
 /*    40 */  -244, -187, -128,  197, -227, -245, -230,  -85,  -65,   54,
 /*    50 */   149,  230,  235, -208, -190,  -93,  159,  228,  266,  380,
606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621
 /*    60 */  -150,  398,  295, -111,  411,  538,   56, -168, -262, -262,
 /*    70 */  -262,  -67, -214, -159, -177,   79,  181,  184,  223,  275,
 /*    80 */   276,  279,  298,  344,  345,  402,  445,  448,  453,  487,
 /*    90 */   488,  500,  502,  506, -189,    9,  229,  133,  326,  332,
 /*   100 */   412,  257,  343,  285,  364,  370,  450,  491,  171,  209,
 /*   110 */   287,  330,  403,  421,  444,  503,  328,  554,  549,  475,
 /*   120 */   496,  562,  614,  574,  568,  671,  599,  597,  597,  597,
 /*   130 */   658,  600,  602,  703,  662,  727,  690,  738,  740,  709,
 /*   140 */   715,  718,  751,  712,  716,  761,  749,  735,  773,  774,
 /*   150 */   777,  776,  790,  769,  770,  780,  781,  782,  784,  788,
 /*   160 */   799,  802,  810,  811,  786,  791,  796,  805,  745,  760,
 /*   170 */   806,  817,  825,  797,  833,  800,  771,  819,  823,  787,
 /*   180 */   821,  824,  826,  792,  785,  801,  809,  597,  853,  830,
 /*   190 */   820,  803,  804,  814,  838,  658,  861,  858,  864,  865,
 /*   200 */   867,  871,  897,  874,  912,  911,  924,  903,  908,  928,
 /*   210 */   925,  936,  938,  944,  895,  930,  931,  943,  953,
622 623
};
static const YYACTIONTYPE yy_default[] = {
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 670 671 672 673 674 675 676
 /*     0 */  1181, 1181, 1181, 1181, 1181, 1181, 1181, 1181, 1181, 1181,
 /*    10 */  1181, 1181, 1181, 1181, 1181, 1181, 1181, 1181, 1181, 1181,
 /*    20 */  1181, 1181, 1181, 1181, 1181, 1181, 1181, 1181, 1181, 1181,
 /*    30 */  1181, 1181, 1181, 1181, 1181, 1181, 1181, 1181, 1181, 1181,
 /*    40 */  1181, 1181, 1181, 1181, 1181, 1181, 1181, 1181, 1181, 1181,
 /*    50 */  1181, 1181, 1181, 1234, 1181, 1181, 1181, 1181, 1181, 1181,
 /*    60 */  1181, 1181, 1181, 1181, 1181, 1181, 1232, 1369, 1181, 1504,
 /*    70 */  1181, 1181, 1181, 1181, 1181, 1181, 1181, 1181, 1181, 1181,
 /*    80 */  1181, 1181, 1181, 1181, 1181, 1181, 1181, 1181, 1181, 1181,
 /*    90 */  1181, 1181, 1181, 1181, 1181, 1181, 1234, 1181, 1515, 1515,
 /*   100 */  1515, 1232, 1181, 1181, 1181, 1181, 1181, 1327, 1181, 1181,
 /*   110 */  1181, 1181, 1181, 1181, 1181, 1181, 1403, 1181, 1181, 1579,
 /*   120 */  1181, 1181, 1280, 1181, 1539, 1181, 1531, 1507, 1521, 1508,
 /*   130 */  1181, 1564, 1524, 1181, 1181, 1181, 1395, 1181, 1181, 1374,
 /*   140 */  1371, 1371, 1181, 1181, 1181, 1234, 1181, 1181, 1234, 1234,
 /*   150 */  1181, 1234, 1181, 1181, 1181, 1181, 1181, 1181, 1181, 1181,
 /*   160 */  1181, 1181, 1181, 1181, 1181, 1181, 1181, 1181, 1181, 1405,
 /*   170 */  1181, 1232, 1181, 1181, 1232, 1181, 1546, 1544, 1181, 1546,
 /*   180 */  1544, 1181, 1181, 1558, 1554, 1537, 1535, 1521, 1181, 1181,
 /*   190 */  1181, 1582, 1570, 1566, 1181, 1181, 1544, 1181, 1181, 1544,
 /*   200 */  1181, 1382, 1181, 1181, 1232, 1181, 1232, 1181, 1296, 1181,
 /*   210 */  1181, 1181, 1232, 1181, 1397, 1330, 1330, 1235, 1186, 1181,
 /*   220 */  1181, 1181, 1181, 1181, 1181, 1181, 1181, 1181, 1181, 1467,
 /*   230 */  1468, 1557, 1556, 1467, 1481, 1480, 1479, 1181, 1181, 1462,
 /*   240 */  1181, 1181, 1463, 1461, 1460, 1181, 1181, 1181, 1181, 1181,
 /*   250 */  1181, 1181, 1181, 1181, 1181, 1181, 1181, 1181, 1181, 1505,
 /*   260 */  1181, 1567, 1571, 1181, 1181, 1181, 1442, 1181, 1181, 1181,
 /*   270 */  1181, 1181, 1181, 1181, 1181, 1181, 1181, 1181, 1181, 1181,
 /*   280 */  1181, 1181, 1181, 1181, 1181, 1181, 1181, 1181, 1181, 1181,
 /*   290 */  1181, 1181, 1181, 1181, 1181, 1181, 1181, 1181, 1181, 1181,
 /*   300 */  1181, 1181, 1181, 1181, 1181, 1181, 1181, 1181, 1181, 1181,
 /*   310 */  1181, 1181, 1181, 1181, 1181, 1181, 1181, 1181, 1181, 1181,
 /*   320 */  1181, 1181, 1181, 1181, 1181, 1181, 1181, 1181, 1181, 1181,
 /*   330 */  1181, 1181, 1181, 1181, 1181, 1181, 1181, 1181, 1181, 1181,
 /*   340 */  1181, 1181, 1181, 1181, 1181, 1181, 1181, 1181, 1181, 1181,
 /*   350 */  1181, 1181, 1181, 1181, 1181, 1181, 1181, 1181, 1341, 1181,
 /*   360 */  1181, 1181, 1181, 1181, 1181, 1261, 1260, 1181, 1181, 1181,
 /*   370 */  1181, 1181, 1181, 1181, 1181, 1181, 1181, 1181, 1181, 1181,
 /*   380 */  1181, 1181, 1181, 1181, 1181, 1181, 1181, 1181, 1181, 1181,
 /*   390 */  1181, 1181, 1181, 1181, 1181, 1181, 1181, 1181, 1528, 1538,
 /*   400 */  1181, 1181, 1181, 1181, 1181, 1181, 1181, 1181, 1181, 1442,
 /*   410 */  1181, 1555, 1181, 1514, 1510, 1181, 1181, 1506, 1181, 1181,
 /*   420 */  1565, 1181, 1181, 1181, 1181, 1181, 1181, 1181, 1181, 1500,
 /*   430 */  1181, 1181, 1181, 1181, 1181, 1181, 1181, 1181, 1181, 1181,
 /*   440 */  1181, 1181, 1181, 1181, 1181, 1181, 1181, 1441, 1181, 1181,
 /*   450 */  1181, 1181, 1181, 1181, 1181, 1324, 1181, 1181, 1181, 1181,
 /*   460 */  1181, 1181, 1181, 1181, 1181, 1181, 1181, 1181, 1309, 1307,
 /*   470 */  1306, 1305, 1181, 1302, 1181, 1181, 1181, 1181, 1181, 1181,
 /*   480 */  1332, 1181, 1181, 1181, 1181, 1181, 1255, 1181, 1181, 1181,
 /*   490 */  1181, 1181, 1181, 1181, 1181, 1181, 1246, 1181, 1245, 1181,
 /*   500 */  1181, 1181, 1181, 1181, 1181, 1181, 1181, 1181, 1181, 1181,
 /*   510 */  1181, 1181, 1181, 1181, 1181, 1181, 1181, 1181, 1181, 1181,
 /*   520 */  1181,
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 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733
};
/********** 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 已提交
734 735
  ParseARG_SDECL                /* A place to hold %extra_argument */
  ParseCTX_SDECL                /* A place to hold %extra_context */
736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770
#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 已提交
771
void ParseTrace(FILE *TraceFILE, char *zTracePrompt){
772 773 774 775 776 777 778 779 780 781 782 783
  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 */ "$",
784 785
  /*    1 */ "OR",
  /*    2 */ "AND",
786 787 788 789 790
  /*    3 */ "UNION",
  /*    4 */ "ALL",
  /*    5 */ "MINUS",
  /*    6 */ "EXCEPT",
  /*    7 */ "INTERSECT",
791 792 793 794 795 796 797 798 799 800
  /*    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",
801
  /*   18 */ "CREATE",
802 803 804
  /*   19 */ "ACCOUNT",
  /*   20 */ "NK_ID",
  /*   21 */ "PASS",
805 806 807 808 809 810 811 812 813 814 815 816
  /*   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",
817 818
  /*   34 */ "PRIVILEGE",
  /*   35 */ "DROP",
X
Xiaoyu Wang 已提交
819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836
  /*   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",
X
Xiaoyu Wang 已提交
837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940
  /*   54 */ "NK_VARIABLE",
  /*   55 */ "FSYNC",
  /*   56 */ "MAXROWS",
  /*   57 */ "MINROWS",
  /*   58 */ "KEEP",
  /*   59 */ "PRECISION",
  /*   60 */ "QUORUM",
  /*   61 */ "REPLICA",
  /*   62 */ "TTL",
  /*   63 */ "WAL",
  /*   64 */ "VGROUPS",
  /*   65 */ "SINGLE_STABLE",
  /*   66 */ "STREAM_MODE",
  /*   67 */ "RETENTIONS",
  /*   68 */ "NK_COMMA",
  /*   69 */ "NK_COLON",
  /*   70 */ "TABLE",
  /*   71 */ "NK_LP",
  /*   72 */ "NK_RP",
  /*   73 */ "STABLE",
  /*   74 */ "ADD",
  /*   75 */ "COLUMN",
  /*   76 */ "MODIFY",
  /*   77 */ "RENAME",
  /*   78 */ "TAG",
  /*   79 */ "SET",
  /*   80 */ "NK_EQ",
  /*   81 */ "USING",
  /*   82 */ "TAGS",
  /*   83 */ "NK_DOT",
  /*   84 */ "COMMENT",
  /*   85 */ "BOOL",
  /*   86 */ "TINYINT",
  /*   87 */ "SMALLINT",
  /*   88 */ "INT",
  /*   89 */ "INTEGER",
  /*   90 */ "BIGINT",
  /*   91 */ "FLOAT",
  /*   92 */ "DOUBLE",
  /*   93 */ "BINARY",
  /*   94 */ "TIMESTAMP",
  /*   95 */ "NCHAR",
  /*   96 */ "UNSIGNED",
  /*   97 */ "JSON",
  /*   98 */ "VARCHAR",
  /*   99 */ "MEDIUMBLOB",
  /*  100 */ "BLOB",
  /*  101 */ "VARBINARY",
  /*  102 */ "DECIMAL",
  /*  103 */ "SMA",
  /*  104 */ "ROLLUP",
  /*  105 */ "FILE_FACTOR",
  /*  106 */ "NK_FLOAT",
  /*  107 */ "DELAY",
  /*  108 */ "SHOW",
  /*  109 */ "DATABASES",
  /*  110 */ "TABLES",
  /*  111 */ "STABLES",
  /*  112 */ "MNODES",
  /*  113 */ "MODULES",
  /*  114 */ "QNODES",
  /*  115 */ "FUNCTIONS",
  /*  116 */ "INDEXES",
  /*  117 */ "FROM",
  /*  118 */ "ACCOUNTS",
  /*  119 */ "APPS",
  /*  120 */ "CONNECTIONS",
  /*  121 */ "LICENCE",
  /*  122 */ "QUERIES",
  /*  123 */ "SCORES",
  /*  124 */ "TOPICS",
  /*  125 */ "VARIABLES",
  /*  126 */ "LIKE",
  /*  127 */ "INDEX",
  /*  128 */ "FULLTEXT",
  /*  129 */ "FUNCTION",
  /*  130 */ "INTERVAL",
  /*  131 */ "TOPIC",
  /*  132 */ "AS",
  /*  133 */ "DESC",
  /*  134 */ "DESCRIBE",
  /*  135 */ "RESET",
  /*  136 */ "QUERY",
  /*  137 */ "EXPLAIN",
  /*  138 */ "ANALYZE",
  /*  139 */ "VERBOSE",
  /*  140 */ "NK_BOOL",
  /*  141 */ "RATIO",
  /*  142 */ "COMPACT",
  /*  143 */ "VNODES",
  /*  144 */ "IN",
  /*  145 */ "OUTPUTTYPE",
  /*  146 */ "AGGREGATE",
  /*  147 */ "BUFSIZE",
  /*  148 */ "STREAM",
  /*  149 */ "INTO",
  /*  150 */ "KILL",
  /*  151 */ "CONNECTION",
  /*  152 */ "MERGE",
  /*  153 */ "VGROUP",
  /*  154 */ "REDISTRIBUTE",
  /*  155 */ "SPLIT",
  /*  156 */ "SYNCDB",
  /*  157 */ "NULL",
X
Xiaoyu Wang 已提交
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
  /*  158 */ "FIRST",
  /*  159 */ "LAST",
  /*  160 */ "NOW",
  /*  161 */ "ROWTS",
  /*  162 */ "TBNAME",
  /*  163 */ "QSTARTTS",
  /*  164 */ "QENDTS",
  /*  165 */ "WSTARTTS",
  /*  166 */ "WENDTS",
  /*  167 */ "WDURATION",
  /*  168 */ "BETWEEN",
  /*  169 */ "IS",
  /*  170 */ "NK_LT",
  /*  171 */ "NK_GT",
  /*  172 */ "NK_LE",
  /*  173 */ "NK_GE",
  /*  174 */ "NK_NE",
  /*  175 */ "MATCH",
  /*  176 */ "NMATCH",
  /*  177 */ "JOIN",
  /*  178 */ "INNER",
  /*  179 */ "SELECT",
  /*  180 */ "DISTINCT",
  /*  181 */ "WHERE",
  /*  182 */ "PARTITION",
  /*  183 */ "BY",
  /*  184 */ "SESSION",
  /*  185 */ "STATE_WINDOW",
  /*  186 */ "SLIDING",
  /*  187 */ "FILL",
  /*  188 */ "VALUE",
  /*  189 */ "NONE",
  /*  190 */ "PREV",
  /*  191 */ "LINEAR",
  /*  192 */ "NEXT",
  /*  193 */ "GROUP",
  /*  194 */ "HAVING",
  /*  195 */ "ORDER",
  /*  196 */ "SLIMIT",
  /*  197 */ "SOFFSET",
  /*  198 */ "LIMIT",
  /*  199 */ "OFFSET",
  /*  200 */ "ASC",
  /*  201 */ "NULLS",
X
Xiaoyu Wang 已提交
985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090
  /*  202 */ "cmd",
  /*  203 */ "account_options",
  /*  204 */ "alter_account_options",
  /*  205 */ "literal",
  /*  206 */ "alter_account_option",
  /*  207 */ "user_name",
  /*  208 */ "dnode_endpoint",
  /*  209 */ "dnode_host_name",
  /*  210 */ "not_exists_opt",
  /*  211 */ "db_name",
  /*  212 */ "db_options",
  /*  213 */ "exists_opt",
  /*  214 */ "alter_db_options",
  /*  215 */ "integer_list",
  /*  216 */ "variable_list",
  /*  217 */ "retention_list",
  /*  218 */ "alter_db_option",
  /*  219 */ "retention",
  /*  220 */ "full_table_name",
  /*  221 */ "column_def_list",
  /*  222 */ "tags_def_opt",
  /*  223 */ "table_options",
  /*  224 */ "multi_create_clause",
  /*  225 */ "tags_def",
  /*  226 */ "multi_drop_clause",
  /*  227 */ "alter_table_clause",
  /*  228 */ "alter_table_options",
  /*  229 */ "column_name",
  /*  230 */ "type_name",
  /*  231 */ "create_subtable_clause",
  /*  232 */ "specific_tags_opt",
  /*  233 */ "literal_list",
  /*  234 */ "drop_table_clause",
  /*  235 */ "col_name_list",
  /*  236 */ "table_name",
  /*  237 */ "column_def",
  /*  238 */ "func_name_list",
  /*  239 */ "alter_table_option",
  /*  240 */ "col_name",
  /*  241 */ "db_name_cond_opt",
  /*  242 */ "like_pattern_opt",
  /*  243 */ "table_name_cond",
  /*  244 */ "from_db_opt",
  /*  245 */ "func_name",
  /*  246 */ "function_name",
  /*  247 */ "index_name",
  /*  248 */ "index_options",
  /*  249 */ "func_list",
  /*  250 */ "duration_literal",
  /*  251 */ "sliding_opt",
  /*  252 */ "func",
  /*  253 */ "expression_list",
  /*  254 */ "topic_name",
  /*  255 */ "query_expression",
  /*  256 */ "analyze_opt",
  /*  257 */ "explain_options",
  /*  258 */ "agg_func_opt",
  /*  259 */ "bufsize_opt",
  /*  260 */ "stream_name",
  /*  261 */ "dnode_list",
  /*  262 */ "signed",
  /*  263 */ "signed_literal",
  /*  264 */ "table_alias",
  /*  265 */ "column_alias",
  /*  266 */ "expression",
  /*  267 */ "pseudo_column",
  /*  268 */ "column_reference",
  /*  269 */ "subquery",
  /*  270 */ "predicate",
  /*  271 */ "compare_op",
  /*  272 */ "in_op",
  /*  273 */ "in_predicate_value",
  /*  274 */ "boolean_value_expression",
  /*  275 */ "boolean_primary",
  /*  276 */ "common_expression",
  /*  277 */ "from_clause",
  /*  278 */ "table_reference_list",
  /*  279 */ "table_reference",
  /*  280 */ "table_primary",
  /*  281 */ "joined_table",
  /*  282 */ "alias_opt",
  /*  283 */ "parenthesized_joined_table",
  /*  284 */ "join_type",
  /*  285 */ "search_condition",
  /*  286 */ "query_specification",
  /*  287 */ "set_quantifier_opt",
  /*  288 */ "select_list",
  /*  289 */ "where_clause_opt",
  /*  290 */ "partition_by_clause_opt",
  /*  291 */ "twindow_clause_opt",
  /*  292 */ "group_by_clause_opt",
  /*  293 */ "having_clause_opt",
  /*  294 */ "select_sublist",
  /*  295 */ "select_item",
  /*  296 */ "fill_opt",
  /*  297 */ "fill_mode",
  /*  298 */ "group_by_list",
  /*  299 */ "query_expression_body",
  /*  300 */ "order_by_clause_opt",
  /*  301 */ "slimit_clause_opt",
  /*  302 */ "limit_clause_opt",
  /*  303 */ "query_primary",
  /*  304 */ "sort_specification_list",
  /*  305 */ "sort_specification",
  /*  306 */ "ordering_specification_opt",
  /*  307 */ "null_ordering_opt",
1091 1092 1093 1094 1095 1096 1097
};
#endif /* defined(YYCOVERAGE) || !defined(NDEBUG) */

#ifndef NDEBUG
/* For tracing reduce actions, the names of all rules are required.
*/
static const char *const yyRuleName[] = {
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
 /*   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 已提交
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
 /*  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",
X
Xiaoyu Wang 已提交
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 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 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357
 /*  57 */ "db_options ::= db_options DAYS NK_VARIABLE",
 /*  58 */ "db_options ::= db_options FSYNC NK_INTEGER",
 /*  59 */ "db_options ::= db_options MAXROWS NK_INTEGER",
 /*  60 */ "db_options ::= db_options MINROWS NK_INTEGER",
 /*  61 */ "db_options ::= db_options KEEP integer_list",
 /*  62 */ "db_options ::= db_options KEEP variable_list",
 /*  63 */ "db_options ::= db_options PRECISION NK_STRING",
 /*  64 */ "db_options ::= db_options QUORUM NK_INTEGER",
 /*  65 */ "db_options ::= db_options REPLICA NK_INTEGER",
 /*  66 */ "db_options ::= db_options TTL NK_INTEGER",
 /*  67 */ "db_options ::= db_options WAL NK_INTEGER",
 /*  68 */ "db_options ::= db_options VGROUPS NK_INTEGER",
 /*  69 */ "db_options ::= db_options SINGLE_STABLE NK_INTEGER",
 /*  70 */ "db_options ::= db_options STREAM_MODE NK_INTEGER",
 /*  71 */ "db_options ::= db_options RETENTIONS retention_list",
 /*  72 */ "alter_db_options ::= alter_db_option",
 /*  73 */ "alter_db_options ::= alter_db_options alter_db_option",
 /*  74 */ "alter_db_option ::= BLOCKS NK_INTEGER",
 /*  75 */ "alter_db_option ::= FSYNC NK_INTEGER",
 /*  76 */ "alter_db_option ::= KEEP integer_list",
 /*  77 */ "alter_db_option ::= KEEP variable_list",
 /*  78 */ "alter_db_option ::= WAL NK_INTEGER",
 /*  79 */ "alter_db_option ::= QUORUM NK_INTEGER",
 /*  80 */ "alter_db_option ::= CACHELAST NK_INTEGER",
 /*  81 */ "alter_db_option ::= REPLICA NK_INTEGER",
 /*  82 */ "integer_list ::= NK_INTEGER",
 /*  83 */ "integer_list ::= integer_list NK_COMMA NK_INTEGER",
 /*  84 */ "variable_list ::= NK_VARIABLE",
 /*  85 */ "variable_list ::= variable_list NK_COMMA NK_VARIABLE",
 /*  86 */ "retention_list ::= retention",
 /*  87 */ "retention_list ::= retention_list NK_COMMA retention",
 /*  88 */ "retention ::= NK_VARIABLE NK_COLON NK_VARIABLE",
 /*  89 */ "cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options",
 /*  90 */ "cmd ::= CREATE TABLE multi_create_clause",
 /*  91 */ "cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options",
 /*  92 */ "cmd ::= DROP TABLE multi_drop_clause",
 /*  93 */ "cmd ::= DROP STABLE exists_opt full_table_name",
 /*  94 */ "cmd ::= ALTER TABLE alter_table_clause",
 /*  95 */ "cmd ::= ALTER STABLE alter_table_clause",
 /*  96 */ "alter_table_clause ::= full_table_name alter_table_options",
 /*  97 */ "alter_table_clause ::= full_table_name ADD COLUMN column_name type_name",
 /*  98 */ "alter_table_clause ::= full_table_name DROP COLUMN column_name",
 /*  99 */ "alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name",
 /* 100 */ "alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name",
 /* 101 */ "alter_table_clause ::= full_table_name ADD TAG column_name type_name",
 /* 102 */ "alter_table_clause ::= full_table_name DROP TAG column_name",
 /* 103 */ "alter_table_clause ::= full_table_name MODIFY TAG column_name type_name",
 /* 104 */ "alter_table_clause ::= full_table_name RENAME TAG column_name column_name",
 /* 105 */ "alter_table_clause ::= full_table_name SET TAG column_name NK_EQ literal",
 /* 106 */ "multi_create_clause ::= create_subtable_clause",
 /* 107 */ "multi_create_clause ::= multi_create_clause create_subtable_clause",
 /* 108 */ "create_subtable_clause ::= not_exists_opt full_table_name USING full_table_name specific_tags_opt TAGS NK_LP literal_list NK_RP",
 /* 109 */ "multi_drop_clause ::= drop_table_clause",
 /* 110 */ "multi_drop_clause ::= multi_drop_clause drop_table_clause",
 /* 111 */ "drop_table_clause ::= exists_opt full_table_name",
 /* 112 */ "specific_tags_opt ::=",
 /* 113 */ "specific_tags_opt ::= NK_LP col_name_list NK_RP",
 /* 114 */ "full_table_name ::= table_name",
 /* 115 */ "full_table_name ::= db_name NK_DOT table_name",
 /* 116 */ "column_def_list ::= column_def",
 /* 117 */ "column_def_list ::= column_def_list NK_COMMA column_def",
 /* 118 */ "column_def ::= column_name type_name",
 /* 119 */ "column_def ::= column_name type_name COMMENT NK_STRING",
 /* 120 */ "type_name ::= BOOL",
 /* 121 */ "type_name ::= TINYINT",
 /* 122 */ "type_name ::= SMALLINT",
 /* 123 */ "type_name ::= INT",
 /* 124 */ "type_name ::= INTEGER",
 /* 125 */ "type_name ::= BIGINT",
 /* 126 */ "type_name ::= FLOAT",
 /* 127 */ "type_name ::= DOUBLE",
 /* 128 */ "type_name ::= BINARY NK_LP NK_INTEGER NK_RP",
 /* 129 */ "type_name ::= TIMESTAMP",
 /* 130 */ "type_name ::= NCHAR NK_LP NK_INTEGER NK_RP",
 /* 131 */ "type_name ::= TINYINT UNSIGNED",
 /* 132 */ "type_name ::= SMALLINT UNSIGNED",
 /* 133 */ "type_name ::= INT UNSIGNED",
 /* 134 */ "type_name ::= BIGINT UNSIGNED",
 /* 135 */ "type_name ::= JSON",
 /* 136 */ "type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP",
 /* 137 */ "type_name ::= MEDIUMBLOB",
 /* 138 */ "type_name ::= BLOB",
 /* 139 */ "type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP",
 /* 140 */ "type_name ::= DECIMAL",
 /* 141 */ "type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP",
 /* 142 */ "type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP",
 /* 143 */ "tags_def_opt ::=",
 /* 144 */ "tags_def_opt ::= tags_def",
 /* 145 */ "tags_def ::= TAGS NK_LP column_def_list NK_RP",
 /* 146 */ "table_options ::=",
 /* 147 */ "table_options ::= table_options COMMENT NK_STRING",
 /* 148 */ "table_options ::= table_options KEEP integer_list",
 /* 149 */ "table_options ::= table_options TTL NK_INTEGER",
 /* 150 */ "table_options ::= table_options SMA NK_LP col_name_list NK_RP",
 /* 151 */ "table_options ::= table_options ROLLUP NK_LP func_name_list NK_RP",
 /* 152 */ "table_options ::= table_options FILE_FACTOR NK_FLOAT",
 /* 153 */ "table_options ::= table_options DELAY NK_INTEGER",
 /* 154 */ "alter_table_options ::= alter_table_option",
 /* 155 */ "alter_table_options ::= alter_table_options alter_table_option",
 /* 156 */ "alter_table_option ::= COMMENT NK_STRING",
 /* 157 */ "alter_table_option ::= KEEP integer_list",
 /* 158 */ "alter_table_option ::= TTL NK_INTEGER",
 /* 159 */ "col_name_list ::= col_name",
 /* 160 */ "col_name_list ::= col_name_list NK_COMMA col_name",
 /* 161 */ "col_name ::= column_name",
 /* 162 */ "cmd ::= SHOW DNODES",
 /* 163 */ "cmd ::= SHOW USERS",
 /* 164 */ "cmd ::= SHOW DATABASES",
 /* 165 */ "cmd ::= SHOW db_name_cond_opt TABLES like_pattern_opt",
 /* 166 */ "cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt",
 /* 167 */ "cmd ::= SHOW db_name_cond_opt VGROUPS",
 /* 168 */ "cmd ::= SHOW MNODES",
 /* 169 */ "cmd ::= SHOW MODULES",
 /* 170 */ "cmd ::= SHOW QNODES",
 /* 171 */ "cmd ::= SHOW FUNCTIONS",
 /* 172 */ "cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt",
 /* 173 */ "cmd ::= SHOW STREAMS",
 /* 174 */ "cmd ::= SHOW ACCOUNTS",
 /* 175 */ "cmd ::= SHOW APPS",
 /* 176 */ "cmd ::= SHOW CONNECTIONS",
 /* 177 */ "cmd ::= SHOW LICENCE",
 /* 178 */ "cmd ::= SHOW CREATE DATABASE db_name",
 /* 179 */ "cmd ::= SHOW CREATE TABLE full_table_name",
 /* 180 */ "cmd ::= SHOW CREATE STABLE full_table_name",
 /* 181 */ "cmd ::= SHOW QUERIES",
 /* 182 */ "cmd ::= SHOW SCORES",
 /* 183 */ "cmd ::= SHOW TOPICS",
 /* 184 */ "cmd ::= SHOW VARIABLES",
 /* 185 */ "db_name_cond_opt ::=",
 /* 186 */ "db_name_cond_opt ::= db_name NK_DOT",
 /* 187 */ "like_pattern_opt ::=",
 /* 188 */ "like_pattern_opt ::= LIKE NK_STRING",
 /* 189 */ "table_name_cond ::= table_name",
 /* 190 */ "from_db_opt ::=",
 /* 191 */ "from_db_opt ::= FROM db_name",
 /* 192 */ "func_name_list ::= func_name",
 /* 193 */ "func_name_list ::= func_name_list NK_COMMA col_name",
 /* 194 */ "func_name ::= function_name",
 /* 195 */ "cmd ::= CREATE SMA INDEX not_exists_opt index_name ON table_name index_options",
 /* 196 */ "cmd ::= CREATE FULLTEXT INDEX not_exists_opt index_name ON table_name NK_LP col_name_list NK_RP",
 /* 197 */ "cmd ::= DROP INDEX exists_opt index_name ON table_name",
 /* 198 */ "index_options ::=",
 /* 199 */ "index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt",
 /* 200 */ "index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt",
 /* 201 */ "func_list ::= func",
 /* 202 */ "func_list ::= func_list NK_COMMA func",
 /* 203 */ "func ::= function_name NK_LP expression_list NK_RP",
 /* 204 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_expression",
 /* 205 */ "cmd ::= CREATE TOPIC not_exists_opt topic_name AS db_name",
 /* 206 */ "cmd ::= DROP TOPIC exists_opt topic_name",
 /* 207 */ "cmd ::= DESC full_table_name",
 /* 208 */ "cmd ::= DESCRIBE full_table_name",
 /* 209 */ "cmd ::= RESET QUERY CACHE",
 /* 210 */ "cmd ::= EXPLAIN analyze_opt explain_options query_expression",
 /* 211 */ "analyze_opt ::=",
 /* 212 */ "analyze_opt ::= ANALYZE",
 /* 213 */ "explain_options ::=",
 /* 214 */ "explain_options ::= explain_options VERBOSE NK_BOOL",
 /* 215 */ "explain_options ::= explain_options RATIO NK_FLOAT",
 /* 216 */ "cmd ::= COMPACT VNODES IN NK_LP integer_list NK_RP",
 /* 217 */ "cmd ::= CREATE agg_func_opt FUNCTION function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt",
 /* 218 */ "cmd ::= DROP FUNCTION function_name",
 /* 219 */ "agg_func_opt ::=",
 /* 220 */ "agg_func_opt ::= AGGREGATE",
 /* 221 */ "bufsize_opt ::=",
 /* 222 */ "bufsize_opt ::= BUFSIZE NK_INTEGER",
 /* 223 */ "cmd ::= CREATE STREAM stream_name INTO table_name AS query_expression",
 /* 224 */ "cmd ::= DROP STREAM stream_name",
 /* 225 */ "cmd ::= KILL CONNECTION NK_INTEGER",
 /* 226 */ "cmd ::= KILL QUERY NK_INTEGER",
 /* 227 */ "cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER",
 /* 228 */ "cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list",
 /* 229 */ "cmd ::= SPLIT VGROUP NK_INTEGER",
 /* 230 */ "dnode_list ::= DNODE NK_INTEGER",
 /* 231 */ "dnode_list ::= dnode_list DNODE NK_INTEGER",
 /* 232 */ "cmd ::= SYNCDB db_name REPLICA",
 /* 233 */ "cmd ::= query_expression",
 /* 234 */ "literal ::= NK_INTEGER",
 /* 235 */ "literal ::= NK_FLOAT",
 /* 236 */ "literal ::= NK_STRING",
 /* 237 */ "literal ::= NK_BOOL",
 /* 238 */ "literal ::= TIMESTAMP NK_STRING",
 /* 239 */ "literal ::= duration_literal",
 /* 240 */ "literal ::= NULL",
 /* 241 */ "duration_literal ::= NK_VARIABLE",
 /* 242 */ "signed ::= NK_INTEGER",
 /* 243 */ "signed ::= NK_PLUS NK_INTEGER",
 /* 244 */ "signed ::= NK_MINUS NK_INTEGER",
 /* 245 */ "signed ::= NK_FLOAT",
 /* 246 */ "signed ::= NK_PLUS NK_FLOAT",
 /* 247 */ "signed ::= NK_MINUS NK_FLOAT",
 /* 248 */ "signed_literal ::= signed",
 /* 249 */ "signed_literal ::= NK_STRING",
 /* 250 */ "signed_literal ::= NK_BOOL",
 /* 251 */ "signed_literal ::= TIMESTAMP NK_STRING",
 /* 252 */ "signed_literal ::= duration_literal",
 /* 253 */ "signed_literal ::= NULL",
 /* 254 */ "literal_list ::= signed_literal",
 /* 255 */ "literal_list ::= literal_list NK_COMMA signed_literal",
 /* 256 */ "db_name ::= NK_ID",
 /* 257 */ "table_name ::= NK_ID",
 /* 258 */ "column_name ::= NK_ID",
 /* 259 */ "function_name ::= NK_ID",
X
Xiaoyu Wang 已提交
1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370
 /* 260 */ "function_name ::= FIRST",
 /* 261 */ "function_name ::= LAST",
 /* 262 */ "table_alias ::= NK_ID",
 /* 263 */ "column_alias ::= NK_ID",
 /* 264 */ "user_name ::= NK_ID",
 /* 265 */ "index_name ::= NK_ID",
 /* 266 */ "topic_name ::= NK_ID",
 /* 267 */ "stream_name ::= NK_ID",
 /* 268 */ "expression ::= literal",
 /* 269 */ "expression ::= pseudo_column",
 /* 270 */ "expression ::= column_reference",
 /* 271 */ "expression ::= function_name NK_LP expression_list NK_RP",
 /* 272 */ "expression ::= function_name NK_LP NK_STAR NK_RP",
1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498
 /* 273 */ "expression ::= function_name NK_LP expression AS type_name NK_RP",
 /* 274 */ "expression ::= subquery",
 /* 275 */ "expression ::= NK_LP expression NK_RP",
 /* 276 */ "expression ::= NK_PLUS expression",
 /* 277 */ "expression ::= NK_MINUS expression",
 /* 278 */ "expression ::= expression NK_PLUS expression",
 /* 279 */ "expression ::= expression NK_MINUS expression",
 /* 280 */ "expression ::= expression NK_STAR expression",
 /* 281 */ "expression ::= expression NK_SLASH expression",
 /* 282 */ "expression ::= expression NK_REM expression",
 /* 283 */ "expression_list ::= expression",
 /* 284 */ "expression_list ::= expression_list NK_COMMA expression",
 /* 285 */ "column_reference ::= column_name",
 /* 286 */ "column_reference ::= table_name NK_DOT column_name",
 /* 287 */ "pseudo_column ::= NOW",
 /* 288 */ "pseudo_column ::= ROWTS",
 /* 289 */ "pseudo_column ::= TBNAME",
 /* 290 */ "pseudo_column ::= QSTARTTS",
 /* 291 */ "pseudo_column ::= QENDTS",
 /* 292 */ "pseudo_column ::= WSTARTTS",
 /* 293 */ "pseudo_column ::= WENDTS",
 /* 294 */ "pseudo_column ::= WDURATION",
 /* 295 */ "predicate ::= expression compare_op expression",
 /* 296 */ "predicate ::= expression BETWEEN expression AND expression",
 /* 297 */ "predicate ::= expression NOT BETWEEN expression AND expression",
 /* 298 */ "predicate ::= expression IS NULL",
 /* 299 */ "predicate ::= expression IS NOT NULL",
 /* 300 */ "predicate ::= expression in_op in_predicate_value",
 /* 301 */ "compare_op ::= NK_LT",
 /* 302 */ "compare_op ::= NK_GT",
 /* 303 */ "compare_op ::= NK_LE",
 /* 304 */ "compare_op ::= NK_GE",
 /* 305 */ "compare_op ::= NK_NE",
 /* 306 */ "compare_op ::= NK_EQ",
 /* 307 */ "compare_op ::= LIKE",
 /* 308 */ "compare_op ::= NOT LIKE",
 /* 309 */ "compare_op ::= MATCH",
 /* 310 */ "compare_op ::= NMATCH",
 /* 311 */ "in_op ::= IN",
 /* 312 */ "in_op ::= NOT IN",
 /* 313 */ "in_predicate_value ::= NK_LP expression_list NK_RP",
 /* 314 */ "boolean_value_expression ::= boolean_primary",
 /* 315 */ "boolean_value_expression ::= NOT boolean_primary",
 /* 316 */ "boolean_value_expression ::= boolean_value_expression OR boolean_value_expression",
 /* 317 */ "boolean_value_expression ::= boolean_value_expression AND boolean_value_expression",
 /* 318 */ "boolean_primary ::= predicate",
 /* 319 */ "boolean_primary ::= NK_LP boolean_value_expression NK_RP",
 /* 320 */ "common_expression ::= expression",
 /* 321 */ "common_expression ::= boolean_value_expression",
 /* 322 */ "from_clause ::= FROM table_reference_list",
 /* 323 */ "table_reference_list ::= table_reference",
 /* 324 */ "table_reference_list ::= table_reference_list NK_COMMA table_reference",
 /* 325 */ "table_reference ::= table_primary",
 /* 326 */ "table_reference ::= joined_table",
 /* 327 */ "table_primary ::= table_name alias_opt",
 /* 328 */ "table_primary ::= db_name NK_DOT table_name alias_opt",
 /* 329 */ "table_primary ::= subquery alias_opt",
 /* 330 */ "table_primary ::= parenthesized_joined_table",
 /* 331 */ "alias_opt ::=",
 /* 332 */ "alias_opt ::= table_alias",
 /* 333 */ "alias_opt ::= AS table_alias",
 /* 334 */ "parenthesized_joined_table ::= NK_LP joined_table NK_RP",
 /* 335 */ "parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP",
 /* 336 */ "joined_table ::= table_reference join_type JOIN table_reference ON search_condition",
 /* 337 */ "join_type ::=",
 /* 338 */ "join_type ::= INNER",
 /* 339 */ "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",
 /* 340 */ "set_quantifier_opt ::=",
 /* 341 */ "set_quantifier_opt ::= DISTINCT",
 /* 342 */ "set_quantifier_opt ::= ALL",
 /* 343 */ "select_list ::= NK_STAR",
 /* 344 */ "select_list ::= select_sublist",
 /* 345 */ "select_sublist ::= select_item",
 /* 346 */ "select_sublist ::= select_sublist NK_COMMA select_item",
 /* 347 */ "select_item ::= common_expression",
 /* 348 */ "select_item ::= common_expression column_alias",
 /* 349 */ "select_item ::= common_expression AS column_alias",
 /* 350 */ "select_item ::= table_name NK_DOT NK_STAR",
 /* 351 */ "where_clause_opt ::=",
 /* 352 */ "where_clause_opt ::= WHERE search_condition",
 /* 353 */ "partition_by_clause_opt ::=",
 /* 354 */ "partition_by_clause_opt ::= PARTITION BY expression_list",
 /* 355 */ "twindow_clause_opt ::=",
 /* 356 */ "twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP",
 /* 357 */ "twindow_clause_opt ::= STATE_WINDOW NK_LP expression NK_RP",
 /* 358 */ "twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt",
 /* 359 */ "twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt",
 /* 360 */ "sliding_opt ::=",
 /* 361 */ "sliding_opt ::= SLIDING NK_LP duration_literal NK_RP",
 /* 362 */ "fill_opt ::=",
 /* 363 */ "fill_opt ::= FILL NK_LP fill_mode NK_RP",
 /* 364 */ "fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP",
 /* 365 */ "fill_mode ::= NONE",
 /* 366 */ "fill_mode ::= PREV",
 /* 367 */ "fill_mode ::= NULL",
 /* 368 */ "fill_mode ::= LINEAR",
 /* 369 */ "fill_mode ::= NEXT",
 /* 370 */ "group_by_clause_opt ::=",
 /* 371 */ "group_by_clause_opt ::= GROUP BY group_by_list",
 /* 372 */ "group_by_list ::= expression",
 /* 373 */ "group_by_list ::= group_by_list NK_COMMA expression",
 /* 374 */ "having_clause_opt ::=",
 /* 375 */ "having_clause_opt ::= HAVING search_condition",
 /* 376 */ "query_expression ::= query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt",
 /* 377 */ "query_expression_body ::= query_primary",
 /* 378 */ "query_expression_body ::= query_expression_body UNION ALL query_expression_body",
 /* 379 */ "query_primary ::= query_specification",
 /* 380 */ "order_by_clause_opt ::=",
 /* 381 */ "order_by_clause_opt ::= ORDER BY sort_specification_list",
 /* 382 */ "slimit_clause_opt ::=",
 /* 383 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER",
 /* 384 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER",
 /* 385 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER",
 /* 386 */ "limit_clause_opt ::=",
 /* 387 */ "limit_clause_opt ::= LIMIT NK_INTEGER",
 /* 388 */ "limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER",
 /* 389 */ "limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER",
 /* 390 */ "subquery ::= NK_LP query_expression NK_RP",
 /* 391 */ "search_condition ::= common_expression",
 /* 392 */ "sort_specification_list ::= sort_specification",
 /* 393 */ "sort_specification_list ::= sort_specification_list NK_COMMA sort_specification",
 /* 394 */ "sort_specification ::= expression ordering_specification_opt null_ordering_opt",
 /* 395 */ "ordering_specification_opt ::=",
 /* 396 */ "ordering_specification_opt ::= ASC",
 /* 397 */ "ordering_specification_opt ::= DESC",
 /* 398 */ "null_ordering_opt ::=",
 /* 399 */ "null_ordering_opt ::= NULLS FIRST",
 /* 400 */ "null_ordering_opt ::= NULLS LAST",
1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515
};
#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 已提交
1516
    pNew = malloc(newSize*sizeof(pNew[0]));
1517 1518
    if( pNew ) pNew[0] = p->yystk0;
  }else{
X
Xiaoyu Wang 已提交
1519
    pNew = realloc(p->yystack, newSize*sizeof(pNew[0]));
1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536
  }
  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 已提交
1537
** second argument to ParseAlloc() below.  This can be changed by
1538 1539 1540 1541 1542 1543 1544 1545 1546
** 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 已提交
1547
void ParseInit(void *yypRawParser ParseCTX_PDECL){
1548
  yyParser *yypParser = (yyParser*)yypRawParser;
X
Xiaoyu Wang 已提交
1549
  ParseCTX_STORE
1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572
#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 已提交
1573
#ifndef Parse_ENGINEALWAYSONSTACK
1574 1575 1576 1577 1578 1579 1580 1581 1582 1583
/* 
** 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 已提交
1584
** to Parse and ParseFree.
1585
*/
X
Xiaoyu Wang 已提交
1586
void *ParseAlloc(void *(*mallocProc)(YYMALLOCARGTYPE) ParseCTX_PDECL){
1587 1588 1589
  yyParser *yypParser;
  yypParser = (yyParser*)(*mallocProc)( (YYMALLOCARGTYPE)sizeof(yyParser) );
  if( yypParser ){
X
Xiaoyu Wang 已提交
1590 1591
    ParseCTX_STORE
    ParseInit(yypParser ParseCTX_PARAM);
1592 1593 1594
  }
  return (void*)yypParser;
}
X
Xiaoyu Wang 已提交
1595
#endif /* Parse_ENGINEALWAYSONSTACK */
1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609


/* 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 已提交
1610 1611
  ParseARG_FETCH
  ParseCTX_FETCH
1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624
  switch( yymajor ){
    /* Here is inserted the actions which take place when a
    ** terminal or non-terminal is destroyed.  This can happen
    ** when the symbol is popped from the stack during a
    ** reduce or during error processing or when a parser is 
    ** being destroyed before it is finished parsing.
    **
    ** Note: during a reduce, the only symbols destroyed are those
    ** which appear on the RHS of the rule, but which are *not* used
    ** inside the C code.
    */
/********* Begin destructor definitions ***************************************/
      /* Default NON-TERMINAL Destructor */
X
Xiaoyu Wang 已提交
1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677
    case 202: /* cmd */
    case 205: /* literal */
    case 212: /* db_options */
    case 214: /* alter_db_options */
    case 219: /* retention */
    case 220: /* full_table_name */
    case 223: /* table_options */
    case 227: /* alter_table_clause */
    case 228: /* alter_table_options */
    case 231: /* create_subtable_clause */
    case 234: /* drop_table_clause */
    case 237: /* column_def */
    case 240: /* col_name */
    case 241: /* db_name_cond_opt */
    case 242: /* like_pattern_opt */
    case 243: /* table_name_cond */
    case 244: /* from_db_opt */
    case 245: /* func_name */
    case 248: /* index_options */
    case 250: /* duration_literal */
    case 251: /* sliding_opt */
    case 252: /* func */
    case 255: /* query_expression */
    case 257: /* explain_options */
    case 262: /* signed */
    case 263: /* signed_literal */
    case 266: /* expression */
    case 267: /* pseudo_column */
    case 268: /* column_reference */
    case 269: /* subquery */
    case 270: /* predicate */
    case 273: /* in_predicate_value */
    case 274: /* boolean_value_expression */
    case 275: /* boolean_primary */
    case 276: /* common_expression */
    case 277: /* from_clause */
    case 278: /* table_reference_list */
    case 279: /* table_reference */
    case 280: /* table_primary */
    case 281: /* joined_table */
    case 283: /* parenthesized_joined_table */
    case 285: /* search_condition */
    case 286: /* query_specification */
    case 289: /* where_clause_opt */
    case 291: /* twindow_clause_opt */
    case 293: /* having_clause_opt */
    case 295: /* select_item */
    case 296: /* fill_opt */
    case 299: /* query_expression_body */
    case 301: /* slimit_clause_opt */
    case 302: /* limit_clause_opt */
    case 303: /* query_primary */
    case 305: /* sort_specification */
1678
{
X
Xiaoyu Wang 已提交
1679
 nodesDestroyNode((yypminor->yy168)); 
1680 1681
}
      break;
X
Xiaoyu Wang 已提交
1682 1683 1684 1685
    case 203: /* account_options */
    case 204: /* alter_account_options */
    case 206: /* alter_account_option */
    case 259: /* bufsize_opt */
1686
{
1687
 
1688 1689
}
      break;
X
Xiaoyu Wang 已提交
1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702
    case 207: /* user_name */
    case 208: /* dnode_endpoint */
    case 209: /* dnode_host_name */
    case 211: /* db_name */
    case 229: /* column_name */
    case 236: /* table_name */
    case 246: /* function_name */
    case 247: /* index_name */
    case 254: /* topic_name */
    case 260: /* stream_name */
    case 264: /* table_alias */
    case 265: /* column_alias */
    case 282: /* alias_opt */
1703
{
1704
 
1705 1706
}
      break;
X
Xiaoyu Wang 已提交
1707 1708 1709 1710 1711
    case 210: /* not_exists_opt */
    case 213: /* exists_opt */
    case 256: /* analyze_opt */
    case 258: /* agg_func_opt */
    case 287: /* set_quantifier_opt */
1712
{
1713 1714 1715
 
}
      break;
X
Xiaoyu Wang 已提交
1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737
    case 215: /* integer_list */
    case 216: /* variable_list */
    case 217: /* retention_list */
    case 221: /* column_def_list */
    case 222: /* tags_def_opt */
    case 224: /* multi_create_clause */
    case 225: /* tags_def */
    case 226: /* multi_drop_clause */
    case 232: /* specific_tags_opt */
    case 233: /* literal_list */
    case 235: /* col_name_list */
    case 238: /* func_name_list */
    case 249: /* func_list */
    case 253: /* expression_list */
    case 261: /* dnode_list */
    case 288: /* select_list */
    case 290: /* partition_by_clause_opt */
    case 292: /* group_by_clause_opt */
    case 294: /* select_sublist */
    case 298: /* group_by_list */
    case 300: /* order_by_clause_opt */
    case 304: /* sort_specification_list */
1738
{
X
Xiaoyu Wang 已提交
1739
 nodesDestroyList((yypminor->yy376)); 
1740 1741
}
      break;
X
Xiaoyu Wang 已提交
1742 1743
    case 218: /* alter_db_option */
    case 239: /* alter_table_option */
1744
{
X
Xiaoyu Wang 已提交
1745
 
1746 1747
}
      break;
X
Xiaoyu Wang 已提交
1748
    case 230: /* type_name */
1749
{
1750
 
1751 1752
}
      break;
X
Xiaoyu Wang 已提交
1753 1754
    case 271: /* compare_op */
    case 272: /* in_op */
1755
{
1756
 
1757 1758
}
      break;
X
Xiaoyu Wang 已提交
1759
    case 284: /* join_type */
1760
{
1761
 
1762 1763
}
      break;
X
Xiaoyu Wang 已提交
1764
    case 297: /* fill_mode */
1765
{
1766
 
1767 1768
}
      break;
X
Xiaoyu Wang 已提交
1769
    case 306: /* ordering_specification_opt */
1770
{
1771
 
1772 1773
}
      break;
X
Xiaoyu Wang 已提交
1774
    case 307: /* null_ordering_opt */
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
}
      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 已提交
1808
void ParseFinalize(void *p){
1809 1810 1811
  yyParser *pParser = (yyParser*)p;
  while( pParser->yytos>pParser->yystack ) yy_pop_parser_stack(pParser);
#if YYSTACKDEPTH<=0
X
Xiaoyu Wang 已提交
1812
  if( pParser->yystack!=&pParser->yystk0 ) free(pParser->yystack);
1813 1814 1815
#endif
}

X
Xiaoyu Wang 已提交
1816
#ifndef Parse_ENGINEALWAYSONSTACK
1817 1818 1819 1820 1821 1822 1823 1824
/* 
** 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 已提交
1825
void ParseFree(
1826 1827 1828 1829 1830 1831
  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 已提交
1832
  ParseFinalize(p);
1833 1834
  (*freeProc)(p);
}
X
Xiaoyu Wang 已提交
1835
#endif /* Parse_ENGINEALWAYSONSTACK */
1836 1837 1838 1839 1840

/*
** Return the peak depth of the stack for a parser.
*/
#ifdef YYTRACKMAXSTACKDEPTH
X
Xiaoyu Wang 已提交
1841
int ParseStackPeak(void *p){
1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864
  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 已提交
1865
int ParseCoverage(FILE *out){
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
  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 );
1902 1903
    assert( i<=YY_ACTTAB_COUNT );
    assert( i+YYNTOKEN<=(int)YY_NLOOKAHEAD );
1904 1905 1906
    assert( iLookAhead!=YYNOCODE );
    assert( iLookAhead < YYNTOKEN );
    i += iLookAhead;
1907 1908
    assert( i<(int)YY_NLOOKAHEAD );
    if( yy_lookahead[i]!=iLookAhead ){
1909 1910
#ifdef YYFALLBACK
      YYCODETYPE iFallback;            /* Fallback token */
1911 1912 1913
      assert( iLookAhead<sizeof(yyFallback)/sizeof(yyFallback[0]) );
      iFallback = yyFallback[iLookAhead];
      if( iFallback!=0 ){
1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927
#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;
1928 1929
        assert( j<(int)(sizeof(yy_lookahead)/sizeof(yy_lookahead[0])) );
        if( yy_lookahead[j]==YYWILDCARD && iLookAhead>0 ){
1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942
#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{
1943
      assert( i>=0 && i<sizeof(yy_action)/sizeof(yy_action[0]) );
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
      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 已提交
1983 1984
   ParseARG_FETCH
   ParseCTX_FETCH
1985 1986 1987 1988 1989 1990 1991 1992 1993 1994
#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 已提交
1995 1996
   ParseARG_STORE /* Suppress warning about unused %extra_argument var */
   ParseCTX_STORE
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
}

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

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 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 2570 2571 2572 2573 2574 2575 2576 2577 2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 2619 2620 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 2635 2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 2686 2687 2688 2689 2690 2691 2692 2693 2694 2695 2696 2697 2698 2699 2700 2701 2702 2703 2704 2705 2706 2707 2708 2709 2710 2711 2712 2713 2714 2715 2716 2717 2718 2719 2720 2721 2722 2723 2724 2725 2726 2727 2728 2729 2730 2731 2732 2733 2734 2735 2736 2737 2738 2739 2740 2741 2742 2743 2744 2745 2746 2747 2748 2749 2750 2751 2752 2753 2754 2755 2756 2757 2758 2759 2760 2761 2762 2763 2764 2765 2766 2767 2768 2769 2770 2771 2772 2773 2774 2775 2776 2777 2778 2779 2780 2781 2782 2783 2784 2785 2786 2787 2788 2789 2790 2791 2792 2793 2794 2795 2796 2797 2798 2799 2800 2801 2802 2803 2804 2805 2806 2807 2808 2809 2810 2811 2812 2813 2814 2815 2816 2817 2818 2819 2820 2821 2822 2823 2824 2825 2826 2827 2828 2829 2830 2831 2832 2833 2834 2835 2836 2837 2838 2839 2840 2841 2842 2843 2844 2845 2846 2847 2848 2849 2850 2851 2852 2853 2854 2855 2856 2857 2858 2859 2860 2861 2862 2863 2864 2865 2866 2867 2868 2869 2870 2871
/* For rule J, yyRuleInfoLhs[J] contains the symbol on the left-hand side
** of that rule */
static const YYCODETYPE yyRuleInfoLhs[] = {
   202,  /* (0) cmd ::= CREATE ACCOUNT NK_ID PASS NK_STRING account_options */
   202,  /* (1) cmd ::= ALTER ACCOUNT NK_ID alter_account_options */
   203,  /* (2) account_options ::= */
   203,  /* (3) account_options ::= account_options PPS literal */
   203,  /* (4) account_options ::= account_options TSERIES literal */
   203,  /* (5) account_options ::= account_options STORAGE literal */
   203,  /* (6) account_options ::= account_options STREAMS literal */
   203,  /* (7) account_options ::= account_options QTIME literal */
   203,  /* (8) account_options ::= account_options DBS literal */
   203,  /* (9) account_options ::= account_options USERS literal */
   203,  /* (10) account_options ::= account_options CONNS literal */
   203,  /* (11) account_options ::= account_options STATE literal */
   204,  /* (12) alter_account_options ::= alter_account_option */
   204,  /* (13) alter_account_options ::= alter_account_options alter_account_option */
   206,  /* (14) alter_account_option ::= PASS literal */
   206,  /* (15) alter_account_option ::= PPS literal */
   206,  /* (16) alter_account_option ::= TSERIES literal */
   206,  /* (17) alter_account_option ::= STORAGE literal */
   206,  /* (18) alter_account_option ::= STREAMS literal */
   206,  /* (19) alter_account_option ::= QTIME literal */
   206,  /* (20) alter_account_option ::= DBS literal */
   206,  /* (21) alter_account_option ::= USERS literal */
   206,  /* (22) alter_account_option ::= CONNS literal */
   206,  /* (23) alter_account_option ::= STATE literal */
   202,  /* (24) cmd ::= CREATE USER user_name PASS NK_STRING */
   202,  /* (25) cmd ::= ALTER USER user_name PASS NK_STRING */
   202,  /* (26) cmd ::= ALTER USER user_name PRIVILEGE NK_STRING */
   202,  /* (27) cmd ::= DROP USER user_name */
   202,  /* (28) cmd ::= CREATE DNODE dnode_endpoint */
   202,  /* (29) cmd ::= CREATE DNODE dnode_host_name PORT NK_INTEGER */
   202,  /* (30) cmd ::= DROP DNODE NK_INTEGER */
   202,  /* (31) cmd ::= DROP DNODE dnode_endpoint */
   202,  /* (32) cmd ::= ALTER DNODE NK_INTEGER NK_STRING */
   202,  /* (33) cmd ::= ALTER DNODE NK_INTEGER NK_STRING NK_STRING */
   202,  /* (34) cmd ::= ALTER ALL DNODES NK_STRING */
   202,  /* (35) cmd ::= ALTER ALL DNODES NK_STRING NK_STRING */
   208,  /* (36) dnode_endpoint ::= NK_STRING */
   209,  /* (37) dnode_host_name ::= NK_ID */
   209,  /* (38) dnode_host_name ::= NK_IPTOKEN */
   202,  /* (39) cmd ::= ALTER LOCAL NK_STRING */
   202,  /* (40) cmd ::= ALTER LOCAL NK_STRING NK_STRING */
   202,  /* (41) cmd ::= CREATE QNODE ON DNODE NK_INTEGER */
   202,  /* (42) cmd ::= DROP QNODE ON DNODE NK_INTEGER */
   202,  /* (43) cmd ::= CREATE DATABASE not_exists_opt db_name db_options */
   202,  /* (44) cmd ::= DROP DATABASE exists_opt db_name */
   202,  /* (45) cmd ::= USE db_name */
   202,  /* (46) cmd ::= ALTER DATABASE db_name alter_db_options */
   210,  /* (47) not_exists_opt ::= IF NOT EXISTS */
   210,  /* (48) not_exists_opt ::= */
   213,  /* (49) exists_opt ::= IF EXISTS */
   213,  /* (50) exists_opt ::= */
   212,  /* (51) db_options ::= */
   212,  /* (52) db_options ::= db_options BLOCKS NK_INTEGER */
   212,  /* (53) db_options ::= db_options CACHE NK_INTEGER */
   212,  /* (54) db_options ::= db_options CACHELAST NK_INTEGER */
   212,  /* (55) db_options ::= db_options COMP NK_INTEGER */
   212,  /* (56) db_options ::= db_options DAYS NK_INTEGER */
   212,  /* (57) db_options ::= db_options DAYS NK_VARIABLE */
   212,  /* (58) db_options ::= db_options FSYNC NK_INTEGER */
   212,  /* (59) db_options ::= db_options MAXROWS NK_INTEGER */
   212,  /* (60) db_options ::= db_options MINROWS NK_INTEGER */
   212,  /* (61) db_options ::= db_options KEEP integer_list */
   212,  /* (62) db_options ::= db_options KEEP variable_list */
   212,  /* (63) db_options ::= db_options PRECISION NK_STRING */
   212,  /* (64) db_options ::= db_options QUORUM NK_INTEGER */
   212,  /* (65) db_options ::= db_options REPLICA NK_INTEGER */
   212,  /* (66) db_options ::= db_options TTL NK_INTEGER */
   212,  /* (67) db_options ::= db_options WAL NK_INTEGER */
   212,  /* (68) db_options ::= db_options VGROUPS NK_INTEGER */
   212,  /* (69) db_options ::= db_options SINGLE_STABLE NK_INTEGER */
   212,  /* (70) db_options ::= db_options STREAM_MODE NK_INTEGER */
   212,  /* (71) db_options ::= db_options RETENTIONS retention_list */
   214,  /* (72) alter_db_options ::= alter_db_option */
   214,  /* (73) alter_db_options ::= alter_db_options alter_db_option */
   218,  /* (74) alter_db_option ::= BLOCKS NK_INTEGER */
   218,  /* (75) alter_db_option ::= FSYNC NK_INTEGER */
   218,  /* (76) alter_db_option ::= KEEP integer_list */
   218,  /* (77) alter_db_option ::= KEEP variable_list */
   218,  /* (78) alter_db_option ::= WAL NK_INTEGER */
   218,  /* (79) alter_db_option ::= QUORUM NK_INTEGER */
   218,  /* (80) alter_db_option ::= CACHELAST NK_INTEGER */
   218,  /* (81) alter_db_option ::= REPLICA NK_INTEGER */
   215,  /* (82) integer_list ::= NK_INTEGER */
   215,  /* (83) integer_list ::= integer_list NK_COMMA NK_INTEGER */
   216,  /* (84) variable_list ::= NK_VARIABLE */
   216,  /* (85) variable_list ::= variable_list NK_COMMA NK_VARIABLE */
   217,  /* (86) retention_list ::= retention */
   217,  /* (87) retention_list ::= retention_list NK_COMMA retention */
   219,  /* (88) retention ::= NK_VARIABLE NK_COLON NK_VARIABLE */
   202,  /* (89) cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options */
   202,  /* (90) cmd ::= CREATE TABLE multi_create_clause */
   202,  /* (91) cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options */
   202,  /* (92) cmd ::= DROP TABLE multi_drop_clause */
   202,  /* (93) cmd ::= DROP STABLE exists_opt full_table_name */
   202,  /* (94) cmd ::= ALTER TABLE alter_table_clause */
   202,  /* (95) cmd ::= ALTER STABLE alter_table_clause */
   227,  /* (96) alter_table_clause ::= full_table_name alter_table_options */
   227,  /* (97) alter_table_clause ::= full_table_name ADD COLUMN column_name type_name */
   227,  /* (98) alter_table_clause ::= full_table_name DROP COLUMN column_name */
   227,  /* (99) alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name */
   227,  /* (100) alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name */
   227,  /* (101) alter_table_clause ::= full_table_name ADD TAG column_name type_name */
   227,  /* (102) alter_table_clause ::= full_table_name DROP TAG column_name */
   227,  /* (103) alter_table_clause ::= full_table_name MODIFY TAG column_name type_name */
   227,  /* (104) alter_table_clause ::= full_table_name RENAME TAG column_name column_name */
   227,  /* (105) alter_table_clause ::= full_table_name SET TAG column_name NK_EQ literal */
   224,  /* (106) multi_create_clause ::= create_subtable_clause */
   224,  /* (107) multi_create_clause ::= multi_create_clause create_subtable_clause */
   231,  /* (108) create_subtable_clause ::= not_exists_opt full_table_name USING full_table_name specific_tags_opt TAGS NK_LP literal_list NK_RP */
   226,  /* (109) multi_drop_clause ::= drop_table_clause */
   226,  /* (110) multi_drop_clause ::= multi_drop_clause drop_table_clause */
   234,  /* (111) drop_table_clause ::= exists_opt full_table_name */
   232,  /* (112) specific_tags_opt ::= */
   232,  /* (113) specific_tags_opt ::= NK_LP col_name_list NK_RP */
   220,  /* (114) full_table_name ::= table_name */
   220,  /* (115) full_table_name ::= db_name NK_DOT table_name */
   221,  /* (116) column_def_list ::= column_def */
   221,  /* (117) column_def_list ::= column_def_list NK_COMMA column_def */
   237,  /* (118) column_def ::= column_name type_name */
   237,  /* (119) column_def ::= column_name type_name COMMENT NK_STRING */
   230,  /* (120) type_name ::= BOOL */
   230,  /* (121) type_name ::= TINYINT */
   230,  /* (122) type_name ::= SMALLINT */
   230,  /* (123) type_name ::= INT */
   230,  /* (124) type_name ::= INTEGER */
   230,  /* (125) type_name ::= BIGINT */
   230,  /* (126) type_name ::= FLOAT */
   230,  /* (127) type_name ::= DOUBLE */
   230,  /* (128) type_name ::= BINARY NK_LP NK_INTEGER NK_RP */
   230,  /* (129) type_name ::= TIMESTAMP */
   230,  /* (130) type_name ::= NCHAR NK_LP NK_INTEGER NK_RP */
   230,  /* (131) type_name ::= TINYINT UNSIGNED */
   230,  /* (132) type_name ::= SMALLINT UNSIGNED */
   230,  /* (133) type_name ::= INT UNSIGNED */
   230,  /* (134) type_name ::= BIGINT UNSIGNED */
   230,  /* (135) type_name ::= JSON */
   230,  /* (136) type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP */
   230,  /* (137) type_name ::= MEDIUMBLOB */
   230,  /* (138) type_name ::= BLOB */
   230,  /* (139) type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP */
   230,  /* (140) type_name ::= DECIMAL */
   230,  /* (141) type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP */
   230,  /* (142) type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */
   222,  /* (143) tags_def_opt ::= */
   222,  /* (144) tags_def_opt ::= tags_def */
   225,  /* (145) tags_def ::= TAGS NK_LP column_def_list NK_RP */
   223,  /* (146) table_options ::= */
   223,  /* (147) table_options ::= table_options COMMENT NK_STRING */
   223,  /* (148) table_options ::= table_options KEEP integer_list */
   223,  /* (149) table_options ::= table_options TTL NK_INTEGER */
   223,  /* (150) table_options ::= table_options SMA NK_LP col_name_list NK_RP */
   223,  /* (151) table_options ::= table_options ROLLUP NK_LP func_name_list NK_RP */
   223,  /* (152) table_options ::= table_options FILE_FACTOR NK_FLOAT */
   223,  /* (153) table_options ::= table_options DELAY NK_INTEGER */
   228,  /* (154) alter_table_options ::= alter_table_option */
   228,  /* (155) alter_table_options ::= alter_table_options alter_table_option */
   239,  /* (156) alter_table_option ::= COMMENT NK_STRING */
   239,  /* (157) alter_table_option ::= KEEP integer_list */
   239,  /* (158) alter_table_option ::= TTL NK_INTEGER */
   235,  /* (159) col_name_list ::= col_name */
   235,  /* (160) col_name_list ::= col_name_list NK_COMMA col_name */
   240,  /* (161) col_name ::= column_name */
   202,  /* (162) cmd ::= SHOW DNODES */
   202,  /* (163) cmd ::= SHOW USERS */
   202,  /* (164) cmd ::= SHOW DATABASES */
   202,  /* (165) cmd ::= SHOW db_name_cond_opt TABLES like_pattern_opt */
   202,  /* (166) cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt */
   202,  /* (167) cmd ::= SHOW db_name_cond_opt VGROUPS */
   202,  /* (168) cmd ::= SHOW MNODES */
   202,  /* (169) cmd ::= SHOW MODULES */
   202,  /* (170) cmd ::= SHOW QNODES */
   202,  /* (171) cmd ::= SHOW FUNCTIONS */
   202,  /* (172) cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt */
   202,  /* (173) cmd ::= SHOW STREAMS */
   202,  /* (174) cmd ::= SHOW ACCOUNTS */
   202,  /* (175) cmd ::= SHOW APPS */
   202,  /* (176) cmd ::= SHOW CONNECTIONS */
   202,  /* (177) cmd ::= SHOW LICENCE */
   202,  /* (178) cmd ::= SHOW CREATE DATABASE db_name */
   202,  /* (179) cmd ::= SHOW CREATE TABLE full_table_name */
   202,  /* (180) cmd ::= SHOW CREATE STABLE full_table_name */
   202,  /* (181) cmd ::= SHOW QUERIES */
   202,  /* (182) cmd ::= SHOW SCORES */
   202,  /* (183) cmd ::= SHOW TOPICS */
   202,  /* (184) cmd ::= SHOW VARIABLES */
   241,  /* (185) db_name_cond_opt ::= */
   241,  /* (186) db_name_cond_opt ::= db_name NK_DOT */
   242,  /* (187) like_pattern_opt ::= */
   242,  /* (188) like_pattern_opt ::= LIKE NK_STRING */
   243,  /* (189) table_name_cond ::= table_name */
   244,  /* (190) from_db_opt ::= */
   244,  /* (191) from_db_opt ::= FROM db_name */
   238,  /* (192) func_name_list ::= func_name */
   238,  /* (193) func_name_list ::= func_name_list NK_COMMA col_name */
   245,  /* (194) func_name ::= function_name */
   202,  /* (195) cmd ::= CREATE SMA INDEX not_exists_opt index_name ON table_name index_options */
   202,  /* (196) cmd ::= CREATE FULLTEXT INDEX not_exists_opt index_name ON table_name NK_LP col_name_list NK_RP */
   202,  /* (197) cmd ::= DROP INDEX exists_opt index_name ON table_name */
   248,  /* (198) index_options ::= */
   248,  /* (199) index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt */
   248,  /* (200) index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt */
   249,  /* (201) func_list ::= func */
   249,  /* (202) func_list ::= func_list NK_COMMA func */
   252,  /* (203) func ::= function_name NK_LP expression_list NK_RP */
   202,  /* (204) cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_expression */
   202,  /* (205) cmd ::= CREATE TOPIC not_exists_opt topic_name AS db_name */
   202,  /* (206) cmd ::= DROP TOPIC exists_opt topic_name */
   202,  /* (207) cmd ::= DESC full_table_name */
   202,  /* (208) cmd ::= DESCRIBE full_table_name */
   202,  /* (209) cmd ::= RESET QUERY CACHE */
   202,  /* (210) cmd ::= EXPLAIN analyze_opt explain_options query_expression */
   256,  /* (211) analyze_opt ::= */
   256,  /* (212) analyze_opt ::= ANALYZE */
   257,  /* (213) explain_options ::= */
   257,  /* (214) explain_options ::= explain_options VERBOSE NK_BOOL */
   257,  /* (215) explain_options ::= explain_options RATIO NK_FLOAT */
   202,  /* (216) cmd ::= COMPACT VNODES IN NK_LP integer_list NK_RP */
   202,  /* (217) cmd ::= CREATE agg_func_opt FUNCTION function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt */
   202,  /* (218) cmd ::= DROP FUNCTION function_name */
   258,  /* (219) agg_func_opt ::= */
   258,  /* (220) agg_func_opt ::= AGGREGATE */
   259,  /* (221) bufsize_opt ::= */
   259,  /* (222) bufsize_opt ::= BUFSIZE NK_INTEGER */
   202,  /* (223) cmd ::= CREATE STREAM stream_name INTO table_name AS query_expression */
   202,  /* (224) cmd ::= DROP STREAM stream_name */
   202,  /* (225) cmd ::= KILL CONNECTION NK_INTEGER */
   202,  /* (226) cmd ::= KILL QUERY NK_INTEGER */
   202,  /* (227) cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER */
   202,  /* (228) cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list */
   202,  /* (229) cmd ::= SPLIT VGROUP NK_INTEGER */
   261,  /* (230) dnode_list ::= DNODE NK_INTEGER */
   261,  /* (231) dnode_list ::= dnode_list DNODE NK_INTEGER */
   202,  /* (232) cmd ::= SYNCDB db_name REPLICA */
   202,  /* (233) cmd ::= query_expression */
   205,  /* (234) literal ::= NK_INTEGER */
   205,  /* (235) literal ::= NK_FLOAT */
   205,  /* (236) literal ::= NK_STRING */
   205,  /* (237) literal ::= NK_BOOL */
   205,  /* (238) literal ::= TIMESTAMP NK_STRING */
   205,  /* (239) literal ::= duration_literal */
   205,  /* (240) literal ::= NULL */
   250,  /* (241) duration_literal ::= NK_VARIABLE */
   262,  /* (242) signed ::= NK_INTEGER */
   262,  /* (243) signed ::= NK_PLUS NK_INTEGER */
   262,  /* (244) signed ::= NK_MINUS NK_INTEGER */
   262,  /* (245) signed ::= NK_FLOAT */
   262,  /* (246) signed ::= NK_PLUS NK_FLOAT */
   262,  /* (247) signed ::= NK_MINUS NK_FLOAT */
   263,  /* (248) signed_literal ::= signed */
   263,  /* (249) signed_literal ::= NK_STRING */
   263,  /* (250) signed_literal ::= NK_BOOL */
   263,  /* (251) signed_literal ::= TIMESTAMP NK_STRING */
   263,  /* (252) signed_literal ::= duration_literal */
   263,  /* (253) signed_literal ::= NULL */
   233,  /* (254) literal_list ::= signed_literal */
   233,  /* (255) literal_list ::= literal_list NK_COMMA signed_literal */
   211,  /* (256) db_name ::= NK_ID */
   236,  /* (257) table_name ::= NK_ID */
   229,  /* (258) column_name ::= NK_ID */
   246,  /* (259) function_name ::= NK_ID */
   246,  /* (260) function_name ::= FIRST */
   246,  /* (261) function_name ::= LAST */
   264,  /* (262) table_alias ::= NK_ID */
   265,  /* (263) column_alias ::= NK_ID */
   207,  /* (264) user_name ::= NK_ID */
   247,  /* (265) index_name ::= NK_ID */
   254,  /* (266) topic_name ::= NK_ID */
   260,  /* (267) stream_name ::= NK_ID */
   266,  /* (268) expression ::= literal */
   266,  /* (269) expression ::= pseudo_column */
   266,  /* (270) expression ::= column_reference */
   266,  /* (271) expression ::= function_name NK_LP expression_list NK_RP */
   266,  /* (272) expression ::= function_name NK_LP NK_STAR NK_RP */
   266,  /* (273) expression ::= function_name NK_LP expression AS type_name NK_RP */
   266,  /* (274) expression ::= subquery */
   266,  /* (275) expression ::= NK_LP expression NK_RP */
   266,  /* (276) expression ::= NK_PLUS expression */
   266,  /* (277) expression ::= NK_MINUS expression */
   266,  /* (278) expression ::= expression NK_PLUS expression */
   266,  /* (279) expression ::= expression NK_MINUS expression */
   266,  /* (280) expression ::= expression NK_STAR expression */
   266,  /* (281) expression ::= expression NK_SLASH expression */
   266,  /* (282) expression ::= expression NK_REM expression */
   253,  /* (283) expression_list ::= expression */
   253,  /* (284) expression_list ::= expression_list NK_COMMA expression */
   268,  /* (285) column_reference ::= column_name */
   268,  /* (286) column_reference ::= table_name NK_DOT column_name */
   267,  /* (287) pseudo_column ::= NOW */
   267,  /* (288) pseudo_column ::= ROWTS */
   267,  /* (289) pseudo_column ::= TBNAME */
   267,  /* (290) pseudo_column ::= QSTARTTS */
   267,  /* (291) pseudo_column ::= QENDTS */
   267,  /* (292) pseudo_column ::= WSTARTTS */
   267,  /* (293) pseudo_column ::= WENDTS */
   267,  /* (294) pseudo_column ::= WDURATION */
   270,  /* (295) predicate ::= expression compare_op expression */
   270,  /* (296) predicate ::= expression BETWEEN expression AND expression */
   270,  /* (297) predicate ::= expression NOT BETWEEN expression AND expression */
   270,  /* (298) predicate ::= expression IS NULL */
   270,  /* (299) predicate ::= expression IS NOT NULL */
   270,  /* (300) predicate ::= expression in_op in_predicate_value */
   271,  /* (301) compare_op ::= NK_LT */
   271,  /* (302) compare_op ::= NK_GT */
   271,  /* (303) compare_op ::= NK_LE */
   271,  /* (304) compare_op ::= NK_GE */
   271,  /* (305) compare_op ::= NK_NE */
   271,  /* (306) compare_op ::= NK_EQ */
   271,  /* (307) compare_op ::= LIKE */
   271,  /* (308) compare_op ::= NOT LIKE */
   271,  /* (309) compare_op ::= MATCH */
   271,  /* (310) compare_op ::= NMATCH */
   272,  /* (311) in_op ::= IN */
   272,  /* (312) in_op ::= NOT IN */
   273,  /* (313) in_predicate_value ::= NK_LP expression_list NK_RP */
   274,  /* (314) boolean_value_expression ::= boolean_primary */
   274,  /* (315) boolean_value_expression ::= NOT boolean_primary */
   274,  /* (316) boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */
   274,  /* (317) boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */
   275,  /* (318) boolean_primary ::= predicate */
   275,  /* (319) boolean_primary ::= NK_LP boolean_value_expression NK_RP */
   276,  /* (320) common_expression ::= expression */
   276,  /* (321) common_expression ::= boolean_value_expression */
   277,  /* (322) from_clause ::= FROM table_reference_list */
   278,  /* (323) table_reference_list ::= table_reference */
   278,  /* (324) table_reference_list ::= table_reference_list NK_COMMA table_reference */
   279,  /* (325) table_reference ::= table_primary */
   279,  /* (326) table_reference ::= joined_table */
   280,  /* (327) table_primary ::= table_name alias_opt */
   280,  /* (328) table_primary ::= db_name NK_DOT table_name alias_opt */
   280,  /* (329) table_primary ::= subquery alias_opt */
   280,  /* (330) table_primary ::= parenthesized_joined_table */
   282,  /* (331) alias_opt ::= */
   282,  /* (332) alias_opt ::= table_alias */
   282,  /* (333) alias_opt ::= AS table_alias */
   283,  /* (334) parenthesized_joined_table ::= NK_LP joined_table NK_RP */
   283,  /* (335) parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */
   281,  /* (336) joined_table ::= table_reference join_type JOIN table_reference ON search_condition */
   284,  /* (337) join_type ::= */
   284,  /* (338) join_type ::= INNER */
   286,  /* (339) 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 */
   287,  /* (340) set_quantifier_opt ::= */
   287,  /* (341) set_quantifier_opt ::= DISTINCT */
   287,  /* (342) set_quantifier_opt ::= ALL */
   288,  /* (343) select_list ::= NK_STAR */
   288,  /* (344) select_list ::= select_sublist */
   294,  /* (345) select_sublist ::= select_item */
   294,  /* (346) select_sublist ::= select_sublist NK_COMMA select_item */
   295,  /* (347) select_item ::= common_expression */
   295,  /* (348) select_item ::= common_expression column_alias */
   295,  /* (349) select_item ::= common_expression AS column_alias */
   295,  /* (350) select_item ::= table_name NK_DOT NK_STAR */
   289,  /* (351) where_clause_opt ::= */
   289,  /* (352) where_clause_opt ::= WHERE search_condition */
   290,  /* (353) partition_by_clause_opt ::= */
   290,  /* (354) partition_by_clause_opt ::= PARTITION BY expression_list */
   291,  /* (355) twindow_clause_opt ::= */
   291,  /* (356) twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP */
   291,  /* (357) twindow_clause_opt ::= STATE_WINDOW NK_LP expression NK_RP */
   291,  /* (358) twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt */
   291,  /* (359) twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt */
   251,  /* (360) sliding_opt ::= */
   251,  /* (361) sliding_opt ::= SLIDING NK_LP duration_literal NK_RP */
   296,  /* (362) fill_opt ::= */
   296,  /* (363) fill_opt ::= FILL NK_LP fill_mode NK_RP */
   296,  /* (364) fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP */
   297,  /* (365) fill_mode ::= NONE */
   297,  /* (366) fill_mode ::= PREV */
   297,  /* (367) fill_mode ::= NULL */
   297,  /* (368) fill_mode ::= LINEAR */
   297,  /* (369) fill_mode ::= NEXT */
   292,  /* (370) group_by_clause_opt ::= */
   292,  /* (371) group_by_clause_opt ::= GROUP BY group_by_list */
   298,  /* (372) group_by_list ::= expression */
   298,  /* (373) group_by_list ::= group_by_list NK_COMMA expression */
   293,  /* (374) having_clause_opt ::= */
   293,  /* (375) having_clause_opt ::= HAVING search_condition */
   255,  /* (376) query_expression ::= query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt */
   299,  /* (377) query_expression_body ::= query_primary */
   299,  /* (378) query_expression_body ::= query_expression_body UNION ALL query_expression_body */
   303,  /* (379) query_primary ::= query_specification */
   300,  /* (380) order_by_clause_opt ::= */
   300,  /* (381) order_by_clause_opt ::= ORDER BY sort_specification_list */
   301,  /* (382) slimit_clause_opt ::= */
   301,  /* (383) slimit_clause_opt ::= SLIMIT NK_INTEGER */
   301,  /* (384) slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */
   301,  /* (385) slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */
   302,  /* (386) limit_clause_opt ::= */
   302,  /* (387) limit_clause_opt ::= LIMIT NK_INTEGER */
   302,  /* (388) limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */
   302,  /* (389) limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */
   269,  /* (390) subquery ::= NK_LP query_expression NK_RP */
   285,  /* (391) search_condition ::= common_expression */
   304,  /* (392) sort_specification_list ::= sort_specification */
   304,  /* (393) sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */
   305,  /* (394) sort_specification ::= expression ordering_specification_opt null_ordering_opt */
   306,  /* (395) ordering_specification_opt ::= */
   306,  /* (396) ordering_specification_opt ::= ASC */
   306,  /* (397) ordering_specification_opt ::= DESC */
   307,  /* (398) null_ordering_opt ::= */
   307,  /* (399) null_ordering_opt ::= NULLS FIRST */
   307,  /* (400) null_ordering_opt ::= NULLS LAST */
};

/* For rule J, yyRuleInfoNRhs[J] contains the negative of the number
** of symbols on the right-hand side of that rule. */
static const signed char yyRuleInfoNRhs[] = {
   -6,  /* (0) cmd ::= CREATE ACCOUNT NK_ID PASS NK_STRING account_options */
   -4,  /* (1) cmd ::= ALTER ACCOUNT NK_ID alter_account_options */
    0,  /* (2) account_options ::= */
   -3,  /* (3) account_options ::= account_options PPS literal */
   -3,  /* (4) account_options ::= account_options TSERIES literal */
   -3,  /* (5) account_options ::= account_options STORAGE literal */
   -3,  /* (6) account_options ::= account_options STREAMS literal */
   -3,  /* (7) account_options ::= account_options QTIME literal */
   -3,  /* (8) account_options ::= account_options DBS literal */
   -3,  /* (9) account_options ::= account_options USERS literal */
   -3,  /* (10) account_options ::= account_options CONNS literal */
   -3,  /* (11) account_options ::= account_options STATE literal */
   -1,  /* (12) alter_account_options ::= alter_account_option */
   -2,  /* (13) alter_account_options ::= alter_account_options alter_account_option */
   -2,  /* (14) alter_account_option ::= PASS literal */
   -2,  /* (15) alter_account_option ::= PPS literal */
   -2,  /* (16) alter_account_option ::= TSERIES literal */
   -2,  /* (17) alter_account_option ::= STORAGE literal */
   -2,  /* (18) alter_account_option ::= STREAMS literal */
   -2,  /* (19) alter_account_option ::= QTIME literal */
   -2,  /* (20) alter_account_option ::= DBS literal */
   -2,  /* (21) alter_account_option ::= USERS literal */
   -2,  /* (22) alter_account_option ::= CONNS literal */
   -2,  /* (23) alter_account_option ::= STATE literal */
   -5,  /* (24) cmd ::= CREATE USER user_name PASS NK_STRING */
   -5,  /* (25) cmd ::= ALTER USER user_name PASS NK_STRING */
   -5,  /* (26) cmd ::= ALTER USER user_name PRIVILEGE NK_STRING */
   -3,  /* (27) cmd ::= DROP USER user_name */
   -3,  /* (28) cmd ::= CREATE DNODE dnode_endpoint */
   -5,  /* (29) cmd ::= CREATE DNODE dnode_host_name PORT NK_INTEGER */
   -3,  /* (30) cmd ::= DROP DNODE NK_INTEGER */
   -3,  /* (31) cmd ::= DROP DNODE dnode_endpoint */
   -4,  /* (32) cmd ::= ALTER DNODE NK_INTEGER NK_STRING */
   -5,  /* (33) cmd ::= ALTER DNODE NK_INTEGER NK_STRING NK_STRING */
   -4,  /* (34) cmd ::= ALTER ALL DNODES NK_STRING */
   -5,  /* (35) cmd ::= ALTER ALL DNODES NK_STRING NK_STRING */
   -1,  /* (36) dnode_endpoint ::= NK_STRING */
   -1,  /* (37) dnode_host_name ::= NK_ID */
   -1,  /* (38) dnode_host_name ::= NK_IPTOKEN */
   -3,  /* (39) cmd ::= ALTER LOCAL NK_STRING */
   -4,  /* (40) cmd ::= ALTER LOCAL NK_STRING NK_STRING */
   -5,  /* (41) cmd ::= CREATE QNODE ON DNODE NK_INTEGER */
   -5,  /* (42) cmd ::= DROP QNODE ON DNODE NK_INTEGER */
   -5,  /* (43) cmd ::= CREATE DATABASE not_exists_opt db_name db_options */
   -4,  /* (44) cmd ::= DROP DATABASE exists_opt db_name */
   -2,  /* (45) cmd ::= USE db_name */
   -4,  /* (46) cmd ::= ALTER DATABASE db_name alter_db_options */
   -3,  /* (47) not_exists_opt ::= IF NOT EXISTS */
    0,  /* (48) not_exists_opt ::= */
   -2,  /* (49) exists_opt ::= IF EXISTS */
    0,  /* (50) exists_opt ::= */
    0,  /* (51) db_options ::= */
   -3,  /* (52) db_options ::= db_options BLOCKS NK_INTEGER */
   -3,  /* (53) db_options ::= db_options CACHE NK_INTEGER */
   -3,  /* (54) db_options ::= db_options CACHELAST NK_INTEGER */
   -3,  /* (55) db_options ::= db_options COMP NK_INTEGER */
   -3,  /* (56) db_options ::= db_options DAYS NK_INTEGER */
   -3,  /* (57) db_options ::= db_options DAYS NK_VARIABLE */
   -3,  /* (58) db_options ::= db_options FSYNC NK_INTEGER */
   -3,  /* (59) db_options ::= db_options MAXROWS NK_INTEGER */
   -3,  /* (60) db_options ::= db_options MINROWS NK_INTEGER */
   -3,  /* (61) db_options ::= db_options KEEP integer_list */
   -3,  /* (62) db_options ::= db_options KEEP variable_list */
   -3,  /* (63) db_options ::= db_options PRECISION NK_STRING */
   -3,  /* (64) db_options ::= db_options QUORUM NK_INTEGER */
   -3,  /* (65) db_options ::= db_options REPLICA NK_INTEGER */
   -3,  /* (66) db_options ::= db_options TTL NK_INTEGER */
   -3,  /* (67) db_options ::= db_options WAL NK_INTEGER */
   -3,  /* (68) db_options ::= db_options VGROUPS NK_INTEGER */
   -3,  /* (69) db_options ::= db_options SINGLE_STABLE NK_INTEGER */
   -3,  /* (70) db_options ::= db_options STREAM_MODE NK_INTEGER */
   -3,  /* (71) db_options ::= db_options RETENTIONS retention_list */
   -1,  /* (72) alter_db_options ::= alter_db_option */
   -2,  /* (73) alter_db_options ::= alter_db_options alter_db_option */
   -2,  /* (74) alter_db_option ::= BLOCKS NK_INTEGER */
   -2,  /* (75) alter_db_option ::= FSYNC NK_INTEGER */
   -2,  /* (76) alter_db_option ::= KEEP integer_list */
   -2,  /* (77) alter_db_option ::= KEEP variable_list */
   -2,  /* (78) alter_db_option ::= WAL NK_INTEGER */
   -2,  /* (79) alter_db_option ::= QUORUM NK_INTEGER */
   -2,  /* (80) alter_db_option ::= CACHELAST NK_INTEGER */
   -2,  /* (81) alter_db_option ::= REPLICA NK_INTEGER */
   -1,  /* (82) integer_list ::= NK_INTEGER */
   -3,  /* (83) integer_list ::= integer_list NK_COMMA NK_INTEGER */
   -1,  /* (84) variable_list ::= NK_VARIABLE */
   -3,  /* (85) variable_list ::= variable_list NK_COMMA NK_VARIABLE */
   -1,  /* (86) retention_list ::= retention */
   -3,  /* (87) retention_list ::= retention_list NK_COMMA retention */
   -3,  /* (88) retention ::= NK_VARIABLE NK_COLON NK_VARIABLE */
   -9,  /* (89) cmd ::= CREATE TABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def_opt table_options */
   -3,  /* (90) cmd ::= CREATE TABLE multi_create_clause */
   -9,  /* (91) cmd ::= CREATE STABLE not_exists_opt full_table_name NK_LP column_def_list NK_RP tags_def table_options */
   -3,  /* (92) cmd ::= DROP TABLE multi_drop_clause */
   -4,  /* (93) cmd ::= DROP STABLE exists_opt full_table_name */
   -3,  /* (94) cmd ::= ALTER TABLE alter_table_clause */
   -3,  /* (95) cmd ::= ALTER STABLE alter_table_clause */
   -2,  /* (96) alter_table_clause ::= full_table_name alter_table_options */
   -5,  /* (97) alter_table_clause ::= full_table_name ADD COLUMN column_name type_name */
   -4,  /* (98) alter_table_clause ::= full_table_name DROP COLUMN column_name */
   -5,  /* (99) alter_table_clause ::= full_table_name MODIFY COLUMN column_name type_name */
   -5,  /* (100) alter_table_clause ::= full_table_name RENAME COLUMN column_name column_name */
   -5,  /* (101) alter_table_clause ::= full_table_name ADD TAG column_name type_name */
   -4,  /* (102) alter_table_clause ::= full_table_name DROP TAG column_name */
   -5,  /* (103) alter_table_clause ::= full_table_name MODIFY TAG column_name type_name */
   -5,  /* (104) alter_table_clause ::= full_table_name RENAME TAG column_name column_name */
   -6,  /* (105) alter_table_clause ::= full_table_name SET TAG column_name NK_EQ literal */
   -1,  /* (106) multi_create_clause ::= create_subtable_clause */
   -2,  /* (107) multi_create_clause ::= multi_create_clause create_subtable_clause */
   -9,  /* (108) create_subtable_clause ::= not_exists_opt full_table_name USING full_table_name specific_tags_opt TAGS NK_LP literal_list NK_RP */
   -1,  /* (109) multi_drop_clause ::= drop_table_clause */
   -2,  /* (110) multi_drop_clause ::= multi_drop_clause drop_table_clause */
   -2,  /* (111) drop_table_clause ::= exists_opt full_table_name */
    0,  /* (112) specific_tags_opt ::= */
   -3,  /* (113) specific_tags_opt ::= NK_LP col_name_list NK_RP */
   -1,  /* (114) full_table_name ::= table_name */
   -3,  /* (115) full_table_name ::= db_name NK_DOT table_name */
   -1,  /* (116) column_def_list ::= column_def */
   -3,  /* (117) column_def_list ::= column_def_list NK_COMMA column_def */
   -2,  /* (118) column_def ::= column_name type_name */
   -4,  /* (119) column_def ::= column_name type_name COMMENT NK_STRING */
   -1,  /* (120) type_name ::= BOOL */
   -1,  /* (121) type_name ::= TINYINT */
   -1,  /* (122) type_name ::= SMALLINT */
   -1,  /* (123) type_name ::= INT */
   -1,  /* (124) type_name ::= INTEGER */
   -1,  /* (125) type_name ::= BIGINT */
   -1,  /* (126) type_name ::= FLOAT */
   -1,  /* (127) type_name ::= DOUBLE */
   -4,  /* (128) type_name ::= BINARY NK_LP NK_INTEGER NK_RP */
   -1,  /* (129) type_name ::= TIMESTAMP */
   -4,  /* (130) type_name ::= NCHAR NK_LP NK_INTEGER NK_RP */
   -2,  /* (131) type_name ::= TINYINT UNSIGNED */
   -2,  /* (132) type_name ::= SMALLINT UNSIGNED */
   -2,  /* (133) type_name ::= INT UNSIGNED */
   -2,  /* (134) type_name ::= BIGINT UNSIGNED */
   -1,  /* (135) type_name ::= JSON */
   -4,  /* (136) type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP */
   -1,  /* (137) type_name ::= MEDIUMBLOB */
   -1,  /* (138) type_name ::= BLOB */
   -4,  /* (139) type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP */
   -1,  /* (140) type_name ::= DECIMAL */
   -4,  /* (141) type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP */
   -6,  /* (142) type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */
    0,  /* (143) tags_def_opt ::= */
   -1,  /* (144) tags_def_opt ::= tags_def */
   -4,  /* (145) tags_def ::= TAGS NK_LP column_def_list NK_RP */
    0,  /* (146) table_options ::= */
   -3,  /* (147) table_options ::= table_options COMMENT NK_STRING */
   -3,  /* (148) table_options ::= table_options KEEP integer_list */
   -3,  /* (149) table_options ::= table_options TTL NK_INTEGER */
   -5,  /* (150) table_options ::= table_options SMA NK_LP col_name_list NK_RP */
   -5,  /* (151) table_options ::= table_options ROLLUP NK_LP func_name_list NK_RP */
   -3,  /* (152) table_options ::= table_options FILE_FACTOR NK_FLOAT */
   -3,  /* (153) table_options ::= table_options DELAY NK_INTEGER */
   -1,  /* (154) alter_table_options ::= alter_table_option */
   -2,  /* (155) alter_table_options ::= alter_table_options alter_table_option */
   -2,  /* (156) alter_table_option ::= COMMENT NK_STRING */
   -2,  /* (157) alter_table_option ::= KEEP integer_list */
   -2,  /* (158) alter_table_option ::= TTL NK_INTEGER */
   -1,  /* (159) col_name_list ::= col_name */
   -3,  /* (160) col_name_list ::= col_name_list NK_COMMA col_name */
   -1,  /* (161) col_name ::= column_name */
   -2,  /* (162) cmd ::= SHOW DNODES */
   -2,  /* (163) cmd ::= SHOW USERS */
   -2,  /* (164) cmd ::= SHOW DATABASES */
   -4,  /* (165) cmd ::= SHOW db_name_cond_opt TABLES like_pattern_opt */
   -4,  /* (166) cmd ::= SHOW db_name_cond_opt STABLES like_pattern_opt */
   -3,  /* (167) cmd ::= SHOW db_name_cond_opt VGROUPS */
   -2,  /* (168) cmd ::= SHOW MNODES */
   -2,  /* (169) cmd ::= SHOW MODULES */
   -2,  /* (170) cmd ::= SHOW QNODES */
   -2,  /* (171) cmd ::= SHOW FUNCTIONS */
   -5,  /* (172) cmd ::= SHOW INDEXES FROM table_name_cond from_db_opt */
   -2,  /* (173) cmd ::= SHOW STREAMS */
   -2,  /* (174) cmd ::= SHOW ACCOUNTS */
   -2,  /* (175) cmd ::= SHOW APPS */
   -2,  /* (176) cmd ::= SHOW CONNECTIONS */
   -2,  /* (177) cmd ::= SHOW LICENCE */
   -4,  /* (178) cmd ::= SHOW CREATE DATABASE db_name */
   -4,  /* (179) cmd ::= SHOW CREATE TABLE full_table_name */
   -4,  /* (180) cmd ::= SHOW CREATE STABLE full_table_name */
   -2,  /* (181) cmd ::= SHOW QUERIES */
   -2,  /* (182) cmd ::= SHOW SCORES */
   -2,  /* (183) cmd ::= SHOW TOPICS */
   -2,  /* (184) cmd ::= SHOW VARIABLES */
    0,  /* (185) db_name_cond_opt ::= */
   -2,  /* (186) db_name_cond_opt ::= db_name NK_DOT */
    0,  /* (187) like_pattern_opt ::= */
   -2,  /* (188) like_pattern_opt ::= LIKE NK_STRING */
   -1,  /* (189) table_name_cond ::= table_name */
    0,  /* (190) from_db_opt ::= */
   -2,  /* (191) from_db_opt ::= FROM db_name */
   -1,  /* (192) func_name_list ::= func_name */
   -3,  /* (193) func_name_list ::= func_name_list NK_COMMA col_name */
   -1,  /* (194) func_name ::= function_name */
   -8,  /* (195) cmd ::= CREATE SMA INDEX not_exists_opt index_name ON table_name index_options */
  -10,  /* (196) cmd ::= CREATE FULLTEXT INDEX not_exists_opt index_name ON table_name NK_LP col_name_list NK_RP */
   -6,  /* (197) cmd ::= DROP INDEX exists_opt index_name ON table_name */
    0,  /* (198) index_options ::= */
   -9,  /* (199) index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_RP sliding_opt */
  -11,  /* (200) index_options ::= FUNCTION NK_LP func_list NK_RP INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt */
   -1,  /* (201) func_list ::= func */
   -3,  /* (202) func_list ::= func_list NK_COMMA func */
   -4,  /* (203) func ::= function_name NK_LP expression_list NK_RP */
   -6,  /* (204) cmd ::= CREATE TOPIC not_exists_opt topic_name AS query_expression */
   -6,  /* (205) cmd ::= CREATE TOPIC not_exists_opt topic_name AS db_name */
   -4,  /* (206) cmd ::= DROP TOPIC exists_opt topic_name */
   -2,  /* (207) cmd ::= DESC full_table_name */
   -2,  /* (208) cmd ::= DESCRIBE full_table_name */
   -3,  /* (209) cmd ::= RESET QUERY CACHE */
   -4,  /* (210) cmd ::= EXPLAIN analyze_opt explain_options query_expression */
    0,  /* (211) analyze_opt ::= */
   -1,  /* (212) analyze_opt ::= ANALYZE */
    0,  /* (213) explain_options ::= */
   -3,  /* (214) explain_options ::= explain_options VERBOSE NK_BOOL */
   -3,  /* (215) explain_options ::= explain_options RATIO NK_FLOAT */
   -6,  /* (216) cmd ::= COMPACT VNODES IN NK_LP integer_list NK_RP */
   -9,  /* (217) cmd ::= CREATE agg_func_opt FUNCTION function_name AS NK_STRING OUTPUTTYPE type_name bufsize_opt */
   -3,  /* (218) cmd ::= DROP FUNCTION function_name */
    0,  /* (219) agg_func_opt ::= */
   -1,  /* (220) agg_func_opt ::= AGGREGATE */
    0,  /* (221) bufsize_opt ::= */
   -2,  /* (222) bufsize_opt ::= BUFSIZE NK_INTEGER */
   -7,  /* (223) cmd ::= CREATE STREAM stream_name INTO table_name AS query_expression */
   -3,  /* (224) cmd ::= DROP STREAM stream_name */
   -3,  /* (225) cmd ::= KILL CONNECTION NK_INTEGER */
   -3,  /* (226) cmd ::= KILL QUERY NK_INTEGER */
   -4,  /* (227) cmd ::= MERGE VGROUP NK_INTEGER NK_INTEGER */
   -4,  /* (228) cmd ::= REDISTRIBUTE VGROUP NK_INTEGER dnode_list */
   -3,  /* (229) cmd ::= SPLIT VGROUP NK_INTEGER */
   -2,  /* (230) dnode_list ::= DNODE NK_INTEGER */
   -3,  /* (231) dnode_list ::= dnode_list DNODE NK_INTEGER */
   -3,  /* (232) cmd ::= SYNCDB db_name REPLICA */
   -1,  /* (233) cmd ::= query_expression */
   -1,  /* (234) literal ::= NK_INTEGER */
   -1,  /* (235) literal ::= NK_FLOAT */
   -1,  /* (236) literal ::= NK_STRING */
   -1,  /* (237) literal ::= NK_BOOL */
   -2,  /* (238) literal ::= TIMESTAMP NK_STRING */
   -1,  /* (239) literal ::= duration_literal */
   -1,  /* (240) literal ::= NULL */
   -1,  /* (241) duration_literal ::= NK_VARIABLE */
   -1,  /* (242) signed ::= NK_INTEGER */
   -2,  /* (243) signed ::= NK_PLUS NK_INTEGER */
   -2,  /* (244) signed ::= NK_MINUS NK_INTEGER */
   -1,  /* (245) signed ::= NK_FLOAT */
   -2,  /* (246) signed ::= NK_PLUS NK_FLOAT */
   -2,  /* (247) signed ::= NK_MINUS NK_FLOAT */
   -1,  /* (248) signed_literal ::= signed */
   -1,  /* (249) signed_literal ::= NK_STRING */
   -1,  /* (250) signed_literal ::= NK_BOOL */
   -2,  /* (251) signed_literal ::= TIMESTAMP NK_STRING */
   -1,  /* (252) signed_literal ::= duration_literal */
   -1,  /* (253) signed_literal ::= NULL */
   -1,  /* (254) literal_list ::= signed_literal */
   -3,  /* (255) literal_list ::= literal_list NK_COMMA signed_literal */
   -1,  /* (256) db_name ::= NK_ID */
   -1,  /* (257) table_name ::= NK_ID */
   -1,  /* (258) column_name ::= NK_ID */
   -1,  /* (259) function_name ::= NK_ID */
   -1,  /* (260) function_name ::= FIRST */
   -1,  /* (261) function_name ::= LAST */
   -1,  /* (262) table_alias ::= NK_ID */
   -1,  /* (263) column_alias ::= NK_ID */
   -1,  /* (264) user_name ::= NK_ID */
   -1,  /* (265) index_name ::= NK_ID */
   -1,  /* (266) topic_name ::= NK_ID */
   -1,  /* (267) stream_name ::= NK_ID */
   -1,  /* (268) expression ::= literal */
   -1,  /* (269) expression ::= pseudo_column */
   -1,  /* (270) expression ::= column_reference */
   -4,  /* (271) expression ::= function_name NK_LP expression_list NK_RP */
   -4,  /* (272) expression ::= function_name NK_LP NK_STAR NK_RP */
   -6,  /* (273) expression ::= function_name NK_LP expression AS type_name NK_RP */
   -1,  /* (274) expression ::= subquery */
   -3,  /* (275) expression ::= NK_LP expression NK_RP */
   -2,  /* (276) expression ::= NK_PLUS expression */
   -2,  /* (277) expression ::= NK_MINUS expression */
   -3,  /* (278) expression ::= expression NK_PLUS expression */
   -3,  /* (279) expression ::= expression NK_MINUS expression */
   -3,  /* (280) expression ::= expression NK_STAR expression */
   -3,  /* (281) expression ::= expression NK_SLASH expression */
   -3,  /* (282) expression ::= expression NK_REM expression */
   -1,  /* (283) expression_list ::= expression */
   -3,  /* (284) expression_list ::= expression_list NK_COMMA expression */
   -1,  /* (285) column_reference ::= column_name */
   -3,  /* (286) column_reference ::= table_name NK_DOT column_name */
   -1,  /* (287) pseudo_column ::= NOW */
   -1,  /* (288) pseudo_column ::= ROWTS */
   -1,  /* (289) pseudo_column ::= TBNAME */
   -1,  /* (290) pseudo_column ::= QSTARTTS */
   -1,  /* (291) pseudo_column ::= QENDTS */
   -1,  /* (292) pseudo_column ::= WSTARTTS */
   -1,  /* (293) pseudo_column ::= WENDTS */
   -1,  /* (294) pseudo_column ::= WDURATION */
   -3,  /* (295) predicate ::= expression compare_op expression */
   -5,  /* (296) predicate ::= expression BETWEEN expression AND expression */
   -6,  /* (297) predicate ::= expression NOT BETWEEN expression AND expression */
   -3,  /* (298) predicate ::= expression IS NULL */
   -4,  /* (299) predicate ::= expression IS NOT NULL */
   -3,  /* (300) predicate ::= expression in_op in_predicate_value */
   -1,  /* (301) compare_op ::= NK_LT */
   -1,  /* (302) compare_op ::= NK_GT */
   -1,  /* (303) compare_op ::= NK_LE */
   -1,  /* (304) compare_op ::= NK_GE */
   -1,  /* (305) compare_op ::= NK_NE */
   -1,  /* (306) compare_op ::= NK_EQ */
   -1,  /* (307) compare_op ::= LIKE */
   -2,  /* (308) compare_op ::= NOT LIKE */
   -1,  /* (309) compare_op ::= MATCH */
   -1,  /* (310) compare_op ::= NMATCH */
   -1,  /* (311) in_op ::= IN */
   -2,  /* (312) in_op ::= NOT IN */
   -3,  /* (313) in_predicate_value ::= NK_LP expression_list NK_RP */
   -1,  /* (314) boolean_value_expression ::= boolean_primary */
   -2,  /* (315) boolean_value_expression ::= NOT boolean_primary */
   -3,  /* (316) boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */
   -3,  /* (317) boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */
   -1,  /* (318) boolean_primary ::= predicate */
   -3,  /* (319) boolean_primary ::= NK_LP boolean_value_expression NK_RP */
   -1,  /* (320) common_expression ::= expression */
   -1,  /* (321) common_expression ::= boolean_value_expression */
   -2,  /* (322) from_clause ::= FROM table_reference_list */
   -1,  /* (323) table_reference_list ::= table_reference */
   -3,  /* (324) table_reference_list ::= table_reference_list NK_COMMA table_reference */
   -1,  /* (325) table_reference ::= table_primary */
   -1,  /* (326) table_reference ::= joined_table */
   -2,  /* (327) table_primary ::= table_name alias_opt */
   -4,  /* (328) table_primary ::= db_name NK_DOT table_name alias_opt */
   -2,  /* (329) table_primary ::= subquery alias_opt */
   -1,  /* (330) table_primary ::= parenthesized_joined_table */
    0,  /* (331) alias_opt ::= */
   -1,  /* (332) alias_opt ::= table_alias */
   -2,  /* (333) alias_opt ::= AS table_alias */
   -3,  /* (334) parenthesized_joined_table ::= NK_LP joined_table NK_RP */
   -3,  /* (335) parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */
   -6,  /* (336) joined_table ::= table_reference join_type JOIN table_reference ON search_condition */
    0,  /* (337) join_type ::= */
   -1,  /* (338) join_type ::= INNER */
   -9,  /* (339) 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 */
    0,  /* (340) set_quantifier_opt ::= */
   -1,  /* (341) set_quantifier_opt ::= DISTINCT */
   -1,  /* (342) set_quantifier_opt ::= ALL */
   -1,  /* (343) select_list ::= NK_STAR */
   -1,  /* (344) select_list ::= select_sublist */
   -1,  /* (345) select_sublist ::= select_item */
   -3,  /* (346) select_sublist ::= select_sublist NK_COMMA select_item */
   -1,  /* (347) select_item ::= common_expression */
   -2,  /* (348) select_item ::= common_expression column_alias */
   -3,  /* (349) select_item ::= common_expression AS column_alias */
   -3,  /* (350) select_item ::= table_name NK_DOT NK_STAR */
    0,  /* (351) where_clause_opt ::= */
   -2,  /* (352) where_clause_opt ::= WHERE search_condition */
    0,  /* (353) partition_by_clause_opt ::= */
   -3,  /* (354) partition_by_clause_opt ::= PARTITION BY expression_list */
    0,  /* (355) twindow_clause_opt ::= */
   -6,  /* (356) twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA duration_literal NK_RP */
   -4,  /* (357) twindow_clause_opt ::= STATE_WINDOW NK_LP expression NK_RP */
   -6,  /* (358) twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt */
   -8,  /* (359) twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt */
    0,  /* (360) sliding_opt ::= */
   -4,  /* (361) sliding_opt ::= SLIDING NK_LP duration_literal NK_RP */
    0,  /* (362) fill_opt ::= */
   -4,  /* (363) fill_opt ::= FILL NK_LP fill_mode NK_RP */
   -6,  /* (364) fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP */
   -1,  /* (365) fill_mode ::= NONE */
   -1,  /* (366) fill_mode ::= PREV */
   -1,  /* (367) fill_mode ::= NULL */
   -1,  /* (368) fill_mode ::= LINEAR */
   -1,  /* (369) fill_mode ::= NEXT */
    0,  /* (370) group_by_clause_opt ::= */
   -3,  /* (371) group_by_clause_opt ::= GROUP BY group_by_list */
   -1,  /* (372) group_by_list ::= expression */
   -3,  /* (373) group_by_list ::= group_by_list NK_COMMA expression */
    0,  /* (374) having_clause_opt ::= */
   -2,  /* (375) having_clause_opt ::= HAVING search_condition */
   -4,  /* (376) query_expression ::= query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt */
   -1,  /* (377) query_expression_body ::= query_primary */
   -4,  /* (378) query_expression_body ::= query_expression_body UNION ALL query_expression_body */
   -1,  /* (379) query_primary ::= query_specification */
    0,  /* (380) order_by_clause_opt ::= */
   -3,  /* (381) order_by_clause_opt ::= ORDER BY sort_specification_list */
    0,  /* (382) slimit_clause_opt ::= */
   -2,  /* (383) slimit_clause_opt ::= SLIMIT NK_INTEGER */
   -4,  /* (384) slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */
   -4,  /* (385) slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */
    0,  /* (386) limit_clause_opt ::= */
   -2,  /* (387) limit_clause_opt ::= LIMIT NK_INTEGER */
   -4,  /* (388) limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */
   -4,  /* (389) limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */
   -3,  /* (390) subquery ::= NK_LP query_expression NK_RP */
   -1,  /* (391) search_condition ::= common_expression */
   -1,  /* (392) sort_specification_list ::= sort_specification */
   -3,  /* (393) sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */
   -3,  /* (394) sort_specification ::= expression ordering_specification_opt null_ordering_opt */
    0,  /* (395) ordering_specification_opt ::= */
   -1,  /* (396) ordering_specification_opt ::= ASC */
   -1,  /* (397) ordering_specification_opt ::= DESC */
    0,  /* (398) null_ordering_opt ::= */
   -2,  /* (399) null_ordering_opt ::= NULLS FIRST */
   -2,  /* (400) null_ordering_opt ::= NULLS LAST */
2872 2873 2874 2875 2876 2877 2878 2879 2880 2881 2882 2883 2884 2885 2886 2887 2888 2889
};

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

  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;
4225 4226
  }
/************ End %syntax_error code ******************************************/
X
Xiaoyu Wang 已提交
4227 4228
  ParseARG_STORE /* Suppress warning about unused %extra_argument variable */
  ParseCTX_STORE
4229 4230 4231 4232 4233 4234 4235 4236
}

/*
** The following is executed when the parser accepts
*/
static void yy_accept(
  yyParser *yypParser           /* The parser */
){
X
Xiaoyu Wang 已提交
4237 4238
  ParseARG_FETCH
  ParseCTX_FETCH
4239 4240 4241 4242 4243 4244 4245 4246 4247 4248 4249 4250 4251
#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 已提交
4252 4253
  ParseARG_STORE /* Suppress warning about unused %extra_argument variable */
  ParseCTX_STORE
4254 4255 4256 4257
}

/* The main parser program.
** The first argument is a pointer to a structure obtained from
X
Xiaoyu Wang 已提交
4258
** "ParseAlloc" which describes the current state of the parser.
4259 4260 4261 4262 4263 4264 4265 4266 4267 4268 4269 4270 4271 4272 4273 4274
** 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 已提交
4275
void Parse(
4276 4277
  void *yyp,                   /* The parser */
  int yymajor,                 /* The major token code number */
X
Xiaoyu Wang 已提交
4278 4279
  ParseTOKENTYPE yyminor       /* The value for the token */
  ParseARG_PDECL               /* Optional %extra_argument parameter */
4280 4281 4282 4283 4284 4285 4286 4287 4288 4289
){
  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 已提交
4290 4291
  ParseCTX_FETCH
  ParseARG_STORE
4292 4293 4294 4295 4296 4297 4298 4299 4300 4301 4302 4303 4304 4305 4306 4307 4308 4309 4310 4311 4312 4313 4314 4315

  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 已提交
4316
                        yyminor ParseCTX_PARAM);
4317 4318 4319 4320 4321 4322 4323 4324 4325 4326 4327 4328 4329 4330 4331 4332 4333 4334 4335 4336 4337 4338 4339 4340 4341 4342 4343 4344 4345 4346 4347 4348 4349 4350 4351 4352 4353 4354 4355 4356 4357 4358 4359 4360 4361 4362 4363 4364 4365 4366 4367 4368 4369 4370 4371 4372 4373 4374 4375 4376 4377 4378 4379 4380 4381 4382 4383 4384 4385 4386 4387 4388 4389 4390 4391 4392 4393 4394 4395 4396 4397 4398 4399 4400 4401 4402 4403 4404 4405 4406 4407 4408 4409 4410 4411 4412 4413 4414 4415 4416 4417 4418 4419 4420 4421 4422 4423 4424 4425 4426 4427 4428 4429 4430 4431 4432 4433 4434 4435 4436 4437 4438 4439 4440 4441 4442 4443 4444 4445 4446 4447 4448
    }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 已提交
4449
int ParseFallback(int iToken){
4450
#ifdef YYFALLBACK
4451 4452
  assert( iToken<(int)(sizeof(yyFallback)/sizeof(yyFallback[0])) );
  return yyFallback[iToken];
4453 4454 4455
#else
  (void)iToken;
  return 0;
4456
#endif
4457
}