/* 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 ************************/
#line 24 "sql.y"

#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"
#line 42 "sql.c"
/**************** 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_GLOB                           25
#define TK_BETWEEN                        26
#define TK_IN                             27
#define TK_GT                             28
#define TK_GE                             29
#define TK_LT                             30
#define TK_LE                             31
#define TK_BITAND                         32
#define TK_BITOR                          33
#define TK_LSHIFT                         34
#define TK_RSHIFT                         35
#define TK_PLUS                           36
#define TK_MINUS                          37
#define TK_DIVIDE                         38
#define TK_TIMES                          39
#define TK_STAR                           40
#define TK_SLASH                          41
#define TK_REM                            42
#define TK_CONCAT                         43
#define TK_UMINUS                         44
#define TK_UPLUS                          45
#define TK_BITNOT                         46
#define TK_QUESTION                       47
#define TK_ARROW                          48
#define TK_SHOW                           49
#define TK_DATABASES                      50
#define TK_TOPICS                         51
#define TK_FUNCTIONS                      52
#define TK_MNODES                         53
#define TK_DNODES                         54
#define TK_ACCOUNTS                       55
#define TK_USERS                          56
#define TK_MODULES                        57
#define TK_QUERIES                        58
#define TK_CONNECTIONS                    59
#define TK_STREAMS                        60
#define TK_VARIABLES                      61
#define TK_SCORES                         62
#define TK_GRANTS                         63
#define TK_VNODES                         64
#define TK_DOT                            65
#define TK_CREATE                         66
#define TK_TABLE                          67
#define TK_STABLE                         68
#define TK_DATABASE                       69
#define TK_TABLES                         70
#define TK_STABLES                        71
#define TK_VGROUPS                        72
#define TK_DROP                           73
#define TK_TOPIC                          74
#define TK_FUNCTION                       75
#define TK_DNODE                          76
#define TK_USER                           77
#define TK_ACCOUNT                        78
#define TK_USE                            79
#define TK_DESCRIBE                       80
#define TK_DESC                           81
#define TK_ALTER                          82
#define TK_PASS                           83
#define TK_PRIVILEGE                      84
#define TK_LOCAL                          85
#define TK_COMPACT                        86
#define TK_LP                             87
#define TK_RP                             88
#define TK_IF                             89
#define TK_EXISTS                         90
#define TK_AS                             91
#define TK_OUTPUTTYPE                     92
#define TK_AGGREGATE                      93
#define TK_BUFSIZE                        94
#define TK_PPS                            95
#define TK_TSERIES                        96
#define TK_DBS                            97
#define TK_STORAGE                        98
#define TK_QTIME                          99
#define TK_CONNS                          100
#define TK_STATE                          101
#define TK_COMMA                          102
#define TK_KEEP                           103
#define TK_CACHE                          104
#define TK_REPLICA                        105
#define TK_QUORUM                         106
#define TK_DAYS                           107
#define TK_MINROWS                        108
#define TK_MAXROWS                        109
#define TK_BLOCKS                         110
#define TK_CTIME                          111
#define TK_WAL                            112
#define TK_FSYNC                          113
#define TK_COMP                           114
#define TK_PRECISION                      115
#define TK_UPDATE                         116
#define TK_CACHELAST                      117
#define TK_PARTITIONS                     118
#define TK_UNSIGNED                       119
#define TK_TAGS                           120
#define TK_USING                          121
#define TK_NULL                           122
#define TK_NOW                            123
#define TK_SELECT                         124
#define TK_UNION                          125
#define TK_ALL                            126
#define TK_DISTINCT                       127
#define TK_FROM                           128
#define TK_VARIABLE                       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 282
#define YYACTIONTYPE unsigned short int
#define ParseTOKENTYPE SStrToken
typedef union {
  int yyinit;
  ParseTOKENTYPE yy0;
  tVariant yy2;
  SCreateDbInfo yy10;
  int32_t yy40;
  SSqlNode* yy68;
  SCreatedTableInfo yy72;
  SLimitVal yy114;
  SCreateTableSql* yy170;
  SIntervalVal yy280;
  int yy281;
  SSessionWindowVal yy295;
  SArray* yy345;
  tSqlExpr* yy418;
  SCreateAcctInfo yy427;
  SWindowStateVal yy432;
  SRelationInfo* yy484;
  TAOS_FIELD yy487;
  int64_t yy525;
} 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             376
#define YYNRULE              303
#define YYNRULE_WITH_ACTION  303
#define YYNTOKEN             201
#define YY_MAX_SHIFT         375
#define YY_MIN_SHIFTREDUCE   590
#define YY_MAX_SHIFTREDUCE   892
#define YY_ERROR_ACTION      893
#define YY_ACCEPT_ACTION     894
#define YY_NO_ACTION         895
#define YY_MIN_REDUCE        896
#define YY_MAX_REDUCE        1198
/************* 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 (811)
static const YYACTIONTYPE yy_action[] = {
 /*     0 */    58,  642, 1117,  245, 1118,  298, 1051,  302,   94,  643,
 /*    10 */    93,  894,  375,  678,   37,   38,  243,   41,   42,   58,
 /*    20 */  1052,  257,   31,   30,   29,  642,   40,  330,   45,   43,
 /*    30 */    46,   44,  255,  643, 1074, 1194,   36,   35,  374,  237,
 /*    40 */    34,   33,   32,   37,   38,  239,   41,   42,   58, 1049,
 /*    50 */   257,   31,   30,   29,  642,   40,  330,   45,   43,   46,
 /*    60 */    44, 1065,  643,  250,  248,   36,   35, 1052, 1049,   34,
 /*    70 */    33,   32,   37,   38,  159,   41,   42,  279, 1046,  257,
 /*    80 */    31,   30,   29, 1038,   40,  330,   45,   43,   46,   44,
 /*    90 */   326,   82,  212,  249,   36,   35,  642, 1049,   34,   33,
 /*   100 */    32, 1172, 1071, 1175,  643,   88,   37,   39,  252,   41,
 /*   110 */    42,   51, 1052,  257,   31,   30,   29,  825,   40,  330,
 /*   120 */    45,   43,   46,   44, 1022,  251, 1020, 1021,   36,   35,
 /*   130 */   212, 1023,   34,   33,   32, 1024,   58, 1025, 1026, 1172,
 /*   140 */   763, 1174,   67,  286,  285,  591,  592,  593,  594,  595,
 /*   150 */   596,  597,  598,  599,  600,  601,  602,  603,  604,  157,
 /*   160 */    81,  238,   38,   58,   41,   42,   10,  127,  257,   31,
 /*   170 */    30,   29,  326,   40,  330,   45,   43,   46,   44,  362,
 /*   180 */   831,  341,  834,   36,   35, 1049,  362,   34,   33,   32,
 /*   190 */  1065,   41,   42, 1065, 1037,  257,   31,   30,   29,   99,
 /*   200 */    40,  330,   45,   43,   46,   44,  240, 1186,  342,  241,
 /*   210 */    36,   35, 1049, 1128,   34,   33,   32,   66,  324,  369,
 /*   220 */   368,  323,  322,  321,  367,  320,  319,  318,  366,  317,
 /*   230 */   365,  364, 1035, 1036,   55, 1039,  726, 1014, 1002, 1003,
 /*   240 */  1004, 1005, 1006, 1007, 1008, 1009, 1010, 1011, 1012, 1013,
 /*   250 */  1015, 1016,   25,  785,  786,    5,   61,  183,   34,   33,
 /*   260 */    32,   24,  182,  108,  113,  104,  112,  352,  351,  215,
 /*   270 */  1172,  230,  840,  945,  174,  829,  223,  832, 1127,  835,
 /*   280 */   193,  313,  141,  140,  139,  222,  246,  230,  840,  337,
 /*   290 */    88,  829,  288,  832, 1124,  835,  254,  329,  328, 1123,
 /*   300 */    45,   43,   46,   44,  838,   58,  235,  236,   36,   35,
 /*   310 */   331,  102,   34,   33,   32,  256,  373,  372,  150,  830,
 /*   320 */   260,  833,  235,  236,  209,  750,  265,   67,  747,  271,
 /*   330 */   748,  210,  749, 1172,  125,  119,  130,    6,  275,  274,
 /*   340 */  1172,  129,  266,  135,  138,  128,  216, 1040,  247,  278,
 /*   350 */   343,   80,  132,  179, 1049, 1172,  212,   47,  231,  262,
 /*   360 */   263,  203,  201,  199,  258, 1172,  217, 1175,  198,  145,
 /*   370 */   144,  143,  142,   47,   58, 1172,   66,  280,  369,  368,
 /*   380 */    36,   35,   58,  367,   34,   33,   32,  366,  218,  365,
 /*   390 */   364,   59,  841,  836,  766,   58,  261, 1172,  259,  837,
 /*   400 */   340,  339,  267,   58,  264,   58,  347,  346,  841,  836,
 /*   410 */     1,  181,   58,   13,  276,  837, 1165,   98,  334,  344,
 /*   420 */   156,  154,  153, 1049,  212, 1172,  158,  348, 1164, 1163,
 /*   430 */   233, 1049,  234, 1172, 1115, 1175, 1116, 1172, 1172, 1172,
 /*   440 */   349, 1172,  213,  839, 1049,  751,  752,  101,  350,  805,
 /*   450 */   354, 1172, 1049,  214, 1049,  219,  211,  370,  983,  220,
 /*   460 */   221, 1048, 1172,  225, 1172, 1172,  226,  227, 1172, 1172,
 /*   470 */   955,  224, 1172,   97,  208, 1172, 1172,  193,  266,  266,
 /*   480 */  1172,  770,   96, 1172,   95,   85,  946,   83,   86,  180,
 /*   490 */  1050,    3,  194,  193,  782,  792,  793,  328,   73,  736,
 /*   500 */    54,   76,  305,  333,  738,  307,  804,  641,  161,   70,
 /*   510 */    48,  353,  737,   59,  301,   79,   59,  867,   70,  100,
 /*   520 */   842,    9,  282, 1073,  844,  282,   70,   15,  118,   14,
 /*   530 */   117,    9,   26,  308,    9,   17,  755,   16,  756, 1084,
 /*   540 */    74,   77,  828,  753,   19,  754,   18,  725,  124, 1081,
 /*   550 */   123,   21, 1082,   20,  137,  136, 1066,  283, 1086,  160,
 /*   560 */   165,  294,  175, 1107, 1047, 1106, 1105,  176, 1104, 1045,
 /*   570 */   177,  155,  178,  960,  310,  311,  312,  315,  316,   68,
 /*   580 */   167, 1063,  206,   64,  327,  954,  338, 1193,  781,  115,
 /*   590 */  1192, 1189,  184,  345, 1185,  121, 1184,   78, 1181,  287,
 /*   600 */    75,  242,  289,  291,  166,  303,  185,  980,   65,  169,
 /*   610 */    28,  168,   60,   69,  299,  207,  297,  295,  942,  293,
 /*   620 */   170,  131,  171,  940,  133,  134,  938,  290,  937,  268,
 /*   630 */   196,   27,  363,  197,  934,  314,  933,  932,  931,  930,
 /*   640 */   929,  928,  200,  202,  925,  923,  921,  919,  204,  916,
 /*   650 */   205,  912,  126,  355,  356,  281,   84,   89,  292,  357,
 /*   660 */   358,  359,  360,  361,  371,  232,  253,  309,  892,  270,
 /*   670 */   269,  891,  228,  229,  272,  273,  890,  109,  959,  958,
 /*   680 */   277,  873,  872,  110,  282,  304,  936,   11,  284,   87,
 /*   690 */   935,  758,   52,   90,  783,  188,  187,  981,  191,  186,
 /*   700 */   189,  146,  190,  147,  927,  192,  148, 1018,  926,  162,
 /*   710 */   149,   53,  918,  172,  917,  982,  173,    2,    4,  794,
 /*   720 */   163,  164, 1028,  788,   91,  244,  790,   92,  296,   62,
 /*   730 */    22,  332,  300,   23,   63,   12,   49,  306,   50,  101,
 /*   740 */   103,  656,   56,  105,  106,   57,  107,  691,  689,  688,
 /*   750 */   687,  685,  684,  683,  680,  646,  325,  111,  845,  864,
 /*   760 */   863,  843,    7,  865,    8,  336,  335,  114,  116,   71,
 /*   770 */    59,  728,   72,  120,  727,  122,  724,  672,  670,  662,
 /*   780 */   668,  664,  666,  660,  658,  694,  693,  692,  690,  686,
 /*   790 */   682,  681,  195,  644,  608,  896,  895,  895,  895,  895,
 /*   800 */   895,  895,  895,  895,  895,  895,  895,  895,  895,  151,
 /*   810 */   152,
};
static const YYCODETYPE yy_lookahead[] = {
 /*     0 */   203,    1,  277,    1,  279,  280,  253,  276,  277,    9,
 /*    10 */   279,  201,  202,    5,   14,   15,  249,   17,   18,  203,
 /*    20 */   253,   21,   22,   23,   24,    1,   26,   27,   28,   29,
 /*    30 */    30,   31,  210,    9,  203,  253,   36,   37,  203,  204,
 /*    40 */    40,   41,   42,   14,   15,  248,   17,   18,  203,  252,
 /*    50 */    21,   22,   23,   24,    1,   26,   27,   28,   29,   30,
 /*    60 */    31,  251,    9,  249,  248,   36,   37,  253,  252,   40,
 /*    70 */    41,   42,   14,   15,  203,   17,   18,  267,  203,   21,
 /*    80 */    22,   23,   24,    0,   26,   27,   28,   29,   30,   31,
 /*    90 */    89,   91,  270,  248,   36,   37,    1,  252,   40,   41,
 /*   100 */    42,  279,  271,  281,    9,   87,   14,   15,  249,   17,
 /*   110 */    18,   87,  253,   21,   22,   23,   24,   88,   26,   27,
 /*   120 */    28,   29,   30,   31,  227,  250,  229,  230,   36,   37,
 /*   130 */   270,  234,   40,   41,   42,  238,  203,  240,  241,  279,
 /*   140 */   102,  281,  124,  272,  273,   50,   51,   52,   53,   54,
 /*   150 */    55,   56,   57,   58,   59,   60,   61,   62,   63,   64,
 /*   160 */   211,   66,   15,  203,   17,   18,  128,   83,   21,   22,
 /*   170 */    23,   24,   89,   26,   27,   28,   29,   30,   31,   95,
 /*   180 */     5,  248,    7,   36,   37,  252,   95,   40,   41,   42,
 /*   190 */   251,   17,   18,  251,  245,   21,   22,   23,   24,  211,
 /*   200 */    26,   27,   28,   29,   30,   31,  267,  253,  248,  267,
 /*   210 */    36,   37,  252,  243,   40,   41,   42,  103,  104,  105,
 /*   220 */   106,  107,  108,  109,  110,  111,  112,  113,  114,  115,
 /*   230 */   116,  117,  244,  245,  246,  247,    5,  227,  228,  229,
 /*   240 */   230,  231,  232,  233,  234,  235,  236,  237,  238,  239,
 /*   250 */   240,  241,   49,  130,  131,   67,   68,   69,   40,   41,
 /*   260 */    42,  270,   74,   75,   76,   77,   78,   36,   37,   66,
 /*   270 */   279,    1,    2,  209,  257,    5,   73,    7,  243,    9,
 /*   280 */   216,   93,   79,   80,   81,   82,  243,    1,    2,   86,
 /*   290 */    87,    5,  275,    7,  243,    9,  210,   47,   48,  243,
 /*   300 */    28,   29,   30,   31,  129,  203,   36,   37,   36,   37,
 /*   310 */    40,  211,   40,   41,   42,   65,   70,   71,   72,    5,
 /*   320 */    73,    7,   36,   37,  270,    2,   73,  124,    5,  147,
 /*   330 */     7,  270,    9,  279,   67,   68,   69,   87,  156,  157,
 /*   340 */   279,   74,  203,   76,   77,   78,  270,  247,  243,  146,
 /*   350 */   248,  148,   85,  214,  252,  279,  270,   87,  155,   36,
 /*   360 */    37,   67,   68,   69,  210,  279,  270,  281,   74,   75,
 /*   370 */    76,   77,   78,   87,  203,  279,  103,   88,  105,  106,
 /*   380 */    36,   37,  203,  110,   40,   41,   42,  114,  270,  116,
 /*   390 */   117,  102,  122,  123,   40,  203,  149,  279,  151,  129,
 /*   400 */   153,  154,  149,  203,  151,  203,  153,  154,  122,  123,
 /*   410 */   212,  213,  203,   87,  203,  129,  270,   91,   16,  248,
 /*   420 */    67,   68,   69,  252,  270,  279,  203,  248,  270,  270,
 /*   430 */   270,  252,  270,  279,  277,  281,  279,  279,  279,  279,
 /*   440 */   248,  279,  270,  129,  252,  122,  123,  121,  248,   81,
 /*   450 */   248,  279,  252,  270,  252,  270,  270,  225,  226,  270,
 /*   460 */   270,  252,  279,  270,  279,  279,  270,  270,  279,  279,
 /*   470 */   209,  270,  279,  254,  270,  279,  279,  216,  203,  203,
 /*   480 */   279,  127,  277,  279,  279,   88,  209,  268,   88,  214,
 /*   490 */   214,  207,  208,  216,   88,   88,   88,   48,  102,   88,
 /*   500 */    87,  102,   88,    1,   88,   88,  138,   88,  102,  102,
 /*   510 */   102,  243,   88,  102,   65,   87,  102,   88,  102,  102,
 /*   520 */    88,  102,  125,  203,  122,  125,  102,  150,  150,  152,
 /*   530 */   152,  102,  269,  120,  102,  150,    5,  152,    7,  203,
 /*   540 */   144,  142,   40,    5,  150,    7,  152,  119,  150,  203,
 /*   550 */   152,  150,  203,  152,   83,   84,  251,  251,  203,  203,
 /*   560 */   203,  203,  255,  278,  251,  278,  278,  203,  278,  203,
 /*   570 */   203,   65,  203,  203,  203,  203,  203,  203,  203,  203,
 /*   580 */   264,  266,  203,  203,  203,  203,  203,  203,  129,  203,
 /*   590 */   203,  203,  203,  203,  203,  203,  203,  141,  203,  274,
 /*   600 */   143,  274,  274,  274,  265,  136,  203,  203,  203,  262,
 /*   610 */   140,  263,  203,  203,  139,  203,  134,  133,  203,  132,
 /*   620 */   261,  203,  260,  203,  203,  203,  203,  135,  203,  203,
 /*   630 */   203,  145,  118,  203,  203,   94,  203,  203,  203,  203,
 /*   640 */   203,  203,  203,  203,  203,  203,  203,  203,  203,  203,
 /*   650 */   203,  203,  101,  100,   56,  205,  205,  205,  205,   97,
 /*   660 */    99,   60,   98,   96,   89,  205,  205,  205,    5,    5,
 /*   670 */   158,    5,  205,  205,  158,    5,    5,  211,  215,  215,
 /*   680 */   147,  105,  104,  211,  125,  120,  205,   87,  102,  126,
 /*   690 */   205,   88,   87,  102,   88,  218,  222,  224,  220,  223,
 /*   700 */   221,  206,  219,  206,  205,  217,  206,  242,  205,   87,
 /*   710 */   206,  256,  205,  259,  205,  226,  258,  212,  207,   88,
 /*   720 */    87,  102,  242,   88,   87,    1,   88,   87,   87,  102,
 /*   730 */   137,   48,    1,  137,  102,   87,   87,  120,   87,  121,
 /*   740 */    83,    5,   92,   91,   75,   92,   91,    9,    5,    5,
 /*   750 */     5,    5,    5,    5,    5,   90,   16,   83,  122,    9,
 /*   760 */     9,   88,   87,    9,   87,   64,   27,  152,  152,   17,
 /*   770 */   102,    5,   17,  152,    5,  152,   88,    5,    5,    5,
 /*   780 */     5,    5,    5,    5,    5,    5,    5,    5,    5,    5,
 /*   790 */     5,    5,  102,   90,   65,    0,  282,  282,  282,  282,
 /*   800 */   282,  282,  282,  282,  282,  282,  282,  282,  282,   22,
 /*   810 */    22,  282,  282,  282,  282,  282,  282,  282,  282,  282,
 /*   820 */   282,  282,  282,  282,  282,  282,  282,  282,  282,  282,
 /*   830 */   282,  282,  282,  282,  282,  282,  282,  282,  282,  282,
 /*   840 */   282,  282,  282,  282,  282,  282,  282,  282,  282,  282,
 /*   850 */   282,  282,  282,  282,  282,  282,  282,  282,  282,  282,
 /*   860 */   282,  282,  282,  282,  282,  282,  282,  282,  282,  282,
 /*   870 */   282,  282,  282,  282,  282,  282,  282,  282,  282,  282,
 /*   880 */   282,  282,  282,  282,  282,  282,  282,  282,  282,  282,
 /*   890 */   282,  282,  282,  282,  282,  282,  282,  282,  282,  282,
 /*   900 */   282,  282,  282,  282,  282,  282,  282,  282,  282,  282,
 /*   910 */   282,  282,  282,  282,  282,  282,  282,  282,  282,  282,
 /*   920 */   282,  282,  282,  282,  282,  282,  282,  282,  282,  282,
 /*   930 */   282,  282,  282,  282,  282,  282,  282,  282,  282,  282,
 /*   940 */   282,  282,  282,  282,  282,  282,  282,  282,  282,  282,
 /*   950 */   282,  282,  282,  282,  282,  282,  282,  282,  282,  282,
 /*   960 */   282,  282,  282,  282,  282,  282,  282,  282,  282,  282,
 /*   970 */   282,  282,  282,  282,  282,  282,  282,  282,  282,  282,
 /*   980 */   282,  282,  282,  282,  282,  282,  282,  282,  282,  282,
 /*   990 */   282,  282,  282,  282,  282,  282,  282,  282,  282,  282,
 /*  1000 */   282,  282,  282,  282,  282,  282,  282,  282,  282,  282,
 /*  1010 */   282,  282,
};
#define YY_SHIFT_COUNT    (375)
#define YY_SHIFT_MIN      (0)
#define YY_SHIFT_MAX      (795)
static const unsigned short int yy_shift_ofst[] = {
 /*     0 */   203,  114,  114,  273,  273,    1,  270,  286,  286,  286,
 /*    10 */    24,   53,   53,   53,   53,   53,   53,   53,   53,   53,
 /*    20 */    53,   53,    2,    2,    0,   95,  286,  286,  286,  286,
 /*    30 */   286,  286,  286,  286,  286,  286,  286,  286,  286,  286,
 /*    40 */   286,  286,  286,  286,  286,  286,  286,  286,  323,  323,
 /*    50 */   323,   18,   18,  123,   53,   83,   53,   53,   53,   53,
 /*    60 */    84,    1,    2,    2,   91,   91,    8,  811,  811,  811,
 /*    70 */   323,  323,  323,  231,  231,  231,  231,  231,  231,  231,
 /*    80 */    53,   53,   53,  354,   53,   53,   53,   18,   18,   53,
 /*    90 */    53,   53,   53,  368,  368,  368,  368,   38,   18,   53,
 /*   100 */    53,   53,   53,   53,   53,   53,   53,   53,   53,   53,
 /*   110 */    53,   53,   53,   53,   53,   53,   53,   53,   53,   53,
 /*   120 */    53,   53,   53,   53,   53,   53,   53,   53,   53,   53,
 /*   130 */    53,   53,   53,   53,   53,   53,   53,   53,   53,   53,
 /*   140 */    53,   53,   53,   53,   53,   53,   53,   53,   53,   53,
 /*   150 */    53,   53,   53,   53,   53,   53,   53,   53,  506,  506,
 /*   160 */   506,  459,  459,  459,  459,  506,  456,  457,  469,  470,
 /*   170 */   475,  482,  484,  487,  492,  486,  506,  506,  506,  541,
 /*   180 */   541,  514,    1,    1,  506,  506,  551,  553,  598,  562,
 /*   190 */   561,  601,  564,  567,  514,    8,  506,  506,  575,  575,
 /*   200 */   506,  575,  506,  575,  506,  506,  811,  811,   29,   58,
 /*   210 */    58,   92,   58,  147,  174,  188,  272,  272,  272,  272,
 /*   220 */   272,  272,  267,  294,  344,  344,  344,  344,  247,  253,
 /*   230 */   250,  182,  326,  218,  218,  175,  314,  246,  353,  289,
 /*   240 */   397,  400,  406,  407,  408,  449,  396,  399,  411,  414,
 /*   250 */   416,  417,  424,  413,  429,  432,  502,  402,  419,  377,
 /*   260 */   378,  385,  531,  538,  394,  398,  428,  401,  471,  663,
 /*   270 */   512,  664,  666,  516,  670,  671,  576,  578,  533,  559,
 /*   280 */   565,  600,  563,  603,  605,  586,  591,  606,  622,  631,
 /*   290 */   633,  635,  619,  637,  638,  640,  724,  641,  627,  593,
 /*   300 */   683,  731,  632,  596,  648,  565,  649,  617,  651,  618,
 /*   310 */   657,  650,  652,  669,  736,  653,  655,  738,  743,  744,
 /*   320 */   745,  746,  747,  748,  749,  665,  740,  674,  750,  751,
 /*   330 */   675,  673,  754,  683,  636,  677,  739,  701,  752,  615,
 /*   340 */   616,  668,  668,  668,  668,  755,  621,  623,  668,  668,
 /*   350 */   668,  766,  769,  688,  668,  772,  773,  774,  775,  776,
 /*   360 */   777,  778,  779,  780,  781,  782,  783,  784,  785,  786,
 /*   370 */   690,  703,  787,  788,  729,  795,
};
#define YY_REDUCE_COUNT (207)
#define YY_REDUCE_MIN   (-275)
#define YY_REDUCE_MAX   (511)
static const short yy_reduce_ofst[] = {
 /*     0 */  -190,   10,   10, -103, -103,  -12, -178,   86,  154, -140,
 /*    10 */  -129, -203, -184, -155,  -67,  -40,  102,  171,  179,  192,
 /*    20 */   200,  202, -275, -269, -169, -165,   -9,   54,   61,   76,
 /*    30 */    96,  118,  146,  158,  159,  160,  162,  172,  183,  185,
 /*    40 */   186,  189,  190,  193,  196,  197,  201,  204, -233, -186,
 /*    50 */  -141,  -61,  -58,   17, -125,  100,  139,  275,  276,  209,
 /*    60 */    64,  -51,  157,  205,  261,  277,  232,  219,  198,  284,
 /*    70 */  -247, -218,  -46,  -30,   35,   43,   51,   56,  105,  268,
 /*    80 */   211,  223,  320,  263,  336,  346,  349,  305,  306,  355,
 /*    90 */   356,  357,  358,  285,  287,  288,  290,  307,  313,  364,
 /*   100 */   366,  367,  369,  370,  371,  372,  373,  374,  375,  376,
 /*   110 */   379,  380,  381,  382,  383,  384,  386,  387,  388,  389,
 /*   120 */   390,  391,  392,  393,  395,  403,  404,  405,  409,  410,
 /*   130 */   412,  415,  418,  420,  421,  422,  423,  425,  426,  427,
 /*   140 */   430,  431,  433,  434,  435,  436,  437,  438,  439,  440,
 /*   150 */   441,  442,  443,  444,  445,  446,  447,  448,  450,  451,
 /*   160 */   452,  325,  327,  328,  329,  453,  315,  339,  316,  348,
 /*   170 */   347,  359,  362,  454,  458,  455,  460,  461,  462,  463,
 /*   180 */   464,  465,  466,  472,  467,  468,  473,  476,  474,  477,
 /*   190 */   479,  483,  478,  488,  480,  489,  481,  485,  495,  497,
 /*   200 */   499,  500,  503,  504,  507,  509,  505,  511,
};
static const YYACTIONTYPE yy_default[] = {
 /*     0 */   893, 1017,  956, 1027,  943,  953, 1177, 1177, 1177, 1177,
 /*    10 */   893,  893,  893,  893,  893,  893,  893,  893,  893,  893,
 /*    20 */   893,  893,  893,  893, 1075,  913,  893,  893,  893,  893,
 /*    30 */   893,  893,  893,  893,  893,  893,  893,  893,  893,  893,
 /*    40 */   893,  893,  893,  893,  893,  893,  893,  893,  893,  893,
 /*    50 */   893,  893,  893, 1090,  893,  953,  893,  893,  893,  893,
 /*    60 */   963,  953,  893,  893,  963,  963,  893, 1070, 1001, 1019,
 /*    70 */   893,  893,  893,  893,  893,  893,  893,  893,  893,  893,
 /*    80 */   893,  893,  893, 1077, 1083, 1080,  893,  893,  893, 1085,
 /*    90 */   893,  893,  893, 1112, 1112, 1112, 1112, 1068,  893,  893,
 /*   100 */   893,  893,  893,  893,  893,  893,  893,  893,  893,  893,
 /*   110 */   893,  893,  893,  893,  893,  893,  893,  893,  893,  893,
 /*   120 */   893,  893,  893,  893,  893,  893,  893,  893,  893,  893,
 /*   130 */   893,  941,  893,  939,  893,  893,  893,  893,  893,  893,
 /*   140 */   893,  893,  893,  893,  893,  893,  893,  893,  893,  893,
 /*   150 */   924,  893,  893,  893,  893,  893,  893,  911,  915,  915,
 /*   160 */   915,  893,  893,  893,  893,  915, 1121, 1125, 1102, 1119,
 /*   170 */  1113, 1097, 1095, 1093, 1101, 1129,  915,  915,  915,  961,
 /*   180 */   961,  957,  953,  953,  915,  915,  979,  977,  975,  967,
 /*   190 */   973,  969,  971,  965,  944,  893,  915,  915,  951,  951,
 /*   200 */   915,  951,  915,  951,  915,  915, 1001, 1019,  893, 1130,
 /*   210 */  1120,  893, 1176, 1160, 1159,  893, 1168, 1167, 1166, 1158,
 /*   220 */  1157, 1156,  893,  893, 1152, 1155, 1154, 1153,  893,  893,
 /*   230 */  1132,  893,  893, 1162, 1161,  893,  893,  893,  893,  893,
 /*   240 */   893,  893,  893,  893,  893, 1108, 1126, 1122,  893,  893,
 /*   250 */   893,  893,  893,  893,  893,  893,  893,  893,  893,  893,
 /*   260 */   893,  893,  893,  893,  893,  893, 1029,  893,  893,  893,
 /*   270 */   893,  893,  893,  893,  893,  893,  893,  893,  893, 1067,
 /*   280 */   893,  893,  893,  893,  893, 1079, 1078,  893,  893,  893,
 /*   290 */   893,  893,  893,  893,  893,  893,  893,  893, 1114,  893,
 /*   300 */  1109,  893, 1103,  893,  893, 1041,  893,  893,  893,  893,
 /*   310 */   893,  893,  893,  893,  893,  893,  893,  893,  893,  893,
 /*   320 */   893,  893,  893,  893,  893,  893,  893,  893,  893,  893,
 /*   330 */   893,  893,  893, 1133,  893,  893,  893,  893,  893,  893,
 /*   340 */   893, 1195, 1190, 1191, 1188,  893,  893,  893, 1187, 1182,
 /*   350 */  1183,  893,  893,  893, 1180,  893,  893,  893,  893,  893,
 /*   360 */   893,  893,  893,  893,  893,  893,  893,  893,  893,  893,
 /*   370 */   985,  893,  922,  920,  893,  893,
};
/********** 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 */
    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,  /*     CONCAT => nothing */
    0,  /*     UMINUS => nothing */
    0,  /*      UPLUS => nothing */
    0,  /*     BITNOT => nothing */
    0,  /*   QUESTION => 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,  /*     SELECT => nothing */
    0,  /*      UNION => nothing */
    1,  /*        ALL => ID */
    0,  /*   DISTINCT => nothing */
    0,  /*       FROM => nothing */
    0,  /*   VARIABLE => 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 */ "GLOB",
  /*   26 */ "BETWEEN",
  /*   27 */ "IN",
  /*   28 */ "GT",
  /*   29 */ "GE",
  /*   30 */ "LT",
  /*   31 */ "LE",
  /*   32 */ "BITAND",
  /*   33 */ "BITOR",
  /*   34 */ "LSHIFT",
  /*   35 */ "RSHIFT",
  /*   36 */ "PLUS",
  /*   37 */ "MINUS",
  /*   38 */ "DIVIDE",
  /*   39 */ "TIMES",
  /*   40 */ "STAR",
  /*   41 */ "SLASH",
  /*   42 */ "REM",
  /*   43 */ "CONCAT",
  /*   44 */ "UMINUS",
  /*   45 */ "UPLUS",
  /*   46 */ "BITNOT",
  /*   47 */ "QUESTION",
  /*   48 */ "ARROW",
  /*   49 */ "SHOW",
  /*   50 */ "DATABASES",
  /*   51 */ "TOPICS",
  /*   52 */ "FUNCTIONS",
  /*   53 */ "MNODES",
  /*   54 */ "DNODES",
  /*   55 */ "ACCOUNTS",
  /*   56 */ "USERS",
  /*   57 */ "MODULES",
  /*   58 */ "QUERIES",
  /*   59 */ "CONNECTIONS",
  /*   60 */ "STREAMS",
  /*   61 */ "VARIABLES",
  /*   62 */ "SCORES",
  /*   63 */ "GRANTS",
  /*   64 */ "VNODES",
  /*   65 */ "DOT",
  /*   66 */ "CREATE",
  /*   67 */ "TABLE",
  /*   68 */ "STABLE",
  /*   69 */ "DATABASE",
  /*   70 */ "TABLES",
  /*   71 */ "STABLES",
  /*   72 */ "VGROUPS",
  /*   73 */ "DROP",
  /*   74 */ "TOPIC",
  /*   75 */ "FUNCTION",
  /*   76 */ "DNODE",
  /*   77 */ "USER",
  /*   78 */ "ACCOUNT",
  /*   79 */ "USE",
  /*   80 */ "DESCRIBE",
  /*   81 */ "DESC",
  /*   82 */ "ALTER",
  /*   83 */ "PASS",
  /*   84 */ "PRIVILEGE",
  /*   85 */ "LOCAL",
  /*   86 */ "COMPACT",
  /*   87 */ "LP",
  /*   88 */ "RP",
  /*   89 */ "IF",
  /*   90 */ "EXISTS",
  /*   91 */ "AS",
  /*   92 */ "OUTPUTTYPE",
  /*   93 */ "AGGREGATE",
  /*   94 */ "BUFSIZE",
  /*   95 */ "PPS",
  /*   96 */ "TSERIES",
  /*   97 */ "DBS",
  /*   98 */ "STORAGE",
  /*   99 */ "QTIME",
  /*  100 */ "CONNS",
  /*  101 */ "STATE",
  /*  102 */ "COMMA",
  /*  103 */ "KEEP",
  /*  104 */ "CACHE",
  /*  105 */ "REPLICA",
  /*  106 */ "QUORUM",
  /*  107 */ "DAYS",
  /*  108 */ "MINROWS",
  /*  109 */ "MAXROWS",
  /*  110 */ "BLOCKS",
  /*  111 */ "CTIME",
  /*  112 */ "WAL",
  /*  113 */ "FSYNC",
  /*  114 */ "COMP",
  /*  115 */ "PRECISION",
  /*  116 */ "UPDATE",
  /*  117 */ "CACHELAST",
  /*  118 */ "PARTITIONS",
  /*  119 */ "UNSIGNED",
  /*  120 */ "TAGS",
  /*  121 */ "USING",
  /*  122 */ "NULL",
  /*  123 */ "NOW",
  /*  124 */ "SELECT",
  /*  125 */ "UNION",
  /*  126 */ "ALL",
  /*  127 */ "DISTINCT",
  /*  128 */ "FROM",
  /*  129 */ "VARIABLE",
  /*  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 */ "interval_option",
  /*  258 */ "sliding_opt",
  /*  259 */ "session_option",
  /*  260 */ "windowstate_option",
  /*  261 */ "fill_opt",
  /*  262 */ "groupby_opt",
  /*  263 */ "having_opt",
  /*  264 */ "orderby_opt",
  /*  265 */ "slimit_opt",
  /*  266 */ "limit_opt",
  /*  267 */ "union",
  /*  268 */ "sclp",
  /*  269 */ "distinct",
  /*  270 */ "expr",
  /*  271 */ "as",
  /*  272 */ "tablelist",
  /*  273 */ "sub",
  /*  274 */ "tmvar",
  /*  275 */ "intervalKey",
  /*  276 */ "sortlist",
  /*  277 */ "item",
  /*  278 */ "sortorder",
  /*  279 */ "arrow",
  /*  280 */ "grouplist",
  /*  281 */ "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 ::= SHOW dbPrefix VGROUPS ids",
 /*  30 */ "cmd ::= DROP TABLE ifexists ids cpxName",
 /*  31 */ "cmd ::= DROP STABLE ifexists ids cpxName",
 /*  32 */ "cmd ::= DROP DATABASE ifexists ids",
 /*  33 */ "cmd ::= DROP TOPIC ifexists ids",
 /*  34 */ "cmd ::= DROP FUNCTION ids",
 /*  35 */ "cmd ::= DROP DNODE ids",
 /*  36 */ "cmd ::= DROP USER ids",
 /*  37 */ "cmd ::= DROP ACCOUNT ids",
 /*  38 */ "cmd ::= USE ids",
 /*  39 */ "cmd ::= DESCRIBE ids cpxName",
 /*  40 */ "cmd ::= DESC ids cpxName",
 /*  41 */ "cmd ::= ALTER USER ids PASS ids",
 /*  42 */ "cmd ::= ALTER USER ids PRIVILEGE ids",
 /*  43 */ "cmd ::= ALTER DNODE ids ids",
 /*  44 */ "cmd ::= ALTER DNODE ids ids ids",
 /*  45 */ "cmd ::= ALTER LOCAL ids",
 /*  46 */ "cmd ::= ALTER LOCAL ids ids",
 /*  47 */ "cmd ::= ALTER DATABASE ids alter_db_optr",
 /*  48 */ "cmd ::= ALTER TOPIC ids alter_topic_optr",
 /*  49 */ "cmd ::= ALTER ACCOUNT ids acct_optr",
 /*  50 */ "cmd ::= ALTER ACCOUNT ids PASS ids acct_optr",
 /*  51 */ "cmd ::= COMPACT VNODES IN LP exprlist RP",
 /*  52 */ "ids ::= ID",
 /*  53 */ "ids ::= STRING",
 /*  54 */ "ifexists ::= IF EXISTS",
 /*  55 */ "ifexists ::=",
 /*  56 */ "ifnotexists ::= IF NOT EXISTS",
 /*  57 */ "ifnotexists ::=",
 /*  58 */ "cmd ::= CREATE DNODE ids",
 /*  59 */ "cmd ::= CREATE ACCOUNT ids PASS ids acct_optr",
 /*  60 */ "cmd ::= CREATE DATABASE ifnotexists ids db_optr",
 /*  61 */ "cmd ::= CREATE TOPIC ifnotexists ids topic_optr",
 /*  62 */ "cmd ::= CREATE FUNCTION ids AS ids OUTPUTTYPE typename bufsize",
 /*  63 */ "cmd ::= CREATE AGGREGATE FUNCTION ids AS ids OUTPUTTYPE typename bufsize",
 /*  64 */ "cmd ::= CREATE USER ids PASS ids",
 /*  65 */ "bufsize ::=",
 /*  66 */ "bufsize ::= BUFSIZE INTEGER",
 /*  67 */ "pps ::=",
 /*  68 */ "pps ::= PPS INTEGER",
 /*  69 */ "tseries ::=",
 /*  70 */ "tseries ::= TSERIES INTEGER",
 /*  71 */ "dbs ::=",
 /*  72 */ "dbs ::= DBS INTEGER",
 /*  73 */ "streams ::=",
 /*  74 */ "streams ::= STREAMS INTEGER",
 /*  75 */ "storage ::=",
 /*  76 */ "storage ::= STORAGE INTEGER",
 /*  77 */ "qtime ::=",
 /*  78 */ "qtime ::= QTIME INTEGER",
 /*  79 */ "users ::=",
 /*  80 */ "users ::= USERS INTEGER",
 /*  81 */ "conns ::=",
 /*  82 */ "conns ::= CONNS INTEGER",
 /*  83 */ "state ::=",
 /*  84 */ "state ::= STATE ids",
 /*  85 */ "acct_optr ::= pps tseries storage streams qtime dbs users conns state",
 /*  86 */ "intitemlist ::= intitemlist COMMA intitem",
 /*  87 */ "intitemlist ::= intitem",
 /*  88 */ "intitem ::= INTEGER",
 /*  89 */ "keep ::= KEEP intitemlist",
 /*  90 */ "cache ::= CACHE INTEGER",
 /*  91 */ "replica ::= REPLICA INTEGER",
 /*  92 */ "quorum ::= QUORUM INTEGER",
 /*  93 */ "days ::= DAYS INTEGER",
 /*  94 */ "minrows ::= MINROWS INTEGER",
 /*  95 */ "maxrows ::= MAXROWS INTEGER",
 /*  96 */ "blocks ::= BLOCKS INTEGER",
 /*  97 */ "ctime ::= CTIME INTEGER",
 /*  98 */ "wal ::= WAL INTEGER",
 /*  99 */ "fsync ::= FSYNC INTEGER",
 /* 100 */ "comp ::= COMP INTEGER",
 /* 101 */ "prec ::= PRECISION STRING",
 /* 102 */ "update ::= UPDATE INTEGER",
 /* 103 */ "cachelast ::= CACHELAST INTEGER",
 /* 104 */ "partitions ::= PARTITIONS INTEGER",
 /* 105 */ "db_optr ::=",
 /* 106 */ "db_optr ::= db_optr cache",
 /* 107 */ "db_optr ::= db_optr replica",
 /* 108 */ "db_optr ::= db_optr quorum",
 /* 109 */ "db_optr ::= db_optr days",
 /* 110 */ "db_optr ::= db_optr minrows",
 /* 111 */ "db_optr ::= db_optr maxrows",
 /* 112 */ "db_optr ::= db_optr blocks",
 /* 113 */ "db_optr ::= db_optr ctime",
 /* 114 */ "db_optr ::= db_optr wal",
 /* 115 */ "db_optr ::= db_optr fsync",
 /* 116 */ "db_optr ::= db_optr comp",
 /* 117 */ "db_optr ::= db_optr prec",
 /* 118 */ "db_optr ::= db_optr keep",
 /* 119 */ "db_optr ::= db_optr update",
 /* 120 */ "db_optr ::= db_optr cachelast",
 /* 121 */ "topic_optr ::= db_optr",
 /* 122 */ "topic_optr ::= topic_optr partitions",
 /* 123 */ "alter_db_optr ::=",
 /* 124 */ "alter_db_optr ::= alter_db_optr replica",
 /* 125 */ "alter_db_optr ::= alter_db_optr quorum",
 /* 126 */ "alter_db_optr ::= alter_db_optr keep",
 /* 127 */ "alter_db_optr ::= alter_db_optr blocks",
 /* 128 */ "alter_db_optr ::= alter_db_optr comp",
 /* 129 */ "alter_db_optr ::= alter_db_optr update",
 /* 130 */ "alter_db_optr ::= alter_db_optr cachelast",
 /* 131 */ "alter_topic_optr ::= alter_db_optr",
 /* 132 */ "alter_topic_optr ::= alter_topic_optr partitions",
 /* 133 */ "typename ::= ids",
 /* 134 */ "typename ::= ids LP signed RP",
 /* 135 */ "typename ::= ids UNSIGNED",
 /* 136 */ "signed ::= INTEGER",
 /* 137 */ "signed ::= PLUS INTEGER",
 /* 138 */ "signed ::= MINUS INTEGER",
 /* 139 */ "cmd ::= CREATE TABLE create_table_args",
 /* 140 */ "cmd ::= CREATE TABLE create_stable_args",
 /* 141 */ "cmd ::= CREATE STABLE create_stable_args",
 /* 142 */ "cmd ::= CREATE TABLE create_table_list",
 /* 143 */ "create_table_list ::= create_from_stable",
 /* 144 */ "create_table_list ::= create_table_list create_from_stable",
 /* 145 */ "create_table_args ::= ifnotexists ids cpxName LP columnlist RP",
 /* 146 */ "create_stable_args ::= ifnotexists ids cpxName LP columnlist RP TAGS LP columnlist RP",
 /* 147 */ "create_from_stable ::= ifnotexists ids cpxName USING ids cpxName TAGS LP tagitemlist RP",
 /* 148 */ "create_from_stable ::= ifnotexists ids cpxName USING ids cpxName LP tagNamelist RP TAGS LP tagitemlist RP",
 /* 149 */ "tagNamelist ::= tagNamelist COMMA ids",
 /* 150 */ "tagNamelist ::= ids",
 /* 151 */ "create_table_args ::= ifnotexists ids cpxName AS select",
 /* 152 */ "columnlist ::= columnlist COMMA column",
 /* 153 */ "columnlist ::= column",
 /* 154 */ "column ::= ids typename",
 /* 155 */ "tagitemlist ::= tagitemlist COMMA tagitem",
 /* 156 */ "tagitemlist ::= tagitem",
 /* 157 */ "tagitem ::= INTEGER",
 /* 158 */ "tagitem ::= FLOAT",
 /* 159 */ "tagitem ::= STRING",
 /* 160 */ "tagitem ::= BOOL",
 /* 161 */ "tagitem ::= NULL",
 /* 162 */ "tagitem ::= NOW",
 /* 163 */ "tagitem ::= MINUS INTEGER",
 /* 164 */ "tagitem ::= MINUS FLOAT",
 /* 165 */ "tagitem ::= PLUS INTEGER",
 /* 166 */ "tagitem ::= PLUS FLOAT",
 /* 167 */ "select ::= SELECT selcollist from where_opt interval_option sliding_opt session_option windowstate_option fill_opt groupby_opt having_opt orderby_opt slimit_opt limit_opt",
 /* 168 */ "select ::= LP select RP",
 /* 169 */ "union ::= select",
 /* 170 */ "union ::= union UNION ALL select",
 /* 171 */ "cmd ::= union",
 /* 172 */ "select ::= SELECT selcollist",
 /* 173 */ "sclp ::= selcollist COMMA",
 /* 174 */ "sclp ::=",
 /* 175 */ "selcollist ::= sclp distinct expr as",
 /* 176 */ "selcollist ::= sclp STAR",
 /* 177 */ "as ::= AS ids",
 /* 178 */ "as ::= ids",
 /* 179 */ "as ::=",
 /* 180 */ "distinct ::= DISTINCT",
 /* 181 */ "distinct ::=",
 /* 182 */ "from ::= FROM tablelist",
 /* 183 */ "from ::= FROM sub",
 /* 184 */ "sub ::= LP union RP",
 /* 185 */ "sub ::= LP union RP ids",
 /* 186 */ "sub ::= sub COMMA LP union RP ids",
 /* 187 */ "tablelist ::= ids cpxName",
 /* 188 */ "tablelist ::= ids cpxName ids",
 /* 189 */ "tablelist ::= tablelist COMMA ids cpxName",
 /* 190 */ "tablelist ::= tablelist COMMA ids cpxName ids",
 /* 191 */ "tmvar ::= VARIABLE",
 /* 192 */ "interval_option ::= intervalKey LP tmvar RP",
 /* 193 */ "interval_option ::= intervalKey LP tmvar COMMA tmvar RP",
 /* 194 */ "interval_option ::=",
 /* 195 */ "intervalKey ::= INTERVAL",
 /* 196 */ "intervalKey ::= EVERY",
 /* 197 */ "session_option ::=",
 /* 198 */ "session_option ::= SESSION LP ids cpxName COMMA tmvar RP",
 /* 199 */ "windowstate_option ::=",
 /* 200 */ "windowstate_option ::= STATE_WINDOW LP ids RP",
 /* 201 */ "fill_opt ::=",
 /* 202 */ "fill_opt ::= FILL LP ID COMMA tagitemlist RP",
 /* 203 */ "fill_opt ::= FILL LP ID RP",
 /* 204 */ "sliding_opt ::= SLIDING LP tmvar RP",
 /* 205 */ "sliding_opt ::=",
 /* 206 */ "orderby_opt ::=",
 /* 207 */ "orderby_opt ::= ORDER BY sortlist",
 /* 208 */ "sortlist ::= sortlist COMMA item sortorder",
 /* 209 */ "sortlist ::= sortlist COMMA arrow sortorder",
 /* 210 */ "sortlist ::= item sortorder",
 /* 211 */ "sortlist ::= arrow sortorder",
 /* 212 */ "item ::= ID",
 /* 213 */ "item ::= ID DOT ID",
 /* 214 */ "sortorder ::= ASC",
 /* 215 */ "sortorder ::= DESC",
 /* 216 */ "sortorder ::=",
 /* 217 */ "groupby_opt ::=",
 /* 218 */ "groupby_opt ::= GROUP BY grouplist",
 /* 219 */ "grouplist ::= grouplist COMMA item",
 /* 220 */ "grouplist ::= grouplist COMMA arrow",
 /* 221 */ "grouplist ::= item",
 /* 222 */ "grouplist ::= arrow",
 /* 223 */ "having_opt ::=",
 /* 224 */ "having_opt ::= HAVING expr",
 /* 225 */ "limit_opt ::=",
 /* 226 */ "limit_opt ::= LIMIT signed",
 /* 227 */ "limit_opt ::= LIMIT signed OFFSET signed",
 /* 228 */ "limit_opt ::= LIMIT signed COMMA signed",
 /* 229 */ "slimit_opt ::=",
 /* 230 */ "slimit_opt ::= SLIMIT signed",
 /* 231 */ "slimit_opt ::= SLIMIT signed SOFFSET signed",
 /* 232 */ "slimit_opt ::= SLIMIT signed COMMA signed",
 /* 233 */ "where_opt ::=",
 /* 234 */ "where_opt ::= WHERE expr",
 /* 235 */ "expr ::= LP expr RP",
 /* 236 */ "expr ::= ID",
 /* 237 */ "expr ::= ID DOT ID",
 /* 238 */ "expr ::= ID DOT STAR",
 /* 239 */ "expr ::= INTEGER",
 /* 240 */ "expr ::= MINUS INTEGER",
 /* 241 */ "expr ::= PLUS INTEGER",
 /* 242 */ "expr ::= FLOAT",
 /* 243 */ "expr ::= MINUS FLOAT",
 /* 244 */ "expr ::= PLUS FLOAT",
 /* 245 */ "expr ::= STRING",
 /* 246 */ "expr ::= NOW",
 /* 247 */ "expr ::= VARIABLE",
 /* 248 */ "expr ::= PLUS VARIABLE",
 /* 249 */ "expr ::= MINUS VARIABLE",
 /* 250 */ "expr ::= BOOL",
 /* 251 */ "expr ::= NULL",
 /* 252 */ "expr ::= ID LP exprlist RP",
 /* 253 */ "expr ::= ID LP STAR RP",
 /* 254 */ "expr ::= expr IS NULL",
 /* 255 */ "expr ::= expr IS NOT NULL",
 /* 256 */ "expr ::= expr LT expr",
 /* 257 */ "expr ::= expr GT expr",
 /* 258 */ "expr ::= expr LE expr",
 /* 259 */ "expr ::= expr GE expr",
 /* 260 */ "expr ::= expr NE expr",
 /* 261 */ "expr ::= expr EQ expr",
 /* 262 */ "expr ::= expr BETWEEN expr AND expr",
 /* 263 */ "expr ::= expr AND expr",
 /* 264 */ "expr ::= expr OR expr",
 /* 265 */ "expr ::= expr PLUS expr",
 /* 266 */ "expr ::= expr MINUS expr",
 /* 267 */ "expr ::= expr STAR expr",
 /* 268 */ "expr ::= expr SLASH expr",
 /* 269 */ "expr ::= expr REM expr",
 /* 270 */ "expr ::= expr LIKE expr",
 /* 271 */ "expr ::= expr MATCH expr",
 /* 272 */ "expr ::= expr NMATCH expr",
 /* 273 */ "expr ::= ID QUESTION STRING",
 /* 274 */ "arrow ::= ID ARROW STRING",
 /* 275 */ "arrow ::= ID DOT ID ARROW STRING",
 /* 276 */ "expr ::= arrow",
 /* 277 */ "expr ::= expr IN LP exprlist RP",
 /* 278 */ "exprlist ::= exprlist COMMA expritem",
 /* 279 */ "exprlist ::= expritem",
 /* 280 */ "expritem ::= expr",
 /* 281 */ "expritem ::=",
 /* 282 */ "cmd ::= RESET QUERY CACHE",
 /* 283 */ "cmd ::= SYNCDB ids REPLICA",
 /* 284 */ "cmd ::= ALTER TABLE ids cpxName ADD COLUMN columnlist",
 /* 285 */ "cmd ::= ALTER TABLE ids cpxName DROP COLUMN ids",
 /* 286 */ "cmd ::= ALTER TABLE ids cpxName MODIFY COLUMN columnlist",
 /* 287 */ "cmd ::= ALTER TABLE ids cpxName ADD TAG columnlist",
 /* 288 */ "cmd ::= ALTER TABLE ids cpxName DROP TAG ids",
 /* 289 */ "cmd ::= ALTER TABLE ids cpxName CHANGE TAG ids ids",
 /* 290 */ "cmd ::= ALTER TABLE ids cpxName SET TAG ids EQ tagitem",
 /* 291 */ "cmd ::= ALTER TABLE ids cpxName MODIFY TAG columnlist",
 /* 292 */ "cmd ::= ALTER STABLE ids cpxName ADD COLUMN columnlist",
 /* 293 */ "cmd ::= ALTER STABLE ids cpxName DROP COLUMN ids",
 /* 294 */ "cmd ::= ALTER STABLE ids cpxName MODIFY COLUMN columnlist",
 /* 295 */ "cmd ::= ALTER STABLE ids cpxName ADD TAG columnlist",
 /* 296 */ "cmd ::= ALTER STABLE ids cpxName DROP TAG ids",
 /* 297 */ "cmd ::= ALTER STABLE ids cpxName CHANGE TAG ids ids",
 /* 298 */ "cmd ::= ALTER STABLE ids cpxName SET TAG ids EQ tagitem",
 /* 299 */ "cmd ::= ALTER STABLE ids cpxName MODIFY TAG columnlist",
 /* 300 */ "cmd ::= KILL CONNECTION INTEGER",
 /* 301 */ "cmd ::= KILL STREAM INTEGER COLON INTEGER",
 /* 302 */ "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 268: /* sclp */
{
#line 787 "sql.y"
tSqlExprListDestroy((yypminor->yy345));
#line 1749 "sql.c"
}
      break;
    case 225: /* intitemlist */
    case 227: /* keep */
    case 248: /* columnlist */
    case 249: /* tagitemlist */
    case 250: /* tagNamelist */
    case 261: /* fill_opt */
    case 262: /* groupby_opt */
    case 264: /* orderby_opt */
    case 276: /* sortlist */
    case 280: /* grouplist */
{
#line 257 "sql.y"
taosArrayDestroy((yypminor->yy345));
#line 1765 "sql.c"
}
      break;
    case 246: /* create_table_list */
{
#line 365 "sql.y"
destroyCreateTableSql((yypminor->yy170));
#line 1772 "sql.c"
}
      break;
    case 251: /* select */
{
#line 485 "sql.y"
destroySqlNode((yypminor->yy68));
#line 1779 "sql.c"
}
      break;
    case 255: /* from */
    case 272: /* tablelist */
    case 273: /* sub */
{
#line 540 "sql.y"
destroyRelationInfo((yypminor->yy484));
#line 1788 "sql.c"
}
      break;
    case 256: /* where_opt */
    case 263: /* having_opt */
    case 270: /* expr */
    case 279: /* arrow */
    case 281: /* expritem */
{
#line 705 "sql.y"
tSqlExprDestroy((yypminor->yy418));
#line 1799 "sql.c"
}
      break;
    case 267: /* union */
{
#line 493 "sql.y"
destroyAllSqlNode((yypminor->yy345));
#line 1806 "sql.c"
}
      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 ::= SHOW dbPrefix VGROUPS ids */
   202,  /* (30) cmd ::= DROP TABLE ifexists ids cpxName */
   202,  /* (31) cmd ::= DROP STABLE ifexists ids cpxName */
   202,  /* (32) cmd ::= DROP DATABASE ifexists ids */
   202,  /* (33) cmd ::= DROP TOPIC ifexists ids */
   202,  /* (34) cmd ::= DROP FUNCTION ids */
   202,  /* (35) cmd ::= DROP DNODE ids */
   202,  /* (36) cmd ::= DROP USER ids */
   202,  /* (37) cmd ::= DROP ACCOUNT ids */
   202,  /* (38) cmd ::= USE ids */
   202,  /* (39) cmd ::= DESCRIBE ids cpxName */
   202,  /* (40) cmd ::= DESC ids cpxName */
   202,  /* (41) cmd ::= ALTER USER ids PASS ids */
   202,  /* (42) cmd ::= ALTER USER ids PRIVILEGE ids */
   202,  /* (43) cmd ::= ALTER DNODE ids ids */
   202,  /* (44) cmd ::= ALTER DNODE ids ids ids */
   202,  /* (45) cmd ::= ALTER LOCAL ids */
   202,  /* (46) cmd ::= ALTER LOCAL ids ids */
   202,  /* (47) cmd ::= ALTER DATABASE ids alter_db_optr */
   202,  /* (48) cmd ::= ALTER TOPIC ids alter_topic_optr */
   202,  /* (49) cmd ::= ALTER ACCOUNT ids acct_optr */
   202,  /* (50) cmd ::= ALTER ACCOUNT ids PASS ids acct_optr */
   202,  /* (51) cmd ::= COMPACT VNODES IN LP exprlist RP */
   203,  /* (52) ids ::= ID */
   203,  /* (53) ids ::= STRING */
   206,  /* (54) ifexists ::= IF EXISTS */
   206,  /* (55) ifexists ::= */
   211,  /* (56) ifnotexists ::= IF NOT EXISTS */
   211,  /* (57) ifnotexists ::= */
   202,  /* (58) cmd ::= CREATE DNODE ids */
   202,  /* (59) cmd ::= CREATE ACCOUNT ids PASS ids acct_optr */
   202,  /* (60) cmd ::= CREATE DATABASE ifnotexists ids db_optr */
   202,  /* (61) cmd ::= CREATE TOPIC ifnotexists ids topic_optr */
   202,  /* (62) cmd ::= CREATE FUNCTION ids AS ids OUTPUTTYPE typename bufsize */
   202,  /* (63) cmd ::= CREATE AGGREGATE FUNCTION ids AS ids OUTPUTTYPE typename bufsize */
   202,  /* (64) cmd ::= CREATE USER ids PASS ids */
   215,  /* (65) bufsize ::= */
   215,  /* (66) bufsize ::= BUFSIZE INTEGER */
   216,  /* (67) pps ::= */
   216,  /* (68) pps ::= PPS INTEGER */
   217,  /* (69) tseries ::= */
   217,  /* (70) tseries ::= TSERIES INTEGER */
   218,  /* (71) dbs ::= */
   218,  /* (72) dbs ::= DBS INTEGER */
   219,  /* (73) streams ::= */
   219,  /* (74) streams ::= STREAMS INTEGER */
   220,  /* (75) storage ::= */
   220,  /* (76) storage ::= STORAGE INTEGER */
   221,  /* (77) qtime ::= */
   221,  /* (78) qtime ::= QTIME INTEGER */
   222,  /* (79) users ::= */
   222,  /* (80) users ::= USERS INTEGER */
   223,  /* (81) conns ::= */
   223,  /* (82) conns ::= CONNS INTEGER */
   224,  /* (83) state ::= */
   224,  /* (84) state ::= STATE ids */
   209,  /* (85) acct_optr ::= pps tseries storage streams qtime dbs users conns state */
   225,  /* (86) intitemlist ::= intitemlist COMMA intitem */
   225,  /* (87) intitemlist ::= intitem */
   226,  /* (88) intitem ::= INTEGER */
   227,  /* (89) keep ::= KEEP intitemlist */
   228,  /* (90) cache ::= CACHE INTEGER */
   229,  /* (91) replica ::= REPLICA INTEGER */
   230,  /* (92) quorum ::= QUORUM INTEGER */
   231,  /* (93) days ::= DAYS INTEGER */
   232,  /* (94) minrows ::= MINROWS INTEGER */
   233,  /* (95) maxrows ::= MAXROWS INTEGER */
   234,  /* (96) blocks ::= BLOCKS INTEGER */
   235,  /* (97) ctime ::= CTIME INTEGER */
   236,  /* (98) wal ::= WAL INTEGER */
   237,  /* (99) fsync ::= FSYNC INTEGER */
   238,  /* (100) comp ::= COMP INTEGER */
   239,  /* (101) prec ::= PRECISION STRING */
   240,  /* (102) update ::= UPDATE INTEGER */
   241,  /* (103) cachelast ::= CACHELAST INTEGER */
   242,  /* (104) partitions ::= PARTITIONS INTEGER */
   212,  /* (105) db_optr ::= */
   212,  /* (106) db_optr ::= db_optr cache */
   212,  /* (107) db_optr ::= db_optr replica */
   212,  /* (108) db_optr ::= db_optr quorum */
   212,  /* (109) db_optr ::= db_optr days */
   212,  /* (110) db_optr ::= db_optr minrows */
   212,  /* (111) db_optr ::= db_optr maxrows */
   212,  /* (112) db_optr ::= db_optr blocks */
   212,  /* (113) db_optr ::= db_optr ctime */
   212,  /* (114) db_optr ::= db_optr wal */
   212,  /* (115) db_optr ::= db_optr fsync */
   212,  /* (116) db_optr ::= db_optr comp */
   212,  /* (117) db_optr ::= db_optr prec */
   212,  /* (118) db_optr ::= db_optr keep */
   212,  /* (119) db_optr ::= db_optr update */
   212,  /* (120) db_optr ::= db_optr cachelast */
   213,  /* (121) topic_optr ::= db_optr */
   213,  /* (122) topic_optr ::= topic_optr partitions */
   207,  /* (123) alter_db_optr ::= */
   207,  /* (124) alter_db_optr ::= alter_db_optr replica */
   207,  /* (125) alter_db_optr ::= alter_db_optr quorum */
   207,  /* (126) alter_db_optr ::= alter_db_optr keep */
   207,  /* (127) alter_db_optr ::= alter_db_optr blocks */
   207,  /* (128) alter_db_optr ::= alter_db_optr comp */
   207,  /* (129) alter_db_optr ::= alter_db_optr update */
   207,  /* (130) alter_db_optr ::= alter_db_optr cachelast */
   208,  /* (131) alter_topic_optr ::= alter_db_optr */
   208,  /* (132) alter_topic_optr ::= alter_topic_optr partitions */
   214,  /* (133) typename ::= ids */
   214,  /* (134) typename ::= ids LP signed RP */
   214,  /* (135) typename ::= ids UNSIGNED */
   243,  /* (136) signed ::= INTEGER */
   243,  /* (137) signed ::= PLUS INTEGER */
   243,  /* (138) signed ::= MINUS INTEGER */
   202,  /* (139) cmd ::= CREATE TABLE create_table_args */
   202,  /* (140) cmd ::= CREATE TABLE create_stable_args */
   202,  /* (141) cmd ::= CREATE STABLE create_stable_args */
   202,  /* (142) cmd ::= CREATE TABLE create_table_list */
   246,  /* (143) create_table_list ::= create_from_stable */
   246,  /* (144) create_table_list ::= create_table_list create_from_stable */
   244,  /* (145) create_table_args ::= ifnotexists ids cpxName LP columnlist RP */
   245,  /* (146) create_stable_args ::= ifnotexists ids cpxName LP columnlist RP TAGS LP columnlist RP */
   247,  /* (147) create_from_stable ::= ifnotexists ids cpxName USING ids cpxName TAGS LP tagitemlist RP */
   247,  /* (148) create_from_stable ::= ifnotexists ids cpxName USING ids cpxName LP tagNamelist RP TAGS LP tagitemlist RP */
   250,  /* (149) tagNamelist ::= tagNamelist COMMA ids */
   250,  /* (150) tagNamelist ::= ids */
   244,  /* (151) create_table_args ::= ifnotexists ids cpxName AS select */
   248,  /* (152) columnlist ::= columnlist COMMA column */
   248,  /* (153) columnlist ::= column */
   252,  /* (154) column ::= ids typename */
   249,  /* (155) tagitemlist ::= tagitemlist COMMA tagitem */
   249,  /* (156) tagitemlist ::= tagitem */
   253,  /* (157) tagitem ::= INTEGER */
   253,  /* (158) tagitem ::= FLOAT */
   253,  /* (159) tagitem ::= STRING */
   253,  /* (160) tagitem ::= BOOL */
   253,  /* (161) tagitem ::= NULL */
   253,  /* (162) tagitem ::= NOW */
   253,  /* (163) tagitem ::= MINUS INTEGER */
   253,  /* (164) tagitem ::= MINUS FLOAT */
   253,  /* (165) tagitem ::= PLUS INTEGER */
   253,  /* (166) tagitem ::= PLUS FLOAT */
   251,  /* (167) select ::= SELECT selcollist from where_opt interval_option sliding_opt session_option windowstate_option fill_opt groupby_opt having_opt orderby_opt slimit_opt limit_opt */
   251,  /* (168) select ::= LP select RP */
   267,  /* (169) union ::= select */
   267,  /* (170) union ::= union UNION ALL select */
   202,  /* (171) cmd ::= union */
   251,  /* (172) select ::= SELECT selcollist */
   268,  /* (173) sclp ::= selcollist COMMA */
   268,  /* (174) sclp ::= */
   254,  /* (175) selcollist ::= sclp distinct expr as */
   254,  /* (176) selcollist ::= sclp STAR */
   271,  /* (177) as ::= AS ids */
   271,  /* (178) as ::= ids */
   271,  /* (179) as ::= */
   269,  /* (180) distinct ::= DISTINCT */
   269,  /* (181) distinct ::= */
   255,  /* (182) from ::= FROM tablelist */
   255,  /* (183) from ::= FROM sub */
   273,  /* (184) sub ::= LP union RP */
   273,  /* (185) sub ::= LP union RP ids */
   273,  /* (186) sub ::= sub COMMA LP union RP ids */
   272,  /* (187) tablelist ::= ids cpxName */
   272,  /* (188) tablelist ::= ids cpxName ids */
   272,  /* (189) tablelist ::= tablelist COMMA ids cpxName */
   272,  /* (190) tablelist ::= tablelist COMMA ids cpxName ids */
   274,  /* (191) tmvar ::= VARIABLE */
   257,  /* (192) interval_option ::= intervalKey LP tmvar RP */
   257,  /* (193) interval_option ::= intervalKey LP tmvar COMMA tmvar RP */
   257,  /* (194) interval_option ::= */
   275,  /* (195) intervalKey ::= INTERVAL */
   275,  /* (196) intervalKey ::= EVERY */
   259,  /* (197) session_option ::= */
   259,  /* (198) session_option ::= SESSION LP ids cpxName COMMA tmvar RP */
   260,  /* (199) windowstate_option ::= */
   260,  /* (200) windowstate_option ::= STATE_WINDOW LP ids RP */
   261,  /* (201) fill_opt ::= */
   261,  /* (202) fill_opt ::= FILL LP ID COMMA tagitemlist RP */
   261,  /* (203) fill_opt ::= FILL LP ID RP */
   258,  /* (204) sliding_opt ::= SLIDING LP tmvar RP */
   258,  /* (205) sliding_opt ::= */
   264,  /* (206) orderby_opt ::= */
   264,  /* (207) orderby_opt ::= ORDER BY sortlist */
   276,  /* (208) sortlist ::= sortlist COMMA item sortorder */
   276,  /* (209) sortlist ::= sortlist COMMA arrow sortorder */
   276,  /* (210) sortlist ::= item sortorder */
   276,  /* (211) sortlist ::= arrow sortorder */
   277,  /* (212) item ::= ID */
   277,  /* (213) item ::= ID DOT ID */
   278,  /* (214) sortorder ::= ASC */
   278,  /* (215) sortorder ::= DESC */
   278,  /* (216) sortorder ::= */
   262,  /* (217) groupby_opt ::= */
   262,  /* (218) groupby_opt ::= GROUP BY grouplist */
   280,  /* (219) grouplist ::= grouplist COMMA item */
   280,  /* (220) grouplist ::= grouplist COMMA arrow */
   280,  /* (221) grouplist ::= item */
   280,  /* (222) grouplist ::= arrow */
   263,  /* (223) having_opt ::= */
   263,  /* (224) having_opt ::= HAVING expr */
   266,  /* (225) limit_opt ::= */
   266,  /* (226) limit_opt ::= LIMIT signed */
   266,  /* (227) limit_opt ::= LIMIT signed OFFSET signed */
   266,  /* (228) limit_opt ::= LIMIT signed COMMA signed */
   265,  /* (229) slimit_opt ::= */
   265,  /* (230) slimit_opt ::= SLIMIT signed */
   265,  /* (231) slimit_opt ::= SLIMIT signed SOFFSET signed */
   265,  /* (232) slimit_opt ::= SLIMIT signed COMMA signed */
   256,  /* (233) where_opt ::= */
   256,  /* (234) where_opt ::= WHERE expr */
   270,  /* (235) expr ::= LP expr RP */
   270,  /* (236) expr ::= ID */
   270,  /* (237) expr ::= ID DOT ID */
   270,  /* (238) expr ::= ID DOT STAR */
   270,  /* (239) expr ::= INTEGER */
   270,  /* (240) expr ::= MINUS INTEGER */
   270,  /* (241) expr ::= PLUS INTEGER */
   270,  /* (242) expr ::= FLOAT */
   270,  /* (243) expr ::= MINUS FLOAT */
   270,  /* (244) expr ::= PLUS FLOAT */
   270,  /* (245) expr ::= STRING */
   270,  /* (246) expr ::= NOW */
   270,  /* (247) expr ::= VARIABLE */
   270,  /* (248) expr ::= PLUS VARIABLE */
   270,  /* (249) expr ::= MINUS VARIABLE */
   270,  /* (250) expr ::= BOOL */
   270,  /* (251) expr ::= NULL */
   270,  /* (252) expr ::= ID LP exprlist RP */
   270,  /* (253) expr ::= ID LP STAR RP */
   270,  /* (254) expr ::= expr IS NULL */
   270,  /* (255) expr ::= expr IS NOT NULL */
   270,  /* (256) expr ::= expr LT expr */
   270,  /* (257) expr ::= expr GT expr */
   270,  /* (258) expr ::= expr LE expr */
   270,  /* (259) expr ::= expr GE expr */
   270,  /* (260) expr ::= expr NE expr */
   270,  /* (261) expr ::= expr EQ expr */
   270,  /* (262) expr ::= expr BETWEEN expr AND expr */
   270,  /* (263) expr ::= expr AND expr */
   270,  /* (264) expr ::= expr OR expr */
   270,  /* (265) expr ::= expr PLUS expr */
   270,  /* (266) expr ::= expr MINUS expr */
   270,  /* (267) expr ::= expr STAR expr */
   270,  /* (268) expr ::= expr SLASH expr */
   270,  /* (269) expr ::= expr REM expr */
   270,  /* (270) expr ::= expr LIKE expr */
   270,  /* (271) expr ::= expr MATCH expr */
   270,  /* (272) expr ::= expr NMATCH expr */
   270,  /* (273) expr ::= ID QUESTION STRING */
   279,  /* (274) arrow ::= ID ARROW STRING */
   279,  /* (275) arrow ::= ID DOT ID ARROW STRING */
   270,  /* (276) expr ::= arrow */
   270,  /* (277) expr ::= expr IN LP exprlist RP */
   210,  /* (278) exprlist ::= exprlist COMMA expritem */
   210,  /* (279) exprlist ::= expritem */
   281,  /* (280) expritem ::= expr */
   281,  /* (281) expritem ::= */
   202,  /* (282) cmd ::= RESET QUERY CACHE */
   202,  /* (283) cmd ::= SYNCDB ids REPLICA */
   202,  /* (284) cmd ::= ALTER TABLE ids cpxName ADD COLUMN columnlist */
   202,  /* (285) cmd ::= ALTER TABLE ids cpxName DROP COLUMN ids */
   202,  /* (286) cmd ::= ALTER TABLE ids cpxName MODIFY COLUMN columnlist */
   202,  /* (287) cmd ::= ALTER TABLE ids cpxName ADD TAG columnlist */
   202,  /* (288) cmd ::= ALTER TABLE ids cpxName DROP TAG ids */
   202,  /* (289) cmd ::= ALTER TABLE ids cpxName CHANGE TAG ids ids */
   202,  /* (290) cmd ::= ALTER TABLE ids cpxName SET TAG ids EQ tagitem */
   202,  /* (291) cmd ::= ALTER TABLE ids cpxName MODIFY TAG columnlist */
   202,  /* (292) cmd ::= ALTER STABLE ids cpxName ADD COLUMN columnlist */
   202,  /* (293) cmd ::= ALTER STABLE ids cpxName DROP COLUMN ids */
   202,  /* (294) cmd ::= ALTER STABLE ids cpxName MODIFY COLUMN columnlist */
   202,  /* (295) cmd ::= ALTER STABLE ids cpxName ADD TAG columnlist */
   202,  /* (296) cmd ::= ALTER STABLE ids cpxName DROP TAG ids */
   202,  /* (297) cmd ::= ALTER STABLE ids cpxName CHANGE TAG ids ids */
   202,  /* (298) cmd ::= ALTER STABLE ids cpxName SET TAG ids EQ tagitem */
   202,  /* (299) cmd ::= ALTER STABLE ids cpxName MODIFY TAG columnlist */
   202,  /* (300) cmd ::= KILL CONNECTION INTEGER */
   202,  /* (301) cmd ::= KILL STREAM INTEGER COLON INTEGER */
   202,  /* (302) 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 */
   -4,  /* (29) cmd ::= SHOW dbPrefix VGROUPS ids */
   -5,  /* (30) cmd ::= DROP TABLE ifexists ids cpxName */
   -5,  /* (31) cmd ::= DROP STABLE ifexists ids cpxName */
   -4,  /* (32) cmd ::= DROP DATABASE ifexists ids */
   -4,  /* (33) cmd ::= DROP TOPIC ifexists ids */
   -3,  /* (34) cmd ::= DROP FUNCTION ids */
   -3,  /* (35) cmd ::= DROP DNODE ids */
   -3,  /* (36) cmd ::= DROP USER ids */
   -3,  /* (37) cmd ::= DROP ACCOUNT ids */
   -2,  /* (38) cmd ::= USE ids */
   -3,  /* (39) cmd ::= DESCRIBE ids cpxName */
   -3,  /* (40) cmd ::= DESC ids cpxName */
   -5,  /* (41) cmd ::= ALTER USER ids PASS ids */
   -5,  /* (42) cmd ::= ALTER USER ids PRIVILEGE ids */
   -4,  /* (43) cmd ::= ALTER DNODE ids ids */
   -5,  /* (44) cmd ::= ALTER DNODE ids ids ids */
   -3,  /* (45) cmd ::= ALTER LOCAL ids */
   -4,  /* (46) cmd ::= ALTER LOCAL ids ids */
   -4,  /* (47) cmd ::= ALTER DATABASE ids alter_db_optr */
   -4,  /* (48) cmd ::= ALTER TOPIC ids alter_topic_optr */
   -4,  /* (49) cmd ::= ALTER ACCOUNT ids acct_optr */
   -6,  /* (50) cmd ::= ALTER ACCOUNT ids PASS ids acct_optr */
   -6,  /* (51) cmd ::= COMPACT VNODES IN LP exprlist RP */
   -1,  /* (52) ids ::= ID */
   -1,  /* (53) ids ::= STRING */
   -2,  /* (54) ifexists ::= IF EXISTS */
    0,  /* (55) ifexists ::= */
   -3,  /* (56) ifnotexists ::= IF NOT EXISTS */
    0,  /* (57) ifnotexists ::= */
   -3,  /* (58) cmd ::= CREATE DNODE ids */
   -6,  /* (59) cmd ::= CREATE ACCOUNT ids PASS ids acct_optr */
   -5,  /* (60) cmd ::= CREATE DATABASE ifnotexists ids db_optr */
   -5,  /* (61) cmd ::= CREATE TOPIC ifnotexists ids topic_optr */
   -8,  /* (62) cmd ::= CREATE FUNCTION ids AS ids OUTPUTTYPE typename bufsize */
   -9,  /* (63) cmd ::= CREATE AGGREGATE FUNCTION ids AS ids OUTPUTTYPE typename bufsize */
   -5,  /* (64) cmd ::= CREATE USER ids PASS ids */
    0,  /* (65) bufsize ::= */
   -2,  /* (66) bufsize ::= BUFSIZE INTEGER */
    0,  /* (67) pps ::= */
   -2,  /* (68) pps ::= PPS INTEGER */
    0,  /* (69) tseries ::= */
   -2,  /* (70) tseries ::= TSERIES INTEGER */
    0,  /* (71) dbs ::= */
   -2,  /* (72) dbs ::= DBS INTEGER */
    0,  /* (73) streams ::= */
   -2,  /* (74) streams ::= STREAMS INTEGER */
    0,  /* (75) storage ::= */
   -2,  /* (76) storage ::= STORAGE INTEGER */
    0,  /* (77) qtime ::= */
   -2,  /* (78) qtime ::= QTIME INTEGER */
    0,  /* (79) users ::= */
   -2,  /* (80) users ::= USERS INTEGER */
    0,  /* (81) conns ::= */
   -2,  /* (82) conns ::= CONNS INTEGER */
    0,  /* (83) state ::= */
   -2,  /* (84) state ::= STATE ids */
   -9,  /* (85) acct_optr ::= pps tseries storage streams qtime dbs users conns state */
   -3,  /* (86) intitemlist ::= intitemlist COMMA intitem */
   -1,  /* (87) intitemlist ::= intitem */
   -1,  /* (88) intitem ::= INTEGER */
   -2,  /* (89) keep ::= KEEP intitemlist */
   -2,  /* (90) cache ::= CACHE INTEGER */
   -2,  /* (91) replica ::= REPLICA INTEGER */
   -2,  /* (92) quorum ::= QUORUM INTEGER */
   -2,  /* (93) days ::= DAYS INTEGER */
   -2,  /* (94) minrows ::= MINROWS INTEGER */
   -2,  /* (95) maxrows ::= MAXROWS INTEGER */
   -2,  /* (96) blocks ::= BLOCKS INTEGER */
   -2,  /* (97) ctime ::= CTIME INTEGER */
   -2,  /* (98) wal ::= WAL INTEGER */
   -2,  /* (99) fsync ::= FSYNC INTEGER */
   -2,  /* (100) comp ::= COMP INTEGER */
   -2,  /* (101) prec ::= PRECISION STRING */
   -2,  /* (102) update ::= UPDATE INTEGER */
   -2,  /* (103) cachelast ::= CACHELAST INTEGER */
   -2,  /* (104) partitions ::= PARTITIONS INTEGER */
    0,  /* (105) db_optr ::= */
   -2,  /* (106) db_optr ::= db_optr cache */
   -2,  /* (107) db_optr ::= db_optr replica */
   -2,  /* (108) db_optr ::= db_optr quorum */
   -2,  /* (109) db_optr ::= db_optr days */
   -2,  /* (110) db_optr ::= db_optr minrows */
   -2,  /* (111) db_optr ::= db_optr maxrows */
   -2,  /* (112) db_optr ::= db_optr blocks */
   -2,  /* (113) db_optr ::= db_optr ctime */
   -2,  /* (114) db_optr ::= db_optr wal */
   -2,  /* (115) db_optr ::= db_optr fsync */
   -2,  /* (116) db_optr ::= db_optr comp */
   -2,  /* (117) db_optr ::= db_optr prec */
   -2,  /* (118) db_optr ::= db_optr keep */
   -2,  /* (119) db_optr ::= db_optr update */
   -2,  /* (120) db_optr ::= db_optr cachelast */
   -1,  /* (121) topic_optr ::= db_optr */
   -2,  /* (122) topic_optr ::= topic_optr partitions */
    0,  /* (123) alter_db_optr ::= */
   -2,  /* (124) alter_db_optr ::= alter_db_optr replica */
   -2,  /* (125) alter_db_optr ::= alter_db_optr quorum */
   -2,  /* (126) alter_db_optr ::= alter_db_optr keep */
   -2,  /* (127) alter_db_optr ::= alter_db_optr blocks */
   -2,  /* (128) alter_db_optr ::= alter_db_optr comp */
   -2,  /* (129) alter_db_optr ::= alter_db_optr update */
   -2,  /* (130) alter_db_optr ::= alter_db_optr cachelast */
   -1,  /* (131) alter_topic_optr ::= alter_db_optr */
   -2,  /* (132) alter_topic_optr ::= alter_topic_optr partitions */
   -1,  /* (133) typename ::= ids */
   -4,  /* (134) typename ::= ids LP signed RP */
   -2,  /* (135) typename ::= ids UNSIGNED */
   -1,  /* (136) signed ::= INTEGER */
   -2,  /* (137) signed ::= PLUS INTEGER */
   -2,  /* (138) signed ::= MINUS INTEGER */
   -3,  /* (139) cmd ::= CREATE TABLE create_table_args */
   -3,  /* (140) cmd ::= CREATE TABLE create_stable_args */
   -3,  /* (141) cmd ::= CREATE STABLE create_stable_args */
   -3,  /* (142) cmd ::= CREATE TABLE create_table_list */
   -1,  /* (143) create_table_list ::= create_from_stable */
   -2,  /* (144) create_table_list ::= create_table_list create_from_stable */
   -6,  /* (145) create_table_args ::= ifnotexists ids cpxName LP columnlist RP */
  -10,  /* (146) create_stable_args ::= ifnotexists ids cpxName LP columnlist RP TAGS LP columnlist RP */
  -10,  /* (147) create_from_stable ::= ifnotexists ids cpxName USING ids cpxName TAGS LP tagitemlist RP */
  -13,  /* (148) create_from_stable ::= ifnotexists ids cpxName USING ids cpxName LP tagNamelist RP TAGS LP tagitemlist RP */
   -3,  /* (149) tagNamelist ::= tagNamelist COMMA ids */
   -1,  /* (150) tagNamelist ::= ids */
   -5,  /* (151) create_table_args ::= ifnotexists ids cpxName AS select */
   -3,  /* (152) columnlist ::= columnlist COMMA column */
   -1,  /* (153) columnlist ::= column */
   -2,  /* (154) column ::= ids typename */
   -3,  /* (155) tagitemlist ::= tagitemlist COMMA tagitem */
   -1,  /* (156) tagitemlist ::= tagitem */
   -1,  /* (157) tagitem ::= INTEGER */
   -1,  /* (158) tagitem ::= FLOAT */
   -1,  /* (159) tagitem ::= STRING */
   -1,  /* (160) tagitem ::= BOOL */
   -1,  /* (161) tagitem ::= NULL */
   -1,  /* (162) tagitem ::= NOW */
   -2,  /* (163) tagitem ::= MINUS INTEGER */
   -2,  /* (164) tagitem ::= MINUS FLOAT */
   -2,  /* (165) tagitem ::= PLUS INTEGER */
   -2,  /* (166) tagitem ::= PLUS FLOAT */
  -14,  /* (167) select ::= SELECT selcollist from where_opt interval_option sliding_opt session_option windowstate_option fill_opt groupby_opt having_opt orderby_opt slimit_opt limit_opt */
   -3,  /* (168) select ::= LP select RP */
   -1,  /* (169) union ::= select */
   -4,  /* (170) union ::= union UNION ALL select */
   -1,  /* (171) cmd ::= union */
   -2,  /* (172) select ::= SELECT selcollist */
   -2,  /* (173) sclp ::= selcollist COMMA */
    0,  /* (174) sclp ::= */
   -4,  /* (175) selcollist ::= sclp distinct expr as */
   -2,  /* (176) selcollist ::= sclp STAR */
   -2,  /* (177) as ::= AS ids */
   -1,  /* (178) as ::= ids */
    0,  /* (179) as ::= */
   -1,  /* (180) distinct ::= DISTINCT */
    0,  /* (181) distinct ::= */
   -2,  /* (182) from ::= FROM tablelist */
   -2,  /* (183) from ::= FROM sub */
   -3,  /* (184) sub ::= LP union RP */
   -4,  /* (185) sub ::= LP union RP ids */
   -6,  /* (186) sub ::= sub COMMA LP union RP ids */
   -2,  /* (187) tablelist ::= ids cpxName */
   -3,  /* (188) tablelist ::= ids cpxName ids */
   -4,  /* (189) tablelist ::= tablelist COMMA ids cpxName */
   -5,  /* (190) tablelist ::= tablelist COMMA ids cpxName ids */
   -1,  /* (191) tmvar ::= VARIABLE */
   -4,  /* (192) interval_option ::= intervalKey LP tmvar RP */
   -6,  /* (193) interval_option ::= intervalKey LP tmvar COMMA tmvar RP */
    0,  /* (194) interval_option ::= */
   -1,  /* (195) intervalKey ::= INTERVAL */
   -1,  /* (196) intervalKey ::= EVERY */
    0,  /* (197) session_option ::= */
   -7,  /* (198) session_option ::= SESSION LP ids cpxName COMMA tmvar RP */
    0,  /* (199) windowstate_option ::= */
   -4,  /* (200) windowstate_option ::= STATE_WINDOW LP ids RP */
    0,  /* (201) fill_opt ::= */
   -6,  /* (202) fill_opt ::= FILL LP ID COMMA tagitemlist RP */
   -4,  /* (203) fill_opt ::= FILL LP ID RP */
   -4,  /* (204) sliding_opt ::= SLIDING LP tmvar RP */
    0,  /* (205) sliding_opt ::= */
    0,  /* (206) orderby_opt ::= */
   -3,  /* (207) orderby_opt ::= ORDER BY sortlist */
   -4,  /* (208) sortlist ::= sortlist COMMA item sortorder */
   -4,  /* (209) sortlist ::= sortlist COMMA arrow sortorder */
   -2,  /* (210) sortlist ::= item sortorder */
   -2,  /* (211) sortlist ::= arrow sortorder */
   -1,  /* (212) item ::= ID */
   -3,  /* (213) item ::= ID DOT ID */
   -1,  /* (214) sortorder ::= ASC */
   -1,  /* (215) sortorder ::= DESC */
    0,  /* (216) sortorder ::= */
    0,  /* (217) groupby_opt ::= */
   -3,  /* (218) groupby_opt ::= GROUP BY grouplist */
   -3,  /* (219) grouplist ::= grouplist COMMA item */
   -3,  /* (220) grouplist ::= grouplist COMMA arrow */
   -1,  /* (221) grouplist ::= item */
   -1,  /* (222) grouplist ::= arrow */
    0,  /* (223) having_opt ::= */
   -2,  /* (224) having_opt ::= HAVING expr */
    0,  /* (225) limit_opt ::= */
   -2,  /* (226) limit_opt ::= LIMIT signed */
   -4,  /* (227) limit_opt ::= LIMIT signed OFFSET signed */
   -4,  /* (228) limit_opt ::= LIMIT signed COMMA signed */
    0,  /* (229) slimit_opt ::= */
   -2,  /* (230) slimit_opt ::= SLIMIT signed */
   -4,  /* (231) slimit_opt ::= SLIMIT signed SOFFSET signed */
   -4,  /* (232) slimit_opt ::= SLIMIT signed COMMA signed */
    0,  /* (233) where_opt ::= */
   -2,  /* (234) where_opt ::= WHERE expr */
   -3,  /* (235) expr ::= LP expr RP */
   -1,  /* (236) expr ::= ID */
   -3,  /* (237) expr ::= ID DOT ID */
   -3,  /* (238) expr ::= ID DOT STAR */
   -1,  /* (239) expr ::= INTEGER */
   -2,  /* (240) expr ::= MINUS INTEGER */
   -2,  /* (241) expr ::= PLUS INTEGER */
   -1,  /* (242) expr ::= FLOAT */
   -2,  /* (243) expr ::= MINUS FLOAT */
   -2,  /* (244) expr ::= PLUS FLOAT */
   -1,  /* (245) expr ::= STRING */
   -1,  /* (246) expr ::= NOW */
   -1,  /* (247) expr ::= VARIABLE */
   -2,  /* (248) expr ::= PLUS VARIABLE */
   -2,  /* (249) expr ::= MINUS VARIABLE */
   -1,  /* (250) expr ::= BOOL */
   -1,  /* (251) expr ::= NULL */
   -4,  /* (252) expr ::= ID LP exprlist RP */
   -4,  /* (253) expr ::= ID LP STAR RP */
   -3,  /* (254) expr ::= expr IS NULL */
   -4,  /* (255) expr ::= expr IS NOT NULL */
   -3,  /* (256) expr ::= expr LT expr */
   -3,  /* (257) expr ::= expr GT expr */
   -3,  /* (258) expr ::= expr LE expr */
   -3,  /* (259) expr ::= expr GE expr */
   -3,  /* (260) expr ::= expr NE expr */
   -3,  /* (261) expr ::= expr EQ expr */
   -5,  /* (262) expr ::= expr BETWEEN expr AND expr */
   -3,  /* (263) expr ::= expr AND expr */
   -3,  /* (264) expr ::= expr OR expr */
   -3,  /* (265) expr ::= expr PLUS expr */
   -3,  /* (266) expr ::= expr MINUS expr */
   -3,  /* (267) expr ::= expr STAR expr */
   -3,  /* (268) expr ::= expr SLASH expr */
   -3,  /* (269) expr ::= expr REM expr */
   -3,  /* (270) expr ::= expr LIKE expr */
   -3,  /* (271) expr ::= expr MATCH expr */
   -3,  /* (272) expr ::= expr NMATCH expr */
   -3,  /* (273) expr ::= ID QUESTION STRING */
   -3,  /* (274) arrow ::= ID ARROW STRING */
   -5,  /* (275) arrow ::= ID DOT ID ARROW STRING */
   -1,  /* (276) expr ::= arrow */
   -5,  /* (277) expr ::= expr IN LP exprlist RP */
   -3,  /* (278) exprlist ::= exprlist COMMA expritem */
   -1,  /* (279) exprlist ::= expritem */
   -1,  /* (280) expritem ::= expr */
    0,  /* (281) expritem ::= */
   -3,  /* (282) cmd ::= RESET QUERY CACHE */
   -3,  /* (283) cmd ::= SYNCDB ids REPLICA */
   -7,  /* (284) cmd ::= ALTER TABLE ids cpxName ADD COLUMN columnlist */
   -7,  /* (285) cmd ::= ALTER TABLE ids cpxName DROP COLUMN ids */
   -7,  /* (286) cmd ::= ALTER TABLE ids cpxName MODIFY COLUMN columnlist */
   -7,  /* (287) cmd ::= ALTER TABLE ids cpxName ADD TAG columnlist */
   -7,  /* (288) cmd ::= ALTER TABLE ids cpxName DROP TAG ids */
   -8,  /* (289) cmd ::= ALTER TABLE ids cpxName CHANGE TAG ids ids */
   -9,  /* (290) cmd ::= ALTER TABLE ids cpxName SET TAG ids EQ tagitem */
   -7,  /* (291) cmd ::= ALTER TABLE ids cpxName MODIFY TAG columnlist */
   -7,  /* (292) cmd ::= ALTER STABLE ids cpxName ADD COLUMN columnlist */
   -7,  /* (293) cmd ::= ALTER STABLE ids cpxName DROP COLUMN ids */
   -7,  /* (294) cmd ::= ALTER STABLE ids cpxName MODIFY COLUMN columnlist */
   -7,  /* (295) cmd ::= ALTER STABLE ids cpxName ADD TAG columnlist */
   -7,  /* (296) cmd ::= ALTER STABLE ids cpxName DROP TAG ids */
   -8,  /* (297) cmd ::= ALTER STABLE ids cpxName CHANGE TAG ids ids */
   -9,  /* (298) cmd ::= ALTER STABLE ids cpxName SET TAG ids EQ tagitem */
   -7,  /* (299) cmd ::= ALTER STABLE ids cpxName MODIFY TAG columnlist */
   -3,  /* (300) cmd ::= KILL CONNECTION INTEGER */
   -5,  /* (301) cmd ::= KILL STREAM INTEGER COLON INTEGER */
   -5,  /* (302) 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 139: /* cmd ::= CREATE TABLE create_table_args */ yytestcase(yyruleno==139);
      case 140: /* cmd ::= CREATE TABLE create_stable_args */ yytestcase(yyruleno==140);
      case 141: /* cmd ::= CREATE STABLE create_stable_args */ yytestcase(yyruleno==141);
