/* This file is automatically generated by Lemon from input grammar
** source file "sql.y". */
/*
** 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:
*/
/************ Begin %include sections from the grammar ************************/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include <stdbool.h>
#include "qSqlparser.h"
#include "tcmdtype.h"
#include "ttoken.h"
#include "ttokendef.h"
#include "tutil.h"
#include "tvariant.h"
/**************** End of %include directives **********************************/
/* These constants specify the various numeric values for terminal symbols.
***************** Begin token definitions *************************************/
#ifndef TK_ID
#define TK_ID                              1
#define TK_BOOL                            2
#define TK_TINYINT                         3
#define TK_SMALLINT                        4
#define TK_INTEGER                         5
#define TK_BIGINT                          6
#define TK_FLOAT                           7
#define TK_DOUBLE                          8
#define TK_STRING                          9
#define TK_TIMESTAMP                      10
#define TK_BINARY                         11
#define TK_NCHAR                          12
#define TK_JSON                           13
#define TK_OR                             14
#define TK_AND                            15
#define TK_NOT                            16
#define TK_EQ                             17
#define TK_NE                             18
#define TK_ISNULL                         19
#define TK_NOTNULL                        20
#define TK_IS                             21
#define TK_LIKE                           22
#define TK_MATCH                          23
#define TK_NMATCH                         24
#define TK_CONTAINS                       25
#define TK_GLOB                           26
#define TK_BETWEEN                        27
#define TK_IN                             28
#define TK_GT                             29
#define TK_GE                             30
#define TK_LT                             31
#define TK_LE                             32
#define TK_BITAND                         33
#define TK_BITOR                          34
#define TK_LSHIFT                         35
#define TK_RSHIFT                         36
#define TK_PLUS                           37
#define TK_MINUS                          38
#define TK_DIVIDE                         39
#define TK_TIMES                          40
#define TK_STAR                           41
#define TK_SLASH                          42
#define TK_REM                            43
#define TK_UMINUS                         44
#define TK_UPLUS                          45
#define TK_BITNOT                         46
#define TK_ARROW                          47
#define TK_SHOW                           48
#define TK_DATABASES                      49
#define TK_TOPICS                         50
#define TK_FUNCTIONS                      51
#define TK_MNODES                         52
#define TK_DNODES                         53
#define TK_ACCOUNTS                       54
#define TK_USERS                          55
#define TK_MODULES                        56
#define TK_QUERIES                        57
#define TK_CONNECTIONS                    58
#define TK_STREAMS                        59
#define TK_VARIABLES                      60
#define TK_SCORES                         61
#define TK_GRANTS                         62
#define TK_VNODES                         63
#define TK_DOT                            64
#define TK_CREATE                         65
#define TK_TABLE                          66
#define TK_STABLE                         67
#define TK_DATABASE                       68
#define TK_TABLES                         69
#define TK_STABLES                        70
#define TK_VGROUPS                        71
#define TK_DROP                           72
#define TK_TOPIC                          73
#define TK_FUNCTION                       74
#define TK_DNODE                          75
#define TK_USER                           76
#define TK_ACCOUNT                        77
#define TK_USE                            78
#define TK_DESCRIBE                       79
#define TK_DESC                           80
#define TK_ALTER                          81
#define TK_PASS                           82
#define TK_PRIVILEGE                      83
#define TK_LOCAL                          84
#define TK_COMPACT                        85
#define TK_LP                             86
#define TK_RP                             87
#define TK_IF                             88
#define TK_EXISTS                         89
#define TK_AS                             90
#define TK_OUTPUTTYPE                     91
#define TK_AGGREGATE                      92
#define TK_BUFSIZE                        93
#define TK_PPS                            94
#define TK_TSERIES                        95
#define TK_DBS                            96
#define TK_STORAGE                        97
#define TK_QTIME                          98
#define TK_CONNS                          99
#define TK_STATE                          100
#define TK_COMMA                          101
#define TK_KEEP                           102
#define TK_CACHE                          103
#define TK_REPLICA                        104
#define TK_QUORUM                         105
#define TK_DAYS                           106
#define TK_MINROWS                        107
#define TK_MAXROWS                        108
#define TK_BLOCKS                         109
#define TK_CTIME                          110
#define TK_WAL                            111
#define TK_FSYNC                          112
#define TK_COMP                           113
#define TK_PRECISION                      114
#define TK_UPDATE                         115
#define TK_CACHELAST                      116
#define TK_PARTITIONS                     117
#define TK_UNSIGNED                       118
#define TK_TAGS                           119
#define TK_USING                          120
#define TK_NULL                           121
#define TK_NOW                            122
#define TK_VARIABLE                       123
#define TK_SELECT                         124
#define TK_UNION                          125
#define TK_ALL                            126
#define TK_DISTINCT                       127
#define TK_FROM                           128
#define TK_RANGE                          129
#define TK_INTERVAL                       130
#define TK_EVERY                          131
#define TK_SESSION                        132
#define TK_STATE_WINDOW                   133
#define TK_FILL                           134
#define TK_SLIDING                        135
#define TK_ORDER                          136
#define TK_BY                             137
#define TK_ASC                            138
#define TK_GROUP                          139
#define TK_HAVING                         140
#define TK_LIMIT                          141
#define TK_OFFSET                         142
#define TK_SLIMIT                         143
#define TK_SOFFSET                        144
#define TK_WHERE                          145
#define TK_RESET                          146
#define TK_QUERY                          147
#define TK_SYNCDB                         148
#define TK_ADD                            149
#define TK_COLUMN                         150
#define TK_MODIFY                         151
#define TK_TAG                            152
#define TK_CHANGE                         153
#define TK_SET                            154
#define TK_KILL                           155
#define TK_CONNECTION                     156
#define TK_STREAM                         157
#define TK_COLON                          158
#define TK_ABORT                          159
#define TK_AFTER                          160
#define TK_ATTACH                         161
#define TK_BEFORE                         162
#define TK_BEGIN                          163
#define TK_CASCADE                        164
#define TK_CLUSTER                        165
#define TK_CONFLICT                       166
#define TK_COPY                           167
#define TK_DEFERRED                       168
#define TK_DELIMITERS                     169
#define TK_DETACH                         170
#define TK_EACH                           171
#define TK_END                            172
#define TK_EXPLAIN                        173
#define TK_FAIL                           174
#define TK_FOR                            175
#define TK_IGNORE                         176
#define TK_IMMEDIATE                      177
#define TK_INITIALLY                      178
#define TK_INSTEAD                        179
#define TK_KEY                            180
#define TK_OF                             181
#define TK_RAISE                          182
#define TK_REPLACE                        183
#define TK_RESTRICT                       184
#define TK_ROW                            185
#define TK_STATEMENT                      186
#define TK_TRIGGER                        187
#define TK_VIEW                           188
#define TK_IPTOKEN                        189
#define TK_SEMI                           190
#define TK_NONE                           191
#define TK_PREV                           192
#define TK_LINEAR                         193
#define TK_IMPORT                         194
#define TK_TBNAME                         195
#define TK_JOIN                           196
#define TK_INSERT                         197
#define TK_INTO                           198
#define TK_VALUES                         199
#define TK_FILE                           200
#endif
/**************** End 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.
**    ParseTOKENTYPE     is the data type used for minor type for terminal
**                       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
**                       which is ParseTOKENTYPE.  The entry in the union
**                       for terminal symbols is called "yy0".
**    YYSTACKDEPTH       is the maximum depth of the parser's stack.  If
**                       zero the stack is dynamically sized using realloc()
**    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
**    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 *****************************************/
#define YYCODETYPE unsigned short int
#define YYNOCODE 284
#define YYACTIONTYPE unsigned short int
#define ParseTOKENTYPE SStrToken
typedef union {
  int yyinit;
  ParseTOKENTYPE yy0;
  SCreateTableSql* yy6;
  SSqlNode* yy16;
  tSqlExpr* yy18;
  SIntervalVal yy32;
  SRelationInfo* yy36;
  SLimitVal yy38;
  SCreateAcctInfo yy51;
  int64_t yy69;
  SRangeVal yy124;
  SSessionWindowVal yy155;
  tVariant yy162;
  SArray* yy189;
  SCreatedTableInfo yy208;
  TAOS_FIELD yy279;
  SWindowStateVal yy336;
  int yy420;
  SCreateDbInfo yy470;
  int32_t yy516;
} YYMINORTYPE;
#ifndef YYSTACKDEPTH
#define YYSTACKDEPTH 100
#endif
#define ParseARG_SDECL SSqlInfo* pInfo;
#define ParseARG_PDECL ,SSqlInfo* pInfo
#define ParseARG_PARAM ,pInfo
#define ParseARG_FETCH SSqlInfo* pInfo=yypParser->pInfo;
#define ParseARG_STORE yypParser->pInfo=pInfo;
#define ParseCTX_SDECL
#define ParseCTX_PDECL
#define ParseCTX_PARAM
#define ParseCTX_FETCH
#define ParseCTX_STORE
#define YYFALLBACK 1
#define YYNSTATE             393
#define YYNRULE              315
#define YYNRULE_WITH_ACTION  315
#define YYNTOKEN             201
#define YY_MAX_SHIFT         392
#define YY_MIN_SHIFTREDUCE   617
#define YY_MAX_SHIFTREDUCE   931
#define YY_ERROR_ACTION      932
#define YY_ACCEPT_ACTION     933
#define YY_NO_ACTION         934
#define YY_MIN_REDUCE        935
#define YY_MAX_REDUCE        1249
/************* 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 **********************************************/
#define YY_ACTTAB_COUNT (858)
static const YYACTIONTYPE yy_action[] = {
 /*     0 */   102,  668,  668, 1166,  161, 1167,  312,  810,  260,  669,
 /*    10 */   669,  813,  391,  241,   37,   38,   24,   41,   42, 1084,
 /*    20 */  1076,  263,   31,   30,   29, 1089, 1223,   40,  344,   45,
 /*    30 */    43,   46,   44, 1073, 1074,   55, 1077,   36,   35,  298,
 /*    40 */   299,   34,   33,   32,   37,   38,  213,   41,   42,  250,
 /*    50 */    84,  263,   31,   30,   29,  214, 1223,   40,  344,   45,
 /*    60 */    43,   46,   44,  933,  392, 1223,  256,   36,   35,  211,
 /*    70 */   215,   34,   33,   32,  293,  292,  128,  122,  133, 1223,
 /*    80 */  1223, 1226, 1225,  132, 1075,  138,  141,  131,   37,   38,
 /*    90 */    85,   41,   42,  983,  135,  263,   31,   30,   29,  668,
 /*   100 */   196,   40,  344,   45,   43,   46,   44,  669,  340,  287,
 /*   110 */    13,   36,   35, 1105,  101,   34,   33,   32,   37,   38,
 /*   120 */    58,   41,   42,   60,  246,  263,   31,   30,   29,  220,
 /*   130 */   286,   40,  344,   45,   43,   46,   44,  316,   97, 1223,
 /*   140 */    96,   36,   35,  668,  104,   34,   33,   32,  340,   37,
 /*   150 */    39,  669,   41,   42, 1105,  176,  263,   31,   30,   29,
 /*   160 */  1114,  862,   40,  344,   45,   43,   46,   44,   34,   33,
 /*   170 */    32,  244,   36,   35,  302,  221,   34,   33,   32,  206,
 /*   180 */   204,  202,  379,   59,   51, 1223,  201,  148,  147,  146,
 /*   190 */   145,  618,  619,  620,  621,  622,  623,  624,  625,  626,
 /*   200 */   627,  628,  629,  630,  631,  159,  993,  242,   38,  278,
 /*   210 */    41,   42,   59,  196,  263,   31,   30,   29,  282,  281,
 /*   220 */    40,  344,   45,   43,   46,   44,  984,  222,  243, 1111,
 /*   230 */    36,   35, 1087,  196,   34,   33,   32, 1223,   41,   42,
 /*   240 */   387, 1021,  263,   31,   30,   29,  822,  823,   40,  344,
 /*   250 */    45,   43,   46,   44,  390,  389,  645,  253,   36,   35,
 /*   260 */   704, 1087,   34,   33,   32,   67,  338,  386,  385,  337,
 /*   270 */   336,  335,  384,  334,  333,  332,  383,  331,  382,  381,
 /*   280 */  1052, 1040, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1048,
 /*   290 */  1049, 1050, 1051, 1053, 1054,  234,  877,   25, 1215,  866,
 /*   300 */  1164,  869, 1165,  872,  776,   59,   59,  773, 1223,  774,
 /*   310 */   868,  775,  871,  867,  219,  870,  234,  877,   59, 1245,
 /*   320 */   866,  227,  869, 1214,  872,  342,  266,  144,  143,  142,
 /*   330 */   226,  239,  240, 1223,  352,   91,    5,   62,  186,  268,
 /*   340 */   269,  259,  315,  185,  111,  116,  107,  115,  272,   59,
 /*   350 */   254,  356,  239,  240, 1087, 1087,  346,   45,   43,   46,
 /*   360 */    44,   67,  327,  386,  385,   36,   35, 1086,  384,   34,
 /*   370 */    33,   32,  383,   68,  382,  381,  100,   59,  264, 1060,
 /*   380 */    47, 1058, 1059,   36,   35, 1237, 1061,   34,   33,   32,
 /*   390 */  1062,   86, 1063, 1064,  357,  285,  343,   83, 1087,   59,
 /*   400 */   752,   47,  215,  267,  235,  265,  248,  355,  354,   59,
 /*   410 */  1090,   59, 1223,  294, 1226,  878,  873,  874,  342,   59,
 /*   420 */    59,   91,  358,  777,  270,  274, 1087,  271,  875,  364,
 /*   430 */   363,  876,  369,  368,  273,  262,  878,  873,  874,  215,
 /*   440 */   158,  156,  155,  255,  359,  182,  257, 1090, 1087, 1223,
 /*   450 */  1090, 1226, 1213,  237,  365,  130,  366,    6, 1087,   68,
 /*   460 */  1087,  238, 1223, 1223,  367,  371,  217,  379, 1087, 1087,
 /*   470 */   218, 1223,  223,  216,  224,  225, 1223, 1105,  105,  794,
 /*   480 */  1223,  229, 1223, 1223, 1223, 1223,  230,  273,  842,  231,
 /*   490 */   228, 1223,  791,  212,  245,  273, 1223,   88,  183, 1223,
 /*   500 */  1223,  273,   99, 1223,   98,   89,  345,    1,  184,  819,
 /*   510 */     3,  197, 1088,  829, 1078,  297,  296,  830,   76,   10,
 /*   520 */   762,   79,  319,  163,  764,  349,  321,   71,  763,  261,
 /*   530 */    54,   48,  348,  906,   60,  289,   60,  879,   71,  667,
 /*   540 */   103,  295,   71,  289, 1177,   82,  841,    9,   15, 1176,
 /*   550 */    14,    9,  251,    9,  347,  121,   17,  120,   16,  361,
 /*   560 */   360,   77,   80,  322,  783,  798,  784, 1173,  781,  865,
 /*   570 */   782,   19, 1172,   18,  127,  252,  126,  751,   21,  370,
 /*   580 */    20,  140,  139,  283,  160, 1113,   26, 1124, 1121, 1122,
 /*   590 */  1106,  290, 1126,  162, 1156,  167,  308, 1155, 1154, 1153,
 /*   600 */   178, 1085,  179, 1083,  180,  181,  998,  324,  157,  809,
 /*   610 */   325, 1103,  326,  301,  329,  330,   69,  209,   65,  341,
 /*   620 */   168,  169,  992,  247,  303,  317,  353,  305, 1244,   81,
 /*   630 */   882,   28,  118,   78, 1243, 1240,  170,  187,  171,  362,
 /*   640 */   313,  172,  311, 1236,  309,  124, 1235,  307, 1232,  173,
 /*   650 */   188, 1018,   66,  304,   61,  175,   70,  210,  980,  134,
 /*   660 */   978,  136,  300,  137,  976,  975,  275,  199,  200,  972,
 /*   670 */   971,  970,  969,  968,  967,  966,  203,  205,  962,  960,
 /*   680 */   958,   27,  207,  955,  208,  951,  328,  174,  288,   87,
 /*   690 */    92,  380,  306,  373,  129,  372,  374,  375,  236,  376,
 /*   700 */   258,  323,  377,  378,  388,  931,  276,  232,  277,  930,
 /*   710 */   233,  279,  997,  996,  112,  113,  280,  929,  912,  284,
 /*   720 */   911,  318,  289,   11,   90,  291,  786,   52,  974,  973,
 /*   730 */  1019,  191,  149,  189,  190,  192,  193,  195,  150,  194,
 /*   740 */   965,    2, 1056,  151,  964,    4,  152, 1020,  957,   53,
 /*   750 */   177,  956,   93,  818,   74,  816,  815,  812, 1066,  811,
 /*   760 */    75,  166,  820,  164,  249,  831,  165,   22,  825,   94,
 /*   770 */    63,  827,   95,  310,  347,  314,   12,   64,   49,   23,
 /*   780 */   320,   50,  104,  106,   56,  682,  108,  109,   57,  110,
 /*   790 */   717,  715,  714,  713,  711,  710,  709,  706,  672,  339,
 /*   800 */   114,    7,  903,  901,  881,  904,  880,  902,    8,  883,
 /*   810 */   350,  351,   72,  754,  780,  117,  119,   60,   73,  123,
 /*   820 */   125,  779,  753,  750,  698,  696,  688,  694,  690,  692,
 /*   830 */   686,  684,  720,  719,  718,  716,  712,  708,  707,  198,
 /*   840 */   670,  635,  935,  934,  934,  934,  934,  934,  934,  934,
 /*   850 */   934,  934,  934,  934,  934,  934,  153,  154,
};
static const YYCODETYPE yy_lookahead[] = {
 /*     0 */   211,    1,    1,  279,  203,  281,  282,    5,  210,    9,
 /*    10 */     9,    9,  203,  204,   14,   15,  271,   17,   18,  203,
 /*    20 */     0,   21,   22,   23,   24,  253,  281,   27,   28,   29,
 /*    30 */    30,   31,   32,  244,  245,  246,  247,   37,   38,   37,
 /*    40 */    38,   41,   42,   43,   14,   15,  271,   17,   18,    1,
 /*    50 */   211,   21,   22,   23,   24,  271,  281,   27,   28,   29,
 /*    60 */    30,   31,   32,  201,  202,  281,  250,   37,   38,  271,
 /*    70 */   271,   41,   42,   43,  273,  274,   66,   67,   68,  281,
 /*    80 */   281,  283,  283,   73,  245,   75,   76,   77,   14,   15,
 /*    90 */    90,   17,   18,  209,   84,   21,   22,   23,   24,    1,
 /*   100 */   216,   27,   28,   29,   30,   31,   32,    9,   88,   87,
 /*   110 */    86,   37,   38,  251,   90,   41,   42,   43,   14,   15,
 /*   120 */    90,   17,   18,  101,  122,   21,   22,   23,   24,  271,
 /*   130 */   268,   27,   28,   29,   30,   31,   32,  278,  279,  281,
 /*   140 */   281,   37,   38,    1,  120,   41,   42,   43,   88,   14,
 /*   150 */    15,    9,   17,   18,  251,  258,   21,   22,   23,   24,
 /*   160 */   203,   87,   27,   28,   29,   30,   31,   32,   41,   42,
 /*   170 */    43,  268,   37,   38,  277,  271,   41,   42,   43,   66,
 /*   180 */    67,   68,   94,  203,   86,  281,   73,   74,   75,   76,
 /*   190 */    77,   49,   50,   51,   52,   53,   54,   55,   56,   57,
 /*   200 */    58,   59,   60,   61,   62,   63,  209,   65,   15,  147,
 /*   210 */    17,   18,  203,  216,   21,   22,   23,   24,  156,  157,
 /*   220 */    27,   28,   29,   30,   31,   32,  209,  271,  248,  272,
 /*   230 */    37,   38,  252,  216,   41,   42,   43,  281,   17,   18,
 /*   240 */   225,  226,   21,   22,   23,   24,  130,  131,   27,   28,
 /*   250 */    29,   30,   31,   32,   69,   70,   71,  248,   37,   38,
 /*   260 */     5,  252,   41,   42,   43,  102,  103,  104,  105,  106,
 /*   270 */   107,  108,  109,  110,  111,  112,  113,  114,  115,  116,
 /*   280 */   227,  228,  229,  230,  231,  232,  233,  234,  235,  236,
 /*   290 */   237,  238,  239,  240,  241,    1,    2,   48,  271,    5,
 /*   300 */   279,    7,  281,    9,    2,  203,  203,    5,  281,    7,
 /*   310 */     5,    9,    7,    5,   65,    7,    1,    2,  203,  253,
 /*   320 */     5,   72,    7,  271,    9,   47,   72,   78,   79,   80,
 /*   330 */    81,   37,   38,  281,   85,   86,   66,   67,   68,   37,
 /*   340 */    38,  210,   64,   73,   74,   75,   76,   77,   72,  203,
 /*   350 */   248,  248,   37,   38,  252,  252,   41,   29,   30,   31,
 /*   360 */    32,  102,   92,  104,  105,   37,   38,  252,  109,   41,
 /*   370 */    42,   43,  113,  124,  115,  116,  254,  203,  210,  227,
 /*   380 */    86,  229,  230,   37,   38,  253,  234,   41,   42,   43,
 /*   390 */   238,  269,  240,  241,  248,  146,   25,  148,  252,  203,
 /*   400 */     5,   86,  271,  149,  155,  151,  249,  153,  154,  203,
 /*   410 */   253,  203,  281,  276,  283,  121,  122,  123,   47,  203,
 /*   420 */   203,   86,  248,  121,  122,  149,  252,  151,  123,  153,
 /*   430 */   154,  123,   37,   38,  203,   64,  121,  122,  123,  271,
 /*   440 */    66,   67,   68,  249,  248,  214,  249,  253,  252,  281,
 /*   450 */   253,  283,  271,  271,  248,   82,  248,   86,  252,  124,
 /*   460 */   252,  271,  281,  281,  248,  248,  271,   94,  252,  252,
 /*   470 */   271,  281,  271,  271,  271,  271,  281,  251,  211,   41,
 /*   480 */   281,  271,  281,  281,  281,  281,  271,  203,   80,  271,
 /*   490 */   271,  281,  101,  271,  268,  203,  281,   87,  214,  281,
 /*   500 */   281,  203,  279,  281,  281,   87,  214,  212,  213,   87,
 /*   510 */   207,  208,  214,   87,  247,   37,   38,   87,  101,  128,
 /*   520 */    87,  101,   87,  101,   87,   16,   87,  101,   87,    1,
 /*   530 */    86,  101,   25,   87,  101,  125,  101,   87,  101,   87,
 /*   540 */   101,  276,  101,  125,  243,   86,  138,  101,  150,  243,
 /*   550 */   152,  101,  243,  101,   47,  150,  150,  152,  152,   37,
 /*   560 */    38,  144,  142,  119,    5,  127,    7,  243,    5,   41,
 /*   570 */     7,  150,  243,  152,  150,  243,  152,  118,  150,  243,
 /*   580 */   152,   82,   83,  203,  203,  203,  270,  203,  203,  203,
 /*   590 */   251,  251,  203,  203,  280,  203,  203,  280,  280,  280,
 /*   600 */   255,  251,  203,  203,  203,  203,  203,  203,   64,  123,
 /*   610 */   203,  267,  203,  275,  203,  203,  203,  203,  203,  203,
 /*   620 */   266,  265,  203,  275,  275,  136,  203,  275,  203,  141,
 /*   630 */   121,  140,  203,  143,  203,  203,  264,  203,  263,  203,
 /*   640 */   139,  262,  134,  203,  133,  203,  203,  132,  203,  261,
 /*   650 */   203,  203,  203,  135,  203,  259,  203,  203,  203,  203,
 /*   660 */   203,  203,  129,  203,  203,  203,  203,  203,  203,  203,
 /*   670 */   203,  203,  203,  203,  203,  203,  203,  203,  203,  203,
 /*   680 */   203,  145,  203,  203,  203,  203,   93,  260,  205,  205,
 /*   690 */   205,  117,  205,   55,  100,   99,   96,   98,  205,   59,
 /*   700 */   205,  205,   97,   95,   88,    5,  158,  205,    5,    5,
 /*   710 */   205,  158,  215,  215,  211,  211,    5,    5,  104,  147,
 /*   720 */   103,  119,  125,   86,  126,  101,   87,   86,  205,  205,
 /*   730 */   224,  218,  206,  223,  222,  221,  219,  217,  206,  220,
 /*   740 */   205,  212,  242,  206,  205,  207,  206,  226,  205,  257,
 /*   750 */   256,  205,  101,   87,  101,  123,  123,    5,  242,    5,
 /*   760 */    86,  101,   87,   86,    1,   87,   86,  137,   87,   86,
 /*   770 */   101,   87,   86,   86,   47,    1,   86,  101,   86,  137,
 /*   780 */   119,   86,  120,   82,   91,    5,   90,   74,   91,   90,
 /*   790 */     9,    5,    5,    5,    5,    5,    5,    5,   89,   16,
 /*   800 */    82,   86,    9,    9,   87,    9,   87,    9,   86,  121,
 /*   810 */    28,   63,   17,    5,  123,  152,  152,  101,   17,  152,
 /*   820 */   152,  123,    5,   87,    5,    5,    5,    5,    5,    5,
 /*   830 */     5,    5,    5,    5,    5,    5,    5,    5,    5,  101,
 /*   840 */    89,   64,    0,  284,  284,  284,  284,  284,  284,  284,
 /*   850 */   284,  284,  284,  284,  284,  284,   22,   22,  284,  284,
 /*   860 */   284,  284,  284,  284,  284,  284,  284,  284,  284,  284,
 /*   870 */   284,  284,  284,  284,  284,  284,  284,  284,  284,  284,
 /*   880 */   284,  284,  284,  284,  284,  284,  284,  284,  284,  284,
 /*   890 */   284,  284,  284,  284,  284,  284,  284,  284,  284,  284,
 /*   900 */   284,  284,  284,  284,  284,  284,  284,  284,  284,  284,
 /*   910 */   284,  284,  284,  284,  284,  284,  284,  284,  284,  284,
 /*   920 */   284,  284,  284,  284,  284,  284,  284,  284,  284,  284,
 /*   930 */   284,  284,  284,  284,  284,  284,  284,  284,  284,  284,
 /*   940 */   284,  284,  284,  284,  284,  284,  284,  284,  284,  284,
 /*   950 */   284,  284,  284,  284,  284,  284,  284,  284,  284,  284,
 /*   960 */   284,  284,  284,  284,  284,  284,  284,  284,  284,  284,
 /*   970 */   284,  284,  284,  284,  284,  284,  284,  284,  284,  284,
 /*   980 */   284,  284,  284,  284,  284,  284,  284,  284,  284,  284,
 /*   990 */   284,  284,  284,  284,  284,  284,  284,  284,  284,  284,
 /*  1000 */   284,  284,  284,  284,  284,  284,  284,  284,  284,  284,
 /*  1010 */   284,  284,  284,  284,  284,  284,  284,  284,  284,  284,
 /*  1020 */   284,  284,  284,  284,  284,  284,  284,  284,  284,  284,
 /*  1030 */   284,  284,  284,  284,  284,  284,  284,  284,  284,  284,
 /*  1040 */   284,  284,  284,  284,  284,  284,  284,  284,  284,  284,
 /*  1050 */   284,  284,  284,  284,  284,  284,  284,  284,  284,
};
#define YY_SHIFT_COUNT    (392)
#define YY_SHIFT_MIN      (0)
#define YY_SHIFT_MAX      (842)
static const unsigned short int yy_shift_ofst[] = {
 /*     0 */   249,  163,  163,  259,  259,   60,  315,  294,  294,  294,
 /*    10 */    98,    1,    1,    1,    1,    1,    1,    1,    1,    1,
 /*    20 */     1,    1,   48,   48,    0,  142,  294,  294,  294,  294,
 /*    30 */   294,  294,  294,  294,  294,  294,  294,  294,  294,  294,
 /*    40 */   294,  294,  294,  294,  294,  294,  294,  294,  302,  302,
 /*    50 */   302,  335,  335,  116,    1,   20,    1,    1,    1,    1,
 /*    60 */     1,  373,   60,   48,   48,   88,   88,  255,  858,  858,
 /*    70 */   858,  302,  302,  302,    2,    2,  395,  395,  395,  395,
 /*    80 */   395,  395,  395,    1,    1,    1,  438,    1,    1,    1,
 /*    90 */   335,  335,    1,    1,    1,    1,  408,  408,  408,  408,
 /*   100 */   391,  335,    1,    1,    1,    1,    1,    1,    1,    1,
 /*   110 */     1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
 /*   120 */     1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
 /*   130 */     1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
 /*   140 */     1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
 /*   150 */     1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
 /*   160 */   544,  544,  544,  486,  486,  486,  486,  544,  488,  490,
 /*   170 */   489,  491,  501,  508,  511,  515,  518,  533,  536,  544,
 /*   180 */   544,  544,  593,  593,  574,   60,   60,  544,  544,  594,
 /*   190 */   596,  638,  600,  599,  640,  605,  608,  574,  255,  544,
 /*   200 */   544,  616,  616,  544,  616,  544,  616,  544,  544,  858,
 /*   210 */   858,   30,   74,  104,  104,  104,  135,  193,  221,  270,
 /*   220 */   328,  328,  328,  328,  328,  328,   10,  113,  346,  346,
 /*   230 */   346,  346,  254,  276,  371,   62,   24,  127,  127,  305,
 /*   240 */   308,  185,  374,   22,  410,  418,  478,  422,  426,  430,
 /*   250 */   278,  417,  420,  433,  435,  437,  439,  441,  444,  446,
 /*   260 */   450,  507,  528,  509,  452,  398,  405,  406,  559,  563,
 /*   270 */   522,  421,  424,  459,  428,  499,  700,  548,  703,  704,
 /*   280 */   553,  711,  712,  614,  617,  572,  597,  602,  637,  598,
 /*   290 */   639,  641,  624,  651,  666,  653,  632,  633,  752,  754,
 /*   300 */   674,  675,  677,  678,  680,  681,  660,  683,  684,  686,
 /*   310 */   763,  687,  669,  630,  727,  774,  676,  642,  690,  602,
 /*   320 */   692,  661,  695,  662,  701,  693,  696,  713,  780,  697,
 /*   330 */   699,  781,  786,  787,  788,  789,  790,  791,  792,  709,
 /*   340 */   783,  718,  793,  794,  715,  717,  719,  796,  798,  688,
 /*   350 */   722,  782,  748,  795,  663,  664,  716,  716,  716,  716,
 /*   360 */   691,  698,  801,  667,  668,  716,  716,  716,  808,  817,
 /*   370 */   736,  716,  819,  820,  821,  822,  823,  824,  825,  826,
 /*   380 */   827,  828,  829,  830,  831,  832,  833,  738,  751,  834,
 /*   390 */   835,  777,  842,
};
#define YY_REDUCE_COUNT (210)
#define YY_REDUCE_MIN   (-276)
#define YY_REDUCE_MAX   (546)
static const short yy_reduce_ofst[] = {
 /*     0 */  -138,   53,   53,  152,  152, -211, -202,  131,  168, -201,
 /*    10 */  -199,  -20,    9,  102,  103,  146,  174,  196,  206,  208,
 /*    20 */   216,  217, -276, -141,  -43, -191, -255, -225, -216, -142,
 /*    30 */   -96,  -44,   27,   52,  181,  182,  190,  195,  199,  201,
 /*    40 */   202,  203,  204,  210,  215,  218,  219,  222,  157,  194,
 /*    50 */   197,  -97,  226, -103, -184,  267,  231,  284,  292,  298,
 /*    60 */   115, -116, -161,   21,  223,   -3,   17,   15,  122,  295,
 /*    70 */   303, -228,   66,  132,  137,  265,  301,  306,  309,  324,
 /*    80 */   329,  332,  336,  380,  381,  382,  316,  384,  385,  386,
 /*    90 */   339,  340,  389,  390,  392,  393,  314,  317,  318,  319,
 /*   100 */   345,  350,  399,  400,  401,  402,  403,  404,  407,  409,
 /*   110 */   411,  412,  413,  414,  415,  416,  419,  423,  425,  429,
 /*   120 */   431,  432,  434,  436,  440,  442,  443,  445,  447,  448,
 /*   130 */   449,  451,  453,  454,  455,  456,  457,  458,  460,  461,
 /*   140 */   462,  463,  464,  465,  466,  467,  468,  469,  470,  471,
 /*   150 */   472,  473,  474,  475,  476,  477,  479,  480,  481,  482,
 /*   160 */   483,  484,  485,  338,  348,  349,  352,  487,  344,  354,
 /*   170 */   356,  372,  375,  379,  388,  427,  396,  492,  494,  493,
 /*   180 */   495,  496,  497,  498,  500,  503,  504,  502,  505,  506,
 /*   190 */   510,  512,  513,  514,  517,  519,  520,  516,  521,  523,
 /*   200 */   524,  526,  532,  535,  537,  539,  540,  543,  546,  529,
 /*   210 */   538,
};
static const YYACTIONTYPE yy_default[] = {
 /*     0 */   932, 1055,  994, 1065,  981,  991, 1228, 1228, 1228, 1228,
 /*    10 */   932,  932,  932,  932,  932,  932,  932,  932,  932,  932,
 /*    20 */   932,  932,  932,  932, 1115,  952,  932,  932,  932,  932,
 /*    30 */   932,  932,  932,  932,  932,  932,  932,  932,  932,  932,
 /*    40 */   932,  932,  932,  932,  932,  932,  932,  932,  932,  932,
 /*    50 */   932,  932,  932, 1139,  932,  991,  932,  932,  932,  932,
 /*    60 */   932, 1001,  991,  932,  932, 1001, 1001,  932, 1110, 1039,
 /*    70 */  1057,  932,  932,  932,  932,  932,  932,  932,  932,  932,
 /*    80 */   932,  932,  932,  932,  932,  932, 1117, 1123, 1120,  932,
 /*    90 */   932,  932, 1125,  932,  932,  932, 1161, 1161, 1161, 1161,
 /*   100 */  1108,  932,  932,  932,  932,  932,  932,  932,  932,  932,
 /*   110 */   932,  932,  932,  932,  932,  932,  932,  932,  932,  932,
 /*   120 */   932,  932,  932,  932,  932,  932,  932,  932,  932,  932,
 /*   130 */   932,  932,  932,  932,  979,  932,  977,  932,  932,  932,
 /*   140 */   932,  932,  932,  932,  932,  932,  932,  932,  932,  932,
 /*   150 */   932,  932,  932,  932,  932,  932,  932,  932,  932,  950,
 /*   160 */   954,  954,  954,  932,  932,  932,  932,  954, 1170, 1174,
 /*   170 */  1151, 1168, 1162, 1146, 1144, 1142, 1150, 1135, 1178,  954,
 /*   180 */   954,  954,  999,  999,  995,  991,  991,  954,  954, 1017,
 /*   190 */  1015, 1013, 1005, 1011, 1007, 1009, 1003,  982,  932,  954,
 /*   200 */   954,  989,  989,  954,  989,  954,  989,  954,  954, 1039,
 /*   210 */  1057, 1227,  932, 1179, 1169, 1227,  932, 1210, 1209,  932,
 /*   220 */  1218, 1217, 1216, 1208, 1207, 1206,  932,  932, 1202, 1205,
 /*   230 */  1204, 1203,  932,  932, 1181,  932,  932, 1212, 1211,  932,
 /*   240 */   932,  932,  932,  932,  932,  932, 1132,  932,  932,  932,
 /*   250 */  1157, 1175, 1171,  932,  932,  932,  932,  932,  932,  932,
 /*   260 */   932, 1182,  932,  932,  932,  932,  932,  932,  932,  932,
 /*   270 */  1096,  932,  932, 1067,  932,  932,  932,  932,  932,  932,
 /*   280 */   932,  932,  932,  932,  932,  932, 1107,  932,  932,  932,
 /*   290 */   932,  932, 1119, 1118,  932,  932,  932,  932,  932,  932,
 /*   300 */   932,  932,  932,  932,  932,  932,  932,  932,  932,  932,
 /*   310 */   932,  932, 1163,  932, 1158,  932, 1152,  932,  932, 1079,
 /*   320 */   932,  932,  932,  932,  932,  932,  932,  932,  932,  932,
 /*   330 */   932,  932,  932,  932,  932,  932,  932,  932,  932,  932,
 /*   340 */   932,  932,  932,  932,  932,  932,  932,  932,  932,  932,
 /*   350 */   932,  932,  932,  932,  932,  932, 1246, 1241, 1242, 1239,
 /*   360 */   932,  932,  932,  932,  932, 1238, 1233, 1234,  932,  932,
 /*   370 */   932, 1231,  932,  932,  932,  932,  932,  932,  932,  932,
 /*   380 */   932,  932,  932,  932,  932,  932,  932, 1023,  932,  961,
 /*   390 */   959,  932,  932,
};
/********** 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[] = {
    0,  /*          $ => nothing */
    0,  /*         ID => nothing */
    1,  /*       BOOL => ID */
    1,  /*    TINYINT => ID */
    1,  /*   SMALLINT => ID */
    1,  /*    INTEGER => ID */
    1,  /*     BIGINT => ID */
    1,  /*      FLOAT => ID */
    1,  /*     DOUBLE => ID */
    1,  /*     STRING => ID */
    1,  /*  TIMESTAMP => ID */
    1,  /*     BINARY => ID */
    1,  /*      NCHAR => ID */
    1,  /*       JSON => ID */
    0,  /*         OR => nothing */
    0,  /*        AND => nothing */
    0,  /*        NOT => nothing */
    0,  /*         EQ => nothing */
    0,  /*         NE => nothing */
    0,  /*     ISNULL => nothing */
    0,  /*    NOTNULL => nothing */
    0,  /*         IS => nothing */
    1,  /*       LIKE => ID */
    1,  /*      MATCH => ID */
    1,  /*     NMATCH => ID */
    0,  /*   CONTAINS => nothing */
    1,  /*       GLOB => ID */
    0,  /*    BETWEEN => nothing */
    0,  /*         IN => nothing */
    0,  /*         GT => nothing */
    0,  /*         GE => nothing */
    0,  /*         LT => nothing */
    0,  /*         LE => nothing */
    0,  /*     BITAND => nothing */
    0,  /*      BITOR => nothing */
    0,  /*     LSHIFT => nothing */
    0,  /*     RSHIFT => nothing */
    0,  /*       PLUS => nothing */
    0,  /*      MINUS => nothing */
    0,  /*     DIVIDE => nothing */
    0,  /*      TIMES => nothing */
    0,  /*       STAR => nothing */
    0,  /*      SLASH => nothing */
    0,  /*        REM => nothing */
    0,  /*     UMINUS => nothing */
    0,  /*      UPLUS => nothing */
    0,  /*     BITNOT => nothing */
    0,  /*      ARROW => nothing */
    0,  /*       SHOW => nothing */
    0,  /*  DATABASES => nothing */
    0,  /*     TOPICS => nothing */
    0,  /*  FUNCTIONS => nothing */
    0,  /*     MNODES => nothing */
    0,  /*     DNODES => nothing */
    0,  /*   ACCOUNTS => nothing */
    0,  /*      USERS => nothing */
    0,  /*    MODULES => nothing */
    0,  /*    QUERIES => nothing */
    0,  /* CONNECTIONS => nothing */
    0,  /*    STREAMS => nothing */
    0,  /*  VARIABLES => nothing */
    0,  /*     SCORES => nothing */
    0,  /*     GRANTS => nothing */
    0,  /*     VNODES => nothing */
    0,  /*        DOT => nothing */
    0,  /*     CREATE => nothing */
    0,  /*      TABLE => nothing */
    1,  /*     STABLE => ID */
    1,  /*   DATABASE => ID */
    0,  /*     TABLES => nothing */
    0,  /*    STABLES => nothing */
    0,  /*    VGROUPS => nothing */
    0,  /*       DROP => nothing */
    0,  /*      TOPIC => nothing */
    0,  /*   FUNCTION => nothing */
    0,  /*      DNODE => nothing */
    0,  /*       USER => nothing */
    0,  /*    ACCOUNT => nothing */
    0,  /*        USE => nothing */
    0,  /*   DESCRIBE => nothing */
    1,  /*       DESC => ID */
    0,  /*      ALTER => nothing */
    0,  /*       PASS => nothing */
    0,  /*  PRIVILEGE => nothing */
    0,  /*      LOCAL => nothing */
    0,  /*    COMPACT => nothing */
    0,  /*         LP => nothing */
    0,  /*         RP => nothing */
    0,  /*         IF => nothing */
    0,  /*     EXISTS => nothing */
    0,  /*         AS => nothing */
    0,  /* OUTPUTTYPE => nothing */
    0,  /*  AGGREGATE => nothing */
    0,  /*    BUFSIZE => nothing */
    0,  /*        PPS => nothing */
    0,  /*    TSERIES => nothing */
    0,  /*        DBS => nothing */
    0,  /*    STORAGE => nothing */
    0,  /*      QTIME => nothing */
    0,  /*      CONNS => nothing */
    0,  /*      STATE => nothing */
    0,  /*      COMMA => nothing */
    0,  /*       KEEP => nothing */
    0,  /*      CACHE => nothing */
    0,  /*    REPLICA => nothing */
    0,  /*     QUORUM => nothing */
    0,  /*       DAYS => nothing */
    0,  /*    MINROWS => nothing */
    0,  /*    MAXROWS => nothing */
    0,  /*     BLOCKS => nothing */
    0,  /*      CTIME => nothing */
    0,  /*        WAL => nothing */
    0,  /*      FSYNC => nothing */
    0,  /*       COMP => nothing */
    0,  /*  PRECISION => nothing */
    0,  /*     UPDATE => nothing */
    0,  /*  CACHELAST => nothing */
    0,  /* PARTITIONS => nothing */
    0,  /*   UNSIGNED => nothing */
    0,  /*       TAGS => nothing */
    0,  /*      USING => nothing */
    1,  /*       NULL => ID */
    1,  /*        NOW => ID */
    0,  /*   VARIABLE => nothing */
    0,  /*     SELECT => nothing */
    0,  /*      UNION => nothing */
    1,  /*        ALL => ID */
    0,  /*   DISTINCT => nothing */
    0,  /*       FROM => nothing */
    0,  /*      RANGE => nothing */
    0,  /*   INTERVAL => nothing */
    0,  /*      EVERY => nothing */
    0,  /*    SESSION => nothing */
    0,  /* STATE_WINDOW => nothing */
    0,  /*       FILL => nothing */
    0,  /*    SLIDING => nothing */
    0,  /*      ORDER => nothing */
    0,  /*         BY => nothing */
    1,  /*        ASC => ID */
    0,  /*      GROUP => nothing */
    0,  /*     HAVING => nothing */
    0,  /*      LIMIT => nothing */
    1,  /*     OFFSET => ID */
    0,  /*     SLIMIT => nothing */
    0,  /*    SOFFSET => nothing */
    0,  /*      WHERE => nothing */
    0,  /*      RESET => nothing */
    0,  /*      QUERY => nothing */
    0,  /*     SYNCDB => nothing */
    0,  /*        ADD => nothing */
    0,  /*     COLUMN => nothing */
    0,  /*     MODIFY => nothing */
    0,  /*        TAG => nothing */
    0,  /*     CHANGE => nothing */
    0,  /*        SET => nothing */
    0,  /*       KILL => nothing */
    0,  /* CONNECTION => nothing */
    0,  /*     STREAM => nothing */
    0,  /*      COLON => nothing */
    1,  /*      ABORT => ID */
    1,  /*      AFTER => ID */
    1,  /*     ATTACH => ID */
    1,  /*     BEFORE => ID */
    1,  /*      BEGIN => ID */
    1,  /*    CASCADE => ID */
    1,  /*    CLUSTER => ID */
    1,  /*   CONFLICT => ID */
    1,  /*       COPY => ID */
    1,  /*   DEFERRED => ID */
    1,  /* DELIMITERS => ID */
    1,  /*     DETACH => ID */
    1,  /*       EACH => ID */
    1,  /*        END => ID */
    1,  /*    EXPLAIN => ID */
    1,  /*       FAIL => ID */
    1,  /*        FOR => ID */
    1,  /*     IGNORE => ID */
    1,  /*  IMMEDIATE => ID */
    1,  /*  INITIALLY => ID */
    1,  /*    INSTEAD => ID */
    1,  /*        KEY => ID */
    1,  /*         OF => ID */
    1,  /*      RAISE => ID */
    1,  /*    REPLACE => ID */
    1,  /*   RESTRICT => ID */
    1,  /*        ROW => ID */
    1,  /*  STATEMENT => ID */
    1,  /*    TRIGGER => ID */
    1,  /*       VIEW => ID */
    1,  /*    IPTOKEN => ID */
    1,  /*       SEMI => ID */
    1,  /*       NONE => ID */
    1,  /*       PREV => ID */
    1,  /*     LINEAR => ID */
    1,  /*     IMPORT => ID */
    1,  /*     TBNAME => ID */
    1,  /*       JOIN => ID */
    1,  /*     INSERT => ID */
    1,  /*       INTO => ID */
    1,  /*     VALUES => ID */
    1,  /*       FILE => ID */
};
#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
  ParseARG_SDECL                /* A place to hold %extra_argument */
  ParseCTX_SDECL                /* A place to hold %extra_context */
