未验证 提交 c20d5741 编写于 作者: H haojun Liao 提交者: GitHub

Merge pull request #4938 from taosdata/feature/TD-2671

[TD-2671]<fix>:support create/drop/alter stable
...@@ -264,6 +264,7 @@ int32_t tscToSQLCmd(SSqlObj* pSql, struct SSqlInfo* pInfo) { ...@@ -264,6 +264,7 @@ int32_t tscToSQLCmd(SSqlObj* pSql, struct SSqlInfo* pInfo) {
case TSDB_SQL_DROP_DB: { case TSDB_SQL_DROP_DB: {
const char* msg2 = "invalid name"; const char* msg2 = "invalid name";
const char* msg3 = "param name too long"; const char* msg3 = "param name too long";
const char* msg4 = "table is not super table";
SStrToken* pzName = &pInfo->pDCLInfo->a[0]; SStrToken* pzName = &pInfo->pDCLInfo->a[0];
if ((pInfo->type != TSDB_SQL_DROP_DNODE) && (tscValidateName(pzName) != TSDB_CODE_SUCCESS)) { if ((pInfo->type != TSDB_SQL_DROP_DNODE) && (tscValidateName(pzName) != TSDB_CODE_SUCCESS)) {
...@@ -285,6 +286,18 @@ int32_t tscToSQLCmd(SSqlObj* pSql, struct SSqlInfo* pInfo) { ...@@ -285,6 +286,18 @@ int32_t tscToSQLCmd(SSqlObj* pSql, struct SSqlInfo* pInfo) {
if(code != TSDB_CODE_SUCCESS) { if(code != TSDB_CODE_SUCCESS) {
return code; return code;
} }
if (pInfo->pDCLInfo->tableType == TSDB_SUPER_TABLE) {
code = tscGetTableMeta(pSql, pTableMetaInfo);
if (code != TSDB_CODE_SUCCESS) {
return code;
}
if (!UTIL_TABLE_IS_SUPER_TABLE(pTableMetaInfo)) {
return invalidSqlErrMsg(tscGetErrorMsgPayload(pCmd), msg4);
}
}
} else if (pInfo->type == TSDB_SQL_DROP_DNODE) { } else if (pInfo->type == TSDB_SQL_DROP_DNODE) {
pzName->n = strdequote(pzName->z); pzName->n = strdequote(pzName->z);
strncpy(pTableMetaInfo->name, pzName->z, pzName->n); strncpy(pTableMetaInfo->name, pzName->z, pzName->n);
...@@ -4794,6 +4807,7 @@ int32_t setAlterTableInfo(SSqlObj* pSql, struct SSqlInfo* pInfo) { ...@@ -4794,6 +4807,7 @@ int32_t setAlterTableInfo(SSqlObj* pSql, struct SSqlInfo* pInfo) {
const char* msg17 = "invalid column name"; const char* msg17 = "invalid column name";
const char* msg18 = "primary timestamp column cannot be dropped"; const char* msg18 = "primary timestamp column cannot be dropped";
const char* msg19 = "invalid new tag name"; const char* msg19 = "invalid new tag name";
const char* msg20 = "table is not super table";
int32_t code = TSDB_CODE_SUCCESS; int32_t code = TSDB_CODE_SUCCESS;
...@@ -4819,6 +4833,10 @@ int32_t setAlterTableInfo(SSqlObj* pSql, struct SSqlInfo* pInfo) { ...@@ -4819,6 +4833,10 @@ int32_t setAlterTableInfo(SSqlObj* pSql, struct SSqlInfo* pInfo) {
STableMeta* pTableMeta = pTableMetaInfo->pTableMeta; STableMeta* pTableMeta = pTableMetaInfo->pTableMeta;
if (pAlterSQL->tableType == TSDB_SUPER_TABLE && !(UTIL_TABLE_IS_SUPER_TABLE(pTableMetaInfo))) {
return invalidSqlErrMsg(tscGetErrorMsgPayload(pCmd), msg20);
}
if (pAlterSQL->type == TSDB_ALTER_TABLE_ADD_TAG_COLUMN || pAlterSQL->type == TSDB_ALTER_TABLE_DROP_TAG_COLUMN || if (pAlterSQL->type == TSDB_ALTER_TABLE_ADD_TAG_COLUMN || pAlterSQL->type == TSDB_ALTER_TABLE_DROP_TAG_COLUMN ||
pAlterSQL->type == TSDB_ALTER_TABLE_CHANGE_TAG_COLUMN) { pAlterSQL->type == TSDB_ALTER_TABLE_CHANGE_TAG_COLUMN) {
if (UTIL_TABLE_IS_NORMAL_TABLE(pTableMetaInfo)) { if (UTIL_TABLE_IS_NORMAL_TABLE(pTableMetaInfo)) {
......
...@@ -2193,7 +2193,7 @@ int tscProcessDropTableRsp(SSqlObj *pSql) { ...@@ -2193,7 +2193,7 @@ int tscProcessDropTableRsp(SSqlObj *pSql) {
tscDebug("%p remove table meta after drop table:%s, numOfRemain:%d", pSql, pTableMetaInfo->name, tscDebug("%p remove table meta after drop table:%s, numOfRemain:%d", pSql, pTableMetaInfo->name,
(int32_t) taosHashGetSize(tscTableMetaInfo)); (int32_t) taosHashGetSize(tscTableMetaInfo));
assert(pTableMetaInfo->pTableMeta == NULL); pTableMetaInfo->pTableMeta = NULL;
return 0; return 0;
} }
......
...@@ -82,151 +82,154 @@ ...@@ -82,151 +82,154 @@
#define TK_STABLES 64 #define TK_STABLES 64
#define TK_VGROUPS 65 #define TK_VGROUPS 65
#define TK_DROP 66 #define TK_DROP 66
#define TK_DNODE 67 #define TK_STABLE 67
#define TK_USER 68 #define TK_DNODE 68
#define TK_ACCOUNT 69 #define TK_USER 69
#define TK_USE 70 #define TK_ACCOUNT 70
#define TK_DESCRIBE 71 #define TK_USE 71
#define TK_ALTER 72 #define TK_DESCRIBE 72
#define TK_PASS 73 #define TK_ALTER 73
#define TK_PRIVILEGE 74 #define TK_PASS 74
#define TK_LOCAL 75 #define TK_PRIVILEGE 75
#define TK_IF 76 #define TK_LOCAL 76
#define TK_EXISTS 77 #define TK_IF 77
#define TK_PPS 78 #define TK_EXISTS 78
#define TK_TSERIES 79 #define TK_PPS 79
#define TK_DBS 80 #define TK_TSERIES 80
#define TK_STORAGE 81 #define TK_DBS 81
#define TK_QTIME 82 #define TK_STORAGE 82
#define TK_CONNS 83 #define TK_QTIME 83
#define TK_STATE 84 #define TK_CONNS 84
#define TK_KEEP 85 #define TK_STATE 85
#define TK_CACHE 86 #define TK_KEEP 86
#define TK_REPLICA 87 #define TK_CACHE 87
#define TK_QUORUM 88 #define TK_REPLICA 88
#define TK_DAYS 89 #define TK_QUORUM 89
#define TK_MINROWS 90 #define TK_DAYS 90
#define TK_MAXROWS 91 #define TK_MINROWS 91
#define TK_BLOCKS 92 #define TK_MAXROWS 92
#define TK_CTIME 93 #define TK_BLOCKS 93
#define TK_WAL 94 #define TK_CTIME 94
#define TK_FSYNC 95 #define TK_WAL 95
#define TK_COMP 96 #define TK_FSYNC 96
#define TK_PRECISION 97 #define TK_COMP 97
#define TK_UPDATE 98 #define TK_PRECISION 98
#define TK_CACHELAST 99 #define TK_UPDATE 99
#define TK_LP 100 #define TK_CACHELAST 100
#define TK_RP 101 #define TK_LP 101
#define TK_UNSIGNED 102 #define TK_RP 102
#define TK_TAGS 103 #define TK_UNSIGNED 103
#define TK_USING 104 #define TK_TAGS 104
#define TK_AS 105 #define TK_USING 105
#define TK_COMMA 106 #define TK_AS 106
#define TK_NULL 107 #define TK_COMMA 107
#define TK_SELECT 108 #define TK_NULL 108
#define TK_UNION 109 #define TK_SELECT 109
#define TK_ALL 110 #define TK_UNION 110
#define TK_FROM 111 #define TK_ALL 111
#define TK_VARIABLE 112 #define TK_FROM 112
#define TK_INTERVAL 113 #define TK_VARIABLE 113
#define TK_FILL 114 #define TK_INTERVAL 114
#define TK_SLIDING 115 #define TK_FILL 115
#define TK_ORDER 116 #define TK_SLIDING 116
#define TK_BY 117 #define TK_ORDER 117
#define TK_ASC 118 #define TK_BY 118
#define TK_DESC 119 #define TK_ASC 119
#define TK_GROUP 120 #define TK_DESC 120
#define TK_HAVING 121 #define TK_GROUP 121
#define TK_LIMIT 122 #define TK_HAVING 122
#define TK_OFFSET 123 #define TK_LIMIT 123
#define TK_SLIMIT 124 #define TK_OFFSET 124
#define TK_SOFFSET 125 #define TK_SLIMIT 125
#define TK_WHERE 126 #define TK_SOFFSET 126
#define TK_NOW 127 #define TK_WHERE 127
#define TK_RESET 128 #define TK_NOW 128
#define TK_QUERY 129 #define TK_RESET 129
#define TK_ADD 130 #define TK_QUERY 130
#define TK_COLUMN 131 #define TK_ADD 131
#define TK_TAG 132 #define TK_COLUMN 132
#define TK_CHANGE 133 #define TK_TAG 133
#define TK_SET 134 #define TK_CHANGE 134
#define TK_KILL 135 #define TK_SET 135
#define TK_CONNECTION 136 #define TK_KILL 136
#define TK_STREAM 137 #define TK_CONNECTION 137
#define TK_COLON 138 #define TK_STREAM 138
#define TK_ABORT 139 #define TK_COLON 139
#define TK_AFTER 140 #define TK_ABORT 140
#define TK_ATTACH 141 #define TK_AFTER 141
#define TK_BEFORE 142 #define TK_ATTACH 142
#define TK_BEGIN 143 #define TK_BEFORE 143
#define TK_CASCADE 144 #define TK_BEGIN 144
#define TK_CLUSTER 145 #define TK_CASCADE 145
#define TK_CONFLICT 146 #define TK_CLUSTER 146
#define TK_COPY 147 #define TK_CONFLICT 147
#define TK_DEFERRED 148 #define TK_COPY 148
#define TK_DELIMITERS 149 #define TK_DEFERRED 149
#define TK_DETACH 150 #define TK_DELIMITERS 150
#define TK_EACH 151 #define TK_DETACH 151
#define TK_END 152 #define TK_EACH 152
#define TK_EXPLAIN 153 #define TK_END 153
#define TK_FAIL 154 #define TK_EXPLAIN 154
#define TK_FOR 155 #define TK_FAIL 155
#define TK_IGNORE 156 #define TK_FOR 156
#define TK_IMMEDIATE 157 #define TK_IGNORE 157
#define TK_INITIALLY 158 #define TK_IMMEDIATE 158
#define TK_INSTEAD 159 #define TK_INITIALLY 159
#define TK_MATCH 160 #define TK_INSTEAD 160
#define TK_KEY 161 #define TK_MATCH 161
#define TK_OF 162 #define TK_KEY 162
#define TK_RAISE 163 #define TK_OF 163
#define TK_REPLACE 164 #define TK_RAISE 164
#define TK_RESTRICT 165 #define TK_REPLACE 165
#define TK_ROW 166 #define TK_RESTRICT 166
#define TK_STATEMENT 167 #define TK_ROW 167
#define TK_TRIGGER 168 #define TK_STATEMENT 168
#define TK_VIEW 169 #define TK_TRIGGER 169
#define TK_COUNT 170 #define TK_VIEW 170
#define TK_SUM 171 #define TK_COUNT 171
#define TK_AVG 172 #define TK_SUM 172
#define TK_MIN 173 #define TK_AVG 173
#define TK_MAX 174 #define TK_MIN 174
#define TK_FIRST 175 #define TK_MAX 175
#define TK_LAST 176 #define TK_FIRST 176
#define TK_TOP 177 #define TK_LAST 177
#define TK_BOTTOM 178 #define TK_TOP 178
#define TK_STDDEV 179 #define TK_BOTTOM 179
#define TK_PERCENTILE 180 #define TK_STDDEV 180
#define TK_APERCENTILE 181 #define TK_PERCENTILE 181
#define TK_LEASTSQUARES 182 #define TK_APERCENTILE 182
#define TK_HISTOGRAM 183 #define TK_LEASTSQUARES 183
#define TK_DIFF 184 #define TK_HISTOGRAM 184
#define TK_SPREAD 185 #define TK_DIFF 185
#define TK_TWA 186 #define TK_SPREAD 186
#define TK_INTERP 187 #define TK_TWA 187
#define TK_LAST_ROW 188 #define TK_INTERP 188
#define TK_RATE 189 #define TK_LAST_ROW 189
#define TK_IRATE 190 #define TK_RATE 190
#define TK_SUM_RATE 191 #define TK_IRATE 191
#define TK_SUM_IRATE 192 #define TK_SUM_RATE 192
#define TK_AVG_RATE 193 #define TK_SUM_IRATE 193
#define TK_AVG_IRATE 194 #define TK_AVG_RATE 194
#define TK_TBID 195 #define TK_AVG_IRATE 195
#define TK_SEMI 196 #define TK_TBID 196
#define TK_NONE 197 #define TK_SEMI 197
#define TK_PREV 198 #define TK_NONE 198
#define TK_LINEAR 199 #define TK_PREV 199
#define TK_IMPORT 200 #define TK_LINEAR 200
#define TK_METRIC 201 #define TK_IMPORT 201
#define TK_TBNAME 202 #define TK_METRIC 202
#define TK_JOIN 203 #define TK_TBNAME 203
#define TK_METRICS 204 #define TK_JOIN 204
#define TK_STABLE 205 #define TK_METRICS 205
#define TK_INSERT 206 #define TK_INSERT 206
#define TK_INTO 207 #define TK_INTO 207
#define TK_VALUES 208 #define TK_VALUES 208
#define TK_SPACE 300 #define TK_SPACE 300
#define TK_COMMENT 301 #define TK_COMMENT 301
#define TK_ILLEGAL 302 #define TK_ILLEGAL 302
......
...@@ -98,6 +98,7 @@ typedef struct SCreateTableSQL { ...@@ -98,6 +98,7 @@ typedef struct SCreateTableSQL {
typedef struct SAlterTableSQL { typedef struct SAlterTableSQL {
SStrToken name; SStrToken name;
int16_t tableType;
int16_t type; int16_t type;
STagData tagData; STagData tagData;
SArray *pAddColumns; // SArray<TAOS_FIELD> SArray *pAddColumns; // SArray<TAOS_FIELD>
...@@ -156,6 +157,7 @@ typedef struct tDCLSQL { ...@@ -156,6 +157,7 @@ typedef struct tDCLSQL {
int32_t nAlloc; /* Number of entries allocated below */ int32_t nAlloc; /* Number of entries allocated below */
SStrToken *a; /* one entry for element */ SStrToken *a; /* one entry for element */
bool existsCheck; bool existsCheck;
int16_t tableType;
union { union {
SCreateDBInfo dbOpt; SCreateDBInfo dbOpt;
...@@ -250,7 +252,7 @@ SCreateTableSQL *tSetCreateSqlElems(SArray *pCols, SArray *pTags, SQuerySQL *pSe ...@@ -250,7 +252,7 @@ SCreateTableSQL *tSetCreateSqlElems(SArray *pCols, SArray *pTags, SQuerySQL *pSe
void tSqlExprNodeDestroy(tSQLExpr *pExpr); void tSqlExprNodeDestroy(tSQLExpr *pExpr);
SAlterTableSQL * tAlterTableSqlElems(SStrToken *pTableName, SArray *pCols, SArray *pVals, int32_t type); SAlterTableSQL * tAlterTableSqlElems(SStrToken *pTableName, SArray *pCols, SArray *pVals, int32_t type, int16_t tableTable);
SCreatedTableInfo createNewChildTableInfo(SStrToken *pTableName, SArray *pTagVals, SStrToken *pToken, SStrToken* igExists); SCreatedTableInfo createNewChildTableInfo(SStrToken *pTableName, SArray *pTagVals, SStrToken *pToken, SStrToken* igExists);
void destroyAllSelectClause(SSubclauseInfo *pSql); void destroyAllSelectClause(SSubclauseInfo *pSql);
...@@ -267,7 +269,7 @@ void setCreatedTableName(SSqlInfo *pInfo, SStrToken *pTableNameToken, SStrToken ...@@ -267,7 +269,7 @@ void setCreatedTableName(SSqlInfo *pInfo, SStrToken *pTableNameToken, SStrToken
void SqlInfoDestroy(SSqlInfo *pInfo); void SqlInfoDestroy(SSqlInfo *pInfo);
void setDCLSQLElems(SSqlInfo *pInfo, int32_t type, int32_t nParams, ...); void setDCLSQLElems(SSqlInfo *pInfo, int32_t type, int32_t nParams, ...);
void setDropDbTableInfo(SSqlInfo *pInfo, int32_t type, SStrToken* pToken, SStrToken* existsCheck); void setDropDbTableInfo(SSqlInfo *pInfo, int32_t type, SStrToken* pToken, SStrToken* existsCheck,int16_t tableType);
void setShowOptions(SSqlInfo *pInfo, int32_t type, SStrToken* prefix, SStrToken* pPatterns); void setShowOptions(SSqlInfo *pInfo, int32_t type, SStrToken* prefix, SStrToken* pPatterns);
tDCLSQL *tTokenListAppend(tDCLSQL *pTokenList, SStrToken *pToken); tDCLSQL *tTokenListAppend(tDCLSQL *pTokenList, SStrToken *pToken);
......
...@@ -131,10 +131,16 @@ cmd ::= SHOW dbPrefix(X) VGROUPS ids(Y). { ...@@ -131,10 +131,16 @@ cmd ::= SHOW dbPrefix(X) VGROUPS ids(Y). {
//drop configure for tables //drop configure for tables
cmd ::= DROP TABLE ifexists(Y) ids(X) cpxName(Z). { cmd ::= DROP TABLE ifexists(Y) ids(X) cpxName(Z). {
X.n += Z.n; X.n += Z.n;
setDropDbTableInfo(pInfo, TSDB_SQL_DROP_TABLE, &X, &Y); setDropDbTableInfo(pInfo, TSDB_SQL_DROP_TABLE, &X, &Y, -1);
} }
cmd ::= DROP DATABASE ifexists(Y) ids(X). { setDropDbTableInfo(pInfo, TSDB_SQL_DROP_DB, &X, &Y); } //drop stable
cmd ::= DROP STABLE ifexists(Y) ids(X) cpxName(Z). {
X.n += Z.n;
setDropDbTableInfo(pInfo, TSDB_SQL_DROP_TABLE, &X, &Y, TSDB_SUPER_TABLE);
}
cmd ::= DROP DATABASE ifexists(Y) ids(X). { setDropDbTableInfo(pInfo, TSDB_SQL_DROP_DB, &X, &Y, -1); }
cmd ::= DROP DNODE ids(X). { setDCLSQLElems(pInfo, TSDB_SQL_DROP_DNODE, 1, &X); } cmd ::= DROP DNODE ids(X). { setDCLSQLElems(pInfo, TSDB_SQL_DROP_DNODE, 1, &X); }
cmd ::= DROP USER ids(X). { setDCLSQLElems(pInfo, TSDB_SQL_DROP_USER, 1, &X); } cmd ::= DROP USER ids(X). { setDCLSQLElems(pInfo, TSDB_SQL_DROP_USER, 1, &X); }
cmd ::= DROP ACCOUNT ids(X). { setDCLSQLElems(pInfo, TSDB_SQL_DROP_ACCT, 1, &X); } cmd ::= DROP ACCOUNT ids(X). { setDCLSQLElems(pInfo, TSDB_SQL_DROP_ACCT, 1, &X); }
...@@ -305,6 +311,8 @@ signed(A) ::= MINUS INTEGER(X). { A = -strtol(X.z, NULL, 10);} ...@@ -305,6 +311,8 @@ signed(A) ::= MINUS INTEGER(X). { A = -strtol(X.z, NULL, 10);}
////////////////////////////////// The CREATE TABLE statement /////////////////////////////// ////////////////////////////////// The CREATE TABLE statement ///////////////////////////////
cmd ::= CREATE TABLE create_table_args. {} cmd ::= CREATE TABLE create_table_args. {}
cmd ::= CREATE TABLE create_stable_args. {}
cmd ::= CREATE STABLE create_stable_args. {}
cmd ::= CREATE TABLE create_table_list(Z). { pInfo->type = TSDB_SQL_CREATE_TABLE; pInfo->pCreateTableInfo = Z;} cmd ::= CREATE TABLE create_table_list(Z). { pInfo->type = TSDB_SQL_CREATE_TABLE; pInfo->pCreateTableInfo = Z;}
%type create_table_list{SCreateTableSQL*} %type create_table_list{SCreateTableSQL*}
...@@ -333,7 +341,8 @@ create_table_args(A) ::= ifnotexists(U) ids(V) cpxName(Z) LP columnlist(X) RP. { ...@@ -333,7 +341,8 @@ create_table_args(A) ::= ifnotexists(U) ids(V) cpxName(Z) LP columnlist(X) RP. {
} }
// create super table // create super table
create_table_args(A) ::= ifnotexists(U) ids(V) cpxName(Z) LP columnlist(X) RP TAGS LP columnlist(Y) RP. { %type create_stable_args{SCreateTableSQL*}
create_stable_args(A) ::= ifnotexists(U) ids(V) cpxName(Z) LP columnlist(X) RP TAGS LP columnlist(Y) RP. {
A = tSetCreateSqlElems(X, Y, NULL, TSQL_CREATE_STABLE); A = tSetCreateSqlElems(X, Y, NULL, TSQL_CREATE_STABLE);
setSqlInfo(pInfo, A, NULL, TSDB_SQL_CREATE_TABLE); setSqlInfo(pInfo, A, NULL, TSDB_SQL_CREATE_TABLE);
...@@ -683,7 +692,7 @@ cmd ::= RESET QUERY CACHE. { setDCLSQLElems(pInfo, TSDB_SQL_RESET_CACHE, 0);} ...@@ -683,7 +692,7 @@ cmd ::= RESET QUERY CACHE. { setDCLSQLElems(pInfo, TSDB_SQL_RESET_CACHE, 0);}
///////////////////////////////////ALTER TABLE statement////////////////////////////////// ///////////////////////////////////ALTER TABLE statement//////////////////////////////////
cmd ::= ALTER TABLE ids(X) cpxName(F) ADD COLUMN columnlist(A). { cmd ::= ALTER TABLE ids(X) cpxName(F) ADD COLUMN columnlist(A). {
X.n += F.n; X.n += F.n;
SAlterTableSQL* pAlterTable = tAlterTableSqlElems(&X, A, NULL, TSDB_ALTER_TABLE_ADD_COLUMN); SAlterTableSQL* pAlterTable = tAlterTableSqlElems(&X, A, NULL, TSDB_ALTER_TABLE_ADD_COLUMN, -1);
setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE);
} }
...@@ -693,14 +702,14 @@ cmd ::= ALTER TABLE ids(X) cpxName(F) DROP COLUMN ids(A). { ...@@ -693,14 +702,14 @@ cmd ::= ALTER TABLE ids(X) cpxName(F) DROP COLUMN ids(A). {
toTSDBType(A.type); toTSDBType(A.type);
SArray* K = tVariantListAppendToken(NULL, &A, -1); SArray* K = tVariantListAppendToken(NULL, &A, -1);
SAlterTableSQL* pAlterTable = tAlterTableSqlElems(&X, NULL, K, TSDB_ALTER_TABLE_DROP_COLUMN); SAlterTableSQL* pAlterTable = tAlterTableSqlElems(&X, NULL, K, TSDB_ALTER_TABLE_DROP_COLUMN, -1);
setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE);
} }
//////////////////////////////////ALTER TAGS statement///////////////////////////////////// //////////////////////////////////ALTER TAGS statement/////////////////////////////////////
cmd ::= ALTER TABLE ids(X) cpxName(Y) ADD TAG columnlist(A). { cmd ::= ALTER TABLE ids(X) cpxName(Y) ADD TAG columnlist(A). {
X.n += Y.n; X.n += Y.n;
SAlterTableSQL* pAlterTable = tAlterTableSqlElems(&X, A, NULL, TSDB_ALTER_TABLE_ADD_TAG_COLUMN); SAlterTableSQL* pAlterTable = tAlterTableSqlElems(&X, A, NULL, TSDB_ALTER_TABLE_ADD_TAG_COLUMN, -1);
setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE);
} }
cmd ::= ALTER TABLE ids(X) cpxName(Z) DROP TAG ids(Y). { cmd ::= ALTER TABLE ids(X) cpxName(Z) DROP TAG ids(Y). {
...@@ -709,7 +718,7 @@ cmd ::= ALTER TABLE ids(X) cpxName(Z) DROP TAG ids(Y). { ...@@ -709,7 +718,7 @@ cmd ::= ALTER TABLE ids(X) cpxName(Z) DROP TAG ids(Y). {
toTSDBType(Y.type); toTSDBType(Y.type);
SArray* A = tVariantListAppendToken(NULL, &Y, -1); SArray* A = tVariantListAppendToken(NULL, &Y, -1);
SAlterTableSQL* pAlterTable = tAlterTableSqlElems(&X, NULL, A, TSDB_ALTER_TABLE_DROP_TAG_COLUMN); SAlterTableSQL* pAlterTable = tAlterTableSqlElems(&X, NULL, A, TSDB_ALTER_TABLE_DROP_TAG_COLUMN, -1);
setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE);
} }
...@@ -722,7 +731,7 @@ cmd ::= ALTER TABLE ids(X) cpxName(F) CHANGE TAG ids(Y) ids(Z). { ...@@ -722,7 +731,7 @@ cmd ::= ALTER TABLE ids(X) cpxName(F) CHANGE TAG ids(Y) ids(Z). {
toTSDBType(Z.type); toTSDBType(Z.type);
A = tVariantListAppendToken(A, &Z, -1); A = tVariantListAppendToken(A, &Z, -1);
SAlterTableSQL* pAlterTable = tAlterTableSqlElems(&X, NULL, A, TSDB_ALTER_TABLE_CHANGE_TAG_COLUMN); SAlterTableSQL* pAlterTable = tAlterTableSqlElems(&X, NULL, A, TSDB_ALTER_TABLE_CHANGE_TAG_COLUMN, -1);
setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE);
} }
...@@ -733,7 +742,54 @@ cmd ::= ALTER TABLE ids(X) cpxName(F) SET TAG ids(Y) EQ tagitem(Z). { ...@@ -733,7 +742,54 @@ cmd ::= ALTER TABLE ids(X) cpxName(F) SET TAG ids(Y) EQ tagitem(Z). {
SArray* A = tVariantListAppendToken(NULL, &Y, -1); SArray* A = tVariantListAppendToken(NULL, &Y, -1);
A = tVariantListAppend(A, &Z, -1); A = tVariantListAppend(A, &Z, -1);
SAlterTableSQL* pAlterTable = tAlterTableSqlElems(&X, NULL, A, TSDB_ALTER_TABLE_UPDATE_TAG_VAL); SAlterTableSQL* pAlterTable = tAlterTableSqlElems(&X, NULL, A, TSDB_ALTER_TABLE_UPDATE_TAG_VAL, -1);
setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE);
}
///////////////////////////////////ALTER STABLE statement//////////////////////////////////
cmd ::= ALTER STABLE ids(X) cpxName(F) ADD COLUMN columnlist(A). {
X.n += F.n;
SAlterTableSQL* pAlterTable = tAlterTableSqlElems(&X, A, NULL, TSDB_ALTER_TABLE_ADD_COLUMN, TSDB_SUPER_TABLE);
setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE);
}
cmd ::= ALTER STABLE ids(X) cpxName(F) DROP COLUMN ids(A). {
X.n += F.n;
toTSDBType(A.type);
SArray* K = tVariantListAppendToken(NULL, &A, -1);
SAlterTableSQL* pAlterTable = tAlterTableSqlElems(&X, NULL, K, TSDB_ALTER_TABLE_DROP_COLUMN, TSDB_SUPER_TABLE);
setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE);
}
//////////////////////////////////ALTER TAGS statement/////////////////////////////////////
cmd ::= ALTER STABLE ids(X) cpxName(Y) ADD TAG columnlist(A). {
X.n += Y.n;
SAlterTableSQL* pAlterTable = tAlterTableSqlElems(&X, A, NULL, TSDB_ALTER_TABLE_ADD_TAG_COLUMN, TSDB_SUPER_TABLE);
setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE);
}
cmd ::= ALTER STABLE ids(X) cpxName(Z) DROP TAG ids(Y). {
X.n += Z.n;
toTSDBType(Y.type);
SArray* A = tVariantListAppendToken(NULL, &Y, -1);
SAlterTableSQL* pAlterTable = tAlterTableSqlElems(&X, NULL, A, TSDB_ALTER_TABLE_DROP_TAG_COLUMN, TSDB_SUPER_TABLE);
setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE);
}
cmd ::= ALTER STABLE ids(X) cpxName(F) CHANGE TAG ids(Y) ids(Z). {
X.n += F.n;
toTSDBType(Y.type);
SArray* A = tVariantListAppendToken(NULL, &Y, -1);
toTSDBType(Z.type);
A = tVariantListAppendToken(A, &Z, -1);
SAlterTableSQL* pAlterTable = tAlterTableSqlElems(&X, NULL, A, TSDB_ALTER_TABLE_CHANGE_TAG_COLUMN, TSDB_SUPER_TABLE);
setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE);
} }
......
...@@ -585,11 +585,12 @@ SCreatedTableInfo createNewChildTableInfo(SStrToken *pTableName, SArray *pTagVal ...@@ -585,11 +585,12 @@ SCreatedTableInfo createNewChildTableInfo(SStrToken *pTableName, SArray *pTagVal
return info; return info;
} }
SAlterTableSQL *tAlterTableSqlElems(SStrToken *pTableName, SArray *pCols, SArray *pVals, int32_t type) { SAlterTableSQL *tAlterTableSqlElems(SStrToken *pTableName, SArray *pCols, SArray *pVals, int32_t type, int16_t tableType) {
SAlterTableSQL *pAlterTable = calloc(1, sizeof(SAlterTableSQL)); SAlterTableSQL *pAlterTable = calloc(1, sizeof(SAlterTableSQL));
pAlterTable->name = *pTableName; pAlterTable->name = *pTableName;
pAlterTable->type = type; pAlterTable->type = type;
pAlterTable->tableType = tableType;
if (type == TSDB_ALTER_TABLE_ADD_COLUMN || type == TSDB_ALTER_TABLE_ADD_TAG_COLUMN) { if (type == TSDB_ALTER_TABLE_ADD_COLUMN || type == TSDB_ALTER_TABLE_ADD_TAG_COLUMN) {
pAlterTable->pAddColumns = pCols; pAlterTable->pAddColumns = pCols;
...@@ -733,9 +734,10 @@ void setDCLSQLElems(SSqlInfo *pInfo, int32_t type, int32_t nParam, ...) { ...@@ -733,9 +734,10 @@ void setDCLSQLElems(SSqlInfo *pInfo, int32_t type, int32_t nParam, ...) {
va_end(va); va_end(va);
} }
void setDropDbTableInfo(SSqlInfo *pInfo, int32_t type, SStrToken* pToken, SStrToken* existsCheck) { void setDropDbTableInfo(SSqlInfo *pInfo, int32_t type, SStrToken* pToken, SStrToken* existsCheck, int16_t tableType) {
pInfo->type = type; pInfo->type = type;
pInfo->pDCLInfo = tTokenListAppend(pInfo->pDCLInfo, pToken); pInfo->pDCLInfo = tTokenListAppend(pInfo->pDCLInfo, pToken);
pInfo->pDCLInfo->tableType = tableType;
pInfo->pDCLInfo->existsCheck = (existsCheck->n == 1); pInfo->pDCLInfo->existsCheck = (existsCheck->n == 1);
} }
......
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
** input grammar file: ** input grammar file:
*/ */
#include <stdio.h> #include <stdio.h>
#include <assert.h>
/************ Begin %include sections from the grammar ************************/ /************ Begin %include sections from the grammar ************************/
#include <stdio.h> #include <stdio.h>
...@@ -76,8 +77,10 @@ ...@@ -76,8 +77,10 @@
** zero the stack is dynamically sized using realloc() ** zero the stack is dynamically sized using realloc()
** ParseARG_SDECL A static variable declaration for the %extra_argument ** ParseARG_SDECL A static variable declaration for the %extra_argument
** ParseARG_PDECL A parameter 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_STORE Code to store %extra_argument into yypParser
** ParseARG_FETCH Code to extract %extra_argument from 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 ** YYERRORSYMBOL is the code number of the error symbol. If not
** defined, then do no error processing. ** defined, then do no error processing.
** YYNSTATE the combined number of states. ** YYNSTATE the combined number of states.
...@@ -97,7 +100,7 @@ ...@@ -97,7 +100,7 @@
#endif #endif
/************* Begin control #defines *****************************************/ /************* Begin control #defines *****************************************/
#define YYCODETYPE unsigned short int #define YYCODETYPE unsigned short int
#define YYNOCODE 279 #define YYNOCODE 278
#define YYACTIONTYPE unsigned short int #define YYACTIONTYPE unsigned short int
#define ParseTOKENTYPE SStrToken #define ParseTOKENTYPE SStrToken
typedef union { typedef union {
...@@ -124,21 +127,29 @@ typedef union { ...@@ -124,21 +127,29 @@ typedef union {
#endif #endif
#define ParseARG_SDECL SSqlInfo* pInfo; #define ParseARG_SDECL SSqlInfo* pInfo;
#define ParseARG_PDECL ,SSqlInfo* pInfo #define ParseARG_PDECL ,SSqlInfo* pInfo
#define ParseARG_FETCH SSqlInfo* pInfo = yypParser->pInfo #define ParseARG_PARAM ,pInfo
#define ParseARG_STORE yypParser->pInfo = 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 YYFALLBACK 1
#define YYNSTATE 258 #define YYNSTATE 282
#define YYNRULE 240 #define YYNRULE 248
#define YYNRULE_WITH_ACTION 248
#define YYNTOKEN 209 #define YYNTOKEN 209
#define YY_MAX_SHIFT 257 #define YY_MAX_SHIFT 281
#define YY_MIN_SHIFTREDUCE 431 #define YY_MIN_SHIFTREDUCE 461
#define YY_MAX_SHIFTREDUCE 670 #define YY_MAX_SHIFTREDUCE 708
#define YY_ERROR_ACTION 671 #define YY_ERROR_ACTION 709
#define YY_ACCEPT_ACTION 672 #define YY_ACCEPT_ACTION 710
#define YY_NO_ACTION 673 #define YY_NO_ACTION 711
#define YY_MIN_REDUCE 674 #define YY_MIN_REDUCE 712
#define YY_MAX_REDUCE 913 #define YY_MAX_REDUCE 959
/************* End control #defines *******************************************/ /************* 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 /* Define the yytestcase() macro to be a no-op if is not already defined
** otherwise. ** otherwise.
...@@ -203,132 +214,136 @@ typedef union { ...@@ -203,132 +214,136 @@ typedef union {
** yy_default[] Default action for each state. ** yy_default[] Default action for each state.
** **
*********** Begin parsing tables **********************************************/ *********** Begin parsing tables **********************************************/
#define YY_ACTTAB_COUNT (586) #define YY_ACTTAB_COUNT (623)
static const YYACTIONTYPE yy_action[] = { static const YYACTIONTYPE yy_action[] = {
/* 0 */ 143, 474, 143, 23, 672, 257, 165, 547, 827, 475, /* 0 */ 158, 505, 158, 710, 281, 857, 659, 578, 182, 506,
/* 10 */ 900, 168, 901, 37, 38, 12, 39, 40, 816, 23, /* 10 */ 941, 185, 942, 41, 42, 15, 43, 44, 26, 179,
/* 20 */ 173, 31, 474, 474, 210, 43, 41, 45, 42, 805, /* 20 */ 190, 35, 505, 505, 231, 47, 45, 49, 46, 868,
/* 30 */ 475, 475, 163, 36, 35, 232, 231, 34, 33, 32, /* 30 */ 506, 506, 846, 40, 39, 256, 255, 38, 37, 36,
/* 40 */ 37, 38, 801, 39, 40, 816, 110, 173, 31, 162, /* 40 */ 41, 42, 660, 43, 44, 857, 951, 190, 35, 178,
/* 50 */ 255, 210, 43, 41, 45, 42, 176, 66, 802, 195, /* 50 */ 279, 231, 47, 45, 49, 46, 180, 195, 843, 214,
/* 60 */ 36, 35, 178, 824, 34, 33, 32, 432, 433, 434, /* 60 */ 40, 39, 157, 61, 38, 37, 36, 462, 463, 464,
/* 70 */ 435, 436, 437, 438, 439, 440, 441, 442, 443, 256, /* 70 */ 465, 466, 467, 468, 469, 470, 471, 472, 473, 280,
/* 80 */ 179, 225, 185, 37, 38, 805, 39, 40, 796, 242, /* 80 */ 198, 846, 204, 41, 42, 865, 43, 44, 246, 266,
/* 90 */ 173, 31, 143, 180, 210, 43, 41, 45, 42, 110, /* 90 */ 190, 35, 158, 834, 231, 47, 45, 49, 46, 122,
/* 100 */ 110, 167, 901, 36, 35, 57, 853, 34, 33, 32, /* 100 */ 122, 184, 942, 40, 39, 122, 62, 38, 37, 36,
/* 110 */ 17, 223, 250, 249, 222, 221, 220, 248, 219, 247, /* 110 */ 20, 244, 274, 273, 243, 242, 241, 272, 240, 271,
/* 120 */ 246, 245, 218, 244, 243, 803, 142, 774, 624, 762, /* 120 */ 270, 269, 239, 268, 267, 38, 37, 36, 813, 657,
/* 130 */ 763, 764, 765, 766, 767, 768, 769, 770, 771, 772, /* 130 */ 801, 802, 803, 804, 805, 806, 807, 808, 809, 810,
/* 140 */ 773, 775, 776, 38, 181, 39, 40, 229, 228, 173, /* 140 */ 811, 812, 814, 815, 42, 200, 43, 44, 253, 252,
/* 150 */ 31, 605, 606, 210, 43, 41, 45, 42, 207, 854, /* 150 */ 190, 35, 835, 275, 231, 47, 45, 49, 46, 228,
/* 160 */ 61, 205, 36, 35, 23, 110, 34, 33, 32, 188, /* 160 */ 895, 66, 226, 40, 39, 115, 894, 38, 37, 36,
/* 170 */ 39, 40, 23, 251, 173, 31, 192, 191, 210, 43, /* 170 */ 26, 43, 44, 32, 26, 190, 35, 846, 207, 231,
/* 180 */ 41, 45, 42, 34, 33, 32, 105, 36, 35, 104, /* 180 */ 47, 45, 49, 46, 26, 211, 210, 162, 40, 39,
/* 190 */ 147, 34, 33, 32, 172, 637, 805, 28, 628, 897, /* 190 */ 196, 845, 38, 37, 36, 189, 670, 117, 938, 661,
/* 200 */ 631, 177, 634, 802, 172, 637, 896, 13, 628, 230, /* 200 */ 71, 664, 26, 667, 122, 189, 670, 188, 193, 661,
/* 210 */ 631, 802, 634, 18, 172, 637, 794, 895, 628, 63, /* 210 */ 843, 664, 194, 667, 843, 189, 670, 16, 21, 661,
/* 220 */ 631, 28, 634, 155, 574, 62, 169, 170, 23, 156, /* 220 */ 90, 664, 249, 667, 843, 266, 32, 186, 187, 246,
/* 230 */ 209, 29, 197, 92, 91, 150, 169, 170, 77, 76, /* 230 */ 26, 230, 837, 166, 278, 277, 109, 186, 187, 167,
/* 240 */ 582, 17, 198, 250, 249, 159, 169, 170, 248, 626, /* 240 */ 250, 615, 843, 199, 102, 101, 165, 186, 187, 4,
/* 250 */ 247, 246, 245, 715, 244, 243, 133, 211, 780, 80, /* 250 */ 20, 26, 274, 273, 219, 197, 26, 272, 248, 271,
/* 260 */ 160, 778, 779, 18, 242, 234, 781, 802, 783, 784, /* 260 */ 270, 269, 10, 268, 267, 67, 70, 132, 254, 819,
/* 270 */ 782, 28, 785, 786, 43, 41, 45, 42, 724, 579, /* 270 */ 843, 217, 817, 818, 21, 844, 27, 820, 905, 822,
/* 280 */ 64, 133, 36, 35, 19, 627, 34, 33, 32, 3, /* 280 */ 823, 821, 32, 824, 825, 47, 45, 49, 46, 258,
/* 290 */ 124, 194, 225, 44, 910, 72, 68, 71, 158, 11, /* 290 */ 663, 843, 666, 40, 39, 48, 842, 38, 37, 36,
/* 300 */ 10, 566, 592, 44, 563, 636, 564, 107, 565, 793, /* 300 */ 754, 232, 213, 146, 69, 48, 904, 669, 763, 173,
/* 310 */ 22, 795, 630, 44, 633, 636, 716, 36, 35, 133, /* 310 */ 755, 146, 68, 146, 662, 48, 665, 669, 599, 638,
/* 320 */ 635, 34, 33, 32, 171, 636, 596, 49, 78, 82, /* 320 */ 639, 596, 668, 597, 33, 598, 612, 669, 603, 607,
/* 330 */ 635, 48, 182, 183, 87, 90, 81, 137, 135, 629, /* 330 */ 604, 22, 668, 832, 833, 25, 836, 216, 625, 88,
/* 340 */ 635, 632, 84, 95, 94, 93, 50, 9, 145, 640, /* 340 */ 92, 937, 668, 119, 936, 82, 97, 100, 91, 201,
/* 350 */ 52, 65, 120, 254, 253, 98, 597, 656, 638, 555, /* 350 */ 202, 191, 588, 629, 94, 3, 136, 27, 52, 152,
/* 360 */ 146, 15, 14, 14, 24, 4, 55, 53, 546, 213, /* 360 */ 148, 29, 77, 73, 76, 150, 105, 104, 103, 40,
/* 370 */ 556, 570, 148, 571, 24, 48, 568, 149, 569, 89, /* 370 */ 39, 630, 689, 38, 37, 36, 18, 17, 671, 53,
/* 380 */ 88, 103, 101, 153, 154, 152, 141, 151, 144, 804, /* 380 */ 56, 174, 234, 17, 589, 81, 80, 27, 175, 52,
/* 390 */ 864, 863, 818, 174, 860, 859, 175, 233, 826, 846, /* 390 */ 12, 11, 99, 98, 673, 87, 86, 57, 54, 160,
/* 400 */ 831, 833, 106, 121, 845, 122, 567, 119, 123, 726, /* 400 */ 59, 161, 577, 14, 13, 163, 601, 164, 602, 114,
/* 410 */ 217, 139, 26, 226, 102, 723, 28, 227, 909, 74, /* 410 */ 112, 170, 171, 901, 169, 900, 156, 168, 159, 192,
/* 420 */ 908, 906, 125, 744, 27, 25, 196, 140, 713, 591, /* 420 */ 257, 116, 867, 859, 600, 872, 32, 874, 118, 133,
/* 430 */ 83, 711, 85, 86, 199, 709, 708, 184, 54, 134, /* 430 */ 887, 886, 131, 134, 135, 765, 238, 154, 30, 215,
/* 440 */ 706, 164, 705, 704, 703, 702, 136, 700, 698, 696, /* 440 */ 247, 762, 956, 78, 955, 953, 137, 251, 113, 950,
/* 450 */ 694, 692, 138, 203, 58, 59, 51, 847, 815, 46, /* 450 */ 84, 949, 947, 138, 783, 31, 28, 155, 752, 93,
/* 460 */ 208, 206, 204, 202, 200, 30, 79, 235, 236, 237, /* 460 */ 750, 95, 624, 220, 96, 181, 748, 747, 203, 147,
/* 470 */ 238, 239, 240, 241, 161, 215, 216, 252, 670, 187, /* 470 */ 58, 745, 224, 744, 743, 856, 742, 741, 149, 151,
/* 480 */ 186, 669, 69, 189, 157, 190, 668, 193, 661, 707, /* 480 */ 738, 55, 50, 123, 229, 227, 736, 734, 225, 732,
/* 490 */ 197, 576, 60, 56, 593, 96, 128, 97, 127, 745, /* 490 */ 223, 730, 221, 153, 89, 34, 218, 63, 259, 260,
/* 500 */ 126, 130, 129, 131, 132, 701, 693, 113, 111, 118, /* 500 */ 64, 888, 261, 262, 263, 264, 265, 276, 708, 176,
/* 510 */ 116, 114, 112, 115, 800, 1, 117, 2, 166, 20, /* 510 */ 205, 206, 707, 208, 236, 237, 209, 177, 172, 706,
/* 520 */ 108, 201, 6, 598, 109, 7, 639, 5, 8, 21, /* 520 */ 74, 694, 212, 216, 609, 746, 60, 106, 233, 6,
/* 530 */ 16, 67, 212, 641, 214, 515, 65, 511, 509, 508, /* 530 */ 120, 141, 140, 784, 139, 142, 143, 740, 144, 145,
/* 540 */ 507, 504, 478, 224, 70, 47, 73, 75, 24, 549, /* 540 */ 107, 739, 2, 108, 841, 731, 65, 626, 1, 129,
/* 550 */ 548, 545, 499, 497, 489, 495, 491, 493, 487, 485, /* 550 */ 126, 124, 125, 183, 127, 128, 130, 222, 7, 631,
/* 560 */ 517, 516, 514, 513, 512, 510, 506, 505, 48, 476, /* 560 */ 121, 23, 24, 672, 8, 5, 674, 9, 19, 235,
/* 570 */ 447, 445, 674, 673, 673, 673, 673, 673, 673, 673, /* 570 */ 72, 546, 542, 70, 540, 539, 538, 535, 509, 245,
/* 580 */ 673, 673, 673, 673, 99, 100, /* 580 */ 79, 27, 75, 580, 51, 83, 85, 579, 576, 530,
/* 590 */ 528, 520, 526, 522, 524, 518, 516, 548, 547, 545,
/* 600 */ 544, 543, 541, 537, 536, 52, 507, 477, 475, 712,
/* 610 */ 711, 711, 711, 711, 711, 711, 711, 711, 711, 711,
/* 620 */ 711, 110, 111,
}; };
static const YYCODETYPE yy_lookahead[] = { static const YYCODETYPE yy_lookahead[] = {
/* 0 */ 267, 1, 267, 213, 210, 211, 230, 5, 213, 9, /* 0 */ 267, 1, 267, 209, 210, 251, 1, 5, 229, 9,
/* 10 */ 277, 276, 277, 13, 14, 267, 16, 17, 251, 213, /* 10 */ 277, 276, 277, 13, 14, 267, 16, 17, 212, 265,
/* 20 */ 20, 21, 1, 1, 24, 25, 26, 27, 28, 253, /* 20 */ 20, 21, 1, 1, 24, 25, 26, 27, 28, 212,
/* 30 */ 9, 9, 265, 33, 34, 33, 34, 37, 38, 39, /* 30 */ 9, 9, 253, 33, 34, 33, 34, 37, 38, 39,
/* 40 */ 13, 14, 252, 16, 17, 251, 213, 20, 21, 212, /* 40 */ 13, 14, 37, 16, 17, 251, 253, 20, 21, 211,
/* 50 */ 213, 24, 25, 26, 27, 28, 250, 218, 252, 265, /* 50 */ 212, 24, 25, 26, 27, 28, 250, 229, 252, 265,
/* 60 */ 33, 34, 230, 268, 37, 38, 39, 45, 46, 47, /* 60 */ 33, 34, 267, 217, 37, 38, 39, 45, 46, 47,
/* 70 */ 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, /* 70 */ 48, 49, 50, 51, 52, 53, 54, 55, 56, 57,
/* 80 */ 66, 76, 60, 13, 14, 253, 16, 17, 249, 78, /* 80 */ 66, 253, 60, 13, 14, 268, 16, 17, 77, 79,
/* 90 */ 20, 21, 267, 213, 24, 25, 26, 27, 28, 213, /* 90 */ 20, 21, 267, 247, 24, 25, 26, 27, 28, 212,
/* 100 */ 213, 276, 277, 33, 34, 105, 273, 37, 38, 39, /* 100 */ 212, 276, 277, 33, 34, 212, 106, 37, 38, 39,
/* 110 */ 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, /* 110 */ 86, 87, 88, 89, 90, 91, 92, 93, 94, 95,
/* 120 */ 95, 96, 97, 98, 99, 245, 267, 229, 101, 231, /* 120 */ 96, 97, 98, 99, 100, 37, 38, 39, 228, 102,
/* 130 */ 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, /* 130 */ 230, 231, 232, 233, 234, 235, 236, 237, 238, 239,
/* 140 */ 242, 243, 244, 14, 130, 16, 17, 133, 134, 20, /* 140 */ 240, 241, 242, 243, 14, 131, 16, 17, 134, 135,
/* 150 */ 21, 118, 119, 24, 25, 26, 27, 28, 271, 273, /* 150 */ 20, 21, 0, 229, 24, 25, 26, 27, 28, 271,
/* 160 */ 273, 275, 33, 34, 213, 213, 37, 38, 39, 129, /* 160 */ 273, 273, 275, 33, 34, 101, 273, 37, 38, 39,
/* 170 */ 16, 17, 213, 230, 20, 21, 136, 137, 24, 25, /* 170 */ 212, 16, 17, 109, 212, 20, 21, 253, 130, 24,
/* 180 */ 26, 27, 28, 37, 38, 39, 213, 33, 34, 100, /* 180 */ 25, 26, 27, 28, 212, 137, 138, 267, 33, 34,
/* 190 */ 267, 37, 38, 39, 1, 2, 253, 108, 5, 267, /* 190 */ 66, 253, 37, 38, 39, 1, 2, 212, 267, 5,
/* 200 */ 7, 250, 9, 252, 1, 2, 267, 44, 5, 250, /* 200 */ 217, 7, 212, 9, 212, 1, 2, 59, 250, 5,
/* 210 */ 7, 252, 9, 100, 1, 2, 0, 267, 5, 254, /* 210 */ 252, 7, 250, 9, 252, 1, 2, 44, 101, 5,
/* 220 */ 7, 108, 9, 60, 101, 273, 33, 34, 213, 66, /* 220 */ 74, 7, 250, 9, 252, 79, 109, 33, 34, 77,
/* 230 */ 37, 266, 109, 70, 71, 72, 33, 34, 131, 132, /* 230 */ 212, 37, 249, 60, 63, 64, 65, 33, 34, 66,
/* 240 */ 37, 85, 269, 87, 88, 267, 33, 34, 92, 1, /* 240 */ 250, 37, 252, 212, 71, 72, 73, 33, 34, 101,
/* 250 */ 94, 95, 96, 217, 98, 99, 220, 15, 229, 73, /* 250 */ 86, 212, 88, 89, 269, 131, 212, 93, 134, 95,
/* 260 */ 267, 232, 233, 100, 78, 250, 237, 252, 239, 240, /* 260 */ 96, 97, 101, 99, 100, 273, 105, 106, 250, 228,
/* 270 */ 241, 108, 243, 244, 25, 26, 27, 28, 217, 106, /* 270 */ 252, 102, 231, 232, 101, 244, 107, 236, 245, 238,
/* 280 */ 218, 220, 33, 34, 111, 37, 37, 38, 39, 61, /* 280 */ 239, 240, 109, 242, 243, 25, 26, 27, 28, 250,
/* 290 */ 62, 128, 76, 100, 253, 67, 68, 69, 135, 131, /* 290 */ 5, 252, 7, 33, 34, 101, 252, 37, 38, 39,
/* 300 */ 132, 2, 101, 100, 5, 112, 7, 106, 9, 247, /* 300 */ 216, 15, 129, 219, 217, 101, 245, 113, 216, 136,
/* 310 */ 248, 249, 5, 100, 7, 112, 217, 33, 34, 220, /* 310 */ 216, 219, 254, 219, 5, 101, 7, 113, 2, 119,
/* 320 */ 127, 37, 38, 39, 59, 112, 101, 106, 61, 62, /* 320 */ 120, 5, 128, 7, 266, 9, 107, 113, 5, 102,
/* 330 */ 127, 106, 33, 34, 67, 68, 69, 61, 62, 5, /* 330 */ 7, 112, 128, 246, 247, 248, 249, 110, 102, 61,
/* 340 */ 127, 7, 75, 67, 68, 69, 125, 100, 267, 107, /* 340 */ 62, 267, 128, 107, 267, 67, 68, 69, 70, 33,
/* 350 */ 106, 104, 105, 63, 64, 65, 101, 101, 101, 101, /* 350 */ 34, 245, 102, 102, 76, 61, 62, 107, 107, 61,
/* 360 */ 267, 106, 106, 106, 106, 100, 100, 123, 102, 101, /* 360 */ 62, 67, 68, 69, 70, 67, 68, 69, 70, 33,
/* 370 */ 101, 5, 267, 7, 106, 106, 5, 267, 7, 73, /* 370 */ 34, 102, 102, 37, 38, 39, 107, 107, 102, 107,
/* 380 */ 74, 61, 62, 267, 267, 267, 267, 267, 267, 253, /* 380 */ 107, 267, 102, 107, 102, 132, 133, 107, 267, 107,
/* 390 */ 246, 246, 251, 246, 246, 246, 246, 246, 213, 274, /* 390 */ 132, 133, 74, 75, 108, 132, 133, 124, 126, 267,
/* 400 */ 213, 213, 213, 213, 274, 213, 107, 255, 213, 213, /* 400 */ 101, 267, 103, 132, 133, 267, 5, 267, 7, 61,
/* 410 */ 213, 213, 213, 213, 59, 213, 108, 213, 213, 213, /* 410 */ 62, 267, 267, 245, 267, 245, 267, 267, 267, 245,
/* 420 */ 213, 213, 213, 213, 213, 213, 251, 213, 213, 112, /* 420 */ 245, 212, 212, 251, 108, 212, 109, 212, 212, 212,
/* 430 */ 213, 213, 213, 213, 270, 213, 213, 213, 122, 213, /* 430 */ 274, 274, 255, 212, 212, 212, 212, 212, 212, 251,
/* 440 */ 213, 270, 213, 213, 213, 213, 213, 213, 213, 213, /* 440 */ 212, 212, 212, 212, 212, 212, 212, 212, 59, 212,
/* 450 */ 213, 213, 213, 270, 214, 214, 124, 214, 264, 121, /* 450 */ 212, 212, 212, 212, 212, 212, 212, 212, 212, 212,
/* 460 */ 116, 120, 115, 114, 113, 126, 84, 83, 49, 80, /* 460 */ 212, 212, 113, 270, 212, 270, 212, 212, 212, 212,
/* 470 */ 82, 53, 81, 79, 214, 214, 214, 76, 5, 5, /* 470 */ 123, 212, 270, 212, 212, 264, 212, 212, 212, 212,
/* 480 */ 138, 5, 218, 138, 214, 5, 5, 129, 86, 214, /* 480 */ 212, 125, 122, 263, 117, 121, 212, 212, 116, 212,
/* 490 */ 109, 101, 106, 110, 101, 215, 222, 215, 226, 228, /* 490 */ 115, 212, 114, 212, 85, 127, 213, 213, 84, 49,
/* 500 */ 227, 223, 225, 224, 221, 214, 214, 261, 263, 256, /* 500 */ 213, 213, 81, 83, 53, 82, 80, 77, 5, 213,
/* 510 */ 258, 260, 262, 259, 251, 219, 257, 216, 1, 106, /* 510 */ 139, 5, 5, 139, 213, 213, 5, 213, 213, 5,
/* 520 */ 100, 100, 117, 101, 100, 117, 101, 100, 100, 106, /* 520 */ 217, 87, 130, 110, 102, 213, 111, 214, 104, 101,
/* 530 */ 100, 73, 103, 107, 103, 9, 104, 5, 5, 5, /* 530 */ 101, 221, 225, 227, 226, 224, 222, 213, 223, 220,
/* 540 */ 5, 5, 77, 15, 73, 16, 132, 132, 106, 5, /* 540 */ 214, 213, 215, 214, 251, 213, 107, 102, 218, 257,
/* 550 */ 5, 101, 5, 5, 5, 5, 5, 5, 5, 5, /* 550 */ 260, 262, 261, 1, 259, 258, 256, 101, 118, 102,
/* 560 */ 5, 5, 5, 5, 5, 5, 5, 5, 106, 77, /* 560 */ 101, 107, 107, 102, 118, 101, 108, 101, 101, 104,
/* 570 */ 59, 58, 0, 278, 278, 278, 278, 278, 278, 278, /* 570 */ 74, 9, 5, 105, 5, 5, 5, 5, 78, 15,
/* 580 */ 278, 278, 278, 278, 21, 21, 278, 278, 278, 278, /* 580 */ 133, 107, 74, 5, 16, 133, 133, 5, 102, 5,
/* 590 */ 278, 278, 278, 278, 278, 278, 278, 278, 278, 278, /* 590 */ 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
/* 600 */ 278, 278, 278, 278, 278, 278, 278, 278, 278, 278, /* 600 */ 5, 5, 5, 5, 5, 107, 78, 59, 58, 0,
/* 610 */ 278, 278, 278, 278, 278, 278, 278, 278, 278, 278, /* 610 */ 278, 278, 278, 278, 278, 278, 278, 278, 278, 278,
/* 620 */ 278, 278, 278, 278, 278, 278, 278, 278, 278, 278, /* 620 */ 278, 21, 21, 278, 278, 278, 278, 278, 278, 278,
/* 630 */ 278, 278, 278, 278, 278, 278, 278, 278, 278, 278, /* 630 */ 278, 278, 278, 278, 278, 278, 278, 278, 278, 278,
/* 640 */ 278, 278, 278, 278, 278, 278, 278, 278, 278, 278, /* 640 */ 278, 278, 278, 278, 278, 278, 278, 278, 278, 278,
/* 650 */ 278, 278, 278, 278, 278, 278, 278, 278, 278, 278, /* 650 */ 278, 278, 278, 278, 278, 278, 278, 278, 278, 278,
...@@ -345,86 +360,97 @@ static const YYCODETYPE yy_lookahead[] = { ...@@ -345,86 +360,97 @@ static const YYCODETYPE yy_lookahead[] = {
/* 760 */ 278, 278, 278, 278, 278, 278, 278, 278, 278, 278, /* 760 */ 278, 278, 278, 278, 278, 278, 278, 278, 278, 278,
/* 770 */ 278, 278, 278, 278, 278, 278, 278, 278, 278, 278, /* 770 */ 278, 278, 278, 278, 278, 278, 278, 278, 278, 278,
/* 780 */ 278, 278, 278, 278, 278, 278, 278, 278, 278, 278, /* 780 */ 278, 278, 278, 278, 278, 278, 278, 278, 278, 278,
/* 790 */ 278, 278, 278, 278, 278, /* 790 */ 278, 278, 278, 278, 278, 278, 278, 278, 278, 278,
/* 800 */ 278, 278, 278, 278, 278, 278, 278, 278, 278, 278,
/* 810 */ 278, 278, 278, 278, 278, 278, 278, 278, 278, 278,
/* 820 */ 278, 278, 278, 278, 278, 278, 278, 278, 278, 278,
/* 830 */ 278, 278,
}; };
#define YY_SHIFT_COUNT (257) #define YY_SHIFT_COUNT (281)
#define YY_SHIFT_MIN (0) #define YY_SHIFT_MIN (0)
#define YY_SHIFT_MAX (572) #define YY_SHIFT_MAX (609)
static const unsigned short int yy_shift_ofst[] = { static const unsigned short int yy_shift_ofst[] = {
/* 0 */ 163, 25, 156, 5, 193, 213, 21, 21, 21, 21, /* 0 */ 173, 24, 164, 11, 194, 214, 21, 21, 21, 21,
/* 10 */ 21, 21, 0, 22, 213, 299, 299, 299, 113, 21, /* 10 */ 21, 21, 21, 21, 21, 0, 22, 214, 316, 316,
/* 20 */ 21, 21, 216, 21, 21, 186, 11, 11, 586, 203, /* 20 */ 316, 117, 21, 21, 21, 152, 21, 21, 146, 11,
/* 30 */ 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, /* 30 */ 10, 10, 623, 204, 214, 214, 214, 214, 214, 214,
/* 40 */ 213, 213, 213, 213, 213, 213, 213, 299, 299, 2, /* 40 */ 214, 214, 214, 214, 214, 214, 214, 214, 214, 214,
/* 50 */ 2, 2, 2, 2, 2, 2, 89, 21, 21, 21, /* 50 */ 214, 316, 316, 2, 2, 2, 2, 2, 2, 2,
/* 60 */ 21, 33, 33, 173, 21, 21, 21, 21, 21, 21, /* 60 */ 64, 21, 21, 21, 21, 21, 200, 200, 219, 21,
/* 70 */ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, /* 70 */ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
/* 80 */ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, /* 80 */ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
/* 90 */ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, /* 90 */ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
/* 100 */ 21, 21, 21, 21, 308, 355, 355, 317, 317, 317, /* 100 */ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
/* 110 */ 355, 316, 332, 338, 344, 341, 347, 349, 351, 339, /* 110 */ 21, 21, 21, 21, 21, 317, 389, 389, 389, 349,
/* 120 */ 308, 355, 355, 355, 5, 355, 382, 384, 419, 389, /* 120 */ 349, 349, 389, 347, 356, 360, 367, 364, 372, 375,
/* 130 */ 388, 418, 391, 394, 355, 401, 355, 401, 355, 586, /* 130 */ 378, 368, 317, 389, 389, 389, 11, 389, 389, 409,
/* 140 */ 586, 27, 70, 70, 70, 129, 154, 249, 249, 249, /* 140 */ 414, 450, 421, 420, 451, 423, 426, 389, 430, 389,
/* 150 */ 267, 284, 284, 284, 284, 228, 276, 14, 40, 146, /* 150 */ 430, 389, 430, 389, 623, 623, 27, 70, 70, 70,
/* 160 */ 146, 247, 290, 123, 201, 225, 255, 256, 257, 307, /* 160 */ 130, 155, 260, 260, 260, 278, 294, 298, 336, 336,
/* 170 */ 334, 248, 265, 242, 221, 244, 258, 268, 269, 107, /* 170 */ 336, 336, 14, 48, 88, 88, 161, 124, 171, 227,
/* 180 */ 266, 168, 366, 371, 306, 320, 473, 342, 474, 476, /* 180 */ 169, 236, 251, 269, 270, 276, 285, 309, 5, 148,
/* 190 */ 345, 480, 481, 402, 358, 381, 390, 383, 386, 393, /* 190 */ 286, 272, 273, 250, 280, 282, 253, 258, 263, 299,
/* 200 */ 420, 517, 421, 422, 424, 413, 405, 423, 408, 425, /* 200 */ 271, 323, 401, 318, 348, 503, 371, 506, 507, 374,
/* 210 */ 427, 426, 428, 429, 430, 431, 432, 458, 526, 532, /* 210 */ 511, 514, 434, 392, 413, 422, 415, 424, 428, 439,
/* 220 */ 533, 534, 535, 536, 465, 528, 471, 529, 414, 415, /* 220 */ 445, 429, 552, 456, 457, 459, 454, 440, 455, 446,
/* 230 */ 442, 544, 545, 450, 442, 547, 548, 549, 550, 551, /* 230 */ 461, 464, 458, 466, 424, 467, 465, 468, 496, 562,
/* 240 */ 552, 553, 554, 555, 556, 557, 558, 559, 560, 561, /* 240 */ 567, 569, 570, 571, 572, 500, 564, 508, 447, 474,
/* 250 */ 562, 462, 492, 563, 564, 511, 513, 572, /* 250 */ 474, 568, 452, 453, 474, 578, 582, 486, 474, 584,
/* 260 */ 585, 586, 587, 588, 589, 590, 591, 592, 593, 594,
/* 270 */ 595, 596, 597, 598, 599, 498, 528, 600, 601, 548,
/* 280 */ 550, 609,
}; };
#define YY_REDUCE_COUNT (140) #define YY_REDUCE_COUNT (155)
#define YY_REDUCE_MIN (-267) #define YY_REDUCE_MIN (-267)
#define YY_REDUCE_MAX (301) #define YY_REDUCE_MAX (332)
static const short yy_reduce_ofst[] = { static const short yy_reduce_ofst[] = {
/* 0 */ -206, -102, 29, 62, -265, -175, -114, -113, -194, -49, /* 0 */ -206, -100, 41, 87, -265, -175, -194, -113, -112, -42,
/* 10 */ -41, 15, -205, -163, -267, -224, -168, -57, -233, -27, /* 10 */ -38, -28, -10, 18, 39, -183, -162, -267, -221, -172,
/* 20 */ -167, -48, -161, -120, -210, 36, 61, 99, -35, -252, /* 20 */ -76, -246, -15, -107, -8, -17, 31, 44, 84, -154,
/* 30 */ -141, -77, -68, -61, -50, -22, -7, 81, 93, 105, /* 30 */ 92, 94, 58, -252, -205, -80, -69, 74, 77, 114,
/* 40 */ 110, 116, 117, 118, 119, 120, 121, 41, 136, 144, /* 40 */ 121, 132, 134, 138, 140, 144, 145, 147, 149, 150,
/* 50 */ 145, 147, 148, 149, 150, 151, 141, 185, 187, 188, /* 50 */ 151, -207, -62, 33, 61, 106, 168, 170, 174, 175,
/* 60 */ 189, 125, 130, 152, 190, 192, 195, 196, 197, 198, /* 60 */ 172, 209, 210, 213, 215, 216, 156, 157, 177, 217,
/* 70 */ 199, 200, 202, 204, 205, 206, 207, 208, 209, 210, /* 70 */ 221, 222, 223, 224, 225, 226, 228, 229, 230, 231,
/* 80 */ 211, 212, 214, 215, 217, 218, 219, 220, 222, 223, /* 80 */ 232, 233, 234, 235, 237, 238, 239, 240, 241, 242,
/* 90 */ 224, 226, 227, 229, 230, 231, 232, 233, 234, 235, /* 90 */ 243, 244, 245, 246, 247, 248, 249, 252, 254, 255,
/* 100 */ 236, 237, 238, 239, 175, 240, 241, 164, 171, 183, /* 100 */ 256, 257, 259, 261, 262, 264, 265, 266, 267, 268,
/* 110 */ 243, 194, 245, 250, 246, 251, 254, 252, 259, 253, /* 110 */ 274, 275, 277, 279, 281, 188, 283, 284, 287, 193,
/* 120 */ 263, 260, 261, 262, 264, 270, 271, 273, 272, 274, /* 120 */ 195, 202, 288, 211, 220, 289, 291, 290, 295, 297,
/* 130 */ 277, 278, 279, 283, 275, 280, 291, 282, 292, 296, /* 130 */ 292, 300, 293, 296, 301, 302, 303, 304, 305, 306,
/* 140 */ 301, /* 140 */ 308, 307, 310, 311, 314, 315, 319, 312, 313, 324,
/* 150 */ 326, 328, 329, 332, 330, 327,
}; };
static const YYACTIONTYPE yy_default[] = { static const YYACTIONTYPE yy_default[] = {
/* 0 */ 671, 725, 714, 722, 903, 903, 671, 671, 671, 671, /* 0 */ 709, 764, 753, 761, 944, 944, 709, 709, 709, 709,
/* 10 */ 671, 671, 828, 689, 903, 671, 671, 671, 671, 671, /* 10 */ 709, 709, 709, 709, 709, 869, 727, 944, 709, 709,
/* 20 */ 671, 671, 722, 671, 671, 727, 727, 727, 823, 671, /* 20 */ 709, 709, 709, 709, 709, 761, 709, 709, 766, 761,
/* 30 */ 671, 671, 671, 671, 671, 671, 671, 671, 671, 671, /* 30 */ 766, 766, 864, 709, 709, 709, 709, 709, 709, 709,
/* 40 */ 671, 671, 671, 671, 671, 671, 671, 671, 671, 671, /* 40 */ 709, 709, 709, 709, 709, 709, 709, 709, 709, 709,
/* 50 */ 671, 671, 671, 671, 671, 671, 671, 671, 830, 832, /* 50 */ 709, 709, 709, 709, 709, 709, 709, 709, 709, 709,
/* 60 */ 671, 850, 850, 821, 671, 671, 671, 671, 671, 671, /* 60 */ 709, 709, 709, 871, 873, 709, 891, 891, 862, 709,
/* 70 */ 671, 671, 671, 671, 671, 671, 671, 671, 671, 671, /* 70 */ 709, 709, 709, 709, 709, 709, 709, 709, 709, 709,
/* 80 */ 671, 671, 671, 712, 671, 710, 671, 671, 671, 671, /* 80 */ 709, 709, 709, 709, 709, 709, 709, 709, 709, 709,
/* 90 */ 671, 671, 671, 671, 671, 671, 671, 671, 699, 671, /* 90 */ 709, 709, 709, 751, 709, 749, 709, 709, 709, 709,
/* 100 */ 671, 671, 671, 671, 671, 691, 691, 671, 671, 671, /* 100 */ 709, 709, 709, 709, 709, 709, 709, 709, 709, 737,
/* 110 */ 691, 857, 861, 855, 843, 851, 842, 838, 837, 865, /* 110 */ 709, 709, 709, 709, 709, 709, 729, 729, 729, 709,
/* 120 */ 671, 691, 691, 691, 722, 691, 743, 741, 739, 731, /* 120 */ 709, 709, 729, 898, 902, 896, 884, 892, 883, 879,
/* 130 */ 737, 733, 735, 729, 691, 720, 691, 720, 691, 761, /* 130 */ 878, 906, 709, 729, 729, 729, 761, 729, 729, 782,
/* 140 */ 777, 671, 866, 902, 856, 892, 891, 898, 890, 889, /* 140 */ 780, 778, 770, 776, 772, 774, 768, 729, 759, 729,
/* 150 */ 671, 885, 886, 888, 887, 671, 671, 671, 671, 894, /* 150 */ 759, 729, 759, 729, 800, 816, 709, 907, 943, 897,
/* 160 */ 893, 671, 671, 671, 671, 671, 671, 671, 671, 671, /* 160 */ 933, 932, 939, 931, 930, 709, 709, 709, 926, 927,
/* 170 */ 671, 671, 868, 671, 862, 858, 671, 671, 671, 671, /* 170 */ 929, 928, 709, 709, 935, 934, 709, 709, 709, 709,
/* 180 */ 787, 671, 671, 671, 671, 671, 671, 671, 671, 671, /* 180 */ 709, 709, 709, 709, 709, 709, 709, 709, 709, 909,
/* 190 */ 671, 671, 671, 671, 671, 820, 671, 671, 829, 671, /* 190 */ 709, 903, 899, 709, 709, 709, 709, 709, 709, 826,
/* 200 */ 671, 671, 671, 671, 671, 852, 671, 844, 671, 671, /* 200 */ 709, 709, 709, 709, 709, 709, 709, 709, 709, 709,
/* 210 */ 671, 671, 671, 797, 671, 671, 671, 671, 671, 671, /* 210 */ 709, 709, 709, 709, 861, 709, 709, 709, 709, 870,
/* 220 */ 671, 671, 671, 671, 671, 671, 671, 671, 671, 671, /* 220 */ 709, 709, 709, 709, 709, 709, 893, 709, 885, 709,
/* 230 */ 907, 671, 671, 671, 905, 671, 671, 671, 671, 671, /* 230 */ 709, 709, 709, 709, 838, 709, 709, 709, 709, 709,
/* 240 */ 671, 671, 671, 671, 671, 671, 671, 671, 671, 671, /* 240 */ 709, 709, 709, 709, 709, 709, 709, 709, 709, 954,
/* 250 */ 671, 746, 671, 697, 695, 671, 687, 671, /* 250 */ 952, 709, 709, 709, 948, 709, 709, 709, 946, 709,
/* 260 */ 709, 709, 709, 709, 709, 709, 709, 709, 709, 709,
/* 270 */ 709, 709, 709, 709, 709, 785, 709, 735, 733, 709,
/* 280 */ 725, 709,
}; };
/********** End of lemon-generated parsing tables *****************************/ /********** End of lemon-generated parsing tables *****************************/
...@@ -511,6 +537,7 @@ static const YYCODETYPE yyFallback[] = { ...@@ -511,6 +537,7 @@ static const YYCODETYPE yyFallback[] = {
0, /* STABLES => nothing */ 0, /* STABLES => nothing */
0, /* VGROUPS => nothing */ 0, /* VGROUPS => nothing */
0, /* DROP => nothing */ 0, /* DROP => nothing */
1, /* STABLE => ID */
0, /* DNODE => nothing */ 0, /* DNODE => nothing */
0, /* USER => nothing */ 0, /* USER => nothing */
0, /* ACCOUNT => nothing */ 0, /* ACCOUNT => nothing */
...@@ -649,7 +676,6 @@ static const YYCODETYPE yyFallback[] = { ...@@ -649,7 +676,6 @@ static const YYCODETYPE yyFallback[] = {
1, /* TBNAME => ID */ 1, /* TBNAME => ID */
1, /* JOIN => ID */ 1, /* JOIN => ID */
1, /* METRICS => ID */ 1, /* METRICS => ID */
1, /* STABLE => ID */
1, /* INSERT => ID */ 1, /* INSERT => ID */
1, /* INTO => ID */ 1, /* INTO => ID */
1, /* VALUES => ID */ 1, /* VALUES => ID */
...@@ -692,6 +718,7 @@ struct yyParser { ...@@ -692,6 +718,7 @@ struct yyParser {
int yyerrcnt; /* Shifts left before out of the error */ int yyerrcnt; /* Shifts left before out of the error */
#endif #endif
ParseARG_SDECL /* A place to hold %extra_argument */ ParseARG_SDECL /* A place to hold %extra_argument */
ParseCTX_SDECL /* A place to hold %extra_context */
#if YYSTACKDEPTH<=0 #if YYSTACKDEPTH<=0
int yystksz; /* Current side of the stack */ int yystksz; /* Current side of the stack */
yyStackEntry *yystack; /* The parser's stack */ yyStackEntry *yystack; /* The parser's stack */
...@@ -806,187 +833,187 @@ static const char *const yyTokenName[] = { ...@@ -806,187 +833,187 @@ static const char *const yyTokenName[] = {
/* 64 */ "STABLES", /* 64 */ "STABLES",
/* 65 */ "VGROUPS", /* 65 */ "VGROUPS",
/* 66 */ "DROP", /* 66 */ "DROP",
/* 67 */ "DNODE", /* 67 */ "STABLE",
/* 68 */ "USER", /* 68 */ "DNODE",
/* 69 */ "ACCOUNT", /* 69 */ "USER",
/* 70 */ "USE", /* 70 */ "ACCOUNT",
/* 71 */ "DESCRIBE", /* 71 */ "USE",
/* 72 */ "ALTER", /* 72 */ "DESCRIBE",
/* 73 */ "PASS", /* 73 */ "ALTER",
/* 74 */ "PRIVILEGE", /* 74 */ "PASS",
/* 75 */ "LOCAL", /* 75 */ "PRIVILEGE",
/* 76 */ "IF", /* 76 */ "LOCAL",
/* 77 */ "EXISTS", /* 77 */ "IF",
/* 78 */ "PPS", /* 78 */ "EXISTS",
/* 79 */ "TSERIES", /* 79 */ "PPS",
/* 80 */ "DBS", /* 80 */ "TSERIES",
/* 81 */ "STORAGE", /* 81 */ "DBS",
/* 82 */ "QTIME", /* 82 */ "STORAGE",
/* 83 */ "CONNS", /* 83 */ "QTIME",
/* 84 */ "STATE", /* 84 */ "CONNS",
/* 85 */ "KEEP", /* 85 */ "STATE",
/* 86 */ "CACHE", /* 86 */ "KEEP",
/* 87 */ "REPLICA", /* 87 */ "CACHE",
/* 88 */ "QUORUM", /* 88 */ "REPLICA",
/* 89 */ "DAYS", /* 89 */ "QUORUM",
/* 90 */ "MINROWS", /* 90 */ "DAYS",
/* 91 */ "MAXROWS", /* 91 */ "MINROWS",
/* 92 */ "BLOCKS", /* 92 */ "MAXROWS",
/* 93 */ "CTIME", /* 93 */ "BLOCKS",
/* 94 */ "WAL", /* 94 */ "CTIME",
/* 95 */ "FSYNC", /* 95 */ "WAL",
/* 96 */ "COMP", /* 96 */ "FSYNC",
/* 97 */ "PRECISION", /* 97 */ "COMP",
/* 98 */ "UPDATE", /* 98 */ "PRECISION",
/* 99 */ "CACHELAST", /* 99 */ "UPDATE",
/* 100 */ "LP", /* 100 */ "CACHELAST",
/* 101 */ "RP", /* 101 */ "LP",
/* 102 */ "UNSIGNED", /* 102 */ "RP",
/* 103 */ "TAGS", /* 103 */ "UNSIGNED",
/* 104 */ "USING", /* 104 */ "TAGS",
/* 105 */ "AS", /* 105 */ "USING",
/* 106 */ "COMMA", /* 106 */ "AS",
/* 107 */ "NULL", /* 107 */ "COMMA",
/* 108 */ "SELECT", /* 108 */ "NULL",
/* 109 */ "UNION", /* 109 */ "SELECT",
/* 110 */ "ALL", /* 110 */ "UNION",
/* 111 */ "FROM", /* 111 */ "ALL",
/* 112 */ "VARIABLE", /* 112 */ "FROM",
/* 113 */ "INTERVAL", /* 113 */ "VARIABLE",
/* 114 */ "FILL", /* 114 */ "INTERVAL",
/* 115 */ "SLIDING", /* 115 */ "FILL",
/* 116 */ "ORDER", /* 116 */ "SLIDING",
/* 117 */ "BY", /* 117 */ "ORDER",
/* 118 */ "ASC", /* 118 */ "BY",
/* 119 */ "DESC", /* 119 */ "ASC",
/* 120 */ "GROUP", /* 120 */ "DESC",
/* 121 */ "HAVING", /* 121 */ "GROUP",
/* 122 */ "LIMIT", /* 122 */ "HAVING",
/* 123 */ "OFFSET", /* 123 */ "LIMIT",
/* 124 */ "SLIMIT", /* 124 */ "OFFSET",
/* 125 */ "SOFFSET", /* 125 */ "SLIMIT",
/* 126 */ "WHERE", /* 126 */ "SOFFSET",
/* 127 */ "NOW", /* 127 */ "WHERE",
/* 128 */ "RESET", /* 128 */ "NOW",
/* 129 */ "QUERY", /* 129 */ "RESET",
/* 130 */ "ADD", /* 130 */ "QUERY",
/* 131 */ "COLUMN", /* 131 */ "ADD",
/* 132 */ "TAG", /* 132 */ "COLUMN",
/* 133 */ "CHANGE", /* 133 */ "TAG",
/* 134 */ "SET", /* 134 */ "CHANGE",
/* 135 */ "KILL", /* 135 */ "SET",
/* 136 */ "CONNECTION", /* 136 */ "KILL",
/* 137 */ "STREAM", /* 137 */ "CONNECTION",
/* 138 */ "COLON", /* 138 */ "STREAM",
/* 139 */ "ABORT", /* 139 */ "COLON",
/* 140 */ "AFTER", /* 140 */ "ABORT",
/* 141 */ "ATTACH", /* 141 */ "AFTER",
/* 142 */ "BEFORE", /* 142 */ "ATTACH",
/* 143 */ "BEGIN", /* 143 */ "BEFORE",
/* 144 */ "CASCADE", /* 144 */ "BEGIN",
/* 145 */ "CLUSTER", /* 145 */ "CASCADE",
/* 146 */ "CONFLICT", /* 146 */ "CLUSTER",
/* 147 */ "COPY", /* 147 */ "CONFLICT",
/* 148 */ "DEFERRED", /* 148 */ "COPY",
/* 149 */ "DELIMITERS", /* 149 */ "DEFERRED",
/* 150 */ "DETACH", /* 150 */ "DELIMITERS",
/* 151 */ "EACH", /* 151 */ "DETACH",
/* 152 */ "END", /* 152 */ "EACH",
/* 153 */ "EXPLAIN", /* 153 */ "END",
/* 154 */ "FAIL", /* 154 */ "EXPLAIN",
/* 155 */ "FOR", /* 155 */ "FAIL",
/* 156 */ "IGNORE", /* 156 */ "FOR",
/* 157 */ "IMMEDIATE", /* 157 */ "IGNORE",
/* 158 */ "INITIALLY", /* 158 */ "IMMEDIATE",
/* 159 */ "INSTEAD", /* 159 */ "INITIALLY",
/* 160 */ "MATCH", /* 160 */ "INSTEAD",
/* 161 */ "KEY", /* 161 */ "MATCH",
/* 162 */ "OF", /* 162 */ "KEY",
/* 163 */ "RAISE", /* 163 */ "OF",
/* 164 */ "REPLACE", /* 164 */ "RAISE",
/* 165 */ "RESTRICT", /* 165 */ "REPLACE",
/* 166 */ "ROW", /* 166 */ "RESTRICT",
/* 167 */ "STATEMENT", /* 167 */ "ROW",
/* 168 */ "TRIGGER", /* 168 */ "STATEMENT",
/* 169 */ "VIEW", /* 169 */ "TRIGGER",
/* 170 */ "COUNT", /* 170 */ "VIEW",
/* 171 */ "SUM", /* 171 */ "COUNT",
/* 172 */ "AVG", /* 172 */ "SUM",
/* 173 */ "MIN", /* 173 */ "AVG",
/* 174 */ "MAX", /* 174 */ "MIN",
/* 175 */ "FIRST", /* 175 */ "MAX",
/* 176 */ "LAST", /* 176 */ "FIRST",
/* 177 */ "TOP", /* 177 */ "LAST",
/* 178 */ "BOTTOM", /* 178 */ "TOP",
/* 179 */ "STDDEV", /* 179 */ "BOTTOM",
/* 180 */ "PERCENTILE", /* 180 */ "STDDEV",
/* 181 */ "APERCENTILE", /* 181 */ "PERCENTILE",
/* 182 */ "LEASTSQUARES", /* 182 */ "APERCENTILE",
/* 183 */ "HISTOGRAM", /* 183 */ "LEASTSQUARES",
/* 184 */ "DIFF", /* 184 */ "HISTOGRAM",
/* 185 */ "SPREAD", /* 185 */ "DIFF",
/* 186 */ "TWA", /* 186 */ "SPREAD",
/* 187 */ "INTERP", /* 187 */ "TWA",
/* 188 */ "LAST_ROW", /* 188 */ "INTERP",
/* 189 */ "RATE", /* 189 */ "LAST_ROW",
/* 190 */ "IRATE", /* 190 */ "RATE",
/* 191 */ "SUM_RATE", /* 191 */ "IRATE",
/* 192 */ "SUM_IRATE", /* 192 */ "SUM_RATE",
/* 193 */ "AVG_RATE", /* 193 */ "SUM_IRATE",
/* 194 */ "AVG_IRATE", /* 194 */ "AVG_RATE",
/* 195 */ "TBID", /* 195 */ "AVG_IRATE",
/* 196 */ "SEMI", /* 196 */ "TBID",
/* 197 */ "NONE", /* 197 */ "SEMI",
/* 198 */ "PREV", /* 198 */ "NONE",
/* 199 */ "LINEAR", /* 199 */ "PREV",
/* 200 */ "IMPORT", /* 200 */ "LINEAR",
/* 201 */ "METRIC", /* 201 */ "IMPORT",
/* 202 */ "TBNAME", /* 202 */ "METRIC",
/* 203 */ "JOIN", /* 203 */ "TBNAME",
/* 204 */ "METRICS", /* 204 */ "JOIN",
/* 205 */ "STABLE", /* 205 */ "METRICS",
/* 206 */ "INSERT", /* 206 */ "INSERT",
/* 207 */ "INTO", /* 207 */ "INTO",
/* 208 */ "VALUES", /* 208 */ "VALUES",
/* 209 */ "error", /* 209 */ "program",
/* 210 */ "program", /* 210 */ "cmd",
/* 211 */ "cmd", /* 211 */ "dbPrefix",
/* 212 */ "dbPrefix", /* 212 */ "ids",
/* 213 */ "ids", /* 213 */ "cpxName",
/* 214 */ "cpxName", /* 214 */ "ifexists",
/* 215 */ "ifexists", /* 215 */ "alter_db_optr",
/* 216 */ "alter_db_optr", /* 216 */ "acct_optr",
/* 217 */ "acct_optr", /* 217 */ "ifnotexists",
/* 218 */ "ifnotexists", /* 218 */ "db_optr",
/* 219 */ "db_optr", /* 219 */ "pps",
/* 220 */ "pps", /* 220 */ "tseries",
/* 221 */ "tseries", /* 221 */ "dbs",
/* 222 */ "dbs", /* 222 */ "streams",
/* 223 */ "streams", /* 223 */ "storage",
/* 224 */ "storage", /* 224 */ "qtime",
/* 225 */ "qtime", /* 225 */ "users",
/* 226 */ "users", /* 226 */ "conns",
/* 227 */ "conns", /* 227 */ "state",
/* 228 */ "state", /* 228 */ "keep",
/* 229 */ "keep", /* 229 */ "tagitemlist",
/* 230 */ "tagitemlist", /* 230 */ "cache",
/* 231 */ "cache", /* 231 */ "replica",
/* 232 */ "replica", /* 232 */ "quorum",
/* 233 */ "quorum", /* 233 */ "days",
/* 234 */ "days", /* 234 */ "minrows",
/* 235 */ "minrows", /* 235 */ "maxrows",
/* 236 */ "maxrows", /* 236 */ "blocks",
/* 237 */ "blocks", /* 237 */ "ctime",
/* 238 */ "ctime", /* 238 */ "wal",
/* 239 */ "wal", /* 239 */ "fsync",
/* 240 */ "fsync", /* 240 */ "comp",
/* 241 */ "comp", /* 241 */ "prec",
/* 242 */ "prec", /* 242 */ "update",
/* 243 */ "update", /* 243 */ "cachelast",
/* 244 */ "cachelast", /* 244 */ "typename",
/* 245 */ "typename", /* 245 */ "signed",
/* 246 */ "signed", /* 246 */ "create_table_args",
/* 247 */ "create_table_args", /* 247 */ "create_stable_args",
/* 248 */ "create_table_list", /* 248 */ "create_table_list",
/* 249 */ "create_from_stable", /* 249 */ "create_from_stable",
/* 250 */ "columnlist", /* 250 */ "columnlist",
...@@ -1052,218 +1079,226 @@ static const char *const yyRuleName[] = { ...@@ -1052,218 +1079,226 @@ static const char *const yyRuleName[] = {
/* 25 */ "cmd ::= SHOW dbPrefix VGROUPS", /* 25 */ "cmd ::= SHOW dbPrefix VGROUPS",
/* 26 */ "cmd ::= SHOW dbPrefix VGROUPS ids", /* 26 */ "cmd ::= SHOW dbPrefix VGROUPS ids",
/* 27 */ "cmd ::= DROP TABLE ifexists ids cpxName", /* 27 */ "cmd ::= DROP TABLE ifexists ids cpxName",
/* 28 */ "cmd ::= DROP DATABASE ifexists ids", /* 28 */ "cmd ::= DROP STABLE ifexists ids cpxName",
/* 29 */ "cmd ::= DROP DNODE ids", /* 29 */ "cmd ::= DROP DATABASE ifexists ids",
/* 30 */ "cmd ::= DROP USER ids", /* 30 */ "cmd ::= DROP DNODE ids",
/* 31 */ "cmd ::= DROP ACCOUNT ids", /* 31 */ "cmd ::= DROP USER ids",
/* 32 */ "cmd ::= USE ids", /* 32 */ "cmd ::= DROP ACCOUNT ids",
/* 33 */ "cmd ::= DESCRIBE ids cpxName", /* 33 */ "cmd ::= USE ids",
/* 34 */ "cmd ::= ALTER USER ids PASS ids", /* 34 */ "cmd ::= DESCRIBE ids cpxName",
/* 35 */ "cmd ::= ALTER USER ids PRIVILEGE ids", /* 35 */ "cmd ::= ALTER USER ids PASS ids",
/* 36 */ "cmd ::= ALTER DNODE ids ids", /* 36 */ "cmd ::= ALTER USER ids PRIVILEGE ids",
/* 37 */ "cmd ::= ALTER DNODE ids ids ids", /* 37 */ "cmd ::= ALTER DNODE ids ids",
/* 38 */ "cmd ::= ALTER LOCAL ids", /* 38 */ "cmd ::= ALTER DNODE ids ids ids",
/* 39 */ "cmd ::= ALTER LOCAL ids ids", /* 39 */ "cmd ::= ALTER LOCAL ids",
/* 40 */ "cmd ::= ALTER DATABASE ids alter_db_optr", /* 40 */ "cmd ::= ALTER LOCAL ids ids",
/* 41 */ "cmd ::= ALTER ACCOUNT ids acct_optr", /* 41 */ "cmd ::= ALTER DATABASE ids alter_db_optr",
/* 42 */ "cmd ::= ALTER ACCOUNT ids PASS ids acct_optr", /* 42 */ "cmd ::= ALTER ACCOUNT ids acct_optr",
/* 43 */ "ids ::= ID", /* 43 */ "cmd ::= ALTER ACCOUNT ids PASS ids acct_optr",
/* 44 */ "ids ::= STRING", /* 44 */ "ids ::= ID",
/* 45 */ "ifexists ::= IF EXISTS", /* 45 */ "ids ::= STRING",
/* 46 */ "ifexists ::=", /* 46 */ "ifexists ::= IF EXISTS",
/* 47 */ "ifnotexists ::= IF NOT EXISTS", /* 47 */ "ifexists ::=",
/* 48 */ "ifnotexists ::=", /* 48 */ "ifnotexists ::= IF NOT EXISTS",
/* 49 */ "cmd ::= CREATE DNODE ids", /* 49 */ "ifnotexists ::=",
/* 50 */ "cmd ::= CREATE ACCOUNT ids PASS ids acct_optr", /* 50 */ "cmd ::= CREATE DNODE ids",
/* 51 */ "cmd ::= CREATE DATABASE ifnotexists ids db_optr", /* 51 */ "cmd ::= CREATE ACCOUNT ids PASS ids acct_optr",
/* 52 */ "cmd ::= CREATE USER ids PASS ids", /* 52 */ "cmd ::= CREATE DATABASE ifnotexists ids db_optr",
/* 53 */ "pps ::=", /* 53 */ "cmd ::= CREATE USER ids PASS ids",
/* 54 */ "pps ::= PPS INTEGER", /* 54 */ "pps ::=",
/* 55 */ "tseries ::=", /* 55 */ "pps ::= PPS INTEGER",
/* 56 */ "tseries ::= TSERIES INTEGER", /* 56 */ "tseries ::=",
/* 57 */ "dbs ::=", /* 57 */ "tseries ::= TSERIES INTEGER",
/* 58 */ "dbs ::= DBS INTEGER", /* 58 */ "dbs ::=",
/* 59 */ "streams ::=", /* 59 */ "dbs ::= DBS INTEGER",
/* 60 */ "streams ::= STREAMS INTEGER", /* 60 */ "streams ::=",
/* 61 */ "storage ::=", /* 61 */ "streams ::= STREAMS INTEGER",
/* 62 */ "storage ::= STORAGE INTEGER", /* 62 */ "storage ::=",
/* 63 */ "qtime ::=", /* 63 */ "storage ::= STORAGE INTEGER",
/* 64 */ "qtime ::= QTIME INTEGER", /* 64 */ "qtime ::=",
/* 65 */ "users ::=", /* 65 */ "qtime ::= QTIME INTEGER",
/* 66 */ "users ::= USERS INTEGER", /* 66 */ "users ::=",
/* 67 */ "conns ::=", /* 67 */ "users ::= USERS INTEGER",
/* 68 */ "conns ::= CONNS INTEGER", /* 68 */ "conns ::=",
/* 69 */ "state ::=", /* 69 */ "conns ::= CONNS INTEGER",
/* 70 */ "state ::= STATE ids", /* 70 */ "state ::=",
/* 71 */ "acct_optr ::= pps tseries storage streams qtime dbs users conns state", /* 71 */ "state ::= STATE ids",
/* 72 */ "keep ::= KEEP tagitemlist", /* 72 */ "acct_optr ::= pps tseries storage streams qtime dbs users conns state",
/* 73 */ "cache ::= CACHE INTEGER", /* 73 */ "keep ::= KEEP tagitemlist",
/* 74 */ "replica ::= REPLICA INTEGER", /* 74 */ "cache ::= CACHE INTEGER",
/* 75 */ "quorum ::= QUORUM INTEGER", /* 75 */ "replica ::= REPLICA INTEGER",
/* 76 */ "days ::= DAYS INTEGER", /* 76 */ "quorum ::= QUORUM INTEGER",
/* 77 */ "minrows ::= MINROWS INTEGER", /* 77 */ "days ::= DAYS INTEGER",
/* 78 */ "maxrows ::= MAXROWS INTEGER", /* 78 */ "minrows ::= MINROWS INTEGER",
/* 79 */ "blocks ::= BLOCKS INTEGER", /* 79 */ "maxrows ::= MAXROWS INTEGER",
/* 80 */ "ctime ::= CTIME INTEGER", /* 80 */ "blocks ::= BLOCKS INTEGER",
/* 81 */ "wal ::= WAL INTEGER", /* 81 */ "ctime ::= CTIME INTEGER",
/* 82 */ "fsync ::= FSYNC INTEGER", /* 82 */ "wal ::= WAL INTEGER",
/* 83 */ "comp ::= COMP INTEGER", /* 83 */ "fsync ::= FSYNC INTEGER",
/* 84 */ "prec ::= PRECISION STRING", /* 84 */ "comp ::= COMP INTEGER",
/* 85 */ "update ::= UPDATE INTEGER", /* 85 */ "prec ::= PRECISION STRING",
/* 86 */ "cachelast ::= CACHELAST INTEGER", /* 86 */ "update ::= UPDATE INTEGER",
/* 87 */ "db_optr ::=", /* 87 */ "cachelast ::= CACHELAST INTEGER",
/* 88 */ "db_optr ::= db_optr cache", /* 88 */ "db_optr ::=",
/* 89 */ "db_optr ::= db_optr replica", /* 89 */ "db_optr ::= db_optr cache",
/* 90 */ "db_optr ::= db_optr quorum", /* 90 */ "db_optr ::= db_optr replica",
/* 91 */ "db_optr ::= db_optr days", /* 91 */ "db_optr ::= db_optr quorum",
/* 92 */ "db_optr ::= db_optr minrows", /* 92 */ "db_optr ::= db_optr days",
/* 93 */ "db_optr ::= db_optr maxrows", /* 93 */ "db_optr ::= db_optr minrows",
/* 94 */ "db_optr ::= db_optr blocks", /* 94 */ "db_optr ::= db_optr maxrows",
/* 95 */ "db_optr ::= db_optr ctime", /* 95 */ "db_optr ::= db_optr blocks",
/* 96 */ "db_optr ::= db_optr wal", /* 96 */ "db_optr ::= db_optr ctime",
/* 97 */ "db_optr ::= db_optr fsync", /* 97 */ "db_optr ::= db_optr wal",
/* 98 */ "db_optr ::= db_optr comp", /* 98 */ "db_optr ::= db_optr fsync",
/* 99 */ "db_optr ::= db_optr prec", /* 99 */ "db_optr ::= db_optr comp",
/* 100 */ "db_optr ::= db_optr keep", /* 100 */ "db_optr ::= db_optr prec",
/* 101 */ "db_optr ::= db_optr update", /* 101 */ "db_optr ::= db_optr keep",
/* 102 */ "db_optr ::= db_optr cachelast", /* 102 */ "db_optr ::= db_optr update",
/* 103 */ "alter_db_optr ::=", /* 103 */ "db_optr ::= db_optr cachelast",
/* 104 */ "alter_db_optr ::= alter_db_optr replica", /* 104 */ "alter_db_optr ::=",
/* 105 */ "alter_db_optr ::= alter_db_optr quorum", /* 105 */ "alter_db_optr ::= alter_db_optr replica",
/* 106 */ "alter_db_optr ::= alter_db_optr keep", /* 106 */ "alter_db_optr ::= alter_db_optr quorum",
/* 107 */ "alter_db_optr ::= alter_db_optr blocks", /* 107 */ "alter_db_optr ::= alter_db_optr keep",
/* 108 */ "alter_db_optr ::= alter_db_optr comp", /* 108 */ "alter_db_optr ::= alter_db_optr blocks",
/* 109 */ "alter_db_optr ::= alter_db_optr wal", /* 109 */ "alter_db_optr ::= alter_db_optr comp",
/* 110 */ "alter_db_optr ::= alter_db_optr fsync", /* 110 */ "alter_db_optr ::= alter_db_optr wal",
/* 111 */ "alter_db_optr ::= alter_db_optr update", /* 111 */ "alter_db_optr ::= alter_db_optr fsync",
/* 112 */ "alter_db_optr ::= alter_db_optr cachelast", /* 112 */ "alter_db_optr ::= alter_db_optr update",
/* 113 */ "typename ::= ids", /* 113 */ "alter_db_optr ::= alter_db_optr cachelast",
/* 114 */ "typename ::= ids LP signed RP", /* 114 */ "typename ::= ids",
/* 115 */ "typename ::= ids UNSIGNED", /* 115 */ "typename ::= ids LP signed RP",
/* 116 */ "signed ::= INTEGER", /* 116 */ "typename ::= ids UNSIGNED",
/* 117 */ "signed ::= PLUS INTEGER", /* 117 */ "signed ::= INTEGER",
/* 118 */ "signed ::= MINUS INTEGER", /* 118 */ "signed ::= PLUS INTEGER",
/* 119 */ "cmd ::= CREATE TABLE create_table_args", /* 119 */ "signed ::= MINUS INTEGER",
/* 120 */ "cmd ::= CREATE TABLE create_table_list", /* 120 */ "cmd ::= CREATE TABLE create_table_args",
/* 121 */ "create_table_list ::= create_from_stable", /* 121 */ "cmd ::= CREATE TABLE create_stable_args",
/* 122 */ "create_table_list ::= create_table_list create_from_stable", /* 122 */ "cmd ::= CREATE STABLE create_stable_args",
/* 123 */ "create_table_args ::= ifnotexists ids cpxName LP columnlist RP", /* 123 */ "cmd ::= CREATE TABLE create_table_list",
/* 124 */ "create_table_args ::= ifnotexists ids cpxName LP columnlist RP TAGS LP columnlist RP", /* 124 */ "create_table_list ::= create_from_stable",
/* 125 */ "create_from_stable ::= ifnotexists ids cpxName USING ids cpxName TAGS LP tagitemlist RP", /* 125 */ "create_table_list ::= create_table_list create_from_stable",
/* 126 */ "create_table_args ::= ifnotexists ids cpxName AS select", /* 126 */ "create_table_args ::= ifnotexists ids cpxName LP columnlist RP",
/* 127 */ "columnlist ::= columnlist COMMA column", /* 127 */ "create_stable_args ::= ifnotexists ids cpxName LP columnlist RP TAGS LP columnlist RP",
/* 128 */ "columnlist ::= column", /* 128 */ "create_from_stable ::= ifnotexists ids cpxName USING ids cpxName TAGS LP tagitemlist RP",
/* 129 */ "column ::= ids typename", /* 129 */ "create_table_args ::= ifnotexists ids cpxName AS select",
/* 130 */ "tagitemlist ::= tagitemlist COMMA tagitem", /* 130 */ "columnlist ::= columnlist COMMA column",
/* 131 */ "tagitemlist ::= tagitem", /* 131 */ "columnlist ::= column",
/* 132 */ "tagitem ::= INTEGER", /* 132 */ "column ::= ids typename",
/* 133 */ "tagitem ::= FLOAT", /* 133 */ "tagitemlist ::= tagitemlist COMMA tagitem",
/* 134 */ "tagitem ::= STRING", /* 134 */ "tagitemlist ::= tagitem",
/* 135 */ "tagitem ::= BOOL", /* 135 */ "tagitem ::= INTEGER",
/* 136 */ "tagitem ::= NULL", /* 136 */ "tagitem ::= FLOAT",
/* 137 */ "tagitem ::= MINUS INTEGER", /* 137 */ "tagitem ::= STRING",
/* 138 */ "tagitem ::= MINUS FLOAT", /* 138 */ "tagitem ::= BOOL",
/* 139 */ "tagitem ::= PLUS INTEGER", /* 139 */ "tagitem ::= NULL",
/* 140 */ "tagitem ::= PLUS FLOAT", /* 140 */ "tagitem ::= MINUS INTEGER",
/* 141 */ "select ::= SELECT selcollist from where_opt interval_opt fill_opt sliding_opt groupby_opt orderby_opt having_opt slimit_opt limit_opt", /* 141 */ "tagitem ::= MINUS FLOAT",
/* 142 */ "union ::= select", /* 142 */ "tagitem ::= PLUS INTEGER",
/* 143 */ "union ::= LP union RP", /* 143 */ "tagitem ::= PLUS FLOAT",
/* 144 */ "union ::= union UNION ALL select", /* 144 */ "select ::= SELECT selcollist from where_opt interval_opt fill_opt sliding_opt groupby_opt orderby_opt having_opt slimit_opt limit_opt",
/* 145 */ "union ::= union UNION ALL LP select RP", /* 145 */ "union ::= select",
/* 146 */ "cmd ::= union", /* 146 */ "union ::= LP union RP",
/* 147 */ "select ::= SELECT selcollist", /* 147 */ "union ::= union UNION ALL select",
/* 148 */ "sclp ::= selcollist COMMA", /* 148 */ "union ::= union UNION ALL LP select RP",
/* 149 */ "sclp ::=", /* 149 */ "cmd ::= union",
/* 150 */ "selcollist ::= sclp expr as", /* 150 */ "select ::= SELECT selcollist",
/* 151 */ "selcollist ::= sclp STAR", /* 151 */ "sclp ::= selcollist COMMA",
/* 152 */ "as ::= AS ids", /* 152 */ "sclp ::=",
/* 153 */ "as ::= ids", /* 153 */ "selcollist ::= sclp expr as",
/* 154 */ "as ::=", /* 154 */ "selcollist ::= sclp STAR",
/* 155 */ "from ::= FROM tablelist", /* 155 */ "as ::= AS ids",
/* 156 */ "tablelist ::= ids cpxName", /* 156 */ "as ::= ids",
/* 157 */ "tablelist ::= ids cpxName ids", /* 157 */ "as ::=",
/* 158 */ "tablelist ::= tablelist COMMA ids cpxName", /* 158 */ "from ::= FROM tablelist",
/* 159 */ "tablelist ::= tablelist COMMA ids cpxName ids", /* 159 */ "tablelist ::= ids cpxName",
/* 160 */ "tmvar ::= VARIABLE", /* 160 */ "tablelist ::= ids cpxName ids",
/* 161 */ "interval_opt ::= INTERVAL LP tmvar RP", /* 161 */ "tablelist ::= tablelist COMMA ids cpxName",
/* 162 */ "interval_opt ::= INTERVAL LP tmvar COMMA tmvar RP", /* 162 */ "tablelist ::= tablelist COMMA ids cpxName ids",
/* 163 */ "interval_opt ::=", /* 163 */ "tmvar ::= VARIABLE",
/* 164 */ "fill_opt ::=", /* 164 */ "interval_opt ::= INTERVAL LP tmvar RP",
/* 165 */ "fill_opt ::= FILL LP ID COMMA tagitemlist RP", /* 165 */ "interval_opt ::= INTERVAL LP tmvar COMMA tmvar RP",
/* 166 */ "fill_opt ::= FILL LP ID RP", /* 166 */ "interval_opt ::=",
/* 167 */ "sliding_opt ::= SLIDING LP tmvar RP", /* 167 */ "fill_opt ::=",
/* 168 */ "sliding_opt ::=", /* 168 */ "fill_opt ::= FILL LP ID COMMA tagitemlist RP",
/* 169 */ "orderby_opt ::=", /* 169 */ "fill_opt ::= FILL LP ID RP",
/* 170 */ "orderby_opt ::= ORDER BY sortlist", /* 170 */ "sliding_opt ::= SLIDING LP tmvar RP",
/* 171 */ "sortlist ::= sortlist COMMA item sortorder", /* 171 */ "sliding_opt ::=",
/* 172 */ "sortlist ::= item sortorder", /* 172 */ "orderby_opt ::=",
/* 173 */ "item ::= ids cpxName", /* 173 */ "orderby_opt ::= ORDER BY sortlist",
/* 174 */ "sortorder ::= ASC", /* 174 */ "sortlist ::= sortlist COMMA item sortorder",
/* 175 */ "sortorder ::= DESC", /* 175 */ "sortlist ::= item sortorder",
/* 176 */ "sortorder ::=", /* 176 */ "item ::= ids cpxName",
/* 177 */ "groupby_opt ::=", /* 177 */ "sortorder ::= ASC",
/* 178 */ "groupby_opt ::= GROUP BY grouplist", /* 178 */ "sortorder ::= DESC",
/* 179 */ "grouplist ::= grouplist COMMA item", /* 179 */ "sortorder ::=",
/* 180 */ "grouplist ::= item", /* 180 */ "groupby_opt ::=",
/* 181 */ "having_opt ::=", /* 181 */ "groupby_opt ::= GROUP BY grouplist",
/* 182 */ "having_opt ::= HAVING expr", /* 182 */ "grouplist ::= grouplist COMMA item",
/* 183 */ "limit_opt ::=", /* 183 */ "grouplist ::= item",
/* 184 */ "limit_opt ::= LIMIT signed", /* 184 */ "having_opt ::=",
/* 185 */ "limit_opt ::= LIMIT signed OFFSET signed", /* 185 */ "having_opt ::= HAVING expr",
/* 186 */ "limit_opt ::= LIMIT signed COMMA signed", /* 186 */ "limit_opt ::=",
/* 187 */ "slimit_opt ::=", /* 187 */ "limit_opt ::= LIMIT signed",
/* 188 */ "slimit_opt ::= SLIMIT signed", /* 188 */ "limit_opt ::= LIMIT signed OFFSET signed",
/* 189 */ "slimit_opt ::= SLIMIT signed SOFFSET signed", /* 189 */ "limit_opt ::= LIMIT signed COMMA signed",
/* 190 */ "slimit_opt ::= SLIMIT signed COMMA signed", /* 190 */ "slimit_opt ::=",
/* 191 */ "where_opt ::=", /* 191 */ "slimit_opt ::= SLIMIT signed",
/* 192 */ "where_opt ::= WHERE expr", /* 192 */ "slimit_opt ::= SLIMIT signed SOFFSET signed",
/* 193 */ "expr ::= LP expr RP", /* 193 */ "slimit_opt ::= SLIMIT signed COMMA signed",
/* 194 */ "expr ::= ID", /* 194 */ "where_opt ::=",
/* 195 */ "expr ::= ID DOT ID", /* 195 */ "where_opt ::= WHERE expr",
/* 196 */ "expr ::= ID DOT STAR", /* 196 */ "expr ::= LP expr RP",
/* 197 */ "expr ::= INTEGER", /* 197 */ "expr ::= ID",
/* 198 */ "expr ::= MINUS INTEGER", /* 198 */ "expr ::= ID DOT ID",
/* 199 */ "expr ::= PLUS INTEGER", /* 199 */ "expr ::= ID DOT STAR",
/* 200 */ "expr ::= FLOAT", /* 200 */ "expr ::= INTEGER",
/* 201 */ "expr ::= MINUS FLOAT", /* 201 */ "expr ::= MINUS INTEGER",
/* 202 */ "expr ::= PLUS FLOAT", /* 202 */ "expr ::= PLUS INTEGER",
/* 203 */ "expr ::= STRING", /* 203 */ "expr ::= FLOAT",
/* 204 */ "expr ::= NOW", /* 204 */ "expr ::= MINUS FLOAT",
/* 205 */ "expr ::= VARIABLE", /* 205 */ "expr ::= PLUS FLOAT",
/* 206 */ "expr ::= BOOL", /* 206 */ "expr ::= STRING",
/* 207 */ "expr ::= ID LP exprlist RP", /* 207 */ "expr ::= NOW",
/* 208 */ "expr ::= ID LP STAR RP", /* 208 */ "expr ::= VARIABLE",
/* 209 */ "expr ::= expr IS NULL", /* 209 */ "expr ::= BOOL",
/* 210 */ "expr ::= expr IS NOT NULL", /* 210 */ "expr ::= ID LP exprlist RP",
/* 211 */ "expr ::= expr LT expr", /* 211 */ "expr ::= ID LP STAR RP",
/* 212 */ "expr ::= expr GT expr", /* 212 */ "expr ::= expr IS NULL",
/* 213 */ "expr ::= expr LE expr", /* 213 */ "expr ::= expr IS NOT NULL",
/* 214 */ "expr ::= expr GE expr", /* 214 */ "expr ::= expr LT expr",
/* 215 */ "expr ::= expr NE expr", /* 215 */ "expr ::= expr GT expr",
/* 216 */ "expr ::= expr EQ expr", /* 216 */ "expr ::= expr LE expr",
/* 217 */ "expr ::= expr AND expr", /* 217 */ "expr ::= expr GE expr",
/* 218 */ "expr ::= expr OR expr", /* 218 */ "expr ::= expr NE expr",
/* 219 */ "expr ::= expr PLUS expr", /* 219 */ "expr ::= expr EQ expr",
/* 220 */ "expr ::= expr MINUS expr", /* 220 */ "expr ::= expr AND expr",
/* 221 */ "expr ::= expr STAR expr", /* 221 */ "expr ::= expr OR expr",
/* 222 */ "expr ::= expr SLASH expr", /* 222 */ "expr ::= expr PLUS expr",
/* 223 */ "expr ::= expr REM expr", /* 223 */ "expr ::= expr MINUS expr",
/* 224 */ "expr ::= expr LIKE expr", /* 224 */ "expr ::= expr STAR expr",
/* 225 */ "expr ::= expr IN LP exprlist RP", /* 225 */ "expr ::= expr SLASH expr",
/* 226 */ "exprlist ::= exprlist COMMA expritem", /* 226 */ "expr ::= expr REM expr",
/* 227 */ "exprlist ::= expritem", /* 227 */ "expr ::= expr LIKE expr",
/* 228 */ "expritem ::= expr", /* 228 */ "expr ::= expr IN LP exprlist RP",
/* 229 */ "expritem ::=", /* 229 */ "exprlist ::= exprlist COMMA expritem",
/* 230 */ "cmd ::= RESET QUERY CACHE", /* 230 */ "exprlist ::= expritem",
/* 231 */ "cmd ::= ALTER TABLE ids cpxName ADD COLUMN columnlist", /* 231 */ "expritem ::= expr",
/* 232 */ "cmd ::= ALTER TABLE ids cpxName DROP COLUMN ids", /* 232 */ "expritem ::=",
/* 233 */ "cmd ::= ALTER TABLE ids cpxName ADD TAG columnlist", /* 233 */ "cmd ::= RESET QUERY CACHE",
/* 234 */ "cmd ::= ALTER TABLE ids cpxName DROP TAG ids", /* 234 */ "cmd ::= ALTER TABLE ids cpxName ADD COLUMN columnlist",
/* 235 */ "cmd ::= ALTER TABLE ids cpxName CHANGE TAG ids ids", /* 235 */ "cmd ::= ALTER TABLE ids cpxName DROP COLUMN ids",
/* 236 */ "cmd ::= ALTER TABLE ids cpxName SET TAG ids EQ tagitem", /* 236 */ "cmd ::= ALTER TABLE ids cpxName ADD TAG columnlist",
/* 237 */ "cmd ::= KILL CONNECTION INTEGER", /* 237 */ "cmd ::= ALTER TABLE ids cpxName DROP TAG ids",
/* 238 */ "cmd ::= KILL STREAM INTEGER COLON INTEGER", /* 238 */ "cmd ::= ALTER TABLE ids cpxName CHANGE TAG ids ids",
/* 239 */ "cmd ::= KILL QUERY INTEGER COLON INTEGER", /* 239 */ "cmd ::= ALTER TABLE ids cpxName SET TAG ids EQ tagitem",
/* 240 */ "cmd ::= ALTER STABLE ids cpxName ADD COLUMN columnlist",
/* 241 */ "cmd ::= ALTER STABLE ids cpxName DROP COLUMN ids",
/* 242 */ "cmd ::= ALTER STABLE ids cpxName ADD TAG columnlist",
/* 243 */ "cmd ::= ALTER STABLE ids cpxName DROP TAG ids",
/* 244 */ "cmd ::= ALTER STABLE ids cpxName CHANGE TAG ids ids",
/* 245 */ "cmd ::= KILL CONNECTION INTEGER",
/* 246 */ "cmd ::= KILL STREAM INTEGER COLON INTEGER",
/* 247 */ "cmd ::= KILL QUERY INTEGER COLON INTEGER",
}; };
#endif /* NDEBUG */ #endif /* NDEBUG */
...@@ -1312,28 +1347,29 @@ static int yyGrowStack(yyParser *p){ ...@@ -1312,28 +1347,29 @@ static int yyGrowStack(yyParser *p){
/* Initialize a new parser that has already been allocated. /* Initialize a new parser that has already been allocated.
*/ */
void ParseInit(void *yypParser){ void ParseInit(void *yypRawParser ParseCTX_PDECL){
yyParser *pParser = (yyParser*)yypParser; yyParser *yypParser = (yyParser*)yypRawParser;
ParseCTX_STORE
#ifdef YYTRACKMAXSTACKDEPTH #ifdef YYTRACKMAXSTACKDEPTH
pParser->yyhwm = 0; yypParser->yyhwm = 0;
#endif #endif
#if YYSTACKDEPTH<=0 #if YYSTACKDEPTH<=0
pParser->yytos = NULL; yypParser->yytos = NULL;
pParser->yystack = NULL; yypParser->yystack = NULL;
pParser->yystksz = 0; yypParser->yystksz = 0;
if( yyGrowStack(pParser) ){ if( yyGrowStack(yypParser) ){
pParser->yystack = &pParser->yystk0; yypParser->yystack = &yypParser->yystk0;
pParser->yystksz = 1; yypParser->yystksz = 1;
} }
#endif #endif
#ifndef YYNOERRORRECOVERY #ifndef YYNOERRORRECOVERY
pParser->yyerrcnt = -1; yypParser->yyerrcnt = -1;
#endif #endif
pParser->yytos = pParser->yystack; yypParser->yytos = yypParser->yystack;
pParser->yystack[0].stateno = 0; yypParser->yystack[0].stateno = 0;
pParser->yystack[0].major = 0; yypParser->yystack[0].major = 0;
#if YYSTACKDEPTH>0 #if YYSTACKDEPTH>0
pParser->yystackEnd = &pParser->yystack[YYSTACKDEPTH-1]; yypParser->yystackEnd = &yypParser->yystack[YYSTACKDEPTH-1];
#endif #endif
} }
...@@ -1350,11 +1386,14 @@ void ParseInit(void *yypParser){ ...@@ -1350,11 +1386,14 @@ void ParseInit(void *yypParser){
** A pointer to a parser. This pointer is used in subsequent calls ** A pointer to a parser. This pointer is used in subsequent calls
** to Parse and ParseFree. ** to Parse and ParseFree.
*/ */
void *ParseAlloc(void *(*mallocProc)(YYMALLOCARGTYPE)){ void *ParseAlloc(void *(*mallocProc)(YYMALLOCARGTYPE) ParseCTX_PDECL){
yyParser *pParser; yyParser *yypParser;
pParser = (yyParser*)(*mallocProc)( (YYMALLOCARGTYPE)sizeof(yyParser) ); yypParser = (yyParser*)(*mallocProc)( (YYMALLOCARGTYPE)sizeof(yyParser) );
if( pParser ) ParseInit(pParser); if( yypParser ){
return pParser; ParseCTX_STORE
ParseInit(yypParser ParseCTX_PARAM);
}
return (void*)yypParser;
} }
#endif /* Parse_ENGINEALWAYSONSTACK */ #endif /* Parse_ENGINEALWAYSONSTACK */
...@@ -1371,7 +1410,8 @@ static void yy_destructor( ...@@ -1371,7 +1410,8 @@ static void yy_destructor(
YYCODETYPE yymajor, /* Type code for object to destroy */ YYCODETYPE yymajor, /* Type code for object to destroy */
YYMINORTYPE *yypminor /* The object to be destroyed */ YYMINORTYPE *yypminor /* The object to be destroyed */
){ ){
ParseARG_FETCH; ParseARG_FETCH
ParseCTX_FETCH
switch( yymajor ){ switch( yymajor ){
/* Here is inserted the actions which take place when a /* Here is inserted the actions which take place when a
** terminal or non-terminal is destroyed. This can happen ** terminal or non-terminal is destroyed. This can happen
...@@ -1384,8 +1424,8 @@ static void yy_destructor( ...@@ -1384,8 +1424,8 @@ static void yy_destructor(
** inside the C code. ** inside the C code.
*/ */
/********* Begin destructor definitions ***************************************/ /********* Begin destructor definitions ***************************************/
case 229: /* keep */ case 228: /* keep */
case 230: /* tagitemlist */ case 229: /* tagitemlist */
case 250: /* columnlist */ case 250: /* columnlist */
case 258: /* fill_opt */ case 258: /* fill_opt */
case 260: /* groupby_opt */ case 260: /* groupby_opt */
...@@ -1540,13 +1580,12 @@ int ParseCoverage(FILE *out){ ...@@ -1540,13 +1580,12 @@ int ParseCoverage(FILE *out){
** Find the appropriate action for a parser given the terminal ** Find the appropriate action for a parser given the terminal
** look-ahead token iLookAhead. ** look-ahead token iLookAhead.
*/ */
static unsigned int yy_find_shift_action( static YYACTIONTYPE yy_find_shift_action(
yyParser *pParser, /* The parser */ YYCODETYPE iLookAhead, /* The look-ahead token */
YYCODETYPE iLookAhead /* The look-ahead token */ YYACTIONTYPE stateno /* Current state number */
){ ){
int i; int i;
int stateno = pParser->yytos->stateno;
if( stateno>YY_MAX_SHIFT ) return stateno; if( stateno>YY_MAX_SHIFT ) return stateno;
assert( stateno <= YY_SHIFT_COUNT ); assert( stateno <= YY_SHIFT_COUNT );
#if defined(YYCOVERAGE) #if defined(YYCOVERAGE)
...@@ -1554,15 +1593,19 @@ static unsigned int yy_find_shift_action( ...@@ -1554,15 +1593,19 @@ static unsigned int yy_find_shift_action(
#endif #endif
do{ do{
i = yy_shift_ofst[stateno]; i = yy_shift_ofst[stateno];
assert( i>=0 && i+YYNTOKEN<=sizeof(yy_lookahead)/sizeof(yy_lookahead[0]) ); assert( i>=0 );
assert( i<=YY_ACTTAB_COUNT );
assert( i+YYNTOKEN<=(int)YY_NLOOKAHEAD );
assert( iLookAhead!=YYNOCODE ); assert( iLookAhead!=YYNOCODE );
assert( iLookAhead < YYNTOKEN ); assert( iLookAhead < YYNTOKEN );
i += iLookAhead; i += iLookAhead;
assert( i<(int)YY_NLOOKAHEAD );
if( yy_lookahead[i]!=iLookAhead ){ if( yy_lookahead[i]!=iLookAhead ){
#ifdef YYFALLBACK #ifdef YYFALLBACK
YYCODETYPE iFallback; /* Fallback token */ YYCODETYPE iFallback; /* Fallback token */
if( iLookAhead<sizeof(yyFallback)/sizeof(yyFallback[0]) assert( iLookAhead<sizeof(yyFallback)/sizeof(yyFallback[0]) );
&& (iFallback = yyFallback[iLookAhead])!=0 ){ iFallback = yyFallback[iLookAhead];
if( iFallback!=0 ){
#ifndef NDEBUG #ifndef NDEBUG
if( yyTraceFILE ){ if( yyTraceFILE ){
fprintf(yyTraceFILE, "%sFALLBACK %s => %s\n", fprintf(yyTraceFILE, "%sFALLBACK %s => %s\n",
...@@ -1577,15 +1620,8 @@ static unsigned int yy_find_shift_action( ...@@ -1577,15 +1620,8 @@ static unsigned int yy_find_shift_action(
#ifdef YYWILDCARD #ifdef YYWILDCARD
{ {
int j = i - iLookAhead + YYWILDCARD; int j = i - iLookAhead + YYWILDCARD;
if( assert( j<(int)(sizeof(yy_lookahead)/sizeof(yy_lookahead[0])) );
#if YY_SHIFT_MIN+YYWILDCARD<0 if( yy_lookahead[j]==YYWILDCARD && iLookAhead>0 ){
j>=0 &&
#endif
#if YY_SHIFT_MAX+YYWILDCARD>=YY_ACTTAB_COUNT
j<YY_ACTTAB_COUNT &&
#endif
yy_lookahead[j]==YYWILDCARD && iLookAhead>0
){
#ifndef NDEBUG #ifndef NDEBUG
if( yyTraceFILE ){ if( yyTraceFILE ){
fprintf(yyTraceFILE, "%sWILDCARD %s => %s\n", fprintf(yyTraceFILE, "%sWILDCARD %s => %s\n",
...@@ -1599,6 +1635,7 @@ static unsigned int yy_find_shift_action( ...@@ -1599,6 +1635,7 @@ static unsigned int yy_find_shift_action(
#endif /* YYWILDCARD */ #endif /* YYWILDCARD */
return yy_default[stateno]; return yy_default[stateno];
}else{ }else{
assert( i>=0 && i<sizeof(yy_action)/sizeof(yy_action[0]) );
return yy_action[i]; return yy_action[i];
} }
}while(1); }while(1);
...@@ -1608,8 +1645,8 @@ static unsigned int yy_find_shift_action( ...@@ -1608,8 +1645,8 @@ static unsigned int yy_find_shift_action(
** Find the appropriate action for a parser given the non-terminal ** Find the appropriate action for a parser given the non-terminal
** look-ahead token iLookAhead. ** look-ahead token iLookAhead.
*/ */
static int yy_find_reduce_action( static YYACTIONTYPE yy_find_reduce_action(
int stateno, /* Current state number */ YYACTIONTYPE stateno, /* Current state number */
YYCODETYPE iLookAhead /* The look-ahead token */ YYCODETYPE iLookAhead /* The look-ahead token */
){ ){
int i; int i;
...@@ -1638,7 +1675,8 @@ static int yy_find_reduce_action( ...@@ -1638,7 +1675,8 @@ static int yy_find_reduce_action(
** The following routine is called if the stack overflows. ** The following routine is called if the stack overflows.
*/ */
static void yyStackOverflow(yyParser *yypParser){ static void yyStackOverflow(yyParser *yypParser){
ParseARG_FETCH; ParseARG_FETCH
ParseCTX_FETCH
#ifndef NDEBUG #ifndef NDEBUG
if( yyTraceFILE ){ if( yyTraceFILE ){
fprintf(yyTraceFILE,"%sStack Overflow!\n",yyTracePrompt); fprintf(yyTraceFILE,"%sStack Overflow!\n",yyTracePrompt);
...@@ -1649,7 +1687,8 @@ static void yyStackOverflow(yyParser *yypParser){ ...@@ -1649,7 +1687,8 @@ static void yyStackOverflow(yyParser *yypParser){
** stack every overflows */ ** stack every overflows */
/******** Begin %stack_overflow code ******************************************/ /******** Begin %stack_overflow code ******************************************/
/******** End %stack_overflow code ********************************************/ /******** End %stack_overflow code ********************************************/
ParseARG_STORE; /* Suppress warning about unused %extra_argument var */ ParseARG_STORE /* Suppress warning about unused %extra_argument var */
ParseCTX_STORE
} }
/* /*
...@@ -1678,8 +1717,8 @@ static void yyTraceShift(yyParser *yypParser, int yyNewState, const char *zTag){ ...@@ -1678,8 +1717,8 @@ static void yyTraceShift(yyParser *yypParser, int yyNewState, const char *zTag){
*/ */
static void yy_shift( static void yy_shift(
yyParser *yypParser, /* The parser to be shifted */ yyParser *yypParser, /* The parser to be shifted */
int yyNewState, /* The new state to shift in */ YYACTIONTYPE yyNewState, /* The new state to shift in */
int yyMajor, /* The major token to shift in */ YYCODETYPE yyMajor, /* The major token to shift in */
ParseTOKENTYPE yyMinor /* The minor token to shift in */ ParseTOKENTYPE yyMinor /* The minor token to shift in */
){ ){
yyStackEntry *yytos; yyStackEntry *yytos;
...@@ -1709,259 +1748,516 @@ static void yy_shift( ...@@ -1709,259 +1748,516 @@ static void yy_shift(
yyNewState += YY_MIN_REDUCE - YY_MIN_SHIFTREDUCE; yyNewState += YY_MIN_REDUCE - YY_MIN_SHIFTREDUCE;
} }
yytos = yypParser->yytos; yytos = yypParser->yytos;
yytos->stateno = (YYACTIONTYPE)yyNewState; yytos->stateno = yyNewState;
yytos->major = (YYCODETYPE)yyMajor; yytos->major = yyMajor;
yytos->minor.yy0 = yyMinor; yytos->minor.yy0 = yyMinor;
yyTraceShift(yypParser, yyNewState, "Shift"); yyTraceShift(yypParser, yyNewState, "Shift");
} }
/* The following table contains information about every rule that /* For rule J, yyRuleInfoLhs[J] contains the symbol on the left-hand side
** is used during the reduce. ** of that rule */
*/ static const YYCODETYPE yyRuleInfoLhs[] = {
static const struct { 209, /* (0) program ::= cmd */
YYCODETYPE lhs; /* Symbol on the left-hand side of the rule */ 210, /* (1) cmd ::= SHOW DATABASES */
signed char nrhs; /* Negative of the number of RHS symbols in the rule */ 210, /* (2) cmd ::= SHOW MNODES */
} yyRuleInfo[] = { 210, /* (3) cmd ::= SHOW DNODES */
{ 210, -1 }, /* (0) program ::= cmd */ 210, /* (4) cmd ::= SHOW ACCOUNTS */
{ 211, -2 }, /* (1) cmd ::= SHOW DATABASES */ 210, /* (5) cmd ::= SHOW USERS */
{ 211, -2 }, /* (2) cmd ::= SHOW MNODES */ 210, /* (6) cmd ::= SHOW MODULES */
{ 211, -2 }, /* (3) cmd ::= SHOW DNODES */ 210, /* (7) cmd ::= SHOW QUERIES */
{ 211, -2 }, /* (4) cmd ::= SHOW ACCOUNTS */ 210, /* (8) cmd ::= SHOW CONNECTIONS */
{ 211, -2 }, /* (5) cmd ::= SHOW USERS */ 210, /* (9) cmd ::= SHOW STREAMS */
{ 211, -2 }, /* (6) cmd ::= SHOW MODULES */ 210, /* (10) cmd ::= SHOW VARIABLES */
{ 211, -2 }, /* (7) cmd ::= SHOW QUERIES */ 210, /* (11) cmd ::= SHOW SCORES */
{ 211, -2 }, /* (8) cmd ::= SHOW CONNECTIONS */ 210, /* (12) cmd ::= SHOW GRANTS */
{ 211, -2 }, /* (9) cmd ::= SHOW STREAMS */ 210, /* (13) cmd ::= SHOW VNODES */
{ 211, -2 }, /* (10) cmd ::= SHOW VARIABLES */ 210, /* (14) cmd ::= SHOW VNODES IPTOKEN */
{ 211, -2 }, /* (11) cmd ::= SHOW SCORES */ 211, /* (15) dbPrefix ::= */
{ 211, -2 }, /* (12) cmd ::= SHOW GRANTS */ 211, /* (16) dbPrefix ::= ids DOT */
{ 211, -2 }, /* (13) cmd ::= SHOW VNODES */ 213, /* (17) cpxName ::= */
{ 211, -3 }, /* (14) cmd ::= SHOW VNODES IPTOKEN */ 213, /* (18) cpxName ::= DOT ids */
{ 212, 0 }, /* (15) dbPrefix ::= */ 210, /* (19) cmd ::= SHOW CREATE TABLE ids cpxName */
{ 212, -2 }, /* (16) dbPrefix ::= ids DOT */ 210, /* (20) cmd ::= SHOW CREATE DATABASE ids */
{ 214, 0 }, /* (17) cpxName ::= */ 210, /* (21) cmd ::= SHOW dbPrefix TABLES */
{ 214, -2 }, /* (18) cpxName ::= DOT ids */ 210, /* (22) cmd ::= SHOW dbPrefix TABLES LIKE ids */
{ 211, -5 }, /* (19) cmd ::= SHOW CREATE TABLE ids cpxName */ 210, /* (23) cmd ::= SHOW dbPrefix STABLES */
{ 211, -4 }, /* (20) cmd ::= SHOW CREATE DATABASE ids */ 210, /* (24) cmd ::= SHOW dbPrefix STABLES LIKE ids */
{ 211, -3 }, /* (21) cmd ::= SHOW dbPrefix TABLES */ 210, /* (25) cmd ::= SHOW dbPrefix VGROUPS */
{ 211, -5 }, /* (22) cmd ::= SHOW dbPrefix TABLES LIKE ids */ 210, /* (26) cmd ::= SHOW dbPrefix VGROUPS ids */
{ 211, -3 }, /* (23) cmd ::= SHOW dbPrefix STABLES */ 210, /* (27) cmd ::= DROP TABLE ifexists ids cpxName */
{ 211, -5 }, /* (24) cmd ::= SHOW dbPrefix STABLES LIKE ids */ 210, /* (28) cmd ::= DROP STABLE ifexists ids cpxName */
{ 211, -3 }, /* (25) cmd ::= SHOW dbPrefix VGROUPS */ 210, /* (29) cmd ::= DROP DATABASE ifexists ids */
{ 211, -4 }, /* (26) cmd ::= SHOW dbPrefix VGROUPS ids */ 210, /* (30) cmd ::= DROP DNODE ids */
{ 211, -5 }, /* (27) cmd ::= DROP TABLE ifexists ids cpxName */ 210, /* (31) cmd ::= DROP USER ids */
{ 211, -4 }, /* (28) cmd ::= DROP DATABASE ifexists ids */ 210, /* (32) cmd ::= DROP ACCOUNT ids */
{ 211, -3 }, /* (29) cmd ::= DROP DNODE ids */ 210, /* (33) cmd ::= USE ids */
{ 211, -3 }, /* (30) cmd ::= DROP USER ids */ 210, /* (34) cmd ::= DESCRIBE ids cpxName */
{ 211, -3 }, /* (31) cmd ::= DROP ACCOUNT ids */ 210, /* (35) cmd ::= ALTER USER ids PASS ids */
{ 211, -2 }, /* (32) cmd ::= USE ids */ 210, /* (36) cmd ::= ALTER USER ids PRIVILEGE ids */
{ 211, -3 }, /* (33) cmd ::= DESCRIBE ids cpxName */ 210, /* (37) cmd ::= ALTER DNODE ids ids */
{ 211, -5 }, /* (34) cmd ::= ALTER USER ids PASS ids */ 210, /* (38) cmd ::= ALTER DNODE ids ids ids */
{ 211, -5 }, /* (35) cmd ::= ALTER USER ids PRIVILEGE ids */ 210, /* (39) cmd ::= ALTER LOCAL ids */
{ 211, -4 }, /* (36) cmd ::= ALTER DNODE ids ids */ 210, /* (40) cmd ::= ALTER LOCAL ids ids */
{ 211, -5 }, /* (37) cmd ::= ALTER DNODE ids ids ids */ 210, /* (41) cmd ::= ALTER DATABASE ids alter_db_optr */
{ 211, -3 }, /* (38) cmd ::= ALTER LOCAL ids */ 210, /* (42) cmd ::= ALTER ACCOUNT ids acct_optr */
{ 211, -4 }, /* (39) cmd ::= ALTER LOCAL ids ids */ 210, /* (43) cmd ::= ALTER ACCOUNT ids PASS ids acct_optr */
{ 211, -4 }, /* (40) cmd ::= ALTER DATABASE ids alter_db_optr */ 212, /* (44) ids ::= ID */
{ 211, -4 }, /* (41) cmd ::= ALTER ACCOUNT ids acct_optr */ 212, /* (45) ids ::= STRING */
{ 211, -6 }, /* (42) cmd ::= ALTER ACCOUNT ids PASS ids acct_optr */ 214, /* (46) ifexists ::= IF EXISTS */
{ 213, -1 }, /* (43) ids ::= ID */ 214, /* (47) ifexists ::= */
{ 213, -1 }, /* (44) ids ::= STRING */ 217, /* (48) ifnotexists ::= IF NOT EXISTS */
{ 215, -2 }, /* (45) ifexists ::= IF EXISTS */ 217, /* (49) ifnotexists ::= */
{ 215, 0 }, /* (46) ifexists ::= */ 210, /* (50) cmd ::= CREATE DNODE ids */
{ 218, -3 }, /* (47) ifnotexists ::= IF NOT EXISTS */ 210, /* (51) cmd ::= CREATE ACCOUNT ids PASS ids acct_optr */
{ 218, 0 }, /* (48) ifnotexists ::= */ 210, /* (52) cmd ::= CREATE DATABASE ifnotexists ids db_optr */
{ 211, -3 }, /* (49) cmd ::= CREATE DNODE ids */ 210, /* (53) cmd ::= CREATE USER ids PASS ids */
{ 211, -6 }, /* (50) cmd ::= CREATE ACCOUNT ids PASS ids acct_optr */ 219, /* (54) pps ::= */
{ 211, -5 }, /* (51) cmd ::= CREATE DATABASE ifnotexists ids db_optr */ 219, /* (55) pps ::= PPS INTEGER */
{ 211, -5 }, /* (52) cmd ::= CREATE USER ids PASS ids */ 220, /* (56) tseries ::= */
{ 220, 0 }, /* (53) pps ::= */ 220, /* (57) tseries ::= TSERIES INTEGER */
{ 220, -2 }, /* (54) pps ::= PPS INTEGER */ 221, /* (58) dbs ::= */
{ 221, 0 }, /* (55) tseries ::= */ 221, /* (59) dbs ::= DBS INTEGER */
{ 221, -2 }, /* (56) tseries ::= TSERIES INTEGER */ 222, /* (60) streams ::= */
{ 222, 0 }, /* (57) dbs ::= */ 222, /* (61) streams ::= STREAMS INTEGER */
{ 222, -2 }, /* (58) dbs ::= DBS INTEGER */ 223, /* (62) storage ::= */
{ 223, 0 }, /* (59) streams ::= */ 223, /* (63) storage ::= STORAGE INTEGER */
{ 223, -2 }, /* (60) streams ::= STREAMS INTEGER */ 224, /* (64) qtime ::= */
{ 224, 0 }, /* (61) storage ::= */ 224, /* (65) qtime ::= QTIME INTEGER */
{ 224, -2 }, /* (62) storage ::= STORAGE INTEGER */ 225, /* (66) users ::= */
{ 225, 0 }, /* (63) qtime ::= */ 225, /* (67) users ::= USERS INTEGER */
{ 225, -2 }, /* (64) qtime ::= QTIME INTEGER */ 226, /* (68) conns ::= */
{ 226, 0 }, /* (65) users ::= */ 226, /* (69) conns ::= CONNS INTEGER */
{ 226, -2 }, /* (66) users ::= USERS INTEGER */ 227, /* (70) state ::= */
{ 227, 0 }, /* (67) conns ::= */ 227, /* (71) state ::= STATE ids */
{ 227, -2 }, /* (68) conns ::= CONNS INTEGER */ 216, /* (72) acct_optr ::= pps tseries storage streams qtime dbs users conns state */
{ 228, 0 }, /* (69) state ::= */ 228, /* (73) keep ::= KEEP tagitemlist */
{ 228, -2 }, /* (70) state ::= STATE ids */ 230, /* (74) cache ::= CACHE INTEGER */
{ 217, -9 }, /* (71) acct_optr ::= pps tseries storage streams qtime dbs users conns state */ 231, /* (75) replica ::= REPLICA INTEGER */
{ 229, -2 }, /* (72) keep ::= KEEP tagitemlist */ 232, /* (76) quorum ::= QUORUM INTEGER */
{ 231, -2 }, /* (73) cache ::= CACHE INTEGER */ 233, /* (77) days ::= DAYS INTEGER */
{ 232, -2 }, /* (74) replica ::= REPLICA INTEGER */ 234, /* (78) minrows ::= MINROWS INTEGER */
{ 233, -2 }, /* (75) quorum ::= QUORUM INTEGER */ 235, /* (79) maxrows ::= MAXROWS INTEGER */
{ 234, -2 }, /* (76) days ::= DAYS INTEGER */ 236, /* (80) blocks ::= BLOCKS INTEGER */
{ 235, -2 }, /* (77) minrows ::= MINROWS INTEGER */ 237, /* (81) ctime ::= CTIME INTEGER */
{ 236, -2 }, /* (78) maxrows ::= MAXROWS INTEGER */ 238, /* (82) wal ::= WAL INTEGER */
{ 237, -2 }, /* (79) blocks ::= BLOCKS INTEGER */ 239, /* (83) fsync ::= FSYNC INTEGER */
{ 238, -2 }, /* (80) ctime ::= CTIME INTEGER */ 240, /* (84) comp ::= COMP INTEGER */
{ 239, -2 }, /* (81) wal ::= WAL INTEGER */ 241, /* (85) prec ::= PRECISION STRING */
{ 240, -2 }, /* (82) fsync ::= FSYNC INTEGER */ 242, /* (86) update ::= UPDATE INTEGER */
{ 241, -2 }, /* (83) comp ::= COMP INTEGER */ 243, /* (87) cachelast ::= CACHELAST INTEGER */
{ 242, -2 }, /* (84) prec ::= PRECISION STRING */ 218, /* (88) db_optr ::= */
{ 243, -2 }, /* (85) update ::= UPDATE INTEGER */ 218, /* (89) db_optr ::= db_optr cache */
{ 244, -2 }, /* (86) cachelast ::= CACHELAST INTEGER */ 218, /* (90) db_optr ::= db_optr replica */
{ 219, 0 }, /* (87) db_optr ::= */ 218, /* (91) db_optr ::= db_optr quorum */
{ 219, -2 }, /* (88) db_optr ::= db_optr cache */ 218, /* (92) db_optr ::= db_optr days */
{ 219, -2 }, /* (89) db_optr ::= db_optr replica */ 218, /* (93) db_optr ::= db_optr minrows */
{ 219, -2 }, /* (90) db_optr ::= db_optr quorum */ 218, /* (94) db_optr ::= db_optr maxrows */
{ 219, -2 }, /* (91) db_optr ::= db_optr days */ 218, /* (95) db_optr ::= db_optr blocks */
{ 219, -2 }, /* (92) db_optr ::= db_optr minrows */ 218, /* (96) db_optr ::= db_optr ctime */
{ 219, -2 }, /* (93) db_optr ::= db_optr maxrows */ 218, /* (97) db_optr ::= db_optr wal */
{ 219, -2 }, /* (94) db_optr ::= db_optr blocks */ 218, /* (98) db_optr ::= db_optr fsync */
{ 219, -2 }, /* (95) db_optr ::= db_optr ctime */ 218, /* (99) db_optr ::= db_optr comp */
{ 219, -2 }, /* (96) db_optr ::= db_optr wal */ 218, /* (100) db_optr ::= db_optr prec */
{ 219, -2 }, /* (97) db_optr ::= db_optr fsync */ 218, /* (101) db_optr ::= db_optr keep */
{ 219, -2 }, /* (98) db_optr ::= db_optr comp */ 218, /* (102) db_optr ::= db_optr update */
{ 219, -2 }, /* (99) db_optr ::= db_optr prec */ 218, /* (103) db_optr ::= db_optr cachelast */
{ 219, -2 }, /* (100) db_optr ::= db_optr keep */ 215, /* (104) alter_db_optr ::= */
{ 219, -2 }, /* (101) db_optr ::= db_optr update */ 215, /* (105) alter_db_optr ::= alter_db_optr replica */
{ 219, -2 }, /* (102) db_optr ::= db_optr cachelast */ 215, /* (106) alter_db_optr ::= alter_db_optr quorum */
{ 216, 0 }, /* (103) alter_db_optr ::= */ 215, /* (107) alter_db_optr ::= alter_db_optr keep */
{ 216, -2 }, /* (104) alter_db_optr ::= alter_db_optr replica */ 215, /* (108) alter_db_optr ::= alter_db_optr blocks */
{ 216, -2 }, /* (105) alter_db_optr ::= alter_db_optr quorum */ 215, /* (109) alter_db_optr ::= alter_db_optr comp */
{ 216, -2 }, /* (106) alter_db_optr ::= alter_db_optr keep */ 215, /* (110) alter_db_optr ::= alter_db_optr wal */
{ 216, -2 }, /* (107) alter_db_optr ::= alter_db_optr blocks */ 215, /* (111) alter_db_optr ::= alter_db_optr fsync */
{ 216, -2 }, /* (108) alter_db_optr ::= alter_db_optr comp */ 215, /* (112) alter_db_optr ::= alter_db_optr update */
{ 216, -2 }, /* (109) alter_db_optr ::= alter_db_optr wal */ 215, /* (113) alter_db_optr ::= alter_db_optr cachelast */
{ 216, -2 }, /* (110) alter_db_optr ::= alter_db_optr fsync */ 244, /* (114) typename ::= ids */
{ 216, -2 }, /* (111) alter_db_optr ::= alter_db_optr update */ 244, /* (115) typename ::= ids LP signed RP */
{ 216, -2 }, /* (112) alter_db_optr ::= alter_db_optr cachelast */ 244, /* (116) typename ::= ids UNSIGNED */
{ 245, -1 }, /* (113) typename ::= ids */ 245, /* (117) signed ::= INTEGER */
{ 245, -4 }, /* (114) typename ::= ids LP signed RP */ 245, /* (118) signed ::= PLUS INTEGER */
{ 245, -2 }, /* (115) typename ::= ids UNSIGNED */ 245, /* (119) signed ::= MINUS INTEGER */
{ 246, -1 }, /* (116) signed ::= INTEGER */ 210, /* (120) cmd ::= CREATE TABLE create_table_args */
{ 246, -2 }, /* (117) signed ::= PLUS INTEGER */ 210, /* (121) cmd ::= CREATE TABLE create_stable_args */
{ 246, -2 }, /* (118) signed ::= MINUS INTEGER */ 210, /* (122) cmd ::= CREATE STABLE create_stable_args */
{ 211, -3 }, /* (119) cmd ::= CREATE TABLE create_table_args */ 210, /* (123) cmd ::= CREATE TABLE create_table_list */
{ 211, -3 }, /* (120) cmd ::= CREATE TABLE create_table_list */ 248, /* (124) create_table_list ::= create_from_stable */
{ 248, -1 }, /* (121) create_table_list ::= create_from_stable */ 248, /* (125) create_table_list ::= create_table_list create_from_stable */
{ 248, -2 }, /* (122) create_table_list ::= create_table_list create_from_stable */ 246, /* (126) create_table_args ::= ifnotexists ids cpxName LP columnlist RP */
{ 247, -6 }, /* (123) create_table_args ::= ifnotexists ids cpxName LP columnlist RP */ 247, /* (127) create_stable_args ::= ifnotexists ids cpxName LP columnlist RP TAGS LP columnlist RP */
{ 247, -10 }, /* (124) create_table_args ::= ifnotexists ids cpxName LP columnlist RP TAGS LP columnlist RP */ 249, /* (128) create_from_stable ::= ifnotexists ids cpxName USING ids cpxName TAGS LP tagitemlist RP */
{ 249, -10 }, /* (125) create_from_stable ::= ifnotexists ids cpxName USING ids cpxName TAGS LP tagitemlist RP */ 246, /* (129) create_table_args ::= ifnotexists ids cpxName AS select */
{ 247, -5 }, /* (126) create_table_args ::= ifnotexists ids cpxName AS select */ 250, /* (130) columnlist ::= columnlist COMMA column */
{ 250, -3 }, /* (127) columnlist ::= columnlist COMMA column */ 250, /* (131) columnlist ::= column */
{ 250, -1 }, /* (128) columnlist ::= column */ 252, /* (132) column ::= ids typename */
{ 252, -2 }, /* (129) column ::= ids typename */ 229, /* (133) tagitemlist ::= tagitemlist COMMA tagitem */
{ 230, -3 }, /* (130) tagitemlist ::= tagitemlist COMMA tagitem */ 229, /* (134) tagitemlist ::= tagitem */
{ 230, -1 }, /* (131) tagitemlist ::= tagitem */ 253, /* (135) tagitem ::= INTEGER */
{ 253, -1 }, /* (132) tagitem ::= INTEGER */ 253, /* (136) tagitem ::= FLOAT */
{ 253, -1 }, /* (133) tagitem ::= FLOAT */ 253, /* (137) tagitem ::= STRING */
{ 253, -1 }, /* (134) tagitem ::= STRING */ 253, /* (138) tagitem ::= BOOL */
{ 253, -1 }, /* (135) tagitem ::= BOOL */ 253, /* (139) tagitem ::= NULL */
{ 253, -1 }, /* (136) tagitem ::= NULL */ 253, /* (140) tagitem ::= MINUS INTEGER */
{ 253, -2 }, /* (137) tagitem ::= MINUS INTEGER */ 253, /* (141) tagitem ::= MINUS FLOAT */
{ 253, -2 }, /* (138) tagitem ::= MINUS FLOAT */ 253, /* (142) tagitem ::= PLUS INTEGER */
{ 253, -2 }, /* (139) tagitem ::= PLUS INTEGER */ 253, /* (143) tagitem ::= PLUS FLOAT */
{ 253, -2 }, /* (140) tagitem ::= PLUS FLOAT */ 251, /* (144) select ::= SELECT selcollist from where_opt interval_opt fill_opt sliding_opt groupby_opt orderby_opt having_opt slimit_opt limit_opt */
{ 251, -12 }, /* (141) select ::= SELECT selcollist from where_opt interval_opt fill_opt sliding_opt groupby_opt orderby_opt having_opt slimit_opt limit_opt */ 265, /* (145) union ::= select */
{ 265, -1 }, /* (142) union ::= select */ 265, /* (146) union ::= LP union RP */
{ 265, -3 }, /* (143) union ::= LP union RP */ 265, /* (147) union ::= union UNION ALL select */
{ 265, -4 }, /* (144) union ::= union UNION ALL select */ 265, /* (148) union ::= union UNION ALL LP select RP */
{ 265, -6 }, /* (145) union ::= union UNION ALL LP select RP */ 210, /* (149) cmd ::= union */
{ 211, -1 }, /* (146) cmd ::= union */ 251, /* (150) select ::= SELECT selcollist */
{ 251, -2 }, /* (147) select ::= SELECT selcollist */ 266, /* (151) sclp ::= selcollist COMMA */
{ 266, -2 }, /* (148) sclp ::= selcollist COMMA */ 266, /* (152) sclp ::= */
{ 266, 0 }, /* (149) sclp ::= */ 254, /* (153) selcollist ::= sclp expr as */
{ 254, -3 }, /* (150) selcollist ::= sclp expr as */ 254, /* (154) selcollist ::= sclp STAR */
{ 254, -2 }, /* (151) selcollist ::= sclp STAR */ 268, /* (155) as ::= AS ids */
{ 268, -2 }, /* (152) as ::= AS ids */ 268, /* (156) as ::= ids */
{ 268, -1 }, /* (153) as ::= ids */ 268, /* (157) as ::= */
{ 268, 0 }, /* (154) as ::= */ 255, /* (158) from ::= FROM tablelist */
{ 255, -2 }, /* (155) from ::= FROM tablelist */ 269, /* (159) tablelist ::= ids cpxName */
{ 269, -2 }, /* (156) tablelist ::= ids cpxName */ 269, /* (160) tablelist ::= ids cpxName ids */
{ 269, -3 }, /* (157) tablelist ::= ids cpxName ids */ 269, /* (161) tablelist ::= tablelist COMMA ids cpxName */
{ 269, -4 }, /* (158) tablelist ::= tablelist COMMA ids cpxName */ 269, /* (162) tablelist ::= tablelist COMMA ids cpxName ids */
{ 269, -5 }, /* (159) tablelist ::= tablelist COMMA ids cpxName ids */ 270, /* (163) tmvar ::= VARIABLE */
{ 270, -1 }, /* (160) tmvar ::= VARIABLE */ 257, /* (164) interval_opt ::= INTERVAL LP tmvar RP */
{ 257, -4 }, /* (161) interval_opt ::= INTERVAL LP tmvar RP */ 257, /* (165) interval_opt ::= INTERVAL LP tmvar COMMA tmvar RP */
{ 257, -6 }, /* (162) interval_opt ::= INTERVAL LP tmvar COMMA tmvar RP */ 257, /* (166) interval_opt ::= */
{ 257, 0 }, /* (163) interval_opt ::= */ 258, /* (167) fill_opt ::= */
{ 258, 0 }, /* (164) fill_opt ::= */ 258, /* (168) fill_opt ::= FILL LP ID COMMA tagitemlist RP */
{ 258, -6 }, /* (165) fill_opt ::= FILL LP ID COMMA tagitemlist RP */ 258, /* (169) fill_opt ::= FILL LP ID RP */
{ 258, -4 }, /* (166) fill_opt ::= FILL LP ID RP */ 259, /* (170) sliding_opt ::= SLIDING LP tmvar RP */
{ 259, -4 }, /* (167) sliding_opt ::= SLIDING LP tmvar RP */ 259, /* (171) sliding_opt ::= */
{ 259, 0 }, /* (168) sliding_opt ::= */ 261, /* (172) orderby_opt ::= */
{ 261, 0 }, /* (169) orderby_opt ::= */ 261, /* (173) orderby_opt ::= ORDER BY sortlist */
{ 261, -3 }, /* (170) orderby_opt ::= ORDER BY sortlist */ 271, /* (174) sortlist ::= sortlist COMMA item sortorder */
{ 271, -4 }, /* (171) sortlist ::= sortlist COMMA item sortorder */ 271, /* (175) sortlist ::= item sortorder */
{ 271, -2 }, /* (172) sortlist ::= item sortorder */ 273, /* (176) item ::= ids cpxName */
{ 273, -2 }, /* (173) item ::= ids cpxName */ 274, /* (177) sortorder ::= ASC */
{ 274, -1 }, /* (174) sortorder ::= ASC */ 274, /* (178) sortorder ::= DESC */
{ 274, -1 }, /* (175) sortorder ::= DESC */ 274, /* (179) sortorder ::= */
{ 274, 0 }, /* (176) sortorder ::= */ 260, /* (180) groupby_opt ::= */
{ 260, 0 }, /* (177) groupby_opt ::= */ 260, /* (181) groupby_opt ::= GROUP BY grouplist */
{ 260, -3 }, /* (178) groupby_opt ::= GROUP BY grouplist */ 275, /* (182) grouplist ::= grouplist COMMA item */
{ 275, -3 }, /* (179) grouplist ::= grouplist COMMA item */ 275, /* (183) grouplist ::= item */
{ 275, -1 }, /* (180) grouplist ::= item */ 262, /* (184) having_opt ::= */
{ 262, 0 }, /* (181) having_opt ::= */ 262, /* (185) having_opt ::= HAVING expr */
{ 262, -2 }, /* (182) having_opt ::= HAVING expr */ 264, /* (186) limit_opt ::= */
{ 264, 0 }, /* (183) limit_opt ::= */ 264, /* (187) limit_opt ::= LIMIT signed */
{ 264, -2 }, /* (184) limit_opt ::= LIMIT signed */ 264, /* (188) limit_opt ::= LIMIT signed OFFSET signed */
{ 264, -4 }, /* (185) limit_opt ::= LIMIT signed OFFSET signed */ 264, /* (189) limit_opt ::= LIMIT signed COMMA signed */
{ 264, -4 }, /* (186) limit_opt ::= LIMIT signed COMMA signed */ 263, /* (190) slimit_opt ::= */
{ 263, 0 }, /* (187) slimit_opt ::= */ 263, /* (191) slimit_opt ::= SLIMIT signed */
{ 263, -2 }, /* (188) slimit_opt ::= SLIMIT signed */ 263, /* (192) slimit_opt ::= SLIMIT signed SOFFSET signed */
{ 263, -4 }, /* (189) slimit_opt ::= SLIMIT signed SOFFSET signed */ 263, /* (193) slimit_opt ::= SLIMIT signed COMMA signed */
{ 263, -4 }, /* (190) slimit_opt ::= SLIMIT signed COMMA signed */ 256, /* (194) where_opt ::= */
{ 256, 0 }, /* (191) where_opt ::= */ 256, /* (195) where_opt ::= WHERE expr */
{ 256, -2 }, /* (192) where_opt ::= WHERE expr */ 267, /* (196) expr ::= LP expr RP */
{ 267, -3 }, /* (193) expr ::= LP expr RP */ 267, /* (197) expr ::= ID */
{ 267, -1 }, /* (194) expr ::= ID */ 267, /* (198) expr ::= ID DOT ID */
{ 267, -3 }, /* (195) expr ::= ID DOT ID */ 267, /* (199) expr ::= ID DOT STAR */
{ 267, -3 }, /* (196) expr ::= ID DOT STAR */ 267, /* (200) expr ::= INTEGER */
{ 267, -1 }, /* (197) expr ::= INTEGER */ 267, /* (201) expr ::= MINUS INTEGER */
{ 267, -2 }, /* (198) expr ::= MINUS INTEGER */ 267, /* (202) expr ::= PLUS INTEGER */
{ 267, -2 }, /* (199) expr ::= PLUS INTEGER */ 267, /* (203) expr ::= FLOAT */
{ 267, -1 }, /* (200) expr ::= FLOAT */ 267, /* (204) expr ::= MINUS FLOAT */
{ 267, -2 }, /* (201) expr ::= MINUS FLOAT */ 267, /* (205) expr ::= PLUS FLOAT */
{ 267, -2 }, /* (202) expr ::= PLUS FLOAT */ 267, /* (206) expr ::= STRING */
{ 267, -1 }, /* (203) expr ::= STRING */ 267, /* (207) expr ::= NOW */
{ 267, -1 }, /* (204) expr ::= NOW */ 267, /* (208) expr ::= VARIABLE */
{ 267, -1 }, /* (205) expr ::= VARIABLE */ 267, /* (209) expr ::= BOOL */
{ 267, -1 }, /* (206) expr ::= BOOL */ 267, /* (210) expr ::= ID LP exprlist RP */
{ 267, -4 }, /* (207) expr ::= ID LP exprlist RP */ 267, /* (211) expr ::= ID LP STAR RP */
{ 267, -4 }, /* (208) expr ::= ID LP STAR RP */ 267, /* (212) expr ::= expr IS NULL */
{ 267, -3 }, /* (209) expr ::= expr IS NULL */ 267, /* (213) expr ::= expr IS NOT NULL */
{ 267, -4 }, /* (210) expr ::= expr IS NOT NULL */ 267, /* (214) expr ::= expr LT expr */
{ 267, -3 }, /* (211) expr ::= expr LT expr */ 267, /* (215) expr ::= expr GT expr */
{ 267, -3 }, /* (212) expr ::= expr GT expr */ 267, /* (216) expr ::= expr LE expr */
{ 267, -3 }, /* (213) expr ::= expr LE expr */ 267, /* (217) expr ::= expr GE expr */
{ 267, -3 }, /* (214) expr ::= expr GE expr */ 267, /* (218) expr ::= expr NE expr */
{ 267, -3 }, /* (215) expr ::= expr NE expr */ 267, /* (219) expr ::= expr EQ expr */
{ 267, -3 }, /* (216) expr ::= expr EQ expr */ 267, /* (220) expr ::= expr AND expr */
{ 267, -3 }, /* (217) expr ::= expr AND expr */ 267, /* (221) expr ::= expr OR expr */
{ 267, -3 }, /* (218) expr ::= expr OR expr */ 267, /* (222) expr ::= expr PLUS expr */
{ 267, -3 }, /* (219) expr ::= expr PLUS expr */ 267, /* (223) expr ::= expr MINUS expr */
{ 267, -3 }, /* (220) expr ::= expr MINUS expr */ 267, /* (224) expr ::= expr STAR expr */
{ 267, -3 }, /* (221) expr ::= expr STAR expr */ 267, /* (225) expr ::= expr SLASH expr */
{ 267, -3 }, /* (222) expr ::= expr SLASH expr */ 267, /* (226) expr ::= expr REM expr */
{ 267, -3 }, /* (223) expr ::= expr REM expr */ 267, /* (227) expr ::= expr LIKE expr */
{ 267, -3 }, /* (224) expr ::= expr LIKE expr */ 267, /* (228) expr ::= expr IN LP exprlist RP */
{ 267, -5 }, /* (225) expr ::= expr IN LP exprlist RP */ 276, /* (229) exprlist ::= exprlist COMMA expritem */
{ 276, -3 }, /* (226) exprlist ::= exprlist COMMA expritem */ 276, /* (230) exprlist ::= expritem */
{ 276, -1 }, /* (227) exprlist ::= expritem */ 277, /* (231) expritem ::= expr */
{ 277, -1 }, /* (228) expritem ::= expr */ 277, /* (232) expritem ::= */
{ 277, 0 }, /* (229) expritem ::= */ 210, /* (233) cmd ::= RESET QUERY CACHE */
{ 211, -3 }, /* (230) cmd ::= RESET QUERY CACHE */ 210, /* (234) cmd ::= ALTER TABLE ids cpxName ADD COLUMN columnlist */
{ 211, -7 }, /* (231) cmd ::= ALTER TABLE ids cpxName ADD COLUMN columnlist */ 210, /* (235) cmd ::= ALTER TABLE ids cpxName DROP COLUMN ids */
{ 211, -7 }, /* (232) cmd ::= ALTER TABLE ids cpxName DROP COLUMN ids */ 210, /* (236) cmd ::= ALTER TABLE ids cpxName ADD TAG columnlist */
{ 211, -7 }, /* (233) cmd ::= ALTER TABLE ids cpxName ADD TAG columnlist */ 210, /* (237) cmd ::= ALTER TABLE ids cpxName DROP TAG ids */
{ 211, -7 }, /* (234) cmd ::= ALTER TABLE ids cpxName DROP TAG ids */ 210, /* (238) cmd ::= ALTER TABLE ids cpxName CHANGE TAG ids ids */
{ 211, -8 }, /* (235) cmd ::= ALTER TABLE ids cpxName CHANGE TAG ids ids */ 210, /* (239) cmd ::= ALTER TABLE ids cpxName SET TAG ids EQ tagitem */
{ 211, -9 }, /* (236) cmd ::= ALTER TABLE ids cpxName SET TAG ids EQ tagitem */ 210, /* (240) cmd ::= ALTER STABLE ids cpxName ADD COLUMN columnlist */
{ 211, -3 }, /* (237) cmd ::= KILL CONNECTION INTEGER */ 210, /* (241) cmd ::= ALTER STABLE ids cpxName DROP COLUMN ids */
{ 211, -5 }, /* (238) cmd ::= KILL STREAM INTEGER COLON INTEGER */ 210, /* (242) cmd ::= ALTER STABLE ids cpxName ADD TAG columnlist */
{ 211, -5 }, /* (239) cmd ::= KILL QUERY INTEGER COLON INTEGER */ 210, /* (243) cmd ::= ALTER STABLE ids cpxName DROP TAG ids */
210, /* (244) cmd ::= ALTER STABLE ids cpxName CHANGE TAG ids ids */
210, /* (245) cmd ::= KILL CONNECTION INTEGER */
210, /* (246) cmd ::= KILL STREAM INTEGER COLON INTEGER */
210, /* (247) 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 MNODES */
-2, /* (3) cmd ::= SHOW DNODES */
-2, /* (4) cmd ::= SHOW ACCOUNTS */
-2, /* (5) cmd ::= SHOW USERS */
-2, /* (6) cmd ::= SHOW MODULES */
-2, /* (7) cmd ::= SHOW QUERIES */
-2, /* (8) cmd ::= SHOW CONNECTIONS */
-2, /* (9) cmd ::= SHOW STREAMS */
-2, /* (10) cmd ::= SHOW VARIABLES */
-2, /* (11) cmd ::= SHOW SCORES */
-2, /* (12) cmd ::= SHOW GRANTS */
-2, /* (13) cmd ::= SHOW VNODES */
-3, /* (14) cmd ::= SHOW VNODES IPTOKEN */
0, /* (15) dbPrefix ::= */
-2, /* (16) dbPrefix ::= ids DOT */
0, /* (17) cpxName ::= */
-2, /* (18) cpxName ::= DOT ids */
-5, /* (19) cmd ::= SHOW CREATE TABLE ids cpxName */
-4, /* (20) cmd ::= SHOW CREATE DATABASE ids */
-3, /* (21) cmd ::= SHOW dbPrefix TABLES */
-5, /* (22) cmd ::= SHOW dbPrefix TABLES LIKE ids */
-3, /* (23) cmd ::= SHOW dbPrefix STABLES */
-5, /* (24) cmd ::= SHOW dbPrefix STABLES LIKE ids */
-3, /* (25) cmd ::= SHOW dbPrefix VGROUPS */
-4, /* (26) cmd ::= SHOW dbPrefix VGROUPS ids */
-5, /* (27) cmd ::= DROP TABLE ifexists ids cpxName */
-5, /* (28) cmd ::= DROP STABLE ifexists ids cpxName */
-4, /* (29) cmd ::= DROP DATABASE ifexists ids */
-3, /* (30) cmd ::= DROP DNODE ids */
-3, /* (31) cmd ::= DROP USER ids */
-3, /* (32) cmd ::= DROP ACCOUNT ids */
-2, /* (33) cmd ::= USE ids */
-3, /* (34) cmd ::= DESCRIBE ids cpxName */
-5, /* (35) cmd ::= ALTER USER ids PASS ids */
-5, /* (36) cmd ::= ALTER USER ids PRIVILEGE ids */
-4, /* (37) cmd ::= ALTER DNODE ids ids */
-5, /* (38) cmd ::= ALTER DNODE ids ids ids */
-3, /* (39) cmd ::= ALTER LOCAL ids */
-4, /* (40) cmd ::= ALTER LOCAL ids ids */
-4, /* (41) cmd ::= ALTER DATABASE ids alter_db_optr */
-4, /* (42) cmd ::= ALTER ACCOUNT ids acct_optr */
-6, /* (43) cmd ::= ALTER ACCOUNT ids PASS ids acct_optr */
-1, /* (44) ids ::= ID */
-1, /* (45) ids ::= STRING */
-2, /* (46) ifexists ::= IF EXISTS */
0, /* (47) ifexists ::= */
-3, /* (48) ifnotexists ::= IF NOT EXISTS */
0, /* (49) ifnotexists ::= */
-3, /* (50) cmd ::= CREATE DNODE ids */
-6, /* (51) cmd ::= CREATE ACCOUNT ids PASS ids acct_optr */
-5, /* (52) cmd ::= CREATE DATABASE ifnotexists ids db_optr */
-5, /* (53) cmd ::= CREATE USER ids PASS ids */
0, /* (54) pps ::= */
-2, /* (55) pps ::= PPS INTEGER */
0, /* (56) tseries ::= */
-2, /* (57) tseries ::= TSERIES INTEGER */
0, /* (58) dbs ::= */
-2, /* (59) dbs ::= DBS INTEGER */
0, /* (60) streams ::= */
-2, /* (61) streams ::= STREAMS INTEGER */
0, /* (62) storage ::= */
-2, /* (63) storage ::= STORAGE INTEGER */
0, /* (64) qtime ::= */
-2, /* (65) qtime ::= QTIME INTEGER */
0, /* (66) users ::= */
-2, /* (67) users ::= USERS INTEGER */
0, /* (68) conns ::= */
-2, /* (69) conns ::= CONNS INTEGER */
0, /* (70) state ::= */
-2, /* (71) state ::= STATE ids */
-9, /* (72) acct_optr ::= pps tseries storage streams qtime dbs users conns state */
-2, /* (73) keep ::= KEEP tagitemlist */
-2, /* (74) cache ::= CACHE INTEGER */
-2, /* (75) replica ::= REPLICA INTEGER */
-2, /* (76) quorum ::= QUORUM INTEGER */
-2, /* (77) days ::= DAYS INTEGER */
-2, /* (78) minrows ::= MINROWS INTEGER */
-2, /* (79) maxrows ::= MAXROWS INTEGER */
-2, /* (80) blocks ::= BLOCKS INTEGER */
-2, /* (81) ctime ::= CTIME INTEGER */
-2, /* (82) wal ::= WAL INTEGER */
-2, /* (83) fsync ::= FSYNC INTEGER */
-2, /* (84) comp ::= COMP INTEGER */
-2, /* (85) prec ::= PRECISION STRING */
-2, /* (86) update ::= UPDATE INTEGER */
-2, /* (87) cachelast ::= CACHELAST INTEGER */
0, /* (88) db_optr ::= */
-2, /* (89) db_optr ::= db_optr cache */
-2, /* (90) db_optr ::= db_optr replica */
-2, /* (91) db_optr ::= db_optr quorum */
-2, /* (92) db_optr ::= db_optr days */
-2, /* (93) db_optr ::= db_optr minrows */
-2, /* (94) db_optr ::= db_optr maxrows */
-2, /* (95) db_optr ::= db_optr blocks */
-2, /* (96) db_optr ::= db_optr ctime */
-2, /* (97) db_optr ::= db_optr wal */
-2, /* (98) db_optr ::= db_optr fsync */
-2, /* (99) db_optr ::= db_optr comp */
-2, /* (100) db_optr ::= db_optr prec */
-2, /* (101) db_optr ::= db_optr keep */
-2, /* (102) db_optr ::= db_optr update */
-2, /* (103) db_optr ::= db_optr cachelast */
0, /* (104) alter_db_optr ::= */
-2, /* (105) alter_db_optr ::= alter_db_optr replica */
-2, /* (106) alter_db_optr ::= alter_db_optr quorum */
-2, /* (107) alter_db_optr ::= alter_db_optr keep */
-2, /* (108) alter_db_optr ::= alter_db_optr blocks */
-2, /* (109) alter_db_optr ::= alter_db_optr comp */
-2, /* (110) alter_db_optr ::= alter_db_optr wal */
-2, /* (111) alter_db_optr ::= alter_db_optr fsync */
-2, /* (112) alter_db_optr ::= alter_db_optr update */
-2, /* (113) alter_db_optr ::= alter_db_optr cachelast */
-1, /* (114) typename ::= ids */
-4, /* (115) typename ::= ids LP signed RP */
-2, /* (116) typename ::= ids UNSIGNED */
-1, /* (117) signed ::= INTEGER */
-2, /* (118) signed ::= PLUS INTEGER */
-2, /* (119) signed ::= MINUS INTEGER */
-3, /* (120) cmd ::= CREATE TABLE create_table_args */
-3, /* (121) cmd ::= CREATE TABLE create_stable_args */
-3, /* (122) cmd ::= CREATE STABLE create_stable_args */
-3, /* (123) cmd ::= CREATE TABLE create_table_list */
-1, /* (124) create_table_list ::= create_from_stable */
-2, /* (125) create_table_list ::= create_table_list create_from_stable */
-6, /* (126) create_table_args ::= ifnotexists ids cpxName LP columnlist RP */
-10, /* (127) create_stable_args ::= ifnotexists ids cpxName LP columnlist RP TAGS LP columnlist RP */
-10, /* (128) create_from_stable ::= ifnotexists ids cpxName USING ids cpxName TAGS LP tagitemlist RP */
-5, /* (129) create_table_args ::= ifnotexists ids cpxName AS select */
-3, /* (130) columnlist ::= columnlist COMMA column */
-1, /* (131) columnlist ::= column */
-2, /* (132) column ::= ids typename */
-3, /* (133) tagitemlist ::= tagitemlist COMMA tagitem */
-1, /* (134) tagitemlist ::= tagitem */
-1, /* (135) tagitem ::= INTEGER */
-1, /* (136) tagitem ::= FLOAT */
-1, /* (137) tagitem ::= STRING */
-1, /* (138) tagitem ::= BOOL */
-1, /* (139) tagitem ::= NULL */
-2, /* (140) tagitem ::= MINUS INTEGER */
-2, /* (141) tagitem ::= MINUS FLOAT */
-2, /* (142) tagitem ::= PLUS INTEGER */
-2, /* (143) tagitem ::= PLUS FLOAT */
-12, /* (144) select ::= SELECT selcollist from where_opt interval_opt fill_opt sliding_opt groupby_opt orderby_opt having_opt slimit_opt limit_opt */
-1, /* (145) union ::= select */
-3, /* (146) union ::= LP union RP */
-4, /* (147) union ::= union UNION ALL select */
-6, /* (148) union ::= union UNION ALL LP select RP */
-1, /* (149) cmd ::= union */
-2, /* (150) select ::= SELECT selcollist */
-2, /* (151) sclp ::= selcollist COMMA */
0, /* (152) sclp ::= */
-3, /* (153) selcollist ::= sclp expr as */
-2, /* (154) selcollist ::= sclp STAR */
-2, /* (155) as ::= AS ids */
-1, /* (156) as ::= ids */
0, /* (157) as ::= */
-2, /* (158) from ::= FROM tablelist */
-2, /* (159) tablelist ::= ids cpxName */
-3, /* (160) tablelist ::= ids cpxName ids */
-4, /* (161) tablelist ::= tablelist COMMA ids cpxName */
-5, /* (162) tablelist ::= tablelist COMMA ids cpxName ids */
-1, /* (163) tmvar ::= VARIABLE */
-4, /* (164) interval_opt ::= INTERVAL LP tmvar RP */
-6, /* (165) interval_opt ::= INTERVAL LP tmvar COMMA tmvar RP */
0, /* (166) interval_opt ::= */
0, /* (167) fill_opt ::= */
-6, /* (168) fill_opt ::= FILL LP ID COMMA tagitemlist RP */
-4, /* (169) fill_opt ::= FILL LP ID RP */
-4, /* (170) sliding_opt ::= SLIDING LP tmvar RP */
0, /* (171) sliding_opt ::= */
0, /* (172) orderby_opt ::= */
-3, /* (173) orderby_opt ::= ORDER BY sortlist */
-4, /* (174) sortlist ::= sortlist COMMA item sortorder */
-2, /* (175) sortlist ::= item sortorder */
-2, /* (176) item ::= ids cpxName */
-1, /* (177) sortorder ::= ASC */
-1, /* (178) sortorder ::= DESC */
0, /* (179) sortorder ::= */
0, /* (180) groupby_opt ::= */
-3, /* (181) groupby_opt ::= GROUP BY grouplist */
-3, /* (182) grouplist ::= grouplist COMMA item */
-1, /* (183) grouplist ::= item */
0, /* (184) having_opt ::= */
-2, /* (185) having_opt ::= HAVING expr */
0, /* (186) limit_opt ::= */
-2, /* (187) limit_opt ::= LIMIT signed */
-4, /* (188) limit_opt ::= LIMIT signed OFFSET signed */
-4, /* (189) limit_opt ::= LIMIT signed COMMA signed */
0, /* (190) slimit_opt ::= */
-2, /* (191) slimit_opt ::= SLIMIT signed */
-4, /* (192) slimit_opt ::= SLIMIT signed SOFFSET signed */
-4, /* (193) slimit_opt ::= SLIMIT signed COMMA signed */
0, /* (194) where_opt ::= */
-2, /* (195) where_opt ::= WHERE expr */
-3, /* (196) expr ::= LP expr RP */
-1, /* (197) expr ::= ID */
-3, /* (198) expr ::= ID DOT ID */
-3, /* (199) expr ::= ID DOT STAR */
-1, /* (200) expr ::= INTEGER */
-2, /* (201) expr ::= MINUS INTEGER */
-2, /* (202) expr ::= PLUS INTEGER */
-1, /* (203) expr ::= FLOAT */
-2, /* (204) expr ::= MINUS FLOAT */
-2, /* (205) expr ::= PLUS FLOAT */
-1, /* (206) expr ::= STRING */
-1, /* (207) expr ::= NOW */
-1, /* (208) expr ::= VARIABLE */
-1, /* (209) expr ::= BOOL */
-4, /* (210) expr ::= ID LP exprlist RP */
-4, /* (211) expr ::= ID LP STAR RP */
-3, /* (212) expr ::= expr IS NULL */
-4, /* (213) expr ::= expr IS NOT NULL */
-3, /* (214) expr ::= expr LT expr */
-3, /* (215) expr ::= expr GT expr */
-3, /* (216) expr ::= expr LE expr */
-3, /* (217) expr ::= expr GE expr */
-3, /* (218) expr ::= expr NE expr */
-3, /* (219) expr ::= expr EQ expr */
-3, /* (220) expr ::= expr AND expr */
-3, /* (221) expr ::= expr OR expr */
-3, /* (222) expr ::= expr PLUS expr */
-3, /* (223) expr ::= expr MINUS expr */
-3, /* (224) expr ::= expr STAR expr */
-3, /* (225) expr ::= expr SLASH expr */
-3, /* (226) expr ::= expr REM expr */
-3, /* (227) expr ::= expr LIKE expr */
-5, /* (228) expr ::= expr IN LP exprlist RP */
-3, /* (229) exprlist ::= exprlist COMMA expritem */
-1, /* (230) exprlist ::= expritem */
-1, /* (231) expritem ::= expr */
0, /* (232) expritem ::= */
-3, /* (233) cmd ::= RESET QUERY CACHE */
-7, /* (234) cmd ::= ALTER TABLE ids cpxName ADD COLUMN columnlist */
-7, /* (235) cmd ::= ALTER TABLE ids cpxName DROP COLUMN ids */
-7, /* (236) cmd ::= ALTER TABLE ids cpxName ADD TAG columnlist */
-7, /* (237) cmd ::= ALTER TABLE ids cpxName DROP TAG ids */
-8, /* (238) cmd ::= ALTER TABLE ids cpxName CHANGE TAG ids ids */
-9, /* (239) cmd ::= ALTER TABLE ids cpxName SET TAG ids EQ tagitem */
-7, /* (240) cmd ::= ALTER STABLE ids cpxName ADD COLUMN columnlist */
-7, /* (241) cmd ::= ALTER STABLE ids cpxName DROP COLUMN ids */
-7, /* (242) cmd ::= ALTER STABLE ids cpxName ADD TAG columnlist */
-7, /* (243) cmd ::= ALTER STABLE ids cpxName DROP TAG ids */
-8, /* (244) cmd ::= ALTER STABLE ids cpxName CHANGE TAG ids ids */
-3, /* (245) cmd ::= KILL CONNECTION INTEGER */
-5, /* (246) cmd ::= KILL STREAM INTEGER COLON INTEGER */
-5, /* (247) cmd ::= KILL QUERY INTEGER COLON INTEGER */
}; };
static void yy_accept(yyParser*); /* Forward Declaration */ static void yy_accept(yyParser*); /* Forward Declaration */
...@@ -1976,30 +2272,34 @@ static void yy_accept(yyParser*); /* Forward Declaration */ ...@@ -1976,30 +2272,34 @@ static void yy_accept(yyParser*); /* Forward Declaration */
** only called from one place, optimizing compilers will in-line it, which ** only called from one place, optimizing compilers will in-line it, which
** means that the extra parameters have no performance impact. ** means that the extra parameters have no performance impact.
*/ */
static void yy_reduce( static YYACTIONTYPE yy_reduce(
yyParser *yypParser, /* The parser */ yyParser *yypParser, /* The parser */
unsigned int yyruleno, /* Number of the rule by which to reduce */ unsigned int yyruleno, /* Number of the rule by which to reduce */
int yyLookahead, /* Lookahead token, or YYNOCODE if none */ int yyLookahead, /* Lookahead token, or YYNOCODE if none */
ParseTOKENTYPE yyLookaheadToken /* Value of the lookahead token */ ParseTOKENTYPE yyLookaheadToken /* Value of the lookahead token */
ParseCTX_PDECL /* %extra_context */
){ ){
int yygoto; /* The next state */ int yygoto; /* The next state */
int yyact; /* The next action */ YYACTIONTYPE yyact; /* The next action */
yyStackEntry *yymsp; /* The top of the parser's stack */ yyStackEntry *yymsp; /* The top of the parser's stack */
int yysize; /* Amount to pop the stack */ int yysize; /* Amount to pop the stack */
ParseARG_FETCH; ParseARG_FETCH
(void)yyLookahead; (void)yyLookahead;
(void)yyLookaheadToken; (void)yyLookaheadToken;
yymsp = yypParser->yytos; yymsp = yypParser->yytos;
#ifndef NDEBUG #ifndef NDEBUG
if( yyTraceFILE && yyruleno<(int)(sizeof(yyRuleName)/sizeof(yyRuleName[0])) ){ if( yyTraceFILE && yyruleno<(int)(sizeof(yyRuleName)/sizeof(yyRuleName[0])) ){
yysize = yyRuleInfo[yyruleno].nrhs; yysize = yyRuleInfoNRhs[yyruleno];
if( yysize ){ if( yysize ){
fprintf(yyTraceFILE, "%sReduce %d [%s], go to state %d.\n", fprintf(yyTraceFILE, "%sReduce %d [%s]%s, pop back to state %d.\n",
yyTracePrompt, yyTracePrompt,
yyruleno, yyRuleName[yyruleno], yymsp[yysize].stateno); yyruleno, yyRuleName[yyruleno],
yyruleno<YYNRULE_WITH_ACTION ? "" : " without external action",
yymsp[yysize].stateno);
}else{ }else{
fprintf(yyTraceFILE, "%sReduce %d [%s].\n", fprintf(yyTraceFILE, "%sReduce %d [%s]%s.\n",
yyTracePrompt, yyruleno, yyRuleName[yyruleno]); yyTracePrompt, yyruleno, yyRuleName[yyruleno],
yyruleno<YYNRULE_WITH_ACTION ? "" : " without external action");
} }
} }
#endif /* NDEBUG */ #endif /* NDEBUG */
...@@ -2007,7 +2307,7 @@ static void yy_reduce( ...@@ -2007,7 +2307,7 @@ static void yy_reduce(
/* Check that the stack is large enough to grow by a single entry /* 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 ** if the RHS of the rule is empty. This ensures that there is room
** enough on the stack to push the LHS value */ ** enough on the stack to push the LHS value */
if( yyRuleInfo[yyruleno].nrhs==0 ){ if( yyRuleInfoNRhs[yyruleno]==0 ){
#ifdef YYTRACKMAXSTACKDEPTH #ifdef YYTRACKMAXSTACKDEPTH
if( (int)(yypParser->yytos - yypParser->yystack)>yypParser->yyhwm ){ if( (int)(yypParser->yytos - yypParser->yystack)>yypParser->yyhwm ){
yypParser->yyhwm++; yypParser->yyhwm++;
...@@ -2017,13 +2317,19 @@ static void yy_reduce( ...@@ -2017,13 +2317,19 @@ static void yy_reduce(
#if YYSTACKDEPTH>0 #if YYSTACKDEPTH>0
if( yypParser->yytos>=yypParser->yystackEnd ){ if( yypParser->yytos>=yypParser->yystackEnd ){
yyStackOverflow(yypParser); yyStackOverflow(yypParser);
return; /* The call to yyStackOverflow() above pops the stack until it is
** empty, causing the main parser loop to exit. So the return value
** is never used and does not matter. */
return 0;
} }
#else #else
if( yypParser->yytos>=&yypParser->yystack[yypParser->yystksz-1] ){ if( yypParser->yytos>=&yypParser->yystack[yypParser->yystksz-1] ){
if( yyGrowStack(yypParser) ){ if( yyGrowStack(yypParser) ){
yyStackOverflow(yypParser); yyStackOverflow(yypParser);
return; /* The call to yyStackOverflow() above pops the stack until it is
** empty, causing the main parser loop to exit. So the return value
** is never used and does not matter. */
return 0;
} }
yymsp = yypParser->yytos; yymsp = yypParser->yytos;
} }
...@@ -2042,7 +2348,9 @@ static void yy_reduce( ...@@ -2042,7 +2348,9 @@ static void yy_reduce(
/********** Begin reduce actions **********************************************/ /********** Begin reduce actions **********************************************/
YYMINORTYPE yylhsminor; YYMINORTYPE yylhsminor;
case 0: /* program ::= cmd */ case 0: /* program ::= cmd */
case 119: /* cmd ::= CREATE TABLE create_table_args */ yytestcase(yyruleno==119); case 120: /* cmd ::= CREATE TABLE create_table_args */ yytestcase(yyruleno==120);
case 121: /* cmd ::= CREATE TABLE create_stable_args */ yytestcase(yyruleno==121);
case 122: /* cmd ::= CREATE STABLE create_stable_args */ yytestcase(yyruleno==122);
{} {}
break; break;
case 1: /* cmd ::= SHOW DATABASES */ case 1: /* cmd ::= SHOW DATABASES */
...@@ -2150,107 +2458,113 @@ static void yy_reduce( ...@@ -2150,107 +2458,113 @@ static void yy_reduce(
case 27: /* cmd ::= DROP TABLE ifexists ids cpxName */ case 27: /* cmd ::= DROP TABLE ifexists ids cpxName */
{ {
yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n;
setDropDbTableInfo(pInfo, TSDB_SQL_DROP_TABLE, &yymsp[-1].minor.yy0, &yymsp[-2].minor.yy0); setDropDbTableInfo(pInfo, TSDB_SQL_DROP_TABLE, &yymsp[-1].minor.yy0, &yymsp[-2].minor.yy0, -1);
}
break;
case 28: /* cmd ::= DROP STABLE ifexists ids cpxName */
{
yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n;
setDropDbTableInfo(pInfo, TSDB_SQL_DROP_TABLE, &yymsp[-1].minor.yy0, &yymsp[-2].minor.yy0, TSDB_SUPER_TABLE);
} }
break; break;
case 28: /* cmd ::= DROP DATABASE ifexists ids */ case 29: /* cmd ::= DROP DATABASE ifexists ids */
{ setDropDbTableInfo(pInfo, TSDB_SQL_DROP_DB, &yymsp[0].minor.yy0, &yymsp[-1].minor.yy0); } { setDropDbTableInfo(pInfo, TSDB_SQL_DROP_DB, &yymsp[0].minor.yy0, &yymsp[-1].minor.yy0, -1); }
break; break;
case 29: /* cmd ::= DROP DNODE ids */ case 30: /* cmd ::= DROP DNODE ids */
{ setDCLSQLElems(pInfo, TSDB_SQL_DROP_DNODE, 1, &yymsp[0].minor.yy0); } { setDCLSQLElems(pInfo, TSDB_SQL_DROP_DNODE, 1, &yymsp[0].minor.yy0); }
break; break;
case 30: /* cmd ::= DROP USER ids */ case 31: /* cmd ::= DROP USER ids */
{ setDCLSQLElems(pInfo, TSDB_SQL_DROP_USER, 1, &yymsp[0].minor.yy0); } { setDCLSQLElems(pInfo, TSDB_SQL_DROP_USER, 1, &yymsp[0].minor.yy0); }
break; break;
case 31: /* cmd ::= DROP ACCOUNT ids */ case 32: /* cmd ::= DROP ACCOUNT ids */
{ setDCLSQLElems(pInfo, TSDB_SQL_DROP_ACCT, 1, &yymsp[0].minor.yy0); } { setDCLSQLElems(pInfo, TSDB_SQL_DROP_ACCT, 1, &yymsp[0].minor.yy0); }
break; break;
case 32: /* cmd ::= USE ids */ case 33: /* cmd ::= USE ids */
{ setDCLSQLElems(pInfo, TSDB_SQL_USE_DB, 1, &yymsp[0].minor.yy0);} { setDCLSQLElems(pInfo, TSDB_SQL_USE_DB, 1, &yymsp[0].minor.yy0);}
break; break;
case 33: /* cmd ::= DESCRIBE ids cpxName */ case 34: /* cmd ::= DESCRIBE ids cpxName */
{ {
yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n;
setDCLSQLElems(pInfo, TSDB_SQL_DESCRIBE_TABLE, 1, &yymsp[-1].minor.yy0); setDCLSQLElems(pInfo, TSDB_SQL_DESCRIBE_TABLE, 1, &yymsp[-1].minor.yy0);
} }
break; break;
case 34: /* cmd ::= ALTER USER ids PASS ids */ case 35: /* cmd ::= ALTER USER ids PASS ids */
{ setAlterUserSql(pInfo, TSDB_ALTER_USER_PASSWD, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, NULL); } { setAlterUserSql(pInfo, TSDB_ALTER_USER_PASSWD, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, NULL); }
break; break;
case 35: /* cmd ::= ALTER USER ids PRIVILEGE ids */ case 36: /* cmd ::= ALTER USER ids PRIVILEGE ids */
{ setAlterUserSql(pInfo, TSDB_ALTER_USER_PRIVILEGES, &yymsp[-2].minor.yy0, NULL, &yymsp[0].minor.yy0);} { setAlterUserSql(pInfo, TSDB_ALTER_USER_PRIVILEGES, &yymsp[-2].minor.yy0, NULL, &yymsp[0].minor.yy0);}
break; break;
case 36: /* cmd ::= ALTER DNODE ids ids */ case 37: /* cmd ::= ALTER DNODE ids ids */
{ setDCLSQLElems(pInfo, TSDB_SQL_CFG_DNODE, 2, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0); } { setDCLSQLElems(pInfo, TSDB_SQL_CFG_DNODE, 2, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0); }
break; break;
case 37: /* cmd ::= ALTER DNODE ids ids ids */ case 38: /* cmd ::= ALTER DNODE ids ids ids */
{ setDCLSQLElems(pInfo, TSDB_SQL_CFG_DNODE, 3, &yymsp[-2].minor.yy0, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0); } { setDCLSQLElems(pInfo, TSDB_SQL_CFG_DNODE, 3, &yymsp[-2].minor.yy0, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0); }
break; break;
case 38: /* cmd ::= ALTER LOCAL ids */ case 39: /* cmd ::= ALTER LOCAL ids */
{ setDCLSQLElems(pInfo, TSDB_SQL_CFG_LOCAL, 1, &yymsp[0].minor.yy0); } { setDCLSQLElems(pInfo, TSDB_SQL_CFG_LOCAL, 1, &yymsp[0].minor.yy0); }
break; break;
case 39: /* cmd ::= ALTER LOCAL ids ids */ case 40: /* cmd ::= ALTER LOCAL ids ids */
{ setDCLSQLElems(pInfo, TSDB_SQL_CFG_LOCAL, 2, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0); } { setDCLSQLElems(pInfo, TSDB_SQL_CFG_LOCAL, 2, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0); }
break; break;
case 40: /* cmd ::= ALTER DATABASE ids alter_db_optr */ case 41: /* cmd ::= ALTER DATABASE ids alter_db_optr */
{ SStrToken t = {0}; setCreateDBSQL(pInfo, TSDB_SQL_ALTER_DB, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy234, &t);} { SStrToken t = {0}; setCreateDBSQL(pInfo, TSDB_SQL_ALTER_DB, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy234, &t);}
break; break;
case 41: /* cmd ::= ALTER ACCOUNT ids acct_optr */ case 42: /* cmd ::= ALTER ACCOUNT ids acct_optr */
{ setCreateAcctSql(pInfo, TSDB_SQL_ALTER_ACCT, &yymsp[-1].minor.yy0, NULL, &yymsp[0].minor.yy71);} { setCreateAcctSql(pInfo, TSDB_SQL_ALTER_ACCT, &yymsp[-1].minor.yy0, NULL, &yymsp[0].minor.yy71);}
break; break;
case 42: /* cmd ::= ALTER ACCOUNT ids PASS ids acct_optr */ case 43: /* cmd ::= ALTER ACCOUNT ids PASS ids acct_optr */
{ setCreateAcctSql(pInfo, TSDB_SQL_ALTER_ACCT, &yymsp[-3].minor.yy0, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy71);} { setCreateAcctSql(pInfo, TSDB_SQL_ALTER_ACCT, &yymsp[-3].minor.yy0, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy71);}
break; break;
case 43: /* ids ::= ID */ case 44: /* ids ::= ID */
case 44: /* ids ::= STRING */ yytestcase(yyruleno==44); case 45: /* ids ::= STRING */ yytestcase(yyruleno==45);
{yylhsminor.yy0 = yymsp[0].minor.yy0; } {yylhsminor.yy0 = yymsp[0].minor.yy0; }
yymsp[0].minor.yy0 = yylhsminor.yy0; yymsp[0].minor.yy0 = yylhsminor.yy0;
break; break;
case 45: /* ifexists ::= IF EXISTS */ case 46: /* ifexists ::= IF EXISTS */
{ yymsp[-1].minor.yy0.n = 1;} { yymsp[-1].minor.yy0.n = 1;}
break; break;
case 46: /* ifexists ::= */ case 47: /* ifexists ::= */
case 48: /* ifnotexists ::= */ yytestcase(yyruleno==48); case 49: /* ifnotexists ::= */ yytestcase(yyruleno==49);
{ yymsp[1].minor.yy0.n = 0;} { yymsp[1].minor.yy0.n = 0;}
break; break;
case 47: /* ifnotexists ::= IF NOT EXISTS */ case 48: /* ifnotexists ::= IF NOT EXISTS */
{ yymsp[-2].minor.yy0.n = 1;} { yymsp[-2].minor.yy0.n = 1;}
break; break;
case 49: /* cmd ::= CREATE DNODE ids */ case 50: /* cmd ::= CREATE DNODE ids */
{ setDCLSQLElems(pInfo, TSDB_SQL_CREATE_DNODE, 1, &yymsp[0].minor.yy0);} { setDCLSQLElems(pInfo, TSDB_SQL_CREATE_DNODE, 1, &yymsp[0].minor.yy0);}
break; break;
case 50: /* cmd ::= CREATE ACCOUNT ids PASS ids acct_optr */ case 51: /* cmd ::= CREATE ACCOUNT ids PASS ids acct_optr */
{ setCreateAcctSql(pInfo, TSDB_SQL_CREATE_ACCT, &yymsp[-3].minor.yy0, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy71);} { setCreateAcctSql(pInfo, TSDB_SQL_CREATE_ACCT, &yymsp[-3].minor.yy0, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy71);}
break; break;
case 51: /* cmd ::= CREATE DATABASE ifnotexists ids db_optr */ case 52: /* cmd ::= CREATE DATABASE ifnotexists ids db_optr */
{ setCreateDBSQL(pInfo, TSDB_SQL_CREATE_DB, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy234, &yymsp[-2].minor.yy0);} { setCreateDBSQL(pInfo, TSDB_SQL_CREATE_DB, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy234, &yymsp[-2].minor.yy0);}
break; break;
case 52: /* cmd ::= CREATE USER ids PASS ids */ case 53: /* cmd ::= CREATE USER ids PASS ids */
{ setCreateUserSql(pInfo, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0);} { setCreateUserSql(pInfo, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0);}
break; break;
case 53: /* pps ::= */ case 54: /* pps ::= */
case 55: /* tseries ::= */ yytestcase(yyruleno==55); case 56: /* tseries ::= */ yytestcase(yyruleno==56);
case 57: /* dbs ::= */ yytestcase(yyruleno==57); case 58: /* dbs ::= */ yytestcase(yyruleno==58);
case 59: /* streams ::= */ yytestcase(yyruleno==59); case 60: /* streams ::= */ yytestcase(yyruleno==60);
case 61: /* storage ::= */ yytestcase(yyruleno==61); case 62: /* storage ::= */ yytestcase(yyruleno==62);
case 63: /* qtime ::= */ yytestcase(yyruleno==63); case 64: /* qtime ::= */ yytestcase(yyruleno==64);
case 65: /* users ::= */ yytestcase(yyruleno==65); case 66: /* users ::= */ yytestcase(yyruleno==66);
case 67: /* conns ::= */ yytestcase(yyruleno==67); case 68: /* conns ::= */ yytestcase(yyruleno==68);
case 69: /* state ::= */ yytestcase(yyruleno==69); case 70: /* state ::= */ yytestcase(yyruleno==70);
{ yymsp[1].minor.yy0.n = 0; } { yymsp[1].minor.yy0.n = 0; }
break; break;
case 54: /* pps ::= PPS INTEGER */ case 55: /* pps ::= PPS INTEGER */
case 56: /* tseries ::= TSERIES INTEGER */ yytestcase(yyruleno==56); case 57: /* tseries ::= TSERIES INTEGER */ yytestcase(yyruleno==57);
case 58: /* dbs ::= DBS INTEGER */ yytestcase(yyruleno==58); case 59: /* dbs ::= DBS INTEGER */ yytestcase(yyruleno==59);
case 60: /* streams ::= STREAMS INTEGER */ yytestcase(yyruleno==60); case 61: /* streams ::= STREAMS INTEGER */ yytestcase(yyruleno==61);
case 62: /* storage ::= STORAGE INTEGER */ yytestcase(yyruleno==62); case 63: /* storage ::= STORAGE INTEGER */ yytestcase(yyruleno==63);
case 64: /* qtime ::= QTIME INTEGER */ yytestcase(yyruleno==64); case 65: /* qtime ::= QTIME INTEGER */ yytestcase(yyruleno==65);
case 66: /* users ::= USERS INTEGER */ yytestcase(yyruleno==66); case 67: /* users ::= USERS INTEGER */ yytestcase(yyruleno==67);
case 68: /* conns ::= CONNS INTEGER */ yytestcase(yyruleno==68); case 69: /* conns ::= CONNS INTEGER */ yytestcase(yyruleno==69);
case 70: /* state ::= STATE ids */ yytestcase(yyruleno==70); case 71: /* state ::= STATE ids */ yytestcase(yyruleno==71);
{ yymsp[-1].minor.yy0 = yymsp[0].minor.yy0; } { yymsp[-1].minor.yy0 = yymsp[0].minor.yy0; }
break; break;
case 71: /* acct_optr ::= pps tseries storage streams qtime dbs users conns state */ case 72: /* acct_optr ::= pps tseries storage streams qtime dbs users conns state */
{ {
yylhsminor.yy71.maxUsers = (yymsp[-2].minor.yy0.n>0)?atoi(yymsp[-2].minor.yy0.z):-1; yylhsminor.yy71.maxUsers = (yymsp[-2].minor.yy0.n>0)?atoi(yymsp[-2].minor.yy0.z):-1;
yylhsminor.yy71.maxDbs = (yymsp[-3].minor.yy0.n>0)?atoi(yymsp[-3].minor.yy0.z):-1; yylhsminor.yy71.maxDbs = (yymsp[-3].minor.yy0.n>0)?atoi(yymsp[-3].minor.yy0.z):-1;
...@@ -2264,108 +2578,108 @@ static void yy_reduce( ...@@ -2264,108 +2578,108 @@ static void yy_reduce(
} }
yymsp[-8].minor.yy71 = yylhsminor.yy71; yymsp[-8].minor.yy71 = yylhsminor.yy71;
break; break;
case 72: /* keep ::= KEEP tagitemlist */ case 73: /* keep ::= KEEP tagitemlist */
{ yymsp[-1].minor.yy421 = yymsp[0].minor.yy421; } { yymsp[-1].minor.yy421 = yymsp[0].minor.yy421; }
break; break;
case 73: /* cache ::= CACHE INTEGER */ case 74: /* cache ::= CACHE INTEGER */
case 74: /* replica ::= REPLICA INTEGER */ yytestcase(yyruleno==74); case 75: /* replica ::= REPLICA INTEGER */ yytestcase(yyruleno==75);
case 75: /* quorum ::= QUORUM INTEGER */ yytestcase(yyruleno==75); case 76: /* quorum ::= QUORUM INTEGER */ yytestcase(yyruleno==76);
case 76: /* days ::= DAYS INTEGER */ yytestcase(yyruleno==76); case 77: /* days ::= DAYS INTEGER */ yytestcase(yyruleno==77);
case 77: /* minrows ::= MINROWS INTEGER */ yytestcase(yyruleno==77); case 78: /* minrows ::= MINROWS INTEGER */ yytestcase(yyruleno==78);
case 78: /* maxrows ::= MAXROWS INTEGER */ yytestcase(yyruleno==78); case 79: /* maxrows ::= MAXROWS INTEGER */ yytestcase(yyruleno==79);
case 79: /* blocks ::= BLOCKS INTEGER */ yytestcase(yyruleno==79); case 80: /* blocks ::= BLOCKS INTEGER */ yytestcase(yyruleno==80);
case 80: /* ctime ::= CTIME INTEGER */ yytestcase(yyruleno==80); case 81: /* ctime ::= CTIME INTEGER */ yytestcase(yyruleno==81);
case 81: /* wal ::= WAL INTEGER */ yytestcase(yyruleno==81); case 82: /* wal ::= WAL INTEGER */ yytestcase(yyruleno==82);
case 82: /* fsync ::= FSYNC INTEGER */ yytestcase(yyruleno==82); case 83: /* fsync ::= FSYNC INTEGER */ yytestcase(yyruleno==83);
case 83: /* comp ::= COMP INTEGER */ yytestcase(yyruleno==83); case 84: /* comp ::= COMP INTEGER */ yytestcase(yyruleno==84);
case 84: /* prec ::= PRECISION STRING */ yytestcase(yyruleno==84); case 85: /* prec ::= PRECISION STRING */ yytestcase(yyruleno==85);
case 85: /* update ::= UPDATE INTEGER */ yytestcase(yyruleno==85); case 86: /* update ::= UPDATE INTEGER */ yytestcase(yyruleno==86);
case 86: /* cachelast ::= CACHELAST INTEGER */ yytestcase(yyruleno==86); case 87: /* cachelast ::= CACHELAST INTEGER */ yytestcase(yyruleno==87);
{ yymsp[-1].minor.yy0 = yymsp[0].minor.yy0; } { yymsp[-1].minor.yy0 = yymsp[0].minor.yy0; }
break; break;
case 87: /* db_optr ::= */ case 88: /* db_optr ::= */
{setDefaultCreateDbOption(&yymsp[1].minor.yy234);} {setDefaultCreateDbOption(&yymsp[1].minor.yy234);}
break; break;
case 88: /* db_optr ::= db_optr cache */ case 89: /* db_optr ::= db_optr cache */
{ yylhsminor.yy234 = yymsp[-1].minor.yy234; yylhsminor.yy234.cacheBlockSize = strtol(yymsp[0].minor.yy0.z, NULL, 10); } { yylhsminor.yy234 = yymsp[-1].minor.yy234; yylhsminor.yy234.cacheBlockSize = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
yymsp[-1].minor.yy234 = yylhsminor.yy234; yymsp[-1].minor.yy234 = yylhsminor.yy234;
break; break;
case 89: /* db_optr ::= db_optr replica */ case 90: /* db_optr ::= db_optr replica */
case 104: /* alter_db_optr ::= alter_db_optr replica */ yytestcase(yyruleno==104); case 105: /* alter_db_optr ::= alter_db_optr replica */ yytestcase(yyruleno==105);
{ yylhsminor.yy234 = yymsp[-1].minor.yy234; yylhsminor.yy234.replica = strtol(yymsp[0].minor.yy0.z, NULL, 10); } { yylhsminor.yy234 = yymsp[-1].minor.yy234; yylhsminor.yy234.replica = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
yymsp[-1].minor.yy234 = yylhsminor.yy234; yymsp[-1].minor.yy234 = yylhsminor.yy234;
break; break;
case 90: /* db_optr ::= db_optr quorum */ case 91: /* db_optr ::= db_optr quorum */
case 105: /* alter_db_optr ::= alter_db_optr quorum */ yytestcase(yyruleno==105); case 106: /* alter_db_optr ::= alter_db_optr quorum */ yytestcase(yyruleno==106);
{ yylhsminor.yy234 = yymsp[-1].minor.yy234; yylhsminor.yy234.quorum = strtol(yymsp[0].minor.yy0.z, NULL, 10); } { yylhsminor.yy234 = yymsp[-1].minor.yy234; yylhsminor.yy234.quorum = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
yymsp[-1].minor.yy234 = yylhsminor.yy234; yymsp[-1].minor.yy234 = yylhsminor.yy234;
break; break;
case 91: /* db_optr ::= db_optr days */ case 92: /* db_optr ::= db_optr days */
{ yylhsminor.yy234 = yymsp[-1].minor.yy234; yylhsminor.yy234.daysPerFile = strtol(yymsp[0].minor.yy0.z, NULL, 10); } { yylhsminor.yy234 = yymsp[-1].minor.yy234; yylhsminor.yy234.daysPerFile = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
yymsp[-1].minor.yy234 = yylhsminor.yy234; yymsp[-1].minor.yy234 = yylhsminor.yy234;
break; break;
case 92: /* db_optr ::= db_optr minrows */ case 93: /* db_optr ::= db_optr minrows */
{ yylhsminor.yy234 = yymsp[-1].minor.yy234; yylhsminor.yy234.minRowsPerBlock = strtod(yymsp[0].minor.yy0.z, NULL); } { yylhsminor.yy234 = yymsp[-1].minor.yy234; yylhsminor.yy234.minRowsPerBlock = strtod(yymsp[0].minor.yy0.z, NULL); }
yymsp[-1].minor.yy234 = yylhsminor.yy234; yymsp[-1].minor.yy234 = yylhsminor.yy234;
break; break;
case 93: /* db_optr ::= db_optr maxrows */ case 94: /* db_optr ::= db_optr maxrows */
{ yylhsminor.yy234 = yymsp[-1].minor.yy234; yylhsminor.yy234.maxRowsPerBlock = strtod(yymsp[0].minor.yy0.z, NULL); } { yylhsminor.yy234 = yymsp[-1].minor.yy234; yylhsminor.yy234.maxRowsPerBlock = strtod(yymsp[0].minor.yy0.z, NULL); }
yymsp[-1].minor.yy234 = yylhsminor.yy234; yymsp[-1].minor.yy234 = yylhsminor.yy234;
break; break;
case 94: /* db_optr ::= db_optr blocks */ case 95: /* db_optr ::= db_optr blocks */
case 107: /* alter_db_optr ::= alter_db_optr blocks */ yytestcase(yyruleno==107); case 108: /* alter_db_optr ::= alter_db_optr blocks */ yytestcase(yyruleno==108);
{ yylhsminor.yy234 = yymsp[-1].minor.yy234; yylhsminor.yy234.numOfBlocks = strtol(yymsp[0].minor.yy0.z, NULL, 10); } { yylhsminor.yy234 = yymsp[-1].minor.yy234; yylhsminor.yy234.numOfBlocks = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
yymsp[-1].minor.yy234 = yylhsminor.yy234; yymsp[-1].minor.yy234 = yylhsminor.yy234;
break; break;
case 95: /* db_optr ::= db_optr ctime */ case 96: /* db_optr ::= db_optr ctime */
{ yylhsminor.yy234 = yymsp[-1].minor.yy234; yylhsminor.yy234.commitTime = strtol(yymsp[0].minor.yy0.z, NULL, 10); } { yylhsminor.yy234 = yymsp[-1].minor.yy234; yylhsminor.yy234.commitTime = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
yymsp[-1].minor.yy234 = yylhsminor.yy234; yymsp[-1].minor.yy234 = yylhsminor.yy234;
break; break;
case 96: /* db_optr ::= db_optr wal */ case 97: /* db_optr ::= db_optr wal */
case 109: /* alter_db_optr ::= alter_db_optr wal */ yytestcase(yyruleno==109); case 110: /* alter_db_optr ::= alter_db_optr wal */ yytestcase(yyruleno==110);
{ yylhsminor.yy234 = yymsp[-1].minor.yy234; yylhsminor.yy234.walLevel = strtol(yymsp[0].minor.yy0.z, NULL, 10); } { yylhsminor.yy234 = yymsp[-1].minor.yy234; yylhsminor.yy234.walLevel = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
yymsp[-1].minor.yy234 = yylhsminor.yy234; yymsp[-1].minor.yy234 = yylhsminor.yy234;
break; break;
case 97: /* db_optr ::= db_optr fsync */ case 98: /* db_optr ::= db_optr fsync */
case 110: /* alter_db_optr ::= alter_db_optr fsync */ yytestcase(yyruleno==110); case 111: /* alter_db_optr ::= alter_db_optr fsync */ yytestcase(yyruleno==111);
{ yylhsminor.yy234 = yymsp[-1].minor.yy234; yylhsminor.yy234.fsyncPeriod = strtol(yymsp[0].minor.yy0.z, NULL, 10); } { yylhsminor.yy234 = yymsp[-1].minor.yy234; yylhsminor.yy234.fsyncPeriod = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
yymsp[-1].minor.yy234 = yylhsminor.yy234; yymsp[-1].minor.yy234 = yylhsminor.yy234;
break; break;
case 98: /* db_optr ::= db_optr comp */ case 99: /* db_optr ::= db_optr comp */
case 108: /* alter_db_optr ::= alter_db_optr comp */ yytestcase(yyruleno==108); case 109: /* alter_db_optr ::= alter_db_optr comp */ yytestcase(yyruleno==109);
{ yylhsminor.yy234 = yymsp[-1].minor.yy234; yylhsminor.yy234.compressionLevel = strtol(yymsp[0].minor.yy0.z, NULL, 10); } { yylhsminor.yy234 = yymsp[-1].minor.yy234; yylhsminor.yy234.compressionLevel = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
yymsp[-1].minor.yy234 = yylhsminor.yy234; yymsp[-1].minor.yy234 = yylhsminor.yy234;
break; break;
case 99: /* db_optr ::= db_optr prec */ case 100: /* db_optr ::= db_optr prec */
{ yylhsminor.yy234 = yymsp[-1].minor.yy234; yylhsminor.yy234.precision = yymsp[0].minor.yy0; } { yylhsminor.yy234 = yymsp[-1].minor.yy234; yylhsminor.yy234.precision = yymsp[0].minor.yy0; }
yymsp[-1].minor.yy234 = yylhsminor.yy234; yymsp[-1].minor.yy234 = yylhsminor.yy234;
break; break;
case 100: /* db_optr ::= db_optr keep */ case 101: /* db_optr ::= db_optr keep */
case 106: /* alter_db_optr ::= alter_db_optr keep */ yytestcase(yyruleno==106); case 107: /* alter_db_optr ::= alter_db_optr keep */ yytestcase(yyruleno==107);
{ yylhsminor.yy234 = yymsp[-1].minor.yy234; yylhsminor.yy234.keep = yymsp[0].minor.yy421; } { yylhsminor.yy234 = yymsp[-1].minor.yy234; yylhsminor.yy234.keep = yymsp[0].minor.yy421; }
yymsp[-1].minor.yy234 = yylhsminor.yy234; yymsp[-1].minor.yy234 = yylhsminor.yy234;
break; break;
case 101: /* db_optr ::= db_optr update */ case 102: /* db_optr ::= db_optr update */
case 111: /* alter_db_optr ::= alter_db_optr update */ yytestcase(yyruleno==111); case 112: /* alter_db_optr ::= alter_db_optr update */ yytestcase(yyruleno==112);
{ yylhsminor.yy234 = yymsp[-1].minor.yy234; yylhsminor.yy234.update = strtol(yymsp[0].minor.yy0.z, NULL, 10); } { yylhsminor.yy234 = yymsp[-1].minor.yy234; yylhsminor.yy234.update = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
yymsp[-1].minor.yy234 = yylhsminor.yy234; yymsp[-1].minor.yy234 = yylhsminor.yy234;
break; break;
case 102: /* db_optr ::= db_optr cachelast */ case 103: /* db_optr ::= db_optr cachelast */
case 112: /* alter_db_optr ::= alter_db_optr cachelast */ yytestcase(yyruleno==112); case 113: /* alter_db_optr ::= alter_db_optr cachelast */ yytestcase(yyruleno==113);
{ yylhsminor.yy234 = yymsp[-1].minor.yy234; yylhsminor.yy234.cachelast = strtol(yymsp[0].minor.yy0.z, NULL, 10); } { yylhsminor.yy234 = yymsp[-1].minor.yy234; yylhsminor.yy234.cachelast = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
yymsp[-1].minor.yy234 = yylhsminor.yy234; yymsp[-1].minor.yy234 = yylhsminor.yy234;
break; break;
case 103: /* alter_db_optr ::= */ case 104: /* alter_db_optr ::= */
{ setDefaultCreateDbOption(&yymsp[1].minor.yy234);} { setDefaultCreateDbOption(&yymsp[1].minor.yy234);}
break; break;
case 113: /* typename ::= ids */ case 114: /* typename ::= ids */
{ {
yymsp[0].minor.yy0.type = 0; yymsp[0].minor.yy0.type = 0;
tSqlSetColumnType (&yylhsminor.yy183, &yymsp[0].minor.yy0); tSqlSetColumnType (&yylhsminor.yy183, &yymsp[0].minor.yy0);
} }
yymsp[0].minor.yy183 = yylhsminor.yy183; yymsp[0].minor.yy183 = yylhsminor.yy183;
break; break;
case 114: /* typename ::= ids LP signed RP */ case 115: /* typename ::= ids LP signed RP */
{ {
if (yymsp[-1].minor.yy325 <= 0) { if (yymsp[-1].minor.yy325 <= 0) {
yymsp[-3].minor.yy0.type = 0; yymsp[-3].minor.yy0.type = 0;
...@@ -2377,7 +2691,7 @@ static void yy_reduce( ...@@ -2377,7 +2691,7 @@ static void yy_reduce(
} }
yymsp[-3].minor.yy183 = yylhsminor.yy183; yymsp[-3].minor.yy183 = yylhsminor.yy183;
break; break;
case 115: /* typename ::= ids UNSIGNED */ case 116: /* typename ::= ids UNSIGNED */
{ {
yymsp[-1].minor.yy0.type = 0; 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); yymsp[-1].minor.yy0.n = ((yymsp[0].minor.yy0.z + yymsp[0].minor.yy0.n) - yymsp[-1].minor.yy0.z);
...@@ -2385,20 +2699,20 @@ static void yy_reduce( ...@@ -2385,20 +2699,20 @@ static void yy_reduce(
} }
yymsp[-1].minor.yy183 = yylhsminor.yy183; yymsp[-1].minor.yy183 = yylhsminor.yy183;
break; break;
case 116: /* signed ::= INTEGER */ case 117: /* signed ::= INTEGER */
{ yylhsminor.yy325 = strtol(yymsp[0].minor.yy0.z, NULL, 10); } { yylhsminor.yy325 = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
yymsp[0].minor.yy325 = yylhsminor.yy325; yymsp[0].minor.yy325 = yylhsminor.yy325;
break; break;
case 117: /* signed ::= PLUS INTEGER */ case 118: /* signed ::= PLUS INTEGER */
{ yymsp[-1].minor.yy325 = strtol(yymsp[0].minor.yy0.z, NULL, 10); } { yymsp[-1].minor.yy325 = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
break; break;
case 118: /* signed ::= MINUS INTEGER */ case 119: /* signed ::= MINUS INTEGER */
{ yymsp[-1].minor.yy325 = -strtol(yymsp[0].minor.yy0.z, NULL, 10);} { yymsp[-1].minor.yy325 = -strtol(yymsp[0].minor.yy0.z, NULL, 10);}
break; break;
case 120: /* cmd ::= CREATE TABLE create_table_list */ case 123: /* cmd ::= CREATE TABLE create_table_list */
{ pInfo->type = TSDB_SQL_CREATE_TABLE; pInfo->pCreateTableInfo = yymsp[0].minor.yy38;} { pInfo->type = TSDB_SQL_CREATE_TABLE; pInfo->pCreateTableInfo = yymsp[0].minor.yy38;}
break; break;
case 121: /* create_table_list ::= create_from_stable */ case 124: /* create_table_list ::= create_from_stable */
{ {
SCreateTableSQL* pCreateTable = calloc(1, sizeof(SCreateTableSQL)); SCreateTableSQL* pCreateTable = calloc(1, sizeof(SCreateTableSQL));
pCreateTable->childTableInfo = taosArrayInit(4, sizeof(SCreatedTableInfo)); pCreateTable->childTableInfo = taosArrayInit(4, sizeof(SCreatedTableInfo));
...@@ -2409,14 +2723,14 @@ static void yy_reduce( ...@@ -2409,14 +2723,14 @@ static void yy_reduce(
} }
yymsp[0].minor.yy38 = yylhsminor.yy38; yymsp[0].minor.yy38 = yylhsminor.yy38;
break; break;
case 122: /* create_table_list ::= create_table_list create_from_stable */ case 125: /* create_table_list ::= create_table_list create_from_stable */
{ {
taosArrayPush(yymsp[-1].minor.yy38->childTableInfo, &yymsp[0].minor.yy152); taosArrayPush(yymsp[-1].minor.yy38->childTableInfo, &yymsp[0].minor.yy152);
yylhsminor.yy38 = yymsp[-1].minor.yy38; yylhsminor.yy38 = yymsp[-1].minor.yy38;
} }
yymsp[-1].minor.yy38 = yylhsminor.yy38; yymsp[-1].minor.yy38 = yylhsminor.yy38;
break; break;
case 123: /* create_table_args ::= ifnotexists ids cpxName LP columnlist RP */ case 126: /* create_table_args ::= ifnotexists ids cpxName LP columnlist RP */
{ {
yylhsminor.yy38 = tSetCreateSqlElems(yymsp[-1].minor.yy421, NULL, NULL, TSQL_CREATE_TABLE); yylhsminor.yy38 = tSetCreateSqlElems(yymsp[-1].minor.yy421, NULL, NULL, TSQL_CREATE_TABLE);
setSqlInfo(pInfo, yylhsminor.yy38, NULL, TSDB_SQL_CREATE_TABLE); setSqlInfo(pInfo, yylhsminor.yy38, NULL, TSDB_SQL_CREATE_TABLE);
...@@ -2426,7 +2740,7 @@ static void yy_reduce( ...@@ -2426,7 +2740,7 @@ static void yy_reduce(
} }
yymsp[-5].minor.yy38 = yylhsminor.yy38; yymsp[-5].minor.yy38 = yylhsminor.yy38;
break; break;
case 124: /* create_table_args ::= ifnotexists ids cpxName LP columnlist RP TAGS LP columnlist RP */ case 127: /* create_stable_args ::= ifnotexists ids cpxName LP columnlist RP TAGS LP columnlist RP */
{ {
yylhsminor.yy38 = tSetCreateSqlElems(yymsp[-5].minor.yy421, yymsp[-1].minor.yy421, NULL, TSQL_CREATE_STABLE); yylhsminor.yy38 = tSetCreateSqlElems(yymsp[-5].minor.yy421, yymsp[-1].minor.yy421, NULL, TSQL_CREATE_STABLE);
setSqlInfo(pInfo, yylhsminor.yy38, NULL, TSDB_SQL_CREATE_TABLE); setSqlInfo(pInfo, yylhsminor.yy38, NULL, TSDB_SQL_CREATE_TABLE);
...@@ -2436,7 +2750,7 @@ static void yy_reduce( ...@@ -2436,7 +2750,7 @@ static void yy_reduce(
} }
yymsp[-9].minor.yy38 = yylhsminor.yy38; yymsp[-9].minor.yy38 = yylhsminor.yy38;
break; break;
case 125: /* create_from_stable ::= ifnotexists ids cpxName USING ids cpxName TAGS LP tagitemlist RP */ case 128: /* create_from_stable ::= ifnotexists ids cpxName USING ids cpxName TAGS LP tagitemlist RP */
{ {
yymsp[-5].minor.yy0.n += yymsp[-4].minor.yy0.n; yymsp[-5].minor.yy0.n += yymsp[-4].minor.yy0.n;
yymsp[-8].minor.yy0.n += yymsp[-7].minor.yy0.n; yymsp[-8].minor.yy0.n += yymsp[-7].minor.yy0.n;
...@@ -2444,7 +2758,7 @@ static void yy_reduce( ...@@ -2444,7 +2758,7 @@ static void yy_reduce(
} }
yymsp[-9].minor.yy152 = yylhsminor.yy152; yymsp[-9].minor.yy152 = yylhsminor.yy152;
break; break;
case 126: /* create_table_args ::= ifnotexists ids cpxName AS select */ case 129: /* create_table_args ::= ifnotexists ids cpxName AS select */
{ {
yylhsminor.yy38 = tSetCreateSqlElems(NULL, NULL, yymsp[0].minor.yy148, TSQL_CREATE_STREAM); yylhsminor.yy38 = tSetCreateSqlElems(NULL, NULL, yymsp[0].minor.yy148, TSQL_CREATE_STREAM);
setSqlInfo(pInfo, yylhsminor.yy38, NULL, TSDB_SQL_CREATE_TABLE); setSqlInfo(pInfo, yylhsminor.yy38, NULL, TSDB_SQL_CREATE_TABLE);
...@@ -2454,43 +2768,43 @@ static void yy_reduce( ...@@ -2454,43 +2768,43 @@ static void yy_reduce(
} }
yymsp[-4].minor.yy38 = yylhsminor.yy38; yymsp[-4].minor.yy38 = yylhsminor.yy38;
break; break;
case 127: /* columnlist ::= columnlist COMMA column */ case 130: /* columnlist ::= columnlist COMMA column */
{taosArrayPush(yymsp[-2].minor.yy421, &yymsp[0].minor.yy183); yylhsminor.yy421 = yymsp[-2].minor.yy421; } {taosArrayPush(yymsp[-2].minor.yy421, &yymsp[0].minor.yy183); yylhsminor.yy421 = yymsp[-2].minor.yy421; }
yymsp[-2].minor.yy421 = yylhsminor.yy421; yymsp[-2].minor.yy421 = yylhsminor.yy421;
break; break;
case 128: /* columnlist ::= column */ case 131: /* columnlist ::= column */
{yylhsminor.yy421 = taosArrayInit(4, sizeof(TAOS_FIELD)); taosArrayPush(yylhsminor.yy421, &yymsp[0].minor.yy183);} {yylhsminor.yy421 = taosArrayInit(4, sizeof(TAOS_FIELD)); taosArrayPush(yylhsminor.yy421, &yymsp[0].minor.yy183);}
yymsp[0].minor.yy421 = yylhsminor.yy421; yymsp[0].minor.yy421 = yylhsminor.yy421;
break; break;
case 129: /* column ::= ids typename */ case 132: /* column ::= ids typename */
{ {
tSqlSetColumnInfo(&yylhsminor.yy183, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy183); tSqlSetColumnInfo(&yylhsminor.yy183, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy183);
} }
yymsp[-1].minor.yy183 = yylhsminor.yy183; yymsp[-1].minor.yy183 = yylhsminor.yy183;
break; break;
case 130: /* tagitemlist ::= tagitemlist COMMA tagitem */ case 133: /* tagitemlist ::= tagitemlist COMMA tagitem */
{ yylhsminor.yy421 = tVariantListAppend(yymsp[-2].minor.yy421, &yymsp[0].minor.yy430, -1); } { yylhsminor.yy421 = tVariantListAppend(yymsp[-2].minor.yy421, &yymsp[0].minor.yy430, -1); }
yymsp[-2].minor.yy421 = yylhsminor.yy421; yymsp[-2].minor.yy421 = yylhsminor.yy421;
break; break;
case 131: /* tagitemlist ::= tagitem */ case 134: /* tagitemlist ::= tagitem */
{ yylhsminor.yy421 = tVariantListAppend(NULL, &yymsp[0].minor.yy430, -1); } { yylhsminor.yy421 = tVariantListAppend(NULL, &yymsp[0].minor.yy430, -1); }
yymsp[0].minor.yy421 = yylhsminor.yy421; yymsp[0].minor.yy421 = yylhsminor.yy421;
break; break;
case 132: /* tagitem ::= INTEGER */ case 135: /* tagitem ::= INTEGER */
case 133: /* tagitem ::= FLOAT */ yytestcase(yyruleno==133); case 136: /* tagitem ::= FLOAT */ yytestcase(yyruleno==136);
case 134: /* tagitem ::= STRING */ yytestcase(yyruleno==134); case 137: /* tagitem ::= STRING */ yytestcase(yyruleno==137);
case 135: /* tagitem ::= BOOL */ yytestcase(yyruleno==135); case 138: /* tagitem ::= BOOL */ yytestcase(yyruleno==138);
{ toTSDBType(yymsp[0].minor.yy0.type); tVariantCreate(&yylhsminor.yy430, &yymsp[0].minor.yy0); } { toTSDBType(yymsp[0].minor.yy0.type); tVariantCreate(&yylhsminor.yy430, &yymsp[0].minor.yy0); }
yymsp[0].minor.yy430 = yylhsminor.yy430; yymsp[0].minor.yy430 = yylhsminor.yy430;
break; break;
case 136: /* tagitem ::= NULL */ case 139: /* tagitem ::= NULL */
{ yymsp[0].minor.yy0.type = 0; tVariantCreate(&yylhsminor.yy430, &yymsp[0].minor.yy0); } { yymsp[0].minor.yy0.type = 0; tVariantCreate(&yylhsminor.yy430, &yymsp[0].minor.yy0); }
yymsp[0].minor.yy430 = yylhsminor.yy430; yymsp[0].minor.yy430 = yylhsminor.yy430;
break; break;
case 137: /* tagitem ::= MINUS INTEGER */ case 140: /* tagitem ::= MINUS INTEGER */
case 138: /* tagitem ::= MINUS FLOAT */ yytestcase(yyruleno==138); case 141: /* tagitem ::= MINUS FLOAT */ yytestcase(yyruleno==141);
case 139: /* tagitem ::= PLUS INTEGER */ yytestcase(yyruleno==139); case 142: /* tagitem ::= PLUS INTEGER */ yytestcase(yyruleno==142);
case 140: /* tagitem ::= PLUS FLOAT */ yytestcase(yyruleno==140); case 143: /* tagitem ::= PLUS FLOAT */ yytestcase(yyruleno==143);
{ {
yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n;
yymsp[-1].minor.yy0.type = yymsp[0].minor.yy0.type; yymsp[-1].minor.yy0.type = yymsp[0].minor.yy0.type;
...@@ -2499,70 +2813,70 @@ static void yy_reduce( ...@@ -2499,70 +2813,70 @@ static void yy_reduce(
} }
yymsp[-1].minor.yy430 = yylhsminor.yy430; yymsp[-1].minor.yy430 = yylhsminor.yy430;
break; break;
case 141: /* select ::= SELECT selcollist from where_opt interval_opt fill_opt sliding_opt groupby_opt orderby_opt having_opt slimit_opt limit_opt */ case 144: /* select ::= SELECT selcollist from where_opt interval_opt fill_opt sliding_opt groupby_opt orderby_opt having_opt slimit_opt limit_opt */
{ {
yylhsminor.yy148 = tSetQuerySqlElems(&yymsp[-11].minor.yy0, yymsp[-10].minor.yy166, yymsp[-9].minor.yy421, yymsp[-8].minor.yy78, yymsp[-4].minor.yy421, yymsp[-3].minor.yy421, &yymsp[-7].minor.yy400, &yymsp[-5].minor.yy0, yymsp[-6].minor.yy421, &yymsp[0].minor.yy167, &yymsp[-1].minor.yy167); yylhsminor.yy148 = tSetQuerySqlElems(&yymsp[-11].minor.yy0, yymsp[-10].minor.yy166, yymsp[-9].minor.yy421, yymsp[-8].minor.yy78, yymsp[-4].minor.yy421, yymsp[-3].minor.yy421, &yymsp[-7].minor.yy400, &yymsp[-5].minor.yy0, yymsp[-6].minor.yy421, &yymsp[0].minor.yy167, &yymsp[-1].minor.yy167);
} }
yymsp[-11].minor.yy148 = yylhsminor.yy148; yymsp[-11].minor.yy148 = yylhsminor.yy148;
break; break;
case 142: /* union ::= select */ case 145: /* union ::= select */
{ yylhsminor.yy153 = setSubclause(NULL, yymsp[0].minor.yy148); } { yylhsminor.yy153 = setSubclause(NULL, yymsp[0].minor.yy148); }
yymsp[0].minor.yy153 = yylhsminor.yy153; yymsp[0].minor.yy153 = yylhsminor.yy153;
break; break;
case 143: /* union ::= LP union RP */ case 146: /* union ::= LP union RP */
{ yymsp[-2].minor.yy153 = yymsp[-1].minor.yy153; } { yymsp[-2].minor.yy153 = yymsp[-1].minor.yy153; }
break; break;
case 144: /* union ::= union UNION ALL select */ case 147: /* union ::= union UNION ALL select */
{ yylhsminor.yy153 = appendSelectClause(yymsp[-3].minor.yy153, yymsp[0].minor.yy148); } { yylhsminor.yy153 = appendSelectClause(yymsp[-3].minor.yy153, yymsp[0].minor.yy148); }
yymsp[-3].minor.yy153 = yylhsminor.yy153; yymsp[-3].minor.yy153 = yylhsminor.yy153;
break; break;
case 145: /* union ::= union UNION ALL LP select RP */ case 148: /* union ::= union UNION ALL LP select RP */
{ yylhsminor.yy153 = appendSelectClause(yymsp[-5].minor.yy153, yymsp[-1].minor.yy148); } { yylhsminor.yy153 = appendSelectClause(yymsp[-5].minor.yy153, yymsp[-1].minor.yy148); }
yymsp[-5].minor.yy153 = yylhsminor.yy153; yymsp[-5].minor.yy153 = yylhsminor.yy153;
break; break;
case 146: /* cmd ::= union */ case 149: /* cmd ::= union */
{ setSqlInfo(pInfo, yymsp[0].minor.yy153, NULL, TSDB_SQL_SELECT); } { setSqlInfo(pInfo, yymsp[0].minor.yy153, NULL, TSDB_SQL_SELECT); }
break; break;
case 147: /* select ::= SELECT selcollist */ case 150: /* select ::= SELECT selcollist */
{ {
yylhsminor.yy148 = tSetQuerySqlElems(&yymsp[-1].minor.yy0, yymsp[0].minor.yy166, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); yylhsminor.yy148 = tSetQuerySqlElems(&yymsp[-1].minor.yy0, yymsp[0].minor.yy166, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
} }
yymsp[-1].minor.yy148 = yylhsminor.yy148; yymsp[-1].minor.yy148 = yylhsminor.yy148;
break; break;
case 148: /* sclp ::= selcollist COMMA */ case 151: /* sclp ::= selcollist COMMA */
{yylhsminor.yy166 = yymsp[-1].minor.yy166;} {yylhsminor.yy166 = yymsp[-1].minor.yy166;}
yymsp[-1].minor.yy166 = yylhsminor.yy166; yymsp[-1].minor.yy166 = yylhsminor.yy166;
break; break;
case 149: /* sclp ::= */ case 152: /* sclp ::= */
{yymsp[1].minor.yy166 = 0;} {yymsp[1].minor.yy166 = 0;}
break; break;
case 150: /* selcollist ::= sclp expr as */ case 153: /* selcollist ::= sclp expr as */
{ {
yylhsminor.yy166 = tSqlExprListAppend(yymsp[-2].minor.yy166, yymsp[-1].minor.yy78, yymsp[0].minor.yy0.n?&yymsp[0].minor.yy0:0); yylhsminor.yy166 = tSqlExprListAppend(yymsp[-2].minor.yy166, yymsp[-1].minor.yy78, yymsp[0].minor.yy0.n?&yymsp[0].minor.yy0:0);
} }
yymsp[-2].minor.yy166 = yylhsminor.yy166; yymsp[-2].minor.yy166 = yylhsminor.yy166;
break; break;
case 151: /* selcollist ::= sclp STAR */ case 154: /* selcollist ::= sclp STAR */
{ {
tSQLExpr *pNode = tSqlExprIdValueCreate(NULL, TK_ALL); tSQLExpr *pNode = tSqlExprIdValueCreate(NULL, TK_ALL);
yylhsminor.yy166 = tSqlExprListAppend(yymsp[-1].minor.yy166, pNode, 0); yylhsminor.yy166 = tSqlExprListAppend(yymsp[-1].minor.yy166, pNode, 0);
} }
yymsp[-1].minor.yy166 = yylhsminor.yy166; yymsp[-1].minor.yy166 = yylhsminor.yy166;
break; break;
case 152: /* as ::= AS ids */ case 155: /* as ::= AS ids */
{ yymsp[-1].minor.yy0 = yymsp[0].minor.yy0; } { yymsp[-1].minor.yy0 = yymsp[0].minor.yy0; }
break; break;
case 153: /* as ::= ids */ case 156: /* as ::= ids */
{ yylhsminor.yy0 = yymsp[0].minor.yy0; } { yylhsminor.yy0 = yymsp[0].minor.yy0; }
yymsp[0].minor.yy0 = yylhsminor.yy0; yymsp[0].minor.yy0 = yylhsminor.yy0;
break; break;
case 154: /* as ::= */ case 157: /* as ::= */
{ yymsp[1].minor.yy0.n = 0; } { yymsp[1].minor.yy0.n = 0; }
break; break;
case 155: /* from ::= FROM tablelist */ case 158: /* from ::= FROM tablelist */
{yymsp[-1].minor.yy421 = yymsp[0].minor.yy421;} {yymsp[-1].minor.yy421 = yymsp[0].minor.yy421;}
break; break;
case 156: /* tablelist ::= ids cpxName */ case 159: /* tablelist ::= ids cpxName */
{ {
toTSDBType(yymsp[-1].minor.yy0.type); toTSDBType(yymsp[-1].minor.yy0.type);
yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n;
...@@ -2571,7 +2885,7 @@ static void yy_reduce( ...@@ -2571,7 +2885,7 @@ static void yy_reduce(
} }
yymsp[-1].minor.yy421 = yylhsminor.yy421; yymsp[-1].minor.yy421 = yylhsminor.yy421;
break; break;
case 157: /* tablelist ::= ids cpxName ids */ case 160: /* tablelist ::= ids cpxName ids */
{ {
toTSDBType(yymsp[-2].minor.yy0.type); toTSDBType(yymsp[-2].minor.yy0.type);
toTSDBType(yymsp[0].minor.yy0.type); toTSDBType(yymsp[0].minor.yy0.type);
...@@ -2581,7 +2895,7 @@ static void yy_reduce( ...@@ -2581,7 +2895,7 @@ static void yy_reduce(
} }
yymsp[-2].minor.yy421 = yylhsminor.yy421; yymsp[-2].minor.yy421 = yylhsminor.yy421;
break; break;
case 158: /* tablelist ::= tablelist COMMA ids cpxName */ case 161: /* tablelist ::= tablelist COMMA ids cpxName */
{ {
toTSDBType(yymsp[-1].minor.yy0.type); toTSDBType(yymsp[-1].minor.yy0.type);
yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n;
...@@ -2590,7 +2904,7 @@ static void yy_reduce( ...@@ -2590,7 +2904,7 @@ static void yy_reduce(
} }
yymsp[-3].minor.yy421 = yylhsminor.yy421; yymsp[-3].minor.yy421 = yylhsminor.yy421;
break; break;
case 159: /* tablelist ::= tablelist COMMA ids cpxName ids */ case 162: /* tablelist ::= tablelist COMMA ids cpxName ids */
{ {
toTSDBType(yymsp[-2].minor.yy0.type); toTSDBType(yymsp[-2].minor.yy0.type);
toTSDBType(yymsp[0].minor.yy0.type); toTSDBType(yymsp[0].minor.yy0.type);
...@@ -2600,23 +2914,23 @@ static void yy_reduce( ...@@ -2600,23 +2914,23 @@ static void yy_reduce(
} }
yymsp[-4].minor.yy421 = yylhsminor.yy421; yymsp[-4].minor.yy421 = yylhsminor.yy421;
break; break;
case 160: /* tmvar ::= VARIABLE */ case 163: /* tmvar ::= VARIABLE */
{yylhsminor.yy0 = yymsp[0].minor.yy0;} {yylhsminor.yy0 = yymsp[0].minor.yy0;}
yymsp[0].minor.yy0 = yylhsminor.yy0; yymsp[0].minor.yy0 = yylhsminor.yy0;
break; break;
case 161: /* interval_opt ::= INTERVAL LP tmvar RP */ case 164: /* interval_opt ::= INTERVAL LP tmvar RP */
{yymsp[-3].minor.yy400.interval = yymsp[-1].minor.yy0; yymsp[-3].minor.yy400.offset.n = 0; yymsp[-3].minor.yy400.offset.z = NULL; yymsp[-3].minor.yy400.offset.type = 0;} {yymsp[-3].minor.yy400.interval = yymsp[-1].minor.yy0; yymsp[-3].minor.yy400.offset.n = 0; yymsp[-3].minor.yy400.offset.z = NULL; yymsp[-3].minor.yy400.offset.type = 0;}
break; break;
case 162: /* interval_opt ::= INTERVAL LP tmvar COMMA tmvar RP */ case 165: /* interval_opt ::= INTERVAL LP tmvar COMMA tmvar RP */
{yymsp[-5].minor.yy400.interval = yymsp[-3].minor.yy0; yymsp[-5].minor.yy400.offset = yymsp[-1].minor.yy0;} {yymsp[-5].minor.yy400.interval = yymsp[-3].minor.yy0; yymsp[-5].minor.yy400.offset = yymsp[-1].minor.yy0;}
break; break;
case 163: /* interval_opt ::= */ case 166: /* interval_opt ::= */
{memset(&yymsp[1].minor.yy400, 0, sizeof(yymsp[1].minor.yy400));} {memset(&yymsp[1].minor.yy400, 0, sizeof(yymsp[1].minor.yy400));}
break; break;
case 164: /* fill_opt ::= */ case 167: /* fill_opt ::= */
{yymsp[1].minor.yy421 = 0; } {yymsp[1].minor.yy421 = 0; }
break; break;
case 165: /* fill_opt ::= FILL LP ID COMMA tagitemlist RP */ case 168: /* fill_opt ::= FILL LP ID COMMA tagitemlist RP */
{ {
tVariant A = {0}; tVariant A = {0};
toTSDBType(yymsp[-3].minor.yy0.type); toTSDBType(yymsp[-3].minor.yy0.type);
...@@ -2626,37 +2940,37 @@ static void yy_reduce( ...@@ -2626,37 +2940,37 @@ static void yy_reduce(
yymsp[-5].minor.yy421 = yymsp[-1].minor.yy421; yymsp[-5].minor.yy421 = yymsp[-1].minor.yy421;
} }
break; break;
case 166: /* fill_opt ::= FILL LP ID RP */ case 169: /* fill_opt ::= FILL LP ID RP */
{ {
toTSDBType(yymsp[-1].minor.yy0.type); toTSDBType(yymsp[-1].minor.yy0.type);
yymsp[-3].minor.yy421 = tVariantListAppendToken(NULL, &yymsp[-1].minor.yy0, -1); yymsp[-3].minor.yy421 = tVariantListAppendToken(NULL, &yymsp[-1].minor.yy0, -1);
} }
break; break;
case 167: /* sliding_opt ::= SLIDING LP tmvar RP */ case 170: /* sliding_opt ::= SLIDING LP tmvar RP */
{yymsp[-3].minor.yy0 = yymsp[-1].minor.yy0; } {yymsp[-3].minor.yy0 = yymsp[-1].minor.yy0; }
break; break;
case 168: /* sliding_opt ::= */ case 171: /* sliding_opt ::= */
{yymsp[1].minor.yy0.n = 0; yymsp[1].minor.yy0.z = NULL; yymsp[1].minor.yy0.type = 0; } {yymsp[1].minor.yy0.n = 0; yymsp[1].minor.yy0.z = NULL; yymsp[1].minor.yy0.type = 0; }
break; break;
case 169: /* orderby_opt ::= */ case 172: /* orderby_opt ::= */
{yymsp[1].minor.yy421 = 0;} {yymsp[1].minor.yy421 = 0;}
break; break;
case 170: /* orderby_opt ::= ORDER BY sortlist */ case 173: /* orderby_opt ::= ORDER BY sortlist */
{yymsp[-2].minor.yy421 = yymsp[0].minor.yy421;} {yymsp[-2].minor.yy421 = yymsp[0].minor.yy421;}
break; break;
case 171: /* sortlist ::= sortlist COMMA item sortorder */ case 174: /* sortlist ::= sortlist COMMA item sortorder */
{ {
yylhsminor.yy421 = tVariantListAppend(yymsp[-3].minor.yy421, &yymsp[-1].minor.yy430, yymsp[0].minor.yy96); yylhsminor.yy421 = tVariantListAppend(yymsp[-3].minor.yy421, &yymsp[-1].minor.yy430, yymsp[0].minor.yy96);
} }
yymsp[-3].minor.yy421 = yylhsminor.yy421; yymsp[-3].minor.yy421 = yylhsminor.yy421;
break; break;
case 172: /* sortlist ::= item sortorder */ case 175: /* sortlist ::= item sortorder */
{ {
yylhsminor.yy421 = tVariantListAppend(NULL, &yymsp[-1].minor.yy430, yymsp[0].minor.yy96); yylhsminor.yy421 = tVariantListAppend(NULL, &yymsp[-1].minor.yy430, yymsp[0].minor.yy96);
} }
yymsp[-1].minor.yy421 = yylhsminor.yy421; yymsp[-1].minor.yy421 = yylhsminor.yy421;
break; break;
case 173: /* item ::= ids cpxName */ case 176: /* item ::= ids cpxName */
{ {
toTSDBType(yymsp[-1].minor.yy0.type); toTSDBType(yymsp[-1].minor.yy0.type);
yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n;
...@@ -2665,240 +2979,240 @@ static void yy_reduce( ...@@ -2665,240 +2979,240 @@ static void yy_reduce(
} }
yymsp[-1].minor.yy430 = yylhsminor.yy430; yymsp[-1].minor.yy430 = yylhsminor.yy430;
break; break;
case 174: /* sortorder ::= ASC */ case 177: /* sortorder ::= ASC */
{ yymsp[0].minor.yy96 = TSDB_ORDER_ASC; } { yymsp[0].minor.yy96 = TSDB_ORDER_ASC; }
break; break;
case 175: /* sortorder ::= DESC */ case 178: /* sortorder ::= DESC */
{ yymsp[0].minor.yy96 = TSDB_ORDER_DESC;} { yymsp[0].minor.yy96 = TSDB_ORDER_DESC;}
break; break;
case 176: /* sortorder ::= */ case 179: /* sortorder ::= */
{ yymsp[1].minor.yy96 = TSDB_ORDER_ASC; } { yymsp[1].minor.yy96 = TSDB_ORDER_ASC; }
break; break;
case 177: /* groupby_opt ::= */ case 180: /* groupby_opt ::= */
{ yymsp[1].minor.yy421 = 0;} { yymsp[1].minor.yy421 = 0;}
break; break;
case 178: /* groupby_opt ::= GROUP BY grouplist */ case 181: /* groupby_opt ::= GROUP BY grouplist */
{ yymsp[-2].minor.yy421 = yymsp[0].minor.yy421;} { yymsp[-2].minor.yy421 = yymsp[0].minor.yy421;}
break; break;
case 179: /* grouplist ::= grouplist COMMA item */ case 182: /* grouplist ::= grouplist COMMA item */
{ {
yylhsminor.yy421 = tVariantListAppend(yymsp[-2].minor.yy421, &yymsp[0].minor.yy430, -1); yylhsminor.yy421 = tVariantListAppend(yymsp[-2].minor.yy421, &yymsp[0].minor.yy430, -1);
} }
yymsp[-2].minor.yy421 = yylhsminor.yy421; yymsp[-2].minor.yy421 = yylhsminor.yy421;
break; break;
case 180: /* grouplist ::= item */ case 183: /* grouplist ::= item */
{ {
yylhsminor.yy421 = tVariantListAppend(NULL, &yymsp[0].minor.yy430, -1); yylhsminor.yy421 = tVariantListAppend(NULL, &yymsp[0].minor.yy430, -1);
} }
yymsp[0].minor.yy421 = yylhsminor.yy421; yymsp[0].minor.yy421 = yylhsminor.yy421;
break; break;
case 181: /* having_opt ::= */ case 184: /* having_opt ::= */
case 191: /* where_opt ::= */ yytestcase(yyruleno==191); case 194: /* where_opt ::= */ yytestcase(yyruleno==194);
case 229: /* expritem ::= */ yytestcase(yyruleno==229); case 232: /* expritem ::= */ yytestcase(yyruleno==232);
{yymsp[1].minor.yy78 = 0;} {yymsp[1].minor.yy78 = 0;}
break; break;
case 182: /* having_opt ::= HAVING expr */ case 185: /* having_opt ::= HAVING expr */
case 192: /* where_opt ::= WHERE expr */ yytestcase(yyruleno==192); case 195: /* where_opt ::= WHERE expr */ yytestcase(yyruleno==195);
{yymsp[-1].minor.yy78 = yymsp[0].minor.yy78;} {yymsp[-1].minor.yy78 = yymsp[0].minor.yy78;}
break; break;
case 183: /* limit_opt ::= */ case 186: /* limit_opt ::= */
case 187: /* slimit_opt ::= */ yytestcase(yyruleno==187); case 190: /* slimit_opt ::= */ yytestcase(yyruleno==190);
{yymsp[1].minor.yy167.limit = -1; yymsp[1].minor.yy167.offset = 0;} {yymsp[1].minor.yy167.limit = -1; yymsp[1].minor.yy167.offset = 0;}
break; break;
case 184: /* limit_opt ::= LIMIT signed */ case 187: /* limit_opt ::= LIMIT signed */
case 188: /* slimit_opt ::= SLIMIT signed */ yytestcase(yyruleno==188); case 191: /* slimit_opt ::= SLIMIT signed */ yytestcase(yyruleno==191);
{yymsp[-1].minor.yy167.limit = yymsp[0].minor.yy325; yymsp[-1].minor.yy167.offset = 0;} {yymsp[-1].minor.yy167.limit = yymsp[0].minor.yy325; yymsp[-1].minor.yy167.offset = 0;}
break; break;
case 185: /* limit_opt ::= LIMIT signed OFFSET signed */ case 188: /* limit_opt ::= LIMIT signed OFFSET signed */
{ yymsp[-3].minor.yy167.limit = yymsp[-2].minor.yy325; yymsp[-3].minor.yy167.offset = yymsp[0].minor.yy325;} { yymsp[-3].minor.yy167.limit = yymsp[-2].minor.yy325; yymsp[-3].minor.yy167.offset = yymsp[0].minor.yy325;}
break; break;
case 186: /* limit_opt ::= LIMIT signed COMMA signed */ case 189: /* limit_opt ::= LIMIT signed COMMA signed */
{ yymsp[-3].minor.yy167.limit = yymsp[0].minor.yy325; yymsp[-3].minor.yy167.offset = yymsp[-2].minor.yy325;} { yymsp[-3].minor.yy167.limit = yymsp[0].minor.yy325; yymsp[-3].minor.yy167.offset = yymsp[-2].minor.yy325;}
break; break;
case 189: /* slimit_opt ::= SLIMIT signed SOFFSET signed */ case 192: /* slimit_opt ::= SLIMIT signed SOFFSET signed */
{yymsp[-3].minor.yy167.limit = yymsp[-2].minor.yy325; yymsp[-3].minor.yy167.offset = yymsp[0].minor.yy325;} {yymsp[-3].minor.yy167.limit = yymsp[-2].minor.yy325; yymsp[-3].minor.yy167.offset = yymsp[0].minor.yy325;}
break; break;
case 190: /* slimit_opt ::= SLIMIT signed COMMA signed */ case 193: /* slimit_opt ::= SLIMIT signed COMMA signed */
{yymsp[-3].minor.yy167.limit = yymsp[0].minor.yy325; yymsp[-3].minor.yy167.offset = yymsp[-2].minor.yy325;} {yymsp[-3].minor.yy167.limit = yymsp[0].minor.yy325; yymsp[-3].minor.yy167.offset = yymsp[-2].minor.yy325;}
break; break;
case 193: /* expr ::= LP expr RP */ case 196: /* expr ::= LP expr RP */
{yylhsminor.yy78 = yymsp[-1].minor.yy78; yylhsminor.yy78->token.z = yymsp[-2].minor.yy0.z; yylhsminor.yy78->token.n = (yymsp[0].minor.yy0.z - yymsp[-2].minor.yy0.z + 1);} {yylhsminor.yy78 = yymsp[-1].minor.yy78; yylhsminor.yy78->token.z = yymsp[-2].minor.yy0.z; yylhsminor.yy78->token.n = (yymsp[0].minor.yy0.z - yymsp[-2].minor.yy0.z + 1);}
yymsp[-2].minor.yy78 = yylhsminor.yy78; yymsp[-2].minor.yy78 = yylhsminor.yy78;
break; break;
case 194: /* expr ::= ID */ case 197: /* expr ::= ID */
{ yylhsminor.yy78 = tSqlExprIdValueCreate(&yymsp[0].minor.yy0, TK_ID);} { yylhsminor.yy78 = tSqlExprIdValueCreate(&yymsp[0].minor.yy0, TK_ID);}
yymsp[0].minor.yy78 = yylhsminor.yy78; yymsp[0].minor.yy78 = yylhsminor.yy78;
break; break;
case 195: /* expr ::= ID DOT ID */ case 198: /* expr ::= ID DOT ID */
{ yymsp[-2].minor.yy0.n += (1+yymsp[0].minor.yy0.n); yylhsminor.yy78 = tSqlExprIdValueCreate(&yymsp[-2].minor.yy0, TK_ID);} { yymsp[-2].minor.yy0.n += (1+yymsp[0].minor.yy0.n); yylhsminor.yy78 = tSqlExprIdValueCreate(&yymsp[-2].minor.yy0, TK_ID);}
yymsp[-2].minor.yy78 = yylhsminor.yy78; yymsp[-2].minor.yy78 = yylhsminor.yy78;
break; break;
case 196: /* expr ::= ID DOT STAR */ case 199: /* expr ::= ID DOT STAR */
{ yymsp[-2].minor.yy0.n += (1+yymsp[0].minor.yy0.n); yylhsminor.yy78 = tSqlExprIdValueCreate(&yymsp[-2].minor.yy0, TK_ALL);} { yymsp[-2].minor.yy0.n += (1+yymsp[0].minor.yy0.n); yylhsminor.yy78 = tSqlExprIdValueCreate(&yymsp[-2].minor.yy0, TK_ALL);}
yymsp[-2].minor.yy78 = yylhsminor.yy78; yymsp[-2].minor.yy78 = yylhsminor.yy78;
break; break;
case 197: /* expr ::= INTEGER */ case 200: /* expr ::= INTEGER */
{ yylhsminor.yy78 = tSqlExprIdValueCreate(&yymsp[0].minor.yy0, TK_INTEGER);} { yylhsminor.yy78 = tSqlExprIdValueCreate(&yymsp[0].minor.yy0, TK_INTEGER);}
yymsp[0].minor.yy78 = yylhsminor.yy78; yymsp[0].minor.yy78 = yylhsminor.yy78;
break; break;
case 198: /* expr ::= MINUS INTEGER */ case 201: /* expr ::= MINUS INTEGER */
case 199: /* expr ::= PLUS INTEGER */ yytestcase(yyruleno==199); case 202: /* expr ::= PLUS INTEGER */ yytestcase(yyruleno==202);
{ yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; yymsp[-1].minor.yy0.type = TK_INTEGER; yylhsminor.yy78 = tSqlExprIdValueCreate(&yymsp[-1].minor.yy0, TK_INTEGER);} { yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; yymsp[-1].minor.yy0.type = TK_INTEGER; yylhsminor.yy78 = tSqlExprIdValueCreate(&yymsp[-1].minor.yy0, TK_INTEGER);}
yymsp[-1].minor.yy78 = yylhsminor.yy78; yymsp[-1].minor.yy78 = yylhsminor.yy78;
break; break;
case 200: /* expr ::= FLOAT */ case 203: /* expr ::= FLOAT */
{ yylhsminor.yy78 = tSqlExprIdValueCreate(&yymsp[0].minor.yy0, TK_FLOAT);} { yylhsminor.yy78 = tSqlExprIdValueCreate(&yymsp[0].minor.yy0, TK_FLOAT);}
yymsp[0].minor.yy78 = yylhsminor.yy78; yymsp[0].minor.yy78 = yylhsminor.yy78;
break; break;
case 201: /* expr ::= MINUS FLOAT */ case 204: /* expr ::= MINUS FLOAT */
case 202: /* expr ::= PLUS FLOAT */ yytestcase(yyruleno==202); case 205: /* expr ::= PLUS FLOAT */ yytestcase(yyruleno==205);
{ yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; yymsp[-1].minor.yy0.type = TK_FLOAT; yylhsminor.yy78 = tSqlExprIdValueCreate(&yymsp[-1].minor.yy0, TK_FLOAT);} { yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; yymsp[-1].minor.yy0.type = TK_FLOAT; yylhsminor.yy78 = tSqlExprIdValueCreate(&yymsp[-1].minor.yy0, TK_FLOAT);}
yymsp[-1].minor.yy78 = yylhsminor.yy78; yymsp[-1].minor.yy78 = yylhsminor.yy78;
break; break;
case 203: /* expr ::= STRING */ case 206: /* expr ::= STRING */
{ yylhsminor.yy78 = tSqlExprIdValueCreate(&yymsp[0].minor.yy0, TK_STRING);} { yylhsminor.yy78 = tSqlExprIdValueCreate(&yymsp[0].minor.yy0, TK_STRING);}
yymsp[0].minor.yy78 = yylhsminor.yy78; yymsp[0].minor.yy78 = yylhsminor.yy78;
break; break;
case 204: /* expr ::= NOW */ case 207: /* expr ::= NOW */
{ yylhsminor.yy78 = tSqlExprIdValueCreate(&yymsp[0].minor.yy0, TK_NOW); } { yylhsminor.yy78 = tSqlExprIdValueCreate(&yymsp[0].minor.yy0, TK_NOW); }
yymsp[0].minor.yy78 = yylhsminor.yy78; yymsp[0].minor.yy78 = yylhsminor.yy78;
break; break;
case 205: /* expr ::= VARIABLE */ case 208: /* expr ::= VARIABLE */
{ yylhsminor.yy78 = tSqlExprIdValueCreate(&yymsp[0].minor.yy0, TK_VARIABLE);} { yylhsminor.yy78 = tSqlExprIdValueCreate(&yymsp[0].minor.yy0, TK_VARIABLE);}
yymsp[0].minor.yy78 = yylhsminor.yy78; yymsp[0].minor.yy78 = yylhsminor.yy78;
break; break;
case 206: /* expr ::= BOOL */ case 209: /* expr ::= BOOL */
{ yylhsminor.yy78 = tSqlExprIdValueCreate(&yymsp[0].minor.yy0, TK_BOOL);} { yylhsminor.yy78 = tSqlExprIdValueCreate(&yymsp[0].minor.yy0, TK_BOOL);}
yymsp[0].minor.yy78 = yylhsminor.yy78; yymsp[0].minor.yy78 = yylhsminor.yy78;
break; break;
case 207: /* expr ::= ID LP exprlist RP */ case 210: /* expr ::= ID LP exprlist RP */
{ yylhsminor.yy78 = tSqlExprCreateFunction(yymsp[-1].minor.yy166, &yymsp[-3].minor.yy0, &yymsp[0].minor.yy0, yymsp[-3].minor.yy0.type); } { yylhsminor.yy78 = tSqlExprCreateFunction(yymsp[-1].minor.yy166, &yymsp[-3].minor.yy0, &yymsp[0].minor.yy0, yymsp[-3].minor.yy0.type); }
yymsp[-3].minor.yy78 = yylhsminor.yy78; yymsp[-3].minor.yy78 = yylhsminor.yy78;
break; break;
case 208: /* expr ::= ID LP STAR RP */ case 211: /* expr ::= ID LP STAR RP */
{ yylhsminor.yy78 = tSqlExprCreateFunction(NULL, &yymsp[-3].minor.yy0, &yymsp[0].minor.yy0, yymsp[-3].minor.yy0.type); } { yylhsminor.yy78 = tSqlExprCreateFunction(NULL, &yymsp[-3].minor.yy0, &yymsp[0].minor.yy0, yymsp[-3].minor.yy0.type); }
yymsp[-3].minor.yy78 = yylhsminor.yy78; yymsp[-3].minor.yy78 = yylhsminor.yy78;
break; break;
case 209: /* expr ::= expr IS NULL */ case 212: /* expr ::= expr IS NULL */
{yylhsminor.yy78 = tSqlExprCreate(yymsp[-2].minor.yy78, NULL, TK_ISNULL);} {yylhsminor.yy78 = tSqlExprCreate(yymsp[-2].minor.yy78, NULL, TK_ISNULL);}
yymsp[-2].minor.yy78 = yylhsminor.yy78; yymsp[-2].minor.yy78 = yylhsminor.yy78;
break; break;
case 210: /* expr ::= expr IS NOT NULL */ case 213: /* expr ::= expr IS NOT NULL */
{yylhsminor.yy78 = tSqlExprCreate(yymsp[-3].minor.yy78, NULL, TK_NOTNULL);} {yylhsminor.yy78 = tSqlExprCreate(yymsp[-3].minor.yy78, NULL, TK_NOTNULL);}
yymsp[-3].minor.yy78 = yylhsminor.yy78; yymsp[-3].minor.yy78 = yylhsminor.yy78;
break; break;
case 211: /* expr ::= expr LT expr */ case 214: /* expr ::= expr LT expr */
{yylhsminor.yy78 = tSqlExprCreate(yymsp[-2].minor.yy78, yymsp[0].minor.yy78, TK_LT);} {yylhsminor.yy78 = tSqlExprCreate(yymsp[-2].minor.yy78, yymsp[0].minor.yy78, TK_LT);}
yymsp[-2].minor.yy78 = yylhsminor.yy78; yymsp[-2].minor.yy78 = yylhsminor.yy78;
break; break;
case 212: /* expr ::= expr GT expr */ case 215: /* expr ::= expr GT expr */
{yylhsminor.yy78 = tSqlExprCreate(yymsp[-2].minor.yy78, yymsp[0].minor.yy78, TK_GT);} {yylhsminor.yy78 = tSqlExprCreate(yymsp[-2].minor.yy78, yymsp[0].minor.yy78, TK_GT);}
yymsp[-2].minor.yy78 = yylhsminor.yy78; yymsp[-2].minor.yy78 = yylhsminor.yy78;
break; break;
case 213: /* expr ::= expr LE expr */ case 216: /* expr ::= expr LE expr */
{yylhsminor.yy78 = tSqlExprCreate(yymsp[-2].minor.yy78, yymsp[0].minor.yy78, TK_LE);} {yylhsminor.yy78 = tSqlExprCreate(yymsp[-2].minor.yy78, yymsp[0].minor.yy78, TK_LE);}
yymsp[-2].minor.yy78 = yylhsminor.yy78; yymsp[-2].minor.yy78 = yylhsminor.yy78;
break; break;
case 214: /* expr ::= expr GE expr */ case 217: /* expr ::= expr GE expr */
{yylhsminor.yy78 = tSqlExprCreate(yymsp[-2].minor.yy78, yymsp[0].minor.yy78, TK_GE);} {yylhsminor.yy78 = tSqlExprCreate(yymsp[-2].minor.yy78, yymsp[0].minor.yy78, TK_GE);}
yymsp[-2].minor.yy78 = yylhsminor.yy78; yymsp[-2].minor.yy78 = yylhsminor.yy78;
break; break;
case 215: /* expr ::= expr NE expr */ case 218: /* expr ::= expr NE expr */
{yylhsminor.yy78 = tSqlExprCreate(yymsp[-2].minor.yy78, yymsp[0].minor.yy78, TK_NE);} {yylhsminor.yy78 = tSqlExprCreate(yymsp[-2].minor.yy78, yymsp[0].minor.yy78, TK_NE);}
yymsp[-2].minor.yy78 = yylhsminor.yy78; yymsp[-2].minor.yy78 = yylhsminor.yy78;
break; break;
case 216: /* expr ::= expr EQ expr */ case 219: /* expr ::= expr EQ expr */
{yylhsminor.yy78 = tSqlExprCreate(yymsp[-2].minor.yy78, yymsp[0].minor.yy78, TK_EQ);} {yylhsminor.yy78 = tSqlExprCreate(yymsp[-2].minor.yy78, yymsp[0].minor.yy78, TK_EQ);}
yymsp[-2].minor.yy78 = yylhsminor.yy78; yymsp[-2].minor.yy78 = yylhsminor.yy78;
break; break;
case 217: /* expr ::= expr AND expr */ case 220: /* expr ::= expr AND expr */
{yylhsminor.yy78 = tSqlExprCreate(yymsp[-2].minor.yy78, yymsp[0].minor.yy78, TK_AND);} {yylhsminor.yy78 = tSqlExprCreate(yymsp[-2].minor.yy78, yymsp[0].minor.yy78, TK_AND);}
yymsp[-2].minor.yy78 = yylhsminor.yy78; yymsp[-2].minor.yy78 = yylhsminor.yy78;
break; break;
case 218: /* expr ::= expr OR expr */ case 221: /* expr ::= expr OR expr */
{yylhsminor.yy78 = tSqlExprCreate(yymsp[-2].minor.yy78, yymsp[0].minor.yy78, TK_OR); } {yylhsminor.yy78 = tSqlExprCreate(yymsp[-2].minor.yy78, yymsp[0].minor.yy78, TK_OR); }
yymsp[-2].minor.yy78 = yylhsminor.yy78; yymsp[-2].minor.yy78 = yylhsminor.yy78;
break; break;
case 219: /* expr ::= expr PLUS expr */ case 222: /* expr ::= expr PLUS expr */
{yylhsminor.yy78 = tSqlExprCreate(yymsp[-2].minor.yy78, yymsp[0].minor.yy78, TK_PLUS); } {yylhsminor.yy78 = tSqlExprCreate(yymsp[-2].minor.yy78, yymsp[0].minor.yy78, TK_PLUS); }
yymsp[-2].minor.yy78 = yylhsminor.yy78; yymsp[-2].minor.yy78 = yylhsminor.yy78;
break; break;
case 220: /* expr ::= expr MINUS expr */ case 223: /* expr ::= expr MINUS expr */
{yylhsminor.yy78 = tSqlExprCreate(yymsp[-2].minor.yy78, yymsp[0].minor.yy78, TK_MINUS); } {yylhsminor.yy78 = tSqlExprCreate(yymsp[-2].minor.yy78, yymsp[0].minor.yy78, TK_MINUS); }
yymsp[-2].minor.yy78 = yylhsminor.yy78; yymsp[-2].minor.yy78 = yylhsminor.yy78;
break; break;
case 221: /* expr ::= expr STAR expr */ case 224: /* expr ::= expr STAR expr */
{yylhsminor.yy78 = tSqlExprCreate(yymsp[-2].minor.yy78, yymsp[0].minor.yy78, TK_STAR); } {yylhsminor.yy78 = tSqlExprCreate(yymsp[-2].minor.yy78, yymsp[0].minor.yy78, TK_STAR); }
yymsp[-2].minor.yy78 = yylhsminor.yy78; yymsp[-2].minor.yy78 = yylhsminor.yy78;
break; break;
case 222: /* expr ::= expr SLASH expr */ case 225: /* expr ::= expr SLASH expr */
{yylhsminor.yy78 = tSqlExprCreate(yymsp[-2].minor.yy78, yymsp[0].minor.yy78, TK_DIVIDE);} {yylhsminor.yy78 = tSqlExprCreate(yymsp[-2].minor.yy78, yymsp[0].minor.yy78, TK_DIVIDE);}
yymsp[-2].minor.yy78 = yylhsminor.yy78; yymsp[-2].minor.yy78 = yylhsminor.yy78;
break; break;
case 223: /* expr ::= expr REM expr */ case 226: /* expr ::= expr REM expr */
{yylhsminor.yy78 = tSqlExprCreate(yymsp[-2].minor.yy78, yymsp[0].minor.yy78, TK_REM); } {yylhsminor.yy78 = tSqlExprCreate(yymsp[-2].minor.yy78, yymsp[0].minor.yy78, TK_REM); }
yymsp[-2].minor.yy78 = yylhsminor.yy78; yymsp[-2].minor.yy78 = yylhsminor.yy78;
break; break;
case 224: /* expr ::= expr LIKE expr */ case 227: /* expr ::= expr LIKE expr */
{yylhsminor.yy78 = tSqlExprCreate(yymsp[-2].minor.yy78, yymsp[0].minor.yy78, TK_LIKE); } {yylhsminor.yy78 = tSqlExprCreate(yymsp[-2].minor.yy78, yymsp[0].minor.yy78, TK_LIKE); }
yymsp[-2].minor.yy78 = yylhsminor.yy78; yymsp[-2].minor.yy78 = yylhsminor.yy78;
break; break;
case 225: /* expr ::= expr IN LP exprlist RP */ case 228: /* expr ::= expr IN LP exprlist RP */
{yylhsminor.yy78 = tSqlExprCreate(yymsp[-4].minor.yy78, (tSQLExpr*)yymsp[-1].minor.yy166, TK_IN); } {yylhsminor.yy78 = tSqlExprCreate(yymsp[-4].minor.yy78, (tSQLExpr*)yymsp[-1].minor.yy166, TK_IN); }
yymsp[-4].minor.yy78 = yylhsminor.yy78; yymsp[-4].minor.yy78 = yylhsminor.yy78;
break; break;
case 226: /* exprlist ::= exprlist COMMA expritem */ case 229: /* exprlist ::= exprlist COMMA expritem */
{yylhsminor.yy166 = tSqlExprListAppend(yymsp[-2].minor.yy166,yymsp[0].minor.yy78,0);} {yylhsminor.yy166 = tSqlExprListAppend(yymsp[-2].minor.yy166,yymsp[0].minor.yy78,0);}
yymsp[-2].minor.yy166 = yylhsminor.yy166; yymsp[-2].minor.yy166 = yylhsminor.yy166;
break; break;
case 227: /* exprlist ::= expritem */ case 230: /* exprlist ::= expritem */
{yylhsminor.yy166 = tSqlExprListAppend(0,yymsp[0].minor.yy78,0);} {yylhsminor.yy166 = tSqlExprListAppend(0,yymsp[0].minor.yy78,0);}
yymsp[0].minor.yy166 = yylhsminor.yy166; yymsp[0].minor.yy166 = yylhsminor.yy166;
break; break;
case 228: /* expritem ::= expr */ case 231: /* expritem ::= expr */
{yylhsminor.yy78 = yymsp[0].minor.yy78;} {yylhsminor.yy78 = yymsp[0].minor.yy78;}
yymsp[0].minor.yy78 = yylhsminor.yy78; yymsp[0].minor.yy78 = yylhsminor.yy78;
break; break;
case 230: /* cmd ::= RESET QUERY CACHE */ case 233: /* cmd ::= RESET QUERY CACHE */
{ setDCLSQLElems(pInfo, TSDB_SQL_RESET_CACHE, 0);} { setDCLSQLElems(pInfo, TSDB_SQL_RESET_CACHE, 0);}
break; break;
case 231: /* cmd ::= ALTER TABLE ids cpxName ADD COLUMN columnlist */ case 234: /* cmd ::= ALTER TABLE ids cpxName ADD COLUMN columnlist */
{ {
yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n; yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n;
SAlterTableSQL* pAlterTable = tAlterTableSqlElems(&yymsp[-4].minor.yy0, yymsp[0].minor.yy421, NULL, TSDB_ALTER_TABLE_ADD_COLUMN); SAlterTableSQL* pAlterTable = tAlterTableSqlElems(&yymsp[-4].minor.yy0, yymsp[0].minor.yy421, NULL, TSDB_ALTER_TABLE_ADD_COLUMN, -1);
setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE);
} }
break; break;
case 232: /* cmd ::= ALTER TABLE ids cpxName DROP COLUMN ids */ case 235: /* cmd ::= ALTER TABLE ids cpxName DROP COLUMN ids */
{ {
yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n; yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n;
toTSDBType(yymsp[0].minor.yy0.type); toTSDBType(yymsp[0].minor.yy0.type);
SArray* K = tVariantListAppendToken(NULL, &yymsp[0].minor.yy0, -1); SArray* K = tVariantListAppendToken(NULL, &yymsp[0].minor.yy0, -1);
SAlterTableSQL* pAlterTable = tAlterTableSqlElems(&yymsp[-4].minor.yy0, NULL, K, TSDB_ALTER_TABLE_DROP_COLUMN); SAlterTableSQL* pAlterTable = tAlterTableSqlElems(&yymsp[-4].minor.yy0, NULL, K, TSDB_ALTER_TABLE_DROP_COLUMN, -1);
setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE);
} }
break; break;
case 233: /* cmd ::= ALTER TABLE ids cpxName ADD TAG columnlist */ case 236: /* cmd ::= ALTER TABLE ids cpxName ADD TAG columnlist */
{ {
yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n; yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n;
SAlterTableSQL* pAlterTable = tAlterTableSqlElems(&yymsp[-4].minor.yy0, yymsp[0].minor.yy421, NULL, TSDB_ALTER_TABLE_ADD_TAG_COLUMN); SAlterTableSQL* pAlterTable = tAlterTableSqlElems(&yymsp[-4].minor.yy0, yymsp[0].minor.yy421, NULL, TSDB_ALTER_TABLE_ADD_TAG_COLUMN, -1);
setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE);
} }
break; break;
case 234: /* cmd ::= ALTER TABLE ids cpxName DROP TAG ids */ case 237: /* cmd ::= ALTER TABLE ids cpxName DROP TAG ids */
{ {
yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n; yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n;
toTSDBType(yymsp[0].minor.yy0.type); toTSDBType(yymsp[0].minor.yy0.type);
SArray* A = tVariantListAppendToken(NULL, &yymsp[0].minor.yy0, -1); SArray* A = tVariantListAppendToken(NULL, &yymsp[0].minor.yy0, -1);
SAlterTableSQL* pAlterTable = tAlterTableSqlElems(&yymsp[-4].minor.yy0, NULL, A, TSDB_ALTER_TABLE_DROP_TAG_COLUMN); SAlterTableSQL* pAlterTable = tAlterTableSqlElems(&yymsp[-4].minor.yy0, NULL, A, TSDB_ALTER_TABLE_DROP_TAG_COLUMN, -1);
setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE);
} }
break; break;
case 235: /* cmd ::= ALTER TABLE ids cpxName CHANGE TAG ids ids */ case 238: /* cmd ::= ALTER TABLE ids cpxName CHANGE TAG ids ids */
{ {
yymsp[-5].minor.yy0.n += yymsp[-4].minor.yy0.n; yymsp[-5].minor.yy0.n += yymsp[-4].minor.yy0.n;
...@@ -2908,11 +3222,11 @@ static void yy_reduce( ...@@ -2908,11 +3222,11 @@ static void yy_reduce(
toTSDBType(yymsp[0].minor.yy0.type); toTSDBType(yymsp[0].minor.yy0.type);
A = tVariantListAppendToken(A, &yymsp[0].minor.yy0, -1); A = tVariantListAppendToken(A, &yymsp[0].minor.yy0, -1);
SAlterTableSQL* pAlterTable = tAlterTableSqlElems(&yymsp[-5].minor.yy0, NULL, A, TSDB_ALTER_TABLE_CHANGE_TAG_COLUMN); SAlterTableSQL* pAlterTable = tAlterTableSqlElems(&yymsp[-5].minor.yy0, NULL, A, TSDB_ALTER_TABLE_CHANGE_TAG_COLUMN, -1);
setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE);
} }
break; break;
case 236: /* cmd ::= ALTER TABLE ids cpxName SET TAG ids EQ tagitem */ case 239: /* cmd ::= ALTER TABLE ids cpxName SET TAG ids EQ tagitem */
{ {
yymsp[-6].minor.yy0.n += yymsp[-5].minor.yy0.n; yymsp[-6].minor.yy0.n += yymsp[-5].minor.yy0.n;
...@@ -2920,26 +3234,76 @@ static void yy_reduce( ...@@ -2920,26 +3234,76 @@ static void yy_reduce(
SArray* A = tVariantListAppendToken(NULL, &yymsp[-2].minor.yy0, -1); SArray* A = tVariantListAppendToken(NULL, &yymsp[-2].minor.yy0, -1);
A = tVariantListAppend(A, &yymsp[0].minor.yy430, -1); A = tVariantListAppend(A, &yymsp[0].minor.yy430, -1);
SAlterTableSQL* pAlterTable = tAlterTableSqlElems(&yymsp[-6].minor.yy0, NULL, A, TSDB_ALTER_TABLE_UPDATE_TAG_VAL); SAlterTableSQL* pAlterTable = tAlterTableSqlElems(&yymsp[-6].minor.yy0, NULL, A, TSDB_ALTER_TABLE_UPDATE_TAG_VAL, -1);
setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE);
}
break;
case 240: /* cmd ::= ALTER STABLE ids cpxName ADD COLUMN columnlist */
{
yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n;
SAlterTableSQL* pAlterTable = tAlterTableSqlElems(&yymsp[-4].minor.yy0, yymsp[0].minor.yy421, NULL, TSDB_ALTER_TABLE_ADD_COLUMN, TSDB_SUPER_TABLE);
setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE);
}
break;
case 241: /* cmd ::= ALTER STABLE ids cpxName DROP COLUMN ids */
{
yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n;
toTSDBType(yymsp[0].minor.yy0.type);
SArray* K = tVariantListAppendToken(NULL, &yymsp[0].minor.yy0, -1);
SAlterTableSQL* pAlterTable = tAlterTableSqlElems(&yymsp[-4].minor.yy0, NULL, K, TSDB_ALTER_TABLE_DROP_COLUMN, TSDB_SUPER_TABLE);
setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE);
}
break;
case 242: /* cmd ::= ALTER STABLE ids cpxName ADD TAG columnlist */
{
yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n;
SAlterTableSQL* pAlterTable = tAlterTableSqlElems(&yymsp[-4].minor.yy0, yymsp[0].minor.yy421, NULL, TSDB_ALTER_TABLE_ADD_TAG_COLUMN, TSDB_SUPER_TABLE);
setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE);
}
break;
case 243: /* cmd ::= ALTER STABLE ids cpxName DROP TAG ids */
{
yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n;
toTSDBType(yymsp[0].minor.yy0.type);
SArray* A = tVariantListAppendToken(NULL, &yymsp[0].minor.yy0, -1);
SAlterTableSQL* pAlterTable = tAlterTableSqlElems(&yymsp[-4].minor.yy0, NULL, A, TSDB_ALTER_TABLE_DROP_TAG_COLUMN, TSDB_SUPER_TABLE);
setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE);
}
break;
case 244: /* cmd ::= ALTER STABLE ids cpxName CHANGE TAG ids ids */
{
yymsp[-5].minor.yy0.n += yymsp[-4].minor.yy0.n;
toTSDBType(yymsp[-1].minor.yy0.type);
SArray* A = tVariantListAppendToken(NULL, &yymsp[-1].minor.yy0, -1);
toTSDBType(yymsp[0].minor.yy0.type);
A = tVariantListAppendToken(A, &yymsp[0].minor.yy0, -1);
SAlterTableSQL* pAlterTable = tAlterTableSqlElems(&yymsp[-5].minor.yy0, NULL, A, TSDB_ALTER_TABLE_CHANGE_TAG_COLUMN, TSDB_SUPER_TABLE);
setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE); setSqlInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE);
} }
break; break;
case 237: /* cmd ::= KILL CONNECTION INTEGER */ case 245: /* cmd ::= KILL CONNECTION INTEGER */
{setKillSql(pInfo, TSDB_SQL_KILL_CONNECTION, &yymsp[0].minor.yy0);} {setKillSql(pInfo, TSDB_SQL_KILL_CONNECTION, &yymsp[0].minor.yy0);}
break; break;
case 238: /* cmd ::= KILL STREAM INTEGER COLON INTEGER */ case 246: /* cmd ::= KILL STREAM INTEGER COLON INTEGER */
{yymsp[-2].minor.yy0.n += (yymsp[-1].minor.yy0.n + yymsp[0].minor.yy0.n); setKillSql(pInfo, TSDB_SQL_KILL_STREAM, &yymsp[-2].minor.yy0);} {yymsp[-2].minor.yy0.n += (yymsp[-1].minor.yy0.n + yymsp[0].minor.yy0.n); setKillSql(pInfo, TSDB_SQL_KILL_STREAM, &yymsp[-2].minor.yy0);}
break; break;
case 239: /* cmd ::= KILL QUERY INTEGER COLON INTEGER */ case 247: /* cmd ::= KILL QUERY INTEGER COLON INTEGER */
{yymsp[-2].minor.yy0.n += (yymsp[-1].minor.yy0.n + yymsp[0].minor.yy0.n); setKillSql(pInfo, TSDB_SQL_KILL_QUERY, &yymsp[-2].minor.yy0);} {yymsp[-2].minor.yy0.n += (yymsp[-1].minor.yy0.n + yymsp[0].minor.yy0.n); setKillSql(pInfo, TSDB_SQL_KILL_QUERY, &yymsp[-2].minor.yy0);}
break; break;
default: default:
break; break;
/********** End reduce actions ************************************************/ /********** End reduce actions ************************************************/
}; };
assert( yyruleno<sizeof(yyRuleInfo)/sizeof(yyRuleInfo[0]) ); assert( yyruleno<sizeof(yyRuleInfoLhs)/sizeof(yyRuleInfoLhs[0]) );
yygoto = yyRuleInfo[yyruleno].lhs; yygoto = yyRuleInfoLhs[yyruleno];
yysize = yyRuleInfo[yyruleno].nrhs; yysize = yyRuleInfoNRhs[yyruleno];
yyact = yy_find_reduce_action(yymsp[yysize].stateno,(YYCODETYPE)yygoto); yyact = yy_find_reduce_action(yymsp[yysize].stateno,(YYCODETYPE)yygoto);
/* There are no SHIFTREDUCE actions on nonterminals because the table /* There are no SHIFTREDUCE actions on nonterminals because the table
...@@ -2954,6 +3318,7 @@ static void yy_reduce( ...@@ -2954,6 +3318,7 @@ static void yy_reduce(
yymsp->stateno = (YYACTIONTYPE)yyact; yymsp->stateno = (YYACTIONTYPE)yyact;
yymsp->major = (YYCODETYPE)yygoto; yymsp->major = (YYCODETYPE)yygoto;
yyTraceShift(yypParser, yyact, "... then shift"); yyTraceShift(yypParser, yyact, "... then shift");
return yyact;
} }
/* /*
...@@ -2963,7 +3328,8 @@ static void yy_reduce( ...@@ -2963,7 +3328,8 @@ static void yy_reduce(
static void yy_parse_failed( static void yy_parse_failed(
yyParser *yypParser /* The parser */ yyParser *yypParser /* The parser */
){ ){
ParseARG_FETCH; ParseARG_FETCH
ParseCTX_FETCH
#ifndef NDEBUG #ifndef NDEBUG
if( yyTraceFILE ){ if( yyTraceFILE ){
fprintf(yyTraceFILE,"%sFail!\n",yyTracePrompt); fprintf(yyTraceFILE,"%sFail!\n",yyTracePrompt);
...@@ -2974,7 +3340,8 @@ static void yy_parse_failed( ...@@ -2974,7 +3340,8 @@ static void yy_parse_failed(
** parser fails */ ** parser fails */
/************ Begin %parse_failure code ***************************************/ /************ Begin %parse_failure code ***************************************/
/************ End %parse_failure code *****************************************/ /************ End %parse_failure code *****************************************/
ParseARG_STORE; /* Suppress warning about unused %extra_argument variable */ ParseARG_STORE /* Suppress warning about unused %extra_argument variable */
ParseCTX_STORE
} }
#endif /* YYNOERRORRECOVERY */ #endif /* YYNOERRORRECOVERY */
...@@ -2986,7 +3353,8 @@ static void yy_syntax_error( ...@@ -2986,7 +3353,8 @@ static void yy_syntax_error(
int yymajor, /* The major type of the error token */ int yymajor, /* The major type of the error token */
ParseTOKENTYPE yyminor /* The minor type of the error token */ ParseTOKENTYPE yyminor /* The minor type of the error token */
){ ){
ParseARG_FETCH; ParseARG_FETCH
ParseCTX_FETCH
#define TOKEN yyminor #define TOKEN yyminor
/************ Begin %syntax_error code ****************************************/ /************ Begin %syntax_error code ****************************************/
...@@ -3012,7 +3380,8 @@ static void yy_syntax_error( ...@@ -3012,7 +3380,8 @@ static void yy_syntax_error(
assert(len <= outputBufLen); assert(len <= outputBufLen);
/************ End %syntax_error code ******************************************/ /************ End %syntax_error code ******************************************/
ParseARG_STORE; /* Suppress warning about unused %extra_argument variable */ ParseARG_STORE /* Suppress warning about unused %extra_argument variable */
ParseCTX_STORE
} }
/* /*
...@@ -3021,7 +3390,8 @@ static void yy_syntax_error( ...@@ -3021,7 +3390,8 @@ static void yy_syntax_error(
static void yy_accept( static void yy_accept(
yyParser *yypParser /* The parser */ yyParser *yypParser /* The parser */
){ ){
ParseARG_FETCH; ParseARG_FETCH
ParseCTX_FETCH
#ifndef NDEBUG #ifndef NDEBUG
if( yyTraceFILE ){ if( yyTraceFILE ){
fprintf(yyTraceFILE,"%sAccept!\n",yyTracePrompt); fprintf(yyTraceFILE,"%sAccept!\n",yyTracePrompt);
...@@ -3036,7 +3406,8 @@ static void yy_accept( ...@@ -3036,7 +3406,8 @@ static void yy_accept(
/*********** Begin %parse_accept code *****************************************/ /*********** Begin %parse_accept code *****************************************/
/*********** End %parse_accept code *******************************************/ /*********** End %parse_accept code *******************************************/
ParseARG_STORE; /* Suppress warning about unused %extra_argument variable */ ParseARG_STORE /* Suppress warning about unused %extra_argument variable */
ParseCTX_STORE
} }
/* The main parser program. /* The main parser program.
...@@ -3065,45 +3436,47 @@ void Parse( ...@@ -3065,45 +3436,47 @@ void Parse(
ParseARG_PDECL /* Optional %extra_argument parameter */ ParseARG_PDECL /* Optional %extra_argument parameter */
){ ){
YYMINORTYPE yyminorunion; YYMINORTYPE yyminorunion;
unsigned int yyact; /* The parser action. */ YYACTIONTYPE yyact; /* The parser action. */
#if !defined(YYERRORSYMBOL) && !defined(YYNOERRORRECOVERY) #if !defined(YYERRORSYMBOL) && !defined(YYNOERRORRECOVERY)
int yyendofinput; /* True if we are at the end of input */ int yyendofinput; /* True if we are at the end of input */
#endif #endif
#ifdef YYERRORSYMBOL #ifdef YYERRORSYMBOL
int yyerrorhit = 0; /* True if yymajor has invoked an error */ int yyerrorhit = 0; /* True if yymajor has invoked an error */
#endif #endif
yyParser *yypParser; /* The parser */ yyParser *yypParser = (yyParser*)yyp; /* The parser */
ParseCTX_FETCH
ParseARG_STORE
yypParser = (yyParser*)yyp;
assert( yypParser->yytos!=0 ); assert( yypParser->yytos!=0 );
#if !defined(YYERRORSYMBOL) && !defined(YYNOERRORRECOVERY) #if !defined(YYERRORSYMBOL) && !defined(YYNOERRORRECOVERY)
yyendofinput = (yymajor==0); yyendofinput = (yymajor==0);
#endif #endif
ParseARG_STORE;
yyact = yypParser->yytos->stateno;
#ifndef NDEBUG #ifndef NDEBUG
if( yyTraceFILE ){ if( yyTraceFILE ){
int stateno = yypParser->yytos->stateno; if( yyact < YY_MIN_REDUCE ){
if( stateno < YY_MIN_REDUCE ){
fprintf(yyTraceFILE,"%sInput '%s' in state %d\n", fprintf(yyTraceFILE,"%sInput '%s' in state %d\n",
yyTracePrompt,yyTokenName[yymajor],stateno); yyTracePrompt,yyTokenName[yymajor],yyact);
}else{ }else{
fprintf(yyTraceFILE,"%sInput '%s' with pending reduce %d\n", fprintf(yyTraceFILE,"%sInput '%s' with pending reduce %d\n",
yyTracePrompt,yyTokenName[yymajor],stateno-YY_MIN_REDUCE); yyTracePrompt,yyTokenName[yymajor],yyact-YY_MIN_REDUCE);
} }
} }
#endif #endif
do{ do{
yyact = yy_find_shift_action(yypParser,(YYCODETYPE)yymajor); assert( yyact==yypParser->yytos->stateno );
yyact = yy_find_shift_action((YYCODETYPE)yymajor,yyact);
if( yyact >= YY_MIN_REDUCE ){ if( yyact >= YY_MIN_REDUCE ){
yy_reduce(yypParser,yyact-YY_MIN_REDUCE,yymajor,yyminor); yyact = yy_reduce(yypParser,yyact-YY_MIN_REDUCE,yymajor,
yyminor ParseCTX_PARAM);
}else if( yyact <= YY_MAX_SHIFTREDUCE ){ }else if( yyact <= YY_MAX_SHIFTREDUCE ){
yy_shift(yypParser,yyact,yymajor,yyminor); yy_shift(yypParser,yyact,(YYCODETYPE)yymajor,yyminor);
#ifndef YYNOERRORRECOVERY #ifndef YYNOERRORRECOVERY
yypParser->yyerrcnt--; yypParser->yyerrcnt--;
#endif #endif
yymajor = YYNOCODE; break;
}else if( yyact==YY_ACCEPT_ACTION ){ }else if( yyact==YY_ACCEPT_ACTION ){
yypParser->yytos--; yypParser->yytos--;
yy_accept(yypParser); yy_accept(yypParser);
...@@ -3154,10 +3527,9 @@ void Parse( ...@@ -3154,10 +3527,9 @@ void Parse(
yymajor = YYNOCODE; yymajor = YYNOCODE;
}else{ }else{
while( yypParser->yytos >= yypParser->yystack while( yypParser->yytos >= yypParser->yystack
&& yymx != YYERRORSYMBOL
&& (yyact = yy_find_reduce_action( && (yyact = yy_find_reduce_action(
yypParser->yytos->stateno, yypParser->yytos->stateno,
YYERRORSYMBOL)) >= YY_MIN_REDUCE YYERRORSYMBOL)) > YY_MAX_SHIFTREDUCE
){ ){
yy_pop_parser_stack(yypParser); yy_pop_parser_stack(yypParser);
} }
...@@ -3174,6 +3546,8 @@ void Parse( ...@@ -3174,6 +3546,8 @@ void Parse(
} }
yypParser->yyerrcnt = 3; yypParser->yyerrcnt = 3;
yyerrorhit = 1; yyerrorhit = 1;
if( yymajor==YYNOCODE ) break;
yyact = yypParser->yytos->stateno;
#elif defined(YYNOERRORRECOVERY) #elif defined(YYNOERRORRECOVERY)
/* If the YYNOERRORRECOVERY macro is defined, then do not attempt to /* If the YYNOERRORRECOVERY macro is defined, then do not attempt to
** do any kind of error recovery. Instead, simply invoke the syntax ** do any kind of error recovery. Instead, simply invoke the syntax
...@@ -3184,8 +3558,7 @@ void Parse( ...@@ -3184,8 +3558,7 @@ void Parse(
*/ */
yy_syntax_error(yypParser,yymajor, yyminor); yy_syntax_error(yypParser,yymajor, yyminor);
yy_destructor(yypParser,(YYCODETYPE)yymajor,&yyminorunion); yy_destructor(yypParser,(YYCODETYPE)yymajor,&yyminorunion);
yymajor = YYNOCODE; break;
#else /* YYERRORSYMBOL is not defined */ #else /* YYERRORSYMBOL is not defined */
/* This is what we do if the grammar does not define ERROR: /* This is what we do if the grammar does not define ERROR:
** **
...@@ -3207,10 +3580,10 @@ void Parse( ...@@ -3207,10 +3580,10 @@ void Parse(
yypParser->yyerrcnt = -1; yypParser->yyerrcnt = -1;
#endif #endif
} }
yymajor = YYNOCODE; break;
#endif #endif
} }
}while( yymajor!=YYNOCODE && yypParser->yytos>yypParser->yystack ); }while( yypParser->yytos>yypParser->yystack );
#ifndef NDEBUG #ifndef NDEBUG
if( yyTraceFILE ){ if( yyTraceFILE ){
yyStackEntry *i; yyStackEntry *i;
...@@ -3225,3 +3598,17 @@ void Parse( ...@@ -3225,3 +3598,17 @@ void Parse(
#endif #endif
return; 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
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册