/* 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_GLOB                           24
#define TK_BETWEEN                        25
#define TK_IN                             26
#define TK_GT                             27
#define TK_GE                             28
#define TK_LT                             29
#define TK_LE                             30
#define TK_BITAND                         31
#define TK_BITOR                          32
#define TK_LSHIFT                         33
#define TK_RSHIFT                         34
#define TK_PLUS                           35
#define TK_MINUS                          36
#define TK_DIVIDE                         37
#define TK_TIMES                          38
#define TK_STAR                           39
#define TK_SLASH                          40
#define TK_REM                            41
#define TK_CONCAT                         42
#define TK_UMINUS                         43
#define TK_UPLUS                          44
#define TK_BITNOT                         45
#define TK_QUESTION                       46
#define TK_ARROW                          47
#define TK_SHOW                           48
#define TK_DATABASES                      49
#define TK_TOPICS                         50
#define TK_FUNCTIONS                      51
#define TK_MNODES                         52
#define TK_DNODES                         53
#define TK_ACCOUNTS                       54
#define TK_USERS                          55
#define TK_MODULES                        56
#define TK_QUERIES                        57
#define TK_CONNECTIONS                    58
#define TK_STREAMS                        59
#define TK_VARIABLES                      60
#define TK_SCORES                         61
#define TK_GRANTS                         62
#define TK_VNODES                         63
#define TK_DOT                            64
#define TK_CREATE                         65
#define TK_TABLE                          66
#define TK_STABLE                         67
#define TK_DATABASE                       68
#define TK_TABLES                         69
#define TK_STABLES                        70
#define TK_VGROUPS                        71
#define TK_DROP                           72
#define TK_TOPIC                          73
#define TK_FUNCTION                       74
#define TK_DNODE                          75
#define TK_USER                           76
#define TK_ACCOUNT                        77
#define TK_USE                            78
#define TK_DESCRIBE                       79
#define TK_DESC                           80
#define TK_ALTER                          81
#define TK_PASS                           82
#define TK_PRIVILEGE                      83
#define TK_LOCAL                          84
#define TK_COMPACT                        85
#define TK_LP                             86
#define TK_RP                             87
#define TK_IF                             88
#define TK_EXISTS                         89
#define TK_AS                             90
#define TK_OUTPUTTYPE                     91
#define TK_AGGREGATE                      92
#define TK_BUFSIZE                        93
#define TK_PPS                            94
#define TK_TSERIES                        95
#define TK_DBS                            96
#define TK_STORAGE                        97
#define TK_QTIME                          98
#define TK_CONNS                          99
#define TK_STATE                          100
#define TK_COMMA                          101
#define TK_KEEP                           102
#define TK_CACHE                          103
#define TK_REPLICA                        104
#define TK_QUORUM                         105
#define TK_DAYS                           106
#define TK_MINROWS                        107
#define TK_MAXROWS                        108
#define TK_BLOCKS                         109
#define TK_CTIME                          110
#define TK_WAL                            111
#define TK_FSYNC                          112
#define TK_COMP                           113
#define TK_PRECISION                      114
#define TK_UPDATE                         115
#define TK_CACHELAST                      116
#define TK_PARTITIONS                     117
#define TK_UNSIGNED                       118
#define TK_TAGS                           119
#define TK_USING                          120
#define TK_NULL                           121
#define TK_NOW                            122
#define TK_SELECT                         123
#define TK_UNION                          124
#define TK_ALL                            125
#define TK_DISTINCT                       126
#define TK_FROM                           127
#define TK_VARIABLE                       128
#define TK_INTERVAL                       129
#define TK_EVERY                          130
#define TK_SESSION                        131
#define TK_STATE_WINDOW                   132
#define TK_FILL                           133
#define TK_SLIDING                        134
#define TK_ORDER                          135
#define TK_BY                             136
#define TK_ASC                            137
#define TK_GROUP                          138
#define TK_HAVING                         139
#define TK_LIMIT                          140
#define TK_OFFSET                         141
#define TK_SLIMIT                         142
#define TK_SOFFSET                        143
#define TK_WHERE                          144
#define TK_RESET                          145
#define TK_QUERY                          146
#define TK_SYNCDB                         147
#define TK_ADD                            148
#define TK_COLUMN                         149
#define TK_MODIFY                         150
#define TK_TAG                            151
#define TK_CHANGE                         152
#define TK_SET                            153
#define TK_KILL                           154
#define TK_CONNECTION                     155
#define TK_STREAM                         156
#define TK_COLON                          157
#define TK_ABORT                          158
#define TK_AFTER                          159
#define TK_ATTACH                         160
#define TK_BEFORE                         161
#define TK_BEGIN                          162
#define TK_CASCADE                        163
#define TK_CLUSTER                        164
#define TK_CONFLICT                       165
#define TK_COPY                           166
#define TK_DEFERRED                       167
#define TK_DELIMITERS                     168
#define TK_DETACH                         169
#define TK_EACH                           170
#define TK_END                            171
#define TK_EXPLAIN                        172
#define TK_FAIL                           173
#define TK_FOR                            174
#define TK_IGNORE                         175
#define TK_IMMEDIATE                      176
#define TK_INITIALLY                      177
#define TK_INSTEAD                        178
#define TK_KEY                            179
#define TK_OF                             180
#define TK_RAISE                          181
#define TK_REPLACE                        182
#define TK_RESTRICT                       183
#define TK_ROW                            184
#define TK_STATEMENT                      185
#define TK_TRIGGER                        186
#define TK_VIEW                           187
#define TK_IPTOKEN                        188
#define TK_SEMI                           189
#define TK_NONE                           190
#define TK_PREV                           191
#define TK_LINEAR                         192
#define TK_IMPORT                         193
#define TK_TBNAME                         194
#define TK_JOIN                           195
#define TK_INSERT                         196
#define TK_INTO                           197
#define TK_VALUES                         198
#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 279
#define YYACTIONTYPE unsigned short int
#define ParseTOKENTYPE SStrToken
typedef union {
  int yyinit;
  ParseTOKENTYPE yy0;
  SCreatedTableInfo yy78;
  SCreateTableSql* yy110;
  SLimitVal yy126;
  int yy130;
  SArray* yy135;
  SIntervalVal yy160;
  TAOS_FIELD yy181;
  SCreateDbInfo yy256;
  SWindowStateVal yy258;
  int32_t yy262;
  SCreateAcctInfo yy277;
  tVariant yy308;
  SRelationInfo* yy460;
  SSqlNode* yy488;
  SSessionWindowVal yy511;
  tSqlExpr* yy526;
  int64_t yy531;
} 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             373
#define YYNRULE              295
#define YYNRULE_WITH_ACTION  295
#define YYNTOKEN             198
#define YY_MAX_SHIFT         372
#define YY_MIN_SHIFTREDUCE   578
#define YY_MAX_SHIFTREDUCE   872
#define YY_ERROR_ACTION      873
#define YY_ACCEPT_ACTION     874
#define YY_NO_ACTION         875
#define YY_MIN_REDUCE        876
#define YY_MAX_REDUCE        1170
/************* 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 (788)
static const YYACTIONTYPE yy_action[] = {
 /*     0 */  1026,  630,  158,  630,  212,  257,  251,  165,  261,  631,
 /*    10 */  1054,  631,  666,   60,   61, 1146,   64,   65,  371,  235,
 /*    20 */   260,   54,   53,  630,   63,  329,   68,   66,   69,   67,
 /*    30 */  1002,  631, 1000, 1001,   59,   58,  165, 1003,   57,   56,
 /*    40 */    55, 1004, 1045, 1005, 1006,   52,   51,  248,   60,   61,
 /*    50 */   241,   64,   65,   23, 1032,  260,   54,   53,  238,   63,
 /*    60 */   329,   68,   66,   69,   67,  212,  212,   98,  212,   59,
 /*    70 */    58,  289,  288,   57,   56,   55, 1147, 1147, 1051, 1147,
 /*    80 */    52,   51, 1092,   60,   61, 1031,   64,   65, 1018,   83,
 /*    90 */   260,   54,   53,   38,   63,  329,   68,   66,   69,   67,
 /*   100 */  1015, 1016,   35, 1019,   59,   58,   89,   29,   57,   56,
 /*   110 */    55, 1093,  126,  301,  247,   52,   51,  327, 1032,   60,
 /*   120 */    62,  808,   64,   65,  359,  249,  260,   54,   53, 1032,
 /*   130 */    63,  329,   68,   66,   69,   67,  773,  774,  237,  165,
 /*   140 */    59,   58, 1029,   45,   57,   56,   55,   61,  630,   64,
 /*   150 */    65,   52,   51,  260,   54,   53,  631,   63,  329,   68,
 /*   160 */    66,   69,   67,   44,  165,  366,  365,   59,   58,  359,
 /*   170 */   364,   57,   56,   55,  363,  327,  362,  361,   52,   51,
 /*   180 */   994,  982,  983,  984,  985,  986,  987,  988,  989,  990,
 /*   190 */   991,  992,  993,  995,  996,  579,  580,  581,  582,  583,
 /*   200 */   584,  585,  586,  587,  588,  589,  590,  591,  592,  156,
 /*   210 */   209,  236,   64,   65,   95,   38,  260,   54,   53,   96,
 /*   220 */    63,  329,   68,   66,   69,   67,  370,  369,  149,   38,
 /*   230 */    59,   58,  101,   84,   57,   56,   55,  303,  210,   94,
 /*   240 */   174,   52,   51,   44,  325,  366,  365,  324,  323,  322,
 /*   250 */   364,  321,  320,  319,  363,  318,  362,  361,  291,   24,
 /*   260 */   245,  259,  823,  925, 1029,  812,  935,  815, 1020,  818,
 /*   270 */   193,  259,  823,  193,  246,  812,  220,  815, 1029,  818,
 /*   280 */    57,   56,   55,  222,  155,  153,  152,   52,   51,  140,
 /*   290 */   139,  138,  221, 1045,  233,  234,  334,   89,  330,   68,
 /*   300 */    66,   69,   67,  926,  233,  234,  283,   59,   58,  239,
 /*   310 */   193,   57,   56,   55,    5,   41,  183,  714,   52,   51,
 /*   320 */    39,  182,  107,  112,  103,  111,  874,  372,  738,   38,
 /*   330 */    38,  735,   14,  736,   45,  737,   97,  263,  252,   38,
 /*   340 */   314,  124,  118,  129,  274,   70,  349,  348,  128,  268,
 /*   350 */   134,  137,  127,  278,  277,   70,  281,  269,   81,  131,
 /*   360 */   265,  266,  203,  201,  199,  231,  100,   38,  179,  198,
 /*   370 */   144,  143,  142,  141,  338,   38, 1045,   38, 1029, 1028,
 /*   380 */   824,  819,  269,   38,  339,  269,   38,  820, 1029,   38,
 /*   390 */   824,  819,  282,  180,   59,   58, 1030,  820,   57,   56,
 /*   400 */    55,  814,   82,  817,  754,   52,   51,  813,  790,  816,
 /*   410 */   367,  963,  340,  264,   86,  262, 1029,  337,  336,  751,
 /*   420 */   341,   87,  345,  770, 1029,  270, 1029,  267,  346,  344,
 /*   430 */   343,  347, 1029,   74,  351, 1029, 1017,  160, 1029,    1,
 /*   440 */   181,    3,  194,  780,   77,    9,  739,  740,  781,  724,
 /*   450 */   306,  285,  258,  726,  308,  725,   34,   71,  285,  847,
 /*   460 */    52,   51,   26,   39,   39,  789,  825,   71,   99,   71,
 /*   470 */   810,  331,  629,   25,    6,   75,  743,   80,  744,   16,
 /*   480 */    25,   15,  136,  135,   78,  741,   25,  742,  117,  309,
 /*   490 */   116,  758,  253,   18,   20,   17,   19,  123,   22,  122,
 /*   500 */    21,  215,  216,  254,  279,  255,  256,  811,  227,  713,
 /*   510 */   228,  213,  214,  217, 1166,  211,  157,  218,  219,  224,
 /*   520 */   225,  226,  223,  821,  208, 1158, 1103, 1102,  243,  822,
 /*   530 */  1099, 1098,  244,  350, 1053,   48, 1064, 1046, 1061, 1062,
 /*   540 */   154, 1066,  286,  159, 1085, 1043, 1027,  164,  297,  315,
 /*   550 */  1084,  175,  176, 1025,  177,  178,  940,  998,  311,  312,
 /*   560 */   173,  313,  769,  166,  167,  316,  290,  240,  168,  169,
 /*   570 */   317,  292,   46,  294,  206,   42,  827,  328,  934,  335,
 /*   580 */    79, 1165,  114, 1164, 1161,  184,   76,  342, 1157,  304,
 /*   590 */   120, 1156,   50, 1153,  185,  960,  302,   43,   40,   47,
 /*   600 */   207,  293,  300,  922,  130,  920,  132,  133,  918,  917,
 /*   610 */   271,  196,  197,  914,  913,  298,  912,  911,  910,  909,
 /*   620 */   908,  200,  202,  905,  903,  901,  899,  204,  896,  205,
 /*   630 */   892,  296,  172,  284,   85,   90,  295,   49, 1086,  360,
 /*   640 */   125,  352,  232,  353,  250,  310,  354,  355,  356,  357,
 /*   650 */   229,  358,  230,  368,  872,  108,  939,  109,  938,  272,
 /*   660 */   273,  871,  275,  276,  870,  853,  852,  280,  916,  915,
 /*   670 */   285,  187,  961,  186,  907,  188,  189,  190,  192,  191,
 /*   680 */     4,  145,  146,    2,  147,  906,  305,  898,  962,  148,
 /*   690 */   897,   33,   10,   88,  746,  170,  171,   30,  287,   91,
 /*   700 */   771,  161, 1008,  782,  162,  163,  776,   92,  242,  778,
 /*   710 */    93,  299,   11,   31,   12,   32,   13,   27,  307,   28,
 /*   720 */   100,  102,  644,   36,  104,  105,   37,  106,  679,  677,
 /*   730 */   676,  675,  673,  672,  671,  668,  634,  326,  110,    7,
 /*   740 */   332,  828,  333,  113,  115,   39,  826,    8,   72,   73,
 /*   750 */   716,  715,  119,  121,  712,  660,  658,  650,  656,  652,
 /*   760 */   654,  648,  646,  682,  681,  680,  678,  674,  670,  669,
 /*   770 */   195,  632,  596,  876,  875,  875,  875,  875,  875,  875,
 /*   780 */   875,  875,  875,  875,  875,  875,  150,  151,
};
static const YYCODETYPE yy_lookahead[] = {
 /*     0 */   200,    1,  200,    1,  267,  207,  207,  200,  207,    9,
 /*    10 */   200,    9,    5,   13,   14,  278,   16,   17,  200,  201,
 /*    20 */    20,   21,   22,    1,   24,   25,   26,   27,   28,   29,
 /*    30 */   224,    9,  226,  227,   34,   35,  200,  231,   38,   39,
 /*    40 */    40,  235,  248,  237,  238,   45,   46,  247,   13,   14,
 /*    50 */   246,   16,   17,  267,  250,   20,   21,   22,  264,   24,
 /*    60 */    25,   26,   27,   28,   29,  267,  267,  208,  267,   34,
 /*    70 */    35,  269,  270,   38,   39,   40,  278,  278,  268,  278,
 /*    80 */    45,   46,  275,   13,   14,  250,   16,   17,    0,   89,
 /*    90 */    20,   21,   22,  200,   24,   25,   26,   27,   28,   29,
 /*   100 */   241,  242,  243,  244,   34,   35,   85,   85,   38,   39,
 /*   110 */    40,  275,   81,  277,  246,   45,   46,   87,  250,   13,
 /*   120 */    14,   86,   16,   17,   93,  246,   20,   21,   22,  250,
 /*   130 */    24,   25,   26,   27,   28,   29,  128,  129,  245,  200,
 /*   140 */    34,   35,  249,  122,   38,   39,   40,   14,    1,   16,
 /*   150 */    17,   45,   46,   20,   21,   22,    9,   24,   25,   26,
 /*   160 */    27,   28,   29,  101,  200,  103,  104,   34,   35,   93,
 /*   170 */   108,   38,   39,   40,  112,   87,  114,  115,   45,   46,
 /*   180 */   224,  225,  226,  227,  228,  229,  230,  231,  232,  233,
 /*   190 */   234,  235,  236,  237,  238,   48,   49,   50,   51,   52,
 /*   200 */    53,   54,   55,   56,   57,   58,   59,   60,   61,   62,
 /*   210 */   267,   64,   16,   17,  275,  200,   20,   21,   22,  251,
 /*   220 */    24,   25,   26,   27,   28,   29,   68,   69,   70,  200,
 /*   230 */    34,   35,  208,  265,   38,   39,   40,  273,  267,  275,
 /*   240 */   254,   45,   46,  101,  102,  103,  104,  105,  106,  107,
 /*   250 */   108,  109,  110,  111,  112,  113,  114,  115,  272,   47,
 /*   260 */   245,    1,    2,  206,  249,    5,  206,    7,  244,    9,
 /*   270 */   213,    1,    2,  213,  245,    5,   64,    7,  249,    9,
 /*   280 */    38,   39,   40,   71,   65,   66,   67,   45,   46,   77,
 /*   290 */    78,   79,   80,  248,   34,   35,   84,   85,   38,   26,
 /*   300 */    27,   28,   29,  206,   34,   35,   86,   34,   35,  264,
 /*   310 */   213,   38,   39,   40,   65,   66,   67,    5,   45,   46,
 /*   320 */   100,   72,   73,   74,   75,   76,  198,  199,    2,  200,
 /*   330 */   200,    5,   85,    7,  122,    9,   89,   71,  267,  200,
 /*   340 */    91,   65,   66,   67,  145,   85,   34,   35,   72,   71,
 /*   350 */    74,   75,   76,  154,  155,   85,  144,  200,  146,   83,
 /*   360 */    34,   35,   65,   66,   67,  153,  119,  200,  211,   72,
 /*   370 */    73,   74,   75,   76,  245,  200,  248,  200,  249,  249,
 /*   380 */   120,  121,  200,  200,  245,  200,  200,  127,  249,  200,
 /*   390 */   120,  121,  264,  211,   34,   35,  211,  127,   38,   39,
 /*   400 */    40,    5,  208,    7,   38,   45,   46,    5,   79,    7,
 /*   410 */   222,  223,  245,  147,   86,  149,  249,  151,  152,  100,
 /*   420 */   245,   86,  245,   86,  249,  147,  249,  149,  245,  151,
 /*   430 */   152,  245,  249,  100,  245,  249,  242,  100,  249,  209,
 /*   440 */   210,  204,  205,   86,  100,  126,  120,  121,   86,   86,
 /*   450 */    86,  123,   63,   86,   86,   86,   85,  100,  123,   86,
 /*   460 */    45,   46,  100,  100,  100,  136,   86,  100,  100,  100,
 /*   470 */     1,   15,   86,  100,   85,  142,    5,   85,    7,  148,
 /*   480 */   100,  150,   81,   82,  140,    5,  100,    7,  148,  118,
 /*   490 */   150,  125,  267,  148,  148,  150,  150,  148,  148,  150,
 /*   500 */   150,  267,  267,  267,  200,  267,  267,   38,  267,  117,
 /*   510 */   267,  267,  267,  267,  250,  267,  200,  267,  267,  267,
 /*   520 */   267,  267,  267,  127,  267,  250,  240,  240,  240,  127,
 /*   530 */   240,  240,  240,  240,  200,  266,  200,  248,  200,  200,
 /*   540 */    63,  200,  248,  200,  276,  263,  248,  200,  200,   92,
 /*   550 */   276,  252,  200,  200,  200,  200,  200,  239,  200,  200,
 /*   560 */   255,  200,  127,  262,  261,  200,  271,  271,  260,  259,
 /*   570 */   200,  271,  200,  271,  200,  200,  120,  200,  200,  200,
 /*   580 */   139,  200,  200,  200,  200,  200,  141,  200,  200,  134,
 /*   590 */   200,  200,  138,  200,  200,  200,  137,  200,  200,  200,
 /*   600 */   200,  133,  132,  200,  200,  200,  200,  200,  200,  200,
 /*   610 */   200,  200,  200,  200,  200,  131,  200,  200,  200,  200,
 /*   620 */   200,  200,  200,  200,  200,  200,  200,  200,  200,  200,
 /*   630 */   200,  130,  256,  202,  202,  202,  202,  143,  202,  116,
 /*   640 */    99,   98,  202,   54,  202,  202,   95,   97,   58,   96,
 /*   650 */   202,   94,  202,   87,    5,  208,  212,  208,  212,  156,
 /*   660 */     5,    5,  156,    5,    5,  103,  102,  145,  202,  202,
 /*   670 */   123,  219,  221,  220,  202,  215,  218,  216,  214,  217,
 /*   680 */   204,  203,  203,  209,  203,  202,  118,  202,  223,  203,
 /*   690 */   202,  253,   85,  124,   86,  258,  257,   85,  100,  100,
 /*   700 */    86,   85,  239,   86,   85,  100,   86,   85,    1,   86,
 /*   710 */    85,   85,  135,  100,  135,  100,   85,   85,  118,   85,
 /*   720 */   119,   81,    5,   90,   89,   73,   90,   89,    9,    5,
 /*   730 */     5,    5,    5,    5,    5,    5,   88,   15,   81,   85,
 /*   740 */    25,  120,   62,  150,  150,  100,   86,   85,   16,   16,
 /*   750 */     5,    5,  150,  150,   86,    5,    5,    5,    5,    5,
 /*   760 */     5,    5,    5,    5,    5,    5,    5,    5,    5,    5,
 /*   770 */   100,   88,   63,    0,  279,  279,  279,  279,  279,  279,
 /*   780 */   279,  279,  279,  279,  279,  279,   21,   21,  279,  279,
 /*   790 */   279,  279,  279,  279,  279,  279,  279,  279,  279,  279,
 /*   800 */   279,  279,  279,  279,  279,  279,  279,  279,  279,  279,
 /*   810 */   279,  279,  279,  279,  279,  279,  279,  279,  279,  279,
 /*   820 */   279,  279,  279,  279,  279,  279,  279,  279,  279,  279,
 /*   830 */   279,  279,  279,  279,  279,  279,  279,  279,  279,  279,
 /*   840 */   279,  279,  279,  279,  279,  279,  279,  279,  279,  279,
 /*   850 */   279,  279,  279,  279,  279,  279,  279,  279,  279,  279,
 /*   860 */   279,  279,  279,  279,  279,  279,  279,  279,  279,  279,
 /*   870 */   279,  279,  279,  279,  279,  279,  279,  279,  279,  279,
 /*   880 */   279,  279,  279,  279,  279,  279,  279,  279,  279,  279,
 /*   890 */   279,  279,  279,  279,  279,  279,  279,  279,  279,  279,
 /*   900 */   279,  279,  279,  279,  279,  279,  279,  279,  279,  279,
 /*   910 */   279,  279,  279,  279,  279,  279,  279,  279,  279,  279,
 /*   920 */   279,  279,  279,  279,  279,  279,  279,  279,  279,  279,
 /*   930 */   279,  279,  279,  279,  279,  279,  279,  279,  279,  279,
 /*   940 */   279,  279,  279,  279,  279,  279,  279,  279,  279,  279,
 /*   950 */   279,  279,  279,  279,  279,  279,  279,  279,  279,  279,
 /*   960 */   279,  279,  279,  279,  279,  279,  279,  279,  279,  279,
 /*   970 */   279,  279,  279,  279,  279,  279,  279,  279,  279,  279,
 /*   980 */   279,  279,  279,  279,  279,  279,
};
#define YY_SHIFT_COUNT    (372)
#define YY_SHIFT_MIN      (0)
#define YY_SHIFT_MAX      (773)
static const unsigned short int yy_shift_ofst[] = {
 /*     0 */   212,  142,  142,   62,   62,   30,  260,  270,  270,   22,
 /*    10 */     2,    2,    2,    2,    2,    2,    2,    2,    2,    2,
 /*    20 */     2,    2,    2,    0,  147,  270,  326,  326,  326,   21,
 /*    30 */    21,    2,    2,    8,    2,   88,    2,    2,    2,    2,
 /*    40 */    31,   30,   76,   76,    7,  788,  788,  788,  270,  270,
 /*    50 */   270,  270,  270,  270,  270,  270,  270,  270,  270,  270,
 /*    60 */   270,  270,  270,  270,  270,  270,  270,  270,  270,  270,
 /*    70 */   270,  326,  326,  326,  312,  312,  312,  312,  312,  312,
 /*    80 */   312,    2,    2,    2,  366,    2,    2,    2,   21,   21,
 /*    90 */     2,    2,    2,    2,  329,  329,  319,   21,    2,    2,
 /*   100 */     2,    2,    2,    2,    2,    2,    2,    2,    2,    2,
 /*   110 */     2,    2,    2,    2,    2,    2,    2,    2,    2,    2,
 /*   120 */     2,    2,    2,    2,    2,    2,    2,    2,    2,    2,
 /*   130 */     2,    2,    2,    2,    2,    2,    2,    2,    2,    2,
 /*   140 */     2,    2,    2,    2,    2,    2,    2,    2,    2,    2,
 /*   150 */     2,    2,    2,    2,    2,    2,    2,  477,  477,  477,
 /*   160 */   435,  435,  435,  435,  477,  477,  441,  445,  455,  454,
 /*   170 */   459,  470,  484,  501,  468,  494,  477,  477,  477,  457,
 /*   180 */   457,  523,   30,   30,  477,  477,  541,  543,  589,  551,
 /*   190 */   550,  590,  553,  557,  523,    7,  477,  477,  566,  566,
 /*   200 */   477,  566,  477,  566,  477,  477,  788,  788,   35,   70,
 /*   210 */    70,  106,   70,  133,  196,  273,  273,  273,  273,  273,
 /*   220 */   249,  276,  297,  360,  360,  360,  360,  242,  242,  266,
 /*   230 */   278,  199,  247,  396,  402,  158,  219,  220,  328,  335,
 /*   240 */   337,  357,  362,  333,  344,  363,  364,  367,  368,  369,
 /*   250 */   371,  373,  415,  415,  415,  415,  415,  380,  469,  389,
 /*   260 */   456,  386,  331,  340,  345,  471,  480,  346,  349,  392,
 /*   270 */   350,  401,  649,  503,  655,  656,  506,  658,  659,  562,
 /*   280 */   564,  522,  547,  568,  607,  569,  608,  612,  598,  599,
 /*   290 */   614,  616,  617,  619,  620,  605,  622,  623,  625,  707,
 /*   300 */   626,  613,  577,  615,  579,  631,  568,  632,  600,  634,
 /*   310 */   601,  640,  633,  635,  652,  717,  636,  638,  719,  724,
 /*   320 */   725,  726,  727,  728,  729,  730,  648,  722,  657,  654,
 /*   330 */   660,  621,  662,  715,  680,  732,  593,  594,  645,  645,
 /*   340 */   645,  645,  733,  602,  603,  645,  645,  645,  745,  746,
 /*   350 */   668,  645,  750,  751,  752,  753,  754,  755,  756,  757,
 /*   360 */   758,  759,  760,  761,  762,  763,  764,  670,  683,  765,
 /*   370 */   766,  709,  773,
};
#define YY_REDUCE_COUNT (207)
#define YY_REDUCE_MIN   (-263)
#define YY_REDUCE_MAX   (488)
static const short yy_reduce_ofst[] = {
 /*     0 */   128,  -44,  -44, -194, -194, -141, -202, -201, -199, -198,
 /*    10 */  -107, -164,  -36,   15,   29,  129,  139,  167,  175,  177,
 /*    20 */   183,  186,  189, -190, -182, -263, -196, -132, -121, -206,
 /*    30 */    45, -193,  -61,  -14, -200,   24,  157,  182,  185,  130,
 /*    40 */    57,  194,   60,   97,  188,  -32,  230,  237, -214,  -57,
 /*    50 */   -29,   71,  225,  234,  235,  236,  238,  239,  241,  243,
 /*    60 */   244,  245,  246,  248,  250,  251,  252,  253,  254,  255,
 /*    70 */   257, -165,  264,  275,  286,  287,  288,  290,  291,  292,
 /*    80 */   293,  304,  316,  334,  269,  336,  338,  339,  289,  294,
 /*    90 */   341,  343,  347,  348,  268,  274,  299,  298,  352,  353,
 /*   100 */   354,  355,  356,  358,  359,  361,  365,  370,  372,  374,
 /*   110 */   375,  377,  378,  379,  381,  382,  383,  384,  385,  387,
 /*   120 */   388,  390,  391,  393,  394,  395,  397,  398,  399,  400,
 /*   130 */   403,  404,  405,  406,  407,  408,  409,  410,  411,  412,
 /*   140 */   413,  414,  416,  417,  418,  419,  420,  421,  422,  423,
 /*   150 */   424,  425,  426,  427,  428,  429,  430,  431,  432,  433,
 /*   160 */   295,  296,  300,  302,  434,  436,  282,  301,  303,  308,
 /*   170 */   310,  437,  439,  376,  305,  438,  440,  442,  443,  444,
 /*   180 */   446,  318,  447,  449,  448,  450,  451,  453,  452,  460,
 /*   190 */   458,  461,  462,  464,  463,  465,  466,  467,  478,  479,
 /*   200 */   472,  481,  483,  486,  485,  488,  474,  476,
};
static const YYACTIONTYPE yy_default[] = {
 /*     0 */   873,  997,  936, 1007,  923,  933, 1149, 1149, 1149,  873,
 /*    10 */   873,  873,  873,  873,  873,  873,  873,  873,  873,  873,
 /*    20 */   873,  873,  873, 1055,  893, 1149,  873,  873,  873,  873,
 /*    30 */   873,  873,  873, 1070,  873,  933,  873,  873,  873,  873,
 /*    40 */   943,  933,  943,  943,  873, 1050,  981,  999,  873,  873,
 /*    50 */   873,  873,  873,  873,  873,  873,  873,  873,  873,  873,
 /*    60 */   873,  873,  873,  873,  873,  873,  873,  873,  873,  873,
 /*    70 */   873,  873,  873,  873,  873,  873,  873,  873,  873,  873,
 /*    80 */   873,  873,  873,  873, 1057, 1063, 1060,  873,  873,  873,
 /*    90 */  1065,  873,  873,  873, 1089, 1089, 1048,  873,  873,  873,
 /*   100 */   873,  873,  873,  873,  873,  873,  873,  873,  873,  873,
 /*   110 */   873,  873,  873,  873,  873,  873,  873,  873,  873,  873,
 /*   120 */   873,  873,  873,  873,  873,  873,  873,  873,  873,  873,
 /*   130 */   921,  873,  919,  873,  873,  873,  873,  873,  873,  873,
 /*   140 */   873,  873,  873,  873,  873,  873,  873,  873,  873,  904,
 /*   150 */   873,  873,  873,  873,  873,  873,  891,  895,  895,  895,
 /*   160 */   873,  873,  873,  873,  895,  895, 1096, 1100, 1082, 1094,
 /*   170 */  1090, 1077, 1075, 1073, 1081, 1104,  895,  895,  895,  941,
 /*   180 */   941,  937,  933,  933,  895,  895,  959,  957,  955,  947,
 /*   190 */   953,  949,  951,  945,  924,  873,  895,  895,  931,  931,
 /*   200 */   895,  931,  895,  931,  895,  895,  981,  999,  873, 1105,
 /*   210 */  1095,  873, 1148, 1135, 1134, 1142, 1141, 1133, 1132, 1131,
 /*   220 */   873,  873,  873, 1127, 1130, 1129, 1128, 1137, 1136,  873,
 /*   230 */   873,  873,  873,  873,  873,  873,  873,  873,  873,  873,
 /*   240 */   873,  873,  873, 1101, 1097,  873,  873,  873,  873,  873,
 /*   250 */   873,  873, 1144, 1143, 1140, 1139, 1138,  873,  873, 1107,
 /*   260 */   873,  873,  873,  873,  873,  873,  873,  873,  873, 1009,
 /*   270 */   873,  873,  873,  873,  873,  873,  873,  873,  873,  873,
 /*   280 */   873,  873, 1047,  873,  873,  873,  873,  873, 1059, 1058,
 /*   290 */   873,  873,  873,  873,  873,  873,  873,  873,  873,  873,
 /*   300 */   873, 1091,  873, 1083,  873,  873, 1021,  873,  873,  873,
 /*   310 */   873,  873,  873,  873,  873,  873,  873,  873,  873,  873,
 /*   320 */   873,  873,  873,  873,  873,  873,  873,  873,  873,  873,
 /*   330 */   873,  873,  873,  873,  873,  873,  873,  873, 1167, 1162,
 /*   340 */  1163, 1160,  873,  873,  873, 1159, 1154, 1155,  873,  873,
 /*   350 */   873, 1152,  873,  873,  873,  873,  873,  873,  873,  873,
 /*   360 */   873,  873,  873,  873,  873,  873,  873,  965,  873,  902,
 /*   370 */   900,  873,  873,
};
/********** 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 */
    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,  /*       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 */
};
#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 */ "OR",
  /*   14 */ "AND",
  /*   15 */ "NOT",
  /*   16 */ "EQ",
  /*   17 */ "NE",
  /*   18 */ "ISNULL",
  /*   19 */ "NOTNULL",
  /*   20 */ "IS",
  /*   21 */ "LIKE",
  /*   22 */ "MATCH",
  /*   23 */ "GLOB",
  /*   24 */ "BETWEEN",
  /*   25 */ "IN",
  /*   26 */ "GT",
  /*   27 */ "GE",
  /*   28 */ "LT",
  /*   29 */ "LE",
  /*   30 */ "BITAND",
  /*   31 */ "BITOR",
  /*   32 */ "LSHIFT",
  /*   33 */ "RSHIFT",
  /*   34 */ "PLUS",
  /*   35 */ "MINUS",
  /*   36 */ "DIVIDE",
  /*   37 */ "TIMES",
  /*   38 */ "STAR",
  /*   39 */ "SLASH",
  /*   40 */ "REM",
  /*   41 */ "CONCAT",
  /*   42 */ "UMINUS",
  /*   43 */ "UPLUS",
  /*   44 */ "BITNOT",
  /*   45 */ "QUESTION",
  /*   46 */ "ARROW",
  /*   47 */ "SHOW",
  /*   48 */ "DATABASES",
  /*   49 */ "TOPICS",
  /*   50 */ "FUNCTIONS",
  /*   51 */ "MNODES",
  /*   52 */ "DNODES",
  /*   53 */ "ACCOUNTS",
  /*   54 */ "USERS",
  /*   55 */ "MODULES",
  /*   56 */ "QUERIES",
  /*   57 */ "CONNECTIONS",
  /*   58 */ "STREAMS",
  /*   59 */ "VARIABLES",
  /*   60 */ "SCORES",
  /*   61 */ "GRANTS",
  /*   62 */ "VNODES",
  /*   63 */ "DOT",
  /*   64 */ "CREATE",
  /*   65 */ "TABLE",
  /*   66 */ "STABLE",
  /*   67 */ "DATABASE",
  /*   68 */ "TABLES",
  /*   69 */ "STABLES",
  /*   70 */ "VGROUPS",
  /*   71 */ "DROP",
  /*   72 */ "TOPIC",
  /*   73 */ "FUNCTION",
  /*   74 */ "DNODE",
  /*   75 */ "USER",
  /*   76 */ "ACCOUNT",
  /*   77 */ "USE",
  /*   78 */ "DESCRIBE",
  /*   79 */ "DESC",
  /*   80 */ "ALTER",
  /*   81 */ "PASS",
  /*   82 */ "PRIVILEGE",
  /*   83 */ "LOCAL",
  /*   84 */ "COMPACT",
  /*   85 */ "LP",
  /*   86 */ "RP",
  /*   87 */ "IF",
  /*   88 */ "EXISTS",
  /*   89 */ "AS",
  /*   90 */ "OUTPUTTYPE",
  /*   91 */ "AGGREGATE",
  /*   92 */ "BUFSIZE",
  /*   93 */ "PPS",
  /*   94 */ "TSERIES",
  /*   95 */ "DBS",
  /*   96 */ "STORAGE",
  /*   97 */ "QTIME",
  /*   98 */ "CONNS",
  /*   99 */ "STATE",
  /*  100 */ "COMMA",
  /*  101 */ "KEEP",
  /*  102 */ "CACHE",
  /*  103 */ "REPLICA",
  /*  104 */ "QUORUM",
  /*  105 */ "DAYS",
  /*  106 */ "MINROWS",
  /*  107 */ "MAXROWS",
  /*  108 */ "BLOCKS",
  /*  109 */ "CTIME",
  /*  110 */ "WAL",
  /*  111 */ "FSYNC",
  /*  112 */ "COMP",
  /*  113 */ "PRECISION",
  /*  114 */ "UPDATE",
  /*  115 */ "CACHELAST",
  /*  116 */ "PARTITIONS",
  /*  117 */ "UNSIGNED",
  /*  118 */ "TAGS",
  /*  119 */ "USING",
  /*  120 */ "NULL",
  /*  121 */ "NOW",
  /*  122 */ "SELECT",
  /*  123 */ "UNION",
  /*  124 */ "ALL",
  /*  125 */ "DISTINCT",
  /*  126 */ "FROM",
  /*  127 */ "VARIABLE",
  /*  128 */ "INTERVAL",
  /*  129 */ "EVERY",
  /*  130 */ "SESSION",
  /*  131 */ "STATE_WINDOW",
  /*  132 */ "FILL",
  /*  133 */ "SLIDING",
  /*  134 */ "ORDER",
  /*  135 */ "BY",
  /*  136 */ "ASC",
  /*  137 */ "GROUP",
  /*  138 */ "HAVING",
  /*  139 */ "LIMIT",
  /*  140 */ "OFFSET",
  /*  141 */ "SLIMIT",
  /*  142 */ "SOFFSET",
  /*  143 */ "WHERE",
  /*  144 */ "RESET",
  /*  145 */ "QUERY",
  /*  146 */ "SYNCDB",
  /*  147 */ "ADD",
  /*  148 */ "COLUMN",
  /*  149 */ "MODIFY",
  /*  150 */ "TAG",
  /*  151 */ "CHANGE",
  /*  152 */ "SET",
  /*  153 */ "KILL",
  /*  154 */ "CONNECTION",
  /*  155 */ "STREAM",
  /*  156 */ "COLON",
  /*  157 */ "ABORT",
  /*  158 */ "AFTER",
  /*  159 */ "ATTACH",
  /*  160 */ "BEFORE",
  /*  161 */ "BEGIN",
  /*  162 */ "CASCADE",
  /*  163 */ "CLUSTER",
  /*  164 */ "CONFLICT",
  /*  165 */ "COPY",
  /*  166 */ "DEFERRED",
  /*  167 */ "DELIMITERS",
  /*  168 */ "DETACH",
  /*  169 */ "EACH",
  /*  170 */ "END",
  /*  171 */ "EXPLAIN",
  /*  172 */ "FAIL",
  /*  173 */ "FOR",
  /*  174 */ "IGNORE",
  /*  175 */ "IMMEDIATE",
  /*  176 */ "INITIALLY",
  /*  177 */ "INSTEAD",
  /*  178 */ "KEY",
  /*  179 */ "OF",
  /*  180 */ "RAISE",
  /*  181 */ "REPLACE",
  /*  182 */ "RESTRICT",
  /*  183 */ "ROW",
  /*  184 */ "STATEMENT",
  /*  185 */ "TRIGGER",
  /*  186 */ "VIEW",
  /*  187 */ "IPTOKEN",
  /*  188 */ "SEMI",
  /*  189 */ "NONE",
  /*  190 */ "PREV",
  /*  191 */ "LINEAR",
  /*  192 */ "IMPORT",
  /*  193 */ "TBNAME",
  /*  194 */ "JOIN",
  /*  195 */ "INSERT",
  /*  196 */ "INTO",
  /*  197 */ "VALUES",
  /*  198 */ "program",
  /*  199 */ "cmd",
  /*  200 */ "ids",
  /*  201 */ "dbPrefix",
  /*  202 */ "cpxName",
  /*  203 */ "ifexists",
  /*  204 */ "alter_db_optr",
  /*  205 */ "alter_topic_optr",
  /*  206 */ "acct_optr",
  /*  207 */ "exprlist",
  /*  208 */ "ifnotexists",
  /*  209 */ "db_optr",
  /*  210 */ "topic_optr",
  /*  211 */ "typename",
  /*  212 */ "bufsize",
  /*  213 */ "pps",
  /*  214 */ "tseries",
  /*  215 */ "dbs",
  /*  216 */ "streams",
  /*  217 */ "storage",
  /*  218 */ "qtime",
  /*  219 */ "users",
  /*  220 */ "conns",
  /*  221 */ "state",
  /*  222 */ "intitemlist",
  /*  223 */ "intitem",
  /*  224 */ "keep",
  /*  225 */ "cache",
  /*  226 */ "replica",
  /*  227 */ "quorum",
  /*  228 */ "days",
  /*  229 */ "minrows",
  /*  230 */ "maxrows",
  /*  231 */ "blocks",
  /*  232 */ "ctime",
  /*  233 */ "wal",
  /*  234 */ "fsync",
  /*  235 */ "comp",
  /*  236 */ "prec",
  /*  237 */ "update",
  /*  238 */ "cachelast",
  /*  239 */ "partitions",
  /*  240 */ "signed",
  /*  241 */ "create_table_args",
  /*  242 */ "create_stable_args",
  /*  243 */ "create_table_list",
  /*  244 */ "create_from_stable",
  /*  245 */ "columnlist",
  /*  246 */ "tagitemlist",
  /*  247 */ "tagNamelist",
  /*  248 */ "select",
  /*  249 */ "column",
  /*  250 */ "tagitem",
  /*  251 */ "selcollist",
  /*  252 */ "from",
  /*  253 */ "where_opt",
  /*  254 */ "interval_option",
  /*  255 */ "sliding_opt",
  /*  256 */ "session_option",
  /*  257 */ "windowstate_option",
  /*  258 */ "fill_opt",
  /*  259 */ "groupby_opt",
  /*  260 */ "having_opt",
  /*  261 */ "orderby_opt",
  /*  262 */ "slimit_opt",
  /*  263 */ "limit_opt",
  /*  264 */ "union",
  /*  265 */ "sclp",
  /*  266 */ "distinct",
  /*  267 */ "expr",
  /*  268 */ "as",
  /*  269 */ "tablelist",
  /*  270 */ "sub",
  /*  271 */ "tmvar",
  /*  272 */ "intervalKey",
  /*  273 */ "sortlist",
  /*  274 */ "sortitem",
  /*  275 */ "item",
  /*  276 */ "sortorder",
  /*  277 */ "grouplist",
  /*  278 */ "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 ::= item sortorder",
 /* 210 */ "item ::= ids cpxName",
 /* 211 */ "sortorder ::= ASC",
 /* 212 */ "sortorder ::= DESC",
 /* 213 */ "sortorder ::=",
 /* 214 */ "groupby_opt ::=",
 /* 215 */ "groupby_opt ::= GROUP BY grouplist",
 /* 216 */ "grouplist ::= grouplist COMMA item",
 /* 217 */ "grouplist ::= item",
 /* 218 */ "having_opt ::=",
 /* 219 */ "having_opt ::= HAVING expr",
 /* 220 */ "limit_opt ::=",
 /* 221 */ "limit_opt ::= LIMIT signed",
 /* 222 */ "limit_opt ::= LIMIT signed OFFSET signed",
 /* 223 */ "limit_opt ::= LIMIT signed COMMA signed",
 /* 224 */ "slimit_opt ::=",
 /* 225 */ "slimit_opt ::= SLIMIT signed",
 /* 226 */ "slimit_opt ::= SLIMIT signed SOFFSET signed",
 /* 227 */ "slimit_opt ::= SLIMIT signed COMMA signed",
 /* 228 */ "where_opt ::=",
 /* 229 */ "where_opt ::= WHERE expr",
 /* 230 */ "expr ::= LP expr RP",
 /* 231 */ "expr ::= ID",
 /* 232 */ "expr ::= ID DOT ID",
 /* 233 */ "expr ::= ID DOT STAR",
 /* 234 */ "expr ::= INTEGER",
 /* 235 */ "expr ::= MINUS INTEGER",
 /* 236 */ "expr ::= PLUS INTEGER",
 /* 237 */ "expr ::= FLOAT",
 /* 238 */ "expr ::= MINUS FLOAT",
 /* 239 */ "expr ::= PLUS FLOAT",
 /* 240 */ "expr ::= STRING",
 /* 241 */ "expr ::= NOW",
 /* 242 */ "expr ::= VARIABLE",
 /* 243 */ "expr ::= PLUS VARIABLE",
 /* 244 */ "expr ::= MINUS VARIABLE",
 /* 245 */ "expr ::= BOOL",
 /* 246 */ "expr ::= NULL",
 /* 247 */ "expr ::= ID LP exprlist RP",
 /* 248 */ "expr ::= ID LP STAR RP",
 /* 249 */ "expr ::= expr IS NULL",
 /* 250 */ "expr ::= expr IS NOT NULL",
 /* 251 */ "expr ::= expr LT expr",
 /* 252 */ "expr ::= expr GT expr",
 /* 253 */ "expr ::= expr LE expr",
 /* 254 */ "expr ::= expr GE expr",
 /* 255 */ "expr ::= expr NE expr",
 /* 256 */ "expr ::= expr EQ expr",
 /* 257 */ "expr ::= expr BETWEEN expr AND expr",
 /* 258 */ "expr ::= expr AND expr",
 /* 259 */ "expr ::= expr OR expr",
 /* 260 */ "expr ::= expr PLUS expr",
 /* 261 */ "expr ::= expr MINUS expr",
 /* 262 */ "expr ::= expr STAR expr",
 /* 263 */ "expr ::= expr SLASH expr",
 /* 264 */ "expr ::= expr REM expr",
 /* 265 */ "expr ::= expr LIKE expr",
 /* 266 */ "expr ::= expr MATCH expr",
 /* 267 */ "expr ::= expr QUESTION expr",
 /* 268 */ "expr ::= expr ARROW expr",
 /* 269 */ "expr ::= expr IN LP exprlist RP",
 /* 270 */ "exprlist ::= exprlist COMMA expritem",
 /* 271 */ "exprlist ::= expritem",
 /* 272 */ "expritem ::= expr",
 /* 273 */ "expritem ::=",
 /* 274 */ "cmd ::= RESET QUERY CACHE",
 /* 275 */ "cmd ::= SYNCDB ids REPLICA",
 /* 276 */ "cmd ::= ALTER TABLE ids cpxName ADD COLUMN columnlist",
 /* 277 */ "cmd ::= ALTER TABLE ids cpxName DROP COLUMN ids",
 /* 278 */ "cmd ::= ALTER TABLE ids cpxName MODIFY COLUMN columnlist",
 /* 279 */ "cmd ::= ALTER TABLE ids cpxName ADD TAG columnlist",
 /* 280 */ "cmd ::= ALTER TABLE ids cpxName DROP TAG ids",
 /* 281 */ "cmd ::= ALTER TABLE ids cpxName CHANGE TAG ids ids",
 /* 282 */ "cmd ::= ALTER TABLE ids cpxName SET TAG ids EQ tagitem",
 /* 283 */ "cmd ::= ALTER TABLE ids cpxName MODIFY TAG columnlist",
 /* 284 */ "cmd ::= ALTER STABLE ids cpxName ADD COLUMN columnlist",
 /* 285 */ "cmd ::= ALTER STABLE ids cpxName DROP COLUMN ids",
 /* 286 */ "cmd ::= ALTER STABLE ids cpxName MODIFY COLUMN columnlist",
 /* 287 */ "cmd ::= ALTER STABLE ids cpxName ADD TAG columnlist",
 /* 288 */ "cmd ::= ALTER STABLE ids cpxName DROP TAG ids",
 /* 289 */ "cmd ::= ALTER STABLE ids cpxName CHANGE TAG ids ids",
 /* 290 */ "cmd ::= ALTER STABLE ids cpxName SET TAG ids EQ tagitem",
 /* 291 */ "cmd ::= ALTER STABLE ids cpxName MODIFY TAG columnlist",
 /* 292 */ "cmd ::= KILL CONNECTION INTEGER",
 /* 293 */ "cmd ::= KILL STREAM INTEGER COLON INTEGER",
 /* 294 */ "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 207: /* exprlist */
    case 251: /* selcollist */
    case 265: /* sclp */
{
#line 768 "sql.y"
tSqlExprListDestroy((yypminor->yy135));
#line 1726 "sql.c"
}
      break;
    case 222: /* intitemlist */
    case 224: /* keep */
    case 245: /* columnlist */
    case 246: /* tagitemlist */
    case 247: /* tagNamelist */
    case 258: /* fill_opt */
    case 259: /* groupby_opt */
    case 261: /* orderby_opt */
    case 273: /* sortlist */
    case 277: /* grouplist */
{
#line 257 "sql.y"
taosArrayDestroy((yypminor->yy135));
#line 1742 "sql.c"
}
      break;
    case 243: /* create_table_list */
{
#line 365 "sql.y"
destroyCreateTableSql((yypminor->yy110));
#line 1749 "sql.c"
}
      break;
    case 248: /* select */
{
#line 485 "sql.y"
destroySqlNode((yypminor->yy488));
#line 1756 "sql.c"
}
      break;
    case 252: /* from */
    case 269: /* tablelist */
    case 270: /* sub */
{
#line 540 "sql.y"
destroyRelationInfo((yypminor->yy460));
#line 1765 "sql.c"
}
      break;
    case 253: /* where_opt */
    case 260: /* having_opt */
    case 267: /* expr */
    case 278: /* expritem */
{
#line 692 "sql.y"
tSqlExprDestroy((yypminor->yy526));
#line 1775 "sql.c"
}
      break;
    case 264: /* union */
{
#line 493 "sql.y"
destroyAllSqlNode((yypminor->yy135));
#line 1782 "sql.c"
}
      break;
    case 274: /* sortitem */
{
#line 625 "sql.y"
tVariantDestroy(&(yypminor->yy308));
#line 1789 "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[] = {
   198,  /* (0) program ::= cmd */
   199,  /* (1) cmd ::= SHOW DATABASES */
   199,  /* (2) cmd ::= SHOW TOPICS */
   199,  /* (3) cmd ::= SHOW FUNCTIONS */
   199,  /* (4) cmd ::= SHOW MNODES */
   199,  /* (5) cmd ::= SHOW DNODES */
   199,  /* (6) cmd ::= SHOW ACCOUNTS */
   199,  /* (7) cmd ::= SHOW USERS */
   199,  /* (8) cmd ::= SHOW MODULES */
   199,  /* (9) cmd ::= SHOW QUERIES */
   199,  /* (10) cmd ::= SHOW CONNECTIONS */
   199,  /* (11) cmd ::= SHOW STREAMS */
   199,  /* (12) cmd ::= SHOW VARIABLES */
   199,  /* (13) cmd ::= SHOW SCORES */
   199,  /* (14) cmd ::= SHOW GRANTS */
   199,  /* (15) cmd ::= SHOW VNODES */
   199,  /* (16) cmd ::= SHOW VNODES ids */
   201,  /* (17) dbPrefix ::= */
   201,  /* (18) dbPrefix ::= ids DOT */
   202,  /* (19) cpxName ::= */
   202,  /* (20) cpxName ::= DOT ids */
   199,  /* (21) cmd ::= SHOW CREATE TABLE ids cpxName */
   199,  /* (22) cmd ::= SHOW CREATE STABLE ids cpxName */
   199,  /* (23) cmd ::= SHOW CREATE DATABASE ids */
   199,  /* (24) cmd ::= SHOW dbPrefix TABLES */
   199,  /* (25) cmd ::= SHOW dbPrefix TABLES LIKE ids */
   199,  /* (26) cmd ::= SHOW dbPrefix STABLES */
   199,  /* (27) cmd ::= SHOW dbPrefix STABLES LIKE ids */
   199,  /* (28) cmd ::= SHOW dbPrefix VGROUPS */
   199,  /* (29) cmd ::= SHOW dbPrefix VGROUPS ids */
   199,  /* (30) cmd ::= DROP TABLE ifexists ids cpxName */
   199,  /* (31) cmd ::= DROP STABLE ifexists ids cpxName */
   199,  /* (32) cmd ::= DROP DATABASE ifexists ids */
   199,  /* (33) cmd ::= DROP TOPIC ifexists ids */
   199,  /* (34) cmd ::= DROP FUNCTION ids */
   199,  /* (35) cmd ::= DROP DNODE ids */
   199,  /* (36) cmd ::= DROP USER ids */
   199,  /* (37) cmd ::= DROP ACCOUNT ids */
   199,  /* (38) cmd ::= USE ids */
   199,  /* (39) cmd ::= DESCRIBE ids cpxName */
   199,  /* (40) cmd ::= DESC ids cpxName */
   199,  /* (41) cmd ::= ALTER USER ids PASS ids */
   199,  /* (42) cmd ::= ALTER USER ids PRIVILEGE ids */
   199,  /* (43) cmd ::= ALTER DNODE ids ids */
   199,  /* (44) cmd ::= ALTER DNODE ids ids ids */
   199,  /* (45) cmd ::= ALTER LOCAL ids */
   199,  /* (46) cmd ::= ALTER LOCAL ids ids */
   199,  /* (47) cmd ::= ALTER DATABASE ids alter_db_optr */
   199,  /* (48) cmd ::= ALTER TOPIC ids alter_topic_optr */
   199,  /* (49) cmd ::= ALTER ACCOUNT ids acct_optr */
   199,  /* (50) cmd ::= ALTER ACCOUNT ids PASS ids acct_optr */
   199,  /* (51) cmd ::= COMPACT VNODES IN LP exprlist RP */
   200,  /* (52) ids ::= ID */
   200,  /* (53) ids ::= STRING */
   203,  /* (54) ifexists ::= IF EXISTS */
   203,  /* (55) ifexists ::= */
   208,  /* (56) ifnotexists ::= IF NOT EXISTS */
   208,  /* (57) ifnotexists ::= */
   199,  /* (58) cmd ::= CREATE DNODE ids */
   199,  /* (59) cmd ::= CREATE ACCOUNT ids PASS ids acct_optr */
   199,  /* (60) cmd ::= CREATE DATABASE ifnotexists ids db_optr */
   199,  /* (61) cmd ::= CREATE TOPIC ifnotexists ids topic_optr */
   199,  /* (62) cmd ::= CREATE FUNCTION ids AS ids OUTPUTTYPE typename bufsize */
   199,  /* (63) cmd ::= CREATE AGGREGATE FUNCTION ids AS ids OUTPUTTYPE typename bufsize */
   199,  /* (64) cmd ::= CREATE USER ids PASS ids */
   212,  /* (65) bufsize ::= */
   212,  /* (66) bufsize ::= BUFSIZE INTEGER */
   213,  /* (67) pps ::= */
   213,  /* (68) pps ::= PPS INTEGER */
   214,  /* (69) tseries ::= */
   214,  /* (70) tseries ::= TSERIES INTEGER */
   215,  /* (71) dbs ::= */
   215,  /* (72) dbs ::= DBS INTEGER */
   216,  /* (73) streams ::= */
   216,  /* (74) streams ::= STREAMS INTEGER */
   217,  /* (75) storage ::= */
   217,  /* (76) storage ::= STORAGE INTEGER */
   218,  /* (77) qtime ::= */
   218,  /* (78) qtime ::= QTIME INTEGER */
   219,  /* (79) users ::= */
   219,  /* (80) users ::= USERS INTEGER */
   220,  /* (81) conns ::= */
   220,  /* (82) conns ::= CONNS INTEGER */
   221,  /* (83) state ::= */
   221,  /* (84) state ::= STATE ids */
   206,  /* (85) acct_optr ::= pps tseries storage streams qtime dbs users conns state */
   222,  /* (86) intitemlist ::= intitemlist COMMA intitem */
   222,  /* (87) intitemlist ::= intitem */
   223,  /* (88) intitem ::= INTEGER */
   224,  /* (89) keep ::= KEEP intitemlist */
   225,  /* (90) cache ::= CACHE INTEGER */
   226,  /* (91) replica ::= REPLICA INTEGER */
   227,  /* (92) quorum ::= QUORUM INTEGER */
   228,  /* (93) days ::= DAYS INTEGER */
   229,  /* (94) minrows ::= MINROWS INTEGER */
   230,  /* (95) maxrows ::= MAXROWS INTEGER */
   231,  /* (96) blocks ::= BLOCKS INTEGER */
   232,  /* (97) ctime ::= CTIME INTEGER */
   233,  /* (98) wal ::= WAL INTEGER */
   234,  /* (99) fsync ::= FSYNC INTEGER */
   235,  /* (100) comp ::= COMP INTEGER */
   236,  /* (101) prec ::= PRECISION STRING */
   237,  /* (102) update ::= UPDATE INTEGER */
   238,  /* (103) cachelast ::= CACHELAST INTEGER */
   239,  /* (104) partitions ::= PARTITIONS INTEGER */
   209,  /* (105) db_optr ::= */
   209,  /* (106) db_optr ::= db_optr cache */
   209,  /* (107) db_optr ::= db_optr replica */
   209,  /* (108) db_optr ::= db_optr quorum */
   209,  /* (109) db_optr ::= db_optr days */
   209,  /* (110) db_optr ::= db_optr minrows */
   209,  /* (111) db_optr ::= db_optr maxrows */
   209,  /* (112) db_optr ::= db_optr blocks */
   209,  /* (113) db_optr ::= db_optr ctime */
   209,  /* (114) db_optr ::= db_optr wal */
   209,  /* (115) db_optr ::= db_optr fsync */
   209,  /* (116) db_optr ::= db_optr comp */
   209,  /* (117) db_optr ::= db_optr prec */
   209,  /* (118) db_optr ::= db_optr keep */
   209,  /* (119) db_optr ::= db_optr update */
   209,  /* (120) db_optr ::= db_optr cachelast */
   210,  /* (121) topic_optr ::= db_optr */
   210,  /* (122) topic_optr ::= topic_optr partitions */
   204,  /* (123) alter_db_optr ::= */
   204,  /* (124) alter_db_optr ::= alter_db_optr replica */
   204,  /* (125) alter_db_optr ::= alter_db_optr quorum */
   204,  /* (126) alter_db_optr ::= alter_db_optr keep */
   204,  /* (127) alter_db_optr ::= alter_db_optr blocks */
   204,  /* (128) alter_db_optr ::= alter_db_optr comp */
   204,  /* (129) alter_db_optr ::= alter_db_optr update */
   204,  /* (130) alter_db_optr ::= alter_db_optr cachelast */
   205,  /* (131) alter_topic_optr ::= alter_db_optr */
   205,  /* (132) alter_topic_optr ::= alter_topic_optr partitions */
   211,  /* (133) typename ::= ids */
   211,  /* (134) typename ::= ids LP signed RP */
   211,  /* (135) typename ::= ids UNSIGNED */
   240,  /* (136) signed ::= INTEGER */
   240,  /* (137) signed ::= PLUS INTEGER */
   240,  /* (138) signed ::= MINUS INTEGER */
   199,  /* (139) cmd ::= CREATE TABLE create_table_args */
   199,  /* (140) cmd ::= CREATE TABLE create_stable_args */
   199,  /* (141) cmd ::= CREATE STABLE create_stable_args */
   199,  /* (142) cmd ::= CREATE TABLE create_table_list */
   243,  /* (143) create_table_list ::= create_from_stable */
   243,  /* (144) create_table_list ::= create_table_list create_from_stable */
   241,  /* (145) create_table_args ::= ifnotexists ids cpxName LP columnlist RP */
   242,  /* (146) create_stable_args ::= ifnotexists ids cpxName LP columnlist RP TAGS LP columnlist RP */
   244,  /* (147) create_from_stable ::= ifnotexists ids cpxName USING ids cpxName TAGS LP tagitemlist RP */
   244,  /* (148) create_from_stable ::= ifnotexists ids cpxName USING ids cpxName LP tagNamelist RP TAGS LP tagitemlist RP */
   247,  /* (149) tagNamelist ::= tagNamelist COMMA ids */
   247,  /* (150) tagNamelist ::= ids */
   241,  /* (151) create_table_args ::= ifnotexists ids cpxName AS select */
   245,  /* (152) columnlist ::= columnlist COMMA column */
   245,  /* (153) columnlist ::= column */
   249,  /* (154) column ::= ids typename */
   246,  /* (155) tagitemlist ::= tagitemlist COMMA tagitem */
   246,  /* (156) tagitemlist ::= tagitem */
   250,  /* (157) tagitem ::= INTEGER */
   250,  /* (158) tagitem ::= FLOAT */
   250,  /* (159) tagitem ::= STRING */
   250,  /* (160) tagitem ::= BOOL */
   250,  /* (161) tagitem ::= NULL */
   250,  /* (162) tagitem ::= NOW */
   250,  /* (163) tagitem ::= MINUS INTEGER */
   250,  /* (164) tagitem ::= MINUS FLOAT */
   250,  /* (165) tagitem ::= PLUS INTEGER */
   250,  /* (166) tagitem ::= PLUS FLOAT */
   248,  /* (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 */
   248,  /* (168) select ::= LP select RP */
   264,  /* (169) union ::= select */
   264,  /* (170) union ::= union UNION ALL select */
   199,  /* (171) cmd ::= union */
   248,  /* (172) select ::= SELECT selcollist */
   265,  /* (173) sclp ::= selcollist COMMA */
   265,  /* (174) sclp ::= */
   251,  /* (175) selcollist ::= sclp distinct expr as */
   251,  /* (176) selcollist ::= sclp STAR */
   268,  /* (177) as ::= AS ids */
   268,  /* (178) as ::= ids */
   268,  /* (179) as ::= */
   266,  /* (180) distinct ::= DISTINCT */
   266,  /* (181) distinct ::= */
   252,  /* (182) from ::= FROM tablelist */
   252,  /* (183) from ::= FROM sub */
   270,  /* (184) sub ::= LP union RP */
   270,  /* (185) sub ::= LP union RP ids */
   270,  /* (186) sub ::= sub COMMA LP union RP ids */
   269,  /* (187) tablelist ::= ids cpxName */
   269,  /* (188) tablelist ::= ids cpxName ids */
   269,  /* (189) tablelist ::= tablelist COMMA ids cpxName */
   269,  /* (190) tablelist ::= tablelist COMMA ids cpxName ids */
   271,  /* (191) tmvar ::= VARIABLE */
   254,  /* (192) interval_option ::= intervalKey LP tmvar RP */
   254,  /* (193) interval_option ::= intervalKey LP tmvar COMMA tmvar RP */
   254,  /* (194) interval_option ::= */
   272,  /* (195) intervalKey ::= INTERVAL */
   272,  /* (196) intervalKey ::= EVERY */
   256,  /* (197) session_option ::= */
   256,  /* (198) session_option ::= SESSION LP ids cpxName COMMA tmvar RP */
   257,  /* (199) windowstate_option ::= */
   257,  /* (200) windowstate_option ::= STATE_WINDOW LP ids RP */
   258,  /* (201) fill_opt ::= */
   258,  /* (202) fill_opt ::= FILL LP ID COMMA tagitemlist RP */
   258,  /* (203) fill_opt ::= FILL LP ID RP */
   255,  /* (204) sliding_opt ::= SLIDING LP tmvar RP */
   255,  /* (205) sliding_opt ::= */
   261,  /* (206) orderby_opt ::= */
   261,  /* (207) orderby_opt ::= ORDER BY sortlist */
   273,  /* (208) sortlist ::= sortlist COMMA item sortorder */
   273,  /* (209) sortlist ::= item sortorder */
   275,  /* (210) item ::= ids cpxName */
   276,  /* (211) sortorder ::= ASC */
   276,  /* (212) sortorder ::= DESC */
   276,  /* (213) sortorder ::= */
   259,  /* (214) groupby_opt ::= */
   259,  /* (215) groupby_opt ::= GROUP BY grouplist */
   277,  /* (216) grouplist ::= grouplist COMMA item */
   277,  /* (217) grouplist ::= item */
   260,  /* (218) having_opt ::= */
   260,  /* (219) having_opt ::= HAVING expr */
   263,  /* (220) limit_opt ::= */
   263,  /* (221) limit_opt ::= LIMIT signed */
   263,  /* (222) limit_opt ::= LIMIT signed OFFSET signed */
   263,  /* (223) limit_opt ::= LIMIT signed COMMA signed */
   262,  /* (224) slimit_opt ::= */
   262,  /* (225) slimit_opt ::= SLIMIT signed */
   262,  /* (226) slimit_opt ::= SLIMIT signed SOFFSET signed */
   262,  /* (227) slimit_opt ::= SLIMIT signed COMMA signed */
   253,  /* (228) where_opt ::= */
   253,  /* (229) where_opt ::= WHERE expr */
   267,  /* (230) expr ::= LP expr RP */
   267,  /* (231) expr ::= ID */
   267,  /* (232) expr ::= ID DOT ID */
   267,  /* (233) expr ::= ID DOT STAR */
   267,  /* (234) expr ::= INTEGER */
   267,  /* (235) expr ::= MINUS INTEGER */
   267,  /* (236) expr ::= PLUS INTEGER */
   267,  /* (237) expr ::= FLOAT */
   267,  /* (238) expr ::= MINUS FLOAT */
   267,  /* (239) expr ::= PLUS FLOAT */
   267,  /* (240) expr ::= STRING */
   267,  /* (241) expr ::= NOW */
   267,  /* (242) expr ::= VARIABLE */
   267,  /* (243) expr ::= PLUS VARIABLE */
   267,  /* (244) expr ::= MINUS VARIABLE */
   267,  /* (245) expr ::= BOOL */
   267,  /* (246) expr ::= NULL */
   267,  /* (247) expr ::= ID LP exprlist RP */
   267,  /* (248) expr ::= ID LP STAR RP */
   267,  /* (249) expr ::= expr IS NULL */
   267,  /* (250) expr ::= expr IS NOT NULL */
   267,  /* (251) expr ::= expr LT expr */
   267,  /* (252) expr ::= expr GT expr */
   267,  /* (253) expr ::= expr LE expr */
   267,  /* (254) expr ::= expr GE expr */
   267,  /* (255) expr ::= expr NE expr */
   267,  /* (256) expr ::= expr EQ expr */
   267,  /* (257) expr ::= expr BETWEEN expr AND expr */
   267,  /* (258) expr ::= expr AND expr */
   267,  /* (259) expr ::= expr OR expr */
   267,  /* (260) expr ::= expr PLUS expr */
   267,  /* (261) expr ::= expr MINUS expr */
   267,  /* (262) expr ::= expr STAR expr */
   267,  /* (263) expr ::= expr SLASH expr */
   267,  /* (264) expr ::= expr REM expr */
   267,  /* (265) expr ::= expr LIKE expr */
   267,  /* (266) expr ::= expr MATCH expr */
   267,  /* (267) expr ::= expr QUESTION expr */
   267,  /* (268) expr ::= expr ARROW expr */
   267,  /* (269) expr ::= expr IN LP exprlist RP */
   207,  /* (270) exprlist ::= exprlist COMMA expritem */
   207,  /* (271) exprlist ::= expritem */
   278,  /* (272) expritem ::= expr */
   278,  /* (273) expritem ::= */
   199,  /* (274) cmd ::= RESET QUERY CACHE */
   199,  /* (275) cmd ::= SYNCDB ids REPLICA */
   199,  /* (276) cmd ::= ALTER TABLE ids cpxName ADD COLUMN columnlist */
   199,  /* (277) cmd ::= ALTER TABLE ids cpxName DROP COLUMN ids */
   199,  /* (278) cmd ::= ALTER TABLE ids cpxName MODIFY COLUMN columnlist */
   199,  /* (279) cmd ::= ALTER TABLE ids cpxName ADD TAG columnlist */
   199,  /* (280) cmd ::= ALTER TABLE ids cpxName DROP TAG ids */
   199,  /* (281) cmd ::= ALTER TABLE ids cpxName CHANGE TAG ids ids */
   199,  /* (282) cmd ::= ALTER TABLE ids cpxName SET TAG ids EQ tagitem */
   199,  /* (283) cmd ::= ALTER TABLE ids cpxName MODIFY TAG columnlist */
   199,  /* (284) cmd ::= ALTER STABLE ids cpxName ADD COLUMN columnlist */
   199,  /* (285) cmd ::= ALTER STABLE ids cpxName DROP COLUMN ids */
   199,  /* (286) cmd ::= ALTER STABLE ids cpxName MODIFY COLUMN columnlist */
   199,  /* (287) cmd ::= ALTER STABLE ids cpxName ADD TAG columnlist */
   199,  /* (288) cmd ::= ALTER STABLE ids cpxName DROP TAG ids */
   199,  /* (289) cmd ::= ALTER STABLE ids cpxName CHANGE TAG ids ids */
   199,  /* (290) cmd ::= ALTER STABLE ids cpxName SET TAG ids EQ tagitem */
   199,  /* (291) cmd ::= ALTER STABLE ids cpxName MODIFY TAG columnlist */
   199,  /* (292) cmd ::= KILL CONNECTION INTEGER */
   199,  /* (293) cmd ::= KILL STREAM INTEGER COLON INTEGER */
   199,  /* (294) 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 */
   -2,  /* (209) sortlist ::= item sortorder */
   -2,  /* (210) item ::= ids cpxName */
   -1,  /* (211) sortorder ::= ASC */
   -1,  /* (212) sortorder ::= DESC */
    0,  /* (213) sortorder ::= */
    0,  /* (214) groupby_opt ::= */
   -3,  /* (215) groupby_opt ::= GROUP BY grouplist */
   -3,  /* (216) grouplist ::= grouplist COMMA item */
   -1,  /* (217) grouplist ::= item */
    0,  /* (218) having_opt ::= */
   -2,  /* (219) having_opt ::= HAVING expr */
    0,  /* (220) limit_opt ::= */
   -2,  /* (221) limit_opt ::= LIMIT signed */
   -4,  /* (222) limit_opt ::= LIMIT signed OFFSET signed */
   -4,  /* (223) limit_opt ::= LIMIT signed COMMA signed */
    0,  /* (224) slimit_opt ::= */
   -2,  /* (225) slimit_opt ::= SLIMIT signed */
   -4,  /* (226) slimit_opt ::= SLIMIT signed SOFFSET signed */
   -4,  /* (227) slimit_opt ::= SLIMIT signed COMMA signed */
    0,  /* (228) where_opt ::= */
   -2,  /* (229) where_opt ::= WHERE expr */
   -3,  /* (230) expr ::= LP expr RP */
   -1,  /* (231) expr ::= ID */
   -3,  /* (232) expr ::= ID DOT ID */
   -3,  /* (233) expr ::= ID DOT STAR */
   -1,  /* (234) expr ::= INTEGER */
   -2,  /* (235) expr ::= MINUS INTEGER */
   -2,  /* (236) expr ::= PLUS INTEGER */
   -1,  /* (237) expr ::= FLOAT */
   -2,  /* (238) expr ::= MINUS FLOAT */
   -2,  /* (239) expr ::= PLUS FLOAT */
   -1,  /* (240) expr ::= STRING */
   -1,  /* (241) expr ::= NOW */
   -1,  /* (242) expr ::= VARIABLE */
   -2,  /* (243) expr ::= PLUS VARIABLE */
   -2,  /* (244) expr ::= MINUS VARIABLE */
   -1,  /* (245) expr ::= BOOL */
   -1,  /* (246) expr ::= NULL */
   -4,  /* (247) expr ::= ID LP exprlist RP */
   -4,  /* (248) expr ::= ID LP STAR RP */
   -3,  /* (249) expr ::= expr IS NULL */
   -4,  /* (250) expr ::= expr IS NOT NULL */
   -3,  /* (251) expr ::= expr LT expr */
   -3,  /* (252) expr ::= expr GT expr */
   -3,  /* (253) expr ::= expr LE expr */
   -3,  /* (254) expr ::= expr GE expr */
   -3,  /* (255) expr ::= expr NE expr */
   -3,  /* (256) expr ::= expr EQ expr */
   -5,  /* (257) expr ::= expr BETWEEN expr AND expr */
   -3,  /* (258) expr ::= expr AND expr */
   -3,  /* (259) expr ::= expr OR expr */
   -3,  /* (260) expr ::= expr PLUS expr */
   -3,  /* (261) expr ::= expr MINUS expr */
   -3,  /* (262) expr ::= expr STAR expr */
   -3,  /* (263) expr ::= expr SLASH expr */
   -3,  /* (264) expr ::= expr REM expr */
   -3,  /* (265) expr ::= expr LIKE expr */
   -3,  /* (266) expr ::= expr MATCH expr */
   -3,  /* (267) expr ::= expr QUESTION expr */
   -3,  /* (268) expr ::= expr ARROW expr */
   -5,  /* (269) expr ::= expr IN LP exprlist RP */
   -3,  /* (270) exprlist ::= exprlist COMMA expritem */
   -1,  /* (271) exprlist ::= expritem */
   -1,  /* (272) expritem ::= expr */
    0,  /* (273) expritem ::= */
   -3,  /* (274) cmd ::= RESET QUERY CACHE */
   -3,  /* (275) cmd ::= SYNCDB ids REPLICA */
   -7,  /* (276) cmd ::= ALTER TABLE ids cpxName ADD COLUMN columnlist */
   -7,  /* (277) cmd ::= ALTER TABLE ids cpxName DROP COLUMN ids */
   -7,  /* (278) cmd ::= ALTER TABLE ids cpxName MODIFY COLUMN columnlist */
   -7,  /* (279) cmd ::= ALTER TABLE ids cpxName ADD TAG columnlist */
   -7,  /* (280) cmd ::= ALTER TABLE ids cpxName DROP TAG ids */
   -8,  /* (281) cmd ::= ALTER TABLE ids cpxName CHANGE TAG ids ids */
   -9,  /* (282) cmd ::= ALTER TABLE ids cpxName SET TAG ids EQ tagitem */
   -7,  /* (283) cmd ::= ALTER TABLE ids cpxName MODIFY TAG columnlist */
   -7,  /* (284) cmd ::= ALTER STABLE ids cpxName ADD COLUMN columnlist */
   -7,  /* (285) cmd ::= ALTER STABLE ids cpxName DROP COLUMN ids */
   -7,  /* (286) cmd ::= ALTER STABLE ids cpxName MODIFY COLUMN columnlist */
   -7,  /* (287) cmd ::= ALTER STABLE ids cpxName ADD TAG columnlist */
   -7,  /* (288) cmd ::= ALTER STABLE ids cpxName DROP TAG ids */
   -8,  /* (289) cmd ::= ALTER STABLE ids cpxName CHANGE TAG ids ids */
   -9,  /* (290) cmd ::= ALTER STABLE ids cpxName SET TAG ids EQ tagitem */
   -7,  /* (291) cmd ::= ALTER STABLE ids cpxName MODIFY TAG columnlist */
   -3,  /* (292) cmd ::= KILL CONNECTION INTEGER */
   -5,  /* (293) cmd ::= KILL STREAM INTEGER COLON INTEGER */
   -5,  /* (294) 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 2720 "sql.c"
        break;
      case 1: /* cmd ::= SHOW DATABASES */
#line 67 "sql.y"
{ setShowOptions(pInfo, TSDB_MGMT_TABLE_DB, 0, 0);}
#line 2725 "sql.c"
        break;
      case 2: /* cmd ::= SHOW TOPICS */
#line 68 "sql.y"
{ setShowOptions(pInfo, TSDB_MGMT_TABLE_TP, 0, 0);}
#line 2730 "sql.c"
        break;
      case 3: /* cmd ::= SHOW FUNCTIONS */
#line 69 "sql.y"
{ setShowOptions(pInfo, TSDB_MGMT_TABLE_FUNCTION, 0, 0);}
#line 2735 "sql.c"
        break;
      case 4: /* cmd ::= SHOW MNODES */
#line 70 "sql.y"
{ setShowOptions(pInfo, TSDB_MGMT_TABLE_MNODE, 0, 0);}
#line 2740 "sql.c"
        break;
      case 5: /* cmd ::= SHOW DNODES */
#line 71 "sql.y"
{ setShowOptions(pInfo, TSDB_MGMT_TABLE_DNODE, 0, 0);}
#line 2745 "sql.c"
        break;
      case 6: /* cmd ::= SHOW ACCOUNTS */
#line 72 "sql.y"
{ setShowOptions(pInfo, TSDB_MGMT_TABLE_ACCT, 0, 0);}
#line 2750 "sql.c"
        break;
      case 7: /* cmd ::= SHOW USERS */
#line 73 "sql.y"
{ setShowOptions(pInfo, TSDB_MGMT_TABLE_USER, 0, 0);}
#line 2755 "sql.c"
        break;
      case 8: /* cmd ::= SHOW MODULES */
#line 75 "sql.y"
{ setShowOptions(pInfo, TSDB_MGMT_TABLE_MODULE, 0, 0);  }
#line 2760 "sql.c"
        break;
      case 9: /* cmd ::= SHOW QUERIES */
#line 76 "sql.y"
{ setShowOptions(pInfo, TSDB_MGMT_TABLE_QUERIES, 0, 0);  }
#line 2765 "sql.c"
        break;
      case 10: /* cmd ::= SHOW CONNECTIONS */
#line 77 "sql.y"
{ setShowOptions(pInfo, TSDB_MGMT_TABLE_CONNS, 0, 0);}
#line 2770 "sql.c"
        break;
      case 11: /* cmd ::= SHOW STREAMS */
#line 78 "sql.y"
{ setShowOptions(pInfo, TSDB_MGMT_TABLE_STREAMS, 0, 0);  }
#line 2775 "sql.c"
        break;
      case 12: /* cmd ::= SHOW VARIABLES */
#line 79 "sql.y"
{ setShowOptions(pInfo, TSDB_MGMT_TABLE_VARIABLES, 0, 0);  }
#line 2780 "sql.c"
        break;
      case 13: /* cmd ::= SHOW SCORES */
#line 80 "sql.y"
{ setShowOptions(pInfo, TSDB_MGMT_TABLE_SCORES, 0, 0);   }
#line 2785 "sql.c"
        break;
      case 14: /* cmd ::= SHOW GRANTS */
#line 81 "sql.y"
{ setShowOptions(pInfo, TSDB_MGMT_TABLE_GRANTS, 0, 0);   }
#line 2790 "sql.c"
        break;
      case 15: /* cmd ::= SHOW VNODES */
#line 83 "sql.y"
{ setShowOptions(pInfo, TSDB_MGMT_TABLE_VNODES, 0, 0); }
#line 2795 "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 2800 "sql.c"
        break;
      case 17: /* dbPrefix ::= */
#line 88 "sql.y"
{yymsp[1].minor.yy0.n = 0; yymsp[1].minor.yy0.type = 0;}
#line 2805 "sql.c"
        break;
      case 18: /* dbPrefix ::= ids DOT */
#line 89 "sql.y"
{yylhsminor.yy0 = yymsp[-1].minor.yy0;  }
#line 2810 "sql.c"
  yymsp[-1].minor.yy0 = yylhsminor.yy0;
        break;
      case 19: /* cpxName ::= */
#line 92 "sql.y"
{yymsp[1].minor.yy0.n = 0;  }
#line 2816 "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 2821 "sql.c"
        break;
      case 21: /* cmd ::= SHOW CREATE TABLE ids cpxName */
#line 95 "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 2829 "sql.c"
        break;
      case 22: /* cmd ::= SHOW CREATE STABLE ids cpxName */
#line 99 "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 2837 "sql.c"
        break;
      case 23: /* cmd ::= SHOW CREATE DATABASE ids */
#line 104 "sql.y"
{
  setDCLSqlElems(pInfo, TSDB_SQL_SHOW_CREATE_DATABASE, 1, &yymsp[0].minor.yy0);
}
#line 2844 "sql.c"
        break;
      case 24: /* cmd ::= SHOW dbPrefix TABLES */
#line 108 "sql.y"
{
    setShowOptions(pInfo, TSDB_MGMT_TABLE_TABLE, &yymsp[-1].minor.yy0, 0);
}
#line 2851 "sql.c"
        break;
      case 25: /* cmd ::= SHOW dbPrefix TABLES LIKE ids */
#line 112 "sql.y"
{
    setShowOptions(pInfo, TSDB_MGMT_TABLE_TABLE, &yymsp[-3].minor.yy0, &yymsp[0].minor.yy0);
}
#line 2858 "sql.c"
        break;
      case 26: /* cmd ::= SHOW dbPrefix STABLES */
#line 116 "sql.y"
{
    setShowOptions(pInfo, TSDB_MGMT_TABLE_METRIC, &yymsp[-1].minor.yy0, 0);
}
#line 2865 "sql.c"
        break;
      case 27: /* cmd ::= SHOW dbPrefix STABLES LIKE ids */
#line 120 "sql.y"
{
    SStrToken token;
    tSetDbName(&token, &yymsp[-3].minor.yy0);
    setShowOptions(pInfo, TSDB_MGMT_TABLE_METRIC, &token, &yymsp[0].minor.yy0);
}
#line 2874 "sql.c"
        break;
      case 28: /* cmd ::= SHOW dbPrefix VGROUPS */
#line 126 "sql.y"
{
    SStrToken token;
    tSetDbName(&token, &yymsp[-1].minor.yy0);
    setShowOptions(pInfo, TSDB_MGMT_TABLE_VGROUP, &token, 0);
}
#line 2883 "sql.c"
        break;
      case 29: /* cmd ::= SHOW dbPrefix VGROUPS ids */
#line 132 "sql.y"
{
    SStrToken token;
    tSetDbName(&token, &yymsp[-2].minor.yy0);
    setShowOptions(pInfo, TSDB_MGMT_TABLE_VGROUP, &token, &yymsp[0].minor.yy0);
}
#line 2892 "sql.c"
        break;
      case 30: /* cmd ::= DROP TABLE ifexists ids cpxName */
#line 139 "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 2900 "sql.c"
        break;
      case 31: /* cmd ::= DROP STABLE ifexists ids cpxName */
#line 145 "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 2908 "sql.c"
        break;
      case 32: /* cmd ::= DROP DATABASE ifexists ids */
#line 150 "sql.y"
{ setDropDbTableInfo(pInfo, TSDB_SQL_DROP_DB, &yymsp[0].minor.yy0, &yymsp[-1].minor.yy0, TSDB_DB_TYPE_DEFAULT, -1); }
#line 2913 "sql.c"
        break;
      case 33: /* cmd ::= DROP TOPIC ifexists ids */
#line 151 "sql.y"
{ setDropDbTableInfo(pInfo, TSDB_SQL_DROP_DB, &yymsp[0].minor.yy0, &yymsp[-1].minor.yy0, TSDB_DB_TYPE_TOPIC, -1); }
#line 2918 "sql.c"
        break;
      case 34: /* cmd ::= DROP FUNCTION ids */
#line 152 "sql.y"
{ setDropFuncInfo(pInfo, TSDB_SQL_DROP_FUNCTION, &yymsp[0].minor.yy0); }
#line 2923 "sql.c"
        break;
      case 35: /* cmd ::= DROP DNODE ids */
#line 154 "sql.y"
{ setDCLSqlElems(pInfo, TSDB_SQL_DROP_DNODE, 1, &yymsp[0].minor.yy0);    }
#line 2928 "sql.c"
        break;
      case 36: /* cmd ::= DROP USER ids */
#line 155 "sql.y"
{ setDCLSqlElems(pInfo, TSDB_SQL_DROP_USER, 1, &yymsp[0].minor.yy0);     }
#line 2933 "sql.c"
        break;
      case 37: /* cmd ::= DROP ACCOUNT ids */
#line 156 "sql.y"
{ setDCLSqlElems(pInfo, TSDB_SQL_DROP_ACCT, 1, &yymsp[0].minor.yy0);  }
#line 2938 "sql.c"
        break;
      case 38: /* cmd ::= USE ids */
#line 159 "sql.y"
{ setDCLSqlElems(pInfo, TSDB_SQL_USE_DB, 1, &yymsp[0].minor.yy0);}
#line 2943 "sql.c"
        break;
      case 39: /* cmd ::= DESCRIBE ids cpxName */
      case 40: /* cmd ::= DESC ids cpxName */ yytestcase(yyruleno==40);
#line 162 "sql.y"
{
    yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n;
    setDCLSqlElems(pInfo, TSDB_SQL_DESCRIBE_TABLE, 1, &yymsp[-1].minor.yy0);
}
#line 2952 "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 2957 "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 2962 "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 2967 "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 2972 "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 2977 "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 2982 "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.yy256, &t);}
#line 2988 "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.yy277);}
#line 2993 "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.yy277);}
#line 2998 "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.yy135);}
#line 3003 "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 3009 "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 3015 "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 3022 "sql.c"
        break;
      case 56: /* ifnotexists ::= IF NOT EXISTS */
#line 199 "sql.y"
{ yymsp[-2].minor.yy0.n = 1;}
#line 3027 "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 3032 "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.yy277);}
#line 3037 "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.yy256, &yymsp[-2].minor.yy0);}
#line 3043 "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.yy181, &yymsp[0].minor.yy0, 1);}
#line 3048 "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.yy181, &yymsp[0].minor.yy0, 2);}
#line 3053 "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 3058 "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 3072 "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 3086 "sql.c"
        break;
      case 85: /* acct_optr ::= pps tseries storage streams qtime dbs users conns state */
#line 244 "sql.y"
{
    yylhsminor.yy277.maxUsers   = (yymsp[-2].minor.yy0.n>0)?atoi(yymsp[-2].minor.yy0.z):-1;
    yylhsminor.yy277.maxDbs     = (yymsp[-3].minor.yy0.n>0)?atoi(yymsp[-3].minor.yy0.z):-1;
    yylhsminor.yy277.maxTimeSeries = (yymsp[-7].minor.yy0.n>0)?atoi(yymsp[-7].minor.yy0.z):-1;
    yylhsminor.yy277.maxStreams = (yymsp[-5].minor.yy0.n>0)?atoi(yymsp[-5].minor.yy0.z):-1;
    yylhsminor.yy277.maxPointsPerSecond     = (yymsp[-8].minor.yy0.n>0)?atoi(yymsp[-8].minor.yy0.z):-1;
    yylhsminor.yy277.maxStorage = (yymsp[-6].minor.yy0.n>0)?strtoll(yymsp[-6].minor.yy0.z, NULL, 10):-1;
    yylhsminor.yy277.maxQueryTime   = (yymsp[-4].minor.yy0.n>0)?strtoll(yymsp[-4].minor.yy0.z, NULL, 10):-1;
    yylhsminor.yy277.maxConnections   = (yymsp[-1].minor.yy0.n>0)?atoi(yymsp[-1].minor.yy0.z):-1;
    yylhsminor.yy277.stat    = yymsp[0].minor.yy0;
}
#line 3101 "sql.c"
  yymsp[-8].minor.yy277 = yylhsminor.yy277;
        break;
      case 86: /* intitemlist ::= intitemlist COMMA intitem */
      case 155: /* tagitemlist ::= tagitemlist COMMA tagitem */ yytestcase(yyruleno==155);
#line 260 "sql.y"
{ yylhsminor.yy135 = tVariantListAppend(yymsp[-2].minor.yy135, &yymsp[0].minor.yy308, -1);    }
#line 3108 "sql.c"
  yymsp[-2].minor.yy135 = yylhsminor.yy135;
        break;
      case 87: /* intitemlist ::= intitem */
      case 156: /* tagitemlist ::= tagitem */ yytestcase(yyruleno==156);
#line 261 "sql.y"
{ yylhsminor.yy135 = tVariantListAppend(NULL, &yymsp[0].minor.yy308, -1); }
#line 3115 "sql.c"
  yymsp[0].minor.yy135 = yylhsminor.yy135;
        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);