#line 64 "sql.y"
{}
#line 2753 "sql.c"
        break;
      case 1: /* cmd ::= SHOW DATABASES */
#line 67 "sql.y"
{ setShowOptions(pInfo, TSDB_MGMT_TABLE_DB, 0, 0);}
#line 2758 "sql.c"
        break;
      case 2: /* cmd ::= SHOW TOPICS */
#line 68 "sql.y"
{ setShowOptions(pInfo, TSDB_MGMT_TABLE_TP, 0, 0);}
#line 2763 "sql.c"
        break;
      case 3: /* cmd ::= SHOW FUNCTIONS */
#line 69 "sql.y"
{ setShowOptions(pInfo, TSDB_MGMT_TABLE_FUNCTION, 0, 0);}
#line 2768 "sql.c"
        break;
      case 4: /* cmd ::= SHOW MNODES */
#line 70 "sql.y"
{ setShowOptions(pInfo, TSDB_MGMT_TABLE_MNODE, 0, 0);}
#line 2773 "sql.c"
        break;
      case 5: /* cmd ::= SHOW DNODES */
#line 71 "sql.y"
{ setShowOptions(pInfo, TSDB_MGMT_TABLE_DNODE, 0, 0);}
#line 2778 "sql.c"
        break;
      case 6: /* cmd ::= SHOW ACCOUNTS */