#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>
#include <assert.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.
*/
void ParseTrace(FILE *TraceFILE, char *zTracePrompt){
  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 */ "$",
  /*    1 */ "ID",
  /*    2 */ "BOOL",
  /*    3 */ "TINYINT",
  /*    4 */ "SMALLINT",
  /*    5 */ "INTEGER",
  /*    6 */ "BIGINT",
  /*    7 */ "FLOAT",
  /*    8 */ "DOUBLE",
  /*    9 */ "STRING",
  /*   10 */ "TIMESTAMP",
  /*   11 */ "BINARY",
  /*   12 */ "NCHAR",
  /*   13 */ "JSON",
  /*   14 */ "OR",
  /*   15 */ "AND",
  /*   16 */ "NOT",
  /*   17 */ "EQ",
  /*   18 */ "NE",
  /*   19 */ "ISNULL",
  /*   20 */ "NOTNULL",
  /*   21 */ "IS",
  /*   22 */ "LIKE",
  /*   23 */ "MATCH",
  /*   24 */ "NMATCH",
  /*   25 */ "CONTAINS",
  /*   26 */ "GLOB",
  /*   27 */ "BETWEEN",
  /*   28 */ "IN",
  /*   29 */ "GT",
  /*   30 */ "GE",
  /*   31 */ "LT",
  /*   32 */ "LE",
  /*   33 */ "BITAND",
  /*   34 */ "BITOR",
  /*   35 */ "LSHIFT",
  /*   36 */ "RSHIFT",
  /*   37 */ "PLUS",
  /*   38 */ "MINUS",
  /*   39 */ "DIVIDE",
  /*   40 */ "TIMES",
  /*   41 */ "STAR",
  /*   42 */ "SLASH",
  /*   43 */ "REM",
  /*   44 */ "UMINUS",
  /*   45 */ "UPLUS",
  /*   46 */ "BITNOT",
  /*   47 */ "ARROW",
  /*   48 */ "SHOW",
  /*   49 */ "DATABASES",
  /*   50 */ "TOPICS",
  /*   51 */ "FUNCTIONS",
  /*   52 */ "MNODES",
  /*   53 */ "DNODES",
  /*   54 */ "ACCOUNTS",
  /*   55 */ "USERS",
  /*   56 */ "MODULES",
  /*   57 */ "QUERIES",
  /*   58 */ "CONNECTIONS",
  /*   59 */ "STREAMS",
  /*   60 */ "VARIABLES",
  /*   61 */ "SCORES",
  /*   62 */ "GRANTS",
  /*   63 */ "VNODES",
  /*   64 */ "DOT",
  /*   65 */ "CREATE",
  /*   66 */ "TABLE",
  /*   67 */ "STABLE",
  /*   68 */ "DATABASE",
  /*   69 */ "TABLES",
  /*   70 */ "STABLES",
  /*   71 */ "VGROUPS",
  /*   72 */ "DROP",
  /*   73 */ "TOPIC",
  /*   74 */ "FUNCTION",
  /*   75 */ "DNODE",
  /*   76 */ "USER",
  /*   77 */ "ACCOUNT",
  /*   78 */ "USE",
  /*   79 */ "DESCRIBE",
  /*   80 */ "DESC",
  /*   81 */ "ALTER",
  /*   82 */ "PASS",
  /*   83 */ "PRIVILEGE",
  /*   84 */ "LOCAL",
  /*   85 */ "COMPACT",
  /*   86 */ "LP",
  /*   87 */ "RP",
  /*   88 */ "IF",
  /*   89 */ "EXISTS",
  /*   90 */ "AS",
  /*   91 */ "OUTPUTTYPE",
  /*   92 */ "AGGREGATE",
  /*   93 */ "BUFSIZE",
  /*   94 */ "PPS",
  /*   95 */ "TSERIES",
  /*   96 */ "DBS",
  /*   97 */ "STORAGE",
  /*   98 */ "QTIME",
  /*   99 */ "CONNS",
  /*  100 */ "STATE",
  /*  101 */ "COMMA",
  /*  102 */ "KEEP",
  /*  103 */ "CACHE",
  /*  104 */ "REPLICA",
  /*  105 */ "QUORUM",
  /*  106 */ "DAYS",
  /*  107 */ "MINROWS",
  /*  108 */ "MAXROWS",
  /*  109 */ "BLOCKS",
  /*  110 */ "CTIME",
  /*  111 */ "WAL",
  /*  112 */ "FSYNC",
  /*  113 */ "COMP",
  /*  114 */ "PRECISION",
  /*  115 */ "UPDATE",
  /*  116 */ "CACHELAST",
  /*  117 */ "PARTITIONS",
  /*  118 */ "UNSIGNED",
  /*  119 */ "TAGS",
  /*  120 */ "USING",
  /*  121 */ "NULL",
  /*  122 */ "NOW",
  /*  123 */ "VARIABLE",
  /*  124 */ "SELECT",
  /*  125 */ "UNION",
  /*  126 */ "ALL",
  /*  127 */ "DISTINCT",
  /*  128 */ "FROM",
  /*  129 */ "RANGE",
  /*  130 */ "INTERVAL",
  /*  131 */ "EVERY",
  /*  132 */ "SESSION",
  /*  133 */ "STATE_WINDOW",
  /*  134 */ "FILL",
  /*  135 */ "SLIDING",
  /*  136 */ "ORDER",
  /*  137 */ "BY",
  /*  138 */ "ASC",
  /*  139 */ "GROUP",
  /*  140 */ "HAVING",
  /*  141 */ "LIMIT",
  /*  142 */ "OFFSET",
  /*  143 */ "SLIMIT",
  /*  144 */ "SOFFSET",
  /*  145 */ "WHERE",
  /*  146 */ "RESET",
  /*  147 */ "QUERY",
  /*  148 */ "SYNCDB",
  /*  149 */ "ADD",
  /*  150 */ "COLUMN",
  /*  151 */ "MODIFY",
  /*  152 */ "TAG",
  /*  153 */ "CHANGE",
  /*  154 */ "SET",
  /*  155 */ "KILL",
  /*  156 */ "CONNECTION",
  /*  157 */ "STREAM",
  /*  158 */ "COLON",
  /*  159 */ "ABORT",
  /*  160 */ "AFTER",
  /*  161 */ "ATTACH",
  /*  162 */ "BEFORE",
  /*  163 */ "BEGIN",
  /*  164 */ "CASCADE",
  /*  165 */ "CLUSTER",
  /*  166 */ "CONFLICT",
  /*  167 */ "COPY",
  /*  168 */ "DEFERRED",
  /*  169 */ "DELIMITERS",
  /*  170 */ "DETACH",
  /*  171 */ "EACH",
  /*  172 */ "END",
  /*  173 */ "EXPLAIN",
  /*  174 */ "FAIL",
  /*  175 */ "FOR",
  /*  176 */ "IGNORE",
  /*  177 */ "IMMEDIATE",
  /*  178 */ "INITIALLY",
  /*  179 */ "INSTEAD",
  /*  180 */ "KEY",
  /*  181 */ "OF",
  /*  182 */ "RAISE",
  /*  183 */ "REPLACE",
  /*  184 */ "RESTRICT",
  /*  185 */ "ROW",
  /*  186 */ "STATEMENT",
  /*  187 */ "TRIGGER",
  /*  188 */ "VIEW",
  /*  189 */ "IPTOKEN",
  /*  190 */ "SEMI",
  /*  191 */ "NONE",
  /*  192 */ "PREV",
  /*  193 */ "LINEAR",
  /*  194 */ "IMPORT",
  /*  195 */ "TBNAME",
  /*  196 */ "JOIN",
  /*  197 */ "INSERT",
  /*  198 */ "INTO",
  /*  199 */ "VALUES",
  /*  200 */ "FILE",
  /*  201 */ "program",
  /*  202 */ "cmd",
  /*  203 */ "ids",
  /*  204 */ "dbPrefix",
  /*  205 */ "cpxName",
  /*  206 */ "ifexists",
  /*  207 */ "alter_db_optr",
  /*  208 */ "alter_topic_optr",
  /*  209 */ "acct_optr",
  /*  210 */ "exprlist",
  /*  211 */ "ifnotexists",
  /*  212 */ "db_optr",
  /*  213 */ "topic_optr",
  /*  214 */ "typename",
  /*  215 */ "bufsize",
  /*  216 */ "pps",
  /*  217 */ "tseries",
  /*  218 */ "dbs",
  /*  219 */ "streams",
  /*  220 */ "storage",
  /*  221 */ "qtime",
  /*  222 */ "users",
  /*  223 */ "conns",
  /*  224 */ "state",
  /*  225 */ "intitemlist",
  /*  226 */ "intitem",
  /*  227 */ "keep",
  /*  228 */ "cache",
  /*  229 */ "replica",
  /*  230 */ "quorum",
  /*  231 */ "days",
  /*  232 */ "minrows",
  /*  233 */ "maxrows",
  /*  234 */ "blocks",
  /*  235 */ "ctime",
  /*  236 */ "wal",
  /*  237 */ "fsync",
  /*  238 */ "comp",
  /*  239 */ "prec",
  /*  240 */ "update",
  /*  241 */ "cachelast",
  /*  242 */ "partitions",
  /*  243 */ "signed",
  /*  244 */ "create_table_args",
  /*  245 */ "create_stable_args",
  /*  246 */ "create_table_list",
  /*  247 */ "create_from_stable",
  /*  248 */ "columnlist",
  /*  249 */ "tagitemlist",
  /*  250 */ "tagNamelist",
  /*  251 */ "select",
  /*  252 */ "column",
  /*  253 */ "tagitem",
  /*  254 */ "selcollist",
  /*  255 */ "from",
  /*  256 */ "where_opt",
  /*  257 */ "range_option",
  /*  258 */ "interval_option",
  /*  259 */ "sliding_opt",
  /*  260 */ "session_option",
  /*  261 */ "windowstate_option",
  /*  262 */ "fill_opt",
  /*  263 */ "groupby_opt",
  /*  264 */ "having_opt",
  /*  265 */ "orderby_opt",
  /*  266 */ "slimit_opt",
  /*  267 */ "limit_opt",
  /*  268 */ "union",
  /*  269 */ "sclp",
  /*  270 */ "distinct",
  /*  271 */ "expr",
  /*  272 */ "as",
  /*  273 */ "tablelist",
  /*  274 */ "sub",
  /*  275 */ "tmvar",
  /*  276 */ "timestamp",
  /*  277 */ "intervalKey",
  /*  278 */ "sortlist",
  /*  279 */ "item",
  /*  280 */ "sortorder",
  /*  281 */ "arrow",
  /*  282 */ "grouplist",
  /*  283 */ "expritem",
};
#endif /* defined(YYCOVERAGE) || !defined(NDEBUG) */