#line 263 "sql.y"
{ toTSDBType(yymsp[0].minor.yy0.type); tVariantCreate(&yylhsminor.yy308, &yymsp[0].minor.yy0); }
#line 3125 "sql.c"
  yymsp[0].minor.yy308 = yylhsminor.yy308;
        break;
      case 89: /* keep ::= KEEP intitemlist */
#line 267 "sql.y"
{ yymsp[-1].minor.yy135 = yymsp[0].minor.yy135; }
#line 3131 "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 3150 "sql.c"
        break;
      case 105: /* db_optr ::= */
#line 286 "sql.y"
{setDefaultCreateDbOption(&yymsp[1].minor.yy256); yymsp[1].minor.yy256.dbType = TSDB_DB_TYPE_DEFAULT;}
#line 3155 "sql.c"
        break;
      case 106: /* db_optr ::= db_optr cache */
#line 288 "sql.y"
{ yylhsminor.yy256 = yymsp[-1].minor.yy256; yylhsminor.yy256.cacheBlockSize = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
#line 3160 "sql.c"
  yymsp[-1].minor.yy256 = yylhsminor.yy256;
        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.yy256 = yymsp[-1].minor.yy256; yylhsminor.yy256.replica = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
#line 3167 "sql.c"
  yymsp[-1].minor.yy256 = yylhsminor.yy256;
        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.yy256 = yymsp[-1].minor.yy256; yylhsminor.yy256.quorum = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
#line 3174 "sql.c"
  yymsp[-1].minor.yy256 = yylhsminor.yy256;
        break;
      case 109: /* db_optr ::= db_optr days */
#line 291 "sql.y"
{ yylhsminor.yy256 = yymsp[-1].minor.yy256; yylhsminor.yy256.daysPerFile = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
#line 3180 "sql.c"
  yymsp[-1].minor.yy256 = yylhsminor.yy256;
        break;
      case 110: /* db_optr ::= db_optr minrows */
#line 292 "sql.y"
{ yylhsminor.yy256 = yymsp[-1].minor.yy256; yylhsminor.yy256.minRowsPerBlock = strtod(yymsp[0].minor.yy0.z, NULL); }
#line 3186 "sql.c"
  yymsp[-1].minor.yy256 = yylhsminor.yy256;
        break;
      case 111: /* db_optr ::= db_optr maxrows */
#line 293 "sql.y"
{ yylhsminor.yy256 = yymsp[-1].minor.yy256; yylhsminor.yy256.maxRowsPerBlock = strtod(yymsp[0].minor.yy0.z, NULL); }
#line 3192 "sql.c"
  yymsp[-1].minor.yy256 = yylhsminor.yy256;
        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.yy256 = yymsp[-1].minor.yy256; yylhsminor.yy256.numOfBlocks = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
#line 3199 "sql.c"
  yymsp[-1].minor.yy256 = yylhsminor.yy256;
        break;
      case 113: /* db_optr ::= db_optr ctime */
#line 295 "sql.y"
{ yylhsminor.yy256 = yymsp[-1].minor.yy256; yylhsminor.yy256.commitTime = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
#line 3205 "sql.c"
  yymsp[-1].minor.yy256 = yylhsminor.yy256;
        break;
      case 114: /* db_optr ::= db_optr wal */
#line 296 "sql.y"
{ yylhsminor.yy256 = yymsp[-1].minor.yy256; yylhsminor.yy256.walLevel = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
#line 3211 "sql.c"
  yymsp[-1].minor.yy256 = yylhsminor.yy256;
        break;
      case 115: /* db_optr ::= db_optr fsync */
#line 297 "sql.y"
{ yylhsminor.yy256 = yymsp[-1].minor.yy256; yylhsminor.yy256.fsyncPeriod = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
#line 3217 "sql.c"
  yymsp[-1].minor.yy256 = yylhsminor.yy256;
        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.yy256 = yymsp[-1].minor.yy256; yylhsminor.yy256.compressionLevel = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
#line 3224 "sql.c"
  yymsp[-1].minor.yy256 = yylhsminor.yy256;
        break;
      case 117: /* db_optr ::= db_optr prec */
#line 299 "sql.y"
{ yylhsminor.yy256 = yymsp[-1].minor.yy256; yylhsminor.yy256.precision = yymsp[0].minor.yy0; }
#line 3230 "sql.c"
  yymsp[-1].minor.yy256 = yylhsminor.yy256;
        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.yy256 = yymsp[-1].minor.yy256; yylhsminor.yy256.keep = yymsp[0].minor.yy135; }
#line 3237 "sql.c"
  yymsp[-1].minor.yy256 = yylhsminor.yy256;
        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.yy256 = yymsp[-1].minor.yy256; yylhsminor.yy256.update = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
#line 3244 "sql.c"
  yymsp[-1].minor.yy256 = yylhsminor.yy256;
        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.yy256 = yymsp[-1].minor.yy256; yylhsminor.yy256.cachelast = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
#line 3251 "sql.c"
  yymsp[-1].minor.yy256 = yylhsminor.yy256;
        break;
      case 121: /* topic_optr ::= db_optr */
      case 131: /* alter_topic_optr ::= alter_db_optr */ yytestcase(yyruleno==131);
#line 306 "sql.y"
{ yylhsminor.yy256 = yymsp[0].minor.yy256; yylhsminor.yy256.dbType = TSDB_DB_TYPE_TOPIC; }
#line 3258 "sql.c"
  yymsp[0].minor.yy256 = yylhsminor.yy256;
        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.yy256 = yymsp[-1].minor.yy256; yylhsminor.yy256.partitions = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
#line 3265 "sql.c"
  yymsp[-1].minor.yy256 = yylhsminor.yy256;
        break;
      case 123: /* alter_db_optr ::= */
#line 310 "sql.y"
{ setDefaultCreateDbOption(&yymsp[1].minor.yy256); yymsp[1].minor.yy256.dbType = TSDB_DB_TYPE_DEFAULT;}
#line 3271 "sql.c"
        break;
      case 133: /* typename ::= ids */
#line 330 "sql.y"
{ 
  yymsp[0].minor.yy0.type = 0;
  tSetColumnType (&yylhsminor.yy181, &yymsp[0].minor.yy0);
}
#line 3279 "sql.c"
  yymsp[0].minor.yy181 = yylhsminor.yy181;
        break;
      case 134: /* typename ::= ids LP signed RP */
#line 336 "sql.y"
{
  if (yymsp[-1].minor.yy531 <= 0) {
    yymsp[-3].minor.yy0.type = 0;
    tSetColumnType(&yylhsminor.yy181, &yymsp[-3].minor.yy0);
  } else {
    yymsp[-3].minor.yy0.type = -yymsp[-1].minor.yy531;  // negative value of name length
    tSetColumnType(&yylhsminor.yy181, &yymsp[-3].minor.yy0);
  }
}
#line 3293 "sql.c"
  yymsp[-3].minor.yy181 = yylhsminor.yy181;
        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.yy181, &yymsp[-1].minor.yy0);
}
#line 3303 "sql.c"
  yymsp[-1].minor.yy181 = yylhsminor.yy181;
        break;
      case 136: /* signed ::= INTEGER */
#line 354 "sql.y"
{ yylhsminor.yy531 = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
#line 3309 "sql.c"
  yymsp[0].minor.yy531 = yylhsminor.yy531;
        break;
      case 137: /* signed ::= PLUS INTEGER */
#line 355 "sql.y"
{ yymsp[-1].minor.yy531 = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
#line 3315 "sql.c"
        break;
      case 138: /* signed ::= MINUS INTEGER */
#line 356 "sql.y"
{ yymsp[-1].minor.yy531 = -strtol(yymsp[0].minor.yy0.z, NULL, 10);}
#line 3320 "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.yy110;}
#line 3325 "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.yy78);
  pCreateTable->type = TSQL_CREATE_TABLE_FROM_STABLE;
  yylhsminor.yy110 = pCreateTable;
}
#line 3337 "sql.c"
  yymsp[0].minor.yy110 = yylhsminor.yy110;
        break;
      case 144: /* create_table_list ::= create_table_list create_from_stable */
#line 375 "sql.y"
{
  taosArrayPush(yymsp[-1].minor.yy110->childTableInfo, &yymsp[0].minor.yy78);
  yylhsminor.yy110 = yymsp[-1].minor.yy110;
}
#line 3346 "sql.c"
  yymsp[-1].minor.yy110 = yylhsminor.yy110;
        break;
      case 145: /* create_table_args ::= ifnotexists ids cpxName LP columnlist RP */
#line 381 "sql.y"
{
  yylhsminor.yy110 = tSetCreateTableInfo(yymsp[-1].minor.yy135, NULL, NULL, TSQL_CREATE_TABLE);
  setSqlInfo(pInfo, yylhsminor.yy110, 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 3358 "sql.c"
  yymsp[-5].minor.yy110 = yylhsminor.yy110;
        break;
      case 146: /* create_stable_args ::= ifnotexists ids cpxName LP columnlist RP TAGS LP columnlist RP */
#line 391 "sql.y"
{
  yylhsminor.yy110 = tSetCreateTableInfo(yymsp[-5].minor.yy135, yymsp[-1].minor.yy135, NULL, TSQL_CREATE_STABLE);
  setSqlInfo(pInfo, yylhsminor.yy110, 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 3370 "sql.c"
  yymsp[-9].minor.yy110 = yylhsminor.yy110;
        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.yy78 = createNewChildTableInfo(&yymsp[-5].minor.yy0, NULL, yymsp[-1].minor.yy135, &yymsp[-8].minor.yy0, &yymsp[-9].minor.yy0);
}
#line 3380 "sql.c"
  yymsp[-9].minor.yy78 = yylhsminor.yy78;
        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.yy78 = createNewChildTableInfo(&yymsp[-8].minor.yy0, yymsp[-5].minor.yy135, yymsp[-1].minor.yy135, &yymsp[-11].minor.yy0, &yymsp[-12].minor.yy0);
}
#line 3390 "sql.c"
  yymsp[-12].minor.yy78 = yylhsminor.yy78;
        break;
      case 149: /* tagNamelist ::= tagNamelist COMMA ids */
#line 416 "sql.y"
{taosArrayPush(yymsp[-2].minor.yy135, &yymsp[0].minor.yy0); yylhsminor.yy135 = yymsp[-2].minor.yy135;  }
#line 3396 "sql.c"
  yymsp[-2].minor.yy135 = yylhsminor.yy135;
        break;
      case 150: /* tagNamelist ::= ids */
#line 417 "sql.y"
{yylhsminor.yy135 = taosArrayInit(4, sizeof(SStrToken)); taosArrayPush(yylhsminor.yy135, &yymsp[0].minor.yy0);}
#line 3402 "sql.c"
  yymsp[0].minor.yy135 = yylhsminor.yy135;
        break;
      case 151: /* create_table_args ::= ifnotexists ids cpxName AS select */
#line 421 "sql.y"
{
  yylhsminor.yy110 = tSetCreateTableInfo(NULL, NULL, yymsp[0].minor.yy488, TSQL_CREATE_STREAM);
  setSqlInfo(pInfo, yylhsminor.yy110, 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 3414 "sql.c"
  yymsp[-4].minor.yy110 = yylhsminor.yy110;
        break;
      case 152: /* columnlist ::= columnlist COMMA column */
#line 432 "sql.y"
{taosArrayPush(yymsp[-2].minor.yy135, &yymsp[0].minor.yy181); yylhsminor.yy135 = yymsp[-2].minor.yy135;  }
#line 3420 "sql.c"
  yymsp[-2].minor.yy135 = yylhsminor.yy135;
        break;
      case 153: /* columnlist ::= column */
#line 433 "sql.y"
{yylhsminor.yy135 = taosArrayInit(4, sizeof(TAOS_FIELD)); taosArrayPush(yylhsminor.yy135, &yymsp[0].minor.yy181);}
#line 3426 "sql.c"
  yymsp[0].minor.yy135 = yylhsminor.yy135;
        break;
      case 154: /* column ::= ids typename */
#line 437 "sql.y"
{
  tSetColumnInfo(&yylhsminor.yy181, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy181);
}
#line 3434 "sql.c"
  yymsp[-1].minor.yy181 = yylhsminor.yy181;
        break;
      case 161: /* tagitem ::= NULL */
#line 452 "sql.y"
{ yymsp[0].minor.yy0.type = 0; tVariantCreate(&yylhsminor.yy308, &yymsp[0].minor.yy0); }
#line 3440 "sql.c"
  yymsp[0].minor.yy308 = yylhsminor.yy308;
        break;
      case 162: /* tagitem ::= NOW */
#line 453 "sql.y"
{ yymsp[0].minor.yy0.type = TSDB_DATA_TYPE_TIMESTAMP; tVariantCreate(&yylhsminor.yy308, &yymsp[0].minor.yy0);}
#line 3446 "sql.c"
  yymsp[0].minor.yy308 = yylhsminor.yy308;
        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.yy308, &yymsp[-1].minor.yy0);
}
#line 3460 "sql.c"
  yymsp[-1].minor.yy308 = yylhsminor.yy308;
        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.yy488 = tSetQuerySqlNode(&yymsp[-13].minor.yy0, yymsp[-12].minor.yy135, yymsp[-11].minor.yy460, yymsp[-10].minor.yy526, yymsp[-4].minor.yy135, yymsp[-2].minor.yy135, &yymsp[-9].minor.yy160, &yymsp[-7].minor.yy511, &yymsp[-6].minor.yy258, &yymsp[-8].minor.yy0, yymsp[-5].minor.yy135, &yymsp[0].minor.yy126, &yymsp[-1].minor.yy126, yymsp[-3].minor.yy526);
}
#line 3468 "sql.c"
  yymsp[-13].minor.yy488 = yylhsminor.yy488;
        break;
      case 168: /* select ::= LP select RP */
#line 490 "sql.y"
{yymsp[-2].minor.yy488 = yymsp[-1].minor.yy488;}
#line 3474 "sql.c"
        break;
      case 169: /* union ::= select */
#line 494 "sql.y"
{ yylhsminor.yy135 = setSubclause(NULL, yymsp[0].minor.yy488); }
#line 3479 "sql.c"
  yymsp[0].minor.yy135 = yylhsminor.yy135;
        break;
      case 170: /* union ::= union UNION ALL select */
#line 495 "sql.y"
{ yylhsminor.yy135 = appendSelectClause(yymsp[-3].minor.yy135, yymsp[0].minor.yy488); }
#line 3485 "sql.c"
  yymsp[-3].minor.yy135 = yylhsminor.yy135;
        break;
      case 171: /* cmd ::= union */
#line 497 "sql.y"
{ setSqlInfo(pInfo, yymsp[0].minor.yy135, NULL, TSDB_SQL_SELECT); }
#line 3491 "sql.c"
        break;
      case 172: /* select ::= SELECT selcollist */
#line 504 "sql.y"
{
  yylhsminor.yy488 = tSetQuerySqlNode(&yymsp[-1].minor.yy0, yymsp[0].minor.yy135, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
}
#line 3498 "sql.c"
  yymsp[-1].minor.yy488 = yylhsminor.yy488;
        break;
      case 173: /* sclp ::= selcollist COMMA */
#line 516 "sql.y"
{yylhsminor.yy135 = yymsp[-1].minor.yy135;}
#line 3504 "sql.c"
  yymsp[-1].minor.yy135 = yylhsminor.yy135;
        break;
      case 174: /* sclp ::= */
      case 206: /* orderby_opt ::= */ yytestcase(yyruleno==206);
#line 517 "sql.y"
{yymsp[1].minor.yy135 = 0;}
#line 3511 "sql.c"
        break;
      case 175: /* selcollist ::= sclp distinct expr as */
#line 518 "sql.y"
{
   yylhsminor.yy135 = tSqlExprListAppend(yymsp[-3].minor.yy135, yymsp[-1].minor.yy526,  yymsp[-2].minor.yy0.n? &yymsp[-2].minor.yy0:0, yymsp[0].minor.yy0.n?&yymsp[0].minor.yy0:0);
}
#line 3518 "sql.c"
  yymsp[-3].minor.yy135 = yylhsminor.yy135;
        break;
      case 176: /* selcollist ::= sclp STAR */
#line 522 "sql.y"
{
   tSqlExpr *pNode = tSqlExprCreateIdValue(NULL, TK_ALL);
   yylhsminor.yy135 = tSqlExprListAppend(yymsp[-1].minor.yy135, pNode, 0, 0);
}
#line 3527 "sql.c"
  yymsp[-1].minor.yy135 = yylhsminor.yy135;
        break;
      case 177: /* as ::= AS ids */
#line 530 "sql.y"
{ yymsp[-1].minor.yy0 = yymsp[0].minor.yy0;    }
#line 3533 "sql.c"
        break;
      case 178: /* as ::= ids */
#line 531 "sql.y"
{ yylhsminor.yy0 = yymsp[0].minor.yy0;    }
#line 3538 "sql.c"
  yymsp[0].minor.yy0 = yylhsminor.yy0;
        break;
      case 179: /* as ::= */
#line 532 "sql.y"
{ yymsp[1].minor.yy0.n = 0;  }
#line 3544 "sql.c"
        break;
      case 180: /* distinct ::= DISTINCT */
#line 535 "sql.y"
{ yylhsminor.yy0 = yymsp[0].minor.yy0;  }
#line 3549 "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.yy460 = yymsp[0].minor.yy460;}
#line 3556 "sql.c"
        break;
      case 184: /* sub ::= LP union RP */
#line 546 "sql.y"
{yymsp[-2].minor.yy460 = addSubqueryElem(NULL, yymsp[-1].minor.yy135, NULL);}
#line 3561 "sql.c"
        break;
      case 185: /* sub ::= LP union RP ids */
#line 547 "sql.y"
{yymsp[-3].minor.yy460 = addSubqueryElem(NULL, yymsp[-2].minor.yy135, &yymsp[0].minor.yy0);}
#line 3566 "sql.c"
        break;
      case 186: /* sub ::= sub COMMA LP union RP ids */
#line 548 "sql.y"
{yylhsminor.yy460 = addSubqueryElem(yymsp[-5].minor.yy460, yymsp[-2].minor.yy135, &yymsp[0].minor.yy0);}
#line 3571 "sql.c"
  yymsp[-5].minor.yy460 = yylhsminor.yy460;
        break;
      case 187: /* tablelist ::= ids cpxName */
#line 552 "sql.y"
{
  yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n;
  yylhsminor.yy460 = setTableNameList(NULL, &yymsp[-1].minor.yy0, NULL);
}
#line 3580 "sql.c"
  yymsp[-1].minor.yy460 = yylhsminor.yy460;
        break;
      case 188: /* tablelist ::= ids cpxName ids */
#line 557 "sql.y"
{
  yymsp[-2].minor.yy0.n += yymsp[-1].minor.yy0.n;
  yylhsminor.yy460 = setTableNameList(NULL, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0);
}
#line 3589 "sql.c"
  yymsp[-2].minor.yy460 = yylhsminor.yy460;
        break;
      case 189: /* tablelist ::= tablelist COMMA ids cpxName */
#line 562 "sql.y"
{
  yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n;
  yylhsminor.yy460 = setTableNameList(yymsp[-3].minor.yy460, &yymsp[-1].minor.yy0, NULL);
}
#line 3598 "sql.c"
  yymsp[-3].minor.yy460 = yylhsminor.yy460;
        break;
      case 190: /* tablelist ::= tablelist COMMA ids cpxName ids */
#line 567 "sql.y"
{
  yymsp[-2].minor.yy0.n += yymsp[-1].minor.yy0.n;
  yylhsminor.yy460 = setTableNameList(yymsp[-4].minor.yy460, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0);
}
#line 3607 "sql.c"
  yymsp[-4].minor.yy460 = yylhsminor.yy460;
        break;
      case 191: /* tmvar ::= VARIABLE */
#line 574 "sql.y"
{yylhsminor.yy0 = yymsp[0].minor.yy0;}
#line 3613 "sql.c"
  yymsp[0].minor.yy0 = yylhsminor.yy0;
        break;
      case 192: /* interval_option ::= intervalKey LP tmvar RP */
#line 577 "sql.y"
{yylhsminor.yy160.interval = yymsp[-1].minor.yy0; yylhsminor.yy160.offset.n = 0; yylhsminor.yy160.token = yymsp[-3].minor.yy262;}
#line 3619 "sql.c"
  yymsp[-3].minor.yy160 = yylhsminor.yy160;
        break;
      case 193: /* interval_option ::= intervalKey LP tmvar COMMA tmvar RP */
#line 578 "sql.y"
{yylhsminor.yy160.interval = yymsp[-3].minor.yy0; yylhsminor.yy160.offset = yymsp[-1].minor.yy0;   yylhsminor.yy160.token = yymsp[-5].minor.yy262;}
#line 3625 "sql.c"
  yymsp[-5].minor.yy160 = yylhsminor.yy160;
        break;
      case 194: /* interval_option ::= */
#line 579 "sql.y"
{memset(&yymsp[1].minor.yy160, 0, sizeof(yymsp[1].minor.yy160));}
#line 3631 "sql.c"
        break;
      case 195: /* intervalKey ::= INTERVAL */
#line 582 "sql.y"
{yymsp[0].minor.yy262 = TK_INTERVAL;}
#line 3636 "sql.c"
        break;
      case 196: /* intervalKey ::= EVERY */
#line 583 "sql.y"
{yymsp[0].minor.yy262 = TK_EVERY;   }
#line 3641 "sql.c"
        break;
      case 197: /* session_option ::= */
#line 586 "sql.y"
{yymsp[1].minor.yy511.col.n = 0; yymsp[1].minor.yy511.gap.n = 0;}
#line 3646 "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.yy511.col = yymsp[-4].minor.yy0;
   yymsp[-6].minor.yy511.gap = yymsp[-1].minor.yy0;
}
#line 3655 "sql.c"
        break;
      case 199: /* windowstate_option ::= */
#line 594 "sql.y"
{ yymsp[1].minor.yy258.col.n = 0; yymsp[1].minor.yy258.col.z = NULL;}
#line 3660 "sql.c"
        break;
      case 200: /* windowstate_option ::= STATE_WINDOW LP ids RP */
#line 595 "sql.y"
{ yymsp[-3].minor.yy258.col = yymsp[-1].minor.yy0; }
#line 3665 "sql.c"
        break;
      case 201: /* fill_opt ::= */
#line 599 "sql.y"
{ yymsp[1].minor.yy135 = 0;     }
#line 3670 "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.yy135, &A, -1, 0);
    yymsp[-5].minor.yy135 = yymsp[-1].minor.yy135;
}
#line 3682 "sql.c"
        break;
      case 203: /* fill_opt ::= FILL LP ID RP */
#line 609 "sql.y"
{
    toTSDBType(yymsp[-1].minor.yy0.type);
    yymsp[-3].minor.yy135 = tVariantListAppendToken(NULL, &yymsp[-1].minor.yy0, -1);
}
#line 3690 "sql.c"
        break;
      case 204: /* sliding_opt ::= SLIDING LP tmvar RP */
#line 615 "sql.y"
{yymsp[-3].minor.yy0 = yymsp[-1].minor.yy0;     }
#line 3695 "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 3700 "sql.c"
        break;
      case 207: /* orderby_opt ::= ORDER BY sortlist */
#line 628 "sql.y"
{yymsp[-2].minor.yy135 = yymsp[0].minor.yy135;}
#line 3705 "sql.c"
        break;
      case 208: /* sortlist ::= sortlist COMMA item sortorder */
#line 630 "sql.y"
{
    yylhsminor.yy135 = tVariantListAppend(yymsp[-3].minor.yy135, &yymsp[-1].minor.yy308, yymsp[0].minor.yy130);
}
#line 3712 "sql.c"
  yymsp[-3].minor.yy135 = yylhsminor.yy135;
        break;
      case 209: /* sortlist ::= item sortorder */
#line 634 "sql.y"
{
  yylhsminor.yy135 = tVariantListAppend(NULL, &yymsp[-1].minor.yy308, yymsp[0].minor.yy130);
}
#line 3720 "sql.c"
  yymsp[-1].minor.yy135 = yylhsminor.yy135;
        break;
      case 210: /* item ::= ids cpxName */
#line 639 "sql.y"
{
  toTSDBType(yymsp[-1].minor.yy0.type);
  yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n;

  tVariantCreate(&yylhsminor.yy308, &yymsp[-1].minor.yy0);
}
#line 3731 "sql.c"
  yymsp[-1].minor.yy308 = yylhsminor.yy308;
        break;
      case 211: /* sortorder ::= ASC */
#line 647 "sql.y"
{ yymsp[0].minor.yy130 = TSDB_ORDER_ASC; }
#line 3737 "sql.c"
        break;
      case 212: /* sortorder ::= DESC */
#line 648 "sql.y"
{ yymsp[0].minor.yy130 = TSDB_ORDER_DESC;}
#line 3742 "sql.c"
        break;
      case 213: /* sortorder ::= */
#line 649 "sql.y"
{ yymsp[1].minor.yy130 = TSDB_ORDER_ASC; }
#line 3747 "sql.c"
        break;
      case 214: /* groupby_opt ::= */
#line 657 "sql.y"
{ yymsp[1].minor.yy135 = 0;}
#line 3752 "sql.c"
        break;
      case 215: /* groupby_opt ::= GROUP BY grouplist */
#line 658 "sql.y"
{ yymsp[-2].minor.yy135 = yymsp[0].minor.yy135;}
#line 3757 "sql.c"
        break;
      case 216: /* grouplist ::= grouplist COMMA item */
#line 660 "sql.y"
{
  yylhsminor.yy135 = tVariantListAppend(yymsp[-2].minor.yy135, &yymsp[0].minor.yy308, -1);
}
#line 3764 "sql.c"
  yymsp[-2].minor.yy135 = yylhsminor.yy135;
        break;
      case 217: /* grouplist ::= item */
#line 664 "sql.y"
{
  yylhsminor.yy135 = tVariantListAppend(NULL, &yymsp[0].minor.yy308, -1);
}
#line 3772 "sql.c"
  yymsp[0].minor.yy135 = yylhsminor.yy135;
        break;
      case 218: /* having_opt ::= */
      case 228: /* where_opt ::= */ yytestcase(yyruleno==228);
      case 273: /* expritem ::= */ yytestcase(yyruleno==273);
#line 671 "sql.y"
{yymsp[1].minor.yy526 = 0;}
#line 3780 "sql.c"
        break;
      case 219: /* having_opt ::= HAVING expr */
      case 229: /* where_opt ::= WHERE expr */ yytestcase(yyruleno==229);
#line 672 "sql.y"
{yymsp[-1].minor.yy526 = yymsp[0].minor.yy526;}
#line 3786 "sql.c"
        break;
      case 220: /* limit_opt ::= */
      case 224: /* slimit_opt ::= */ yytestcase(yyruleno==224);
#line 676 "sql.y"
{yymsp[1].minor.yy126.limit = -1; yymsp[1].minor.yy126.offset = 0;}
#line 3792 "sql.c"
        break;
      case 221: /* limit_opt ::= LIMIT signed */
      case 225: /* slimit_opt ::= SLIMIT signed */ yytestcase(yyruleno==225);
#line 677 "sql.y"
{yymsp[-1].minor.yy126.limit = yymsp[0].minor.yy531;  yymsp[-1].minor.yy126.offset = 0;}
#line 3798 "sql.c"
        break;
      case 222: /* limit_opt ::= LIMIT signed OFFSET signed */
#line 679 "sql.y"
{ yymsp[-3].minor.yy126.limit = yymsp[-2].minor.yy531;  yymsp[-3].minor.yy126.offset = yymsp[0].minor.yy531;}
#line 3803 "sql.c"
        break;
      case 223: /* limit_opt ::= LIMIT signed COMMA signed */
#line 681 "sql.y"
{ yymsp[-3].minor.yy126.limit = yymsp[0].minor.yy531;  yymsp[-3].minor.yy126.offset = yymsp[-2].minor.yy531;}
#line 3808 "sql.c"
        break;
      case 226: /* slimit_opt ::= SLIMIT signed SOFFSET signed */
#line 687 "sql.y"
{yymsp[-3].minor.yy126.limit = yymsp[-2].minor.yy531;  yymsp[-3].minor.yy126.offset = yymsp[0].minor.yy531;}
#line 3813 "sql.c"
        break;
      case 227: /* slimit_opt ::= SLIMIT signed COMMA signed */
#line 689 "sql.y"
{yymsp[-3].minor.yy126.limit = yymsp[0].minor.yy531;  yymsp[-3].minor.yy126.offset = yymsp[-2].minor.yy531;}
#line 3818 "sql.c"
        break;
      case 230: /* expr ::= LP expr RP */
#line 702 "sql.y"
{yylhsminor.yy526 = yymsp[-1].minor.yy526; yylhsminor.yy526->exprToken.z = yymsp[-2].minor.yy0.z; yylhsminor.yy526->exprToken.n = (yymsp[0].minor.yy0.z - yymsp[-2].minor.yy0.z + 1);}
#line 3823 "sql.c"
  yymsp[-2].minor.yy526 = yylhsminor.yy526;
        break;
      case 231: /* expr ::= ID */
#line 704 "sql.y"
{ yylhsminor.yy526 = tSqlExprCreateIdValue(&yymsp[0].minor.yy0, TK_ID);}
#line 3829 "sql.c"
  yymsp[0].minor.yy526 = yylhsminor.yy526;
        break;
      case 232: /* expr ::= ID DOT ID */
#line 705 "sql.y"
{ yymsp[-2].minor.yy0.n += (1+yymsp[0].minor.yy0.n); yylhsminor.yy526 = tSqlExprCreateIdValue(&yymsp[-2].minor.yy0, TK_ID);}
#line 3835 "sql.c"
  yymsp[-2].minor.yy526 = yylhsminor.yy526;
        break;
      case 233: /* expr ::= ID DOT STAR */
#line 706 "sql.y"
{ yymsp[-2].minor.yy0.n += (1+yymsp[0].minor.yy0.n); yylhsminor.yy526 = tSqlExprCreateIdValue(&yymsp[-2].minor.yy0, TK_ALL);}
#line 3841 "sql.c"
  yymsp[-2].minor.yy526 = yylhsminor.yy526;
        break;
      case 234: /* expr ::= INTEGER */
#line 708 "sql.y"
{ yylhsminor.yy526 = tSqlExprCreateIdValue(&yymsp[0].minor.yy0, TK_INTEGER);}
#line 3847 "sql.c"
  yymsp[0].minor.yy526 = yylhsminor.yy526;
        break;
      case 235: /* expr ::= MINUS INTEGER */
      case 236: /* expr ::= PLUS INTEGER */ yytestcase(yyruleno==236);
#line 709 "sql.y"
{ yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; yymsp[-1].minor.yy0.type = TK_INTEGER; yylhsminor.yy526 = tSqlExprCreateIdValue(&yymsp[-1].minor.yy0, TK_INTEGER);}
#line 3854 "sql.c"
  yymsp[-1].minor.yy526 = yylhsminor.yy526;
        break;
      case 237: /* expr ::= FLOAT */
#line 711 "sql.y"
{ yylhsminor.yy526 = tSqlExprCreateIdValue(&yymsp[0].minor.yy0, TK_FLOAT);}
#line 3860 "sql.c"
  yymsp[0].minor.yy526 = yylhsminor.yy526;
        break;
      case 238: /* expr ::= MINUS FLOAT */
      case 239: /* expr ::= PLUS FLOAT */ yytestcase(yyruleno==239);
#line 712 "sql.y"
{ yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; yymsp[-1].minor.yy0.type = TK_FLOAT; yylhsminor.yy526 = tSqlExprCreateIdValue(&yymsp[-1].minor.yy0, TK_FLOAT);}
#line 3867 "sql.c"
  yymsp[-1].minor.yy526 = yylhsminor.yy526;
        break;
      case 240: /* expr ::= STRING */
#line 714 "sql.y"
{ yylhsminor.yy526 = tSqlExprCreateIdValue(&yymsp[0].minor.yy0, TK_STRING);}
#line 3873 "sql.c"
  yymsp[0].minor.yy526 = yylhsminor.yy526;
        break;
      case 241: /* expr ::= NOW */
#line 715 "sql.y"
{ yylhsminor.yy526 = tSqlExprCreateIdValue(&yymsp[0].minor.yy0, TK_NOW); }
#line 3879 "sql.c"
  yymsp[0].minor.yy526 = yylhsminor.yy526;
        break;
      case 242: /* expr ::= VARIABLE */
#line 716 "sql.y"
{ yylhsminor.yy526 = tSqlExprCreateIdValue(&yymsp[0].minor.yy0, TK_VARIABLE);}
#line 3885 "sql.c"
  yymsp[0].minor.yy526 = yylhsminor.yy526;
        break;
      case 243: /* expr ::= PLUS VARIABLE */
      case 244: /* expr ::= MINUS VARIABLE */ yytestcase(yyruleno==244);
#line 717 "sql.y"
{ yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; yymsp[-1].minor.yy0.type = TK_VARIABLE; yylhsminor.yy526 = tSqlExprCreateIdValue(&yymsp[-1].minor.yy0, TK_VARIABLE);}
#line 3892 "sql.c"
  yymsp[-1].minor.yy526 = yylhsminor.yy526;
        break;
      case 245: /* expr ::= BOOL */
#line 719 "sql.y"
{ yylhsminor.yy526 = tSqlExprCreateIdValue(&yymsp[0].minor.yy0, TK_BOOL);}
#line 3898 "sql.c"
  yymsp[0].minor.yy526 = yylhsminor.yy526;
        break;
      case 246: /* expr ::= NULL */
#line 720 "sql.y"
{ yylhsminor.yy526 = tSqlExprCreateIdValue(&yymsp[0].minor.yy0, TK_NULL);}
#line 3904 "sql.c"
  yymsp[0].minor.yy526 = yylhsminor.yy526;
        break;
      case 247: /* expr ::= ID LP exprlist RP */
#line 723 "sql.y"
{ tStrTokenAppend(pInfo->funcs, &yymsp[-3].minor.yy0); yylhsminor.yy526 = tSqlExprCreateFunction(yymsp[-1].minor.yy135, &yymsp[-3].minor.yy0, &yymsp[0].minor.yy0, yymsp[-3].minor.yy0.type); }
#line 3910 "sql.c"
  yymsp[-3].minor.yy526 = yylhsminor.yy526;
        break;
      case 248: /* expr ::= ID LP STAR RP */
#line 726 "sql.y"
{ tStrTokenAppend(pInfo->funcs, &yymsp[-3].minor.yy0); yylhsminor.yy526 = tSqlExprCreateFunction(NULL, &yymsp[-3].minor.yy0, &yymsp[0].minor.yy0, yymsp[-3].minor.yy0.type); }
#line 3916 "sql.c"
  yymsp[-3].minor.yy526 = yylhsminor.yy526;
        break;
      case 249: /* expr ::= expr IS NULL */
#line 729 "sql.y"
{yylhsminor.yy526 = tSqlExprCreate(yymsp[-2].minor.yy526, NULL, TK_ISNULL);}
#line 3922 "sql.c"
  yymsp[-2].minor.yy526 = yylhsminor.yy526;
        break;
      case 250: /* expr ::= expr IS NOT NULL */
#line 730 "sql.y"
{yylhsminor.yy526 = tSqlExprCreate(yymsp[-3].minor.yy526, NULL, TK_NOTNULL);}
#line 3928 "sql.c"
  yymsp[-3].minor.yy526 = yylhsminor.yy526;
        break;
      case 251: /* expr ::= expr LT expr */
#line 733 "sql.y"
{yylhsminor.yy526 = tSqlExprCreate(yymsp[-2].minor.yy526, yymsp[0].minor.yy526, TK_LT);}
#line 3934 "sql.c"
  yymsp[-2].minor.yy526 = yylhsminor.yy526;
        break;
      case 252: /* expr ::= expr GT expr */
#line 734 "sql.y"
{yylhsminor.yy526 = tSqlExprCreate(yymsp[-2].minor.yy526, yymsp[0].minor.yy526, TK_GT);}
#line 3940 "sql.c"
  yymsp[-2].minor.yy526 = yylhsminor.yy526;
        break;
      case 253: /* expr ::= expr LE expr */
#line 735 "sql.y"
{yylhsminor.yy526 = tSqlExprCreate(yymsp[-2].minor.yy526, yymsp[0].minor.yy526, TK_LE);}
#line 3946 "sql.c"
  yymsp[-2].minor.yy526 = yylhsminor.yy526;
        break;
      case 254: /* expr ::= expr GE expr */
#line 736 "sql.y"
{yylhsminor.yy526 = tSqlExprCreate(yymsp[-2].minor.yy526, yymsp[0].minor.yy526, TK_GE);}
#line 3952 "sql.c"
  yymsp[-2].minor.yy526 = yylhsminor.yy526;
        break;
      case 255: /* expr ::= expr NE expr */
#line 737 "sql.y"
{yylhsminor.yy526 = tSqlExprCreate(yymsp[-2].minor.yy526, yymsp[0].minor.yy526, TK_NE);}
#line 3958 "sql.c"
  yymsp[-2].minor.yy526 = yylhsminor.yy526;
        break;
      case 256: /* expr ::= expr EQ expr */
#line 738 "sql.y"
{yylhsminor.yy526 = tSqlExprCreate(yymsp[-2].minor.yy526, yymsp[0].minor.yy526, TK_EQ);}
#line 3964 "sql.c"
  yymsp[-2].minor.yy526 = yylhsminor.yy526;
        break;
      case 257: /* expr ::= expr BETWEEN expr AND expr */
#line 740 "sql.y"
{ tSqlExpr* X2 = tSqlExprClone(yymsp[-4].minor.yy526); yylhsminor.yy526 = tSqlExprCreate(tSqlExprCreate(yymsp[-4].minor.yy526, yymsp[-2].minor.yy526, TK_GE), tSqlExprCreate(X2, yymsp[0].minor.yy526, TK_LE), TK_AND);}
#line 3970 "sql.c"
  yymsp[-4].minor.yy526 = yylhsminor.yy526;
        break;
      case 258: /* expr ::= expr AND expr */
#line 742 "sql.y"
{yylhsminor.yy526 = tSqlExprCreate(yymsp[-2].minor.yy526, yymsp[0].minor.yy526, TK_AND);}
#line 3976 "sql.c"
  yymsp[-2].minor.yy526 = yylhsminor.yy526;
        break;
      case 259: /* expr ::= expr OR expr */
#line 743 "sql.y"
{yylhsminor.yy526 = tSqlExprCreate(yymsp[-2].minor.yy526, yymsp[0].minor.yy526, TK_OR); }
#line 3982 "sql.c"
  yymsp[-2].minor.yy526 = yylhsminor.yy526;
        break;
      case 260: /* expr ::= expr PLUS expr */
#line 746 "sql.y"
{yylhsminor.yy526 = tSqlExprCreate(yymsp[-2].minor.yy526, yymsp[0].minor.yy526, TK_PLUS);  }
#line 3988 "sql.c"
  yymsp[-2].minor.yy526 = yylhsminor.yy526;
        break;
      case 261: /* expr ::= expr MINUS expr */
#line 747 "sql.y"
{yylhsminor.yy526 = tSqlExprCreate(yymsp[-2].minor.yy526, yymsp[0].minor.yy526, TK_MINUS); }
#line 3994 "sql.c"
  yymsp[-2].minor.yy526 = yylhsminor.yy526;
        break;
      case 262: /* expr ::= expr STAR expr */
#line 748 "sql.y"
{yylhsminor.yy526 = tSqlExprCreate(yymsp[-2].minor.yy526, yymsp[0].minor.yy526, TK_STAR);  }
#line 4000 "sql.c"
  yymsp[-2].minor.yy526 = yylhsminor.yy526;
        break;
      case 263: /* expr ::= expr SLASH expr */
#line 749 "sql.y"
{yylhsminor.yy526 = tSqlExprCreate(yymsp[-2].minor.yy526, yymsp[0].minor.yy526, TK_DIVIDE);}
#line 4006 "sql.c"
  yymsp[-2].minor.yy526 = yylhsminor.yy526;
        break;
      case 264: /* expr ::= expr REM expr */
#line 750 "sql.y"
{yylhsminor.yy526 = tSqlExprCreate(yymsp[-2].minor.yy526, yymsp[0].minor.yy526, TK_REM);   }
#line 4012 "sql.c"
  yymsp[-2].minor.yy526 = yylhsminor.yy526;
        break;
      case 265: /* expr ::= expr LIKE expr */
#line 753 "sql.y"
{yylhsminor.yy526 = tSqlExprCreate(yymsp[-2].minor.yy526, yymsp[0].minor.yy526, TK_LIKE);  }
#line 4018 "sql.c"
  yymsp[-2].minor.yy526 = yylhsminor.yy526;
        break;
      case 266: /* expr ::= expr MATCH expr */
#line 756 "sql.y"
{yylhsminor.yy526 = tSqlExprCreate(yymsp[-2].minor.yy526, yymsp[0].minor.yy526, TK_MATCH);  }
#line 4024 "sql.c"
  yymsp[-2].minor.yy526 = yylhsminor.yy526;
        break;
      case 267: /* expr ::= expr QUESTION expr */
#line 759 "sql.y"
{yylhsminor.yy526 = tSqlExprCreate(yymsp[-2].minor.yy526, yymsp[0].minor.yy526, TK_QUESTION);  }
#line 4030 "sql.c"
  yymsp[-2].minor.yy526 = yylhsminor.yy526;
        break;
      case 268: /* expr ::= expr ARROW expr */
#line 762 "sql.y"
{yylhsminor.yy526 = tSqlExprCreate(yymsp[-2].minor.yy526, yymsp[0].minor.yy526, TK_ARROW);  }
#line 4036 "sql.c"
  yymsp[-2].minor.yy526 = yylhsminor.yy526;
        break;
      case 269: /* expr ::= expr IN LP exprlist RP */
#line 765 "sql.y"
{yylhsminor.yy526 = tSqlExprCreate(yymsp[-4].minor.yy526, (tSqlExpr*)yymsp[-1].minor.yy135, TK_IN); }
#line 4042 "sql.c"
  yymsp[-4].minor.yy526 = yylhsminor.yy526;
        break;
      case 270: /* exprlist ::= exprlist COMMA expritem */
#line 773 "sql.y"
{yylhsminor.yy135 = tSqlExprListAppend(yymsp[-2].minor.yy135,yymsp[0].minor.yy526,0, 0);}
#line 4048 "sql.c"
  yymsp[-2].minor.yy135 = yylhsminor.yy135;
        break;
      case 271: /* exprlist ::= expritem */
#line 774 "sql.y"
{yylhsminor.yy135 = tSqlExprListAppend(0,yymsp[0].minor.yy526,0, 0);}
#line 4054 "sql.c"
  yymsp[0].minor.yy135 = yylhsminor.yy135;
        break;
      case 272: /* expritem ::= expr */
#line 775 "sql.y"
{yylhsminor.yy526 = yymsp[0].minor.yy526;}
#line 4060 "sql.c"
  yymsp[0].minor.yy526 = yylhsminor.yy526;
        break;
      case 274: /* cmd ::= RESET QUERY CACHE */
#line 779 "sql.y"
{ setDCLSqlElems(pInfo, TSDB_SQL_RESET_CACHE, 0);}
#line 4066 "sql.c"
        break;
      case 275: /* cmd ::= SYNCDB ids REPLICA */
#line 782 "sql.y"
{ setDCLSqlElems(pInfo, TSDB_SQL_SYNC_DB_REPLICA, 1, &yymsp[-1].minor.yy0);}
#line 4071 "sql.c"
        break;
      case 276: /* cmd ::= ALTER TABLE ids cpxName ADD COLUMN columnlist */
#line 785 "sql.y"
{
    yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n;
    SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, yymsp[0].minor.yy135, NULL, TSDB_ALTER_TABLE_ADD_COLUMN, -1);
    setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE);
}
#line 4080 "sql.c"
        break;
      case 277: /* cmd ::= ALTER TABLE ids cpxName DROP COLUMN ids */
#line 791 "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 4093 "sql.c"
        break;
      case 278: /* cmd ::= ALTER TABLE ids cpxName MODIFY COLUMN columnlist */
#line 801 "sql.y"
{
    yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n;
    SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, yymsp[0].minor.yy135, NULL, TSDB_ALTER_TABLE_CHANGE_COLUMN, -1);
    setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE);
}
#line 4102 "sql.c"
        break;
      case 279: /* cmd ::= ALTER TABLE ids cpxName ADD TAG columnlist */