#line 72 "sql.y"
{ setShowOptions(pInfo, TSDB_MGMT_TABLE_ACCT, 0, 0);}
#line 2783 "sql.c"
        break;
      case 7: /* cmd ::= SHOW USERS */
#line 73 "sql.y"
{ setShowOptions(pInfo, TSDB_MGMT_TABLE_USER, 0, 0);}
#line 2788 "sql.c"
        break;
      case 8: /* cmd ::= SHOW MODULES */
#line 75 "sql.y"
{ setShowOptions(pInfo, TSDB_MGMT_TABLE_MODULE, 0, 0);  }
#line 2793 "sql.c"
        break;
      case 9: /* cmd ::= SHOW QUERIES */
#line 76 "sql.y"
{ setShowOptions(pInfo, TSDB_MGMT_TABLE_QUERIES, 0, 0);  }
#line 2798 "sql.c"
        break;
      case 10: /* cmd ::= SHOW CONNECTIONS */
#line 77 "sql.y"
{ setShowOptions(pInfo, TSDB_MGMT_TABLE_CONNS, 0, 0);}
#line 2803 "sql.c"
        break;
      case 11: /* cmd ::= SHOW STREAMS */
#line 78 "sql.y"
{ setShowOptions(pInfo, TSDB_MGMT_TABLE_STREAMS, 0, 0);  }
#line 2808 "sql.c"
        break;
      case 12: /* cmd ::= SHOW VARIABLES */