#ifndef NDEBUG
/* For tracing reduce actions, the names of all rules are required.
*/
static const char *const yyRuleName[] = {
 /*   0 */ "program ::= cmd",
 /*   1 */ "cmd ::= SHOW DATABASES",
 /*   2 */ "cmd ::= SHOW TOPICS",
 /*   3 */ "cmd ::= SHOW FUNCTIONS",
 /*   4 */ "cmd ::= SHOW MNODES",
 /*   5 */ "cmd ::= SHOW DNODES",
 /*   6 */ "cmd ::= SHOW ACCOUNTS",
 /*   7 */ "cmd ::= SHOW USERS",
 /*   8 */ "cmd ::= SHOW MODULES",
 /*   9 */ "cmd ::= SHOW QUERIES",
 /*  10 */ "cmd ::= SHOW CONNECTIONS",
 /*  11 */ "cmd ::= SHOW STREAMS",
 /*  12 */ "cmd ::= SHOW VARIABLES",
 /*  13 */ "cmd ::= SHOW SCORES",
 /*  14 */ "cmd ::= SHOW GRANTS",
 /*  15 */ "cmd ::= SHOW VNODES",
 /*  16 */ "cmd ::= SHOW VNODES ids",
 /*  17 */ "dbPrefix ::=",
 /*  18 */ "dbPrefix ::= ids DOT",
 /*  19 */ "cpxName ::=",
 /*  20 */ "cpxName ::= DOT ids",
 /*  21 */ "cmd ::= SHOW CREATE TABLE ids cpxName",
 /*  22 */ "cmd ::= SHOW CREATE STABLE ids cpxName",
 /*  23 */ "cmd ::= SHOW CREATE DATABASE ids",
 /*  24 */ "cmd ::= SHOW dbPrefix TABLES",
 /*  25 */ "cmd ::= SHOW dbPrefix TABLES LIKE ids",
 /*  26 */ "cmd ::= SHOW dbPrefix STABLES",
 /*  27 */ "cmd ::= SHOW dbPrefix STABLES LIKE ids",
 /*  28 */ "cmd ::= SHOW dbPrefix VGROUPS",
 /*  29 */ "cmd ::= DROP TABLE ifexists ids cpxName",
 /*  30 */ "cmd ::= DROP STABLE ifexists ids cpxName",
 /*  31 */ "cmd ::= DROP DATABASE ifexists ids",
 /*  32 */ "cmd ::= DROP TOPIC ifexists ids",
 /*  33 */ "cmd ::= DROP FUNCTION ids",
 /*  34 */ "cmd ::= DROP DNODE ids",
 /*  35 */ "cmd ::= DROP USER ids",
 /*  36 */ "cmd ::= DROP ACCOUNT ids",
 /*  37 */ "cmd ::= USE ids",
 /*  38 */ "cmd ::= DESCRIBE ids cpxName",
 /*  39 */ "cmd ::= DESC ids cpxName",
 /*  40 */ "cmd ::= ALTER USER ids PASS ids",
 /*  41 */ "cmd ::= ALTER USER ids PRIVILEGE ids",
 /*  42 */ "cmd ::= ALTER DNODE ids ids",
 /*  43 */ "cmd ::= ALTER DNODE ids ids ids",
 /*  44 */ "cmd ::= ALTER LOCAL ids",
 /*  45 */ "cmd ::= ALTER LOCAL ids ids",
 /*  46 */ "cmd ::= ALTER DATABASE ids alter_db_optr",
 /*  47 */ "cmd ::= ALTER TOPIC ids alter_topic_optr",
 /*  48 */ "cmd ::= ALTER ACCOUNT ids acct_optr",
 /*  49 */ "cmd ::= ALTER ACCOUNT ids PASS ids acct_optr",
 /*  50 */ "cmd ::= COMPACT VNODES IN LP exprlist RP",
 /*  51 */ "ids ::= ID",
 /*  52 */ "ids ::= STRING",
 /*  53 */ "ifexists ::= IF EXISTS",
 /*  54 */ "ifexists ::=",
 /*  55 */ "ifnotexists ::= IF NOT EXISTS",
 /*  56 */ "ifnotexists ::=",
 /*  57 */ "cmd ::= CREATE DNODE ids",
 /*  58 */ "cmd ::= CREATE ACCOUNT ids PASS ids acct_optr",
 /*  59 */ "cmd ::= CREATE DATABASE ifnotexists ids db_optr",
 /*  60 */ "cmd ::= CREATE TOPIC ifnotexists ids topic_optr",
 /*  61 */ "cmd ::= CREATE FUNCTION ids AS ids OUTPUTTYPE typename bufsize",
 /*  62 */ "cmd ::= CREATE AGGREGATE FUNCTION ids AS ids OUTPUTTYPE typename bufsize",
 /*  63 */ "cmd ::= CREATE USER ids PASS ids",
 /*  64 */ "bufsize ::=",
 /*  65 */ "bufsize ::= BUFSIZE INTEGER",
 /*  66 */ "pps ::=",
 /*  67 */ "pps ::= PPS INTEGER",
 /*  68 */ "tseries ::=",
 /*  69 */ "tseries ::= TSERIES INTEGER",
 /*  70 */ "dbs ::=",
 /*  71 */ "dbs ::= DBS INTEGER",
 /*  72 */ "streams ::=",
 /*  73 */ "streams ::= STREAMS INTEGER",
 /*  74 */ "storage ::=",
 /*  75 */ "storage ::= STORAGE INTEGER",
 /*  76 */ "qtime ::=",
 /*  77 */ "qtime ::= QTIME INTEGER",
 /*  78 */ "users ::=",
 /*  79 */ "users ::= USERS INTEGER",
 /*  80 */ "conns ::=",
 /*  81 */ "conns ::= CONNS INTEGER",
 /*  82 */ "state ::=",
 /*  83 */ "state ::= STATE ids",
 /*  84 */ "acct_optr ::= pps tseries storage streams qtime dbs users conns state",
 /*  85 */ "intitemlist ::= intitemlist COMMA intitem",
 /*  86 */ "intitemlist ::= intitem",
 /*  87 */ "intitem ::= INTEGER",
 /*  88 */ "keep ::= KEEP intitemlist",
 /*  89 */ "cache ::= CACHE INTEGER",
 /*  90 */ "replica ::= REPLICA INTEGER",
 /*  91 */ "quorum ::= QUORUM INTEGER",
 /*  92 */ "days ::= DAYS INTEGER",
 /*  93 */ "minrows ::= MINROWS INTEGER",
 /*  94 */ "maxrows ::= MAXROWS INTEGER",
 /*  95 */ "blocks ::= BLOCKS INTEGER",
 /*  96 */ "ctime ::= CTIME INTEGER",
 /*  97 */ "wal ::= WAL INTEGER",
 /*  98 */ "fsync ::= FSYNC INTEGER",
 /*  99 */ "comp ::= COMP INTEGER",
 /* 100 */ "prec ::= PRECISION STRING",
 /* 101 */ "update ::= UPDATE INTEGER",
 /* 102 */ "cachelast ::= CACHELAST INTEGER",
 /* 103 */ "partitions ::= PARTITIONS INTEGER",
 /* 104 */ "db_optr ::=",
 /* 105 */ "db_optr ::= db_optr cache",
 /* 106 */ "db_optr ::= db_optr replica",
 /* 107 */ "db_optr ::= db_optr quorum",
 /* 108 */ "db_optr ::= db_optr days",
 /* 109 */ "db_optr ::= db_optr minrows",
 /* 110 */ "db_optr ::= db_optr maxrows",
 /* 111 */ "db_optr ::= db_optr blocks",
 /* 112 */ "db_optr ::= db_optr ctime",
 /* 113 */ "db_optr ::= db_optr wal",
 /* 114 */ "db_optr ::= db_optr fsync",
 /* 115 */ "db_optr ::= db_optr comp",
 /* 116 */ "db_optr ::= db_optr prec",
 /* 117 */ "db_optr ::= db_optr keep",
 /* 118 */ "db_optr ::= db_optr update",
 /* 119 */ "db_optr ::= db_optr cachelast",
 /* 120 */ "topic_optr ::= db_optr",
 /* 121 */ "topic_optr ::= topic_optr partitions",
 /* 122 */ "alter_db_optr ::=",
 /* 123 */ "alter_db_optr ::= alter_db_optr replica",
 /* 124 */ "alter_db_optr ::= alter_db_optr quorum",
 /* 125 */ "alter_db_optr ::= alter_db_optr keep",
 /* 126 */ "alter_db_optr ::= alter_db_optr blocks",
 /* 127 */ "alter_db_optr ::= alter_db_optr comp",
 /* 128 */ "alter_db_optr ::= alter_db_optr update",
 /* 129 */ "alter_db_optr ::= alter_db_optr cachelast",
 /* 130 */ "alter_topic_optr ::= alter_db_optr",
 /* 131 */ "alter_topic_optr ::= alter_topic_optr partitions",
 /* 132 */ "typename ::= ids",
 /* 133 */ "typename ::= ids LP signed RP",
 /* 134 */ "typename ::= ids UNSIGNED",
 /* 135 */ "signed ::= INTEGER",
 /* 136 */ "signed ::= PLUS INTEGER",
 /* 137 */ "signed ::= MINUS INTEGER",
 /* 138 */ "cmd ::= CREATE TABLE create_table_args",
 /* 139 */ "cmd ::= CREATE TABLE create_stable_args",
 /* 140 */ "cmd ::= CREATE STABLE create_stable_args",
 /* 141 */ "cmd ::= CREATE TABLE create_table_list",
 /* 142 */ "create_table_list ::= create_from_stable",
 /* 143 */ "create_table_list ::= create_table_list create_from_stable",
 /* 144 */ "create_table_args ::= ifnotexists ids cpxName LP columnlist RP",
 /* 145 */ "create_stable_args ::= ifnotexists ids cpxName LP columnlist RP TAGS LP columnlist RP",
 /* 146 */ "create_from_stable ::= ifnotexists ids cpxName USING ids cpxName TAGS LP tagitemlist RP",
 /* 147 */ "create_from_stable ::= ifnotexists ids cpxName USING ids cpxName LP tagNamelist RP TAGS LP tagitemlist RP",
 /* 148 */ "tagNamelist ::= tagNamelist COMMA ids",
 /* 149 */ "tagNamelist ::= ids",
 /* 150 */ "create_table_args ::= ifnotexists ids cpxName AS select",
 /* 151 */ "columnlist ::= columnlist COMMA column",
 /* 152 */ "columnlist ::= column",
 /* 153 */ "column ::= ids typename",
 /* 154 */ "tagitemlist ::= tagitemlist COMMA tagitem",
 /* 155 */ "tagitemlist ::= tagitem",
 /* 156 */ "tagitem ::= INTEGER",
 /* 157 */ "tagitem ::= FLOAT",
 /* 158 */ "tagitem ::= STRING",
 /* 159 */ "tagitem ::= BOOL",
 /* 160 */ "tagitem ::= NULL",
 /* 161 */ "tagitem ::= NOW",
 /* 162 */ "tagitem ::= NOW PLUS VARIABLE",
 /* 163 */ "tagitem ::= NOW MINUS VARIABLE",
 /* 164 */ "tagitem ::= MINUS INTEGER",
 /* 165 */ "tagitem ::= MINUS FLOAT",
 /* 166 */ "tagitem ::= PLUS INTEGER",
 /* 167 */ "tagitem ::= PLUS FLOAT",
 /* 168 */ "select ::= SELECT selcollist from where_opt range_option interval_option sliding_opt session_option windowstate_option fill_opt groupby_opt having_opt orderby_opt slimit_opt limit_opt",
 /* 169 */ "select ::= LP select RP",
 /* 170 */ "union ::= select",
 /* 171 */ "union ::= union UNION ALL select",
 /* 172 */ "cmd ::= union",
 /* 173 */ "select ::= SELECT selcollist",
 /* 174 */ "sclp ::= selcollist COMMA",
 /* 175 */ "sclp ::=",
 /* 176 */ "selcollist ::= sclp distinct expr as",
 /* 177 */ "selcollist ::= sclp STAR",
 /* 178 */ "as ::= AS ids",
 /* 179 */ "as ::= ids",
 /* 180 */ "as ::=",
 /* 181 */ "distinct ::= DISTINCT",
 /* 182 */ "distinct ::=",
 /* 183 */ "from ::= FROM tablelist",
 /* 184 */ "from ::= FROM sub",
 /* 185 */ "sub ::= LP union RP",
 /* 186 */ "sub ::= LP union RP ids",
 /* 187 */ "sub ::= sub COMMA LP union RP ids",
 /* 188 */ "tablelist ::= ids cpxName",
 /* 189 */ "tablelist ::= ids cpxName ids",
 /* 190 */ "tablelist ::= tablelist COMMA ids cpxName",
 /* 191 */ "tablelist ::= tablelist COMMA ids cpxName ids",
 /* 192 */ "tmvar ::= VARIABLE",
 /* 193 */ "timestamp ::= INTEGER",
 /* 194 */ "timestamp ::= MINUS INTEGER",
 /* 195 */ "timestamp ::= PLUS INTEGER",
 /* 196 */ "timestamp ::= STRING",
 /* 197 */ "timestamp ::= NOW",
 /* 198 */ "timestamp ::= NOW PLUS VARIABLE",
 /* 199 */ "timestamp ::= NOW MINUS VARIABLE",
 /* 200 */ "range_option ::=",
 /* 201 */ "range_option ::= RANGE LP timestamp COMMA timestamp RP",
 /* 202 */ "interval_option ::= intervalKey LP tmvar RP",
 /* 203 */ "interval_option ::= intervalKey LP tmvar COMMA tmvar RP",
 /* 204 */ "interval_option ::=",
 /* 205 */ "intervalKey ::= INTERVAL",
 /* 206 */ "intervalKey ::= EVERY",
 /* 207 */ "session_option ::=",
 /* 208 */ "session_option ::= SESSION LP ids cpxName COMMA tmvar RP",
 /* 209 */ "windowstate_option ::=",
 /* 210 */ "windowstate_option ::= STATE_WINDOW LP ids RP",
 /* 211 */ "fill_opt ::=",
 /* 212 */ "fill_opt ::= FILL LP ID COMMA tagitemlist RP",
 /* 213 */ "fill_opt ::= FILL LP ID RP",
 /* 214 */ "sliding_opt ::= SLIDING LP tmvar RP",
 /* 215 */ "sliding_opt ::=",
 /* 216 */ "orderby_opt ::=",
 /* 217 */ "orderby_opt ::= ORDER BY sortlist",
 /* 218 */ "sortlist ::= sortlist COMMA item sortorder",
 /* 219 */ "sortlist ::= sortlist COMMA arrow sortorder",
 /* 220 */ "sortlist ::= item sortorder",
 /* 221 */ "sortlist ::= arrow sortorder",
 /* 222 */ "item ::= ID",
 /* 223 */ "item ::= ID DOT ID",
 /* 224 */ "sortorder ::= ASC",
 /* 225 */ "sortorder ::= DESC",
 /* 226 */ "sortorder ::=",
 /* 227 */ "groupby_opt ::=",
 /* 228 */ "groupby_opt ::= GROUP BY grouplist",
 /* 229 */ "grouplist ::= grouplist COMMA item",
 /* 230 */ "grouplist ::= grouplist COMMA arrow",
 /* 231 */ "grouplist ::= item",
 /* 232 */ "grouplist ::= arrow",
 /* 233 */ "having_opt ::=",
 /* 234 */ "having_opt ::= HAVING expr",
 /* 235 */ "limit_opt ::=",
 /* 236 */ "limit_opt ::= LIMIT signed",
 /* 237 */ "limit_opt ::= LIMIT signed OFFSET signed",
 /* 238 */ "limit_opt ::= LIMIT signed COMMA signed",
 /* 239 */ "slimit_opt ::=",
 /* 240 */ "slimit_opt ::= SLIMIT signed",
 /* 241 */ "slimit_opt ::= SLIMIT signed SOFFSET signed",
 /* 242 */ "slimit_opt ::= SLIMIT signed COMMA signed",
 /* 243 */ "where_opt ::=",
 /* 244 */ "where_opt ::= WHERE expr",
 /* 245 */ "expr ::= LP expr RP",
 /* 246 */ "expr ::= ID",
 /* 247 */ "expr ::= ID DOT ID",
 /* 248 */ "expr ::= ID DOT STAR",
 /* 249 */ "expr ::= INTEGER",
 /* 250 */ "expr ::= MINUS INTEGER",
 /* 251 */ "expr ::= PLUS INTEGER",
 /* 252 */ "expr ::= FLOAT",
 /* 253 */ "expr ::= MINUS FLOAT",
 /* 254 */ "expr ::= PLUS FLOAT",
 /* 255 */ "expr ::= STRING",
 /* 256 */ "expr ::= NOW",
 /* 257 */ "expr ::= VARIABLE",
 /* 258 */ "expr ::= PLUS VARIABLE",
 /* 259 */ "expr ::= MINUS VARIABLE",
 /* 260 */ "expr ::= BOOL",
 /* 261 */ "expr ::= NULL",
 /* 262 */ "expr ::= ID LP exprlist RP",
 /* 263 */ "expr ::= ID LP STAR RP",
 /* 264 */ "expr ::= ID LP expr AS typename RP",
 /* 265 */ "expr ::= expr IS NULL",
 /* 266 */ "expr ::= expr IS NOT NULL",
 /* 267 */ "expr ::= expr LT expr",
 /* 268 */ "expr ::= expr GT expr",
 /* 269 */ "expr ::= expr LE expr",
 /* 270 */ "expr ::= expr GE expr",
 /* 271 */ "expr ::= expr NE expr",
 /* 272 */ "expr ::= expr EQ expr",
 /* 273 */ "expr ::= expr BETWEEN expr AND expr",
 /* 274 */ "expr ::= expr AND expr",
 /* 275 */ "expr ::= expr OR expr",
 /* 276 */ "expr ::= expr PLUS expr",
 /* 277 */ "expr ::= expr MINUS expr",
 /* 278 */ "expr ::= expr STAR expr",
 /* 279 */ "expr ::= expr SLASH expr",
 /* 280 */ "expr ::= expr REM expr",
 /* 281 */ "expr ::= expr LIKE expr",
 /* 282 */ "expr ::= expr MATCH expr",
 /* 283 */ "expr ::= expr NMATCH expr",
 /* 284 */ "expr ::= ID CONTAINS STRING",
 /* 285 */ "expr ::= ID DOT ID CONTAINS STRING",
 /* 286 */ "arrow ::= ID ARROW STRING",
 /* 287 */ "arrow ::= ID DOT ID ARROW STRING",
 /* 288 */ "expr ::= arrow",
 /* 289 */ "expr ::= expr IN LP exprlist RP",
 /* 290 */ "exprlist ::= exprlist COMMA expritem",
 /* 291 */ "exprlist ::= expritem",
 /* 292 */ "expritem ::= expr",
 /* 293 */ "expritem ::=",
 /* 294 */ "cmd ::= RESET QUERY CACHE",
 /* 295 */ "cmd ::= SYNCDB ids REPLICA",
 /* 296 */ "cmd ::= ALTER TABLE ids cpxName ADD COLUMN columnlist",
 /* 297 */ "cmd ::= ALTER TABLE ids cpxName DROP COLUMN ids",
 /* 298 */ "cmd ::= ALTER TABLE ids cpxName MODIFY COLUMN columnlist",
 /* 299 */ "cmd ::= ALTER TABLE ids cpxName ADD TAG columnlist",
 /* 300 */ "cmd ::= ALTER TABLE ids cpxName DROP TAG ids",
 /* 301 */ "cmd ::= ALTER TABLE ids cpxName CHANGE TAG ids ids",
 /* 302 */ "cmd ::= ALTER TABLE ids cpxName SET TAG ids EQ tagitem",
 /* 303 */ "cmd ::= ALTER TABLE ids cpxName MODIFY TAG columnlist",
 /* 304 */ "cmd ::= ALTER STABLE ids cpxName ADD COLUMN columnlist",
 /* 305 */ "cmd ::= ALTER STABLE ids cpxName DROP COLUMN ids",
 /* 306 */ "cmd ::= ALTER STABLE ids cpxName MODIFY COLUMN columnlist",
 /* 307 */ "cmd ::= ALTER STABLE ids cpxName ADD TAG columnlist",
 /* 308 */ "cmd ::= ALTER STABLE ids cpxName DROP TAG ids",
 /* 309 */ "cmd ::= ALTER STABLE ids cpxName CHANGE TAG ids ids",
 /* 310 */ "cmd ::= ALTER STABLE ids cpxName SET TAG ids EQ tagitem",
 /* 311 */ "cmd ::= ALTER STABLE ids cpxName MODIFY TAG columnlist",
 /* 312 */ "cmd ::= KILL CONNECTION INTEGER",
 /* 313 */ "cmd ::= KILL STREAM INTEGER COLON INTEGER",
 /* 314 */ "cmd ::= KILL QUERY INTEGER COLON INTEGER",
};
#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 ){
    pNew = malloc(newSize*sizeof(pNew[0]));
    if( pNew ) pNew[0] = p->yystk0;
  }else{
    pNew = realloc(p->yystack, newSize*sizeof(pNew[0]));
  }
  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