#line 808 "sql.y"
{
    yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n;
    SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, yymsp[0].minor.yy135, NULL, TSDB_ALTER_TABLE_ADD_TAG_COLUMN, -1);
    setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE);
}
#line 4111 "sql.c"
        break;
      case 280: /* cmd ::= ALTER TABLE ids cpxName DROP TAG ids */
#line 813 "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 4124 "sql.c"
        break;
      case 281: /* cmd ::= ALTER TABLE ids cpxName CHANGE TAG ids ids */
#line 823 "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 4140 "sql.c"
        break;
      case 282: /* cmd ::= ALTER TABLE ids cpxName SET TAG ids EQ tagitem */
#line 836 "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.yy308, -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 4154 "sql.c"
        break;
      case 283: /* cmd ::= ALTER TABLE ids cpxName MODIFY TAG columnlist */
#line 847 "sql.y"
{
    yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n;
    SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, yymsp[0].minor.yy135, NULL, TSDB_ALTER_TABLE_MODIFY_TAG_COLUMN, -1);
    setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE);
}
#line 4163 "sql.c"
        break;
      case 284: /* cmd ::= ALTER STABLE ids cpxName ADD COLUMN columnlist */
#line 854 "sql.y"
{
    yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n;
    SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, yymsp[0].minor.yy135, NULL, TSDB_ALTER_TABLE_ADD_COLUMN, TSDB_SUPER_TABLE);
    setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE);
}
#line 4172 "sql.c"
        break;
      case 285: /* cmd ::= ALTER STABLE ids cpxName DROP COLUMN ids */