#line 79 "sql.y"
{ setShowOptions(pInfo, TSDB_MGMT_TABLE_VARIABLES, 0, 0);  }
#line 2813 "sql.c"
        break;
      case 13: /* cmd ::= SHOW SCORES */
#line 80 "sql.y"
{ setShowOptions(pInfo, TSDB_MGMT_TABLE_SCORES, 0, 0);   }
#line 2818 "sql.c"
        break;
      case 14: /* cmd ::= SHOW GRANTS */
#line 81 "sql.y"
{ setShowOptions(pInfo, TSDB_MGMT_TABLE_GRANTS, 0, 0);   }
#line 2823 "sql.c"
        break;
      case 15: /* cmd ::= SHOW VNODES */
#line 83 "sql.y"
{ setShowOptions(pInfo, TSDB_MGMT_TABLE_VNODES, 0, 0); }
#line 2828 "sql.c"
        break;
      case 16: /* cmd ::= SHOW VNODES ids */
#line 84 "sql.y"
{ setShowOptions(pInfo, TSDB_MGMT_TABLE_VNODES, &yymsp[0].minor.yy0, 0); }
#line 2833 "sql.c"
        break;
      case 17: /* dbPrefix ::= */
#line 88 "sql.y"
{yymsp[1].minor.yy0.n = 0; yymsp[1].minor.yy0.type = 0;}
#line 2838 "sql.c"
        break;
      case 18: /* dbPrefix ::= ids DOT */