** second argument to ParseAlloc() below.  This can be changed by
** 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.
*/
void ParseInit(void *yypRawParser ParseCTX_PDECL){
  yyParser *yypParser = (yyParser*)yypRawParser;
  ParseCTX_STORE
#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
}

#ifndef Parse_ENGINEALWAYSONSTACK
/* 
** 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
** to Parse and ParseFree.
*/
void *ParseAlloc(void *(*mallocProc)(YYMALLOCARGTYPE) ParseCTX_PDECL){
  yyParser *yypParser;
  yypParser = (yyParser*)(*mallocProc)( (YYMALLOCARGTYPE)sizeof(yyParser) );
  if( yypParser ){
    ParseCTX_STORE
    ParseInit(yypParser ParseCTX_PARAM);
  }
  return (void*)yypParser;
}
#endif /* Parse_ENGINEALWAYSONSTACK */


/* 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 */
){
  ParseARG_FETCH
  ParseCTX_FETCH
  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 ***************************************/
    case 210: /* exprlist */
    case 254: /* selcollist */
    case 269: /* sclp */
{
tSqlExprListDestroy((yypminor->yy189));
}
      break;
    case 225: /* intitemlist */
    case 227: /* keep */
    case 248: /* columnlist */
    case 249: /* tagitemlist */
    case 250: /* tagNamelist */
    case 262: /* fill_opt */
    case 263: /* groupby_opt */
    case 265: /* orderby_opt */
    case 278: /* sortlist */
    case 282: /* grouplist */
{
taosArrayDestroy(&(yypminor->yy189));
}
      break;
    case 246: /* create_table_list */
{
destroyCreateTableSql((yypminor->yy6));
}
      break;
    case 251: /* select */
{
destroySqlNode((yypminor->yy16));
}
      break;
    case 255: /* from */
    case 273: /* tablelist */
    case 274: /* sub */
{
destroyRelationInfo((yypminor->yy36));
}
      break;
    case 256: /* where_opt */
    case 264: /* having_opt */
    case 271: /* expr */
    case 276: /* timestamp */
    case 281: /* arrow */
    case 283: /* expritem */
{
tSqlExprDestroy((yypminor->yy18));
}
      break;
    case 268: /* union */
{
destroyAllSqlNode((yypminor->yy189));
}
      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
*/
void ParseFinalize(void *p){
  yyParser *pParser = (yyParser*)p;
  while( pParser->yytos>pParser->yystack ) yy_pop_parser_stack(pParser);
#if YYSTACKDEPTH<=0
  if( pParser->yystack!=&pParser->yystk0 ) free(pParser->yystack);
#endif
}

#ifndef Parse_ENGINEALWAYSONSTACK
/* 
** 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.
*/
void ParseFree(
  void *p,                    /* The parser to be deleted */
  void (*freeProc)(void*)     /* Function used to reclaim memory */
){
#ifndef YYPARSEFREENEVERNULL
  if( p==0 ) return;
#endif
  ParseFinalize(p);
  (*freeProc)(p);
}
#endif /* Parse_ENGINEALWAYSONSTACK */

/*
** Return the peak depth of the stack for a parser.
*/
#ifdef YYTRACKMAXSTACKDEPTH
int ParseStackPeak(void *p){
  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)
int ParseCoverage(FILE *out){
  int stateno, iLookAhead, i;
  int nMissed = 0;
  for(stateno=0; stateno<YYNSTATE; stateno++){
    i = yy_shift_ofst[stateno];
    for(iLookAhead=0; iLookAhead<YYNTOKEN; iLookAhead++){
      if( yy_lookahead[i+iLookAhead]!=iLookAhead ) continue;
      if( yycoverage[stateno][iLookAhead]==0 ) nMissed++;
      if( out ){
        fprintf(out,"State %d lookahead %s %s\n", stateno,
                yyTokenName[iLookAhead],
                yycoverage[stateno][iLookAhead] ? "ok" : "missed");
      }
    }
  }
  return nMissed;
}
#endif

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

  if( stateno>YY_MAX_SHIFT ) return stateno;
  assert( stateno <= YY_SHIFT_COUNT );
#if defined(YYCOVERAGE)
  yycoverage[stateno][iLookAhead] = 1;
#endif
  do{
    i = yy_shift_ofst[stateno];
    assert( i>=0 );
    assert( i<=YY_ACTTAB_COUNT );
    assert( i+YYNTOKEN<=(int)YY_NLOOKAHEAD );
    assert( iLookAhead!=YYNOCODE );
    assert( iLookAhead < YYNTOKEN );
    i += iLookAhead;
    assert( i<(int)YY_NLOOKAHEAD );
    if( yy_lookahead[i]!=iLookAhead ){
#ifdef YYFALLBACK
      YYCODETYPE iFallback;            /* Fallback token */
      assert( iLookAhead<sizeof(yyFallback)/sizeof(yyFallback[0]) );
      iFallback = yyFallback[iLookAhead];
      if( iFallback!=0 ){
#ifndef NDEBUG
        if( yyTraceFILE ){
          fprintf(yyTraceFILE, "%sFALLBACK %s => %s\n",
             yyTracePrompt, yyTokenName[iLookAhead], yyTokenName[iFallback]);
        }
#endif
        assert( yyFallback[iFallback]==0 ); /* Fallback loop must terminate */
        iLookAhead = iFallback;
        continue;
      }
#endif
#ifdef YYWILDCARD
      {
        int j = i - iLookAhead + YYWILDCARD;
        assert( j<(int)(sizeof(yy_lookahead)/sizeof(yy_lookahead[0])) );
        if( yy_lookahead[j]==YYWILDCARD && iLookAhead>0 ){
#ifndef NDEBUG
          if( yyTraceFILE ){
            fprintf(yyTraceFILE, "%sWILDCARD %s => %s\n",
               yyTracePrompt, yyTokenName[iLookAhead],
               yyTokenName[YYWILDCARD]);
          }
#endif /* NDEBUG */
          return yy_action[j];
        }
      }
#endif /* YYWILDCARD */
      return yy_default[stateno];
    }else{
      assert( i>=0 && i<(int)(sizeof(yy_action)/sizeof(yy_action[0])) );
      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){
   ParseARG_FETCH
   ParseCTX_FETCH
#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 ********************************************/
   ParseARG_STORE /* Suppress warning about unused %extra_argument var */
   ParseCTX_STORE
}

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

/* For rule J, yyRuleInfoLhs[J] contains the symbol on the left-hand side
** of that rule */
static const YYCODETYPE yyRuleInfoLhs[] = {
   201,  /* (0) program ::= cmd */
   202,  /* (1) cmd ::= SHOW DATABASES */
   202,  /* (2) cmd ::= SHOW TOPICS */
   202,  /* (3) cmd ::= SHOW FUNCTIONS */
   202,  /* (4) cmd ::= SHOW MNODES */
   202,  /* (5) cmd ::= SHOW DNODES */
   202,  /* (6) cmd ::= SHOW ACCOUNTS */
   202,  /* (7) cmd ::= SHOW USERS */
   202,  /* (8) cmd ::= SHOW MODULES */
   202,  /* (9) cmd ::= SHOW QUERIES */
   202,  /* (10) cmd ::= SHOW CONNECTIONS */
   202,  /* (11) cmd ::= SHOW STREAMS */
   202,  /* (12) cmd ::= SHOW VARIABLES */
   202,  /* (13) cmd ::= SHOW SCORES */
   202,  /* (14) cmd ::= SHOW GRANTS */
   202,  /* (15) cmd ::= SHOW VNODES */
   202,  /* (16) cmd ::= SHOW VNODES ids */
   204,  /* (17) dbPrefix ::= */
   204,  /* (18) dbPrefix ::= ids DOT */
   205,  /* (19) cpxName ::= */
   205,  /* (20) cpxName ::= DOT ids */
   202,  /* (21) cmd ::= SHOW CREATE TABLE ids cpxName */
   202,  /* (22) cmd ::= SHOW CREATE STABLE ids cpxName */
   202,  /* (23) cmd ::= SHOW CREATE DATABASE ids */
   202,  /* (24) cmd ::= SHOW dbPrefix TABLES */
   202,  /* (25) cmd ::= SHOW dbPrefix TABLES LIKE ids */
   202,  /* (26) cmd ::= SHOW dbPrefix STABLES */
   202,  /* (27) cmd ::= SHOW dbPrefix STABLES LIKE ids */
   202,  /* (28) cmd ::= SHOW dbPrefix VGROUPS */
   202,  /* (29) cmd ::= DROP TABLE ifexists ids cpxName */
   202,  /* (30) cmd ::= DROP STABLE ifexists ids cpxName */
   202,  /* (31) cmd ::= DROP DATABASE ifexists ids */
   202,  /* (32) cmd ::= DROP TOPIC ifexists ids */
   202,  /* (33) cmd ::= DROP FUNCTION ids */
   202,  /* (34) cmd ::= DROP DNODE ids */
   202,  /* (35) cmd ::= DROP USER ids */
   202,  /* (36) cmd ::= DROP ACCOUNT ids */
   202,  /* (37) cmd ::= USE ids */
   202,  /* (38) cmd ::= DESCRIBE ids cpxName */
   202,  /* (39) cmd ::= DESC ids cpxName */
   202,  /* (40) cmd ::= ALTER USER ids PASS ids */
   202,  /* (41) cmd ::= ALTER USER ids PRIVILEGE ids */
   202,  /* (42) cmd ::= ALTER DNODE ids ids */
   202,  /* (43) cmd ::= ALTER DNODE ids ids ids */
   202,  /* (44) cmd ::= ALTER LOCAL ids */
   202,  /* (45) cmd ::= ALTER LOCAL ids ids */
   202,  /* (46) cmd ::= ALTER DATABASE ids alter_db_optr */
   202,  /* (47) cmd ::= ALTER TOPIC ids alter_topic_optr */
   202,  /* (48) cmd ::= ALTER ACCOUNT ids acct_optr */
   202,  /* (49) cmd ::= ALTER ACCOUNT ids PASS ids acct_optr */
   202,  /* (50) cmd ::= COMPACT VNODES IN LP exprlist RP */
   203,  /* (51) ids ::= ID */
   203,  /* (52) ids ::= STRING */
   206,  /* (53) ifexists ::= IF EXISTS */
   206,  /* (54) ifexists ::= */
   211,  /* (55) ifnotexists ::= IF NOT EXISTS */
   211,  /* (56) ifnotexists ::= */
   202,  /* (57) cmd ::= CREATE DNODE ids */
   202,  /* (58) cmd ::= CREATE ACCOUNT ids PASS ids acct_optr */
   202,  /* (59) cmd ::= CREATE DATABASE ifnotexists ids db_optr */
   202,  /* (60) cmd ::= CREATE TOPIC ifnotexists ids topic_optr */
   202,  /* (61) cmd ::= CREATE FUNCTION ids AS ids OUTPUTTYPE typename bufsize */
   202,  /* (62) cmd ::= CREATE AGGREGATE FUNCTION ids AS ids OUTPUTTYPE typename bufsize */
   202,  /* (63) cmd ::= CREATE USER ids PASS ids */
   215,  /* (64) bufsize ::= */
   215,  /* (65) bufsize ::= BUFSIZE INTEGER */
   216,  /* (66) pps ::= */
   216,  /* (67) pps ::= PPS INTEGER */
   217,  /* (68) tseries ::= */
   217,  /* (69) tseries ::= TSERIES INTEGER */
   218,  /* (70) dbs ::= */
   218,  /* (71) dbs ::= DBS INTEGER */
   219,  /* (72) streams ::= */
   219,  /* (73) streams ::= STREAMS INTEGER */
   220,  /* (74) storage ::= */
   220,  /* (75) storage ::= STORAGE INTEGER */
   221,  /* (76) qtime ::= */
   221,  /* (77) qtime ::= QTIME INTEGER */
   222,  /* (78) users ::= */
   222,  /* (79) users ::= USERS INTEGER */
   223,  /* (80) conns ::= */
   223,  /* (81) conns ::= CONNS INTEGER */
   224,  /* (82) state ::= */
   224,  /* (83) state ::= STATE ids */
   209,  /* (84) acct_optr ::= pps tseries storage streams qtime dbs users conns state */
   225,  /* (85) intitemlist ::= intitemlist COMMA intitem */
   225,  /* (86) intitemlist ::= intitem */
   226,  /* (87) intitem ::= INTEGER */
   227,  /* (88) keep ::= KEEP intitemlist */
   228,  /* (89) cache ::= CACHE INTEGER */
   229,  /* (90) replica ::= REPLICA INTEGER */
   230,  /* (91) quorum ::= QUORUM INTEGER */
   231,  /* (92) days ::= DAYS INTEGER */
   232,  /* (93) minrows ::= MINROWS INTEGER */
   233,  /* (94) maxrows ::= MAXROWS INTEGER */
   234,  /* (95) blocks ::= BLOCKS INTEGER */
   235,  /* (96) ctime ::= CTIME INTEGER */
   236,  /* (97) wal ::= WAL INTEGER */
   237,  /* (98) fsync ::= FSYNC INTEGER */
   238,  /* (99) comp ::= COMP INTEGER */
   239,  /* (100) prec ::= PRECISION STRING */
   240,  /* (101) update ::= UPDATE INTEGER */
   241,  /* (102) cachelast ::= CACHELAST INTEGER */
   242,  /* (103) partitions ::= PARTITIONS INTEGER */
   212,  /* (104) db_optr ::= */
   212,  /* (105) db_optr ::= db_optr cache */
   212,  /* (106) db_optr ::= db_optr replica */
   212,  /* (107) db_optr ::= db_optr quorum */
   212,  /* (108) db_optr ::= db_optr days */
   212,  /* (109) db_optr ::= db_optr minrows */
   212,  /* (110) db_optr ::= db_optr maxrows */
   212,  /* (111) db_optr ::= db_optr blocks */
   212,  /* (112) db_optr ::= db_optr ctime */
   212,  /* (113) db_optr ::= db_optr wal */
   212,  /* (114) db_optr ::= db_optr fsync */
   212,  /* (115) db_optr ::= db_optr comp */
   212,  /* (116) db_optr ::= db_optr prec */
   212,  /* (117) db_optr ::= db_optr keep */
   212,  /* (118) db_optr ::= db_optr update */
   212,  /* (119) db_optr ::= db_optr cachelast */
   213,  /* (120) topic_optr ::= db_optr */
   213,  /* (121) topic_optr ::= topic_optr partitions */
   207,  /* (122) alter_db_optr ::= */
   207,  /* (123) alter_db_optr ::= alter_db_optr replica */
   207,  /* (124) alter_db_optr ::= alter_db_optr quorum */
   207,  /* (125) alter_db_optr ::= alter_db_optr keep */
   207,  /* (126) alter_db_optr ::= alter_db_optr blocks */
   207,  /* (127) alter_db_optr ::= alter_db_optr comp */
   207,  /* (128) alter_db_optr ::= alter_db_optr update */
   207,  /* (129) alter_db_optr ::= alter_db_optr cachelast */
   208,  /* (130) alter_topic_optr ::= alter_db_optr */
   208,  /* (131) alter_topic_optr ::= alter_topic_optr partitions */
   214,  /* (132) typename ::= ids */
   214,  /* (133) typename ::= ids LP signed RP */
   214,  /* (134) typename ::= ids UNSIGNED */
   243,  /* (135) signed ::= INTEGER */
   243,  /* (136) signed ::= PLUS INTEGER */
   243,  /* (137) signed ::= MINUS INTEGER */
   202,  /* (138) cmd ::= CREATE TABLE create_table_args */
   202,  /* (139) cmd ::= CREATE TABLE create_stable_args */
   202,  /* (140) cmd ::= CREATE STABLE create_stable_args */
   202,  /* (141) cmd ::= CREATE TABLE create_table_list */
   246,  /* (142) create_table_list ::= create_from_stable */
   246,  /* (143) create_table_list ::= create_table_list create_from_stable */
   244,  /* (144) create_table_args ::= ifnotexists ids cpxName LP columnlist RP */
   245,  /* (145) create_stable_args ::= ifnotexists ids cpxName LP columnlist RP TAGS LP columnlist RP */
   247,  /* (146) create_from_stable ::= ifnotexists ids cpxName USING ids cpxName TAGS LP tagitemlist RP */
   247,  /* (147) create_from_stable ::= ifnotexists ids cpxName USING ids cpxName LP tagNamelist RP TAGS LP tagitemlist RP */
   250,  /* (148) tagNamelist ::= tagNamelist COMMA ids */
   250,  /* (149) tagNamelist ::= ids */
   244,  /* (150) create_table_args ::= ifnotexists ids cpxName AS select */
   248,  /* (151) columnlist ::= columnlist COMMA column */
   248,  /* (152) columnlist ::= column */
   252,  /* (153) column ::= ids typename */
   249,  /* (154) tagitemlist ::= tagitemlist COMMA tagitem */
   249,  /* (155) tagitemlist ::= tagitem */
   253,  /* (156) tagitem ::= INTEGER */
   253,  /* (157) tagitem ::= FLOAT */
   253,  /* (158) tagitem ::= STRING */
   253,  /* (159) tagitem ::= BOOL */
   253,  /* (160) tagitem ::= NULL */
   253,  /* (161) tagitem ::= NOW */
   253,  /* (162) tagitem ::= NOW PLUS VARIABLE */
   253,  /* (163) tagitem ::= NOW MINUS VARIABLE */
   253,  /* (164) tagitem ::= MINUS INTEGER */
   253,  /* (165) tagitem ::= MINUS FLOAT */
   253,  /* (166) tagitem ::= PLUS INTEGER */
   253,  /* (167) tagitem ::= PLUS FLOAT */
   251,  /* (168) select ::= SELECT selcollist from where_opt range_option interval_option sliding_opt session_option windowstate_option fill_opt groupby_opt having_opt orderby_opt slimit_opt limit_opt */
   251,  /* (169) select ::= LP select RP */
   268,  /* (170) union ::= select */
   268,  /* (171) union ::= union UNION ALL select */
   202,  /* (172) cmd ::= union */
   251,  /* (173) select ::= SELECT selcollist */
   269,  /* (174) sclp ::= selcollist COMMA */
   269,  /* (175) sclp ::= */
   254,  /* (176) selcollist ::= sclp distinct expr as */
   254,  /* (177) selcollist ::= sclp STAR */
   272,  /* (178) as ::= AS ids */
   272,  /* (179) as ::= ids */
   272,  /* (180) as ::= */
   270,  /* (181) distinct ::= DISTINCT */
   270,  /* (182) distinct ::= */
   255,  /* (183) from ::= FROM tablelist */
   255,  /* (184) from ::= FROM sub */
   274,  /* (185) sub ::= LP union RP */
   274,  /* (186) sub ::= LP union RP ids */
   274,  /* (187) sub ::= sub COMMA LP union RP ids */
   273,  /* (188) tablelist ::= ids cpxName */
   273,  /* (189) tablelist ::= ids cpxName ids */
   273,  /* (190) tablelist ::= tablelist COMMA ids cpxName */
   273,  /* (191) tablelist ::= tablelist COMMA ids cpxName ids */
   275,  /* (192) tmvar ::= VARIABLE */
   276,  /* (193) timestamp ::= INTEGER */
   276,  /* (194) timestamp ::= MINUS INTEGER */
   276,  /* (195) timestamp ::= PLUS INTEGER */
   276,  /* (196) timestamp ::= STRING */
   276,  /* (197) timestamp ::= NOW */
   276,  /* (198) timestamp ::= NOW PLUS VARIABLE */
   276,  /* (199) timestamp ::= NOW MINUS VARIABLE */
   257,  /* (200) range_option ::= */
   257,  /* (201) range_option ::= RANGE LP timestamp COMMA timestamp RP */
   258,  /* (202) interval_option ::= intervalKey LP tmvar RP */
   258,  /* (203) interval_option ::= intervalKey LP tmvar COMMA tmvar RP */
   258,  /* (204) interval_option ::= */
   277,  /* (205) intervalKey ::= INTERVAL */
   277,  /* (206) intervalKey ::= EVERY */
   260,  /* (207) session_option ::= */
   260,  /* (208) session_option ::= SESSION LP ids cpxName COMMA tmvar RP */
   261,  /* (209) windowstate_option ::= */
   261,  /* (210) windowstate_option ::= STATE_WINDOW LP ids RP */
   262,  /* (211) fill_opt ::= */
   262,  /* (212) fill_opt ::= FILL LP ID COMMA tagitemlist RP */
   262,  /* (213) fill_opt ::= FILL LP ID RP */
   259,  /* (214) sliding_opt ::= SLIDING LP tmvar RP */
   259,  /* (215) sliding_opt ::= */
   265,  /* (216) orderby_opt ::= */
   265,  /* (217) orderby_opt ::= ORDER BY sortlist */
   278,  /* (218) sortlist ::= sortlist COMMA item sortorder */
   278,  /* (219) sortlist ::= sortlist COMMA arrow sortorder */
   278,  /* (220) sortlist ::= item sortorder */
   278,  /* (221) sortlist ::= arrow sortorder */
   279,  /* (222) item ::= ID */
   279,  /* (223) item ::= ID DOT ID */
   280,  /* (224) sortorder ::= ASC */
   280,  /* (225) sortorder ::= DESC */
   280,  /* (226) sortorder ::= */
   263,  /* (227) groupby_opt ::= */
   263,  /* (228) groupby_opt ::= GROUP BY grouplist */
   282,  /* (229) grouplist ::= grouplist COMMA item */
   282,  /* (230) grouplist ::= grouplist COMMA arrow */
   282,  /* (231) grouplist ::= item */
   282,  /* (232) grouplist ::= arrow */
   264,  /* (233) having_opt ::= */
   264,  /* (234) having_opt ::= HAVING expr */
   267,  /* (235) limit_opt ::= */
   267,  /* (236) limit_opt ::= LIMIT signed */
   267,  /* (237) limit_opt ::= LIMIT signed OFFSET signed */
   267,  /* (238) limit_opt ::= LIMIT signed COMMA signed */
   266,  /* (239) slimit_opt ::= */
   266,  /* (240) slimit_opt ::= SLIMIT signed */
   266,  /* (241) slimit_opt ::= SLIMIT signed SOFFSET signed */
   266,  /* (242) slimit_opt ::= SLIMIT signed COMMA signed */
   256,  /* (243) where_opt ::= */
   256,  /* (244) where_opt ::= WHERE expr */
   271,  /* (245) expr ::= LP expr RP */
   271,  /* (246) expr ::= ID */
   271,  /* (247) expr ::= ID DOT ID */
   271,  /* (248) expr ::= ID DOT STAR */
   271,  /* (249) expr ::= INTEGER */
   271,  /* (250) expr ::= MINUS INTEGER */
   271,  /* (251) expr ::= PLUS INTEGER */
   271,  /* (252) expr ::= FLOAT */
   271,  /* (253) expr ::= MINUS FLOAT */
   271,  /* (254) expr ::= PLUS FLOAT */
   271,  /* (255) expr ::= STRING */
   271,  /* (256) expr ::= NOW */
   271,  /* (257) expr ::= VARIABLE */
   271,  /* (258) expr ::= PLUS VARIABLE */
   271,  /* (259) expr ::= MINUS VARIABLE */
   271,  /* (260) expr ::= BOOL */
   271,  /* (261) expr ::= NULL */
   271,  /* (262) expr ::= ID LP exprlist RP */
   271,  /* (263) expr ::= ID LP STAR RP */
   271,  /* (264) expr ::= ID LP expr AS typename RP */
   271,  /* (265) expr ::= expr IS NULL */
   271,  /* (266) expr ::= expr IS NOT NULL */
   271,  /* (267) expr ::= expr LT expr */
   271,  /* (268) expr ::= expr GT expr */
   271,  /* (269) expr ::= expr LE expr */
   271,  /* (270) expr ::= expr GE expr */
   271,  /* (271) expr ::= expr NE expr */
   271,  /* (272) expr ::= expr EQ expr */
   271,  /* (273) expr ::= expr BETWEEN expr AND expr */
   271,  /* (274) expr ::= expr AND expr */
   271,  /* (275) expr ::= expr OR expr */
   271,  /* (276) expr ::= expr PLUS expr */
   271,  /* (277) expr ::= expr MINUS expr */
   271,  /* (278) expr ::= expr STAR expr */
   271,  /* (279) expr ::= expr SLASH expr */
   271,  /* (280) expr ::= expr REM expr */
   271,  /* (281) expr ::= expr LIKE expr */
   271,  /* (282) expr ::= expr MATCH expr */
   271,  /* (283) expr ::= expr NMATCH expr */
   271,  /* (284) expr ::= ID CONTAINS STRING */
   271,  /* (285) expr ::= ID DOT ID CONTAINS STRING */
   281,  /* (286) arrow ::= ID ARROW STRING */
   281,  /* (287) arrow ::= ID DOT ID ARROW STRING */
   271,  /* (288) expr ::= arrow */
   271,  /* (289) expr ::= expr IN LP exprlist RP */
   210,  /* (290) exprlist ::= exprlist COMMA expritem */
   210,  /* (291) exprlist ::= expritem */
   283,  /* (292) expritem ::= expr */
   283,  /* (293) expritem ::= */
   202,  /* (294) cmd ::= RESET QUERY CACHE */
   202,  /* (295) cmd ::= SYNCDB ids REPLICA */
   202,  /* (296) cmd ::= ALTER TABLE ids cpxName ADD COLUMN columnlist */
   202,  /* (297) cmd ::= ALTER TABLE ids cpxName DROP COLUMN ids */
   202,  /* (298) cmd ::= ALTER TABLE ids cpxName MODIFY COLUMN columnlist */
   202,  /* (299) cmd ::= ALTER TABLE ids cpxName ADD TAG columnlist */
   202,  /* (300) cmd ::= ALTER TABLE ids cpxName DROP TAG ids */
   202,  /* (301) cmd ::= ALTER TABLE ids cpxName CHANGE TAG ids ids */
   202,  /* (302) cmd ::= ALTER TABLE ids cpxName SET TAG ids EQ tagitem */
   202,  /* (303) cmd ::= ALTER TABLE ids cpxName MODIFY TAG columnlist */
   202,  /* (304) cmd ::= ALTER STABLE ids cpxName ADD COLUMN columnlist */
   202,  /* (305) cmd ::= ALTER STABLE ids cpxName DROP COLUMN ids */
   202,  /* (306) cmd ::= ALTER STABLE ids cpxName MODIFY COLUMN columnlist */
   202,  /* (307) cmd ::= ALTER STABLE ids cpxName ADD TAG columnlist */
   202,  /* (308) cmd ::= ALTER STABLE ids cpxName DROP TAG ids */
   202,  /* (309) cmd ::= ALTER STABLE ids cpxName CHANGE TAG ids ids */
   202,  /* (310) cmd ::= ALTER STABLE ids cpxName SET TAG ids EQ tagitem */
   202,  /* (311) cmd ::= ALTER STABLE ids cpxName MODIFY TAG columnlist */
   202,  /* (312) cmd ::= KILL CONNECTION INTEGER */
   202,  /* (313) cmd ::= KILL STREAM INTEGER COLON INTEGER */
   202,  /* (314) cmd ::= KILL QUERY INTEGER COLON INTEGER */
};

/* 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[] = {
   -1,  /* (0) program ::= cmd */
   -2,  /* (1) cmd ::= SHOW DATABASES */
   -2,  /* (2) cmd ::= SHOW TOPICS */
   -2,  /* (3) cmd ::= SHOW FUNCTIONS */
   -2,  /* (4) cmd ::= SHOW MNODES */
   -2,  /* (5) cmd ::= SHOW DNODES */
   -2,  /* (6) cmd ::= SHOW ACCOUNTS */
   -2,  /* (7) cmd ::= SHOW USERS */
   -2,  /* (8) cmd ::= SHOW MODULES */
   -2,  /* (9) cmd ::= SHOW QUERIES */
   -2,  /* (10) cmd ::= SHOW CONNECTIONS */
   -2,  /* (11) cmd ::= SHOW STREAMS */
   -2,  /* (12) cmd ::= SHOW VARIABLES */
   -2,  /* (13) cmd ::= SHOW SCORES */
   -2,  /* (14) cmd ::= SHOW GRANTS */
   -2,  /* (15) cmd ::= SHOW VNODES */
   -3,  /* (16) cmd ::= SHOW VNODES ids */
    0,  /* (17) dbPrefix ::= */
   -2,  /* (18) dbPrefix ::= ids DOT */
    0,  /* (19) cpxName ::= */
   -2,  /* (20) cpxName ::= DOT ids */
   -5,  /* (21) cmd ::= SHOW CREATE TABLE ids cpxName */
   -5,  /* (22) cmd ::= SHOW CREATE STABLE ids cpxName */
   -4,  /* (23) cmd ::= SHOW CREATE DATABASE ids */
   -3,  /* (24) cmd ::= SHOW dbPrefix TABLES */
   -5,  /* (25) cmd ::= SHOW dbPrefix TABLES LIKE ids */
   -3,  /* (26) cmd ::= SHOW dbPrefix STABLES */
   -5,  /* (27) cmd ::= SHOW dbPrefix STABLES LIKE ids */
   -3,  /* (28) cmd ::= SHOW dbPrefix VGROUPS */
   -5,  /* (29) cmd ::= DROP TABLE ifexists ids cpxName */
   -5,  /* (30) cmd ::= DROP STABLE ifexists ids cpxName */
   -4,  /* (31) cmd ::= DROP DATABASE ifexists ids */
   -4,  /* (32) cmd ::= DROP TOPIC ifexists ids */
   -3,  /* (33) cmd ::= DROP FUNCTION ids */
   -3,  /* (34) cmd ::= DROP DNODE ids */
   -3,  /* (35) cmd ::= DROP USER ids */
   -3,  /* (36) cmd ::= DROP ACCOUNT ids */
   -2,  /* (37) cmd ::= USE ids */
   -3,  /* (38) cmd ::= DESCRIBE ids cpxName */
   -3,  /* (39) cmd ::= DESC ids cpxName */
   -5,  /* (40) cmd ::= ALTER USER ids PASS ids */
   -5,  /* (41) cmd ::= ALTER USER ids PRIVILEGE ids */
   -4,  /* (42) cmd ::= ALTER DNODE ids ids */
   -5,  /* (43) cmd ::= ALTER DNODE ids ids ids */
   -3,  /* (44) cmd ::= ALTER LOCAL ids */
   -4,  /* (45) cmd ::= ALTER LOCAL ids ids */
   -4,  /* (46) cmd ::= ALTER DATABASE ids alter_db_optr */
   -4,  /* (47) cmd ::= ALTER TOPIC ids alter_topic_optr */
   -4,  /* (48) cmd ::= ALTER ACCOUNT ids acct_optr */
   -6,  /* (49) cmd ::= ALTER ACCOUNT ids PASS ids acct_optr */
   -6,  /* (50) cmd ::= COMPACT VNODES IN LP exprlist RP */
   -1,  /* (51) ids ::= ID */
   -1,  /* (52) ids ::= STRING */
   -2,  /* (53) ifexists ::= IF EXISTS */
    0,  /* (54) ifexists ::= */
   -3,  /* (55) ifnotexists ::= IF NOT EXISTS */
    0,  /* (56) ifnotexists ::= */
   -3,  /* (57) cmd ::= CREATE DNODE ids */
   -6,  /* (58) cmd ::= CREATE ACCOUNT ids PASS ids acct_optr */
   -5,  /* (59) cmd ::= CREATE DATABASE ifnotexists ids db_optr */
   -5,  /* (60) cmd ::= CREATE TOPIC ifnotexists ids topic_optr */
   -8,  /* (61) cmd ::= CREATE FUNCTION ids AS ids OUTPUTTYPE typename bufsize */
   -9,  /* (62) cmd ::= CREATE AGGREGATE FUNCTION ids AS ids OUTPUTTYPE typename bufsize */
   -5,  /* (63) cmd ::= CREATE USER ids PASS ids */
    0,  /* (64) bufsize ::= */
   -2,  /* (65) bufsize ::= BUFSIZE INTEGER */
    0,  /* (66) pps ::= */
   -2,  /* (67) pps ::= PPS INTEGER */
    0,  /* (68) tseries ::= */
   -2,  /* (69) tseries ::= TSERIES INTEGER */
    0,  /* (70) dbs ::= */
   -2,  /* (71) dbs ::= DBS INTEGER */
    0,  /* (72) streams ::= */
   -2,  /* (73) streams ::= STREAMS INTEGER */
    0,  /* (74) storage ::= */
   -2,  /* (75) storage ::= STORAGE INTEGER */
    0,  /* (76) qtime ::= */
   -2,  /* (77) qtime ::= QTIME INTEGER */
    0,  /* (78) users ::= */
   -2,  /* (79) users ::= USERS INTEGER */
    0,  /* (80) conns ::= */
   -2,  /* (81) conns ::= CONNS INTEGER */
    0,  /* (82) state ::= */
   -2,  /* (83) state ::= STATE ids */
   -9,  /* (84) acct_optr ::= pps tseries storage streams qtime dbs users conns state */
   -3,  /* (85) intitemlist ::= intitemlist COMMA intitem */
   -1,  /* (86) intitemlist ::= intitem */
   -1,  /* (87) intitem ::= INTEGER */
   -2,  /* (88) keep ::= KEEP intitemlist */
   -2,  /* (89) cache ::= CACHE INTEGER */
   -2,  /* (90) replica ::= REPLICA INTEGER */
   -2,  /* (91) quorum ::= QUORUM INTEGER */
   -2,  /* (92) days ::= DAYS INTEGER */
   -2,  /* (93) minrows ::= MINROWS INTEGER */
   -2,  /* (94) maxrows ::= MAXROWS INTEGER */
   -2,  /* (95) blocks ::= BLOCKS INTEGER */
   -2,  /* (96) ctime ::= CTIME INTEGER */
   -2,  /* (97) wal ::= WAL INTEGER */
   -2,  /* (98) fsync ::= FSYNC INTEGER */
   -2,  /* (99) comp ::= COMP INTEGER */
   -2,  /* (100) prec ::= PRECISION STRING */
   -2,  /* (101) update ::= UPDATE INTEGER */
   -2,  /* (102) cachelast ::= CACHELAST INTEGER */
   -2,  /* (103) partitions ::= PARTITIONS INTEGER */
    0,  /* (104) db_optr ::= */
   -2,  /* (105) db_optr ::= db_optr cache */
   -2,  /* (106) db_optr ::= db_optr replica */
   -2,  /* (107) db_optr ::= db_optr quorum */
   -2,  /* (108) db_optr ::= db_optr days */
   -2,  /* (109) db_optr ::= db_optr minrows */
   -2,  /* (110) db_optr ::= db_optr maxrows */
   -2,  /* (111) db_optr ::= db_optr blocks */
   -2,  /* (112) db_optr ::= db_optr ctime */
   -2,  /* (113) db_optr ::= db_optr wal */
   -2,  /* (114) db_optr ::= db_optr fsync */
   -2,  /* (115) db_optr ::= db_optr comp */
   -2,  /* (116) db_optr ::= db_optr prec */
   -2,  /* (117) db_optr ::= db_optr keep */
   -2,  /* (118) db_optr ::= db_optr update */
   -2,  /* (119) db_optr ::= db_optr cachelast */
   -1,  /* (120) topic_optr ::= db_optr */
   -2,  /* (121) topic_optr ::= topic_optr partitions */
    0,  /* (122) alter_db_optr ::= */
   -2,  /* (123) alter_db_optr ::= alter_db_optr replica */
   -2,  /* (124) alter_db_optr ::= alter_db_optr quorum */
   -2,  /* (125) alter_db_optr ::= alter_db_optr keep */
   -2,  /* (126) alter_db_optr ::= alter_db_optr blocks */
   -2,  /* (127) alter_db_optr ::= alter_db_optr comp */
   -2,  /* (128) alter_db_optr ::= alter_db_optr update */
   -2,  /* (129) alter_db_optr ::= alter_db_optr cachelast */
   -1,  /* (130) alter_topic_optr ::= alter_db_optr */
   -2,  /* (131) alter_topic_optr ::= alter_topic_optr partitions */
   -1,  /* (132) typename ::= ids */
   -4,  /* (133) typename ::= ids LP signed RP */
   -2,  /* (134) typename ::= ids UNSIGNED */
   -1,  /* (135) signed ::= INTEGER */
   -2,  /* (136) signed ::= PLUS INTEGER */
   -2,  /* (137) signed ::= MINUS INTEGER */
   -3,  /* (138) cmd ::= CREATE TABLE create_table_args */
   -3,  /* (139) cmd ::= CREATE TABLE create_stable_args */
   -3,  /* (140) cmd ::= CREATE STABLE create_stable_args */
   -3,  /* (141) cmd ::= CREATE TABLE create_table_list */
   -1,  /* (142) create_table_list ::= create_from_stable */
   -2,  /* (143) create_table_list ::= create_table_list create_from_stable */
   -6,  /* (144) create_table_args ::= ifnotexists ids cpxName LP columnlist RP */
  -10,  /* (145) create_stable_args ::= ifnotexists ids cpxName LP columnlist RP TAGS LP columnlist RP */
  -10,  /* (146) create_from_stable ::= ifnotexists ids cpxName USING ids cpxName TAGS LP tagitemlist RP */
  -13,  /* (147) create_from_stable ::= ifnotexists ids cpxName USING ids cpxName LP tagNamelist RP TAGS LP tagitemlist RP */
   -3,  /* (148) tagNamelist ::= tagNamelist COMMA ids */
   -1,  /* (149) tagNamelist ::= ids */
   -5,  /* (150) create_table_args ::= ifnotexists ids cpxName AS select */
   -3,  /* (151) columnlist ::= columnlist COMMA column */
   -1,  /* (152) columnlist ::= column */
   -2,  /* (153) column ::= ids typename */
   -3,  /* (154) tagitemlist ::= tagitemlist COMMA tagitem */
   -1,  /* (155) tagitemlist ::= tagitem */
   -1,  /* (156) tagitem ::= INTEGER */
   -1,  /* (157) tagitem ::= FLOAT */
   -1,  /* (158) tagitem ::= STRING */
   -1,  /* (159) tagitem ::= BOOL */
   -1,  /* (160) tagitem ::= NULL */
   -1,  /* (161) tagitem ::= NOW */
   -3,  /* (162) tagitem ::= NOW PLUS VARIABLE */
   -3,  /* (163) tagitem ::= NOW MINUS VARIABLE */
   -2,  /* (164) tagitem ::= MINUS INTEGER */
   -2,  /* (165) tagitem ::= MINUS FLOAT */
   -2,  /* (166) tagitem ::= PLUS INTEGER */
   -2,  /* (167) tagitem ::= PLUS FLOAT */
  -15,  /* (168) select ::= SELECT selcollist from where_opt range_option interval_option sliding_opt session_option windowstate_option fill_opt groupby_opt having_opt orderby_opt slimit_opt limit_opt */
   -3,  /* (169) select ::= LP select RP */
   -1,  /* (170) union ::= select */
   -4,  /* (171) union ::= union UNION ALL select */
   -1,  /* (172) cmd ::= union */
   -2,  /* (173) select ::= SELECT selcollist */
   -2,  /* (174) sclp ::= selcollist COMMA */
    0,  /* (175) sclp ::= */
   -4,  /* (176) selcollist ::= sclp distinct expr as */
   -2,  /* (177) selcollist ::= sclp STAR */
   -2,  /* (178) as ::= AS ids */
   -1,  /* (179) as ::= ids */
    0,  /* (180) as ::= */
   -1,  /* (181) distinct ::= DISTINCT */
    0,  /* (182) distinct ::= */
   -2,  /* (183) from ::= FROM tablelist */
   -2,  /* (184) from ::= FROM sub */
   -3,  /* (185) sub ::= LP union RP */
   -4,  /* (186) sub ::= LP union RP ids */
   -6,  /* (187) sub ::= sub COMMA LP union RP ids */
   -2,  /* (188) tablelist ::= ids cpxName */
   -3,  /* (189) tablelist ::= ids cpxName ids */
   -4,  /* (190) tablelist ::= tablelist COMMA ids cpxName */
   -5,  /* (191) tablelist ::= tablelist COMMA ids cpxName ids */
   -1,  /* (192) tmvar ::= VARIABLE */
   -1,  /* (193) timestamp ::= INTEGER */
   -2,  /* (194) timestamp ::= MINUS INTEGER */
   -2,  /* (195) timestamp ::= PLUS INTEGER */
   -1,  /* (196) timestamp ::= STRING */
   -1,  /* (197) timestamp ::= NOW */
   -3,  /* (198) timestamp ::= NOW PLUS VARIABLE */
   -3,  /* (199) timestamp ::= NOW MINUS VARIABLE */
    0,  /* (200) range_option ::= */
   -6,  /* (201) range_option ::= RANGE LP timestamp COMMA timestamp RP */
   -4,  /* (202) interval_option ::= intervalKey LP tmvar RP */
   -6,  /* (203) interval_option ::= intervalKey LP tmvar COMMA tmvar RP */
    0,  /* (204) interval_option ::= */
   -1,  /* (205) intervalKey ::= INTERVAL */
   -1,  /* (206) intervalKey ::= EVERY */
    0,  /* (207) session_option ::= */
   -7,  /* (208) session_option ::= SESSION LP ids cpxName COMMA tmvar RP */
    0,  /* (209) windowstate_option ::= */
   -4,  /* (210) windowstate_option ::= STATE_WINDOW LP ids RP */
    0,  /* (211) fill_opt ::= */
   -6,  /* (212) fill_opt ::= FILL LP ID COMMA tagitemlist RP */
   -4,  /* (213) fill_opt ::= FILL LP ID RP */
   -4,  /* (214) sliding_opt ::= SLIDING LP tmvar RP */
    0,  /* (215) sliding_opt ::= */
    0,  /* (216) orderby_opt ::= */
   -3,  /* (217) orderby_opt ::= ORDER BY sortlist */
   -4,  /* (218) sortlist ::= sortlist COMMA item sortorder */
   -4,  /* (219) sortlist ::= sortlist COMMA arrow sortorder */
   -2,  /* (220) sortlist ::= item sortorder */
   -2,  /* (221) sortlist ::= arrow sortorder */
   -1,  /* (222) item ::= ID */
   -3,  /* (223) item ::= ID DOT ID */
   -1,  /* (224) sortorder ::= ASC */
   -1,  /* (225) sortorder ::= DESC */
    0,  /* (226) sortorder ::= */
    0,  /* (227) groupby_opt ::= */
   -3,  /* (228) groupby_opt ::= GROUP BY grouplist */
   -3,  /* (229) grouplist ::= grouplist COMMA item */
   -3,  /* (230) grouplist ::= grouplist COMMA arrow */
   -1,  /* (231) grouplist ::= item */
   -1,  /* (232) grouplist ::= arrow */
    0,  /* (233) having_opt ::= */
   -2,  /* (234) having_opt ::= HAVING expr */
    0,  /* (235) limit_opt ::= */
   -2,  /* (236) limit_opt ::= LIMIT signed */
   -4,  /* (237) limit_opt ::= LIMIT signed OFFSET signed */
   -4,  /* (238) limit_opt ::= LIMIT signed COMMA signed */
    0,  /* (239) slimit_opt ::= */
   -2,  /* (240) slimit_opt ::= SLIMIT signed */
   -4,  /* (241) slimit_opt ::= SLIMIT signed SOFFSET signed */
   -4,  /* (242) slimit_opt ::= SLIMIT signed COMMA signed */
    0,  /* (243) where_opt ::= */
   -2,  /* (244) where_opt ::= WHERE expr */
   -3,  /* (245) expr ::= LP expr RP */
   -1,  /* (246) expr ::= ID */
   -3,  /* (247) expr ::= ID DOT ID */
   -3,  /* (248) expr ::= ID DOT STAR */
   -1,  /* (249) expr ::= INTEGER */
   -2,  /* (250) expr ::= MINUS INTEGER */
   -2,  /* (251) expr ::= PLUS INTEGER */
   -1,  /* (252) expr ::= FLOAT */
   -2,  /* (253) expr ::= MINUS FLOAT */
   -2,  /* (254) expr ::= PLUS FLOAT */
   -1,  /* (255) expr ::= STRING */
   -1,  /* (256) expr ::= NOW */
   -1,  /* (257) expr ::= VARIABLE */
   -2,  /* (258) expr ::= PLUS VARIABLE */
   -2,  /* (259) expr ::= MINUS VARIABLE */
   -1,  /* (260) expr ::= BOOL */
   -1,  /* (261) expr ::= NULL */
   -4,  /* (262) expr ::= ID LP exprlist RP */
   -4,  /* (263) expr ::= ID LP STAR RP */
   -6,  /* (264) expr ::= ID LP expr AS typename RP */
   -3,  /* (265) expr ::= expr IS NULL */
   -4,  /* (266) expr ::= expr IS NOT NULL */
   -3,  /* (267) expr ::= expr LT expr */
   -3,  /* (268) expr ::= expr GT expr */
   -3,  /* (269) expr ::= expr LE expr */
   -3,  /* (270) expr ::= expr GE expr */
   -3,  /* (271) expr ::= expr NE expr */
   -3,  /* (272) expr ::= expr EQ expr */
   -5,  /* (273) expr ::= expr BETWEEN expr AND expr */
   -3,  /* (274) expr ::= expr AND expr */
   -3,  /* (275) expr ::= expr OR expr */
   -3,  /* (276) expr ::= expr PLUS expr */
   -3,  /* (277) expr ::= expr MINUS expr */
   -3,  /* (278) expr ::= expr STAR expr */
   -3,  /* (279) expr ::= expr SLASH expr */
   -3,  /* (280) expr ::= expr REM expr */
   -3,  /* (281) expr ::= expr LIKE expr */
   -3,  /* (282) expr ::= expr MATCH expr */
   -3,  /* (283) expr ::= expr NMATCH expr */
   -3,  /* (284) expr ::= ID CONTAINS STRING */
   -5,  /* (285) expr ::= ID DOT ID CONTAINS STRING */
   -3,  /* (286) arrow ::= ID ARROW STRING */
   -5,  /* (287) arrow ::= ID DOT ID ARROW STRING */
   -1,  /* (288) expr ::= arrow */
   -5,  /* (289) expr ::= expr IN LP exprlist RP */
   -3,  /* (290) exprlist ::= exprlist COMMA expritem */
   -1,  /* (291) exprlist ::= expritem */
   -1,  /* (292) expritem ::= expr */
    0,  /* (293) expritem ::= */
   -3,  /* (294) cmd ::= RESET QUERY CACHE */
   -3,  /* (295) cmd ::= SYNCDB ids REPLICA */
   -7,  /* (296) cmd ::= ALTER TABLE ids cpxName ADD COLUMN columnlist */
   -7,  /* (297) cmd ::= ALTER TABLE ids cpxName DROP COLUMN ids */
   -7,  /* (298) cmd ::= ALTER TABLE ids cpxName MODIFY COLUMN columnlist */
   -7,  /* (299) cmd ::= ALTER TABLE ids cpxName ADD TAG columnlist */
   -7,  /* (300) cmd ::= ALTER TABLE ids cpxName DROP TAG ids */
   -8,  /* (301) cmd ::= ALTER TABLE ids cpxName CHANGE TAG ids ids */
   -9,  /* (302) cmd ::= ALTER TABLE ids cpxName SET TAG ids EQ tagitem */
   -7,  /* (303) cmd ::= ALTER TABLE ids cpxName MODIFY TAG columnlist */
   -7,  /* (304) cmd ::= ALTER STABLE ids cpxName ADD COLUMN columnlist */
   -7,  /* (305) cmd ::= ALTER STABLE ids cpxName DROP COLUMN ids */
   -7,  /* (306) cmd ::= ALTER STABLE ids cpxName MODIFY COLUMN columnlist */
   -7,  /* (307) cmd ::= ALTER STABLE ids cpxName ADD TAG columnlist */
   -7,  /* (308) cmd ::= ALTER STABLE ids cpxName DROP TAG ids */
   -8,  /* (309) cmd ::= ALTER STABLE ids cpxName CHANGE TAG ids ids */
   -9,  /* (310) cmd ::= ALTER STABLE ids cpxName SET TAG ids EQ tagitem */
   -7,  /* (311) cmd ::= ALTER STABLE ids cpxName MODIFY TAG columnlist */
   -3,  /* (312) cmd ::= KILL CONNECTION INTEGER */
   -5,  /* (313) cmd ::= KILL STREAM INTEGER COLON INTEGER */
   -5,  /* (314) cmd ::= KILL QUERY INTEGER COLON INTEGER */
};

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 */
  ParseTOKENTYPE yyLookaheadToken  /* Value of the lookahead token */
  ParseCTX_PDECL                   /* %extra_context */
){
  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 */
  ParseARG_FETCH
  (void)yyLookahead;
  (void)yyLookaheadToken;
  yymsp = yypParser->yytos;

  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;
      case 0: /* program ::= cmd */
      case 138: /* cmd ::= CREATE TABLE create_table_args */ yytestcase(yyruleno==138);
      case 139: /* cmd ::= CREATE TABLE create_stable_args */ yytestcase(yyruleno==139);
      case 140: /* cmd ::= CREATE STABLE create_stable_args */ yytestcase(yyruleno==140);
{}
        break;
      case 1: /* cmd ::= SHOW DATABASES */
{ setShowOptions(pInfo, TSDB_MGMT_TABLE_DB, 0, 0);}
        break;
      case 2: /* cmd ::= SHOW TOPICS */
{ setShowOptions(pInfo, TSDB_MGMT_TABLE_TP, 0, 0);}
        break;
      case 3: /* cmd ::= SHOW FUNCTIONS */
{ setShowOptions(pInfo, TSDB_MGMT_TABLE_FUNCTION, 0, 0);}
        break;
      case 4: /* cmd ::= SHOW MNODES */
{ setShowOptions(pInfo, TSDB_MGMT_TABLE_MNODE, 0, 0);}
        break;
      case 5: /* cmd ::= SHOW DNODES */
{ setShowOptions(pInfo, TSDB_MGMT_TABLE_DNODE, 0, 0);}
        break;
      case 6: /* cmd ::= SHOW ACCOUNTS */
{ setShowOptions(pInfo, TSDB_MGMT_TABLE_ACCT, 0, 0);}
        break;
      case 7: /* cmd ::= SHOW USERS */
{ setShowOptions(pInfo, TSDB_MGMT_TABLE_USER, 0, 0);}
        break;
      case 8: /* cmd ::= SHOW MODULES */
{ setShowOptions(pInfo, TSDB_MGMT_TABLE_MODULE, 0, 0);  }
        break;
      case 9: /* cmd ::= SHOW QUERIES */
{ setShowOptions(pInfo, TSDB_MGMT_TABLE_QUERIES, 0, 0);  }
        break;
      case 10: /* cmd ::= SHOW CONNECTIONS */
{ setShowOptions(pInfo, TSDB_MGMT_TABLE_CONNS, 0, 0);}
        break;
      case 11: /* cmd ::= SHOW STREAMS */
{ setShowOptions(pInfo, TSDB_MGMT_TABLE_STREAMS, 0, 0);  }
        break;
      case 12: /* cmd ::= SHOW VARIABLES */
{ setShowOptions(pInfo, TSDB_MGMT_TABLE_VARIABLES, 0, 0);  }
        break;
      case 13: /* cmd ::= SHOW SCORES */
{ setShowOptions(pInfo, TSDB_MGMT_TABLE_SCORES, 0, 0);   }
        break;
      case 14: /* cmd ::= SHOW GRANTS */
{ setShowOptions(pInfo, TSDB_MGMT_TABLE_GRANTS, 0, 0);   }
        break;
      case 15: /* cmd ::= SHOW VNODES */
{ setShowOptions(pInfo, TSDB_MGMT_TABLE_VNODES, 0, 0); }
        break;
      case 16: /* cmd ::= SHOW VNODES ids */
{ setShowOptions(pInfo, TSDB_MGMT_TABLE_VNODES, &yymsp[0].minor.yy0, 0); }
        break;
      case 17: /* dbPrefix ::= */
{yymsp[1].minor.yy0.n = 0; yymsp[1].minor.yy0.type = 0;}
        break;
      case 18: /* dbPrefix ::= ids DOT */
{yylhsminor.yy0 = yymsp[-1].minor.yy0;  }
  yymsp[-1].minor.yy0 = yylhsminor.yy0;
        break;
      case 19: /* cpxName ::= */
{yymsp[1].minor.yy0.n = 0;  }
        break;
      case 20: /* cpxName ::= DOT ids */
{yymsp[-1].minor.yy0 = yymsp[0].minor.yy0; yymsp[-1].minor.yy0.n += 1;    }
        break;
      case 21: /* cmd ::= SHOW CREATE TABLE ids cpxName */
{
   yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n;
   setDCLSqlElems(pInfo, TSDB_SQL_SHOW_CREATE_TABLE, 1, &yymsp[-1].minor.yy0);
}
        break;
      case 22: /* cmd ::= SHOW CREATE STABLE ids cpxName */
{
   yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n;
   setDCLSqlElems(pInfo, TSDB_SQL_SHOW_CREATE_STABLE, 1, &yymsp[-1].minor.yy0);
}
        break;
      case 23: /* cmd ::= SHOW CREATE DATABASE ids */
{
  setDCLSqlElems(pInfo, TSDB_SQL_SHOW_CREATE_DATABASE, 1, &yymsp[0].minor.yy0);
}
        break;
      case 24: /* cmd ::= SHOW dbPrefix TABLES */
{
    setShowOptions(pInfo, TSDB_MGMT_TABLE_TABLE, &yymsp[-1].minor.yy0, 0);
}
        break;
      case 25: /* cmd ::= SHOW dbPrefix TABLES LIKE ids */
{
    setShowOptions(pInfo, TSDB_MGMT_TABLE_TABLE, &yymsp[-3].minor.yy0, &yymsp[0].minor.yy0);
}
        break;
      case 26: /* cmd ::= SHOW dbPrefix STABLES */
{
    setShowOptions(pInfo, TSDB_MGMT_TABLE_METRIC, &yymsp[-1].minor.yy0, 0);
}
        break;
      case 27: /* cmd ::= SHOW dbPrefix STABLES LIKE ids */
{
    SStrToken token;
    tSetDbName(&token, &yymsp[-3].minor.yy0);
    setShowOptions(pInfo, TSDB_MGMT_TABLE_METRIC, &token, &yymsp[0].minor.yy0);
}
        break;
      case 28: /* cmd ::= SHOW dbPrefix VGROUPS */
{
    SStrToken token;
    tSetDbName(&token, &yymsp[-1].minor.yy0);
    setShowOptions(pInfo, TSDB_MGMT_TABLE_VGROUP, &token, 0);
}
        break;
      case 29: /* cmd ::= DROP TABLE ifexists ids cpxName */
{
    yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n;
    setDropDbTableInfo(pInfo, TSDB_SQL_DROP_TABLE, &yymsp[-1].minor.yy0, &yymsp[-2].minor.yy0, -1, -1);
}
        break;
      case 30: /* cmd ::= DROP STABLE ifexists ids cpxName */
{
    yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n;
    setDropDbTableInfo(pInfo, TSDB_SQL_DROP_TABLE, &yymsp[-1].minor.yy0, &yymsp[-2].minor.yy0, -1, TSDB_SUPER_TABLE);
}
        break;
      case 31: /* cmd ::= DROP DATABASE ifexists ids */
{ setDropDbTableInfo(pInfo, TSDB_SQL_DROP_DB, &yymsp[0].minor.yy0, &yymsp[-1].minor.yy0, TSDB_DB_TYPE_DEFAULT, -1); }
        break;
      case 32: /* cmd ::= DROP TOPIC ifexists ids */
{ setDropDbTableInfo(pInfo, TSDB_SQL_DROP_DB, &yymsp[0].minor.yy0, &yymsp[-1].minor.yy0, TSDB_DB_TYPE_TOPIC, -1); }
        break;
      case 33: /* cmd ::= DROP FUNCTION ids */
{ setDropFuncInfo(pInfo, TSDB_SQL_DROP_FUNCTION, &yymsp[0].minor.yy0); }
        break;
      case 34: /* cmd ::= DROP DNODE ids */
{ setDCLSqlElems(pInfo, TSDB_SQL_DROP_DNODE, 1, &yymsp[0].minor.yy0);    }
        break;
      case 35: /* cmd ::= DROP USER ids */
{ setDCLSqlElems(pInfo, TSDB_SQL_DROP_USER, 1, &yymsp[0].minor.yy0);     }
        break;
      case 36: /* cmd ::= DROP ACCOUNT ids */
{ setDCLSqlElems(pInfo, TSDB_SQL_DROP_ACCT, 1, &yymsp[0].minor.yy0);  }
        break;
      case 37: /* cmd ::= USE ids */
{ setDCLSqlElems(pInfo, TSDB_SQL_USE_DB, 1, &yymsp[0].minor.yy0);}
        break;
      case 38: /* cmd ::= DESCRIBE ids cpxName */
      case 39: /* cmd ::= DESC ids cpxName */ yytestcase(yyruleno==39);
{
    yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n;
    setDCLSqlElems(pInfo, TSDB_SQL_DESCRIBE_TABLE, 1, &yymsp[-1].minor.yy0);
}
        break;
      case 40: /* cmd ::= ALTER USER ids PASS ids */
{ setAlterUserSql(pInfo, TSDB_ALTER_USER_PASSWD, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, NULL);    }
        break;
      case 41: /* cmd ::= ALTER USER ids PRIVILEGE ids */
{ setAlterUserSql(pInfo, TSDB_ALTER_USER_PRIVILEGES, &yymsp[-2].minor.yy0, NULL, &yymsp[0].minor.yy0);}
        break;
      case 42: /* cmd ::= ALTER DNODE ids ids */
{ setDCLSqlElems(pInfo, TSDB_SQL_CFG_DNODE, 2, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0);          }
        break;
      case 43: /* cmd ::= ALTER DNODE ids ids ids */
{ setDCLSqlElems(pInfo, TSDB_SQL_CFG_DNODE, 3, &yymsp[-2].minor.yy0, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0);      }
        break;
      case 44: /* cmd ::= ALTER LOCAL ids */
{ setDCLSqlElems(pInfo, TSDB_SQL_CFG_LOCAL, 1, &yymsp[0].minor.yy0);              }
        break;
      case 45: /* cmd ::= ALTER LOCAL ids ids */
{ setDCLSqlElems(pInfo, TSDB_SQL_CFG_LOCAL, 2, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0);          }
        break;
      case 46: /* cmd ::= ALTER DATABASE ids alter_db_optr */
      case 47: /* cmd ::= ALTER TOPIC ids alter_topic_optr */ yytestcase(yyruleno==47);
{ SStrToken t = {0};  setCreateDbInfo(pInfo, TSDB_SQL_ALTER_DB, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy470, &t);}
        break;
      case 48: /* cmd ::= ALTER ACCOUNT ids acct_optr */
{ setCreateAcctSql(pInfo, TSDB_SQL_ALTER_ACCT, &yymsp[-1].minor.yy0, NULL, &yymsp[0].minor.yy51);}
        break;
      case 49: /* cmd ::= ALTER ACCOUNT ids PASS ids acct_optr */
{ setCreateAcctSql(pInfo, TSDB_SQL_ALTER_ACCT, &yymsp[-3].minor.yy0, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy51);}
        break;
      case 50: /* cmd ::= COMPACT VNODES IN LP exprlist RP */
{ setCompactVnodeSql(pInfo, TSDB_SQL_COMPACT_VNODE, yymsp[-1].minor.yy189);}
        break;
      case 51: /* ids ::= ID */
      case 52: /* ids ::= STRING */ yytestcase(yyruleno==52);
{yylhsminor.yy0 = yymsp[0].minor.yy0; }
  yymsp[0].minor.yy0 = yylhsminor.yy0;
        break;
      case 53: /* ifexists ::= IF EXISTS */
{ yymsp[-1].minor.yy0.n = 1;}
        break;
      case 54: /* ifexists ::= */
      case 56: /* ifnotexists ::= */ yytestcase(yyruleno==56);
      case 182: /* distinct ::= */ yytestcase(yyruleno==182);
{ yymsp[1].minor.yy0.n = 0;}
        break;
      case 55: /* ifnotexists ::= IF NOT EXISTS */
{ yymsp[-2].minor.yy0.n = 1;}
        break;
      case 57: /* cmd ::= CREATE DNODE ids */
{ setDCLSqlElems(pInfo, TSDB_SQL_CREATE_DNODE, 1, &yymsp[0].minor.yy0);}
        break;
      case 58: /* cmd ::= CREATE ACCOUNT ids PASS ids acct_optr */
{ setCreateAcctSql(pInfo, TSDB_SQL_CREATE_ACCT, &yymsp[-3].minor.yy0, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy51);}
        break;
      case 59: /* cmd ::= CREATE DATABASE ifnotexists ids db_optr */
      case 60: /* cmd ::= CREATE TOPIC ifnotexists ids topic_optr */ yytestcase(yyruleno==60);
{ setCreateDbInfo(pInfo, TSDB_SQL_CREATE_DB, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy470, &yymsp[-2].minor.yy0);}
        break;
      case 61: /* cmd ::= CREATE FUNCTION ids AS ids OUTPUTTYPE typename bufsize */
{ setCreateFuncInfo(pInfo, TSDB_SQL_CREATE_FUNCTION, &yymsp[-5].minor.yy0, &yymsp[-3].minor.yy0, &yymsp[-1].minor.yy279, &yymsp[0].minor.yy0, 1);}
        break;
      case 62: /* cmd ::= CREATE AGGREGATE FUNCTION ids AS ids OUTPUTTYPE typename bufsize */
{ setCreateFuncInfo(pInfo, TSDB_SQL_CREATE_FUNCTION, &yymsp[-5].minor.yy0, &yymsp[-3].minor.yy0, &yymsp[-1].minor.yy279, &yymsp[0].minor.yy0, 2);}
        break;
      case 63: /* cmd ::= CREATE USER ids PASS ids */
{ setCreateUserSql(pInfo, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0);}
        break;
      case 64: /* bufsize ::= */
      case 66: /* pps ::= */ yytestcase(yyruleno==66);
      case 68: /* tseries ::= */ yytestcase(yyruleno==68);
      case 70: /* dbs ::= */ yytestcase(yyruleno==70);
      case 72: /* streams ::= */ yytestcase(yyruleno==72);
      case 74: /* storage ::= */ yytestcase(yyruleno==74);
      case 76: /* qtime ::= */ yytestcase(yyruleno==76);
      case 78: /* users ::= */ yytestcase(yyruleno==78);
      case 80: /* conns ::= */ yytestcase(yyruleno==80);
      case 82: /* state ::= */ yytestcase(yyruleno==82);
{ yymsp[1].minor.yy0.n = 0;   }
        break;
      case 65: /* bufsize ::= BUFSIZE INTEGER */
      case 67: /* pps ::= PPS INTEGER */ yytestcase(yyruleno==67);
      case 69: /* tseries ::= TSERIES INTEGER */ yytestcase(yyruleno==69);
      case 71: /* dbs ::= DBS INTEGER */ yytestcase(yyruleno==71);
      case 73: /* streams ::= STREAMS INTEGER */ yytestcase(yyruleno==73);
      case 75: /* storage ::= STORAGE INTEGER */ yytestcase(yyruleno==75);
      case 77: /* qtime ::= QTIME INTEGER */ yytestcase(yyruleno==77);
      case 79: /* users ::= USERS INTEGER */ yytestcase(yyruleno==79);
      case 81: /* conns ::= CONNS INTEGER */ yytestcase(yyruleno==81);
      case 83: /* state ::= STATE ids */ yytestcase(yyruleno==83);
{ yymsp[-1].minor.yy0 = yymsp[0].minor.yy0;     }
        break;
      case 84: /* acct_optr ::= pps tseries storage streams qtime dbs users conns state */
{
    yylhsminor.yy51.maxUsers   = (yymsp[-2].minor.yy0.n>0)?atoi(yymsp[-2].minor.yy0.z):-1;
    yylhsminor.yy51.maxDbs     = (yymsp[-3].minor.yy0.n>0)?atoi(yymsp[-3].minor.yy0.z):-1;
    yylhsminor.yy51.maxTimeSeries = (yymsp[-7].minor.yy0.n>0)?atoi(yymsp[-7].minor.yy0.z):-1;
    yylhsminor.yy51.maxStreams = (yymsp[-5].minor.yy0.n>0)?atoi(yymsp[-5].minor.yy0.z):-1;
    yylhsminor.yy51.maxPointsPerSecond     = (yymsp[-8].minor.yy0.n>0)?atoi(yymsp[-8].minor.yy0.z):-1;
    yylhsminor.yy51.maxStorage = (yymsp[-6].minor.yy0.n>0)?strtoll(yymsp[-6].minor.yy0.z, NULL, 10):-1;
    yylhsminor.yy51.maxQueryTime   = (yymsp[-4].minor.yy0.n>0)?strtoll(yymsp[-4].minor.yy0.z, NULL, 10):-1;
    yylhsminor.yy51.maxConnections   = (yymsp[-1].minor.yy0.n>0)?atoi(yymsp[-1].minor.yy0.z):-1;
    yylhsminor.yy51.stat    = yymsp[0].minor.yy0;
}
  yymsp[-8].minor.yy51 = yylhsminor.yy51;
        break;
      case 85: /* intitemlist ::= intitemlist COMMA intitem */
      case 154: /* tagitemlist ::= tagitemlist COMMA tagitem */ yytestcase(yyruleno==154);
{ yylhsminor.yy189 = tVariantListAppend(yymsp[-2].minor.yy189, &yymsp[0].minor.yy162, -1);    }
  yymsp[-2].minor.yy189 = yylhsminor.yy189;
        break;
      case 86: /* intitemlist ::= intitem */
      case 155: /* tagitemlist ::= tagitem */ yytestcase(yyruleno==155);
{ yylhsminor.yy189 = tVariantListAppend(NULL, &yymsp[0].minor.yy162, -1); }
  yymsp[0].minor.yy189 = yylhsminor.yy189;
        break;
      case 87: /* intitem ::= INTEGER */
      case 156: /* tagitem ::= INTEGER */ yytestcase(yyruleno==156);
      case 157: /* tagitem ::= FLOAT */ yytestcase(yyruleno==157);
      case 158: /* tagitem ::= STRING */ yytestcase(yyruleno==158);
      case 159: /* tagitem ::= BOOL */ yytestcase(yyruleno==159);
{ toTSDBType(yymsp[0].minor.yy0.type); tVariantCreate(&yylhsminor.yy162, &yymsp[0].minor.yy0); }
  yymsp[0].minor.yy162 = yylhsminor.yy162;
        break;
      case 88: /* keep ::= KEEP intitemlist */
{ yymsp[-1].minor.yy189 = yymsp[0].minor.yy189; }
        break;
      case 89: /* cache ::= CACHE INTEGER */
      case 90: /* replica ::= REPLICA INTEGER */ yytestcase(yyruleno==90);
      case 91: /* quorum ::= QUORUM INTEGER */ yytestcase(yyruleno==91);
      case 92: /* days ::= DAYS INTEGER */ yytestcase(yyruleno==92);
      case 93: /* minrows ::= MINROWS INTEGER */ yytestcase(yyruleno==93);
      case 94: /* maxrows ::= MAXROWS INTEGER */ yytestcase(yyruleno==94);
      case 95: /* blocks ::= BLOCKS INTEGER */ yytestcase(yyruleno==95);
      case 96: /* ctime ::= CTIME INTEGER */ yytestcase(yyruleno==96);
      case 97: /* wal ::= WAL INTEGER */ yytestcase(yyruleno==97);
      case 98: /* fsync ::= FSYNC INTEGER */ yytestcase(yyruleno==98);
      case 99: /* comp ::= COMP INTEGER */ yytestcase(yyruleno==99);
      case 100: /* prec ::= PRECISION STRING */ yytestcase(yyruleno==100);
      case 101: /* update ::= UPDATE INTEGER */ yytestcase(yyruleno==101);
      case 102: /* cachelast ::= CACHELAST INTEGER */ yytestcase(yyruleno==102);
      case 103: /* partitions ::= PARTITIONS INTEGER */ yytestcase(yyruleno==103);
{ yymsp[-1].minor.yy0 = yymsp[0].minor.yy0; }
        break;
      case 104: /* db_optr ::= */
{setDefaultCreateDbOption(&yymsp[1].minor.yy470); yymsp[1].minor.yy470.dbType = TSDB_DB_TYPE_DEFAULT;}
        break;
      case 105: /* db_optr ::= db_optr cache */
{ yylhsminor.yy470 = yymsp[-1].minor.yy470; yylhsminor.yy470.cacheBlockSize = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
  yymsp[-1].minor.yy470 = yylhsminor.yy470;
        break;
      case 106: /* db_optr ::= db_optr replica */
      case 123: /* alter_db_optr ::= alter_db_optr replica */ yytestcase(yyruleno==123);
{ yylhsminor.yy470 = yymsp[-1].minor.yy470; yylhsminor.yy470.replica = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
  yymsp[-1].minor.yy470 = yylhsminor.yy470;
        break;
      case 107: /* db_optr ::= db_optr quorum */
      case 124: /* alter_db_optr ::= alter_db_optr quorum */ yytestcase(yyruleno==124);
{ yylhsminor.yy470 = yymsp[-1].minor.yy470; yylhsminor.yy470.quorum = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
  yymsp[-1].minor.yy470 = yylhsminor.yy470;
        break;
      case 108: /* db_optr ::= db_optr days */
{ yylhsminor.yy470 = yymsp[-1].minor.yy470; yylhsminor.yy470.daysPerFile = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
  yymsp[-1].minor.yy470 = yylhsminor.yy470;
        break;
      case 109: /* db_optr ::= db_optr minrows */
{ yylhsminor.yy470 = yymsp[-1].minor.yy470; yylhsminor.yy470.minRowsPerBlock = strtod(yymsp[0].minor.yy0.z, NULL); }
  yymsp[-1].minor.yy470 = yylhsminor.yy470;
        break;
      case 110: /* db_optr ::= db_optr maxrows */
{ yylhsminor.yy470 = yymsp[-1].minor.yy470; yylhsminor.yy470.maxRowsPerBlock = strtod(yymsp[0].minor.yy0.z, NULL); }
  yymsp[-1].minor.yy470 = yylhsminor.yy470;
        break;
      case 111: /* db_optr ::= db_optr blocks */
      case 126: /* alter_db_optr ::= alter_db_optr blocks */ yytestcase(yyruleno==126);
{ yylhsminor.yy470 = yymsp[-1].minor.yy470; yylhsminor.yy470.numOfBlocks = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
  yymsp[-1].minor.yy470 = yylhsminor.yy470;
        break;
      case 112: /* db_optr ::= db_optr ctime */
{ yylhsminor.yy470 = yymsp[-1].minor.yy470; yylhsminor.yy470.commitTime = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
  yymsp[-1].minor.yy470 = yylhsminor.yy470;
        break;
      case 113: /* db_optr ::= db_optr wal */
{ yylhsminor.yy470 = yymsp[-1].minor.yy470; yylhsminor.yy470.walLevel = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
  yymsp[-1].minor.yy470 = yylhsminor.yy470;
        break;
      case 114: /* db_optr ::= db_optr fsync */
{ yylhsminor.yy470 = yymsp[-1].minor.yy470; yylhsminor.yy470.fsyncPeriod = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
  yymsp[-1].minor.yy470 = yylhsminor.yy470;
        break;
      case 115: /* db_optr ::= db_optr comp */
      case 127: /* alter_db_optr ::= alter_db_optr comp */ yytestcase(yyruleno==127);
{ yylhsminor.yy470 = yymsp[-1].minor.yy470; yylhsminor.yy470.compressionLevel = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
  yymsp[-1].minor.yy470 = yylhsminor.yy470;
        break;
      case 116: /* db_optr ::= db_optr prec */
{ yylhsminor.yy470 = yymsp[-1].minor.yy470; yylhsminor.yy470.precision = yymsp[0].minor.yy0; }
  yymsp[-1].minor.yy470 = yylhsminor.yy470;
        break;
      case 117: /* db_optr ::= db_optr keep */
      case 125: /* alter_db_optr ::= alter_db_optr keep */ yytestcase(yyruleno==125);
{ yylhsminor.yy470 = yymsp[-1].minor.yy470; yylhsminor.yy470.keep = yymsp[0].minor.yy189; }
  yymsp[-1].minor.yy470 = yylhsminor.yy470;
        break;
      case 118: /* db_optr ::= db_optr update */
      case 128: /* alter_db_optr ::= alter_db_optr update */ yytestcase(yyruleno==128);
{ yylhsminor.yy470 = yymsp[-1].minor.yy470; yylhsminor.yy470.update = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
  yymsp[-1].minor.yy470 = yylhsminor.yy470;
        break;
      case 119: /* db_optr ::= db_optr cachelast */
      case 129: /* alter_db_optr ::= alter_db_optr cachelast */ yytestcase(yyruleno==129);
{ yylhsminor.yy470 = yymsp[-1].minor.yy470; yylhsminor.yy470.cachelast = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
  yymsp[-1].minor.yy470 = yylhsminor.yy470;
        break;
      case 120: /* topic_optr ::= db_optr */
      case 130: /* alter_topic_optr ::= alter_db_optr */ yytestcase(yyruleno==130);
{ yylhsminor.yy470 = yymsp[0].minor.yy470; yylhsminor.yy470.dbType = TSDB_DB_TYPE_TOPIC; }
  yymsp[0].minor.yy470 = yylhsminor.yy470;
        break;
      case 121: /* topic_optr ::= topic_optr partitions */
      case 131: /* alter_topic_optr ::= alter_topic_optr partitions */ yytestcase(yyruleno==131);
{ yylhsminor.yy470 = yymsp[-1].minor.yy470; yylhsminor.yy470.partitions = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
  yymsp[-1].minor.yy470 = yylhsminor.yy470;
        break;
      case 122: /* alter_db_optr ::= */
{ setDefaultCreateDbOption(&yymsp[1].minor.yy470); yymsp[1].minor.yy470.dbType = TSDB_DB_TYPE_DEFAULT;}
        break;
      case 132: /* typename ::= ids */
{
  yymsp[0].minor.yy0.type = 0;
  tSetColumnType (&yylhsminor.yy279, &yymsp[0].minor.yy0);
}
  yymsp[0].minor.yy279 = yylhsminor.yy279;
        break;
      case 133: /* typename ::= ids LP signed RP */
{
  if (yymsp[-1].minor.yy69 <= 0) {
    yymsp[-3].minor.yy0.type = 0;
    tSetColumnType(&yylhsminor.yy279, &yymsp[-3].minor.yy0);
  } else {
    yymsp[-3].minor.yy0.type = -yymsp[-1].minor.yy69;  // negative value of name length
    tSetColumnType(&yylhsminor.yy279, &yymsp[-3].minor.yy0);
  }
}
  yymsp[-3].minor.yy279 = yylhsminor.yy279;
        break;
      case 134: /* typename ::= ids UNSIGNED */
{
  yymsp[-1].minor.yy0.type = 0;
  yymsp[-1].minor.yy0.n = ((yymsp[0].minor.yy0.z + yymsp[0].minor.yy0.n) - yymsp[-1].minor.yy0.z);
  tSetColumnType (&yylhsminor.yy279, &yymsp[-1].minor.yy0);
}
  yymsp[-1].minor.yy279 = yylhsminor.yy279;
        break;
      case 135: /* signed ::= INTEGER */
{ yylhsminor.yy69 = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
  yymsp[0].minor.yy69 = yylhsminor.yy69;
        break;
      case 136: /* signed ::= PLUS INTEGER */
{ yymsp[-1].minor.yy69 = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
        break;
      case 137: /* signed ::= MINUS INTEGER */
{ yymsp[-1].minor.yy69 = -strtol(yymsp[0].minor.yy0.z, NULL, 10);}
        break;
      case 141: /* cmd ::= CREATE TABLE create_table_list */
{ pInfo->type = TSDB_SQL_CREATE_TABLE; pInfo->pCreateTableInfo = yymsp[0].minor.yy6;}
        break;
      case 142: /* create_table_list ::= create_from_stable */
{
  SCreateTableSql* pCreateTable = calloc(1, sizeof(SCreateTableSql));
  pCreateTable->childTableInfo = taosArrayInit(4, sizeof(SCreatedTableInfo));

  taosArrayPush(pCreateTable->childTableInfo, &yymsp[0].minor.yy208);
  pCreateTable->type = TSQL_CREATE_TABLE_FROM_STABLE;
  yylhsminor.yy6 = pCreateTable;
}
  yymsp[0].minor.yy6 = yylhsminor.yy6;
        break;
      case 143: /* create_table_list ::= create_table_list create_from_stable */
{
  taosArrayPush(yymsp[-1].minor.yy6->childTableInfo, &yymsp[0].minor.yy208);
  yylhsminor.yy6 = yymsp[-1].minor.yy6;
}
  yymsp[-1].minor.yy6 = yylhsminor.yy6;
        break;
      case 144: /* create_table_args ::= ifnotexists ids cpxName LP columnlist RP */
{
  yylhsminor.yy6 = tSetCreateTableInfo(yymsp[-1].minor.yy189, NULL, NULL, TSQL_CREATE_TABLE);
  setSqlInfo(pInfo, yylhsminor.yy6, NULL, TSDB_SQL_CREATE_TABLE);

  yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n;
  setCreatedTableName(pInfo, &yymsp[-4].minor.yy0, &yymsp[-5].minor.yy0);
}
  yymsp[-5].minor.yy6 = yylhsminor.yy6;
        break;
      case 145: /* create_stable_args ::= ifnotexists ids cpxName LP columnlist RP TAGS LP columnlist RP */
{
  yylhsminor.yy6 = tSetCreateTableInfo(yymsp[-5].minor.yy189, yymsp[-1].minor.yy189, NULL, TSQL_CREATE_STABLE);
  setSqlInfo(pInfo, yylhsminor.yy6, NULL, TSDB_SQL_CREATE_TABLE);

  yymsp[-8].minor.yy0.n += yymsp[-7].minor.yy0.n;
  setCreatedTableName(pInfo, &yymsp[-8].minor.yy0, &yymsp[-9].minor.yy0);
}
  yymsp[-9].minor.yy6 = yylhsminor.yy6;
        break;
      case 146: /* create_from_stable ::= ifnotexists ids cpxName USING ids cpxName TAGS LP tagitemlist RP */
{
  yymsp[-5].minor.yy0.n += yymsp[-4].minor.yy0.n;
  yymsp[-8].minor.yy0.n += yymsp[-7].minor.yy0.n;
  yylhsminor.yy208 = createNewChildTableInfo(&yymsp[-5].minor.yy0, NULL, yymsp[-1].minor.yy189, &yymsp[-8].minor.yy0, &yymsp[-9].minor.yy0);
}
  yymsp[-9].minor.yy208 = yylhsminor.yy208;
        break;
      case 147: /* create_from_stable ::= ifnotexists ids cpxName USING ids cpxName LP tagNamelist RP TAGS LP tagitemlist RP */
{
  yymsp[-8].minor.yy0.n += yymsp[-7].minor.yy0.n;
  yymsp[-11].minor.yy0.n += yymsp[-10].minor.yy0.n;
  yylhsminor.yy208 = createNewChildTableInfo(&yymsp[-8].minor.yy0, yymsp[-5].minor.yy189, yymsp[-1].minor.yy189, &yymsp[-11].minor.yy0, &yymsp[-12].minor.yy0);
}
  yymsp[-12].minor.yy208 = yylhsminor.yy208;
        break;
      case 148: /* tagNamelist ::= tagNamelist COMMA ids */
{taosArrayPush(yymsp[-2].minor.yy189, &yymsp[0].minor.yy0); yylhsminor.yy189 = yymsp[-2].minor.yy189;  }
  yymsp[-2].minor.yy189 = yylhsminor.yy189;
        break;
      case 149: /* tagNamelist ::= ids */
{yylhsminor.yy189 = taosArrayInit(4, sizeof(SStrToken)); taosArrayPush(yylhsminor.yy189, &yymsp[0].minor.yy0);}
  yymsp[0].minor.yy189 = yylhsminor.yy189;
        break;
      case 150: /* create_table_args ::= ifnotexists ids cpxName AS select */
{
  yylhsminor.yy6 = tSetCreateTableInfo(NULL, NULL, yymsp[0].minor.yy16, TSQL_CREATE_STREAM);
  setSqlInfo(pInfo, yylhsminor.yy6, NULL, TSDB_SQL_CREATE_TABLE);

  yymsp[-3].minor.yy0.n += yymsp[-2].minor.yy0.n;
  setCreatedTableName(pInfo, &yymsp[-3].minor.yy0, &yymsp[-4].minor.yy0);
}
  yymsp[-4].minor.yy6 = yylhsminor.yy6;
        break;
      case 151: /* columnlist ::= columnlist COMMA column */
{taosArrayPush(yymsp[-2].minor.yy189, &yymsp[0].minor.yy279); yylhsminor.yy189 = yymsp[-2].minor.yy189;  }
  yymsp[-2].minor.yy189 = yylhsminor.yy189;
        break;
      case 152: /* columnlist ::= column */
{yylhsminor.yy189 = taosArrayInit(4, sizeof(TAOS_FIELD)); taosArrayPush(yylhsminor.yy189, &yymsp[0].minor.yy279);}
  yymsp[0].minor.yy189 = yylhsminor.yy189;
        break;
      case 153: /* column ::= ids typename */
{
  tSetColumnInfo(&yylhsminor.yy279, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy279);
}
  yymsp[-1].minor.yy279 = yylhsminor.yy279;
        break;
      case 160: /* tagitem ::= NULL */
{ yymsp[0].minor.yy0.type = 0; tVariantCreate(&yylhsminor.yy162, &yymsp[0].minor.yy0); }
  yymsp[0].minor.yy162 = yylhsminor.yy162;
        break;
      case 161: /* tagitem ::= NOW */
{ yymsp[0].minor.yy0.type = TSDB_DATA_TYPE_TIMESTAMP; tVariantCreateExt(&yylhsminor.yy162, &yymsp[0].minor.yy0, TK_NOW, true);}
  yymsp[0].minor.yy162 = yylhsminor.yy162;
        break;
      case 162: /* tagitem ::= NOW PLUS VARIABLE */
{
    yymsp[0].minor.yy0.type = TSDB_DATA_TYPE_TIMESTAMP;
    tVariantCreateExt(&yymsp[-2].minor.yy162, &yymsp[0].minor.yy0, TK_PLUS, true);
}
        break;
      case 163: /* tagitem ::= NOW MINUS VARIABLE */
{
    yymsp[0].minor.yy0.type = TSDB_DATA_TYPE_TIMESTAMP;
    tVariantCreateExt(&yymsp[-2].minor.yy162, &yymsp[0].minor.yy0, TK_MINUS, true);
}
        break;
      case 164: /* tagitem ::= MINUS INTEGER */
      case 165: /* tagitem ::= MINUS FLOAT */ yytestcase(yyruleno==165);
      case 166: /* tagitem ::= PLUS INTEGER */ yytestcase(yyruleno==166);
      case 167: /* tagitem ::= PLUS FLOAT */ yytestcase(yyruleno==167);
{
    yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n;
    yymsp[-1].minor.yy0.type = yymsp[0].minor.yy0.type;
    toTSDBType(yymsp[-1].minor.yy0.type);
    tVariantCreate(&yylhsminor.yy162, &yymsp[-1].minor.yy0);
}
  yymsp[-1].minor.yy162 = yylhsminor.yy162;
        break;
      case 168: /* select ::= SELECT selcollist from where_opt range_option interval_option sliding_opt session_option windowstate_option fill_opt groupby_opt having_opt orderby_opt slimit_opt limit_opt */
{
  yylhsminor.yy16 = tSetQuerySqlNode(&yymsp[-14].minor.yy0, yymsp[-13].minor.yy189, yymsp[-12].minor.yy36, yymsp[-11].minor.yy18, yymsp[-4].minor.yy189, yymsp[-2].minor.yy189, &yymsp[-9].minor.yy32, &yymsp[-7].minor.yy155, &yymsp[-6].minor.yy336, &yymsp[-8].minor.yy0, yymsp[-5].minor.yy189, &yymsp[0].minor.yy38, &yymsp[-1].minor.yy38, yymsp[-3].minor.yy18, &yymsp[-10].minor.yy124);
}
  yymsp[-14].minor.yy16 = yylhsminor.yy16;
        break;
      case 169: /* select ::= LP select RP */
{yymsp[-2].minor.yy16 = yymsp[-1].minor.yy16;}
        break;
      case 170: /* union ::= select */
{ yylhsminor.yy189 = setSubclause(NULL, yymsp[0].minor.yy16); }
  yymsp[0].minor.yy189 = yylhsminor.yy189;
        break;
      case 171: /* union ::= union UNION ALL select */
{ yylhsminor.yy189 = appendSelectClause(yymsp[-3].minor.yy189, yymsp[0].minor.yy16); }
  yymsp[-3].minor.yy189 = yylhsminor.yy189;
        break;
      case 172: /* cmd ::= union */
{ setSqlInfo(pInfo, yymsp[0].minor.yy189, NULL, TSDB_SQL_SELECT); }
        break;
      case 173: /* select ::= SELECT selcollist */
{
  yylhsminor.yy16 = tSetQuerySqlNode(&yymsp[-1].minor.yy0, yymsp[0].minor.yy189, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
}
  yymsp[-1].minor.yy16 = yylhsminor.yy16;
        break;
      case 174: /* sclp ::= selcollist COMMA */
{yylhsminor.yy189 = yymsp[-1].minor.yy189;}
  yymsp[-1].minor.yy189 = yylhsminor.yy189;
        break;
      case 175: /* sclp ::= */
      case 216: /* orderby_opt ::= */ yytestcase(yyruleno==216);
{yymsp[1].minor.yy189 = 0;}
        break;
      case 176: /* selcollist ::= sclp distinct expr as */
{
   yylhsminor.yy189 = tSqlExprListAppend(yymsp[-3].minor.yy189, yymsp[-1].minor.yy18,  yymsp[-2].minor.yy0.n? &yymsp[-2].minor.yy0:0, yymsp[0].minor.yy0.n?&yymsp[0].minor.yy0:0);
}
  yymsp[-3].minor.yy189 = yylhsminor.yy189;
        break;
      case 177: /* selcollist ::= sclp STAR */
{
   tSqlExpr *pNode = tSqlExprCreateIdValue(pInfo, NULL, TK_ALL);
   yylhsminor.yy189 = tSqlExprListAppend(yymsp[-1].minor.yy189, pNode, 0, 0);
}
  yymsp[-1].minor.yy189 = yylhsminor.yy189;
        break;
      case 178: /* as ::= AS ids */
{ yymsp[-1].minor.yy0 = yymsp[0].minor.yy0;    }
        break;
      case 179: /* as ::= ids */
{ yylhsminor.yy0 = yymsp[0].minor.yy0;    }
  yymsp[0].minor.yy0 = yylhsminor.yy0;
        break;
      case 180: /* as ::= */
{ yymsp[1].minor.yy0.n = 0;  }
        break;
      case 181: /* distinct ::= DISTINCT */
{ yylhsminor.yy0 = yymsp[0].minor.yy0;  }
  yymsp[0].minor.yy0 = yylhsminor.yy0;
        break;
      case 183: /* from ::= FROM tablelist */
      case 184: /* from ::= FROM sub */ yytestcase(yyruleno==184);
{yymsp[-1].minor.yy36 = yymsp[0].minor.yy36;}
        break;
      case 185: /* sub ::= LP union RP */
{yymsp[-2].minor.yy36 = addSubqueryElem(NULL, yymsp[-1].minor.yy189, NULL);}
        break;
      case 186: /* sub ::= LP union RP ids */
{yymsp[-3].minor.yy36 = addSubqueryElem(NULL, yymsp[-2].minor.yy189, &yymsp[0].minor.yy0);}
        break;
      case 187: /* sub ::= sub COMMA LP union RP ids */
{yylhsminor.yy36 = addSubqueryElem(yymsp[-5].minor.yy36, yymsp[-2].minor.yy189, &yymsp[0].minor.yy0);}
  yymsp[-5].minor.yy36 = yylhsminor.yy36;
        break;
      case 188: /* tablelist ::= ids cpxName */
{
  yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n;
  yylhsminor.yy36 = setTableNameList(NULL, &yymsp[-1].minor.yy0, NULL);
}
  yymsp[-1].minor.yy36 = yylhsminor.yy36;
        break;
      case 189: /* tablelist ::= ids cpxName ids */
{
  yymsp[-2].minor.yy0.n += yymsp[-1].minor.yy0.n;
  yylhsminor.yy36 = setTableNameList(NULL, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0);
}
  yymsp[-2].minor.yy36 = yylhsminor.yy36;
        break;
      case 190: /* tablelist ::= tablelist COMMA ids cpxName */
{
  yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n;
  yylhsminor.yy36 = setTableNameList(yymsp[-3].minor.yy36, &yymsp[-1].minor.yy0, NULL);
}
  yymsp[-3].minor.yy36 = yylhsminor.yy36;
        break;
      case 191: /* tablelist ::= tablelist COMMA ids cpxName ids */
{
  yymsp[-2].minor.yy0.n += yymsp[-1].minor.yy0.n;
  yylhsminor.yy36 = setTableNameList(yymsp[-4].minor.yy36, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0);
}
  yymsp[-4].minor.yy36 = yylhsminor.yy36;
        break;
      case 192: /* tmvar ::= VARIABLE */
{yylhsminor.yy0 = yymsp[0].minor.yy0;}
  yymsp[0].minor.yy0 = yylhsminor.yy0;
        break;
      case 193: /* timestamp ::= INTEGER */
{ yylhsminor.yy18 = tSqlExprCreateTimestamp(&yymsp[0].minor.yy0, TK_INTEGER);}
  yymsp[0].minor.yy18 = yylhsminor.yy18;
        break;
      case 194: /* timestamp ::= MINUS INTEGER */
      case 195: /* timestamp ::= PLUS INTEGER */ yytestcase(yyruleno==195);
{ yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; yymsp[-1].minor.yy0.type = TK_INTEGER; yylhsminor.yy18 = tSqlExprCreateTimestamp(&yymsp[-1].minor.yy0, TK_INTEGER);}
  yymsp[-1].minor.yy18 = yylhsminor.yy18;
        break;
      case 196: /* timestamp ::= STRING */
{ yylhsminor.yy18 = tSqlExprCreateTimestamp(&yymsp[0].minor.yy0, TK_STRING);}
  yymsp[0].minor.yy18 = yylhsminor.yy18;
        break;
      case 197: /* timestamp ::= NOW */
{ yylhsminor.yy18 = tSqlExprCreateTimestamp(&yymsp[0].minor.yy0, TK_NOW); }
  yymsp[0].minor.yy18 = yylhsminor.yy18;
        break;
      case 198: /* timestamp ::= NOW PLUS VARIABLE */
{yymsp[-2].minor.yy18 = tSqlExprCreateTimestamp(&yymsp[0].minor.yy0, TK_PLUS);  }
        break;
      case 199: /* timestamp ::= NOW MINUS VARIABLE */
{yymsp[-2].minor.yy18 = tSqlExprCreateTimestamp(&yymsp[0].minor.yy0, TK_MINUS); }
        break;
      case 200: /* range_option ::= */
{yymsp[1].minor.yy124.start = 0; yymsp[1].minor.yy124.end = 0;}
        break;
      case 201: /* range_option ::= RANGE LP timestamp COMMA timestamp RP */
{yymsp[-5].minor.yy124.start = yymsp[-3].minor.yy18; yymsp[-5].minor.yy124.end = yymsp[-1].minor.yy18;}
        break;
      case 202: /* interval_option ::= intervalKey LP tmvar RP */
{yylhsminor.yy32.interval = yymsp[-1].minor.yy0; yylhsminor.yy32.offset.n = 0; yylhsminor.yy32.token = yymsp[-3].minor.yy516;}
  yymsp[-3].minor.yy32 = yylhsminor.yy32;
        break;
      case 203: /* interval_option ::= intervalKey LP tmvar COMMA tmvar RP */
{yylhsminor.yy32.interval = yymsp[-3].minor.yy0; yylhsminor.yy32.offset = yymsp[-1].minor.yy0;   yylhsminor.yy32.token = yymsp[-5].minor.yy516;}
  yymsp[-5].minor.yy32 = yylhsminor.yy32;
        break;
      case 204: /* interval_option ::= */
{memset(&yymsp[1].minor.yy32, 0, sizeof(yymsp[1].minor.yy32));}
        break;
      case 205: /* intervalKey ::= INTERVAL */
{yymsp[0].minor.yy516 = TK_INTERVAL;}
        break;
      case 206: /* intervalKey ::= EVERY */
{yymsp[0].minor.yy516 = TK_EVERY;   }
        break;
      case 207: /* session_option ::= */
{yymsp[1].minor.yy155.col.n = 0; yymsp[1].minor.yy155.gap.n = 0;}
        break;
      case 208: /* session_option ::= SESSION LP ids cpxName COMMA tmvar RP */
{
   yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n;
   yymsp[-6].minor.yy155.col = yymsp[-4].minor.yy0;
   yymsp[-6].minor.yy155.gap = yymsp[-1].minor.yy0;
}
        break;
      case 209: /* windowstate_option ::= */
{ yymsp[1].minor.yy336.col.n = 0; yymsp[1].minor.yy336.col.z = NULL;}
        break;
      case 210: /* windowstate_option ::= STATE_WINDOW LP ids RP */
{ yymsp[-3].minor.yy336.col = yymsp[-1].minor.yy0; }
        break;
      case 211: /* fill_opt ::= */
{ yymsp[1].minor.yy189 = 0;     }
        break;
      case 212: /* fill_opt ::= FILL LP ID COMMA tagitemlist RP */
{
    tVariant A = {0};
    toTSDBType(yymsp[-3].minor.yy0.type);
    tVariantCreate(&A, &yymsp[-3].minor.yy0);

    tVariantListInsert(yymsp[-1].minor.yy189, &A, -1, 0);
    yymsp[-5].minor.yy189 = yymsp[-1].minor.yy189;
}
        break;
      case 213: /* fill_opt ::= FILL LP ID RP */
{
    toTSDBType(yymsp[-1].minor.yy0.type);
    yymsp[-3].minor.yy189 = tVariantListAppendToken(NULL, &yymsp[-1].minor.yy0, -1, true);
}
        break;
      case 214: /* sliding_opt ::= SLIDING LP tmvar RP */
{yymsp[-3].minor.yy0 = yymsp[-1].minor.yy0;     }
        break;
      case 215: /* sliding_opt ::= */
{yymsp[1].minor.yy0.n = 0; yymsp[1].minor.yy0.z = NULL; yymsp[1].minor.yy0.type = 0;   }
        break;
      case 217: /* orderby_opt ::= ORDER BY sortlist */
{yymsp[-2].minor.yy189 = yymsp[0].minor.yy189;}
        break;
      case 218: /* sortlist ::= sortlist COMMA item sortorder */
{
  yylhsminor.yy189 = commonItemAppend(yymsp[-3].minor.yy189, &yymsp[-1].minor.yy162, NULL, false, yymsp[0].minor.yy420);
}
  yymsp[-3].minor.yy189 = yylhsminor.yy189;
        break;
      case 219: /* sortlist ::= sortlist COMMA arrow sortorder */
{
  yylhsminor.yy189 = commonItemAppend(yymsp[-3].minor.yy189, NULL, yymsp[-1].minor.yy18, true, yymsp[0].minor.yy420);
}
  yymsp[-3].minor.yy189 = yylhsminor.yy189;
        break;
      case 220: /* sortlist ::= item sortorder */
{
  yylhsminor.yy189 = commonItemAppend(NULL, &yymsp[-1].minor.yy162, NULL, false, yymsp[0].minor.yy420);
}
  yymsp[-1].minor.yy189 = yylhsminor.yy189;
        break;
      case 221: /* sortlist ::= arrow sortorder */
{
  yylhsminor.yy189 = commonItemAppend(NULL, NULL, yymsp[-1].minor.yy18, true, yymsp[0].minor.yy420);
}
  yymsp[-1].minor.yy189 = yylhsminor.yy189;
        break;
      case 222: /* item ::= ID */
{
  toTSDBType(yymsp[0].minor.yy0.type);
  tVariantCreate(&yylhsminor.yy162, &yymsp[0].minor.yy0);
}
  yymsp[0].minor.yy162 = yylhsminor.yy162;
        break;
      case 223: /* item ::= ID DOT ID */
{
  toTSDBType(yymsp[-2].minor.yy0.type);
  yymsp[-2].minor.yy0.n += (1+yymsp[0].minor.yy0.n);
  tVariantCreate(&yylhsminor.yy162, &yymsp[-2].minor.yy0);
}
  yymsp[-2].minor.yy162 = yylhsminor.yy162;
        break;
      case 224: /* sortorder ::= ASC */
{ yymsp[0].minor.yy420 = TSDB_ORDER_ASC; }
        break;
      case 225: /* sortorder ::= DESC */
{ yymsp[0].minor.yy420 = TSDB_ORDER_DESC;}
        break;
      case 226: /* sortorder ::= */
{ yymsp[1].minor.yy420 = TSDB_ORDER_ASC; }
        break;
      case 227: /* groupby_opt ::= */
{ yymsp[1].minor.yy189 = 0;}
        break;
      case 228: /* groupby_opt ::= GROUP BY grouplist */
{ yymsp[-2].minor.yy189 = yymsp[0].minor.yy189;}
        break;
      case 229: /* grouplist ::= grouplist COMMA item */
{
  yylhsminor.yy189 = commonItemAppend(yymsp[-2].minor.yy189, &yymsp[0].minor.yy162, NULL, false, -1);
}
  yymsp[-2].minor.yy189 = yylhsminor.yy189;
        break;
      case 230: /* grouplist ::= grouplist COMMA arrow */
{
  yylhsminor.yy189 = commonItemAppend(yymsp[-2].minor.yy189, NULL, yymsp[0].minor.yy18, true, -1);
}
  yymsp[-2].minor.yy189 = yylhsminor.yy189;
        break;
      case 231: /* grouplist ::= item */
{
  yylhsminor.yy189 = commonItemAppend(NULL, &yymsp[0].minor.yy162, NULL, false, -1);
}
  yymsp[0].minor.yy189 = yylhsminor.yy189;
        break;
      case 232: /* grouplist ::= arrow */
{
  yylhsminor.yy189 = commonItemAppend(NULL, NULL, yymsp[0].minor.yy18, true, -1);
}
  yymsp[0].minor.yy189 = yylhsminor.yy189;
        break;
      case 233: /* having_opt ::= */
      case 243: /* where_opt ::= */ yytestcase(yyruleno==243);
      case 293: /* expritem ::= */ yytestcase(yyruleno==293);
{yymsp[1].minor.yy18 = 0;}
        break;
      case 234: /* having_opt ::= HAVING expr */
      case 244: /* where_opt ::= WHERE expr */ yytestcase(yyruleno==244);
{yymsp[-1].minor.yy18 = yymsp[0].minor.yy18;}
        break;
      case 235: /* limit_opt ::= */
      case 239: /* slimit_opt ::= */ yytestcase(yyruleno==239);
{yymsp[1].minor.yy38.limit = -1; yymsp[1].minor.yy38.offset = 0;}
        break;
      case 236: /* limit_opt ::= LIMIT signed */
      case 240: /* slimit_opt ::= SLIMIT signed */ yytestcase(yyruleno==240);
{yymsp[-1].minor.yy38.limit = yymsp[0].minor.yy69;  yymsp[-1].minor.yy38.offset = 0;}
        break;
      case 237: /* limit_opt ::= LIMIT signed OFFSET signed */
{ yymsp[-3].minor.yy38.limit = yymsp[-2].minor.yy69;  yymsp[-3].minor.yy38.offset = yymsp[0].minor.yy69;}
        break;
      case 238: /* limit_opt ::= LIMIT signed COMMA signed */
{ yymsp[-3].minor.yy38.limit = yymsp[0].minor.yy69;  yymsp[-3].minor.yy38.offset = yymsp[-2].minor.yy69;}
        break;
      case 241: /* slimit_opt ::= SLIMIT signed SOFFSET signed */
{yymsp[-3].minor.yy38.limit = yymsp[-2].minor.yy69;  yymsp[-3].minor.yy38.offset = yymsp[0].minor.yy69;}
        break;
      case 242: /* slimit_opt ::= SLIMIT signed COMMA signed */
{yymsp[-3].minor.yy38.limit = yymsp[0].minor.yy69;  yymsp[-3].minor.yy38.offset = yymsp[-2].minor.yy69;}
        break;
      case 245: /* expr ::= LP expr RP */
{yylhsminor.yy18 = yymsp[-1].minor.yy18; yylhsminor.yy18->exprToken.z = yymsp[-2].minor.yy0.z; yylhsminor.yy18->exprToken.n = (yymsp[0].minor.yy0.z - yymsp[-2].minor.yy0.z + 1);}
  yymsp[-2].minor.yy18 = yylhsminor.yy18;
        break;
      case 246: /* expr ::= ID */
{ yylhsminor.yy18 = tSqlExprCreateIdValue(pInfo, &yymsp[0].minor.yy0, TK_ID);}
  yymsp[0].minor.yy18 = yylhsminor.yy18;
        break;
      case 247: /* expr ::= ID DOT ID */
{ yymsp[-2].minor.yy0.n += (1+yymsp[0].minor.yy0.n); yylhsminor.yy18 = tSqlExprCreateIdValue(pInfo, &yymsp[-2].minor.yy0, TK_ID);}
  yymsp[-2].minor.yy18 = yylhsminor.yy18;
        break;
      case 248: /* expr ::= ID DOT STAR */
{ yymsp[-2].minor.yy0.n += (1+yymsp[0].minor.yy0.n); yylhsminor.yy18 = tSqlExprCreateIdValue(pInfo, &yymsp[-2].minor.yy0, TK_ALL);}
  yymsp[-2].minor.yy18 = yylhsminor.yy18;
        break;
      case 249: /* expr ::= INTEGER */
{ yylhsminor.yy18 = tSqlExprCreateIdValue(pInfo, &yymsp[0].minor.yy0, TK_INTEGER);}
  yymsp[0].minor.yy18 = yylhsminor.yy18;
        break;
      case 250: /* expr ::= MINUS INTEGER */
      case 251: /* expr ::= PLUS INTEGER */ yytestcase(yyruleno==251);
{ yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; yymsp[-1].minor.yy0.type = TK_INTEGER; yylhsminor.yy18 = tSqlExprCreateIdValue(pInfo, &yymsp[-1].minor.yy0, TK_INTEGER);}
  yymsp[-1].minor.yy18 = yylhsminor.yy18;
        break;
      case 252: /* expr ::= FLOAT */
{ yylhsminor.yy18 = tSqlExprCreateIdValue(pInfo, &yymsp[0].minor.yy0, TK_FLOAT);}
  yymsp[0].minor.yy18 = yylhsminor.yy18;
        break;
      case 253: /* expr ::= MINUS FLOAT */
      case 254: /* expr ::= PLUS FLOAT */ yytestcase(yyruleno==254);
{ yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; yymsp[-1].minor.yy0.type = TK_FLOAT; yylhsminor.yy18 = tSqlExprCreateIdValue(pInfo, &yymsp[-1].minor.yy0, TK_FLOAT);}
  yymsp[-1].minor.yy18 = yylhsminor.yy18;
        break;
      case 255: /* expr ::= STRING */
{ yylhsminor.yy18 = tSqlExprCreateIdValue(pInfo, &yymsp[0].minor.yy0, TK_STRING);}
  yymsp[0].minor.yy18 = yylhsminor.yy18;
        break;
      case 256: /* expr ::= NOW */
{ yylhsminor.yy18 = tSqlExprCreateIdValue(pInfo, &yymsp[0].minor.yy0, TK_NOW); }
  yymsp[0].minor.yy18 = yylhsminor.yy18;
        break;
      case 257: /* expr ::= VARIABLE */
{ yylhsminor.yy18 = tSqlExprCreateIdValue(pInfo, &yymsp[0].minor.yy0, TK_VARIABLE);}
  yymsp[0].minor.yy18 = yylhsminor.yy18;
        break;
      case 258: /* expr ::= PLUS VARIABLE */
      case 259: /* expr ::= MINUS VARIABLE */ yytestcase(yyruleno==259);
{ yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; yymsp[-1].minor.yy0.type = TK_VARIABLE; yylhsminor.yy18 = tSqlExprCreateIdValue(pInfo, &yymsp[-1].minor.yy0, TK_VARIABLE);}
  yymsp[-1].minor.yy18 = yylhsminor.yy18;
        break;
      case 260: /* expr ::= BOOL */
{ yylhsminor.yy18 = tSqlExprCreateIdValue(pInfo, &yymsp[0].minor.yy0, TK_BOOL);}
  yymsp[0].minor.yy18 = yylhsminor.yy18;
        break;
      case 261: /* expr ::= NULL */
{ yylhsminor.yy18 = tSqlExprCreateIdValue(pInfo, &yymsp[0].minor.yy0, TK_NULL);}
  yymsp[0].minor.yy18 = yylhsminor.yy18;
        break;
      case 262: /* expr ::= ID LP exprlist RP */
{ tStrTokenAppend(pInfo->funcs, &yymsp[-3].minor.yy0); yylhsminor.yy18 = tSqlExprCreateFunction(yymsp[-1].minor.yy189, &yymsp[-3].minor.yy0, &yymsp[0].minor.yy0, yymsp[-3].minor.yy0.type); }
  yymsp[-3].minor.yy18 = yylhsminor.yy18;
        break;
      case 263: /* expr ::= ID LP STAR RP */
{ tStrTokenAppend(pInfo->funcs, &yymsp[-3].minor.yy0); yylhsminor.yy18 = tSqlExprCreateFunction(NULL, &yymsp[-3].minor.yy0, &yymsp[0].minor.yy0, yymsp[-3].minor.yy0.type); }
  yymsp[-3].minor.yy18 = yylhsminor.yy18;
        break;
      case 264: /* expr ::= ID LP expr AS typename RP */
{ tStrTokenAppend(pInfo->funcs, &yymsp[-5].minor.yy0); yylhsminor.yy18 = tSqlExprCreateFuncWithParams(pInfo, yymsp[-3].minor.yy18, &yymsp[-1].minor.yy279, &yymsp[-5].minor.yy0, &yymsp[0].minor.yy0, yymsp[-5].minor.yy0.type); }
  yymsp[-5].minor.yy18 = yylhsminor.yy18;
        break;
      case 265: /* expr ::= expr IS NULL */
{yylhsminor.yy18 = tSqlExprCreate(yymsp[-2].minor.yy18, NULL, TK_ISNULL);}
  yymsp[-2].minor.yy18 = yylhsminor.yy18;
        break;
      case 266: /* expr ::= expr IS NOT NULL */
{yylhsminor.yy18 = tSqlExprCreate(yymsp[-3].minor.yy18, NULL, TK_NOTNULL);}
  yymsp[-3].minor.yy18 = yylhsminor.yy18;
        break;
      case 267: /* expr ::= expr LT expr */
{yylhsminor.yy18 = tSqlExprCreate(yymsp[-2].minor.yy18, yymsp[0].minor.yy18, TK_LT);}
  yymsp[-2].minor.yy18 = yylhsminor.yy18;
        break;
      case 268: /* expr ::= expr GT expr */
{yylhsminor.yy18 = tSqlExprCreate(yymsp[-2].minor.yy18, yymsp[0].minor.yy18, TK_GT);}
  yymsp[-2].minor.yy18 = yylhsminor.yy18;
        break;
      case 269: /* expr ::= expr LE expr */
{yylhsminor.yy18 = tSqlExprCreate(yymsp[-2].minor.yy18, yymsp[0].minor.yy18, TK_LE);}
  yymsp[-2].minor.yy18 = yylhsminor.yy18;
        break;
      case 270: /* expr ::= expr GE expr */
{yylhsminor.yy18 = tSqlExprCreate(yymsp[-2].minor.yy18, yymsp[0].minor.yy18, TK_GE);}
  yymsp[-2].minor.yy18 = yylhsminor.yy18;
        break;
      case 271: /* expr ::= expr NE expr */
{yylhsminor.yy18 = tSqlExprCreate(yymsp[-2].minor.yy18, yymsp[0].minor.yy18, TK_NE);}
  yymsp[-2].minor.yy18 = yylhsminor.yy18;
        break;
      case 272: /* expr ::= expr EQ expr */
{yylhsminor.yy18 = tSqlExprCreate(yymsp[-2].minor.yy18, yymsp[0].minor.yy18, TK_EQ);}
  yymsp[-2].minor.yy18 = yylhsminor.yy18;
        break;
      case 273: /* expr ::= expr BETWEEN expr AND expr */
{ tSqlExpr* X2 = tSqlExprClone(yymsp[-4].minor.yy18); yylhsminor.yy18 = tSqlExprCreate(tSqlExprCreate(yymsp[-4].minor.yy18, yymsp[-2].minor.yy18, TK_GE), tSqlExprCreate(X2, yymsp[0].minor.yy18, TK_LE), TK_AND);}
  yymsp[-4].minor.yy18 = yylhsminor.yy18;
        break;
      case 274: /* expr ::= expr AND expr */
{yylhsminor.yy18 = tSqlExprCreate(yymsp[-2].minor.yy18, yymsp[0].minor.yy18, TK_AND);}
  yymsp[-2].minor.yy18 = yylhsminor.yy18;
        break;
      case 275: /* expr ::= expr OR expr */
{yylhsminor.yy18 = tSqlExprCreate(yymsp[-2].minor.yy18, yymsp[0].minor.yy18, TK_OR); }
  yymsp[-2].minor.yy18 = yylhsminor.yy18;
        break;
      case 276: /* expr ::= expr PLUS expr */
{yylhsminor.yy18 = tSqlExprCreate(yymsp[-2].minor.yy18, yymsp[0].minor.yy18, TK_PLUS);  }
  yymsp[-2].minor.yy18 = yylhsminor.yy18;
        break;
      case 277: /* expr ::= expr MINUS expr */
{yylhsminor.yy18 = tSqlExprCreate(yymsp[-2].minor.yy18, yymsp[0].minor.yy18, TK_MINUS); }
  yymsp[-2].minor.yy18 = yylhsminor.yy18;
        break;
      case 278: /* expr ::= expr STAR expr */
{yylhsminor.yy18 = tSqlExprCreate(yymsp[-2].minor.yy18, yymsp[0].minor.yy18, TK_STAR);  }
  yymsp[-2].minor.yy18 = yylhsminor.yy18;
        break;
      case 279: /* expr ::= expr SLASH expr */
{yylhsminor.yy18 = tSqlExprCreate(yymsp[-2].minor.yy18, yymsp[0].minor.yy18, TK_DIVIDE);}
  yymsp[-2].minor.yy18 = yylhsminor.yy18;
        break;
      case 280: /* expr ::= expr REM expr */
{yylhsminor.yy18 = tSqlExprCreate(yymsp[-2].minor.yy18, yymsp[0].minor.yy18, TK_REM);   }
  yymsp[-2].minor.yy18 = yylhsminor.yy18;
        break;
      case 281: /* expr ::= expr LIKE expr */
{yylhsminor.yy18 = tSqlExprCreate(yymsp[-2].minor.yy18, yymsp[0].minor.yy18, TK_LIKE);  }
  yymsp[-2].minor.yy18 = yylhsminor.yy18;
        break;
      case 282: /* expr ::= expr MATCH expr */
{yylhsminor.yy18 = tSqlExprCreate(yymsp[-2].minor.yy18, yymsp[0].minor.yy18, TK_MATCH);  }
  yymsp[-2].minor.yy18 = yylhsminor.yy18;
        break;
      case 283: /* expr ::= expr NMATCH expr */
{yylhsminor.yy18 = tSqlExprCreate(yymsp[-2].minor.yy18, yymsp[0].minor.yy18, TK_NMATCH);  }
  yymsp[-2].minor.yy18 = yylhsminor.yy18;
        break;
      case 284: /* expr ::= ID CONTAINS STRING */
{ tSqlExpr* S = tSqlExprCreateIdValue(pInfo, &yymsp[-2].minor.yy0, TK_ID); tSqlExpr* M = tSqlExprCreateIdValue(pInfo, &yymsp[0].minor.yy0, TK_STRING); yylhsminor.yy18 = tSqlExprCreate(S, M, TK_CONTAINS);  }
  yymsp[-2].minor.yy18 = yylhsminor.yy18;
        break;
      case 285: /* expr ::= ID DOT ID CONTAINS STRING */
{ yymsp[-4].minor.yy0.n += (1+yymsp[-2].minor.yy0.n); tSqlExpr* S = tSqlExprCreateIdValue(pInfo, &yymsp[-4].minor.yy0, TK_ID); tSqlExpr* M = tSqlExprCreateIdValue(pInfo, &yymsp[0].minor.yy0, TK_STRING); yylhsminor.yy18 = tSqlExprCreate(S, M, TK_CONTAINS);  }
  yymsp[-4].minor.yy18 = yylhsminor.yy18;
        break;
      case 286: /* arrow ::= ID ARROW STRING */
{tSqlExpr* S = tSqlExprCreateIdValue(pInfo, &yymsp[-2].minor.yy0, TK_ID); tSqlExpr* M = tSqlExprCreateIdValue(pInfo, &yymsp[0].minor.yy0, TK_STRING); yylhsminor.yy18 = tSqlExprCreate(S, M, TK_ARROW);  }
  yymsp[-2].minor.yy18 = yylhsminor.yy18;
        break;
      case 287: /* arrow ::= ID DOT ID ARROW STRING */
{yymsp[-4].minor.yy0.n += (1+yymsp[-2].minor.yy0.n); tSqlExpr* S = tSqlExprCreateIdValue(pInfo, &yymsp[-4].minor.yy0, TK_ID); tSqlExpr* M = tSqlExprCreateIdValue(pInfo, &yymsp[0].minor.yy0, TK_STRING); yylhsminor.yy18 = tSqlExprCreate(S, M, TK_ARROW);  }
  yymsp[-4].minor.yy18 = yylhsminor.yy18;
        break;
      case 288: /* expr ::= arrow */
      case 292: /* expritem ::= expr */ yytestcase(yyruleno==292);
{yylhsminor.yy18 = yymsp[0].minor.yy18;}
  yymsp[0].minor.yy18 = yylhsminor.yy18;
        break;
      case 289: /* expr ::= expr IN LP exprlist RP */
{yylhsminor.yy18 = tSqlExprCreate(yymsp[-4].minor.yy18, (tSqlExpr*)yymsp[-1].minor.yy189, TK_IN); }
  yymsp[-4].minor.yy18 = yylhsminor.yy18;
        break;
      case 290: /* exprlist ::= exprlist COMMA expritem */
{yylhsminor.yy189 = tSqlExprListAppend(yymsp[-2].minor.yy189,yymsp[0].minor.yy18,0, 0);}
  yymsp[-2].minor.yy189 = yylhsminor.yy189;
        break;
      case 291: /* exprlist ::= expritem */
{yylhsminor.yy189 = tSqlExprListAppend(0,yymsp[0].minor.yy18,0, 0);}
  yymsp[0].minor.yy189 = yylhsminor.yy189;
        break;
      case 294: /* cmd ::= RESET QUERY CACHE */
{ setDCLSqlElems(pInfo, TSDB_SQL_RESET_CACHE, 0);}
        break;
      case 295: /* cmd ::= SYNCDB ids REPLICA */
{ setDCLSqlElems(pInfo, TSDB_SQL_SYNC_DB_REPLICA, 1, &yymsp[-1].minor.yy0);}
        break;
      case 296: /* cmd ::= ALTER TABLE ids cpxName ADD COLUMN columnlist */
{
    yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n;
    SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, yymsp[0].minor.yy189, NULL, TSDB_ALTER_TABLE_ADD_COLUMN, -1);
    setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE);
}
        break;
      case 297: /* cmd ::= ALTER TABLE ids cpxName DROP COLUMN ids */
{
    yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n;

    toTSDBType(yymsp[0].minor.yy0.type);
    SArray* K = tVariantListAppendToken(NULL, &yymsp[0].minor.yy0, -1, false);

    SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, NULL, K, TSDB_ALTER_TABLE_DROP_COLUMN, -1);
    setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE);
}
        break;
      case 298: /* cmd ::= ALTER TABLE ids cpxName MODIFY COLUMN columnlist */
{
    yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n;
    SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, yymsp[0].minor.yy189, NULL, TSDB_ALTER_TABLE_CHANGE_COLUMN, -1);
    setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE);
}
        break;
      case 299: /* cmd ::= ALTER TABLE ids cpxName ADD TAG columnlist */
{
    yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n;
    SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, yymsp[0].minor.yy189, NULL, TSDB_ALTER_TABLE_ADD_TAG_COLUMN, -1);
    setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE);
}
        break;
      case 300: /* cmd ::= ALTER TABLE ids cpxName DROP TAG ids */
{
    yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n;

    toTSDBType(yymsp[0].minor.yy0.type);
    SArray* A = tVariantListAppendToken(NULL, &yymsp[0].minor.yy0, -1, false);

    SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, NULL, A, TSDB_ALTER_TABLE_DROP_TAG_COLUMN, -1);
    setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE);
}
        break;
      case 301: /* cmd ::= ALTER TABLE ids cpxName CHANGE TAG ids ids */
{
    yymsp[-5].minor.yy0.n += yymsp[-4].minor.yy0.n;

    toTSDBType(yymsp[-1].minor.yy0.type);
    SArray* A = tVariantListAppendToken(NULL, &yymsp[-1].minor.yy0, -1, false);

    toTSDBType(yymsp[0].minor.yy0.type);
    A = tVariantListAppendToken(A, &yymsp[0].minor.yy0, -1, false);

    SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-5].minor.yy0, NULL, A, TSDB_ALTER_TABLE_CHANGE_TAG_COLUMN, -1);
    setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE);
}
        break;
      case 302: /* cmd ::= ALTER TABLE ids cpxName SET TAG ids EQ tagitem */
{
    yymsp[-6].minor.yy0.n += yymsp[-5].minor.yy0.n;

    toTSDBType(yymsp[-2].minor.yy0.type);
    SArray* A = tVariantListAppendToken(NULL, &yymsp[-2].minor.yy0, -1, false);
    A = tVariantListAppend(A, &yymsp[0].minor.yy162, -1);

    SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-6].minor.yy0, NULL, A, TSDB_ALTER_TABLE_UPDATE_TAG_VAL, -1);
    setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE);
}
        break;
      case 303: /* cmd ::= ALTER TABLE ids cpxName MODIFY TAG columnlist */
{
    yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n;
    SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, yymsp[0].minor.yy189, NULL, TSDB_ALTER_TABLE_MODIFY_TAG_COLUMN, -1);
    setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE);
}
        break;
      case 304: /* cmd ::= ALTER STABLE ids cpxName ADD COLUMN columnlist */
{
    yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n;
    SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, yymsp[0].minor.yy189, NULL, TSDB_ALTER_TABLE_ADD_COLUMN, TSDB_SUPER_TABLE);
    setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE);
}
        break;
      case 305: /* cmd ::= ALTER STABLE ids cpxName DROP COLUMN ids */
{
    yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n;

    toTSDBType(yymsp[0].minor.yy0.type);
    SArray* K = tVariantListAppendToken(NULL, &yymsp[0].minor.yy0, -1, false);

    SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, NULL, K, TSDB_ALTER_TABLE_DROP_COLUMN, TSDB_SUPER_TABLE);
    setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE);
}
        break;
      case 306: /* cmd ::= ALTER STABLE ids cpxName MODIFY COLUMN columnlist */
{
    yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n;
    SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, yymsp[0].minor.yy189, NULL, TSDB_ALTER_TABLE_CHANGE_COLUMN, TSDB_SUPER_TABLE);
    setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE);
}
        break;
      case 307: /* cmd ::= ALTER STABLE ids cpxName ADD TAG columnlist */
{
    yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n;
    SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, yymsp[0].minor.yy189, NULL, TSDB_ALTER_TABLE_ADD_TAG_COLUMN, TSDB_SUPER_TABLE);
    setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE);
}
        break;
      case 308: /* cmd ::= ALTER STABLE ids cpxName DROP TAG ids */
{
    yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n;

    toTSDBType(yymsp[0].minor.yy0.type);
    SArray* A = tVariantListAppendToken(NULL, &yymsp[0].minor.yy0, -1, false);

    SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, NULL, A, TSDB_ALTER_TABLE_DROP_TAG_COLUMN, TSDB_SUPER_TABLE);
    setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE);
}
        break;
      case 309: /* cmd ::= ALTER STABLE ids cpxName CHANGE TAG ids ids */
{
    yymsp[-5].minor.yy0.n += yymsp[-4].minor.yy0.n;

    toTSDBType(yymsp[-1].minor.yy0.type);
    SArray* A = tVariantListAppendToken(NULL, &yymsp[-1].minor.yy0, -1, false);

    toTSDBType(yymsp[0].minor.yy0.type);
    A = tVariantListAppendToken(A, &yymsp[0].minor.yy0, -1, false);

    SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-5].minor.yy0, NULL, A, TSDB_ALTER_TABLE_CHANGE_TAG_COLUMN, TSDB_SUPER_TABLE);
    setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE);
}
        break;
      case 310: /* cmd ::= ALTER STABLE ids cpxName SET TAG ids EQ tagitem */
{
    yymsp[-6].minor.yy0.n += yymsp[-5].minor.yy0.n;

    toTSDBType(yymsp[-2].minor.yy0.type);
    SArray* A = tVariantListAppendToken(NULL, &yymsp[-2].minor.yy0, -1, false);
    A = tVariantListAppend(A, &yymsp[0].minor.yy162, -1);

    SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-6].minor.yy0, NULL, A, TSDB_ALTER_TABLE_UPDATE_TAG_VAL, TSDB_SUPER_TABLE);
    setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE);
}
        break;
      case 311: /* cmd ::= ALTER STABLE ids cpxName MODIFY TAG columnlist */
{
    yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n;
    SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, yymsp[0].minor.yy189, NULL, TSDB_ALTER_TABLE_MODIFY_TAG_COLUMN, TSDB_SUPER_TABLE);
    setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE);
}
        break;
      case 312: /* cmd ::= KILL CONNECTION INTEGER */
{setKillSql(pInfo, TSDB_SQL_KILL_CONNECTION, &yymsp[0].minor.yy0);}
        break;
      case 313: /* cmd ::= KILL STREAM INTEGER COLON INTEGER */
{yymsp[-2].minor.yy0.n += (yymsp[-1].minor.yy0.n + yymsp[0].minor.yy0.n); setKillSql(pInfo, TSDB_SQL_KILL_STREAM, &yymsp[-2].minor.yy0);}
        break;
      case 314: /* cmd ::= KILL QUERY INTEGER COLON INTEGER */
{yymsp[-2].minor.yy0.n += (yymsp[-1].minor.yy0.n + yymsp[0].minor.yy0.n); setKillSql(pInfo, TSDB_SQL_KILL_QUERY, &yymsp[-2].minor.yy0);}
        break;
      default:
        break;