#line 860 "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 4185 "sql.c"
        break;
      case 286: /* cmd ::= ALTER STABLE ids cpxName MODIFY COLUMN columnlist */
#line 870 "sql.y"
{
    yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n;
    SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, yymsp[0].minor.yy135, NULL, TSDB_ALTER_TABLE_CHANGE_COLUMN, TSDB_SUPER_TABLE);
    setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE);
}
#line 4194 "sql.c"
        break;
      case 287: /* cmd ::= ALTER STABLE ids cpxName ADD TAG columnlist */
#line 877 "sql.y"
{
    yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n;
    SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, yymsp[0].minor.yy135, NULL, TSDB_ALTER_TABLE_ADD_TAG_COLUMN, TSDB_SUPER_TABLE);
    setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE);
}
#line 4203 "sql.c"
        break;
      case 288: /* cmd ::= ALTER STABLE ids cpxName DROP TAG ids */
#line 882 "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 4216 "sql.c"
        break;
      case 289: /* cmd ::= ALTER STABLE ids cpxName CHANGE TAG ids ids */
#line 892 "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 4232 "sql.c"
        break;
      case 290: /* cmd ::= ALTER STABLE ids cpxName SET TAG ids EQ tagitem */
#line 905 "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.yy308, -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 4246 "sql.c"
        break;
      case 291: /* cmd ::= ALTER STABLE ids cpxName MODIFY TAG columnlist */
#line 916 "sql.y"
{
    yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n;
    SAlterTableInfo* pAlterTable = tSetAlterTableInfo(&yymsp[-4].minor.yy0, yymsp[0].minor.yy135, NULL, TSDB_ALTER_TABLE_MODIFY_TAG_COLUMN, TSDB_SUPER_TABLE);
    setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE);
}
#line 4255 "sql.c"
        break;
      case 292: /* cmd ::= KILL CONNECTION INTEGER */
#line 923 "sql.y"
{setKillSql(pInfo, TSDB_SQL_KILL_CONNECTION, &yymsp[0].minor.yy0);}
#line 4260 "sql.c"
        break;
      case 293: /* cmd ::= KILL STREAM INTEGER COLON INTEGER */
#line 924 "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 4265 "sql.c"
        break;
      case 294: /* cmd ::= KILL QUERY INTEGER COLON INTEGER */
#line 925 "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 4270 "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 4355 "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 4382 "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
}