#line 89 "sql.y"
{yylhsminor.yy0 = yymsp[-1].minor.yy0;  }
#line 2843 "sql.c"
  yymsp[-1].minor.yy0 = yylhsminor.yy0;
        break;
      case 19: /* cpxName ::= */
#line 92 "sql.y"
{yymsp[1].minor.yy0.n = 0;  }
#line 2849 "sql.c"
        break;
      case 20: /* cpxName ::= DOT ids */
#line 93 "sql.y"
{yymsp[-1].minor.yy0 = yymsp[0].minor.yy0; yymsp[-1].minor.yy0.n += 1;    }
#line 2854 "sql.c"
        break;
      case 21: /* cmd ::= SHOW CREATE TABLE ids cpxName */
#line 94 "sql.y"
{
   yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n;
   setDCLSqlElems(pInfo, TSDB_SQL_SHOW_CREATE_TABLE, 1, &yymsp[-1].minor.yy0);
}
#line 2862 "sql.c"
        break;
      case 22: /* cmd ::= SHOW CREATE STABLE ids cpxName */
#line 98 "sql.y"
{
   yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n;
   setDCLSqlElems(pInfo, TSDB_SQL_SHOW_CREATE_STABLE, 1, &yymsp[-1].minor.yy0);
}
#line 2870 "sql.c"
        break;
      case 23: /* cmd ::= SHOW CREATE DATABASE ids */
#line 103 "sql.y"
{
  setDCLSqlElems(pInfo, TSDB_SQL_SHOW_CREATE_DATABASE, 1, &yymsp[0].minor.yy0);
}
#line 2877 "sql.c"
        break;
      case 24: /* cmd ::= SHOW dbPrefix TABLES */
#line 107 "sql.y"
{
    setShowOptions(pInfo, TSDB_MGMT_TABLE_TABLE, &yymsp[-1].minor.yy0, 0);
}
#line 2884 "sql.c"
        break;
      case 25: /* cmd ::= SHOW dbPrefix TABLES LIKE ids */
#line 111 "sql.y"
{
    setShowOptions(pInfo, TSDB_MGMT_TABLE_TABLE, &yymsp[-3].minor.yy0, &yymsp[0].minor.yy0);
}
#line 2891 "sql.c"
        break;
      case 26: /* cmd ::= SHOW dbPrefix STABLES */
#line 115 "sql.y"
{
    setShowOptions(pInfo, TSDB_MGMT_TABLE_METRIC, &yymsp[-1].minor.yy0, 0);
}
#line 2898 "sql.c"
        break;
      case 27: /* cmd ::= SHOW dbPrefix STABLES LIKE ids */
#line 119 "sql.y"
{
    SStrToken token;
    tSetDbName(&token, &yymsp[-3].minor.yy0);
    setShowOptions(pInfo, TSDB_MGMT_TABLE_METRIC, &token, &yymsp[0].minor.yy0);
}
#line 2907 "sql.c"
        break;
      case 28: /* cmd ::= SHOW dbPrefix VGROUPS */
#line 125 "sql.y"
{
    SStrToken token;
    tSetDbName(&token, &yymsp[-1].minor.yy0);
    setShowOptions(pInfo, TSDB_MGMT_TABLE_VGROUP, &token, 0);
}
#line 2916 "sql.c"
        break;
      case 29: /* cmd ::= SHOW dbPrefix VGROUPS ids */
#line 131 "sql.y"
{
    SStrToken token;
    tSetDbName(&token, &yymsp[-2].minor.yy0);
    setShowOptions(pInfo, TSDB_MGMT_TABLE_VGROUP, &token, &yymsp[0].minor.yy0);
}
#line 2925 "sql.c"
        break;
      case 30: /* cmd ::= DROP TABLE ifexists ids cpxName */
#line 138 "sql.y"
{
    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);
}
#line 2933 "sql.c"
        break;
      case 31: /* cmd ::= DROP STABLE ifexists ids cpxName */
#line 144 "sql.y"
{
    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);
}
#line 2941 "sql.c"
        break;
      case 32: /* cmd ::= DROP DATABASE ifexists ids */
#line 149 "sql.y"
{ setDropDbTableInfo(pInfo, TSDB_SQL_DROP_DB, &yymsp[0].minor.yy0, &yymsp[-1].minor.yy0, TSDB_DB_TYPE_DEFAULT, -1); }
#line 2946 "sql.c"
        break;
      case 33: /* cmd ::= DROP TOPIC ifexists ids */
#line 150 "sql.y"
{ setDropDbTableInfo(pInfo, TSDB_SQL_DROP_DB, &yymsp[0].minor.yy0, &yymsp[-1].minor.yy0, TSDB_DB_TYPE_TOPIC, -1); }
#line 2951 "sql.c"
        break;
      case 34: /* cmd ::= DROP FUNCTION ids */
#line 151 "sql.y"
{ setDropFuncInfo(pInfo, TSDB_SQL_DROP_FUNCTION, &yymsp[0].minor.yy0); }
#line 2956 "sql.c"
        break;
      case 35: /* cmd ::= DROP DNODE ids */
#line 153 "sql.y"
{ setDCLSqlElems(pInfo, TSDB_SQL_DROP_DNODE, 1, &yymsp[0].minor.yy0);    }
#line 2961 "sql.c"
        break;
      case 36: /* cmd ::= DROP USER ids */
#line 154 "sql.y"
{ setDCLSqlElems(pInfo, TSDB_SQL_DROP_USER, 1, &yymsp[0].minor.yy0);     }
#line 2966 "sql.c"
        break;
      case 37: /* cmd ::= DROP ACCOUNT ids */
#line 155 "sql.y"
{ setDCLSqlElems(pInfo, TSDB_SQL_DROP_ACCT, 1, &yymsp[0].minor.yy0);  }
#line 2971 "sql.c"
        break;
      case 38: /* cmd ::= USE ids */
#line 158 "sql.y"
{ setDCLSqlElems(pInfo, TSDB_SQL_USE_DB, 1, &yymsp[0].minor.yy0);}
#line 2976 "sql.c"
        break;
      case 39: /* cmd ::= DESCRIBE ids cpxName */
      case 40: /* cmd ::= DESC ids cpxName */ yytestcase(yyruleno==40);
#line 161 "sql.y"
{
    yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n;
    setDCLSqlElems(pInfo, TSDB_SQL_DESCRIBE_TABLE, 1, &yymsp[-1].minor.yy0);
}
#line 2985 "sql.c"
        break;
      case 41: /* cmd ::= ALTER USER ids PASS ids */
#line 171 "sql.y"
{ setAlterUserSql(pInfo, TSDB_ALTER_USER_PASSWD, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, NULL);    }
#line 2990 "sql.c"
        break;
      case 42: /* cmd ::= ALTER USER ids PRIVILEGE ids */
#line 172 "sql.y"
{ setAlterUserSql(pInfo, TSDB_ALTER_USER_PRIVILEGES, &yymsp[-2].minor.yy0, NULL, &yymsp[0].minor.yy0);}
#line 2995 "sql.c"
        break;
      case 43: /* cmd ::= ALTER DNODE ids ids */
#line 173 "sql.y"
{ setDCLSqlElems(pInfo, TSDB_SQL_CFG_DNODE, 2, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0);          }
#line 3000 "sql.c"
        break;
      case 44: /* cmd ::= ALTER DNODE ids ids ids */
#line 174 "sql.y"
{ setDCLSqlElems(pInfo, TSDB_SQL_CFG_DNODE, 3, &yymsp[-2].minor.yy0, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0);      }
#line 3005 "sql.c"
        break;
      case 45: /* cmd ::= ALTER LOCAL ids */
#line 175 "sql.y"
{ setDCLSqlElems(pInfo, TSDB_SQL_CFG_LOCAL, 1, &yymsp[0].minor.yy0);              }
#line 3010 "sql.c"
        break;
      case 46: /* cmd ::= ALTER LOCAL ids ids */
#line 176 "sql.y"
{ setDCLSqlElems(pInfo, TSDB_SQL_CFG_LOCAL, 2, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0);          }
#line 3015 "sql.c"
        break;
      case 47: /* cmd ::= ALTER DATABASE ids alter_db_optr */
      case 48: /* cmd ::= ALTER TOPIC ids alter_topic_optr */ yytestcase(yyruleno==48);
#line 177 "sql.y"
{ SStrToken t = {0};  setCreateDbInfo(pInfo, TSDB_SQL_ALTER_DB, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy10, &t);}
#line 3021 "sql.c"
        break;
      case 49: /* cmd ::= ALTER ACCOUNT ids acct_optr */
#line 180 "sql.y"
{ setCreateAcctSql(pInfo, TSDB_SQL_ALTER_ACCT, &yymsp[-1].minor.yy0, NULL, &yymsp[0].minor.yy427);}
#line 3026 "sql.c"
        break;
      case 50: /* cmd ::= ALTER ACCOUNT ids PASS ids acct_optr */
#line 181 "sql.y"
{ setCreateAcctSql(pInfo, TSDB_SQL_ALTER_ACCT, &yymsp[-3].minor.yy0, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy427);}
#line 3031 "sql.c"
        break;
      case 51: /* cmd ::= COMPACT VNODES IN LP exprlist RP */
#line 185 "sql.y"
{ setCompactVnodeSql(pInfo, TSDB_SQL_COMPACT_VNODE, yymsp[-1].minor.yy345);}
#line 3036 "sql.c"
        break;
      case 52: /* ids ::= ID */
      case 53: /* ids ::= STRING */ yytestcase(yyruleno==53);
#line 191 "sql.y"
{yylhsminor.yy0 = yymsp[0].minor.yy0; }
#line 3042 "sql.c"
  yymsp[0].minor.yy0 = yylhsminor.yy0;
        break;
      case 54: /* ifexists ::= IF EXISTS */
#line 195 "sql.y"
{ yymsp[-1].minor.yy0.n = 1;}
#line 3048 "sql.c"
        break;
      case 55: /* ifexists ::= */
      case 57: /* ifnotexists ::= */ yytestcase(yyruleno==57);
      case 181: /* distinct ::= */ yytestcase(yyruleno==181);
#line 196 "sql.y"
{ yymsp[1].minor.yy0.n = 0;}
#line 3055 "sql.c"
        break;
      case 56: /* ifnotexists ::= IF NOT EXISTS */
#line 199 "sql.y"
{ yymsp[-2].minor.yy0.n = 1;}
#line 3060 "sql.c"
        break;
      case 58: /* cmd ::= CREATE DNODE ids */
#line 204 "sql.y"
{ setDCLSqlElems(pInfo, TSDB_SQL_CREATE_DNODE, 1, &yymsp[0].minor.yy0);}
#line 3065 "sql.c"
        break;
      case 59: /* cmd ::= CREATE ACCOUNT ids PASS ids acct_optr */
#line 206 "sql.y"
{ setCreateAcctSql(pInfo, TSDB_SQL_CREATE_ACCT, &yymsp[-3].minor.yy0, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy427);}
#line 3070 "sql.c"
        break;
      case 60: /* cmd ::= CREATE DATABASE ifnotexists ids db_optr */
      case 61: /* cmd ::= CREATE TOPIC ifnotexists ids topic_optr */ yytestcase(yyruleno==61);