/********** End reduce actions ************************************************/
  };
  assert( yyruleno<sizeof(yyRuleInfoLhs)/sizeof(yyRuleInfoLhs[0]) );
  yygoto = yyRuleInfoLhs[yyruleno];
  yysize = yyRuleInfoNRhs[yyruleno];
  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 */
){
  ParseARG_FETCH
  ParseCTX_FETCH
#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 *****************************************/
  ParseARG_STORE /* Suppress warning about unused %extra_argument variable */
  ParseCTX_STORE
}
#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 */
  ParseTOKENTYPE yyminor         /* The minor type of the error token */
){
  ParseARG_FETCH
  ParseCTX_FETCH
#define TOKEN yyminor
/************ Begin %syntax_error code ****************************************/

  pInfo->valid = false;
  int32_t outputBufLen = tListLen(pInfo->msg);
  int32_t len = 0;

  if(TOKEN.z) {
    char msg[] = "syntax error near \"%s\"";
    int32_t sqlLen = strlen(&TOKEN.z[0]);

    if (sqlLen + sizeof(msg)/sizeof(msg[0]) + 1 > outputBufLen) {
        char tmpstr[128] = {0};
        memcpy(tmpstr, &TOKEN.z[0], sizeof(tmpstr)/sizeof(tmpstr[0]) - 1);
        len = sprintf(pInfo->msg, msg, tmpstr);
    } else {
        len = sprintf(pInfo->msg, msg, &TOKEN.z[0]);
    }

  } else {
    len = sprintf(pInfo->msg, "Incomplete SQL statement");
  }

  assert(len <= outputBufLen);
/************ End %syntax_error code ******************************************/
  ParseARG_STORE /* Suppress warning about unused %extra_argument variable */
  ParseCTX_STORE
}