#line 207 "sql.y"
{ setCreateDbInfo(pInfo, TSDB_SQL_CREATE_DB, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy10, &yymsp[-2].minor.yy0);}
#line 3076 "sql.c"
        break;
      case 62: /* cmd ::= CREATE FUNCTION ids AS ids OUTPUTTYPE typename bufsize */
#line 209 "sql.y"
{ setCreateFuncInfo(pInfo, TSDB_SQL_CREATE_FUNCTION, &yymsp[-5].minor.yy0, &yymsp[-3].minor.yy0, &yymsp[-1].minor.yy487, &yymsp[0].minor.yy0, 1);}
#line 3081 "sql.c"
        break;
      case 63: /* cmd ::= CREATE AGGREGATE FUNCTION ids AS ids OUTPUTTYPE typename bufsize */
#line 210 "sql.y"
{ setCreateFuncInfo(pInfo, TSDB_SQL_CREATE_FUNCTION, &yymsp[-5].minor.yy0, &yymsp[-3].minor.yy0, &yymsp[-1].minor.yy487, &yymsp[0].minor.yy0, 2);}
#line 3086 "sql.c"
        break;
      case 64: /* cmd ::= CREATE USER ids PASS ids */
#line 211 "sql.y"
{ setCreateUserSql(pInfo, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0);}
#line 3091 "sql.c"
        break;
      case 65: /* bufsize ::= */
      case 67: /* pps ::= */ yytestcase(yyruleno==67);
      case 69: /* tseries ::= */ yytestcase(yyruleno==69);
      case 71: /* dbs ::= */ yytestcase(yyruleno==71);
      case 73: /* streams ::= */ yytestcase(yyruleno==73);
      case 75: /* storage ::= */ yytestcase(yyruleno==75);
      case 77: /* qtime ::= */ yytestcase(yyruleno==77);
      case 79: /* users ::= */ yytestcase(yyruleno==79);
      case 81: /* conns ::= */ yytestcase(yyruleno==81);
      case 83: /* state ::= */ yytestcase(yyruleno==83);
#line 213 "sql.y"
{ yymsp[1].minor.yy0.n = 0;   }
#line 3105 "sql.c"
        break;
      case 66: /* bufsize ::= BUFSIZE INTEGER */
      case 68: /* pps ::= PPS INTEGER */ yytestcase(yyruleno==68);
      case 70: /* tseries ::= TSERIES INTEGER */ yytestcase(yyruleno==70);
      case 72: /* dbs ::= DBS INTEGER */ yytestcase(yyruleno==72);
      case 74: /* streams ::= STREAMS INTEGER */ yytestcase(yyruleno==74);
      case 76: /* storage ::= STORAGE INTEGER */ yytestcase(yyruleno==76);
      case 78: /* qtime ::= QTIME INTEGER */ yytestcase(yyruleno==78);
      case 80: /* users ::= USERS INTEGER */ yytestcase(yyruleno==80);
      case 82: /* conns ::= CONNS INTEGER */ yytestcase(yyruleno==82);
      case 84: /* state ::= STATE ids */ yytestcase(yyruleno==84);
#line 214 "sql.y"
{ yymsp[-1].minor.yy0 = yymsp[0].minor.yy0;     }
#line 3119 "sql.c"
        break;
      case 85: /* acct_optr ::= pps tseries storage streams qtime dbs users conns state */
#line 244 "sql.y"
{
    yylhsminor.yy427.maxUsers   = (yymsp[-2].minor.yy0.n>0)?atoi(yymsp[-2].minor.yy0.z):-1;
    yylhsminor.yy427.maxDbs     = (yymsp[-3].minor.yy0.n>0)?atoi(yymsp[-3].minor.yy0.z):-1;
    yylhsminor.yy427.maxTimeSeries = (yymsp[-7].minor.yy0.n>0)?atoi(yymsp[-7].minor.yy0.z):-1;
    yylhsminor.yy427.maxStreams = (yymsp[-5].minor.yy0.n>0)?atoi(yymsp[-5].minor.yy0.z):-1;
    yylhsminor.yy427.maxPointsPerSecond     = (yymsp[-8].minor.yy0.n>0)?atoi(yymsp[-8].minor.yy0.z):-1;
    yylhsminor.yy427.maxStorage = (yymsp[-6].minor.yy0.n>0)?strtoll(yymsp[-6].minor.yy0.z, NULL, 10):-1;
    yylhsminor.yy427.maxQueryTime   = (yymsp[-4].minor.yy0.n>0)?strtoll(yymsp[-4].minor.yy0.z, NULL, 10):-1;
    yylhsminor.yy427.maxConnections   = (yymsp[-1].minor.yy0.n>0)?atoi(yymsp[-1].minor.yy0.z):-1;
    yylhsminor.yy427.stat    = yymsp[0].minor.yy0;
}
#line 3134 "sql.c"
  yymsp[-8].minor.yy427 = yylhsminor.yy427;
        break;
      case 86: /* intitemlist ::= intitemlist COMMA intitem */
      case 155: /* tagitemlist ::= tagitemlist COMMA tagitem */ yytestcase(yyruleno==155);
#line 260 "sql.y"
{ yylhsminor.yy345 = tVariantListAppend(yymsp[-2].minor.yy345, &yymsp[0].minor.yy2, -1);    }
#line 3141 "sql.c"
  yymsp[-2].minor.yy345 = yylhsminor.yy345;
        break;
      case 87: /* intitemlist ::= intitem */
      case 156: /* tagitemlist ::= tagitem */ yytestcase(yyruleno==156);
#line 261 "sql.y"
{ yylhsminor.yy345 = tVariantListAppend(NULL, &yymsp[0].minor.yy2, -1); }
#line 3148 "sql.c"
  yymsp[0].minor.yy345 = yylhsminor.yy345;
        break;
      case 88: /* intitem ::= INTEGER */
      case 157: /* tagitem ::= INTEGER */ yytestcase(yyruleno==157);
      case 158: /* tagitem ::= FLOAT */ yytestcase(yyruleno==158);
      case 159: /* tagitem ::= STRING */ yytestcase(yyruleno==159);
      case 160: /* tagitem ::= BOOL */ yytestcase(yyruleno==160);
      case 212: /* item ::= ID */ yytestcase(yyruleno==212);
#line 263 "sql.y"
{ toTSDBType(yymsp[0].minor.yy0.type); tVariantCreate(&yylhsminor.yy2, &yymsp[0].minor.yy0); }
#line 3159 "sql.c"
  yymsp[0].minor.yy2 = yylhsminor.yy2;
        break;
      case 89: /* keep ::= KEEP intitemlist */
#line 267 "sql.y"
{ yymsp[-1].minor.yy345 = yymsp[0].minor.yy345; }
#line 3165 "sql.c"
        break;
      case 90: /* cache ::= CACHE INTEGER */
      case 91: /* replica ::= REPLICA INTEGER */ yytestcase(yyruleno==91);
      case 92: /* quorum ::= QUORUM INTEGER */ yytestcase(yyruleno==92);
      case 93: /* days ::= DAYS INTEGER */ yytestcase(yyruleno==93);
      case 94: /* minrows ::= MINROWS INTEGER */ yytestcase(yyruleno==94);
      case 95: /* maxrows ::= MAXROWS INTEGER */ yytestcase(yyruleno==95);
      case 96: /* blocks ::= BLOCKS INTEGER */ yytestcase(yyruleno==96);
      case 97: /* ctime ::= CTIME INTEGER */ yytestcase(yyruleno==97);
      case 98: /* wal ::= WAL INTEGER */ yytestcase(yyruleno==98);
      case 99: /* fsync ::= FSYNC INTEGER */ yytestcase(yyruleno==99);
      case 100: /* comp ::= COMP INTEGER */ yytestcase(yyruleno==100);
      case 101: /* prec ::= PRECISION STRING */ yytestcase(yyruleno==101);
      case 102: /* update ::= UPDATE INTEGER */ yytestcase(yyruleno==102);
      case 103: /* cachelast ::= CACHELAST INTEGER */ yytestcase(yyruleno==103);
      case 104: /* partitions ::= PARTITIONS INTEGER */ yytestcase(yyruleno==104);
#line 269 "sql.y"
{ yymsp[-1].minor.yy0 = yymsp[0].minor.yy0; }
#line 3184 "sql.c"
        break;
      case 105: /* db_optr ::= */
#line 286 "sql.y"
{setDefaultCreateDbOption(&yymsp[1].minor.yy10); yymsp[1].minor.yy10.dbType = TSDB_DB_TYPE_DEFAULT;}
#line 3189 "sql.c"
        break;
      case 106: /* db_optr ::= db_optr cache */
#line 288 "sql.y"
{ yylhsminor.yy10 = yymsp[-1].minor.yy10; yylhsminor.yy10.cacheBlockSize = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
#line 3194 "sql.c"
  yymsp[-1].minor.yy10 = yylhsminor.yy10;
        break;
      case 107: /* db_optr ::= db_optr replica */
      case 124: /* alter_db_optr ::= alter_db_optr replica */ yytestcase(yyruleno==124);
#line 289 "sql.y"
{ yylhsminor.yy10 = yymsp[-1].minor.yy10; yylhsminor.yy10.replica = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
#line 3201 "sql.c"
  yymsp[-1].minor.yy10 = yylhsminor.yy10;
        break;
      case 108: /* db_optr ::= db_optr quorum */
      case 125: /* alter_db_optr ::= alter_db_optr quorum */ yytestcase(yyruleno==125);
#line 290 "sql.y"
{ yylhsminor.yy10 = yymsp[-1].minor.yy10; yylhsminor.yy10.quorum = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
#line 3208 "sql.c"
  yymsp[-1].minor.yy10 = yylhsminor.yy10;
        break;
      case 109: /* db_optr ::= db_optr days */
#line 291 "sql.y"
{ yylhsminor.yy10 = yymsp[-1].minor.yy10; yylhsminor.yy10.daysPerFile = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
#line 3214 "sql.c"
  yymsp[-1].minor.yy10 = yylhsminor.yy10;
        break;
      case 110: /* db_optr ::= db_optr minrows */
#line 292 "sql.y"
{ yylhsminor.yy10 = yymsp[-1].minor.yy10; yylhsminor.yy10.minRowsPerBlock = strtod(yymsp[0].minor.yy0.z, NULL); }
#line 3220 "sql.c"
  yymsp[-1].minor.yy10 = yylhsminor.yy10;
        break;
      case 111: /* db_optr ::= db_optr maxrows */
#line 293 "sql.y"
{ yylhsminor.yy10 = yymsp[-1].minor.yy10; yylhsminor.yy10.maxRowsPerBlock = strtod(yymsp[0].minor.yy0.z, NULL); }
#line 3226 "sql.c"
  yymsp[-1].minor.yy10 = yylhsminor.yy10;
        break;
      case 112: /* db_optr ::= db_optr blocks */
      case 127: /* alter_db_optr ::= alter_db_optr blocks */ yytestcase(yyruleno==127);
#line 294 "sql.y"
{ yylhsminor.yy10 = yymsp[-1].minor.yy10; yylhsminor.yy10.numOfBlocks = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
#line 3233 "sql.c"
  yymsp[-1].minor.yy10 = yylhsminor.yy10;
        break;
      case 113: /* db_optr ::= db_optr ctime */
#line 295 "sql.y"
{ yylhsminor.yy10 = yymsp[-1].minor.yy10; yylhsminor.yy10.commitTime = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
#line 3239 "sql.c"
  yymsp[-1].minor.yy10 = yylhsminor.yy10;
        break;
      case 114: /* db_optr ::= db_optr wal */
#line 296 "sql.y"
{ yylhsminor.yy10 = yymsp[-1].minor.yy10; yylhsminor.yy10.walLevel = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
#line 3245 "sql.c"
  yymsp[-1].minor.yy10 = yylhsminor.yy10;
        break;
      case 115: /* db_optr ::= db_optr fsync */
#line 297 "sql.y"
{ yylhsminor.yy10 = yymsp[-1].minor.yy10; yylhsminor.yy10.fsyncPeriod = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
#line 3251 "sql.c"
  yymsp[-1].minor.yy10 = yylhsminor.yy10;
        break;
      case 116: /* db_optr ::= db_optr comp */
      case 128: /* alter_db_optr ::= alter_db_optr comp */ yytestcase(yyruleno==128);
#line 298 "sql.y"
{ yylhsminor.yy10 = yymsp[-1].minor.yy10; yylhsminor.yy10.compressionLevel = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
#line 3258 "sql.c"
  yymsp[-1].minor.yy10 = yylhsminor.yy10;
        break;
      case 117: /* db_optr ::= db_optr prec */
#line 299 "sql.y"
{ yylhsminor.yy10 = yymsp[-1].minor.yy10; yylhsminor.yy10.precision = yymsp[0].minor.yy0; }
#line 3264 "sql.c"
  yymsp[-1].minor.yy10 = yylhsminor.yy10;
        break;
      case 118: /* db_optr ::= db_optr keep */
      case 126: /* alter_db_optr ::= alter_db_optr keep */ yytestcase(yyruleno==126);
#line 300 "sql.y"
{ yylhsminor.yy10 = yymsp[-1].minor.yy10; yylhsminor.yy10.keep = yymsp[0].minor.yy345; }
#line 3271 "sql.c"
  yymsp[-1].minor.yy10 = yylhsminor.yy10;
        break;
      case 119: /* db_optr ::= db_optr update */
      case 129: /* alter_db_optr ::= alter_db_optr update */ yytestcase(yyruleno==129);
#line 301 "sql.y"
{ yylhsminor.yy10 = yymsp[-1].minor.yy10; yylhsminor.yy10.update = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
#line 3278 "sql.c"
  yymsp[-1].minor.yy10 = yylhsminor.yy10;
        break;
      case 120: /* db_optr ::= db_optr cachelast */
      case 130: /* alter_db_optr ::= alter_db_optr cachelast */ yytestcase(yyruleno==130);
#line 302 "sql.y"
{ yylhsminor.yy10 = yymsp[-1].minor.yy10; yylhsminor.yy10.cachelast = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
#line 3285 "sql.c"
  yymsp[-1].minor.yy10 = yylhsminor.yy10;
        break;
      case 121: /* topic_optr ::= db_optr */
      case 131: /* alter_topic_optr ::= alter_db_optr */ yytestcase(yyruleno==131);
#line 306 "sql.y"
{ yylhsminor.yy10 = yymsp[0].minor.yy10; yylhsminor.yy10.dbType = TSDB_DB_TYPE_TOPIC; }
#line 3292 "sql.c"
  yymsp[0].minor.yy10 = yylhsminor.yy10;
        break;
      case 122: /* topic_optr ::= topic_optr partitions */
      case 132: /* alter_topic_optr ::= alter_topic_optr partitions */ yytestcase(yyruleno==132);
#line 307 "sql.y"
{ yylhsminor.yy10 = yymsp[-1].minor.yy10; yylhsminor.yy10.partitions = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
#line 3299 "sql.c"
  yymsp[-1].minor.yy10 = yylhsminor.yy10;
        break;
      case 123: /* alter_db_optr ::= */
#line 310 "sql.y"
{ setDefaultCreateDbOption(&yymsp[1].minor.yy10); yymsp[1].minor.yy10.dbType = TSDB_DB_TYPE_DEFAULT;}
#line 3305 "sql.c"
        break;
      case 133: /* typename ::= ids */
#line 330 "sql.y"
{
  yymsp[0].minor.yy0.type = 0;
  tSetColumnType (&yylhsminor.yy487, &yymsp[0].minor.yy0);
}
#line 3313 "sql.c"
  yymsp[0].minor.yy487 = yylhsminor.yy487;
        break;
      case 134: /* typename ::= ids LP signed RP */
#line 336 "sql.y"
{
  if (yymsp[-1].minor.yy525 <= 0) {
    yymsp[-3].minor.yy0.type = 0;
    tSetColumnType(&yylhsminor.yy487, &yymsp[-3].minor.yy0);
  } else {
    yymsp[-3].minor.yy0.type = -yymsp[-1].minor.yy525;  // negative value of name length
    tSetColumnType(&yylhsminor.yy487, &yymsp[-3].minor.yy0);
  }
}
#line 3327 "sql.c"
  yymsp[-3].minor.yy487 = yylhsminor.yy487;
        break;
      case 135: /* typename ::= ids UNSIGNED */
#line 347 "sql.y"
{
  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.yy487, &yymsp[-1].minor.yy0);
}
#line 3337 "sql.c"
  yymsp[-1].minor.yy487 = yylhsminor.yy487;
        break;
      case 136: /* signed ::= INTEGER */
#line 354 "sql.y"
{ yylhsminor.yy525 = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
#line 3343 "sql.c"
  yymsp[0].minor.yy525 = yylhsminor.yy525;
        break;
      case 137: /* signed ::= PLUS INTEGER */
#line 355 "sql.y"
{ yymsp[-1].minor.yy525 = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
#line 3349 "sql.c"
        break;
      case 138: /* signed ::= MINUS INTEGER */
#line 356 "sql.y"
{ yymsp[-1].minor.yy525 = -strtol(yymsp[0].minor.yy0.z, NULL, 10);}
#line 3354 "sql.c"
        break;
      case 142: /* cmd ::= CREATE TABLE create_table_list */
#line 362 "sql.y"
{ pInfo->type = TSDB_SQL_CREATE_TABLE; pInfo->pCreateTableInfo = yymsp[0].minor.yy170;}
#line 3359 "sql.c"
        break;
      case 143: /* create_table_list ::= create_from_stable */
#line 366 "sql.y"
{
  SCreateTableSql* pCreateTable = calloc(1, sizeof(SCreateTableSql));
  pCreateTable->childTableInfo = taosArrayInit(4, sizeof(SCreatedTableInfo));

  taosArrayPush(pCreateTable->childTableInfo, &yymsp[0].minor.yy72);
  pCreateTable->type = TSQL_CREATE_TABLE_FROM_STABLE;
  yylhsminor.yy170 = pCreateTable;
}
#line 3371 "sql.c"
  yymsp[0].minor.yy170 = yylhsminor.yy170;
        break;
      case 144: /* create_table_list ::= create_table_list create_from_stable */
#line 375 "sql.y"
{
  taosArrayPush(yymsp[-1].minor.yy170->childTableInfo, &yymsp[0].minor.yy72);
  yylhsminor.yy170 = yymsp[-1].minor.yy170;
}
#line 3380 "sql.c"
  yymsp[-1].minor.yy170 = yylhsminor.yy170;
        break;
      case 145: /* create_table_args ::= ifnotexists ids cpxName LP columnlist RP */
#line 381 "sql.y"
{
  yylhsminor.yy170 = tSetCreateTableInfo(yymsp[-1].minor.yy345, NULL, NULL, TSQL_CREATE_TABLE);
  setSqlInfo(pInfo, yylhsminor.yy170, 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);
}
#line 3392 "sql.c"
  yymsp[-5].minor.yy170 = yylhsminor.yy170;
        break;
      case 146: /* create_stable_args ::= ifnotexists ids cpxName LP columnlist RP TAGS LP columnlist RP */
#line 391 "sql.y"
{
  yylhsminor.yy170 = tSetCreateTableInfo(yymsp[-5].minor.yy345, yymsp[-1].minor.yy345, NULL, TSQL_CREATE_STABLE);
  setSqlInfo(pInfo, yylhsminor.yy170, 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);
}
#line 3404 "sql.c"
  yymsp[-9].minor.yy170 = yylhsminor.yy170;
        break;
      case 147: /* create_from_stable ::= ifnotexists ids cpxName USING ids cpxName TAGS LP tagitemlist RP */
#line 402 "sql.y"
{
  yymsp[-5].minor.yy0.n += yymsp[-4].minor.yy0.n;
  yymsp[-8].minor.yy0.n += yymsp[-7].minor.yy0.n;
  yylhsminor.yy72 = createNewChildTableInfo(&yymsp[-5].minor.yy0, NULL, yymsp[-1].minor.yy345, &yymsp[-8].minor.yy0, &yymsp[-9].minor.yy0);
}
#line 3414 "sql.c"
  yymsp[-9].minor.yy72 = yylhsminor.yy72;
        break;
      case 148: /* create_from_stable ::= ifnotexists ids cpxName USING ids cpxName LP tagNamelist RP TAGS LP tagitemlist RP */
#line 408 "sql.y"
{
  yymsp[-8].minor.yy0.n += yymsp[-7].minor.yy0.n;
  yymsp[-11].minor.yy0.n += yymsp[-10].minor.yy0.n;
  yylhsminor.yy72 = createNewChildTableInfo(&yymsp[-8].minor.yy0, yymsp[-5].minor.yy345, yymsp[-1].minor.yy345, &yymsp[-11].minor.yy0, &yymsp[-12].minor.yy0);
}
#line 3424 "sql.c"
  yymsp[-12].minor.yy72 = yylhsminor.yy72;
        break;
      case 149: /* tagNamelist ::= tagNamelist COMMA ids */
#line 416 "sql.y"
{taosArrayPush(yymsp[-2].minor.yy345, &yymsp[0].minor.yy0); yylhsminor.yy345 = yymsp[-2].minor.yy345;  }
#line 3430 "sql.c"
  yymsp[-2].minor.yy345 = yylhsminor.yy345;
        break;
      case 150: /* tagNamelist ::= ids */
#line 417 "sql.y"
{yylhsminor.yy345 = taosArrayInit(4, sizeof(SStrToken)); taosArrayPush(yylhsminor.yy345, &yymsp[0].minor.yy0);}
#line 3436 "sql.c"
  yymsp[0].minor.yy345 = yylhsminor.yy345;
        break;
      case 151: /* create_table_args ::= ifnotexists ids cpxName AS select */
#line 421 "sql.y"
{
  yylhsminor.yy170 = tSetCreateTableInfo(NULL, NULL, yymsp[0].minor.yy68, TSQL_CREATE_STREAM);
  setSqlInfo(pInfo, yylhsminor.yy170, 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);
}
#line 3448 "sql.c"
  yymsp[-4].minor.yy170 = yylhsminor.yy170;
        break;
      case 152: /* columnlist ::= columnlist COMMA column */
#line 432 "sql.y"
{taosArrayPush(yymsp[-2].minor.yy345, &yymsp[0].minor.yy487); yylhsminor.yy345 = yymsp[-2].minor.yy345;  }
#line 3454 "sql.c"
  yymsp[-2].minor.yy345 = yylhsminor.yy345;
        break;
      case 153: /* columnlist ::= column */
#line 433 "sql.y"
{yylhsminor.yy345 = taosArrayInit(4, sizeof(TAOS_FIELD)); taosArrayPush(yylhsminor.yy345, &yymsp[0].minor.yy487);}
#line 3460 "sql.c"
  yymsp[0].minor.yy345 = yylhsminor.yy345;
        break;
      case 154: /* column ::= ids typename */
#line 437 "sql.y"
{
  tSetColumnInfo(&yylhsminor.yy487, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy487);
}
#line 3468 "sql.c"
  yymsp[-1].minor.yy487 = yylhsminor.yy487;
        break;
      case 161: /* tagitem ::= NULL */
#line 452 "sql.y"
{ yymsp[0].minor.yy0.type = 0; tVariantCreate(&yylhsminor.yy2, &yymsp[0].minor.yy0); }
#line 3474 "sql.c"
  yymsp[0].minor.yy2 = yylhsminor.yy2;
        break;
      case 162: /* tagitem ::= NOW */
#line 453 "sql.y"
{ yymsp[0].minor.yy0.type = TSDB_DATA_TYPE_TIMESTAMP; tVariantCreate(&yylhsminor.yy2, &yymsp[0].minor.yy0);}
#line 3480 "sql.c"
  yymsp[0].minor.yy2 = yylhsminor.yy2;
        break;
      case 163: /* tagitem ::= MINUS INTEGER */
      case 164: /* tagitem ::= MINUS FLOAT */ yytestcase(yyruleno==164);
      case 165: /* tagitem ::= PLUS INTEGER */ yytestcase(yyruleno==165);
      case 166: /* tagitem ::= PLUS FLOAT */ yytestcase(yyruleno==166);
#line 455 "sql.y"
{
    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.yy2, &yymsp[-1].minor.yy0);
}
#line 3494 "sql.c"
  yymsp[-1].minor.yy2 = yylhsminor.yy2;
        break;
      case 167: /* select ::= SELECT selcollist from where_opt interval_option sliding_opt session_option windowstate_option fill_opt groupby_opt having_opt orderby_opt slimit_opt limit_opt */
#line 486 "sql.y"
{
  yylhsminor.yy68 = tSetQuerySqlNode(&yymsp[-13].minor.yy0, yymsp[-12].minor.yy345, yymsp[-11].minor.yy484, yymsp[-10].minor.yy418, yymsp[-4].minor.yy345, yymsp[-2].minor.yy345, &yymsp[-9].minor.yy280, &yymsp[-7].minor.yy295, &yymsp[-6].minor.yy432, &yymsp[-8].minor.yy0, yymsp[-5].minor.yy345, &yymsp[0].minor.yy114, &yymsp[-1].minor.yy114, yymsp[-3].minor.yy418);
}
#line 3502 "sql.c"
  yymsp[-13].minor.yy68 = yylhsminor.yy68;
        break;
      case 168: /* select ::= LP select RP */
#line 490 "sql.y"
{yymsp[-2].minor.yy68 = yymsp[-1].minor.yy68;}
#line 3508 "sql.c"
        break;
      case 169: /* union ::= select */
#line 494 "sql.y"
{ yylhsminor.yy345 = setSubclause(NULL, yymsp[0].minor.yy68); }
#line 3513 "sql.c"
  yymsp[0].minor.yy345 = yylhsminor.yy345;
        break;
      case 170: /* union ::= union UNION ALL select */
#line 495 "sql.y"
{ yylhsminor.yy345 = appendSelectClause(yymsp[-3].minor.yy345, yymsp[0].minor.yy68); }
#line 3519 "sql.c"
  yymsp[-3].minor.yy345 = yylhsminor.yy345;
        break;
      case 171: /* cmd ::= union */
#line 497 "sql.y"
{ setSqlInfo(pInfo, yymsp[0].minor.yy345, NULL, TSDB_SQL_SELECT); }
#line 3525 "sql.c"
        break;
      case 172: /* select ::= SELECT selcollist */
#line 504 "sql.y"
{
  yylhsminor.yy68 = tSetQuerySqlNode(&yymsp[-1].minor.yy0, yymsp[0].minor.yy345, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
}
#line 3532 "sql.c"
  yymsp[-1].minor.yy68 = yylhsminor.yy68;
        break;
      case 173: /* sclp ::= selcollist COMMA */
#line 516 "sql.y"
{yylhsminor.yy345 = yymsp[-1].minor.yy345;}
#line 3538 "sql.c"
  yymsp[-1].minor.yy345 = yylhsminor.yy345;
        break;
      case 174: /* sclp ::= */
      case 206: /* orderby_opt ::= */ yytestcase(yyruleno==206);
#line 517 "sql.y"
{yymsp[1].minor.yy345 = 0;}
#line 3545 "sql.c"
        break;
      case 175: /* selcollist ::= sclp distinct expr as */
#line 518 "sql.y"
{
   yylhsminor.yy345 = tSqlExprListAppend(yymsp[-3].minor.yy345, yymsp[-1].minor.yy418,  yymsp[-2].minor.yy0.n? &yymsp[-2].minor.yy0:0, yymsp[0].minor.yy0.n?&yymsp[0].minor.yy0:0);
}
#line 3552 "sql.c"
  yymsp[-3].minor.yy345 = yylhsminor.yy345;
        break;
      case 176: /* selcollist ::= sclp STAR */
#line 522 "sql.y"
{
   tSqlExpr *pNode = tSqlExprCreateIdValue(pInfo, NULL, TK_ALL);
   yylhsminor.yy345 = tSqlExprListAppend(yymsp[-1].minor.yy345, pNode, 0, 0);
}
#line 3561 "sql.c"
  yymsp[-1].minor.yy345 = yylhsminor.yy345;
        break;
      case 177: /* as ::= AS ids */
#line 530 "sql.y"
{ yymsp[-1].minor.yy0 = yymsp[0].minor.yy0;    }
#line 3567 "sql.c"
        break;
      case 178: /* as ::= ids */
#line 531 "sql.y"
{ yylhsminor.yy0 = yymsp[0].minor.yy0;    }
#line 3572 "sql.c"
  yymsp[0].minor.yy0 = yylhsminor.yy0;
        break;
      case 179: /* as ::= */
#line 532 "sql.y"
{ yymsp[1].minor.yy0.n = 0;  }
#line 3578 "sql.c"
        break;
      case 180: /* distinct ::= DISTINCT */
#line 535 "sql.y"
{ yylhsminor.yy0 = yymsp[0].minor.yy0;  }
#line 3583 "sql.c"
  yymsp[0].minor.yy0 = yylhsminor.yy0;
        break;
      case 182: /* from ::= FROM tablelist */
      case 183: /* from ::= FROM sub */ yytestcase(yyruleno==183);
#line 541 "sql.y"
{yymsp[-1].minor.yy484 = yymsp[0].minor.yy484;}
#line 3590 "sql.c"
        break;
      case 184: /* sub ::= LP union RP */
#line 546 "sql.y"
{yymsp[-2].minor.yy484 = addSubqueryElem(NULL, yymsp[-1].minor.yy345, NULL);}
#line 3595 "sql.c"
        break;
      case 185: /* sub ::= LP union RP ids */
#line 547 "sql.y"
{yymsp[-3].minor.yy484 = addSubqueryElem(NULL, yymsp[-2].minor.yy345, &yymsp[0].minor.yy0);}
#line 3600 "sql.c"
        break;
      case 186: /* sub ::= sub COMMA LP union RP ids */
#line 548 "sql.y"
{yylhsminor.yy484 = addSubqueryElem(yymsp[-5].minor.yy484, yymsp[-2].minor.yy345, &yymsp[0].minor.yy0);}
#line 3605 "sql.c"
  yymsp[-5].minor.yy484 = yylhsminor.yy484;
        break;
      case 187: /* tablelist ::= ids cpxName */
#line 552 "sql.y"
{
  yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n;
  yylhsminor.yy484 = setTableNameList(NULL, &yymsp[-1].minor.yy0, NULL);
}
#line 3614 "sql.c"
  yymsp[-1].minor.yy484 = yylhsminor.yy484;
        break;
      case 188: /* tablelist ::= ids cpxName ids */
#line 557 "sql.y"
{
  yymsp[-2].minor.yy0.n += yymsp[-1].minor.yy0.n;
  yylhsminor.yy484 = setTableNameList(NULL, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0);
}
#line 3623 "sql.c"
  yymsp[-2].minor.yy484 = yylhsminor.yy484;
        break;
      case 189: /* tablelist ::= tablelist COMMA ids cpxName */
#line 562 "sql.y"
{
  yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n;
  yylhsminor.yy484 = setTableNameList(yymsp[-3].minor.yy484, &yymsp[-1].minor.yy0, NULL);
}
#line 3632 "sql.c"
  yymsp[-3].minor.yy484 = yylhsminor.yy484;
        break;
      case 190: /* tablelist ::= tablelist COMMA ids cpxName ids */
#line 567 "sql.y"
{
  yymsp[-2].minor.yy0.n += yymsp[-1].minor.yy0.n;
  yylhsminor.yy484 = setTableNameList(yymsp[-4].minor.yy484, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0);
}
#line 3641 "sql.c"
  yymsp[-4].minor.yy484 = yylhsminor.yy484;
        break;
      case 191: /* tmvar ::= VARIABLE */
#line 574 "sql.y"
{yylhsminor.yy0 = yymsp[0].minor.yy0;}
#line 3647 "sql.c"
  yymsp[0].minor.yy0 = yylhsminor.yy0;
        break;
      case 192: /* interval_option ::= intervalKey LP tmvar RP */
#line 577 "sql.y"
{yylhsminor.yy280.interval = yymsp[-1].minor.yy0; yylhsminor.yy280.offset.n = 0; yylhsminor.yy280.token = yymsp[-3].minor.yy40;}
#line 3653 "sql.c"
  yymsp[-3].minor.yy280 = yylhsminor.yy280;
        break;
      case 193: /* interval_option ::= intervalKey LP tmvar COMMA tmvar RP */
#line 578 "sql.y"
{yylhsminor.yy280.interval = yymsp[-3].minor.yy0; yylhsminor.yy280.offset = yymsp[-1].minor.yy0;   yylhsminor.yy280.token = yymsp[-5].minor.yy40;}
#line 3659 "sql.c"
  yymsp[-5].minor.yy280 = yylhsminor.yy280;
        break;
      case 194: /* interval_option ::= */
#line 579 "sql.y"
{memset(&yymsp[1].minor.yy280, 0, sizeof(yymsp[1].minor.yy280));}
#line 3665 "sql.c"
        break;
      case 195: /* intervalKey ::= INTERVAL */
#line 582 "sql.y"
{yymsp[0].minor.yy40 = TK_INTERVAL;}
#line 3670 "sql.c"
        break;
      case 196: /* intervalKey ::= EVERY */
#line 583 "sql.y"
{yymsp[0].minor.yy40 = TK_EVERY;   }
#line 3675 "sql.c"
        break;
      case 197: /* session_option ::= */
#line 586 "sql.y"
{yymsp[1].minor.yy295.col.n = 0; yymsp[1].minor.yy295.gap.n = 0;}
#line 3680 "sql.c"
        break;
      case 198: /* session_option ::= SESSION LP ids cpxName COMMA tmvar RP */
#line 587 "sql.y"
{
   yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n;
   yymsp[-6].minor.yy295.col = yymsp[-4].minor.yy0;
   yymsp[-6].minor.yy295.gap = yymsp[-1].minor.yy0;
}
#line 3689 "sql.c"
        break;
      case 199: /* windowstate_option ::= */
#line 594 "sql.y"
{ yymsp[1].minor.yy432.col.n = 0; yymsp[1].minor.yy432.col.z = NULL;}
#line 3694 "sql.c"
        break;
      case 200: /* windowstate_option ::= STATE_WINDOW LP ids RP */
#line 595 "sql.y"
{ yymsp[-3].minor.yy432.col = yymsp[-1].minor.yy0; }
#line 3699 "sql.c"
        break;
      case 201: /* fill_opt ::= */
#line 599 "sql.y"
{ yymsp[1].minor.yy345 = 0;     }
#line 3704 "sql.c"
        break;
      case 202: /* fill_opt ::= FILL LP ID COMMA tagitemlist RP */
#line 600 "sql.y"
{
    tVariant A = {0};
    toTSDBType(yymsp[-3].minor.yy0.type);
    tVariantCreate(&A, &yymsp[-3].minor.yy0);

    tVariantListInsert(yymsp[-1].minor.yy345, &A, -1, 0);
    yymsp[-5].minor.yy345 = yymsp[-1].minor.yy345;
}
#line 3716 "sql.c"
        break;
      case 203: /* fill_opt ::= FILL LP ID RP */
#line 609 "sql.y"
{
    toTSDBType(yymsp[-1].minor.yy0.type);
    yymsp[-3].minor.yy345 = tVariantListAppendToken(NULL, &yymsp[-1].minor.yy0, -1);
}
#line 3724 "sql.c"
        break;
      case 204: /* sliding_opt ::= SLIDING LP tmvar RP */
#line 615 "sql.y"
{yymsp[-3].minor.yy0 = yymsp[-1].minor.yy0;     }
#line 3729 "sql.c"
        break;
      case 205: /* sliding_opt ::= */
#line 616 "sql.y"
{yymsp[1].minor.yy0.n = 0; yymsp[1].minor.yy0.z = NULL; yymsp[1].minor.yy0.type = 0;   }
#line 3734 "sql.c"
        break;
      case 207: /* orderby_opt ::= ORDER BY sortlist */
#line 625 "sql.y"
{yymsp[-2].minor.yy345 = yymsp[0].minor.yy345;}
#line 3739 "sql.c"
        break;
      case 208: /* sortlist ::= sortlist COMMA item sortorder */
#line 627 "sql.y"
{
  yylhsminor.yy345 = commonItemAppend(yymsp[-3].minor.yy345, &yymsp[-1].minor.yy2, NULL, false, yymsp[0].minor.yy281);
}
#line 3746 "sql.c"
  yymsp[-3].minor.yy345 = yylhsminor.yy345;
        break;
      case 209: /* sortlist ::= sortlist COMMA arrow sortorder */
#line 631 "sql.y"
{
  yylhsminor.yy345 = commonItemAppend(yymsp[-3].minor.yy345, NULL, yymsp[-1].minor.yy418, true, yymsp[0].minor.yy281);
}
#line 3754 "sql.c"
  yymsp[-3].minor.yy345 = yylhsminor.yy345;
        break;
      case 210: /* sortlist ::= item sortorder */
#line 635 "sql.y"
{
  yylhsminor.yy345 = commonItemAppend(NULL, &yymsp[-1].minor.yy2, NULL, false, yymsp[0].minor.yy281);
}
#line 3762 "sql.c"
  yymsp[-1].minor.yy345 = yylhsminor.yy345;
        break;
      case 211: /* sortlist ::= arrow sortorder */
#line 639 "sql.y"
{
  yylhsminor.yy345 = commonItemAppend(NULL, NULL, yymsp[-1].minor.yy418, true, yymsp[0].minor.yy281);
}
#line 3770 "sql.c"
  yymsp[-1].minor.yy345 = yylhsminor.yy345;
        break;
      case 213: /* item ::= ID DOT ID */
#line 645 "sql.y"
{
  toTSDBType(yymsp[-2].minor.yy0.type);
  yymsp[-2].minor.yy0.n += yymsp[0].minor.yy0.n;
  tVariantCreate(&yylhsminor.yy2, &yymsp[-2].minor.yy0);
}
#line 3780 "sql.c"
  yymsp[-2].minor.yy2 = yylhsminor.yy2;
        break;
      case 214: /* sortorder ::= ASC */
#line 652 "sql.y"
{ yymsp[0].minor.yy281 = TSDB_ORDER_ASC; }
#line 3786 "sql.c"
        break;
      case 215: /* sortorder ::= DESC */
#line 653 "sql.y"
{ yymsp[0].minor.yy281 = TSDB_ORDER_DESC;}
#line 3791 "sql.c"
        break;
      case 216: /* sortorder ::= */
#line 654 "sql.y"
{ yymsp[1].minor.yy281 = TSDB_ORDER_ASC; }
#line 3796 "sql.c"
        break;
      case 217: /* groupby_opt ::= */
#line 662 "sql.y"
{ yymsp[1].minor.yy345 = 0;}
#line 3801 "sql.c"
        break;
      case 218: /* groupby_opt ::= GROUP BY grouplist */
#line 663 "sql.y"
{ yymsp[-2].minor.yy345 = yymsp[0].minor.yy345;}
#line 3806 "sql.c"
        break;
      case 219: /* grouplist ::= grouplist COMMA item */
#line 665 "sql.y"
{
  yylhsminor.yy345 = commonItemAppend(yymsp[-2].minor.yy345, &yymsp[0].minor.yy2, NULL, false, -1);
}
#line 3813 "sql.c"
  yymsp[-2].minor.yy345 = yylhsminor.yy345;
        break;
      case 220: /* grouplist ::= grouplist COMMA arrow */
#line 669 "sql.y"
{
  yylhsminor.yy345 = commonItemAppend(yymsp[-2].minor.yy345, NULL, yymsp[0].minor.yy418, true, -1);
}
#line 3821 "sql.c"
  yymsp[-2].minor.yy345 = yylhsminor.yy345;
        break;
      case 221: /* grouplist ::= item */
#line 673 "sql.y"
{
  yylhsminor.yy345 = commonItemAppend(NULL, &yymsp[0].minor.yy2, NULL, false, -1);
}
#line 3829 "sql.c"
  yymsp[0].minor.yy345 = yylhsminor.yy345;
        break;
      case 222: /* grouplist ::= arrow */
#line 677 "sql.y"
{
  yylhsminor.yy345 = commonItemAppend(NULL, NULL, yymsp[0].minor.yy418, true, -1);
}
#line 3837 "sql.c"
  yymsp[0].minor.yy345 = yylhsminor.yy345;
        break;
      case 223: /* having_opt ::= */
      case 233: /* where_opt ::= */ yytestcase(yyruleno==233);
      case 281: /* expritem ::= */ yytestcase(yyruleno==281);
#line 684 "sql.y"
{yymsp[1].minor.yy418 = 0;}
#line 3845 "sql.c"
        break;
      case 224: /* having_opt ::= HAVING expr */
      case 234: /* where_opt ::= WHERE expr */ yytestcase(yyruleno==234);
#line 685 "sql.y"
{yymsp[-1].minor.yy418 = yymsp[0].minor.yy418;}
#line 3851 "sql.c"
        break;
      case 225: /* limit_opt ::= */
      case 229: /* slimit_opt ::= */ yytestcase(yyruleno==229);
#line 689 "sql.y"
{yymsp[1].minor.yy114.limit = -1; yymsp[1].minor.yy114.offset = 0;}
#line 3857 "sql.c"
        break;
      case 226: /* limit_opt ::= LIMIT signed */
      case 230: /* slimit_opt ::= SLIMIT signed */ yytestcase(yyruleno==230);
#line 690 "sql.y"
{yymsp[-1].minor.yy114.limit = yymsp[0].minor.yy525;  yymsp[-1].minor.yy114.offset = 0;}
#line 3863 "sql.c"
        break;
      case 227: /* limit_opt ::= LIMIT signed OFFSET signed */
#line 692 "sql.y"
{ yymsp[-3].minor.yy114.limit = yymsp[-2].minor.yy525;  yymsp[-3].minor.yy114.offset = yymsp[0].minor.yy525;}
#line 3868 "sql.c"
        break;
      case 228: /* limit_opt ::= LIMIT signed COMMA signed */
#line 694 "sql.y"
{ yymsp[-3].minor.yy114.limit = yymsp[0].minor.yy525;  yymsp[-3].minor.yy114.offset = yymsp[-2].minor.yy525;}
#line 3873 "sql.c"
        break;
      case 231: /* slimit_opt ::= SLIMIT signed SOFFSET signed */
#line 700 "sql.y"
{yymsp[-3].minor.yy114.limit = yymsp[-2].minor.yy525;  yymsp[-3].minor.yy114.offset = yymsp[0].minor.yy525;}
#line 3878 "sql.c"
        break;
      case 232: /* slimit_opt ::= SLIMIT signed COMMA signed */
#line 702 "sql.y"
{yymsp[-3].minor.yy114.limit = yymsp[0].minor.yy525;  yymsp[-3].minor.yy114.offset = yymsp[-2].minor.yy525;}
#line 3883 "sql.c"
        break;
      case 235: /* expr ::= LP expr RP */
#line 715 "sql.y"
{yylhsminor.yy418 = yymsp[-1].minor.yy418; yylhsminor.yy418->exprToken.z = yymsp[-2].minor.yy0.z; yylhsminor.yy418->exprToken.n = (yymsp[0].minor.yy0.z - yymsp[-2].minor.yy0.z + 1);}
#line 3888 "sql.c"
  yymsp[-2].minor.yy418 = yylhsminor.yy418;
        break;
      case 236: /* expr ::= ID */
#line 717 "sql.y"
{ yylhsminor.yy418 = tSqlExprCreateIdValue(pInfo, &yymsp[0].minor.yy0, TK_ID);}
#line 3894 "sql.c"
  yymsp[0].minor.yy418 = yylhsminor.yy418;
        break;
      case 237: /* expr ::= ID DOT ID */
#line 718 "sql.y"
{ yymsp[-2].minor.yy0.n += (1+yymsp[0].minor.yy0.n); yylhsminor.yy418 = tSqlExprCreateIdValue(pInfo, &yymsp[-2].minor.yy0, TK_ID);}
#line 3900 "sql.c"
  yymsp[-2].minor.yy418 = yylhsminor.yy418;
        break;
      case 238: /* expr ::= ID DOT STAR */
#line 719 "sql.y"
{ yymsp[-2].minor.yy0.n += (1+yymsp[0].minor.yy0.n); yylhsminor.yy418 = tSqlExprCreateIdValue(pInfo, &yymsp[-2].minor.yy0, TK_ALL);}
#line 3906 "sql.c"
  yymsp[-2].minor.yy418 = yylhsminor.yy418;
        break;
      case 239: /* expr ::= INTEGER */
#line 721 "sql.y"
{ yylhsminor.yy418 = tSqlExprCreateIdValue(pInfo, &yymsp[0].minor.yy0, TK_INTEGER);}
#line 3912 "sql.c"
  yymsp[0].minor.yy418 = yylhsminor.yy418;
        break;
      case 240: /* expr ::= MINUS INTEGER */
      case 241: /* expr ::= PLUS INTEGER */ yytestcase(yyruleno==241);
#line 722 "sql.y"
{ yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; yymsp[-1].minor.yy0.type = TK_INTEGER; yylhsminor.yy418 = tSqlExprCreateIdValue(pInfo, &yymsp[-1].minor.yy0, TK_INTEGER);}
#line 3919 "sql.c"
  yymsp[-1].minor.yy418 = yylhsminor.yy418;
        break;
      case 242: /* expr ::= FLOAT */
#line 724 "sql.y"
{ yylhsminor.yy418 = tSqlExprCreateIdValue(pInfo, &yymsp[0].minor.yy0, TK_FLOAT);}
#line 3925 "sql.c"
  yymsp[0].minor.yy418 = yylhsminor.yy418;
        break;
      case 243: /* expr ::= MINUS FLOAT */
      case 244: /* expr ::= PLUS FLOAT */ yytestcase(yyruleno==244);
#line 725 "sql.y"
{ yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; yymsp[-1].minor.yy0.type = TK_FLOAT; yylhsminor.yy418 = tSqlExprCreateIdValue(pInfo, &yymsp[-1].minor.yy0, TK_FLOAT);}
#line 3932 "sql.c"
  yymsp[-1].minor.yy418 = yylhsminor.yy418;
        break;
      case 245: /* expr ::= STRING */
#line 727 "sql.y"
{ yylhsminor.yy418 = tSqlExprCreateIdValue(pInfo, &yymsp[0].minor.yy0, TK_STRING);}
#line 3938 "sql.c"
  yymsp[0].minor.yy418 = yylhsminor.yy418;
        break;
      case 246: /* expr ::= NOW */
#line 728 "sql.y"
{ yylhsminor.yy418 = tSqlExprCreateIdValue(pInfo, &yymsp[0].minor.yy0, TK_NOW); }
#line 3944 "sql.c"
  yymsp[0].minor.yy418 = yylhsminor.yy418;
        break;
      case 247: /* expr ::= VARIABLE */
#line 729 "sql.y"
{ yylhsminor.yy418 = tSqlExprCreateIdValue(pInfo, &yymsp[0].minor.yy0, TK_VARIABLE);}
#line 3950 "sql.c"
  yymsp[0].minor.yy418 = yylhsminor.yy418;
        break;
      case 248: /* expr ::= PLUS VARIABLE */
      case 249: /* expr ::= MINUS VARIABLE */ yytestcase(yyruleno==249);
#line 730 "sql.y"
{ yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; yymsp[-1].minor.yy0.type = TK_VARIABLE; yylhsminor.yy418 = tSqlExprCreateIdValue(pInfo, &yymsp[-1].minor.yy0, TK_VARIABLE);}
#line 3957 "sql.c"
  yymsp[-1].minor.yy418 = yylhsminor.yy418;
        break;
      case 250: /* expr ::= BOOL */
#line 732 "sql.y"
{ yylhsminor.yy418 = tSqlExprCreateIdValue(pInfo, &yymsp[0].minor.yy0, TK_BOOL);}
#line 3963 "sql.c"
  yymsp[0].minor.yy418 = yylhsminor.yy418;
        break;
      case 251: /* expr ::= NULL */
#line 733 "sql.y"
{ yylhsminor.yy418 = tSqlExprCreateIdValue(pInfo, &yymsp[0].minor.yy0, TK_NULL);}
#line 3969 "sql.c"
  yymsp[0].minor.yy418 = yylhsminor.yy418;
        break;
      case 252: /* expr ::= ID LP exprlist RP */
#line 736 "sql.y"
{ tStrTokenAppend(pInfo->funcs, &yymsp[-3].minor.yy0); yylhsminor.yy418 = tSqlExprCreateFunction(yymsp[-1].minor.yy345, &yymsp[-3].minor.yy0, &yymsp[0].minor.yy0, yymsp[-3].minor.yy0.type); }
#line 3975 "sql.c"
  yymsp[-3].minor.yy418 = yylhsminor.yy418;
        break;
      case 253: /* expr ::= ID LP STAR RP */
#line 739 "sql.y"
{ tStrTokenAppend(pInfo->funcs, &yymsp[-3].minor.yy0); yylhsminor.yy418 = tSqlExprCreateFunction(NULL, &yymsp[-3].minor.yy0, &yymsp[0].minor.yy0, yymsp[-3].minor.yy0.type); }
#line 3981 "sql.c"
  yymsp[-3].minor.yy418 = yylhsminor.yy418;
        break;
      case 254: /* expr ::= expr IS NULL */
#line 742 "sql.y"
{yylhsminor.yy418 = tSqlExprCreate(yymsp[-2].minor.yy418, NULL, TK_ISNULL);}
#line 3987 "sql.c"
  yymsp[-2].minor.yy418 = yylhsminor.yy418;
        break;
      case 255: /* expr ::= expr IS NOT NULL */
#line 743 "sql.y"
{yylhsminor.yy418 = tSqlExprCreate(yymsp[-3].minor.yy418, NULL, TK_NOTNULL);}
#line 3993 "sql.c"
  yymsp[-3].minor.yy418 = yylhsminor.yy418;
        break;
      case 256: /* expr ::= expr LT expr */
#line 746 "sql.y"
{yylhsminor.yy418 = tSqlExprCreate(yymsp[-2].minor.yy418, yymsp[0].minor.yy418, TK_LT);}
#line 3999 "sql.c"
  yymsp[-2].minor.yy418 = yylhsminor.yy418;
        break;
      case 257: /* expr ::= expr GT expr */
#line 747 "sql.y"
{yylhsminor.yy418 = tSqlExprCreate(yymsp[-2].minor.yy418, yymsp[0].minor.yy418, TK_GT);}
#line 4005 "sql.c"
  yymsp[-2].minor.yy418 = yylhsminor.yy418;
        break;
      case 258: /* expr ::= expr LE expr */
#line 748 "sql.y"
{yylhsminor.yy418 = tSqlExprCreate(yymsp[-2].minor.yy418, yymsp[0].minor.yy418, TK_LE);}
#line 4011 "sql.c"
  yymsp[-2].minor.yy418 = yylhsminor.yy418;
        break;
      case 259: /* expr ::= expr GE expr */
#line 749 "sql.y"
{yylhsminor.yy418 = tSqlExprCreate(yymsp[-2].minor.yy418, yymsp[0].minor.yy418, TK_GE);}
#line 4017 "sql.c"
  yymsp[-2].minor.yy418 = yylhsminor.yy418;
        break;
      case 260: /* expr ::= expr NE expr */
#line 750 "sql.y"
{yylhsminor.yy418 = tSqlExprCreate(yymsp[-2].minor.yy418, yymsp[0].minor.yy418, TK_NE);}
#line 4023 "sql.c"
  yymsp[-2].minor.yy418 = yylhsminor.yy418;
        break;
      case 261: /* expr ::= expr EQ expr */
#line 751 "sql.y"
{yylhsminor.yy418 = tSqlExprCreate(yymsp[-2].minor.yy418, yymsp[0].minor.yy418, TK_EQ);}
#line 4029 "sql.c"
  yymsp[-2].minor.yy418 = yylhsminor.yy418;
        break;
      case 262: /* expr ::= expr BETWEEN expr AND expr */
#line 753 "sql.y"
{ tSqlExpr* X2 = tSqlExprClone(yymsp[-4].minor.yy418); yylhsminor.yy418 = tSqlExprCreate(tSqlExprCreate(yymsp[-4].minor.yy418, yymsp[-2].minor.yy418, TK_GE), tSqlExprCreate(X2, yymsp[0].minor.yy418, TK_LE), TK_AND);}
#line 4035 "sql.c"
  yymsp[-4].minor.yy418 = yylhsminor.yy418;
        break;
      case 263: /* expr ::= expr AND expr */
#line 755 "sql.y"
{yylhsminor.yy418 = tSqlExprCreate(yymsp[-2].minor.yy418, yymsp[0].minor.yy418, TK_AND);}
#line 4041 "sql.c"
  yymsp[-2].minor.yy418 = yylhsminor.yy418;
        break;
      case 264: /* expr ::= expr OR expr */
#line 756 "sql.y"
{yylhsminor.yy418 = tSqlExprCreate(yymsp[-2].minor.yy418, yymsp[0].minor.yy418, TK_OR); }
#line 4047 "sql.c"
  yymsp[-2].minor.yy418 = yylhsminor.yy418;
        break;
      case 265: /* expr ::= expr PLUS expr */
#line 759 "sql.y"
{yylhsminor.yy418 = tSqlExprCreate(yymsp[-2].minor.yy418, yymsp[0].minor.yy418, TK_PLUS);  }
#line 4053 "sql.c"
  yymsp[-2].minor.yy418 = yylhsminor.yy418;
        break;
      case 266: /* expr ::= expr MINUS expr */
#line 760 "sql.y"
{yylhsminor.yy418 = tSqlExprCreate(yymsp[-2].minor.yy418, yymsp[0].minor.yy418, TK_MINUS); }
#line 4059 "sql.c"
  yymsp[-2].minor.yy418 = yylhsminor.yy418;
        break;
      case 267: /* expr ::= expr STAR expr */
#line 761 "sql.y"
{yylhsminor.yy418 = tSqlExprCreate(yymsp[-2].minor.yy418, yymsp[0].minor.yy418, TK_STAR);  }
#line 4065 "sql.c"
  yymsp[-2].minor.yy418 = yylhsminor.yy418;
        break;
      case 268: /* expr ::= expr SLASH expr */
#line 762 "sql.y"
{yylhsminor.yy418 = tSqlExprCreate(yymsp[-2].minor.yy418, yymsp[0].minor.yy418, TK_DIVIDE);}
#line 4071 "sql.c"
  yymsp[-2].minor.yy418 = yylhsminor.yy418;
        break;
      case 269: /* expr ::= expr REM expr */
#line 763 "sql.y"
{yylhsminor.yy418 = tSqlExprCreate(yymsp[-2].minor.yy418, yymsp[0].minor.yy418, TK_REM);   }
#line 4077 "sql.c"
  yymsp[-2].minor.yy418 = yylhsminor.yy418;
        break;
      case 270: /* expr ::= expr LIKE expr */
#line 766 "sql.y"
{yylhsminor.yy418 = tSqlExprCreate(yymsp[-2].minor.yy418, yymsp[0].minor.yy418, TK_LIKE);  }
#line 4083 "sql.c"
  yymsp[-2].minor.yy418 = yylhsminor.yy418;
        break;
      case 271: /* expr ::= expr MATCH expr */
#line 769 "sql.y"
{yylhsminor.yy418 = tSqlExprCreate(yymsp[-2].minor.yy418, yymsp[0].minor.yy418, TK_MATCH);  }
#line 4089 "sql.c"
  yymsp[-2].minor.yy418 = yylhsminor.yy418;
        break;
      case 272: /* expr ::= expr NMATCH expr */
#line 770 "sql.y"
{yylhsminor.yy418 = tSqlExprCreate(yymsp[-2].minor.yy418, yymsp[0].minor.yy418, TK_NMATCH);  }
#line 4095 "sql.c"
  yymsp[-2].minor.yy418 = yylhsminor.yy418;
        break;
      case 273: /* expr ::= ID QUESTION STRING */
#line 773 "sql.y"
{ tSqlExpr* S = tSqlExprCreateIdValue(pInfo, &yymsp[-2].minor.yy0, TK_ID); tSqlExpr* M = tSqlExprCreateIdValue(pInfo, &yymsp[0].minor.yy0, TK_STRING); yylhsminor.yy418 = tSqlExprCreate(S, M, TK_QUESTION);  }
#line 4101 "sql.c"
  yymsp[-2].minor.yy418 = yylhsminor.yy418;
        break;
      case 274: /* arrow ::= ID ARROW STRING */
#line 778 "sql.y"
{tSqlExpr* S = tSqlExprCreateIdValue(pInfo, &yymsp[-2].minor.yy0, TK_ID); tSqlExpr* M = tSqlExprCreateIdValue(pInfo, &yymsp[0].minor.yy0, TK_STRING); yylhsminor.yy418 = tSqlExprCreate(S, M, TK_ARROW);  }
#line 4107 "sql.c"
  yymsp[-2].minor.yy418 = yylhsminor.yy418;
        break;
      case 275: /* arrow ::= ID DOT ID ARROW STRING */
#line 779 "sql.y"
{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.yy418 = tSqlExprCreate(S, M, TK_ARROW);  }
#line 4113 "sql.c"
  yymsp[-4].minor.yy418 = yylhsminor.yy418;
        break;
      case 276: /* expr ::= arrow */
      case 280: /* expritem ::= expr */ yytestcase(yyruleno==280);
#line 781 "sql.y"
{yylhsminor.yy418 = yymsp[0].minor.yy418;}
#line 4120 "sql.c"
  yymsp[0].minor.yy418 = yylhsminor.yy418;
        break;
      case 277: /* expr ::= expr IN LP exprlist RP */
#line 784 "sql.y"
{yylhsminor.yy418 = tSqlExprCreate(yymsp[-4].minor.yy418, (tSqlExpr*)yymsp[-1].minor.yy345, TK_IN); }
#line 4126 "sql.c"
  yymsp[-4].minor.yy418 = yylhsminor.yy418;
        break;
      case 278: /* exprlist ::= exprlist COMMA expritem */
#line 792 "sql.y"
{yylhsminor.yy345 = tSqlExprListAppend(yymsp[-2].minor.yy345,yymsp[0].minor.yy418,0, 0);}
#line 4132 "sql.c"
  yymsp[-2].minor.yy345 = yylhsminor.yy345;
        break;
      case 279: /* exprlist ::= expritem */
#line 793 "sql.y"
{yylhsminor.yy345 = tSqlExprListAppend(0,yymsp[0].minor.yy418,0, 0);}
#line 4138 "sql.c"
  yymsp[0].minor.yy345 = yylhsminor.yy345;
        break;
      case 282: /* cmd ::= RESET QUERY CACHE */
#line 798 "sql.y"
{ setDCLSqlElems(pInfo, TSDB_SQL_RESET_CACHE, 0);}
#line 4144 "sql.c"
        break;
      case 283: /* cmd ::= SYNCDB ids REPLICA */
#line 801 "sql.y"
{ setDCLSqlElems(pInfo, TSDB_SQL_SYNC_DB_REPLICA, 1, &yymsp[-1].minor.yy0);}
#line 4149 "sql.c"
        break;
      case 284: /* cmd ::= ALTER TABLE ids cpxName ADD COLUMN columnlist */
#line 804 "sql.y"
{
    yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n;
    SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, yymsp[0].minor.yy345, NULL, TSDB_ALTER_TABLE_ADD_COLUMN, -1);
    setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE);
}
#line 4158 "sql.c"
        break;
      case 285: /* cmd ::= ALTER TABLE ids cpxName DROP COLUMN ids */
#line 810 "sql.y"
{
    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);

    SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, NULL, K, TSDB_ALTER_TABLE_DROP_COLUMN, -1);
    setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE);
}
#line 4171 "sql.c"
        break;
      case 286: /* cmd ::= ALTER TABLE ids cpxName MODIFY COLUMN columnlist */
#line 820 "sql.y"
{
    yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n;
    SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, yymsp[0].minor.yy345, NULL, TSDB_ALTER_TABLE_CHANGE_COLUMN, -1);
    setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE);
}
#line 4180 "sql.c"
        break;
      case 287: /* cmd ::= ALTER TABLE ids cpxName ADD TAG columnlist */
#line 827 "sql.y"
{
    yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n;
    SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, yymsp[0].minor.yy345, NULL, TSDB_ALTER_TABLE_ADD_TAG_COLUMN, -1);
    setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE);
}
#line 4189 "sql.c"
        break;
      case 288: /* cmd ::= ALTER TABLE ids cpxName DROP TAG ids */
#line 832 "sql.y"
{
    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);

    SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, NULL, A, TSDB_ALTER_TABLE_DROP_TAG_COLUMN, -1);
    setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE);
}
#line 4202 "sql.c"
        break;
      case 289: /* cmd ::= ALTER TABLE ids cpxName CHANGE TAG ids ids */
#line 842 "sql.y"
{
    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);

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

    SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-5].minor.yy0, NULL, A, TSDB_ALTER_TABLE_CHANGE_TAG_COLUMN, -1);
    setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE);
}
#line 4218 "sql.c"
        break;
      case 290: /* cmd ::= ALTER TABLE ids cpxName SET TAG ids EQ tagitem */