/*
** The following is executed when the parser accepts
*/
static void yy_accept(
  yyParser *yypParser           /* The parser */
){
  ParseARG_FETCH
  ParseCTX_FETCH
#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 *******************************************/
  ParseARG_STORE /* Suppress warning about unused %extra_argument variable */
  ParseCTX_STORE
}

/* The main parser program.
** The first argument is a pointer to a structure obtained from
** "ParseAlloc" which describes the current state of the parser.
** 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.
*/
void Parse(
  void *yyp,                   /* The parser */
  int yymajor,                 /* The major token code number */
  ParseTOKENTYPE yyminor       /* The value for the token */
  ParseARG_PDECL               /* Optional %extra_argument parameter */
){
  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 */
  ParseCTX_FETCH
  ParseARG_STORE

  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

  while(1){ /* Exit by "break" */
    assert( yypParser->yytos>=yypParser->yystack );
    assert( yyact==yypParser->yytos->stateno );
    yyact = yy_find_shift_action((YYCODETYPE)yymajor,yyact);
    if( yyact >= YY_MIN_REDUCE ){
      unsigned int yyruleno = yyact - YY_MIN_REDUCE; /* Reduce by this rule */
      assert( yyruleno<(int)(sizeof(yyRuleName)/sizeof(yyRuleName[0])) );
#ifndef NDEBUG
      if( yyTraceFILE ){
        int yysize = yyRuleInfoNRhs[yyruleno];
        if( yysize ){
          fprintf(yyTraceFILE, "%sReduce %d [%s]%s, pop back to state %d.\n",
            yyTracePrompt,
            yyruleno, yyRuleName[yyruleno],
            yyruleno<YYNRULE_WITH_ACTION ? "" : " without external action",
            yypParser->yytos[yysize].stateno);
        }else{
          fprintf(yyTraceFILE, "%sReduce %d [%s]%s.\n",
            yyTracePrompt, yyruleno, yyRuleName[yyruleno],
            yyruleno<YYNRULE_WITH_ACTION ? "" : " without external action");
        }
      }
#endif /* NDEBUG */

      /* Check that the stack is large enough to grow by a single entry
      ** if the RHS of the rule is empty.  This ensures that there is room
      ** enough on the stack to push the LHS value */
      if( yyRuleInfoNRhs[yyruleno]==0 ){
#ifdef YYTRACKMAXSTACKDEPTH
        if( (int)(yypParser->yytos - yypParser->yystack)>yypParser->yyhwm ){
          yypParser->yyhwm++;
          assert( yypParser->yyhwm ==
                  (int)(yypParser->yytos - yypParser->yystack));
        }
#endif
#if YYSTACKDEPTH>0 
        if( yypParser->yytos>=yypParser->yystackEnd ){
          yyStackOverflow(yypParser);
          break;
        }
#else
        if( yypParser->yytos>=&yypParser->yystack[yypParser->yystksz-1] ){
          if( yyGrowStack(yypParser) ){
            yyStackOverflow(yypParser);
            break;
          }
        }
#endif
      }
      yyact = yy_reduce(yypParser,yyruleno,yymajor,yyminor ParseCTX_PARAM);
    }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);
          if( yyact<=YY_MAX_SHIFTREDUCE ) break;
          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
    }
  }
#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.
*/
int ParseFallback(int iToken){
#ifdef YYFALLBACK
  assert( iToken<(int)(sizeof(yyFallback)/sizeof(yyFallback[0])) );
  return yyFallback[iToken];
#else
  (void)iToken;
  return 0;
#endif
}