#line 855 "sql.y"
{
    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);
    A = tVariantListAppend(A, &yymsp[0].minor.yy2, -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);
}
#line 4232 "sql.c"
        break;
      case 291: /* cmd ::= ALTER TABLE ids cpxName MODIFY TAG columnlist */
#line 866 "sql.y"
{
    yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n;
    SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, yymsp[0].minor.yy345, NULL, TSDB_ALTER_TABLE_MODIFY_TAG_COLUMN, -1);
    setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE);
}
#line 4241 "sql.c"
        break;
      case 292: /* cmd ::= ALTER STABLE ids cpxName ADD COLUMN columnlist */
#line 873 "sql.y"
{
    yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n;
    SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, yymsp[0].minor.yy345, NULL, TSDB_ALTER_TABLE_ADD_COLUMN, TSDB_SUPER_TABLE);
    setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE);
}
#line 4250 "sql.c"
        break;
      case 293: /* cmd ::= ALTER STABLE ids cpxName DROP COLUMN ids */
#line 879 "sql.y"
{
    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);

    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);
}
#line 4263 "sql.c"
        break;
      case 294: /* cmd ::= ALTER STABLE ids cpxName MODIFY COLUMN columnlist */
#line 889 "sql.y"
{
    yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n;
    SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, yymsp[0].minor.yy345, NULL, TSDB_ALTER_TABLE_CHANGE_COLUMN, TSDB_SUPER_TABLE);
    setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE);
}
#line 4272 "sql.c"
        break;
      case 295: /* cmd ::= ALTER STABLE ids cpxName ADD TAG columnlist */
#line 896 "sql.y"
{
    yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n;
    SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, yymsp[0].minor.yy345, NULL, TSDB_ALTER_TABLE_ADD_TAG_COLUMN, TSDB_SUPER_TABLE);
    setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE);
}
#line 4281 "sql.c"
        break;
      case 296: /* cmd ::= ALTER STABLE ids cpxName DROP TAG ids */
#line 901 "sql.y"
{
    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);

    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);
}
#line 4294 "sql.c"
        break;
      case 297: /* cmd ::= ALTER STABLE ids cpxName CHANGE TAG ids ids */
#line 911 "sql.y"
{
    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);

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

    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);
}
#line 4310 "sql.c"
        break;
      case 298: /* cmd ::= ALTER STABLE ids cpxName SET TAG ids EQ tagitem */
#line 924 "sql.y"
{
    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);
    A = tVariantListAppend(A, &yymsp[0].minor.yy2, -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);
}
#line 4324 "sql.c"
        break;
      case 299: /* cmd ::= ALTER STABLE ids cpxName MODIFY TAG columnlist */
#line 935 "sql.y"
{
    yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n;
    SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, yymsp[0].minor.yy345, NULL, TSDB_ALTER_TABLE_MODIFY_TAG_COLUMN, TSDB_SUPER_TABLE);
    setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE);
}
#line 4333 "sql.c"
        break;
      case 300: /* cmd ::= KILL CONNECTION INTEGER */
#line 942 "sql.y"
{setKillSql(pInfo, TSDB_SQL_KILL_CONNECTION, &yymsp[0].minor.yy0);}
#line 4338 "sql.c"
        break;
      case 301: /* cmd ::= KILL STREAM INTEGER COLON INTEGER */
#line 943 "sql.y"
{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);}
#line 4343 "sql.c"
        break;
      case 302: /* cmd ::= KILL QUERY INTEGER COLON INTEGER */
#line 944 "sql.y"
{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);}
#line 4348 "sql.c"
        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 ****************************************/
#line 38 "sql.y"

  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);
#line 4433 "sql.c"
/************ 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 *****************************************/
#line 62 "sql.y"
#line 4460 "sql.c"
/*********** 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
}
