提交 f9e1ca94 编写于 作者: Y yihaoDeng

TD-1589

上级 49413180
......@@ -455,7 +455,7 @@ void tscTableMetaCallBack(void *param, TAOS_RES *res, int code) {
// in case of insert, redo parsing the sql string and build new submit data block for two reasons:
// 1. the table Id(tid & uid) may have been update, the submit block needs to be updated accordingly.
// 2. vnode may need the schema information along with submit block to update its local table schema.
if (pCmd->command == TSDB_SQL_INSERT || pCmd->command == TSDB_SQL_SELECT) {
if (pCmd->command == TSDB_SQL_INSERT || pCmd->command == TSDB_SQL_SELECT || pCmd->command == TSDB_SQL_DELETE) {
tscDebug("%p redo parse sql string and proceed", pSql);
pCmd->parseFinished = false;
tscResetSqlCmdObj(pCmd, false);
......@@ -477,6 +477,8 @@ void tscTableMetaCallBack(void *param, TAOS_RES *res, int code) {
tscHandleInsertRetry(pSql);
} else if (pCmd->command == TSDB_SQL_SELECT) { // in case of other query type, continue
tscProcessSql(pSql);
} else if (pCmd->command == TSDB_SQL_DELETE) {
// handle delete
}
}else { // in all other cases, simple retry
tscProcessSql(pSql);
......
......@@ -90,6 +90,8 @@ static int32_t parseWhereClause(SQueryInfo* pQueryInfo, tSQLExpr** pExpr, SSqlOb
static int32_t parseFillClause(SSqlCmd* pCmd, SQueryInfo* pQueryInfo, SQuerySQL* pQuerySQL);
static int32_t parseOrderbyClause(SSqlCmd* pCmd, SQueryInfo* pQueryInfo, SQuerySQL* pQuerySql, SSchema* pSchema);
static int32_t setDelInfo(SSqlObj* pSql, struct SSqlInfo* pInfo);
static int32_t tsRewriteFieldNameIfNecessary(SSqlCmd* pCmd, SQueryInfo* pQueryInfo);
static int32_t setAlterTableInfo(SSqlObj* pSql, struct SSqlInfo* pInfo);
static int32_t validateSqlFunctionInStreamSql(SSqlCmd* pCmd, SQueryInfo* pQueryInfo);
......@@ -105,6 +107,7 @@ static bool validateOneTags(SSqlCmd* pCmd, TAOS_FIELD* pTagField);
static bool hasTimestampForPointInterpQuery(SQueryInfo* pQueryInfo);
static bool hasNormalColumnFilter(SQueryInfo* pQueryInfo);
static int32_t getTimeFromExpr(tSQLExpr *pExpr, int16_t timePrecision, int64_t *result);
static int32_t parseLimitClause(SSqlCmd* pCmd, SQueryInfo* pQueryInfo, int32_t index, SQuerySQL* pQuerySql, SSqlObj* pSql);
static int32_t parseCreateDBOptions(SSqlCmd* pCmd, SCreateDBInfo* pCreateDbSql);
static int32_t getColumnIndexByName(SSqlCmd* pCmd, const SStrToken* pToken, SQueryInfo* pQueryInfo, SColumnIndex* pIndex);
......@@ -570,7 +573,13 @@ int32_t tscToSQLCmd(SSqlObj* pSql, struct SSqlInfo* pInfo) {
pCmd->parseFinished = 1;
return TSDB_CODE_SUCCESS; // do not build query message here
}
case TSDB_SQL_DELETE: {
if ((code = setDelInfo(pSql, pInfo)) != TSDB_CODE_SUCCESS) {
return code;
}
pCmd->parseFinished = 1;
break;
}
case TSDB_SQL_ALTER_TABLE: {
if ((code = setAlterTableInfo(pSql, pInfo)) != TSDB_CODE_SUCCESS) {
return code;
......@@ -579,6 +588,7 @@ int32_t tscToSQLCmd(SSqlObj* pSql, struct SSqlInfo* pInfo) {
break;
}
case TSDB_SQL_KILL_QUERY:
case TSDB_SQL_KILL_STREAM:
case TSDB_SQL_KILL_CONNECTION: {
......@@ -3696,7 +3706,68 @@ static int32_t handleExprInQueryCond(SSqlCmd* pCmd, SQueryInfo* pQueryInfo, tSQL
return ret;
}
int32_t handleExprInDelCond(SSqlCmd* pCmd, SQueryInfo *pQueryInfo, tSQLExpr* pExpr) {
return TSDB_CODE_SUCCESS;
}
int32_t getDelCond(SSqlCmd* pCmd, SQueryInfo *pQueryInfo, tSQLExpr* pExpr) {
if (pExpr == NULL) {
return TSDB_CODE_SUCCESS;
}
const char* msg1 = "invalid time stamp";
const char* msg2 = "illegal column name";
if (pExpr->nSQLOptr == TK_IN) {
tSQLExpr* pLeft = pExpr->pLeft;
tSQLExpr* pRight = pExpr->pRight;
SColumnIndex index = COLUMN_INDEX_INITIALIZER;
if (getColumnIndexByName(pCmd, &pLeft->colInfo, pQueryInfo, &index) != TSDB_CODE_SUCCESS) {
return invalidSqlErrMsg(tscGetErrorMsgPayload(pCmd), msg2);
}
STableMetaInfo* pTableMetaInfo = tscGetMetaInfo(pQueryInfo, index.tableIndex);
int16_t timePrecision = tscGetTableInfo(pTableMetaInfo->pTableMeta).precision;
if (index.columnIndex == PRIMARYKEY_TIMESTAMP_COL_INDEX) {
if (pRight == NULL || pRight->nSQLOptr != TK_SET || pRight->pParam == NULL) {
return invalidSqlErrMsg(tscGetErrorMsgPayload(pCmd), msg2);
}
int32_t nParam = pRight->pParam->nExpr;
int64_t *tsBuf = malloc(sizeof(int64_t) * nParam);
for (int i = 0; i < nParam; i++) {
int64_t ts;
if (getTimeFromExpr(pRight->pParam->a[i].pNode, timePrecision, &ts) != TSDB_CODE_SUCCESS) {
free(tsBuf);
return invalidSqlErrMsg(tscGetErrorMsgPayload(pCmd), msg1);
} else {
tsBuf[i] = ts;
}
}
qsort(tsBuf, nParam, sizeof(tsBuf[0]), compareInt64Val);
} else {
return invalidSqlErrMsg(tscGetErrorMsgPayload(pCmd), msg2);
}
} else {
return TSDB_CODE_TSC_INVALID_SQL;
}
//const char* msg1 = "del condition must use 'or'";
//tSQLExpr* pLeft = pExpr->pLeft;
//tSQLExpr* pRight = pExpr->pRight;
//int32_t leftType = -1;
//int32_t rightType = -1;
//if (!isExprDirectParentOfLeafNode(pExpr)) {
// int32_t ret = getDelCond(pCmd, pQueryInfo, pExpr->pLeft);
// if (ret != TSDB_CODE_SUCCESS) {
// return ret;
// }
// ret = getDelCond(pCmd, pQueryInfo, pExpr->pRight);
// if (ret != TSDB_CODE_SUCCESS) {
// return ret;
// }
//}
//return handleExprInDelCond(pCmd, pQueryInfo, pExpr);
}
int32_t getQueryCondExpr(SSqlCmd* pCmd, SQueryInfo* pQueryInfo, tSQLExpr** pExpr, SCondExpr* pCondExpr,
int32_t* type, int32_t parentOptr) {
if (pExpr == NULL) {
......@@ -4171,52 +4242,39 @@ int32_t parseWhereClause(SQueryInfo* pQueryInfo, tSQLExpr** pExpr, SSqlObj* pSql
return ret;
}
int32_t getTimeRange(STimeWindow* win, tSQLExpr* pRight, int32_t optr, int16_t timePrecision) {
// this is join condition, do nothing
if (pRight->nSQLOptr == TK_ID) {
return TSDB_CODE_SUCCESS;
}
/*
* filter primary ts filter expression like:
* where ts in ('2015-12-12 4:8:12')
*/
if (pRight->nSQLOptr == TK_SET || optr == TK_IN) {
return TSDB_CODE_TSC_INVALID_SQL;
}
int32_t getTimeFromExpr(tSQLExpr *pExpr, int16_t timePrecision, int64_t *result) {
int64_t val = 0;
bool parsed = false;
if (pRight->val.nType == TSDB_DATA_TYPE_BINARY) {
pRight->val.nLen = strdequote(pRight->val.pz);
if (pExpr->val.nType == TSDB_DATA_TYPE_BINARY) {
pExpr->val.nLen = strdequote(pExpr->val.pz);
char* seg = strnchr(pRight->val.pz, '-', pRight->val.nLen, false);
char* seg = strnchr(pExpr->val.pz, '-', pExpr->val.nLen, false);
if (seg != NULL) {
if (taosParseTime(pRight->val.pz, &val, pRight->val.nLen, TSDB_TIME_PRECISION_MICRO, tsDaylight) == TSDB_CODE_SUCCESS) {
if (taosParseTime(pExpr->val.pz, &val, pExpr->val.nLen, TSDB_TIME_PRECISION_MICRO, tsDaylight) == TSDB_CODE_SUCCESS) {
parsed = true;
} else {
return TSDB_CODE_TSC_INVALID_SQL;
}
} else {
SStrToken token = {.z = pRight->val.pz, .n = pRight->val.nLen, .type = TK_ID};
int32_t len = tSQLGetToken(pRight->val.pz, &token.type);
SStrToken token = {.z = pExpr->val.pz, .n = pExpr->val.nLen, .type = TK_ID};
int32_t len = tSQLGetToken(pExpr->val.pz, &token.type);
if ((token.type != TK_INTEGER && token.type != TK_FLOAT) || len != pRight->val.nLen) {
if ((token.type != TK_INTEGER && token.type != TK_FLOAT) || len != pExpr->val.nLen) {
return TSDB_CODE_TSC_INVALID_SQL;
}
}
} else if (pRight->nSQLOptr == TK_INTEGER && timePrecision == TSDB_TIME_PRECISION_MILLI) {
} else if (pExpr->nSQLOptr == TK_INTEGER && timePrecision == TSDB_TIME_PRECISION_MILLI) {
/*
* if the pRight->nSQLOptr == TK_INTEGER/TK_FLOAT, the value is adaptive, we
* if the pExpr->nSQLOptr == TK_INTEGER/TK_FLOAT, the value is adaptive, we
* need the time precision in metermeta to transfer the value in MICROSECOND
*
* Additional check to avoid data overflow
*/
if (pRight->val.i64Key <= INT64_MAX / 1000) {
pRight->val.i64Key *= 1000;
if (pExpr->val.i64Key <= INT64_MAX / 1000) {
pExpr->val.i64Key *= 1000;
}
} else if (pRight->nSQLOptr == TK_FLOAT && timePrecision == TSDB_TIME_PRECISION_MILLI) {
pRight->val.dKey *= 1000;
} else if (pExpr->nSQLOptr == TK_FLOAT && timePrecision == TSDB_TIME_PRECISION_MILLI) {
pExpr->val.dKey *= 1000;
}
if (!parsed) {
......@@ -4224,7 +4282,7 @@ int32_t getTimeRange(STimeWindow* win, tSQLExpr* pRight, int32_t optr, int16_t t
* failed to parse timestamp in regular formation, try next
* it may be a epoch time in string format
*/
tVariantDump(&pRight->val, (char*)&val, TSDB_DATA_TYPE_BIGINT, true);
tVariantDump(&pExpr->val, (char*)&val, TSDB_DATA_TYPE_BIGINT, true);
/*
* transfer it into MICROSECOND format if it is a string, since for
......@@ -4232,12 +4290,33 @@ int32_t getTimeRange(STimeWindow* win, tSQLExpr* pRight, int32_t optr, int16_t t
*
* additional check to avoid data overflow
*/
if (pRight->nSQLOptr == TK_STRING && timePrecision == TSDB_TIME_PRECISION_MILLI) {
if (pExpr->nSQLOptr == TK_STRING && timePrecision == TSDB_TIME_PRECISION_MILLI) {
if (val <= INT64_MAX / 1000) {
val *= 1000;
}
}
}
*result = val;
return TSDB_CODE_SUCCESS;
}
int32_t getTimeRange(STimeWindow* win, tSQLExpr* pRight, int32_t optr, int16_t timePrecision) {
// this is join condition, do nothing
if (pRight->nSQLOptr == TK_ID) {
return TSDB_CODE_SUCCESS;
}
/*
* filter primary ts filter expression like:
* where ts in ('2015-12-12 4:8:12')
*/
if (pRight->nSQLOptr == TK_SET || optr == TK_IN) {
return TSDB_CODE_TSC_INVALID_SQL;
}
int64_t val;
int32_t code = getTimeFromExpr(pRight, timePrecision, &val);
if (code != TSDB_CODE_SUCCESS) {
return code;
}
int32_t delta = 1;
/* for millisecond, delta is 1ms=1000us */
......@@ -4560,6 +4639,51 @@ int32_t parseOrderbyClause(SSqlCmd* pCmd, SQueryInfo* pQueryInfo, SQuerySQL* pQu
return TSDB_CODE_SUCCESS;
}
int32_t setDelInfo(SSqlObj *pSql, struct SSqlInfo* pInfo) {
const char* msg1 = "invalid table name";
const char* msg2 = "invalid delete sql";
const char* msg3 = "delete can not be supported by super table";
int32_t code = TSDB_CODE_SUCCESS;
SDelSQL* pDelSql = pInfo->pDelInfo;
SSqlCmd* pCmd = &pSql->cmd;
SQueryInfo* pQueryInfo = tscGetQueryInfoDetail(pCmd, 0);
STableMetaInfo* pTableMetaInfo = tscGetMetaInfo(pQueryInfo, 0);
SStrToken tblToken = {0};
if (pDelSql->from && pDelSql->from->nExpr > 0) {
tVariant* pVar = &pDelSql->from->a[0].pVar;
SStrToken token = {.z = pVar->pz, .n = pVar->nLen, TK_STRING};
tblToken = token;
} else {
return invalidSqlErrMsg(tscGetErrorMsgPayload(pCmd), msg1);
}
if (tscValidateName(&tblToken) != TSDB_CODE_SUCCESS) {
return invalidSqlErrMsg(tscGetErrorMsgPayload(pCmd), msg1);
}
code = tscSetTableFullName(pTableMetaInfo, &tblToken, pSql);
if (code != TSDB_CODE_SUCCESS) {
return code;
}
code = tscGetTableMeta(pSql, pTableMetaInfo);
if (code != TSDB_CODE_SUCCESS) {
return code;
}
if (UTIL_TABLE_IS_SUPER_TABLE(pTableMetaInfo)) {
return invalidSqlErrMsg(tscGetErrorMsgPayload(pCmd), msg3);
}
if (pDelSql->pWhere != NULL) {
if (getDelCond(pCmd, pQueryInfo, pDelSql->pWhere) != TSDB_CODE_SUCCESS) {
return invalidSqlErrMsg(tscGetErrorMsgPayload(pCmd), msg2);
}
}
return TSDB_CODE_SUCCESS;
}
int32_t setAlterTableInfo(SSqlObj* pSql, struct SSqlInfo* pInfo) {
const int32_t DEFAULT_TABLE_INDEX = 0;
......
......@@ -411,6 +411,7 @@ int doProcessSql(SSqlObj *pSql) {
pCmd->command == TSDB_SQL_FETCH ||
pCmd->command == TSDB_SQL_RETRIEVE ||
pCmd->command == TSDB_SQL_INSERT ||
pCmd->command == TSDB_SQL_DELETE ||
pCmd->command == TSDB_SQL_CONNECT ||
pCmd->command == TSDB_SQL_HB ||
pCmd->command == TSDB_SQL_META ||
......@@ -528,6 +529,18 @@ int tscBuildSubmitMsg(SSqlObj *pSql, SSqlInfo *pInfo) {
return TSDB_CODE_SUCCESS;
}
int tscBuildDelMsg(SSqlObj *pSql, SSqlInfo *pInfo) {
SQueryInfo *pQueryInfo = tscGetQueryInfoDetail(&pSql->cmd, 0);
STableMeta* pTableMeta = tscGetMetaInfo(pQueryInfo, 0)->pTableMeta;
char* pMsg = pSql->cmd.payload;
// NOTE: shell message size should not include SMsgDesc
int32_t size = pSql->cmd.payloadLen - sizeof(SMsgDesc);
int32_t vgId = pTableMeta->vgroupInfo.vgId;
pSql->cmd.msgType = TSDB_MSG_TYPE_DELETE;
return TSDB_CODE_SUCCESS;
}
/*
* for table query, simply return the size <= 1k
*/
......@@ -2287,8 +2300,10 @@ int tscGetSTableVgroupInfo(SSqlObj *pSql, int32_t clauseIndex) {
void tscInitMsgsFp() {
tscBuildMsg[TSDB_SQL_SELECT] = tscBuildQueryMsg;
tscBuildMsg[TSDB_SQL_INSERT] = tscBuildSubmitMsg;
tscBuildMsg[TSDB_SQL_DELETE] = tscBuildDelMsg;
tscBuildMsg[TSDB_SQL_FETCH] = tscBuildFetchMsg;
tscBuildMsg[TSDB_SQL_CREATE_DB] = tscBuildCreateDbMsg;
tscBuildMsg[TSDB_SQL_CREATE_USER] = tscBuildUserMsg;
......
......@@ -35,6 +35,7 @@ enum {
TSDB_DEFINE_SQL_TYPE( TSDB_SQL_SELECT, "select" )
TSDB_DEFINE_SQL_TYPE( TSDB_SQL_FETCH, "fetch" )
TSDB_DEFINE_SQL_TYPE( TSDB_SQL_INSERT, "insert" )
TSDB_DEFINE_SQL_TYPE( TSDB_SQL_DELETE, "delete" )
TSDB_DEFINE_SQL_TYPE( TSDB_SQL_UPDATE_TAGS_VAL, "update-tag-val" )
// the SQL below is for mgmt node
......
......@@ -42,6 +42,7 @@ enum {
// message from client to dnode
TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_SUBMIT, "submit" )
TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_DELETE, "delete" )
TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_QUERY, "query" )
TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_FETCH, "fetch" )
TAOS_DEFINE_MESSAGE_TYPE( TSDB_MSG_TYPE_UPDATE_TAG_VAL, "update-tag-val" )
......
......@@ -16,7 +16,6 @@
#ifndef TDENGINE_TTOKENDEF_H
#define TDENGINE_TTOKENDEF_H
#define TK_ID 1
#define TK_BOOL 2
#define TK_TINYINT 3
......@@ -121,107 +120,108 @@
#define TK_AS 102
#define TK_COMMA 103
#define TK_NULL 104
#define TK_SELECT 105
#define TK_UNION 106
#define TK_ALL 107
#define TK_FROM 108
#define TK_VARIABLE 109
#define TK_INTERVAL 110
#define TK_FILL 111
#define TK_SLIDING 112
#define TK_ORDER 113
#define TK_BY 114
#define TK_ASC 115
#define TK_DESC 116
#define TK_GROUP 117
#define TK_HAVING 118
#define TK_LIMIT 119
#define TK_OFFSET 120
#define TK_SLIMIT 121
#define TK_SOFFSET 122
#define TK_WHERE 123
#define TK_NOW 124
#define TK_RESET 125
#define TK_QUERY 126
#define TK_ADD 127
#define TK_COLUMN 128
#define TK_TAG 129
#define TK_CHANGE 130
#define TK_SET 131
#define TK_KILL 132
#define TK_CONNECTION 133
#define TK_STREAM 134
#define TK_COLON 135
#define TK_ABORT 136
#define TK_AFTER 137
#define TK_ATTACH 138
#define TK_BEFORE 139
#define TK_BEGIN 140
#define TK_CASCADE 141
#define TK_CLUSTER 142
#define TK_CONFLICT 143
#define TK_COPY 144
#define TK_DEFERRED 145
#define TK_DELIMITERS 146
#define TK_DETACH 147
#define TK_EACH 148
#define TK_END 149
#define TK_EXPLAIN 150
#define TK_FAIL 151
#define TK_FOR 152
#define TK_IGNORE 153
#define TK_IMMEDIATE 154
#define TK_INITIALLY 155
#define TK_INSTEAD 156
#define TK_MATCH 157
#define TK_KEY 158
#define TK_OF 159
#define TK_RAISE 160
#define TK_REPLACE 161
#define TK_RESTRICT 162
#define TK_ROW 163
#define TK_STATEMENT 164
#define TK_TRIGGER 165
#define TK_VIEW 166
#define TK_COUNT 167
#define TK_SUM 168
#define TK_AVG 169
#define TK_MIN 170
#define TK_MAX 171
#define TK_FIRST 172
#define TK_LAST 173
#define TK_TOP 174
#define TK_BOTTOM 175
#define TK_STDDEV 176
#define TK_PERCENTILE 177
#define TK_APERCENTILE 178
#define TK_LEASTSQUARES 179
#define TK_HISTOGRAM 180
#define TK_DIFF 181
#define TK_SPREAD 182
#define TK_TWA 183
#define TK_INTERP 184
#define TK_LAST_ROW 185
#define TK_RATE 186
#define TK_IRATE 187
#define TK_SUM_RATE 188
#define TK_SUM_IRATE 189
#define TK_AVG_RATE 190
#define TK_AVG_IRATE 191
#define TK_TBID 192
#define TK_SEMI 193
#define TK_NONE 194
#define TK_PREV 195
#define TK_LINEAR 196
#define TK_IMPORT 197
#define TK_METRIC 198
#define TK_TBNAME 199
#define TK_JOIN 200
#define TK_METRICS 201
#define TK_STABLE 202
#define TK_INSERT 203
#define TK_INTO 204
#define TK_VALUES 205
#define TK_DELETE 105
#define TK_SELECT 106
#define TK_UNION 107
#define TK_ALL 108
#define TK_FROM 109
#define TK_VARIABLE 110
#define TK_INTERVAL 111
#define TK_FILL 112
#define TK_SLIDING 113
#define TK_ORDER 114
#define TK_BY 115
#define TK_ASC 116
#define TK_DESC 117
#define TK_GROUP 118
#define TK_HAVING 119
#define TK_LIMIT 120
#define TK_OFFSET 121
#define TK_SLIMIT 122
#define TK_SOFFSET 123
#define TK_WHERE 124
#define TK_NOW 125
#define TK_RESET 126
#define TK_QUERY 127
#define TK_ADD 128
#define TK_COLUMN 129
#define TK_TAG 130
#define TK_CHANGE 131
#define TK_SET 132
#define TK_KILL 133
#define TK_CONNECTION 134
#define TK_STREAM 135
#define TK_COLON 136
#define TK_ABORT 137
#define TK_AFTER 138
#define TK_ATTACH 139
#define TK_BEFORE 140
#define TK_BEGIN 141
#define TK_CASCADE 142
#define TK_CLUSTER 143
#define TK_CONFLICT 144
#define TK_COPY 145
#define TK_DEFERRED 146
#define TK_DELIMITERS 147
#define TK_DETACH 148
#define TK_EACH 149
#define TK_END 150
#define TK_EXPLAIN 151
#define TK_FAIL 152
#define TK_FOR 153
#define TK_IGNORE 154
#define TK_IMMEDIATE 155
#define TK_INITIALLY 156
#define TK_INSTEAD 157
#define TK_MATCH 158
#define TK_KEY 159
#define TK_OF 160
#define TK_RAISE 161
#define TK_REPLACE 162
#define TK_RESTRICT 163
#define TK_ROW 164
#define TK_STATEMENT 165
#define TK_TRIGGER 166
#define TK_VIEW 167
#define TK_COUNT 168
#define TK_SUM 169
#define TK_AVG 170
#define TK_MIN 171
#define TK_MAX 172
#define TK_FIRST 173
#define TK_LAST 174
#define TK_TOP 175
#define TK_BOTTOM 176
#define TK_STDDEV 177
#define TK_PERCENTILE 178
#define TK_APERCENTILE 179
#define TK_LEASTSQUARES 180
#define TK_HISTOGRAM 181
#define TK_DIFF 182
#define TK_SPREAD 183
#define TK_TWA 184
#define TK_INTERP 185
#define TK_LAST_ROW 186
#define TK_RATE 187
#define TK_IRATE 188
#define TK_SUM_RATE 189
#define TK_SUM_IRATE 190
#define TK_AVG_RATE 191
#define TK_AVG_IRATE 192
#define TK_TBID 193
#define TK_SEMI 194
#define TK_NONE 195
#define TK_PREV 196
#define TK_LINEAR 197
#define TK_IMPORT 198
#define TK_METRIC 199
#define TK_TBNAME 200
#define TK_JOIN 201
#define TK_METRICS 202
#define TK_STABLE 203
#define TK_INSERT 204
#define TK_INTO 205
#define TK_VALUES 206
#define TK_SPACE 300
#define TK_COMMENT 301
......
......@@ -85,6 +85,11 @@ typedef struct SQuerySQL {
SStrToken selectToken; // sql string
} SQuerySQL;
typedef struct SDelSQL {
tVariantList* from;
struct tSQLExpr* pWhere;
} SDelSQL;
typedef struct SCreateTableSQL {
struct SStrToken name; // meter name, create table [meterName] xxx
bool existCheck;
......@@ -188,6 +193,7 @@ typedef struct SSqlInfo {
SCreateTableSQL *pCreateTableInfo;
SAlterTableSQL * pAlterInfo;
tDCLSQL * pDCLInfo;
SDelSQL * pDelInfo;
};
SSubclauseInfo subclauseInfo;
......@@ -268,12 +274,15 @@ SQuerySQL *tSetQuerySQLElems(SStrToken *pSelectToken, tSQLExprList *pSelection,
tVariantList *pGroupby, tVariantList *pSortOrder, SIntervalVal *pInterval,
SStrToken *pSliding, tVariantList *pFill, SLimitVal *pLimit, SLimitVal *pGLimit);
SCreateTableSQL *tSetCreateSQLElems(tFieldList *pCols, tFieldList *pTags, SStrToken *pMetricName,
tVariantList *pTagVals, SQuerySQL *pSelect, int32_t type);
void tSQLExprNodeDestroy(tSQLExpr *pExpr);
tSQLExpr *tSQLExprNodeClone(tSQLExpr *pExpr);
SDelSQL *tSetDelSQLElems(tVariantList *pFrom, tSQLExpr *pWhere);
SAlterTableSQL *tAlterTableSQLElems(SStrToken *pMeterName, tFieldList *pCols, tVariantList *pVals, int32_t type);
tSQLExprListList *tSQLListListAppend(tSQLExprListList *pList, tSQLExprList *pExprList);
......@@ -281,6 +290,8 @@ tSQLExprListList *tSQLListListAppend(tSQLExprListList *pList, tSQLExprList *pExp
void destroyAllSelectClause(SSubclauseInfo *pSql);
void doDestroyQuerySql(SQuerySQL *pSql);
void doDestroyDelSql(SDelSQL *pSql);
SSqlInfo * setSQLInfo(SSqlInfo *pInfo, void *pSqlExprInfo, SStrToken *pMeterName, int32_t type);
SSubclauseInfo *setSubclause(SSubclauseInfo *pClause, void *pSqlExprInfo);
......
......@@ -376,6 +376,16 @@ tagitem(A) ::= PLUS(X) FLOAT(Y). {
tVariantCreate(&A, &X);
}
///////////////////////////////////DELETE TABLE statement//////////////////////////////////
%type delete {SDelSQL*}
%destructor delete { doDestroyDelSql($$); }
delete(A) ::= DELETE from(X) where_opt(Y). {
A = tSetDelSQLElems(X, Y);
}
cmd ::= delete(A). { setSQLInfo(pInfo, A, NULL, TSDB_SQL_DELETE); }
//////////////////////// The SELECT statement /////////////////////////////////
%type select {SQuerySQL*}
%destructor select {doDestroyQuerySql($$);}
......@@ -700,6 +710,7 @@ cmd ::= ALTER TABLE ids(X) cpxName(F) SET TAG ids(Y) EQ tagitem(Z). {
setSQLInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE);
}
////////////////////////////////////////kill statement///////////////////////////////////////
cmd ::= KILL CONNECTION INTEGER(Y). {setKillSQL(pInfo, TSDB_SQL_KILL_CONNECTION, &Y);}
cmd ::= KILL STREAM INTEGER(X) COLON(Z) INTEGER(Y). {X.n += (Z.n + Y.n); setKillSQL(pInfo, TSDB_SQL_KILL_STREAM, &X);}
......
......@@ -578,6 +578,30 @@ void doDestroyQuerySql(SQuerySQL *pQuerySql) {
free(pQuerySql);
}
/*
* extract the del info out of sql string
*/
SDelSQL *tSetDelSQLElems(tVariantList *pFrom, tSQLExpr *pWhere) {
//assert(pSelection != NULL);
SDelSQL *pDelSql = calloc(1, sizeof(SDelSQL));
pDelSql->from = pFrom;
pDelSql->pWhere = pWhere;
return pDelSql;
}
void doDestroyDelSql(SDelSQL *pDelSql) {
if (pDelSql == NULL) {
return;
}
tSQLExprDestroy(pDelSql->pWhere);
pDelSql->pWhere = NULL;
tVariantListDestroy(pDelSql->from);
pDelSql->from = NULL;
free(pDelSql);
}
void destroyAllSelectClause(SSubclauseInfo *pClause) {
if (pClause == NULL || pClause->numOfClause == 0) {
return;
......@@ -662,8 +686,9 @@ void SQLInfoDestroy(SSqlInfo *pInfo) {
} else if (pInfo->type == TSDB_SQL_ALTER_TABLE) {
tVariantListDestroy(pInfo->pAlterInfo->varList);
tFieldListDestroy(pInfo->pAlterInfo->pAddColumns);
taosTFree(pInfo->pAlterInfo);
} else if (pInfo->type == TSDB_SQL_DELETE) {
doDestroyDelSql(pInfo->pDelInfo);
} else {
if (pInfo->pDCLInfo != NULL && pInfo->pDCLInfo->nAlloc > 0) {
free(pInfo->pDCLInfo->a);
......@@ -702,6 +727,8 @@ SSqlInfo* setSQLInfo(SSqlInfo *pInfo, void *pSqlExprInfo, SStrToken *pMeterName,
if (type == TSDB_SQL_SELECT) {
pInfo->subclauseInfo = *(SSubclauseInfo*) pSqlExprInfo;
free(pSqlExprInfo);
} else if (type == TSDB_SQL_DELETE){
pInfo->pDelInfo = pSqlExprInfo;
} else {
pInfo->pCreateTableInfo = pSqlExprInfo;
}
......
......@@ -237,6 +237,7 @@ static SKeyword keywordTable[] = {
{"SUM_IRATE", TK_SUM_IRATE},
{"AVG_RATE", TK_AVG_RATE},
{"AVG_IRATE", TK_AVG_IRATE},
{"DELETE", TK_DELETE},
};
static const char isIdChar[] = {
......
/*
** 2000-05-29
**
** The author disclaims copyright to this source code. In place of
** a legal notice, here is a blessing:
**
** May you do good and not evil.
** May you find forgiveness for yourself and forgive others.
** May you share freely, never taking more than you give.
**
*************************************************************************
** Driver template for the LEMON parser generator.
**
** The "lemon" program processes an LALR(1) input grammar file, then uses
** this template to construct a parser. The "lemon" program inserts text
** at each "%%" line. Also, any "P-a-r-s-e" identifer prefix (without the
** interstitial "-" characters) contained in this template is changed into
** the value of the %name directive from the grammar. Otherwise, the content
** of this template is copied straight through into the generate parser
** source file.
**
** The following is the concatenation of all %include directives from the
** input grammar file:
/* Driver template for the LEMON parser generator.
** The author disclaims copyright to this source code.
*/
/* First off, code is included that follows the "include" declaration
** in the input grammar file. */
#include <stdio.h>
/************ Begin %include sections from the grammar ************************/
#include <stdio.h>
#include <stdlib.h>
......@@ -36,88 +16,78 @@
#include "ttokendef.h"
#include "tutil.h"
#include "tvariant.h"
/**************** End of %include directives **********************************/
/* These constants specify the various numeric values for terminal symbols
** in a format understandable to "makeheaders". This section is blank unless
** "lemon" is run with the "-m" command-line option.
***************** Begin makeheaders token definitions *************************/
/**************** End makeheaders token definitions ***************************/
/* The next sections is a series of control #defines.
/* Next is all token values, in a form suitable for use by makeheaders.
** This section will be null unless lemon is run with the -m switch.
*/
/*
** These constants (all generated automatically by the parser generator)
** specify the various kinds of tokens (terminals) that the parser
** understands.
**
** Each symbol here is a terminal symbol in the grammar.
*/
/* Make sure the INTERFACE macro is defined.
*/
#ifndef INTERFACE
# define INTERFACE 1
#endif
/* The next thing included is series of defines which control
** various aspects of the generated parser.
** YYCODETYPE is the data type used to store the integer codes
** that represent terminal and non-terminal symbols.
** "unsigned char" is used if there are fewer than
** 256 symbols. Larger types otherwise.
** YYNOCODE is a number of type YYCODETYPE that is not used for
** any terminal or nonterminal symbol.
** YYCODETYPE is the data type used for storing terminal
** and nonterminal numbers. "unsigned char" is
** used if there are fewer than 250 terminals
** and nonterminals. "int" is used otherwise.
** YYNOCODE is a number of type YYCODETYPE which corresponds
** to no legal terminal or nonterminal number. This
** number is used to fill in empty slots of the hash
** table.
** YYFALLBACK If defined, this indicates that one or more tokens
** (also known as: "terminal symbols") have fall-back
** values which should be used if the original symbol
** would not parse. This permits keywords to sometimes
** be used as identifiers, for example.
** YYACTIONTYPE is the data type used for "action codes" - numbers
** that indicate what to do in response to the next
** token.
** ParseTOKENTYPE is the data type used for minor type for terminal
** symbols. Background: A "minor type" is a semantic
** value associated with a terminal or non-terminal
** symbols. For example, for an "ID" terminal symbol,
** the minor type might be the name of the identifier.
** Each non-terminal can have a different minor type.
** Terminal symbols all have the same minor type, though.
** This macros defines the minor type for terminal
** symbols.
** YYMINORTYPE is the data type used for all minor types.
** have fall-back values which should be used if the
** original value of the token will not parse.
** YYACTIONTYPE is the data type used for storing terminal
** and nonterminal numbers. "unsigned char" is
** used if there are fewer than 250 rules and
** states combined. "int" is used otherwise.
** ParseTOKENTYPE is the data type used for minor tokens given
** directly to the parser from the tokenizer.
** YYMINORTYPE is the data type used for all minor tokens.
** This is typically a union of many types, one of
** which is ParseTOKENTYPE. The entry in the union
** for terminal symbols is called "yy0".
** for base tokens is called "yy0".
** YYSTACKDEPTH is the maximum depth of the parser's stack. If
** zero the stack is dynamically sized using realloc()
** ParseARG_SDECL A static variable declaration for the %extra_argument
** ParseARG_PDECL A parameter declaration for the %extra_argument
** ParseARG_STORE Code to store %extra_argument into yypParser
** ParseARG_FETCH Code to extract %extra_argument from yypParser
** YYERRORSYMBOL is the code number of the error symbol. If not
** defined, then do no error processing.
** YYNSTATE the combined number of states.
** YYNRULE the number of rules in the grammar
** YYNTOKEN Number of terminal symbols
** YY_MAX_SHIFT Maximum value for shift actions
** YY_MIN_SHIFTREDUCE Minimum value for shift-reduce actions
** YY_MAX_SHIFTREDUCE Maximum value for shift-reduce actions
** YY_ERROR_ACTION The yy_action[] code for syntax error
** YY_ACCEPT_ACTION The yy_action[] code for accept
** YY_NO_ACTION The yy_action[] code for no-op
** YY_MIN_REDUCE Minimum value for reduce actions
** YY_MAX_REDUCE Maximum value for reduce actions
** YYERRORSYMBOL is the code number of the error symbol. If not
** defined, then do no error processing.
*/
#ifndef INTERFACE
# define INTERFACE 1
#endif
/************* Begin control #defines *****************************************/
#define YYCODETYPE unsigned short int
#define YYNOCODE 272
#define YYNOCODE 274
#define YYACTIONTYPE unsigned short int
#define ParseTOKENTYPE SStrToken
typedef union {
int yyinit;
ParseTOKENTYPE yy0;
SSubclauseInfo* yy25;
tSQLExpr* yy66;
SCreateAcctSQL yy73;
int yy82;
SQuerySQL* yy150;
SCreateDBInfo yy158;
TAOS_FIELD yy181;
SLimitVal yy188;
tSQLExprList* yy224;
int64_t yy271;
tVariant yy312;
SIntervalVal yy314;
SCreateTableSQL* yy374;
tFieldList* yy449;
tVariantList* yy494;
int yy46;
tSQLExpr* yy64;
tVariant yy134;
SCreateAcctSQL yy149;
SDelSQL* yy175;
int64_t yy207;
SLimitVal yy216;
TAOS_FIELD yy223;
SSubclauseInfo* yy231;
SCreateDBInfo yy268;
tSQLExprList* yy290;
SQuerySQL* yy414;
SCreateTableSQL* yy470;
tVariantList* yy498;
tFieldList* yy523;
SIntervalVal yy532;
} YYMINORTYPE;
#ifndef YYSTACKDEPTH
#define YYSTACKDEPTH 100
......@@ -126,19 +96,16 @@ typedef union {
#define ParseARG_PDECL ,SSqlInfo* pInfo
#define ParseARG_FETCH SSqlInfo* pInfo = yypParser->pInfo
#define ParseARG_STORE yypParser->pInfo = pInfo
#define YYNSTATE 420
#define YYNRULE 232
#define YYFALLBACK 1
#define YYNSTATE 252
#define YYNRULE 230
#define YYNTOKEN 206
#define YY_MAX_SHIFT 251
#define YY_MIN_SHIFTREDUCE 416
#define YY_MAX_SHIFTREDUCE 645
#define YY_ERROR_ACTION 646
#define YY_ACCEPT_ACTION 647
#define YY_NO_ACTION 648
#define YY_MIN_REDUCE 649
#define YY_MAX_REDUCE 878
/************* End control #defines *******************************************/
#define YY_NO_ACTION (YYNSTATE+YYNRULE+2)
#define YY_ACCEPT_ACTION (YYNSTATE+YYNRULE+1)
#define YY_ERROR_ACTION (YYNSTATE+YYNRULE)
/* The yyzerominor constant is used to initialize instances of
** YYMINORTYPE objects to zero. */
static const YYMINORTYPE yyzerominor = { 0 };
/* Define the yytestcase() macro to be a no-op if is not already defined
** otherwise.
......@@ -161,35 +128,33 @@ typedef union {
** Suppose the action integer is N. Then the action is determined as
** follows
**
** 0 <= N <= YY_MAX_SHIFT Shift N. That is, push the lookahead
** 0 <= N < YYNSTATE Shift N. That is, push the lookahead
** token onto the stack and goto state N.
**
** N between YY_MIN_SHIFTREDUCE Shift to an arbitrary state then
** and YY_MAX_SHIFTREDUCE reduce by rule N-YY_MIN_SHIFTREDUCE.
** YYNSTATE <= N < YYNSTATE+YYNRULE Reduce by rule N-YYNSTATE.
**
** N == YY_ERROR_ACTION A syntax error has occurred.
** N == YYNSTATE+YYNRULE A syntax error has occurred.
**
** N == YY_ACCEPT_ACTION The parser accepts its input.
** N == YYNSTATE+YYNRULE+1 The parser accepts its input.
**
** N == YY_NO_ACTION No such action. Denotes unused
** N == YYNSTATE+YYNRULE+2 No such action. Denotes unused
** slots in the yy_action[] table.
**
** N between YY_MIN_REDUCE Reduce by rule N-YY_MIN_REDUCE
** and YY_MAX_REDUCE
**
** The action table is constructed as a single large table named yy_action[].
** Given state S and lookahead X, the action is computed as either:
** Given state S and lookahead X, the action is computed as
**
** (A) N = yy_action[ yy_shift_ofst[S] + X ]
** (B) N = yy_default[S]
** yy_action[ yy_shift_ofst[S] + X ]
**
** The (A) formula is preferred. The B formula is used instead if
** yy_lookahead[yy_shift_ofst[S]+X] is not equal to X.
** If the index value yy_shift_ofst[S]+X is out of range or if the value
** yy_lookahead[yy_shift_ofst[S]+X] is not equal to X or if yy_shift_ofst[S]
** is equal to YY_SHIFT_USE_DFLT, it means that the action is not in the table
** and that yy_default[S] should be used instead.
**
** The formulas above are for computing the action when the lookahead is
** The formula above is for computing the action when the lookahead is
** a terminal symbol. If the lookahead is a non-terminal (as occurs after
** a reduce action) then the yy_reduce_ofst[] array is used in place of
** the yy_shift_ofst[] array.
** the yy_shift_ofst[] array and YY_REDUCE_USE_DFLT is used in place of
** YY_SHIFT_USE_DFLT.
**
** The following are the tables generated in this section:
**
......@@ -201,230 +166,248 @@ typedef union {
** yy_reduce_ofst[] For each state, the offset into yy_action for
** shifting non-terminals after a reduce.
** yy_default[] Default action for each state.
**
*********** Begin parsing tables **********************************************/
#define YY_ACTTAB_COUNT (566)
*/
#define YY_ACTTAB_COUNT (676)
static const YYACTIONTYPE yy_action[] = {
/* 0 */ 751, 459, 11, 749, 750, 647, 251, 459, 752, 460,
/* 10 */ 754, 755, 753, 35, 36, 460, 37, 38, 159, 249,
/* 20 */ 170, 29, 141, 459, 206, 41, 39, 43, 40, 140,
/* 30 */ 145, 460, 865, 34, 33, 862, 141, 32, 31, 30,
/* 40 */ 35, 36, 781, 37, 38, 165, 866, 170, 29, 141,
/* 50 */ 62, 206, 41, 39, 43, 40, 191, 525, 164, 866,
/* 60 */ 34, 33, 27, 21, 32, 31, 30, 417, 418, 419,
/* 70 */ 420, 421, 422, 423, 424, 425, 426, 427, 428, 250,
/* 80 */ 35, 36, 181, 37, 38, 227, 226, 170, 29, 781,
/* 90 */ 176, 206, 41, 39, 43, 40, 174, 162, 767, 792,
/* 100 */ 34, 33, 56, 160, 32, 31, 30, 21, 36, 8,
/* 110 */ 37, 38, 63, 118, 170, 29, 770, 108, 206, 41,
/* 120 */ 39, 43, 40, 32, 31, 30, 599, 34, 33, 78,
/* 130 */ 875, 32, 31, 30, 238, 37, 38, 108, 238, 170,
/* 140 */ 29, 184, 766, 206, 41, 39, 43, 40, 188, 187,
/* 150 */ 789, 177, 34, 33, 224, 223, 32, 31, 30, 16,
/* 160 */ 218, 244, 243, 217, 216, 215, 242, 214, 241, 240,
/* 170 */ 239, 213, 747, 818, 735, 736, 737, 738, 739, 740,
/* 180 */ 741, 742, 743, 744, 745, 746, 169, 612, 103, 12,
/* 190 */ 603, 17, 606, 819, 609, 201, 169, 612, 26, 108,
/* 200 */ 603, 108, 606, 861, 609, 153, 169, 612, 173, 567,
/* 210 */ 603, 154, 606, 105, 609, 90, 89, 148, 166, 167,
/* 220 */ 34, 33, 205, 102, 32, 31, 30, 770, 166, 167,
/* 230 */ 26, 21, 557, 41, 39, 43, 40, 549, 166, 167,
/* 240 */ 194, 34, 33, 17, 193, 32, 31, 30, 860, 16,
/* 250 */ 26, 244, 243, 203, 21, 60, 242, 61, 241, 240,
/* 260 */ 239, 248, 247, 96, 175, 229, 767, 76, 80, 245,
/* 270 */ 190, 554, 21, 85, 88, 79, 18, 156, 121, 122,
/* 280 */ 605, 82, 608, 42, 70, 66, 69, 225, 770, 767,
/* 290 */ 135, 133, 601, 42, 611, 768, 93, 92, 91, 690,
/* 300 */ 168, 207, 131, 42, 611, 230, 545, 767, 546, 610,
/* 310 */ 699, 157, 691, 131, 611, 131, 604, 541, 607, 610,
/* 320 */ 538, 571, 539, 47, 540, 46, 580, 581, 602, 610,
/* 330 */ 572, 631, 613, 50, 14, 13, 13, 531, 543, 3,
/* 340 */ 544, 46, 48, 530, 75, 74, 811, 22, 178, 179,
/* 350 */ 51, 211, 10, 9, 829, 22, 87, 86, 101, 99,
/* 360 */ 158, 143, 144, 146, 147, 151, 152, 150, 139, 149,
/* 370 */ 769, 142, 828, 171, 825, 824, 172, 791, 761, 796,
/* 380 */ 228, 783, 798, 104, 810, 119, 120, 701, 117, 212,
/* 390 */ 615, 137, 24, 221, 698, 26, 222, 192, 874, 72,
/* 400 */ 873, 871, 123, 719, 25, 100, 23, 138, 566, 688,
/* 410 */ 81, 686, 83, 84, 684, 195, 780, 683, 161, 542,
/* 420 */ 180, 199, 132, 681, 680, 679, 52, 49, 678, 677,
/* 430 */ 109, 134, 44, 675, 204, 673, 671, 669, 667, 202,
/* 440 */ 200, 198, 196, 28, 136, 220, 57, 58, 812, 77,
/* 450 */ 231, 232, 233, 234, 235, 236, 237, 246, 209, 645,
/* 460 */ 53, 182, 183, 644, 110, 64, 67, 155, 186, 185,
/* 470 */ 682, 643, 94, 636, 676, 189, 126, 125, 720, 124,
/* 480 */ 127, 128, 130, 129, 95, 668, 1, 551, 193, 765,
/* 490 */ 2, 55, 113, 111, 114, 112, 115, 116, 59, 568,
/* 500 */ 163, 106, 197, 5, 573, 107, 6, 65, 614, 19,
/* 510 */ 4, 20, 15, 208, 616, 7, 210, 500, 496, 494,
/* 520 */ 493, 492, 489, 463, 219, 68, 45, 71, 73, 22,
/* 530 */ 527, 526, 524, 54, 484, 482, 474, 480, 476, 478,
/* 540 */ 472, 470, 499, 498, 497, 495, 491, 490, 46, 461,
/* 550 */ 432, 430, 649, 648, 648, 648, 648, 648, 648, 648,
/* 560 */ 648, 648, 648, 648, 97, 98,
/* 0 */ 404, 34, 33, 76, 80, 32, 31, 30, 403, 85,
/* 10 */ 88, 79, 35, 36, 186, 37, 38, 82, 407, 172,
/* 20 */ 29, 190, 189, 208, 41, 39, 43, 40, 250, 249,
/* 30 */ 96, 8, 34, 33, 63, 120, 32, 31, 30, 35,
/* 40 */ 36, 420, 37, 38, 101, 99, 172, 29, 653, 253,
/* 50 */ 208, 41, 39, 43, 40, 32, 31, 30, 98, 34,
/* 60 */ 33, 87, 86, 32, 31, 30, 35, 36, 404, 37,
/* 70 */ 38, 178, 110, 172, 29, 50, 403, 208, 41, 39,
/* 80 */ 43, 40, 347, 10, 9, 261, 34, 33, 262, 110,
/* 90 */ 32, 31, 30, 51, 41, 39, 43, 40, 75, 74,
/* 100 */ 193, 56, 34, 33, 406, 213, 32, 31, 30, 22,
/* 110 */ 229, 228, 419, 418, 417, 416, 415, 414, 413, 412,
/* 120 */ 411, 410, 409, 408, 252, 304, 270, 183, 36, 61,
/* 130 */ 37, 38, 18, 179, 172, 29, 226, 225, 208, 41,
/* 140 */ 39, 43, 40, 379, 205, 378, 60, 34, 33, 47,
/* 150 */ 314, 32, 31, 30, 22, 37, 38, 110, 97, 172,
/* 160 */ 29, 21, 21, 208, 41, 39, 43, 40, 377, 48,
/* 170 */ 376, 313, 34, 33, 110, 46, 32, 31, 30, 317,
/* 180 */ 396, 329, 328, 327, 326, 325, 324, 323, 322, 321,
/* 190 */ 320, 319, 318, 21, 232, 227, 343, 343, 16, 220,
/* 200 */ 246, 245, 219, 218, 217, 244, 216, 243, 242, 241,
/* 210 */ 215, 171, 292, 21, 277, 301, 203, 296, 209, 295,
/* 220 */ 46, 171, 292, 12, 303, 301, 177, 296, 343, 295,
/* 230 */ 300, 278, 299, 170, 137, 135, 298, 374, 297, 155,
/* 240 */ 93, 92, 91, 168, 169, 156, 176, 264, 343, 90,
/* 250 */ 89, 150, 62, 168, 169, 171, 292, 207, 373, 301,
/* 260 */ 302, 296, 27, 295, 381, 360, 143, 384, 133, 383,
/* 270 */ 366, 382, 3, 368, 367, 166, 286, 17, 365, 291,
/* 280 */ 363, 362, 364, 13, 104, 26, 337, 168, 169, 133,
/* 290 */ 16, 105, 246, 245, 287, 180, 181, 244, 13, 243,
/* 300 */ 242, 241, 372, 123, 124, 192, 143, 306, 42, 70,
/* 310 */ 66, 69, 158, 273, 260, 167, 286, 14, 42, 21,
/* 320 */ 293, 274, 195, 272, 404, 46, 102, 107, 282, 281,
/* 330 */ 293, 231, 403, 361, 26, 294, 133, 78, 261, 17,
/* 340 */ 247, 143, 240, 175, 196, 294, 265, 26, 371, 164,
/* 350 */ 370, 285, 42, 162, 349, 161, 251, 369, 359, 375,
/* 360 */ 358, 344, 375, 357, 293, 356, 380, 355, 375, 354,
/* 370 */ 353, 352, 22, 54, 346, 348, 345, 73, 71, 294,
/* 380 */ 68, 336, 335, 45, 334, 221, 333, 332, 331, 330,
/* 390 */ 65, 212, 7, 210, 15, 6, 305, 4, 267, 284,
/* 400 */ 5, 20, 275, 109, 19, 165, 199, 108, 191, 271,
/* 410 */ 55, 258, 257, 195, 59, 256, 188, 255, 187, 185,
/* 420 */ 184, 254, 2, 1, 95, 402, 248, 100, 397, 131,
/* 430 */ 94, 390, 238, 239, 126, 234, 235, 132, 237, 236,
/* 440 */ 26, 312, 130, 77, 233, 157, 28, 128, 222, 129,
/* 450 */ 67, 64, 53, 127, 118, 211, 350, 198, 204, 200,
/* 460 */ 44, 202, 280, 206, 49, 201, 163, 197, 58, 57,
/* 470 */ 138, 405, 401, 654, 400, 654, 399, 398, 136, 395,
/* 480 */ 654, 394, 18, 52, 276, 393, 654, 654, 117, 392,
/* 490 */ 116, 654, 115, 240, 114, 654, 194, 391, 134, 182,
/* 500 */ 113, 103, 112, 654, 111, 263, 389, 119, 311, 654,
/* 510 */ 654, 654, 654, 654, 230, 174, 259, 654, 654, 654,
/* 520 */ 315, 310, 654, 654, 388, 84, 83, 387, 654, 81,
/* 530 */ 386, 140, 23, 654, 654, 25, 351, 385, 125, 342,
/* 540 */ 341, 72, 340, 224, 338, 654, 223, 24, 139, 214,
/* 550 */ 316, 654, 283, 654, 654, 122, 654, 654, 279, 654,
/* 560 */ 654, 654, 654, 654, 654, 654, 654, 654, 654, 654,
/* 570 */ 654, 654, 654, 654, 121, 654, 654, 654, 654, 654,
/* 580 */ 654, 654, 654, 654, 654, 654, 106, 269, 654, 268,
/* 590 */ 654, 654, 654, 654, 654, 266, 654, 654, 654, 654,
/* 600 */ 654, 654, 654, 654, 654, 654, 654, 654, 654, 654,
/* 610 */ 654, 654, 654, 654, 654, 654, 654, 654, 654, 654,
/* 620 */ 654, 654, 654, 654, 654, 654, 654, 654, 654, 309,
/* 630 */ 173, 308, 307, 654, 654, 654, 654, 654, 339, 654,
/* 640 */ 654, 654, 654, 654, 654, 654, 654, 654, 654, 654,
/* 650 */ 654, 654, 654, 654, 144, 151, 141, 152, 154, 153,
/* 660 */ 149, 148, 146, 145, 160, 159, 654, 290, 289, 288,
/* 670 */ 147, 142, 654, 654, 654, 11,
};
static const YYCODETYPE yy_lookahead[] = {
/* 0 */ 226, 1, 260, 229, 230, 207, 208, 1, 234, 9,
/* 10 */ 236, 237, 238, 13, 14, 9, 16, 17, 209, 210,
/* 20 */ 20, 21, 260, 1, 24, 25, 26, 27, 28, 260,
/* 30 */ 260, 9, 270, 33, 34, 260, 260, 37, 38, 39,
/* 40 */ 13, 14, 244, 16, 17, 269, 270, 20, 21, 260,
/* 50 */ 247, 24, 25, 26, 27, 28, 258, 5, 269, 270,
/* 60 */ 33, 34, 259, 210, 37, 38, 39, 45, 46, 47,
/* 70 */ 48, 49, 50, 51, 52, 53, 54, 55, 56, 57,
/* 80 */ 13, 14, 60, 16, 17, 33, 34, 20, 21, 244,
/* 90 */ 66, 24, 25, 26, 27, 28, 243, 227, 245, 210,
/* 100 */ 33, 34, 102, 258, 37, 38, 39, 210, 14, 98,
/* 110 */ 16, 17, 101, 102, 20, 21, 246, 210, 24, 25,
/* 120 */ 26, 27, 28, 37, 38, 39, 99, 33, 34, 73,
/* 130 */ 246, 37, 38, 39, 78, 16, 17, 210, 78, 20,
/* 140 */ 21, 126, 245, 24, 25, 26, 27, 28, 133, 134,
/* 150 */ 261, 127, 33, 34, 130, 131, 37, 38, 39, 85,
/* 160 */ 86, 87, 88, 89, 90, 91, 92, 93, 94, 95,
/* 170 */ 96, 97, 226, 266, 228, 229, 230, 231, 232, 233,
/* 180 */ 234, 235, 236, 237, 238, 239, 1, 2, 210, 44,
/* 190 */ 5, 98, 7, 266, 9, 268, 1, 2, 105, 210,
/* 200 */ 5, 210, 7, 260, 9, 60, 1, 2, 227, 99,
/* 210 */ 5, 66, 7, 103, 9, 70, 71, 72, 33, 34,
/* 220 */ 33, 34, 37, 98, 37, 38, 39, 246, 33, 34,
/* 230 */ 105, 210, 37, 25, 26, 27, 28, 99, 33, 34,
/* 240 */ 262, 33, 34, 98, 106, 37, 38, 39, 260, 85,
/* 250 */ 105, 87, 88, 264, 210, 266, 92, 266, 94, 95,
/* 260 */ 96, 63, 64, 65, 243, 210, 245, 61, 62, 227,
/* 270 */ 125, 103, 210, 67, 68, 69, 108, 132, 61, 62,
/* 280 */ 5, 75, 7, 98, 67, 68, 69, 243, 246, 245,
/* 290 */ 61, 62, 1, 98, 109, 240, 67, 68, 69, 214,
/* 300 */ 59, 15, 217, 98, 109, 243, 5, 245, 7, 124,
/* 310 */ 214, 260, 214, 217, 109, 217, 5, 2, 7, 124,
/* 320 */ 5, 99, 7, 103, 9, 103, 115, 116, 37, 124,
/* 330 */ 99, 99, 99, 103, 103, 103, 103, 99, 5, 98,
/* 340 */ 7, 103, 122, 99, 128, 129, 267, 103, 33, 34,
/* 350 */ 120, 99, 128, 129, 241, 103, 73, 74, 61, 62,
/* 360 */ 260, 260, 260, 260, 260, 260, 260, 260, 260, 260,
/* 370 */ 246, 260, 241, 241, 241, 241, 241, 210, 242, 210,
/* 380 */ 241, 244, 210, 210, 267, 210, 210, 210, 248, 210,
/* 390 */ 104, 210, 210, 210, 210, 105, 210, 244, 210, 210,
/* 400 */ 210, 210, 210, 210, 210, 59, 210, 210, 109, 210,
/* 410 */ 210, 210, 210, 210, 210, 263, 257, 210, 263, 104,
/* 420 */ 210, 263, 210, 210, 210, 210, 119, 121, 210, 210,
/* 430 */ 256, 210, 118, 210, 113, 210, 210, 210, 210, 117,
/* 440 */ 112, 111, 110, 123, 210, 76, 211, 211, 211, 84,
/* 450 */ 83, 49, 80, 82, 53, 81, 79, 76, 211, 5,
/* 460 */ 211, 135, 5, 5, 255, 215, 215, 211, 5, 135,
/* 470 */ 211, 5, 212, 86, 211, 126, 219, 223, 225, 224,
/* 480 */ 222, 220, 218, 221, 212, 211, 216, 99, 106, 244,
/* 490 */ 213, 107, 252, 254, 251, 253, 250, 249, 103, 99,
/* 500 */ 1, 98, 98, 114, 99, 98, 114, 73, 99, 103,
/* 510 */ 98, 103, 98, 100, 104, 98, 100, 9, 5, 5,
/* 520 */ 5, 5, 5, 77, 15, 73, 16, 129, 129, 103,
/* 530 */ 5, 5, 99, 98, 5, 5, 5, 5, 5, 5,
/* 540 */ 5, 5, 5, 5, 5, 5, 5, 5, 103, 77,
/* 550 */ 59, 58, 0, 271, 271, 271, 271, 271, 271, 271,
/* 560 */ 271, 271, 271, 271, 21, 21, 271, 271, 271, 271,
/* 570 */ 271, 271, 271, 271, 271, 271, 271, 271, 271, 271,
/* 580 */ 271, 271, 271, 271, 271, 271, 271, 271, 271, 271,
/* 590 */ 271, 271, 271, 271, 271, 271, 271, 271, 271, 271,
/* 600 */ 271, 271, 271, 271, 271, 271, 271, 271, 271, 271,
/* 610 */ 271, 271, 271, 271, 271, 271, 271, 271, 271, 271,
/* 620 */ 271, 271, 271, 271, 271, 271, 271, 271, 271, 271,
/* 630 */ 271, 271, 271, 271, 271, 271, 271, 271, 271, 271,
/* 640 */ 271, 271, 271, 271, 271, 271, 271, 271, 271, 271,
/* 650 */ 271, 271, 271, 271, 271, 271, 271, 271, 271, 271,
/* 660 */ 271, 271, 271, 271, 271, 271, 271, 271, 271, 271,
/* 670 */ 271, 271, 271, 271, 271, 271, 271, 271, 271, 271,
/* 680 */ 271, 271, 271, 271, 271, 271, 271, 271, 271, 271,
/* 690 */ 271, 271, 271, 271, 271, 271, 271, 271, 271, 271,
/* 700 */ 271, 271, 271, 271, 271, 271, 271, 271, 271, 271,
/* 710 */ 271, 271, 271, 271, 271, 271, 271, 271, 271, 271,
/* 720 */ 271, 271, 271, 271, 271, 271, 271, 271, 271, 271,
/* 730 */ 271, 271, 271, 271, 271, 271, 271, 271, 271, 271,
/* 740 */ 271, 271, 271, 271, 271, 271, 271, 271, 271, 271,
/* 750 */ 271, 271, 271, 271, 271, 271, 271, 271, 271, 271,
/* 760 */ 271, 271, 271, 271, 271, 271, 271, 271, 271, 271,
/* 770 */ 271, 271,
/* 0 */ 1, 33, 34, 61, 62, 37, 38, 39, 9, 67,
/* 10 */ 68, 69, 13, 14, 127, 16, 17, 75, 58, 20,
/* 20 */ 21, 134, 135, 24, 25, 26, 27, 28, 63, 64,
/* 30 */ 65, 98, 33, 34, 101, 102, 37, 38, 39, 13,
/* 40 */ 14, 0, 16, 17, 61, 62, 20, 21, 208, 209,
/* 50 */ 24, 25, 26, 27, 28, 37, 38, 39, 21, 33,
/* 60 */ 34, 73, 74, 37, 38, 39, 13, 14, 1, 16,
/* 70 */ 17, 66, 211, 20, 21, 103, 9, 24, 25, 26,
/* 80 */ 27, 28, 5, 129, 130, 245, 33, 34, 248, 211,
/* 90 */ 37, 38, 39, 121, 25, 26, 27, 28, 129, 130,
/* 100 */ 260, 102, 33, 34, 59, 99, 37, 38, 39, 103,
/* 110 */ 33, 34, 45, 46, 47, 48, 49, 50, 51, 52,
/* 120 */ 53, 54, 55, 56, 57, 99, 103, 60, 14, 268,
/* 130 */ 16, 17, 109, 128, 20, 21, 131, 132, 24, 25,
/* 140 */ 26, 27, 28, 5, 266, 7, 268, 33, 34, 103,
/* 150 */ 99, 37, 38, 39, 103, 16, 17, 211, 21, 20,
/* 160 */ 21, 211, 211, 24, 25, 26, 27, 28, 5, 123,
/* 170 */ 7, 99, 33, 34, 211, 103, 37, 38, 39, 227,
/* 180 */ 77, 229, 230, 231, 232, 233, 234, 235, 236, 237,
/* 190 */ 238, 239, 240, 211, 244, 244, 246, 246, 85, 86,
/* 200 */ 87, 88, 89, 90, 91, 92, 93, 94, 95, 96,
/* 210 */ 97, 1, 2, 211, 268, 5, 270, 7, 15, 9,
/* 220 */ 103, 1, 2, 44, 1, 5, 244, 7, 246, 9,
/* 230 */ 5, 268, 7, 59, 61, 62, 5, 5, 7, 60,
/* 240 */ 67, 68, 69, 33, 34, 66, 244, 37, 246, 70,
/* 250 */ 71, 72, 251, 33, 34, 1, 2, 37, 5, 5,
/* 260 */ 37, 7, 261, 9, 2, 215, 262, 5, 218, 7,
/* 270 */ 227, 9, 98, 230, 231, 271, 272, 98, 235, 99,
/* 280 */ 237, 238, 239, 103, 105, 106, 215, 33, 34, 218,
/* 290 */ 85, 211, 87, 88, 99, 33, 34, 92, 103, 94,
/* 300 */ 95, 96, 5, 61, 62, 126, 262, 104, 98, 67,
/* 310 */ 68, 69, 133, 99, 99, 271, 272, 103, 98, 211,
/* 320 */ 110, 99, 107, 99, 1, 103, 98, 103, 116, 117,
/* 330 */ 110, 211, 9, 215, 106, 125, 218, 73, 245, 98,
/* 340 */ 228, 262, 78, 228, 264, 125, 211, 106, 5, 228,
/* 350 */ 5, 272, 98, 260, 246, 210, 211, 5, 5, 247,
/* 360 */ 5, 241, 247, 5, 110, 5, 104, 5, 247, 5,
/* 370 */ 5, 5, 103, 98, 5, 99, 5, 130, 130, 125,
/* 380 */ 73, 77, 5, 16, 5, 15, 5, 5, 5, 9,
/* 390 */ 73, 100, 98, 100, 98, 115, 104, 98, 263, 99,
/* 400 */ 115, 103, 99, 98, 103, 1, 98, 98, 127, 99,
/* 410 */ 108, 99, 86, 107, 103, 5, 5, 5, 136, 5,
/* 420 */ 136, 5, 214, 217, 213, 212, 76, 59, 212, 222,
/* 430 */ 213, 212, 81, 79, 225, 49, 80, 219, 53, 82,
/* 440 */ 106, 245, 221, 84, 83, 212, 124, 220, 76, 223,
/* 450 */ 216, 216, 212, 224, 250, 212, 226, 111, 118, 112,
/* 460 */ 119, 113, 212, 114, 122, 265, 265, 265, 212, 212,
/* 470 */ 211, 211, 211, 273, 211, 273, 211, 211, 211, 211,
/* 480 */ 273, 211, 109, 120, 110, 211, 273, 273, 252, 211,
/* 490 */ 253, 273, 254, 78, 255, 273, 245, 211, 211, 211,
/* 500 */ 256, 249, 257, 273, 258, 250, 211, 249, 259, 273,
/* 510 */ 273, 273, 273, 273, 242, 242, 245, 273, 273, 273,
/* 520 */ 243, 242, 273, 273, 211, 211, 211, 211, 273, 211,
/* 530 */ 211, 211, 211, 273, 273, 211, 211, 247, 211, 211,
/* 540 */ 211, 211, 211, 211, 211, 273, 211, 211, 211, 211,
/* 550 */ 211, 273, 269, 273, 273, 211, 273, 273, 269, 273,
/* 560 */ 273, 273, 273, 273, 273, 273, 273, 273, 273, 273,
/* 570 */ 273, 273, 273, 273, 211, 273, 273, 273, 273, 273,
/* 580 */ 273, 273, 273, 273, 273, 273, 211, 211, 273, 211,
/* 590 */ 273, 273, 273, 273, 273, 211, 273, 273, 273, 273,
/* 600 */ 273, 273, 273, 273, 273, 273, 273, 273, 273, 273,
/* 610 */ 273, 273, 273, 273, 273, 273, 273, 273, 273, 273,
/* 620 */ 273, 273, 273, 273, 273, 273, 273, 273, 273, 242,
/* 630 */ 242, 242, 242, 273, 273, 273, 273, 273, 247, 273,
/* 640 */ 273, 273, 273, 273, 273, 273, 273, 273, 273, 273,
/* 650 */ 273, 273, 273, 273, 262, 262, 262, 262, 262, 262,
/* 660 */ 262, 262, 262, 262, 262, 262, 273, 262, 262, 262,
/* 670 */ 262, 262, 273, 273, 273, 262,
};
#define YY_SHIFT_COUNT (251)
#define YY_SHIFT_MIN (0)
#define YY_SHIFT_MAX (552)
static const unsigned short int yy_shift_ofst[] = {
/* 0 */ 145, 74, 164, 185, 205, 6, 6, 6, 6, 6,
/* 10 */ 6, 0, 22, 205, 315, 315, 315, 93, 6, 6,
/* 20 */ 6, 6, 6, 56, 60, 60, 566, 195, 205, 205,
/* 30 */ 205, 205, 205, 205, 205, 205, 205, 205, 205, 205,
/* 40 */ 205, 205, 205, 205, 205, 315, 315, 52, 52, 52,
/* 50 */ 52, 52, 52, 11, 52, 125, 6, 6, 6, 6,
/* 60 */ 211, 211, 168, 6, 6, 6, 6, 6, 6, 6,
/* 70 */ 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
/* 80 */ 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
/* 90 */ 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
/* 100 */ 6, 6, 290, 346, 346, 299, 299, 299, 346, 307,
/* 110 */ 306, 314, 321, 322, 328, 330, 332, 320, 290, 346,
/* 120 */ 346, 369, 369, 346, 365, 367, 402, 372, 371, 401,
/* 130 */ 374, 377, 346, 381, 346, 381, 346, 566, 566, 27,
/* 140 */ 67, 67, 67, 94, 119, 208, 208, 208, 206, 187,
/* 150 */ 187, 187, 187, 217, 229, 24, 15, 86, 86, 198,
/* 160 */ 138, 110, 222, 231, 232, 233, 275, 311, 291, 241,
/* 170 */ 286, 220, 230, 238, 244, 252, 216, 224, 301, 333,
/* 180 */ 283, 297, 454, 326, 457, 458, 334, 463, 466, 387,
/* 190 */ 349, 382, 388, 384, 395, 400, 403, 499, 404, 405,
/* 200 */ 407, 406, 389, 408, 392, 409, 412, 410, 414, 413,
/* 210 */ 417, 416, 434, 508, 513, 514, 515, 516, 517, 446,
/* 220 */ 509, 452, 510, 398, 399, 426, 525, 526, 433, 435,
/* 230 */ 426, 529, 530, 531, 532, 533, 534, 535, 536, 537,
/* 240 */ 538, 539, 540, 541, 542, 445, 472, 543, 544, 491,
/* 250 */ 493, 552,
#define YY_SHIFT_USE_DFLT (-114)
#define YY_SHIFT_COUNT (253)
#define YY_SHIFT_MIN (-113)
#define YY_SHIFT_MAX (416)
static const short yy_shift_ofst[] = {
/* 0 */ 179, 113, 205, 220, 254, 323, 323, 323, 323, 323,
/* 10 */ 323, -1, 67, 254, 262, 262, 262, 241, 323, 323,
/* 20 */ 323, 323, 323, 264, 415, 415, -114, 210, 254, 254,
/* 30 */ 254, 254, 254, 254, 254, 254, 254, 254, 254, 254,
/* 40 */ 254, 254, 254, 254, 254, 262, 262, 77, 77, 77,
/* 50 */ 77, 77, 77, -67, 77, 228, 323, 323, 323, 323,
/* 60 */ 212, 212, 23, 323, 323, 323, 323, 323, 323, 323,
/* 70 */ 323, 323, 323, 323, 323, 323, 323, 323, 323, 323,
/* 80 */ 323, 323, 323, 323, 323, 323, 323, 323, 323, 323,
/* 90 */ 323, 323, 323, 323, 323, 323, 323, 323, 323, 323,
/* 100 */ 323, 323, 334, 322, 373, 368, 368, 374, 374, 374,
/* 110 */ 368, 363, 342, 341, 349, 340, 348, 347, 346, 322,
/* 120 */ 334, 368, 368, 372, 372, 368, 359, 361, 386, 356,
/* 130 */ 357, 385, 351, 354, 368, 350, 368, 350, 368, -114,
/* 140 */ -114, 26, 53, 53, 53, 114, 139, 69, 69, 69,
/* 150 */ -58, -32, -32, -32, -32, 242, 173, 5, -113, 18,
/* 160 */ 18, -35, 215, 224, 222, 214, 195, 180, 231, 225,
/* 170 */ 223, 174, 203, 46, -28, 72, 51, 6, -31, -46,
/* 180 */ 163, 138, -12, -17, 416, 284, 414, 412, 282, 411,
/* 190 */ 410, 326, 281, 306, 312, 302, 311, 310, 309, 404,
/* 200 */ 308, 303, 305, 301, 285, 298, 280, 300, 299, 292,
/* 210 */ 296, 293, 294, 291, 317, 380, 383, 382, 381, 379,
/* 220 */ 377, 304, 370, 307, 367, 248, 247, 269, 371, 369,
/* 230 */ 276, 275, 269, 366, 365, 364, 362, 360, 358, 355,
/* 240 */ 353, 352, 345, 343, 297, 253, 232, 117, 103, 137,
/* 250 */ 37, 45, -40, 41,
};
#define YY_REDUCE_COUNT (138)
#define YY_REDUCE_MIN (-258)
#define YY_REDUCE_MAX (277)
#define YY_REDUCE_USE_DFLT (-161)
#define YY_REDUCE_COUNT (140)
#define YY_REDUCE_MIN (-160)
#define YY_REDUCE_MAX (413)
static const short yy_reduce_ofst[] = {
/* 0 */ -202, -54, -226, -224, -211, -73, -11, -147, 21, 44,
/* 10 */ 62, -111, -191, -238, -130, -19, 42, -155, -22, -93,
/* 20 */ -9, 55, -103, 85, 96, 98, -197, -258, -231, -230,
/* 30 */ -225, -57, -12, 51, 100, 101, 102, 103, 104, 105,
/* 40 */ 106, 107, 108, 109, 111, -116, 124, 113, 131, 132,
/* 50 */ 133, 134, 135, 136, 139, 137, 167, 169, 172, 173,
/* 60 */ 79, 117, 140, 175, 176, 177, 179, 181, 182, 183,
/* 70 */ 184, 186, 188, 189, 190, 191, 192, 193, 194, 196,
/* 80 */ 197, 199, 200, 201, 202, 203, 204, 207, 210, 212,
/* 90 */ 213, 214, 215, 218, 219, 221, 223, 225, 226, 227,
/* 100 */ 228, 234, 153, 235, 236, 152, 155, 158, 237, 159,
/* 110 */ 174, 209, 239, 242, 240, 243, 246, 248, 245, 247,
/* 120 */ 249, 250, 251, 256, 253, 255, 254, 257, 258, 261,
/* 130 */ 262, 264, 259, 260, 263, 272, 274, 270, 277,
/* 0 */ -160, -48, 43, 44, 4, -54, -122, 2, -18, -49,
/* 10 */ -50, 135, 145, 79, 121, 115, 112, 93, 80, -37,
/* 20 */ -139, 120, 108, 118, 71, 50, 1, 413, 409, 408,
/* 30 */ 407, 406, 405, 403, 402, 401, 400, 399, 398, 397,
/* 40 */ 396, 395, 394, 393, 392, 391, 290, 390, 389, 388,
/* 50 */ 387, 279, 273, 277, 272, 271, 384, 378, 376, 375,
/* 60 */ 289, 283, 258, 363, 344, 339, 338, 337, 336, 335,
/* 70 */ 333, 332, 331, 330, 329, 328, 327, 325, 324, 321,
/* 80 */ 320, 319, 318, 316, 315, 314, 313, 295, 288, 287,
/* 90 */ 286, 278, 274, 270, 268, 267, 266, 265, 263, 261,
/* 100 */ 260, 259, 251, 255, 252, 257, 256, 202, 201, 200,
/* 110 */ 250, 249, 246, 245, 244, 239, 238, 237, 236, 204,
/* 120 */ 196, 243, 240, 235, 234, 233, 230, 209, 229, 227,
/* 130 */ 226, 221, 207, 218, 219, 217, 216, 211, 213, 206,
/* 140 */ 208,
};
static const YYACTIONTYPE yy_default[] = {
/* 0 */ 646, 700, 689, 868, 868, 646, 646, 646, 646, 646,
/* 10 */ 646, 793, 664, 868, 646, 646, 646, 646, 646, 646,
/* 20 */ 646, 646, 646, 702, 702, 702, 788, 646, 646, 646,
/* 30 */ 646, 646, 646, 646, 646, 646, 646, 646, 646, 646,
/* 40 */ 646, 646, 646, 646, 646, 646, 646, 646, 646, 646,
/* 50 */ 646, 646, 646, 646, 646, 646, 646, 795, 797, 646,
/* 60 */ 815, 815, 786, 646, 646, 646, 646, 646, 646, 646,
/* 70 */ 646, 646, 646, 646, 646, 646, 646, 646, 646, 646,
/* 80 */ 646, 687, 646, 685, 646, 646, 646, 646, 646, 646,
/* 90 */ 646, 646, 646, 646, 646, 646, 674, 646, 646, 646,
/* 100 */ 646, 646, 646, 666, 666, 646, 646, 646, 666, 822,
/* 110 */ 826, 820, 808, 816, 807, 803, 802, 830, 646, 666,
/* 120 */ 666, 697, 697, 666, 718, 716, 714, 706, 712, 708,
/* 130 */ 710, 704, 666, 695, 666, 695, 666, 734, 748, 646,
/* 140 */ 831, 867, 821, 857, 856, 863, 855, 854, 646, 850,
/* 150 */ 851, 853, 852, 646, 646, 646, 646, 859, 858, 646,
/* 160 */ 646, 646, 646, 646, 646, 646, 646, 646, 646, 833,
/* 170 */ 646, 827, 823, 646, 646, 646, 646, 646, 646, 646,
/* 180 */ 646, 646, 646, 646, 646, 646, 646, 646, 646, 646,
/* 190 */ 646, 785, 646, 646, 794, 646, 646, 646, 646, 646,
/* 200 */ 646, 817, 646, 809, 646, 646, 646, 646, 646, 646,
/* 210 */ 646, 762, 646, 646, 646, 646, 646, 646, 646, 646,
/* 220 */ 646, 646, 646, 646, 646, 872, 646, 646, 646, 756,
/* 230 */ 870, 646, 646, 646, 646, 646, 646, 646, 646, 646,
/* 240 */ 646, 646, 646, 646, 646, 721, 646, 672, 670, 646,
/* 250 */ 662, 646,
/* 0 */ 652, 471, 460, 641, 641, 652, 652, 652, 652, 652,
/* 10 */ 652, 566, 435, 641, 652, 652, 652, 652, 652, 652,
/* 20 */ 652, 652, 652, 473, 473, 473, 561, 652, 652, 652,
/* 30 */ 652, 652, 652, 652, 652, 652, 652, 652, 652, 652,
/* 40 */ 652, 652, 652, 652, 652, 652, 652, 652, 652, 652,
/* 50 */ 652, 652, 652, 652, 652, 652, 652, 568, 570, 652,
/* 60 */ 588, 588, 559, 652, 652, 652, 652, 652, 652, 652,
/* 70 */ 652, 652, 652, 652, 652, 652, 652, 652, 652, 652,
/* 80 */ 652, 458, 652, 456, 652, 652, 652, 652, 652, 652,
/* 90 */ 652, 652, 652, 652, 652, 652, 445, 652, 652, 652,
/* 100 */ 652, 652, 652, 603, 652, 437, 437, 652, 652, 652,
/* 110 */ 437, 595, 599, 593, 581, 589, 580, 576, 575, 603,
/* 120 */ 652, 437, 437, 468, 468, 437, 489, 487, 485, 477,
/* 130 */ 483, 479, 481, 475, 437, 466, 437, 466, 437, 505,
/* 140 */ 519, 652, 604, 640, 594, 630, 629, 636, 628, 627,
/* 150 */ 652, 623, 624, 626, 625, 652, 652, 652, 652, 632,
/* 160 */ 631, 652, 652, 652, 652, 652, 652, 652, 652, 652,
/* 170 */ 652, 606, 652, 600, 596, 652, 652, 652, 652, 652,
/* 180 */ 652, 652, 652, 652, 652, 652, 652, 652, 652, 652,
/* 190 */ 652, 652, 652, 558, 652, 652, 567, 652, 652, 652,
/* 200 */ 652, 652, 652, 590, 652, 582, 652, 652, 652, 652,
/* 210 */ 652, 652, 652, 533, 652, 652, 652, 652, 652, 652,
/* 220 */ 652, 652, 652, 652, 652, 652, 652, 645, 652, 652,
/* 230 */ 652, 527, 643, 652, 652, 652, 652, 652, 652, 652,
/* 240 */ 652, 652, 652, 652, 652, 652, 652, 492, 652, 443,
/* 250 */ 441, 652, 433, 652, 651, 650, 649, 642, 557, 556,
/* 260 */ 555, 554, 552, 551, 563, 565, 564, 562, 569, 571,
/* 270 */ 560, 574, 573, 578, 577, 579, 572, 592, 591, 584,
/* 280 */ 585, 587, 586, 583, 620, 638, 639, 637, 635, 634,
/* 290 */ 633, 619, 618, 617, 616, 615, 612, 614, 611, 613,
/* 300 */ 610, 609, 608, 607, 605, 622, 621, 602, 601, 598,
/* 310 */ 597, 553, 536, 535, 534, 532, 472, 518, 517, 516,
/* 320 */ 515, 514, 513, 512, 511, 510, 509, 508, 507, 506,
/* 330 */ 504, 500, 498, 497, 496, 493, 467, 470, 469, 648,
/* 340 */ 647, 646, 644, 538, 539, 531, 530, 529, 528, 537,
/* 350 */ 491, 490, 488, 486, 478, 484, 480, 482, 476, 474,
/* 360 */ 462, 461, 526, 525, 524, 523, 522, 521, 520, 503,
/* 370 */ 502, 501, 499, 495, 494, 541, 550, 549, 548, 547,
/* 380 */ 546, 545, 544, 543, 542, 540, 459, 457, 455, 454,
/* 390 */ 453, 452, 451, 450, 449, 448, 465, 447, 446, 444,
/* 400 */ 442, 440, 439, 464, 463, 438, 436, 434, 432, 431,
/* 410 */ 430, 429, 428, 427, 426, 425, 424, 423, 422, 421,
};
/********** End of lemon-generated parsing tables *****************************/
/* The next table maps tokens (terminal symbols) into fallback tokens.
** If a construct like the following:
/* The next table maps tokens into fallback tokens. If a construct
** like the following:
**
** %fallback ID X Y Z.
**
......@@ -432,10 +415,6 @@ static const YYACTIONTYPE yy_default[] = {
** and Z. Whenever one of the tokens X, Y, or Z is input to the parser
** but it does not parse, the type of the token is changed to ID and
** the parse is retried before an error is thrown.
**
** This feature can be used, for example, to cause some keywords in a language
** to revert to identifiers if they keyword does not apply in the context where
** it appears.
*/
#ifdef YYFALLBACK
static const YYCODETYPE yyFallback[] = {
......@@ -544,6 +523,7 @@ static const YYCODETYPE yyFallback[] = {
0, /* AS => nothing */
0, /* COMMA => nothing */
1, /* NULL => ID */
0, /* DELETE => nothing */
0, /* SELECT => nothing */
0, /* UNION => nothing */
1, /* ALL => ID */
......@@ -659,13 +639,9 @@ static const YYCODETYPE yyFallback[] = {
** + The semantic value stored at this level of the stack. This is
** the information used by the action routines in the grammar.
** It is sometimes called the "minor" token.
**
** After the "shift" half of a SHIFTREDUCE action, the stateno field
** actually contains the reduce action for the second half of the
** SHIFTREDUCE.
*/
struct yyStackEntry {
YYACTIONTYPE stateno; /* The state-number, or reduce action in SHIFTREDUCE */
YYACTIONTYPE stateno; /* The state-number */
YYCODETYPE major; /* The major token value. This is the code
** number for the token at this stack level */
YYMINORTYPE minor; /* The user-supplied minor token value. This
......@@ -676,21 +652,17 @@ typedef struct yyStackEntry yyStackEntry;
/* The state of the parser is completely contained in an instance of
** the following structure */
struct yyParser {
yyStackEntry *yytos; /* Pointer to top element of the stack */
int yyidx; /* Index of top element in stack */
#ifdef YYTRACKMAXSTACKDEPTH
int yyhwm; /* High-water mark of the stack */
int yyidxMax; /* Maximum value of yyidx */
#endif
#ifndef YYNOERRORRECOVERY
int yyerrcnt; /* Shifts left before out of the error */
#endif
ParseARG_SDECL /* A place to hold %extra_argument */
#if YYSTACKDEPTH<=0
int yystksz; /* Current side of the stack */
yyStackEntry *yystack; /* The parser's stack */
yyStackEntry yystk0; /* First stack entry */
#else
yyStackEntry yystack[YYSTACKDEPTH]; /* The parser's stack */
yyStackEntry *yystackEnd; /* Last entry in the stack */
#endif
};
typedef struct yyParser yyParser;
......@@ -727,283 +699,81 @@ void ParseTrace(FILE *TraceFILE, char *zTracePrompt){
}
#endif /* NDEBUG */
#if defined(YYCOVERAGE) || !defined(NDEBUG)
#ifndef NDEBUG
/* For tracing shifts, the names of all terminals and nonterminals
** are required. The following table supplies these names */
static const char *const yyTokenName[] = {
/* 0 */ "$",
/* 1 */ "ID",
/* 2 */ "BOOL",
/* 3 */ "TINYINT",
/* 4 */ "SMALLINT",
/* 5 */ "INTEGER",
/* 6 */ "BIGINT",
/* 7 */ "FLOAT",
/* 8 */ "DOUBLE",
/* 9 */ "STRING",
/* 10 */ "TIMESTAMP",
/* 11 */ "BINARY",
/* 12 */ "NCHAR",
/* 13 */ "OR",
/* 14 */ "AND",
/* 15 */ "NOT",
/* 16 */ "EQ",
/* 17 */ "NE",
/* 18 */ "ISNULL",
/* 19 */ "NOTNULL",
/* 20 */ "IS",
/* 21 */ "LIKE",
/* 22 */ "GLOB",
/* 23 */ "BETWEEN",
/* 24 */ "IN",
/* 25 */ "GT",
/* 26 */ "GE",
/* 27 */ "LT",
/* 28 */ "LE",
/* 29 */ "BITAND",
/* 30 */ "BITOR",
/* 31 */ "LSHIFT",
/* 32 */ "RSHIFT",
/* 33 */ "PLUS",
/* 34 */ "MINUS",
/* 35 */ "DIVIDE",
/* 36 */ "TIMES",
/* 37 */ "STAR",
/* 38 */ "SLASH",
/* 39 */ "REM",
/* 40 */ "CONCAT",
/* 41 */ "UMINUS",
/* 42 */ "UPLUS",
/* 43 */ "BITNOT",
/* 44 */ "SHOW",
/* 45 */ "DATABASES",
/* 46 */ "MNODES",
/* 47 */ "DNODES",
/* 48 */ "ACCOUNTS",
/* 49 */ "USERS",
/* 50 */ "MODULES",
/* 51 */ "QUERIES",
/* 52 */ "CONNECTIONS",
/* 53 */ "STREAMS",
/* 54 */ "VARIABLES",
/* 55 */ "SCORES",
/* 56 */ "GRANTS",
/* 57 */ "VNODES",
/* 58 */ "IPTOKEN",
/* 59 */ "DOT",
/* 60 */ "CREATE",
/* 61 */ "TABLE",
/* 62 */ "DATABASE",
/* 63 */ "TABLES",
/* 64 */ "STABLES",
/* 65 */ "VGROUPS",
/* 66 */ "DROP",
/* 67 */ "DNODE",
/* 68 */ "USER",
/* 69 */ "ACCOUNT",
/* 70 */ "USE",
/* 71 */ "DESCRIBE",
/* 72 */ "ALTER",
/* 73 */ "PASS",
/* 74 */ "PRIVILEGE",
/* 75 */ "LOCAL",
/* 76 */ "IF",
/* 77 */ "EXISTS",
/* 78 */ "PPS",
/* 79 */ "TSERIES",
/* 80 */ "DBS",
/* 81 */ "STORAGE",
/* 82 */ "QTIME",
/* 83 */ "CONNS",
/* 84 */ "STATE",
/* 85 */ "KEEP",
/* 86 */ "CACHE",
/* 87 */ "REPLICA",
/* 88 */ "QUORUM",
/* 89 */ "DAYS",
/* 90 */ "MINROWS",
/* 91 */ "MAXROWS",
/* 92 */ "BLOCKS",
/* 93 */ "CTIME",
/* 94 */ "WAL",
/* 95 */ "FSYNC",
/* 96 */ "COMP",
/* 97 */ "PRECISION",
/* 98 */ "LP",
/* 99 */ "RP",
/* 100 */ "TAGS",
/* 101 */ "USING",
/* 102 */ "AS",
/* 103 */ "COMMA",
/* 104 */ "NULL",
/* 105 */ "SELECT",
/* 106 */ "UNION",
/* 107 */ "ALL",
/* 108 */ "FROM",
/* 109 */ "VARIABLE",
/* 110 */ "INTERVAL",
/* 111 */ "FILL",
/* 112 */ "SLIDING",
/* 113 */ "ORDER",
/* 114 */ "BY",
/* 115 */ "ASC",
/* 116 */ "DESC",
/* 117 */ "GROUP",
/* 118 */ "HAVING",
/* 119 */ "LIMIT",
/* 120 */ "OFFSET",
/* 121 */ "SLIMIT",
/* 122 */ "SOFFSET",
/* 123 */ "WHERE",
/* 124 */ "NOW",
/* 125 */ "RESET",
/* 126 */ "QUERY",
/* 127 */ "ADD",
/* 128 */ "COLUMN",
/* 129 */ "TAG",
/* 130 */ "CHANGE",
/* 131 */ "SET",
/* 132 */ "KILL",
/* 133 */ "CONNECTION",
/* 134 */ "STREAM",
/* 135 */ "COLON",
/* 136 */ "ABORT",
/* 137 */ "AFTER",
/* 138 */ "ATTACH",
/* 139 */ "BEFORE",
/* 140 */ "BEGIN",
/* 141 */ "CASCADE",
/* 142 */ "CLUSTER",
/* 143 */ "CONFLICT",
/* 144 */ "COPY",
/* 145 */ "DEFERRED",
/* 146 */ "DELIMITERS",
/* 147 */ "DETACH",
/* 148 */ "EACH",
/* 149 */ "END",
/* 150 */ "EXPLAIN",
/* 151 */ "FAIL",
/* 152 */ "FOR",
/* 153 */ "IGNORE",
/* 154 */ "IMMEDIATE",
/* 155 */ "INITIALLY",
/* 156 */ "INSTEAD",
/* 157 */ "MATCH",
/* 158 */ "KEY",
/* 159 */ "OF",
/* 160 */ "RAISE",
/* 161 */ "REPLACE",
/* 162 */ "RESTRICT",
/* 163 */ "ROW",
/* 164 */ "STATEMENT",
/* 165 */ "TRIGGER",
/* 166 */ "VIEW",
/* 167 */ "COUNT",
/* 168 */ "SUM",
/* 169 */ "AVG",
/* 170 */ "MIN",
/* 171 */ "MAX",
/* 172 */ "FIRST",
/* 173 */ "LAST",
/* 174 */ "TOP",
/* 175 */ "BOTTOM",
/* 176 */ "STDDEV",
/* 177 */ "PERCENTILE",
/* 178 */ "APERCENTILE",
/* 179 */ "LEASTSQUARES",
/* 180 */ "HISTOGRAM",
/* 181 */ "DIFF",
/* 182 */ "SPREAD",
/* 183 */ "TWA",
/* 184 */ "INTERP",
/* 185 */ "LAST_ROW",
/* 186 */ "RATE",
/* 187 */ "IRATE",
/* 188 */ "SUM_RATE",
/* 189 */ "SUM_IRATE",
/* 190 */ "AVG_RATE",
/* 191 */ "AVG_IRATE",
/* 192 */ "TBID",
/* 193 */ "SEMI",
/* 194 */ "NONE",
/* 195 */ "PREV",
/* 196 */ "LINEAR",
/* 197 */ "IMPORT",
/* 198 */ "METRIC",
/* 199 */ "TBNAME",
/* 200 */ "JOIN",
/* 201 */ "METRICS",
/* 202 */ "STABLE",
/* 203 */ "INSERT",
/* 204 */ "INTO",
/* 205 */ "VALUES",
/* 206 */ "error",
/* 207 */ "program",
/* 208 */ "cmd",
/* 209 */ "dbPrefix",
/* 210 */ "ids",
/* 211 */ "cpxName",
/* 212 */ "ifexists",
/* 213 */ "alter_db_optr",
/* 214 */ "acct_optr",
/* 215 */ "ifnotexists",
/* 216 */ "db_optr",
/* 217 */ "pps",
/* 218 */ "tseries",
/* 219 */ "dbs",
/* 220 */ "streams",
/* 221 */ "storage",
/* 222 */ "qtime",
/* 223 */ "users",
/* 224 */ "conns",
/* 225 */ "state",
/* 226 */ "keep",
/* 227 */ "tagitemlist",
/* 228 */ "cache",
/* 229 */ "replica",
/* 230 */ "quorum",
/* 231 */ "days",
/* 232 */ "minrows",
/* 233 */ "maxrows",
/* 234 */ "blocks",
/* 235 */ "ctime",
/* 236 */ "wal",
/* 237 */ "fsync",
/* 238 */ "comp",
/* 239 */ "prec",
/* 240 */ "typename",
/* 241 */ "signed",
/* 242 */ "create_table_args",
/* 243 */ "columnlist",
/* 244 */ "select",
/* 245 */ "column",
/* 246 */ "tagitem",
/* 247 */ "selcollist",
/* 248 */ "from",
/* 249 */ "where_opt",
/* 250 */ "interval_opt",
/* 251 */ "fill_opt",
/* 252 */ "sliding_opt",
/* 253 */ "groupby_opt",
/* 254 */ "orderby_opt",
/* 255 */ "having_opt",
/* 256 */ "slimit_opt",
/* 257 */ "limit_opt",
/* 258 */ "union",
/* 259 */ "sclp",
/* 260 */ "expr",
/* 261 */ "as",
/* 262 */ "tablelist",
/* 263 */ "tmvar",
/* 264 */ "sortlist",
/* 265 */ "sortitem",
/* 266 */ "item",
/* 267 */ "sortorder",
/* 268 */ "grouplist",
/* 269 */ "exprlist",
/* 270 */ "expritem",
"$", "ID", "BOOL", "TINYINT",
"SMALLINT", "INTEGER", "BIGINT", "FLOAT",
"DOUBLE", "STRING", "TIMESTAMP", "BINARY",
"NCHAR", "OR", "AND", "NOT",
"EQ", "NE", "ISNULL", "NOTNULL",
"IS", "LIKE", "GLOB", "BETWEEN",
"IN", "GT", "GE", "LT",
"LE", "BITAND", "BITOR", "LSHIFT",
"RSHIFT", "PLUS", "MINUS", "DIVIDE",
"TIMES", "STAR", "SLASH", "REM",
"CONCAT", "UMINUS", "UPLUS", "BITNOT",
"SHOW", "DATABASES", "MNODES", "DNODES",
"ACCOUNTS", "USERS", "MODULES", "QUERIES",
"CONNECTIONS", "STREAMS", "VARIABLES", "SCORES",
"GRANTS", "VNODES", "IPTOKEN", "DOT",
"CREATE", "TABLE", "DATABASE", "TABLES",
"STABLES", "VGROUPS", "DROP", "DNODE",
"USER", "ACCOUNT", "USE", "DESCRIBE",
"ALTER", "PASS", "PRIVILEGE", "LOCAL",
"IF", "EXISTS", "PPS", "TSERIES",
"DBS", "STORAGE", "QTIME", "CONNS",
"STATE", "KEEP", "CACHE", "REPLICA",
"QUORUM", "DAYS", "MINROWS", "MAXROWS",
"BLOCKS", "CTIME", "WAL", "FSYNC",
"COMP", "PRECISION", "LP", "RP",
"TAGS", "USING", "AS", "COMMA",
"NULL", "DELETE", "SELECT", "UNION",
"ALL", "FROM", "VARIABLE", "INTERVAL",
"FILL", "SLIDING", "ORDER", "BY",
"ASC", "DESC", "GROUP", "HAVING",
"LIMIT", "OFFSET", "SLIMIT", "SOFFSET",
"WHERE", "NOW", "RESET", "QUERY",
"ADD", "COLUMN", "TAG", "CHANGE",
"SET", "KILL", "CONNECTION", "STREAM",
"COLON", "ABORT", "AFTER", "ATTACH",
"BEFORE", "BEGIN", "CASCADE", "CLUSTER",
"CONFLICT", "COPY", "DEFERRED", "DELIMITERS",
"DETACH", "EACH", "END", "EXPLAIN",
"FAIL", "FOR", "IGNORE", "IMMEDIATE",
"INITIALLY", "INSTEAD", "MATCH", "KEY",
"OF", "RAISE", "REPLACE", "RESTRICT",
"ROW", "STATEMENT", "TRIGGER", "VIEW",
"COUNT", "SUM", "AVG", "MIN",
"MAX", "FIRST", "LAST", "TOP",
"BOTTOM", "STDDEV", "PERCENTILE", "APERCENTILE",
"LEASTSQUARES", "HISTOGRAM", "DIFF", "SPREAD",
"TWA", "INTERP", "LAST_ROW", "RATE",
"IRATE", "SUM_RATE", "SUM_IRATE", "AVG_RATE",
"AVG_IRATE", "TBID", "SEMI", "NONE",
"PREV", "LINEAR", "IMPORT", "METRIC",
"TBNAME", "JOIN", "METRICS", "STABLE",
"INSERT", "INTO", "VALUES", "error",
"program", "cmd", "dbPrefix", "ids",
"cpxName", "ifexists", "alter_db_optr", "acct_optr",
"ifnotexists", "db_optr", "pps", "tseries",
"dbs", "streams", "storage", "qtime",
"users", "conns", "state", "keep",
"tagitemlist", "cache", "replica", "quorum",
"days", "minrows", "maxrows", "blocks",
"ctime", "wal", "fsync", "comp",
"prec", "typename", "signed", "create_table_args",
"columnlist", "select", "column", "tagitem",
"delete", "from", "where_opt", "selcollist",
"interval_opt", "fill_opt", "sliding_opt", "groupby_opt",
"orderby_opt", "having_opt", "slimit_opt", "limit_opt",
"union", "sclp", "expr", "as",
"tablelist", "tmvar", "sortlist", "sortitem",
"item", "sortorder", "grouplist", "exprlist",
"expritem",
};
#endif /* defined(YYCOVERAGE) || !defined(NDEBUG) */
#endif /* NDEBUG */
#ifndef NDEBUG
/* For tracing reduce actions, the names of all rules are required.
......@@ -1140,179 +910,134 @@ static const char *const yyRuleName[] = {
/* 128 */ "tagitem ::= MINUS FLOAT",
/* 129 */ "tagitem ::= PLUS INTEGER",
/* 130 */ "tagitem ::= PLUS FLOAT",
/* 131 */ "select ::= SELECT selcollist from where_opt interval_opt fill_opt sliding_opt groupby_opt orderby_opt having_opt slimit_opt limit_opt",
/* 132 */ "union ::= select",
/* 133 */ "union ::= LP union RP",
/* 134 */ "union ::= union UNION ALL select",
/* 135 */ "union ::= union UNION ALL LP select RP",
/* 136 */ "cmd ::= union",
/* 137 */ "select ::= SELECT selcollist",
/* 138 */ "sclp ::= selcollist COMMA",
/* 139 */ "sclp ::=",
/* 140 */ "selcollist ::= sclp expr as",
/* 141 */ "selcollist ::= sclp STAR",
/* 142 */ "as ::= AS ids",
/* 143 */ "as ::= ids",
/* 144 */ "as ::=",
/* 145 */ "from ::= FROM tablelist",
/* 146 */ "tablelist ::= ids cpxName",
/* 147 */ "tablelist ::= ids cpxName ids",
/* 148 */ "tablelist ::= tablelist COMMA ids cpxName",
/* 149 */ "tablelist ::= tablelist COMMA ids cpxName ids",
/* 150 */ "tmvar ::= VARIABLE",
/* 151 */ "interval_opt ::= INTERVAL LP tmvar RP",
/* 152 */ "interval_opt ::= INTERVAL LP tmvar COMMA tmvar RP",
/* 153 */ "interval_opt ::=",
/* 154 */ "fill_opt ::=",
/* 155 */ "fill_opt ::= FILL LP ID COMMA tagitemlist RP",
/* 156 */ "fill_opt ::= FILL LP ID RP",
/* 157 */ "sliding_opt ::= SLIDING LP tmvar RP",
/* 158 */ "sliding_opt ::=",
/* 159 */ "orderby_opt ::=",
/* 160 */ "orderby_opt ::= ORDER BY sortlist",
/* 161 */ "sortlist ::= sortlist COMMA item sortorder",
/* 162 */ "sortlist ::= item sortorder",
/* 163 */ "item ::= ids cpxName",
/* 164 */ "sortorder ::= ASC",
/* 165 */ "sortorder ::= DESC",
/* 166 */ "sortorder ::=",
/* 167 */ "groupby_opt ::=",
/* 168 */ "groupby_opt ::= GROUP BY grouplist",
/* 169 */ "grouplist ::= grouplist COMMA item",
/* 170 */ "grouplist ::= item",
/* 171 */ "having_opt ::=",
/* 172 */ "having_opt ::= HAVING expr",
/* 173 */ "limit_opt ::=",
/* 174 */ "limit_opt ::= LIMIT signed",
/* 175 */ "limit_opt ::= LIMIT signed OFFSET signed",
/* 176 */ "limit_opt ::= LIMIT signed COMMA signed",
/* 177 */ "slimit_opt ::=",
/* 178 */ "slimit_opt ::= SLIMIT signed",
/* 179 */ "slimit_opt ::= SLIMIT signed SOFFSET signed",
/* 180 */ "slimit_opt ::= SLIMIT signed COMMA signed",
/* 181 */ "where_opt ::=",
/* 182 */ "where_opt ::= WHERE expr",
/* 183 */ "expr ::= LP expr RP",
/* 184 */ "expr ::= ID",
/* 185 */ "expr ::= ID DOT ID",
/* 186 */ "expr ::= ID DOT STAR",
/* 187 */ "expr ::= INTEGER",
/* 188 */ "expr ::= MINUS INTEGER",
/* 189 */ "expr ::= PLUS INTEGER",
/* 190 */ "expr ::= FLOAT",
/* 191 */ "expr ::= MINUS FLOAT",
/* 192 */ "expr ::= PLUS FLOAT",
/* 193 */ "expr ::= STRING",
/* 194 */ "expr ::= NOW",
/* 195 */ "expr ::= VARIABLE",
/* 196 */ "expr ::= BOOL",
/* 197 */ "expr ::= ID LP exprlist RP",
/* 198 */ "expr ::= ID LP STAR RP",
/* 199 */ "expr ::= expr IS NULL",
/* 200 */ "expr ::= expr IS NOT NULL",
/* 201 */ "expr ::= expr LT expr",
/* 202 */ "expr ::= expr GT expr",
/* 203 */ "expr ::= expr LE expr",
/* 204 */ "expr ::= expr GE expr",
/* 205 */ "expr ::= expr NE expr",
/* 206 */ "expr ::= expr EQ expr",
/* 207 */ "expr ::= expr AND expr",
/* 208 */ "expr ::= expr OR expr",
/* 209 */ "expr ::= expr PLUS expr",
/* 210 */ "expr ::= expr MINUS expr",
/* 211 */ "expr ::= expr STAR expr",
/* 212 */ "expr ::= expr SLASH expr",
/* 213 */ "expr ::= expr REM expr",
/* 214 */ "expr ::= expr LIKE expr",
/* 215 */ "expr ::= expr IN LP exprlist RP",
/* 216 */ "exprlist ::= exprlist COMMA expritem",
/* 217 */ "exprlist ::= expritem",
/* 218 */ "expritem ::= expr",
/* 219 */ "expritem ::=",
/* 220 */ "cmd ::= RESET QUERY CACHE",
/* 221 */ "cmd ::= ALTER TABLE ids cpxName ADD COLUMN columnlist",
/* 222 */ "cmd ::= ALTER TABLE ids cpxName DROP COLUMN ids",
/* 223 */ "cmd ::= ALTER TABLE ids cpxName ADD TAG columnlist",
/* 224 */ "cmd ::= ALTER TABLE ids cpxName DROP TAG ids",
/* 225 */ "cmd ::= ALTER TABLE ids cpxName CHANGE TAG ids ids",
/* 226 */ "cmd ::= ALTER TABLE ids cpxName SET TAG ids EQ tagitem",
/* 227 */ "cmd ::= KILL CONNECTION INTEGER",
/* 228 */ "cmd ::= KILL STREAM INTEGER COLON INTEGER",
/* 229 */ "cmd ::= KILL QUERY INTEGER COLON INTEGER",
/* 131 */ "delete ::= DELETE from where_opt",
/* 132 */ "cmd ::= delete",
/* 133 */ "select ::= SELECT selcollist from where_opt interval_opt fill_opt sliding_opt groupby_opt orderby_opt having_opt slimit_opt limit_opt",
/* 134 */ "union ::= select",
/* 135 */ "union ::= LP union RP",
/* 136 */ "union ::= union UNION ALL select",
/* 137 */ "union ::= union UNION ALL LP select RP",
/* 138 */ "cmd ::= union",
/* 139 */ "select ::= SELECT selcollist",
/* 140 */ "sclp ::= selcollist COMMA",
/* 141 */ "sclp ::=",
/* 142 */ "selcollist ::= sclp expr as",
/* 143 */ "selcollist ::= sclp STAR",
/* 144 */ "as ::= AS ids",
/* 145 */ "as ::= ids",
/* 146 */ "as ::=",
/* 147 */ "from ::= FROM tablelist",
/* 148 */ "tablelist ::= ids cpxName",
/* 149 */ "tablelist ::= ids cpxName ids",
/* 150 */ "tablelist ::= tablelist COMMA ids cpxName",
/* 151 */ "tablelist ::= tablelist COMMA ids cpxName ids",
/* 152 */ "tmvar ::= VARIABLE",
/* 153 */ "interval_opt ::= INTERVAL LP tmvar RP",
/* 154 */ "interval_opt ::= INTERVAL LP tmvar COMMA tmvar RP",
/* 155 */ "interval_opt ::=",
/* 156 */ "fill_opt ::=",
/* 157 */ "fill_opt ::= FILL LP ID COMMA tagitemlist RP",
/* 158 */ "fill_opt ::= FILL LP ID RP",
/* 159 */ "sliding_opt ::= SLIDING LP tmvar RP",
/* 160 */ "sliding_opt ::=",
/* 161 */ "orderby_opt ::=",
/* 162 */ "orderby_opt ::= ORDER BY sortlist",
/* 163 */ "sortlist ::= sortlist COMMA item sortorder",
/* 164 */ "sortlist ::= item sortorder",
/* 165 */ "item ::= ids cpxName",
/* 166 */ "sortorder ::= ASC",
/* 167 */ "sortorder ::= DESC",
/* 168 */ "sortorder ::=",
/* 169 */ "groupby_opt ::=",
/* 170 */ "groupby_opt ::= GROUP BY grouplist",
/* 171 */ "grouplist ::= grouplist COMMA item",
/* 172 */ "grouplist ::= item",
/* 173 */ "having_opt ::=",
/* 174 */ "having_opt ::= HAVING expr",
/* 175 */ "limit_opt ::=",
/* 176 */ "limit_opt ::= LIMIT signed",
/* 177 */ "limit_opt ::= LIMIT signed OFFSET signed",
/* 178 */ "limit_opt ::= LIMIT signed COMMA signed",
/* 179 */ "slimit_opt ::=",
/* 180 */ "slimit_opt ::= SLIMIT signed",
/* 181 */ "slimit_opt ::= SLIMIT signed SOFFSET signed",
/* 182 */ "slimit_opt ::= SLIMIT signed COMMA signed",
/* 183 */ "where_opt ::=",
/* 184 */ "where_opt ::= WHERE expr",
/* 185 */ "expr ::= LP expr RP",
/* 186 */ "expr ::= ID",
/* 187 */ "expr ::= ID DOT ID",
/* 188 */ "expr ::= ID DOT STAR",
/* 189 */ "expr ::= INTEGER",
/* 190 */ "expr ::= MINUS INTEGER",
/* 191 */ "expr ::= PLUS INTEGER",
/* 192 */ "expr ::= FLOAT",
/* 193 */ "expr ::= MINUS FLOAT",
/* 194 */ "expr ::= PLUS FLOAT",
/* 195 */ "expr ::= STRING",
/* 196 */ "expr ::= NOW",
/* 197 */ "expr ::= VARIABLE",
/* 198 */ "expr ::= BOOL",
/* 199 */ "expr ::= ID LP exprlist RP",
/* 200 */ "expr ::= ID LP STAR RP",
/* 201 */ "expr ::= expr IS NULL",
/* 202 */ "expr ::= expr IS NOT NULL",
/* 203 */ "expr ::= expr LT expr",
/* 204 */ "expr ::= expr GT expr",
/* 205 */ "expr ::= expr LE expr",
/* 206 */ "expr ::= expr GE expr",
/* 207 */ "expr ::= expr NE expr",
/* 208 */ "expr ::= expr EQ expr",
/* 209 */ "expr ::= expr AND expr",
/* 210 */ "expr ::= expr OR expr",
/* 211 */ "expr ::= expr PLUS expr",
/* 212 */ "expr ::= expr MINUS expr",
/* 213 */ "expr ::= expr STAR expr",
/* 214 */ "expr ::= expr SLASH expr",
/* 215 */ "expr ::= expr REM expr",
/* 216 */ "expr ::= expr LIKE expr",
/* 217 */ "expr ::= expr IN LP exprlist RP",
/* 218 */ "exprlist ::= exprlist COMMA expritem",
/* 219 */ "exprlist ::= expritem",
/* 220 */ "expritem ::= expr",
/* 221 */ "expritem ::=",
/* 222 */ "cmd ::= RESET QUERY CACHE",
/* 223 */ "cmd ::= ALTER TABLE ids cpxName ADD COLUMN columnlist",
/* 224 */ "cmd ::= ALTER TABLE ids cpxName DROP COLUMN ids",
/* 225 */ "cmd ::= ALTER TABLE ids cpxName ADD TAG columnlist",
/* 226 */ "cmd ::= ALTER TABLE ids cpxName DROP TAG ids",
/* 227 */ "cmd ::= ALTER TABLE ids cpxName CHANGE TAG ids ids",
/* 228 */ "cmd ::= ALTER TABLE ids cpxName SET TAG ids EQ tagitem",
/* 229 */ "cmd ::= KILL CONNECTION INTEGER",
/* 230 */ "cmd ::= KILL STREAM INTEGER COLON INTEGER",
/* 231 */ "cmd ::= KILL QUERY INTEGER COLON INTEGER",
};
#endif /* NDEBUG */
#if YYSTACKDEPTH<=0
/*
** Try to increase the size of the parser stack. Return the number
** of errors. Return 0 on success.
** Try to increase the size of the parser stack.
*/
static int yyGrowStack(yyParser *p){
static void yyGrowStack(yyParser *p){
int newSize;
int idx;
yyStackEntry *pNew;
newSize = p->yystksz*2 + 100;
idx = p->yytos ? (int)(p->yytos - p->yystack) : 0;
if( p->yystack==&p->yystk0 ){
pNew = malloc(newSize*sizeof(pNew[0]));
if( pNew ) pNew[0] = p->yystk0;
}else{
pNew = realloc(p->yystack, newSize*sizeof(pNew[0]));
}
if( pNew ){
p->yystack = pNew;
p->yytos = &p->yystack[idx];
p->yystksz = newSize;
#ifndef NDEBUG
if( yyTraceFILE ){
fprintf(yyTraceFILE,"%sStack grows from %d to %d entries.\n",
yyTracePrompt, p->yystksz, newSize);
fprintf(yyTraceFILE,"%sStack grows to %d entries!\n",
yyTracePrompt, p->yystksz);
}
#endif
p->yystksz = newSize;
}
return pNew==0;
}
#endif
/* Datatype of the argument to the memory allocated passed as the
** second argument to ParseAlloc() below. This can be changed by
** putting an appropriate #define in the %include section of the input
** grammar.
*/
#ifndef YYMALLOCARGTYPE
# define YYMALLOCARGTYPE size_t
#endif
/* Initialize a new parser that has already been allocated.
*/
void ParseInit(void *yypParser){
yyParser *pParser = (yyParser*)yypParser;
#ifdef YYTRACKMAXSTACKDEPTH
pParser->yyhwm = 0;
#endif
#if YYSTACKDEPTH<=0
pParser->yytos = NULL;
pParser->yystack = NULL;
pParser->yystksz = 0;
if( yyGrowStack(pParser) ){
pParser->yystack = &pParser->yystk0;
pParser->yystksz = 1;
}
#endif
#ifndef YYNOERRORRECOVERY
pParser->yyerrcnt = -1;
#endif
pParser->yytos = pParser->yystack;
pParser->yystack[0].stateno = 0;
pParser->yystack[0].major = 0;
#if YYSTACKDEPTH>0
pParser->yystackEnd = &pParser->yystack[YYSTACKDEPTH-1];
#endif
}
#ifndef Parse_ENGINEALWAYSONSTACK
/*
** This function allocates a new parser.
** The only argument is a pointer to a function which works like
......@@ -1325,21 +1050,27 @@ void ParseInit(void *yypParser){
** A pointer to a parser. This pointer is used in subsequent calls
** to Parse and ParseFree.
*/
void *ParseAlloc(void *(*mallocProc)(YYMALLOCARGTYPE)){
void *ParseAlloc(void *(*mallocProc)(size_t)){
yyParser *pParser;
pParser = (yyParser*)(*mallocProc)( (YYMALLOCARGTYPE)sizeof(yyParser) );
if( pParser ) ParseInit(pParser);
pParser = (yyParser*)(*mallocProc)( (size_t)sizeof(yyParser) );
if( pParser ){
pParser->yyidx = -1;
#ifdef YYTRACKMAXSTACKDEPTH
pParser->yyidxMax = 0;
#endif
#if YYSTACKDEPTH<=0
pParser->yystack = NULL;
pParser->yystksz = 0;
yyGrowStack(pParser);
#endif
}
return pParser;
}
#endif /* Parse_ENGINEALWAYSONSTACK */
/* The following function deletes the "minor type" or semantic value
** associated with a symbol. The symbol can be either a terminal
** or nonterminal. "yymajor" is the symbol code, and "yypminor" is
** a pointer to the value to be deleted. The code used to do the
** deletions is derived from the %destructor and/or %token_destructor
** directives of the input grammar.
/* The following function deletes the value associated with a
** symbol. The symbol can be either a terminal or nonterminal.
** "yymajor" is the symbol code, and "yypminor" is a pointer to
** the value.
*/
static void yy_destructor(
yyParser *yypParser, /* The parser */
......@@ -1355,57 +1086,60 @@ static void yy_destructor(
** being destroyed before it is finished parsing.
**
** Note: during a reduce, the only symbols destroyed are those
** which appear on the RHS of the rule, but which are *not* used
** which appear on the RHS of the rule, but which are not used
** inside the C code.
*/
/********* Begin destructor definitions ***************************************/
case 226: /* keep */
case 227: /* tagitemlist */
case 251: /* fill_opt */
case 253: /* groupby_opt */
case 254: /* orderby_opt */
case 264: /* sortlist */
case 268: /* grouplist */
case 227: /* keep */
case 228: /* tagitemlist */
case 253: /* fill_opt */
case 255: /* groupby_opt */
case 256: /* orderby_opt */
case 266: /* sortlist */
case 270: /* grouplist */
{
tVariantListDestroy((yypminor->yy498));
}
break;
case 244: /* columnlist */
{
tVariantListDestroy((yypminor->yy494));
tFieldListDestroy((yypminor->yy523));
}
break;
case 243: /* columnlist */
case 245: /* select */
{
tFieldListDestroy((yypminor->yy449));
doDestroyQuerySql((yypminor->yy414));
}
break;
case 244: /* select */
case 248: /* delete */
{
doDestroyQuerySql((yypminor->yy150));
doDestroyDelSql((yypminor->yy175));
}
break;
case 247: /* selcollist */
case 259: /* sclp */
case 269: /* exprlist */
case 250: /* where_opt */
case 257: /* having_opt */
case 262: /* expr */
case 272: /* expritem */
{
tSQLExprListDestroy((yypminor->yy224));
tSQLExprDestroy((yypminor->yy64));
}
break;
case 249: /* where_opt */
case 255: /* having_opt */
case 260: /* expr */
case 270: /* expritem */
case 251: /* selcollist */
case 261: /* sclp */
case 271: /* exprlist */
{
tSQLExprDestroy((yypminor->yy66));
tSQLExprListDestroy((yypminor->yy290));
}
break;
case 258: /* union */
case 260: /* union */
{
destroyAllSelectClause((yypminor->yy25));
destroyAllSelectClause((yypminor->yy231));
}
break;
case 265: /* sortitem */
case 267: /* sortitem */
{
tVariantDestroy(&(yypminor->yy312));
tVariantDestroy(&(yypminor->yy134));
}
break;
/********* End destructor definitions *****************************************/
default: break; /* If no destructor action specified: do nothing */
}
}
......@@ -1415,53 +1149,51 @@ tVariantDestroy(&(yypminor->yy312));
**
** If there is a destructor routine associated with the token which
** is popped from the stack, then call it.
**
** Return the major token number for the symbol popped.
*/
static void yy_pop_parser_stack(yyParser *pParser){
yyStackEntry *yytos;
assert( pParser->yytos!=0 );
assert( pParser->yytos > pParser->yystack );
yytos = pParser->yytos--;
static int yy_pop_parser_stack(yyParser *pParser){
YYCODETYPE yymajor;
yyStackEntry *yytos = &pParser->yystack[pParser->yyidx];
if( pParser->yyidx<0 ) return 0;
#ifndef NDEBUG
if( yyTraceFILE ){
if( yyTraceFILE && pParser->yyidx>=0 ){
fprintf(yyTraceFILE,"%sPopping %s\n",
yyTracePrompt,
yyTokenName[yytos->major]);
}
#endif
yy_destructor(pParser, yytos->major, &yytos->minor);
yymajor = yytos->major;
yy_destructor(pParser, yymajor, &yytos->minor);
pParser->yyidx--;
return yymajor;
}
/*
** Clear all secondary memory allocations from the parser
*/
void ParseFinalize(void *p){
yyParser *pParser = (yyParser*)p;
while( pParser->yytos>pParser->yystack ) yy_pop_parser_stack(pParser);
#if YYSTACKDEPTH<=0
if( pParser->yystack!=&pParser->yystk0 ) free(pParser->yystack);
#endif
}
#ifndef Parse_ENGINEALWAYSONSTACK
/*
** Deallocate and destroy a parser. Destructors are called for
** Deallocate and destroy a parser. Destructors are all called for
** all stack elements before shutting the parser down.
**
** If the YYPARSEFREENEVERNULL macro exists (for example because it
** is defined in a %include section of the input grammar) then it is
** assumed that the input pointer is never NULL.
** Inputs:
** <ul>
** <li> A pointer to the parser. This should be a pointer
** obtained from ParseAlloc.
** <li> A pointer to a function used to reclaim memory obtained
** from malloc.
** </ul>
*/
void ParseFree(
void *p, /* The parser to be deleted */
void (*freeProc)(void*) /* Function used to reclaim memory */
){
#ifndef YYPARSEFREENEVERNULL
if( p==0 ) return;
yyParser *pParser = (yyParser*)p;
if( pParser==0 ) return;
while( pParser->yyidx>=0 ) yy_pop_parser_stack(pParser);
#if YYSTACKDEPTH<=0
free(pParser->yystack);
#endif
ParseFinalize(p);
(*freeProc)(p);
(*freeProc)((void*)pParser);
}
#endif /* Parse_ENGINEALWAYSONSTACK */
/*
** Return the peak depth of the stack for a parser.
......@@ -1469,70 +1201,33 @@ void ParseFree(
#ifdef YYTRACKMAXSTACKDEPTH
int ParseStackPeak(void *p){
yyParser *pParser = (yyParser*)p;
return pParser->yyhwm;
}
#endif
/* This array of booleans keeps track of the parser statement
** coverage. The element yycoverage[X][Y] is set when the parser
** is in state X and has a lookahead token Y. In a well-tested
** systems, every element of this matrix should end up being set.
*/
#if defined(YYCOVERAGE)
static unsigned char yycoverage[YYNSTATE][YYNTOKEN];
#endif
/*
** Write into out a description of every state/lookahead combination that
**
** (1) has not been used by the parser, and
** (2) is not a syntax error.
**
** Return the number of missed state/lookahead combinations.
*/
#if defined(YYCOVERAGE)
int ParseCoverage(FILE *out){
int stateno, iLookAhead, i;
int nMissed = 0;
for(stateno=0; stateno<YYNSTATE; stateno++){
i = yy_shift_ofst[stateno];
for(iLookAhead=0; iLookAhead<YYNTOKEN; iLookAhead++){
if( yy_lookahead[i+iLookAhead]!=iLookAhead ) continue;
if( yycoverage[stateno][iLookAhead]==0 ) nMissed++;
if( out ){
fprintf(out,"State %d lookahead %s %s\n", stateno,
yyTokenName[iLookAhead],
yycoverage[stateno][iLookAhead] ? "ok" : "missed");
}
}
}
return nMissed;
return pParser->yyidxMax;
}
#endif
/*
** Find the appropriate action for a parser given the terminal
** look-ahead token iLookAhead.
**
** If the look-ahead token is YYNOCODE, then check to see if the action is
** independent of the look-ahead. If it is, return the action, otherwise
** return YY_NO_ACTION.
*/
static unsigned int yy_find_shift_action(
static int yy_find_shift_action(
yyParser *pParser, /* The parser */
YYCODETYPE iLookAhead /* The look-ahead token */
){
int i;
int stateno = pParser->yytos->stateno;
int stateno = pParser->yystack[pParser->yyidx].stateno;
if( stateno>YY_MAX_SHIFT ) return stateno;
assert( stateno <= YY_SHIFT_COUNT );
#if defined(YYCOVERAGE)
yycoverage[stateno][iLookAhead] = 1;
#endif
do{
i = yy_shift_ofst[stateno];
assert( i>=0 && i+YYNTOKEN<=sizeof(yy_lookahead)/sizeof(yy_lookahead[0]) );
if( stateno>YY_SHIFT_COUNT
|| (i = yy_shift_ofst[stateno])==YY_SHIFT_USE_DFLT ){
return yy_default[stateno];
}
assert( iLookAhead!=YYNOCODE );
assert( iLookAhead < YYNTOKEN );
i += iLookAhead;
if( yy_lookahead[i]!=iLookAhead ){
if( i<0 || i>=YY_ACTTAB_COUNT || yy_lookahead[i]!=iLookAhead ){
if( iLookAhead>0 ){
#ifdef YYFALLBACK
YYCODETYPE iFallback; /* Fallback token */
if( iLookAhead<sizeof(yyFallback)/sizeof(yyFallback[0])
......@@ -1543,9 +1238,7 @@ static unsigned int yy_find_shift_action(
yyTracePrompt, yyTokenName[iLookAhead], yyTokenName[iFallback]);
}
#endif
assert( yyFallback[iFallback]==0 ); /* Fallback loop must terminate */
iLookAhead = iFallback;
continue;
return yy_find_shift_action(pParser, iFallback);
}
#endif
#ifdef YYWILDCARD
......@@ -1558,29 +1251,32 @@ static unsigned int yy_find_shift_action(
#if YY_SHIFT_MAX+YYWILDCARD>=YY_ACTTAB_COUNT
j<YY_ACTTAB_COUNT &&
#endif
yy_lookahead[j]==YYWILDCARD && iLookAhead>0
yy_lookahead[j]==YYWILDCARD
){
#ifndef NDEBUG
if( yyTraceFILE ){
fprintf(yyTraceFILE, "%sWILDCARD %s => %s\n",
yyTracePrompt, yyTokenName[iLookAhead],
yyTokenName[YYWILDCARD]);
yyTracePrompt, yyTokenName[iLookAhead], yyTokenName[YYWILDCARD]);
}
#endif /* NDEBUG */
return yy_action[j];
}
}
#endif /* YYWILDCARD */
}
return yy_default[stateno];
}else{
return yy_action[i];
}
}while(1);
}
/*
** Find the appropriate action for a parser given the non-terminal
** look-ahead token iLookAhead.
**
** If the look-ahead token is YYNOCODE, then check to see if the action is
** independent of the look-ahead. If it is, return the action, otherwise
** return YY_NO_ACTION.
*/
static int yy_find_reduce_action(
int stateno, /* Current state number */
......@@ -1595,6 +1291,7 @@ static int yy_find_reduce_action(
assert( stateno<=YY_REDUCE_COUNT );
#endif
i = yy_reduce_ofst[stateno];
assert( i!=YY_REDUCE_USE_DFLT );
assert( iLookAhead!=YYNOCODE );
i += iLookAhead;
#ifdef YYERRORSYMBOL
......@@ -1611,42 +1308,20 @@ static int yy_find_reduce_action(
/*
** The following routine is called if the stack overflows.
*/
static void yyStackOverflow(yyParser *yypParser){
static void yyStackOverflow(yyParser *yypParser, YYMINORTYPE *yypMinor){
ParseARG_FETCH;
yypParser->yyidx--;
#ifndef NDEBUG
if( yyTraceFILE ){
fprintf(yyTraceFILE,"%sStack Overflow!\n",yyTracePrompt);
}
#endif
while( yypParser->yytos>yypParser->yystack ) yy_pop_parser_stack(yypParser);
while( yypParser->yyidx>=0 ) yy_pop_parser_stack(yypParser);
/* Here code is inserted which will execute if the parser
** stack every overflows */
/******** Begin %stack_overflow code ******************************************/
/******** End %stack_overflow code ********************************************/
ParseARG_STORE; /* Suppress warning about unused %extra_argument var */
}
/*
** Print tracing information for a SHIFT action
*/
#ifndef NDEBUG
static void yyTraceShift(yyParser *yypParser, int yyNewState, const char *zTag){
if( yyTraceFILE ){
if( yyNewState<YYNSTATE ){
fprintf(yyTraceFILE,"%s%s '%s', go to state %d\n",
yyTracePrompt, zTag, yyTokenName[yypParser->yytos->major],
yyNewState);
}else{
fprintf(yyTraceFILE,"%s%s '%s', pending reduce %d\n",
yyTracePrompt, zTag, yyTokenName[yypParser->yytos->major],
yyNewState - YY_MIN_REDUCE);
}
}
}
#else
# define yyTraceShift(X,Y,Z)
#endif
/*
** Perform a shift action.
*/
......@@ -1654,39 +1329,43 @@ static void yy_shift(
yyParser *yypParser, /* The parser to be shifted */
int yyNewState, /* The new state to shift in */
int yyMajor, /* The major token to shift in */
ParseTOKENTYPE yyMinor /* The minor token to shift in */
YYMINORTYPE *yypMinor /* Pointer to the minor token to shift in */
){
yyStackEntry *yytos;
yypParser->yytos++;
yypParser->yyidx++;
#ifdef YYTRACKMAXSTACKDEPTH
if( (int)(yypParser->yytos - yypParser->yystack)>yypParser->yyhwm ){
yypParser->yyhwm++;
assert( yypParser->yyhwm == (int)(yypParser->yytos - yypParser->yystack) );
if( yypParser->yyidx>yypParser->yyidxMax ){
yypParser->yyidxMax = yypParser->yyidx;
}
#endif
#if YYSTACKDEPTH>0
if( yypParser->yytos>yypParser->yystackEnd ){
yypParser->yytos--;
yyStackOverflow(yypParser);
if( yypParser->yyidx>=YYSTACKDEPTH ){
yyStackOverflow(yypParser, yypMinor);
return;
}
#else
if( yypParser->yytos>=&yypParser->yystack[yypParser->yystksz] ){
if( yyGrowStack(yypParser) ){
yypParser->yytos--;
yyStackOverflow(yypParser);
if( yypParser->yyidx>=yypParser->yystksz ){
yyGrowStack(yypParser);
if( yypParser->yyidx>=yypParser->yystksz ){
yyStackOverflow(yypParser, yypMinor);
return;
}
}
#endif
if( yyNewState > YY_MAX_SHIFT ){
yyNewState += YY_MIN_REDUCE - YY_MIN_SHIFTREDUCE;
}
yytos = yypParser->yytos;
yytos = &yypParser->yystack[yypParser->yyidx];
yytos->stateno = (YYACTIONTYPE)yyNewState;
yytos->major = (YYCODETYPE)yyMajor;
yytos->minor.yy0 = yyMinor;
yyTraceShift(yypParser, yyNewState, "Shift");
yytos->minor = *yypMinor;
#ifndef NDEBUG
if( yyTraceFILE && yypParser->yyidx>0 ){
int i;
fprintf(yyTraceFILE,"%sShift %d\n",yyTracePrompt,yyNewState);
fprintf(yyTraceFILE,"%sStack:",yyTracePrompt);
for(i=1; i<=yypParser->yyidx; i++)
fprintf(yyTraceFILE," %s",yyTokenName[yypParser->yystack[i].major]);
fprintf(yyTraceFILE,"\n");
}
#endif
}
/* The following table contains information about every rule that
......@@ -1694,238 +1373,240 @@ static void yy_shift(
*/
static const struct {
YYCODETYPE lhs; /* Symbol on the left-hand side of the rule */
signed char nrhs; /* Negative of the number of RHS symbols in the rule */
unsigned char nrhs; /* Number of right-hand side symbols in the rule */
} yyRuleInfo[] = {
{ 207, -1 }, /* (0) program ::= cmd */
{ 208, -2 }, /* (1) cmd ::= SHOW DATABASES */
{ 208, -2 }, /* (2) cmd ::= SHOW MNODES */
{ 208, -2 }, /* (3) cmd ::= SHOW DNODES */
{ 208, -2 }, /* (4) cmd ::= SHOW ACCOUNTS */
{ 208, -2 }, /* (5) cmd ::= SHOW USERS */
{ 208, -2 }, /* (6) cmd ::= SHOW MODULES */
{ 208, -2 }, /* (7) cmd ::= SHOW QUERIES */
{ 208, -2 }, /* (8) cmd ::= SHOW CONNECTIONS */
{ 208, -2 }, /* (9) cmd ::= SHOW STREAMS */
{ 208, -2 }, /* (10) cmd ::= SHOW VARIABLES */
{ 208, -2 }, /* (11) cmd ::= SHOW SCORES */
{ 208, -2 }, /* (12) cmd ::= SHOW GRANTS */
{ 208, -2 }, /* (13) cmd ::= SHOW VNODES */
{ 208, -3 }, /* (14) cmd ::= SHOW VNODES IPTOKEN */
{ 209, 0 }, /* (15) dbPrefix ::= */
{ 209, -2 }, /* (16) dbPrefix ::= ids DOT */
{ 211, 0 }, /* (17) cpxName ::= */
{ 211, -2 }, /* (18) cpxName ::= DOT ids */
{ 208, -5 }, /* (19) cmd ::= SHOW CREATE TABLE ids cpxName */
{ 208, -4 }, /* (20) cmd ::= SHOW CREATE DATABASE ids */
{ 208, -3 }, /* (21) cmd ::= SHOW dbPrefix TABLES */
{ 208, -5 }, /* (22) cmd ::= SHOW dbPrefix TABLES LIKE ids */
{ 208, -3 }, /* (23) cmd ::= SHOW dbPrefix STABLES */
{ 208, -5 }, /* (24) cmd ::= SHOW dbPrefix STABLES LIKE ids */
{ 208, -3 }, /* (25) cmd ::= SHOW dbPrefix VGROUPS */
{ 208, -4 }, /* (26) cmd ::= SHOW dbPrefix VGROUPS ids */
{ 208, -5 }, /* (27) cmd ::= DROP TABLE ifexists ids cpxName */
{ 208, -4 }, /* (28) cmd ::= DROP DATABASE ifexists ids */
{ 208, -3 }, /* (29) cmd ::= DROP DNODE ids */
{ 208, -3 }, /* (30) cmd ::= DROP USER ids */
{ 208, -3 }, /* (31) cmd ::= DROP ACCOUNT ids */
{ 208, -2 }, /* (32) cmd ::= USE ids */
{ 208, -3 }, /* (33) cmd ::= DESCRIBE ids cpxName */
{ 208, -5 }, /* (34) cmd ::= ALTER USER ids PASS ids */
{ 208, -5 }, /* (35) cmd ::= ALTER USER ids PRIVILEGE ids */
{ 208, -4 }, /* (36) cmd ::= ALTER DNODE ids ids */
{ 208, -5 }, /* (37) cmd ::= ALTER DNODE ids ids ids */
{ 208, -3 }, /* (38) cmd ::= ALTER LOCAL ids */
{ 208, -4 }, /* (39) cmd ::= ALTER LOCAL ids ids */
{ 208, -4 }, /* (40) cmd ::= ALTER DATABASE ids alter_db_optr */
{ 208, -4 }, /* (41) cmd ::= ALTER ACCOUNT ids acct_optr */
{ 208, -6 }, /* (42) cmd ::= ALTER ACCOUNT ids PASS ids acct_optr */
{ 210, -1 }, /* (43) ids ::= ID */
{ 210, -1 }, /* (44) ids ::= STRING */
{ 212, -2 }, /* (45) ifexists ::= IF EXISTS */
{ 212, 0 }, /* (46) ifexists ::= */
{ 215, -3 }, /* (47) ifnotexists ::= IF NOT EXISTS */
{ 215, 0 }, /* (48) ifnotexists ::= */
{ 208, -3 }, /* (49) cmd ::= CREATE DNODE ids */
{ 208, -6 }, /* (50) cmd ::= CREATE ACCOUNT ids PASS ids acct_optr */
{ 208, -5 }, /* (51) cmd ::= CREATE DATABASE ifnotexists ids db_optr */
{ 208, -5 }, /* (52) cmd ::= CREATE USER ids PASS ids */
{ 217, 0 }, /* (53) pps ::= */
{ 217, -2 }, /* (54) pps ::= PPS INTEGER */
{ 218, 0 }, /* (55) tseries ::= */
{ 218, -2 }, /* (56) tseries ::= TSERIES INTEGER */
{ 219, 0 }, /* (57) dbs ::= */
{ 219, -2 }, /* (58) dbs ::= DBS INTEGER */
{ 220, 0 }, /* (59) streams ::= */
{ 220, -2 }, /* (60) streams ::= STREAMS INTEGER */
{ 221, 0 }, /* (61) storage ::= */
{ 221, -2 }, /* (62) storage ::= STORAGE INTEGER */
{ 222, 0 }, /* (63) qtime ::= */
{ 222, -2 }, /* (64) qtime ::= QTIME INTEGER */
{ 223, 0 }, /* (65) users ::= */
{ 223, -2 }, /* (66) users ::= USERS INTEGER */
{ 224, 0 }, /* (67) conns ::= */
{ 224, -2 }, /* (68) conns ::= CONNS INTEGER */
{ 225, 0 }, /* (69) state ::= */
{ 225, -2 }, /* (70) state ::= STATE ids */
{ 214, -9 }, /* (71) acct_optr ::= pps tseries storage streams qtime dbs users conns state */
{ 226, -2 }, /* (72) keep ::= KEEP tagitemlist */
{ 228, -2 }, /* (73) cache ::= CACHE INTEGER */
{ 229, -2 }, /* (74) replica ::= REPLICA INTEGER */
{ 230, -2 }, /* (75) quorum ::= QUORUM INTEGER */
{ 231, -2 }, /* (76) days ::= DAYS INTEGER */
{ 232, -2 }, /* (77) minrows ::= MINROWS INTEGER */
{ 233, -2 }, /* (78) maxrows ::= MAXROWS INTEGER */
{ 234, -2 }, /* (79) blocks ::= BLOCKS INTEGER */
{ 235, -2 }, /* (80) ctime ::= CTIME INTEGER */
{ 236, -2 }, /* (81) wal ::= WAL INTEGER */
{ 237, -2 }, /* (82) fsync ::= FSYNC INTEGER */
{ 238, -2 }, /* (83) comp ::= COMP INTEGER */
{ 239, -2 }, /* (84) prec ::= PRECISION STRING */
{ 216, 0 }, /* (85) db_optr ::= */
{ 216, -2 }, /* (86) db_optr ::= db_optr cache */
{ 216, -2 }, /* (87) db_optr ::= db_optr replica */
{ 216, -2 }, /* (88) db_optr ::= db_optr quorum */
{ 216, -2 }, /* (89) db_optr ::= db_optr days */
{ 216, -2 }, /* (90) db_optr ::= db_optr minrows */
{ 216, -2 }, /* (91) db_optr ::= db_optr maxrows */
{ 216, -2 }, /* (92) db_optr ::= db_optr blocks */
{ 216, -2 }, /* (93) db_optr ::= db_optr ctime */
{ 216, -2 }, /* (94) db_optr ::= db_optr wal */
{ 216, -2 }, /* (95) db_optr ::= db_optr fsync */
{ 216, -2 }, /* (96) db_optr ::= db_optr comp */
{ 216, -2 }, /* (97) db_optr ::= db_optr prec */
{ 216, -2 }, /* (98) db_optr ::= db_optr keep */
{ 213, 0 }, /* (99) alter_db_optr ::= */
{ 213, -2 }, /* (100) alter_db_optr ::= alter_db_optr replica */
{ 213, -2 }, /* (101) alter_db_optr ::= alter_db_optr quorum */
{ 213, -2 }, /* (102) alter_db_optr ::= alter_db_optr keep */
{ 213, -2 }, /* (103) alter_db_optr ::= alter_db_optr blocks */
{ 213, -2 }, /* (104) alter_db_optr ::= alter_db_optr comp */
{ 213, -2 }, /* (105) alter_db_optr ::= alter_db_optr wal */
{ 213, -2 }, /* (106) alter_db_optr ::= alter_db_optr fsync */
{ 240, -1 }, /* (107) typename ::= ids */
{ 240, -4 }, /* (108) typename ::= ids LP signed RP */
{ 241, -1 }, /* (109) signed ::= INTEGER */
{ 241, -2 }, /* (110) signed ::= PLUS INTEGER */
{ 241, -2 }, /* (111) signed ::= MINUS INTEGER */
{ 208, -6 }, /* (112) cmd ::= CREATE TABLE ifnotexists ids cpxName create_table_args */
{ 242, -3 }, /* (113) create_table_args ::= LP columnlist RP */
{ 242, -7 }, /* (114) create_table_args ::= LP columnlist RP TAGS LP columnlist RP */
{ 242, -7 }, /* (115) create_table_args ::= USING ids cpxName TAGS LP tagitemlist RP */
{ 242, -2 }, /* (116) create_table_args ::= AS select */
{ 243, -3 }, /* (117) columnlist ::= columnlist COMMA column */
{ 243, -1 }, /* (118) columnlist ::= column */
{ 245, -2 }, /* (119) column ::= ids typename */
{ 227, -3 }, /* (120) tagitemlist ::= tagitemlist COMMA tagitem */
{ 227, -1 }, /* (121) tagitemlist ::= tagitem */
{ 246, -1 }, /* (122) tagitem ::= INTEGER */
{ 246, -1 }, /* (123) tagitem ::= FLOAT */
{ 246, -1 }, /* (124) tagitem ::= STRING */
{ 246, -1 }, /* (125) tagitem ::= BOOL */
{ 246, -1 }, /* (126) tagitem ::= NULL */
{ 246, -2 }, /* (127) tagitem ::= MINUS INTEGER */
{ 246, -2 }, /* (128) tagitem ::= MINUS FLOAT */
{ 246, -2 }, /* (129) tagitem ::= PLUS INTEGER */
{ 246, -2 }, /* (130) tagitem ::= PLUS FLOAT */
{ 244, -12 }, /* (131) select ::= SELECT selcollist from where_opt interval_opt fill_opt sliding_opt groupby_opt orderby_opt having_opt slimit_opt limit_opt */
{ 258, -1 }, /* (132) union ::= select */
{ 258, -3 }, /* (133) union ::= LP union RP */
{ 258, -4 }, /* (134) union ::= union UNION ALL select */
{ 258, -6 }, /* (135) union ::= union UNION ALL LP select RP */
{ 208, -1 }, /* (136) cmd ::= union */
{ 244, -2 }, /* (137) select ::= SELECT selcollist */
{ 259, -2 }, /* (138) sclp ::= selcollist COMMA */
{ 259, 0 }, /* (139) sclp ::= */
{ 247, -3 }, /* (140) selcollist ::= sclp expr as */
{ 247, -2 }, /* (141) selcollist ::= sclp STAR */
{ 261, -2 }, /* (142) as ::= AS ids */
{ 261, -1 }, /* (143) as ::= ids */
{ 261, 0 }, /* (144) as ::= */
{ 248, -2 }, /* (145) from ::= FROM tablelist */
{ 262, -2 }, /* (146) tablelist ::= ids cpxName */
{ 262, -3 }, /* (147) tablelist ::= ids cpxName ids */
{ 262, -4 }, /* (148) tablelist ::= tablelist COMMA ids cpxName */
{ 262, -5 }, /* (149) tablelist ::= tablelist COMMA ids cpxName ids */
{ 263, -1 }, /* (150) tmvar ::= VARIABLE */
{ 250, -4 }, /* (151) interval_opt ::= INTERVAL LP tmvar RP */
{ 250, -6 }, /* (152) interval_opt ::= INTERVAL LP tmvar COMMA tmvar RP */
{ 250, 0 }, /* (153) interval_opt ::= */
{ 251, 0 }, /* (154) fill_opt ::= */
{ 251, -6 }, /* (155) fill_opt ::= FILL LP ID COMMA tagitemlist RP */
{ 251, -4 }, /* (156) fill_opt ::= FILL LP ID RP */
{ 252, -4 }, /* (157) sliding_opt ::= SLIDING LP tmvar RP */
{ 252, 0 }, /* (158) sliding_opt ::= */
{ 254, 0 }, /* (159) orderby_opt ::= */
{ 254, -3 }, /* (160) orderby_opt ::= ORDER BY sortlist */
{ 264, -4 }, /* (161) sortlist ::= sortlist COMMA item sortorder */
{ 264, -2 }, /* (162) sortlist ::= item sortorder */
{ 266, -2 }, /* (163) item ::= ids cpxName */
{ 267, -1 }, /* (164) sortorder ::= ASC */
{ 267, -1 }, /* (165) sortorder ::= DESC */
{ 267, 0 }, /* (166) sortorder ::= */
{ 253, 0 }, /* (167) groupby_opt ::= */
{ 253, -3 }, /* (168) groupby_opt ::= GROUP BY grouplist */
{ 268, -3 }, /* (169) grouplist ::= grouplist COMMA item */
{ 268, -1 }, /* (170) grouplist ::= item */
{ 255, 0 }, /* (171) having_opt ::= */
{ 255, -2 }, /* (172) having_opt ::= HAVING expr */
{ 257, 0 }, /* (173) limit_opt ::= */
{ 257, -2 }, /* (174) limit_opt ::= LIMIT signed */
{ 257, -4 }, /* (175) limit_opt ::= LIMIT signed OFFSET signed */
{ 257, -4 }, /* (176) limit_opt ::= LIMIT signed COMMA signed */
{ 256, 0 }, /* (177) slimit_opt ::= */
{ 256, -2 }, /* (178) slimit_opt ::= SLIMIT signed */
{ 256, -4 }, /* (179) slimit_opt ::= SLIMIT signed SOFFSET signed */
{ 256, -4 }, /* (180) slimit_opt ::= SLIMIT signed COMMA signed */
{ 249, 0 }, /* (181) where_opt ::= */
{ 249, -2 }, /* (182) where_opt ::= WHERE expr */
{ 260, -3 }, /* (183) expr ::= LP expr RP */
{ 260, -1 }, /* (184) expr ::= ID */
{ 260, -3 }, /* (185) expr ::= ID DOT ID */
{ 260, -3 }, /* (186) expr ::= ID DOT STAR */
{ 260, -1 }, /* (187) expr ::= INTEGER */
{ 260, -2 }, /* (188) expr ::= MINUS INTEGER */
{ 260, -2 }, /* (189) expr ::= PLUS INTEGER */
{ 260, -1 }, /* (190) expr ::= FLOAT */
{ 260, -2 }, /* (191) expr ::= MINUS FLOAT */
{ 260, -2 }, /* (192) expr ::= PLUS FLOAT */
{ 260, -1 }, /* (193) expr ::= STRING */
{ 260, -1 }, /* (194) expr ::= NOW */
{ 260, -1 }, /* (195) expr ::= VARIABLE */
{ 260, -1 }, /* (196) expr ::= BOOL */
{ 260, -4 }, /* (197) expr ::= ID LP exprlist RP */
{ 260, -4 }, /* (198) expr ::= ID LP STAR RP */
{ 260, -3 }, /* (199) expr ::= expr IS NULL */
{ 260, -4 }, /* (200) expr ::= expr IS NOT NULL */
{ 260, -3 }, /* (201) expr ::= expr LT expr */
{ 260, -3 }, /* (202) expr ::= expr GT expr */
{ 260, -3 }, /* (203) expr ::= expr LE expr */
{ 260, -3 }, /* (204) expr ::= expr GE expr */
{ 260, -3 }, /* (205) expr ::= expr NE expr */
{ 260, -3 }, /* (206) expr ::= expr EQ expr */
{ 260, -3 }, /* (207) expr ::= expr AND expr */
{ 260, -3 }, /* (208) expr ::= expr OR expr */
{ 260, -3 }, /* (209) expr ::= expr PLUS expr */
{ 260, -3 }, /* (210) expr ::= expr MINUS expr */
{ 260, -3 }, /* (211) expr ::= expr STAR expr */
{ 260, -3 }, /* (212) expr ::= expr SLASH expr */
{ 260, -3 }, /* (213) expr ::= expr REM expr */
{ 260, -3 }, /* (214) expr ::= expr LIKE expr */
{ 260, -5 }, /* (215) expr ::= expr IN LP exprlist RP */
{ 269, -3 }, /* (216) exprlist ::= exprlist COMMA expritem */
{ 269, -1 }, /* (217) exprlist ::= expritem */
{ 270, -1 }, /* (218) expritem ::= expr */
{ 270, 0 }, /* (219) expritem ::= */
{ 208, -3 }, /* (220) cmd ::= RESET QUERY CACHE */
{ 208, -7 }, /* (221) cmd ::= ALTER TABLE ids cpxName ADD COLUMN columnlist */
{ 208, -7 }, /* (222) cmd ::= ALTER TABLE ids cpxName DROP COLUMN ids */
{ 208, -7 }, /* (223) cmd ::= ALTER TABLE ids cpxName ADD TAG columnlist */
{ 208, -7 }, /* (224) cmd ::= ALTER TABLE ids cpxName DROP TAG ids */
{ 208, -8 }, /* (225) cmd ::= ALTER TABLE ids cpxName CHANGE TAG ids ids */
{ 208, -9 }, /* (226) cmd ::= ALTER TABLE ids cpxName SET TAG ids EQ tagitem */
{ 208, -3 }, /* (227) cmd ::= KILL CONNECTION INTEGER */
{ 208, -5 }, /* (228) cmd ::= KILL STREAM INTEGER COLON INTEGER */
{ 208, -5 }, /* (229) cmd ::= KILL QUERY INTEGER COLON INTEGER */
{ 208, 1 },
{ 209, 2 },
{ 209, 2 },
{ 209, 2 },
{ 209, 2 },
{ 209, 2 },
{ 209, 2 },
{ 209, 2 },
{ 209, 2 },
{ 209, 2 },
{ 209, 2 },
{ 209, 2 },
{ 209, 2 },
{ 209, 2 },
{ 209, 3 },
{ 210, 0 },
{ 210, 2 },
{ 212, 0 },
{ 212, 2 },
{ 209, 5 },
{ 209, 4 },
{ 209, 3 },
{ 209, 5 },
{ 209, 3 },
{ 209, 5 },
{ 209, 3 },
{ 209, 4 },
{ 209, 5 },
{ 209, 4 },
{ 209, 3 },
{ 209, 3 },
{ 209, 3 },
{ 209, 2 },
{ 209, 3 },
{ 209, 5 },
{ 209, 5 },
{ 209, 4 },
{ 209, 5 },
{ 209, 3 },
{ 209, 4 },
{ 209, 4 },
{ 209, 4 },
{ 209, 6 },
{ 211, 1 },
{ 211, 1 },
{ 213, 2 },
{ 213, 0 },
{ 216, 3 },
{ 216, 0 },
{ 209, 3 },
{ 209, 6 },
{ 209, 5 },
{ 209, 5 },
{ 218, 0 },
{ 218, 2 },
{ 219, 0 },
{ 219, 2 },
{ 220, 0 },
{ 220, 2 },
{ 221, 0 },
{ 221, 2 },
{ 222, 0 },
{ 222, 2 },
{ 223, 0 },
{ 223, 2 },
{ 224, 0 },
{ 224, 2 },
{ 225, 0 },
{ 225, 2 },
{ 226, 0 },
{ 226, 2 },
{ 215, 9 },
{ 227, 2 },
{ 229, 2 },
{ 230, 2 },
{ 231, 2 },
{ 232, 2 },
{ 233, 2 },
{ 234, 2 },
{ 235, 2 },
{ 236, 2 },
{ 237, 2 },
{ 238, 2 },
{ 239, 2 },
{ 240, 2 },
{ 217, 0 },
{ 217, 2 },
{ 217, 2 },
{ 217, 2 },
{ 217, 2 },
{ 217, 2 },
{ 217, 2 },
{ 217, 2 },
{ 217, 2 },
{ 217, 2 },
{ 217, 2 },
{ 217, 2 },
{ 217, 2 },
{ 217, 2 },
{ 214, 0 },
{ 214, 2 },
{ 214, 2 },
{ 214, 2 },
{ 214, 2 },
{ 214, 2 },
{ 214, 2 },
{ 214, 2 },
{ 241, 1 },
{ 241, 4 },
{ 242, 1 },
{ 242, 2 },
{ 242, 2 },
{ 209, 6 },
{ 243, 3 },
{ 243, 7 },
{ 243, 7 },
{ 243, 2 },
{ 244, 3 },
{ 244, 1 },
{ 246, 2 },
{ 228, 3 },
{ 228, 1 },
{ 247, 1 },
{ 247, 1 },
{ 247, 1 },
{ 247, 1 },
{ 247, 1 },
{ 247, 2 },
{ 247, 2 },
{ 247, 2 },
{ 247, 2 },
{ 248, 3 },
{ 209, 1 },
{ 245, 12 },
{ 260, 1 },
{ 260, 3 },
{ 260, 4 },
{ 260, 6 },
{ 209, 1 },
{ 245, 2 },
{ 261, 2 },
{ 261, 0 },
{ 251, 3 },
{ 251, 2 },
{ 263, 2 },
{ 263, 1 },
{ 263, 0 },
{ 249, 2 },
{ 264, 2 },
{ 264, 3 },
{ 264, 4 },
{ 264, 5 },
{ 265, 1 },
{ 252, 4 },
{ 252, 6 },
{ 252, 0 },
{ 253, 0 },
{ 253, 6 },
{ 253, 4 },
{ 254, 4 },
{ 254, 0 },
{ 256, 0 },
{ 256, 3 },
{ 266, 4 },
{ 266, 2 },
{ 268, 2 },
{ 269, 1 },
{ 269, 1 },
{ 269, 0 },
{ 255, 0 },
{ 255, 3 },
{ 270, 3 },
{ 270, 1 },
{ 257, 0 },
{ 257, 2 },
{ 259, 0 },
{ 259, 2 },
{ 259, 4 },
{ 259, 4 },
{ 258, 0 },
{ 258, 2 },
{ 258, 4 },
{ 258, 4 },
{ 250, 0 },
{ 250, 2 },
{ 262, 3 },
{ 262, 1 },
{ 262, 3 },
{ 262, 3 },
{ 262, 1 },
{ 262, 2 },
{ 262, 2 },
{ 262, 1 },
{ 262, 2 },
{ 262, 2 },
{ 262, 1 },
{ 262, 1 },
{ 262, 1 },
{ 262, 1 },
{ 262, 4 },
{ 262, 4 },
{ 262, 3 },
{ 262, 4 },
{ 262, 3 },
{ 262, 3 },
{ 262, 3 },
{ 262, 3 },
{ 262, 3 },
{ 262, 3 },
{ 262, 3 },
{ 262, 3 },
{ 262, 3 },
{ 262, 3 },
{ 262, 3 },
{ 262, 3 },
{ 262, 3 },
{ 262, 3 },
{ 262, 5 },
{ 271, 3 },
{ 271, 1 },
{ 272, 1 },
{ 272, 0 },
{ 209, 3 },
{ 209, 7 },
{ 209, 7 },
{ 209, 7 },
{ 209, 7 },
{ 209, 8 },
{ 209, 9 },
{ 209, 3 },
{ 209, 5 },
{ 209, 5 },
};
static void yy_accept(yyParser*); /* Forward Declaration */
......@@ -1933,66 +1614,43 @@ static void yy_accept(yyParser*); /* Forward Declaration */
/*
** Perform a reduce action and the shift that must immediately
** follow the reduce.
**
** The yyLookahead and yyLookaheadToken parameters provide reduce actions
** access to the lookahead token (if any). The yyLookahead will be YYNOCODE
** if the lookahead token has already been consumed. As this procedure is
** only called from one place, optimizing compilers will in-line it, which
** means that the extra parameters have no performance impact.
*/
static void yy_reduce(
yyParser *yypParser, /* The parser */
unsigned int yyruleno, /* Number of the rule by which to reduce */
int yyLookahead, /* Lookahead token, or YYNOCODE if none */
ParseTOKENTYPE yyLookaheadToken /* Value of the lookahead token */
int yyruleno /* Number of the rule by which to reduce */
){
int yygoto; /* The next state */
int yyact; /* The next action */
YYMINORTYPE yygotominor; /* The LHS of the rule reduced */
yyStackEntry *yymsp; /* The top of the parser's stack */
int yysize; /* Amount to pop the stack */
ParseARG_FETCH;
(void)yyLookahead;
(void)yyLookaheadToken;
yymsp = yypParser->yytos;
yymsp = &yypParser->yystack[yypParser->yyidx];
#ifndef NDEBUG
if( yyTraceFILE && yyruleno<(int)(sizeof(yyRuleName)/sizeof(yyRuleName[0])) ){
yysize = yyRuleInfo[yyruleno].nrhs;
if( yysize ){
fprintf(yyTraceFILE, "%sReduce %d [%s], go to state %d.\n",
yyTracePrompt,
yyruleno, yyRuleName[yyruleno], yymsp[yysize].stateno);
}else{
fprintf(yyTraceFILE, "%sReduce %d [%s].\n",
yyTracePrompt, yyruleno, yyRuleName[yyruleno]);
}
if( yyTraceFILE && yyruleno>=0
&& yyruleno<(int)(sizeof(yyRuleName)/sizeof(yyRuleName[0])) ){
fprintf(yyTraceFILE, "%sReduce [%s].\n", yyTracePrompt,
yyRuleName[yyruleno]);
}
#endif /* NDEBUG */
/* Check that the stack is large enough to grow by a single entry
** if the RHS of the rule is empty. This ensures that there is room
** enough on the stack to push the LHS value */
if( yyRuleInfo[yyruleno].nrhs==0 ){
#ifdef YYTRACKMAXSTACKDEPTH
if( (int)(yypParser->yytos - yypParser->yystack)>yypParser->yyhwm ){
yypParser->yyhwm++;
assert( yypParser->yyhwm == (int)(yypParser->yytos - yypParser->yystack));
}
#endif
#if YYSTACKDEPTH>0
if( yypParser->yytos>=yypParser->yystackEnd ){
yyStackOverflow(yypParser);
return;
}
#else
if( yypParser->yytos>=&yypParser->yystack[yypParser->yystksz-1] ){
if( yyGrowStack(yypParser) ){
yyStackOverflow(yypParser);
return;
}
yymsp = yypParser->yytos;
}
#endif
}
/* Silence complaints from purify about yygotominor being uninitialized
** in some cases when it is copied into the stack after the following
** switch. yygotominor is uninitialized when a rule reduces that does
** not set the value of its left-hand side nonterminal. Leaving the
** value of the nonterminal uninitialized is utterly harmless as long
** as the value is never used. So really the only thing this code
** accomplishes is to quieten purify.
**
** 2007-01-16: The wireshark project (www.wireshark.org) reports that
** without this code, their parser segfaults. I'm not sure what there
** parser is doing to make this happen. This is the second bug report
** from wireshark this week. Clearly they are stressing Lemon in ways
** that it has not been previously stressed... (SQLite ticket #2172)
*/
/*memset(&yygotominor, 0, sizeof(yygotominor));*/
yygotominor = yyzerominor;
switch( yyruleno ){
/* Beginning here are the reduction cases. A typical example
......@@ -2003,8 +1661,6 @@ static void yy_reduce(
** #line <lineno> <thisfile>
** break;
*/
/********** Begin reduce actions **********************************************/
YYMINORTYPE yylhsminor;
case 0: /* program ::= cmd */
{}
break;
......@@ -2051,17 +1707,16 @@ static void yy_reduce(
{ setShowOptions(pInfo, TSDB_MGMT_TABLE_VNODES, &yymsp[0].minor.yy0, 0); }
break;
case 15: /* dbPrefix ::= */
{yymsp[1].minor.yy0.n = 0; yymsp[1].minor.yy0.type = 0;}
{yygotominor.yy0.n = 0; yygotominor.yy0.type = 0;}
break;
case 16: /* dbPrefix ::= ids DOT */
{yylhsminor.yy0 = yymsp[-1].minor.yy0; }
yymsp[-1].minor.yy0 = yylhsminor.yy0;
{yygotominor.yy0 = yymsp[-1].minor.yy0; }
break;
case 17: /* cpxName ::= */
{yymsp[1].minor.yy0.n = 0; }
{yygotominor.yy0.n = 0; }
break;
case 18: /* cpxName ::= DOT ids */
{yymsp[-1].minor.yy0 = yymsp[0].minor.yy0; yymsp[-1].minor.yy0.n += 1; }
{yygotominor.yy0 = yymsp[0].minor.yy0; yygotominor.yy0.n += 1; }
break;
case 19: /* cmd ::= SHOW CREATE TABLE ids cpxName */
{
......@@ -2156,37 +1811,34 @@ static void yy_reduce(
{ setDCLSQLElems(pInfo, TSDB_SQL_CFG_LOCAL, 2, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0); }
break;
case 40: /* cmd ::= ALTER DATABASE ids alter_db_optr */
{ SStrToken t = {0}; setCreateDBSQL(pInfo, TSDB_SQL_ALTER_DB, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy158, &t);}
{ SStrToken t = {0}; setCreateDBSQL(pInfo, TSDB_SQL_ALTER_DB, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy268, &t);}
break;
case 41: /* cmd ::= ALTER ACCOUNT ids acct_optr */
{ setCreateAcctSQL(pInfo, TSDB_SQL_ALTER_ACCT, &yymsp[-1].minor.yy0, NULL, &yymsp[0].minor.yy73);}
{ setCreateAcctSQL(pInfo, TSDB_SQL_ALTER_ACCT, &yymsp[-1].minor.yy0, NULL, &yymsp[0].minor.yy149);}
break;
case 42: /* 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.yy73);}
{ setCreateAcctSQL(pInfo, TSDB_SQL_ALTER_ACCT, &yymsp[-3].minor.yy0, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy149);}
break;
case 43: /* ids ::= ID */
case 44: /* ids ::= STRING */ yytestcase(yyruleno==44);
{yylhsminor.yy0 = yymsp[0].minor.yy0; }
yymsp[0].minor.yy0 = yylhsminor.yy0;
{yygotominor.yy0 = yymsp[0].minor.yy0; }
break;
case 45: /* ifexists ::= IF EXISTS */
{yymsp[-1].minor.yy0.n = 1;}
case 47: /* ifnotexists ::= IF NOT EXISTS */ yytestcase(yyruleno==47);
{yygotominor.yy0.n = 1;}
break;
case 46: /* ifexists ::= */
case 48: /* ifnotexists ::= */ yytestcase(yyruleno==48);
{yymsp[1].minor.yy0.n = 0;}
break;
case 47: /* ifnotexists ::= IF NOT EXISTS */
{yymsp[-2].minor.yy0.n = 1;}
{yygotominor.yy0.n = 0;}
break;
case 49: /* cmd ::= CREATE DNODE ids */
{ setDCLSQLElems(pInfo, TSDB_SQL_CREATE_DNODE, 1, &yymsp[0].minor.yy0);}
break;
case 50: /* 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.yy73);}
{ setCreateAcctSQL(pInfo, TSDB_SQL_CREATE_ACCT, &yymsp[-3].minor.yy0, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy149);}
break;
case 51: /* cmd ::= CREATE DATABASE ifnotexists ids db_optr */
{ setCreateDBSQL(pInfo, TSDB_SQL_CREATE_DB, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy158, &yymsp[-2].minor.yy0);}
{ setCreateDBSQL(pInfo, TSDB_SQL_CREATE_DB, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy268, &yymsp[-2].minor.yy0);}
break;
case 52: /* cmd ::= CREATE USER ids PASS ids */
{ setCreateUserSQL(pInfo, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0);}
......@@ -2200,7 +1852,7 @@ static void yy_reduce(
case 65: /* users ::= */ yytestcase(yyruleno==65);
case 67: /* conns ::= */ yytestcase(yyruleno==67);
case 69: /* state ::= */ yytestcase(yyruleno==69);
{yymsp[1].minor.yy0.n = 0; }
{yygotominor.yy0.n = 0; }
break;
case 54: /* pps ::= PPS INTEGER */
case 56: /* tseries ::= TSERIES INTEGER */ yytestcase(yyruleno==56);
......@@ -2211,24 +1863,23 @@ static void yy_reduce(
case 66: /* users ::= USERS INTEGER */ yytestcase(yyruleno==66);
case 68: /* conns ::= CONNS INTEGER */ yytestcase(yyruleno==68);
case 70: /* state ::= STATE ids */ yytestcase(yyruleno==70);
{yymsp[-1].minor.yy0 = yymsp[0].minor.yy0; }
{yygotominor.yy0 = yymsp[0].minor.yy0; }
break;
case 71: /* acct_optr ::= pps tseries storage streams qtime dbs users conns state */
{
yylhsminor.yy73.maxUsers = (yymsp[-2].minor.yy0.n>0)?atoi(yymsp[-2].minor.yy0.z):-1;
yylhsminor.yy73.maxDbs = (yymsp[-3].minor.yy0.n>0)?atoi(yymsp[-3].minor.yy0.z):-1;
yylhsminor.yy73.maxTimeSeries = (yymsp[-7].minor.yy0.n>0)?atoi(yymsp[-7].minor.yy0.z):-1;
yylhsminor.yy73.maxStreams = (yymsp[-5].minor.yy0.n>0)?atoi(yymsp[-5].minor.yy0.z):-1;
yylhsminor.yy73.maxPointsPerSecond = (yymsp[-8].minor.yy0.n>0)?atoi(yymsp[-8].minor.yy0.z):-1;
yylhsminor.yy73.maxStorage = (yymsp[-6].minor.yy0.n>0)?strtoll(yymsp[-6].minor.yy0.z, NULL, 10):-1;
yylhsminor.yy73.maxQueryTime = (yymsp[-4].minor.yy0.n>0)?strtoll(yymsp[-4].minor.yy0.z, NULL, 10):-1;
yylhsminor.yy73.maxConnections = (yymsp[-1].minor.yy0.n>0)?atoi(yymsp[-1].minor.yy0.z):-1;
yylhsminor.yy73.stat = yymsp[0].minor.yy0;
}
yymsp[-8].minor.yy73 = yylhsminor.yy73;
yygotominor.yy149.maxUsers = (yymsp[-2].minor.yy0.n>0)?atoi(yymsp[-2].minor.yy0.z):-1;
yygotominor.yy149.maxDbs = (yymsp[-3].minor.yy0.n>0)?atoi(yymsp[-3].minor.yy0.z):-1;
yygotominor.yy149.maxTimeSeries = (yymsp[-7].minor.yy0.n>0)?atoi(yymsp[-7].minor.yy0.z):-1;
yygotominor.yy149.maxStreams = (yymsp[-5].minor.yy0.n>0)?atoi(yymsp[-5].minor.yy0.z):-1;
yygotominor.yy149.maxPointsPerSecond = (yymsp[-8].minor.yy0.n>0)?atoi(yymsp[-8].minor.yy0.z):-1;
yygotominor.yy149.maxStorage = (yymsp[-6].minor.yy0.n>0)?strtoll(yymsp[-6].minor.yy0.z, NULL, 10):-1;
yygotominor.yy149.maxQueryTime = (yymsp[-4].minor.yy0.n>0)?strtoll(yymsp[-4].minor.yy0.z, NULL, 10):-1;
yygotominor.yy149.maxConnections = (yymsp[-1].minor.yy0.n>0)?atoi(yymsp[-1].minor.yy0.z):-1;
yygotominor.yy149.stat = yymsp[0].minor.yy0;
}
break;
case 72: /* keep ::= KEEP tagitemlist */
{ yymsp[-1].minor.yy494 = yymsp[0].minor.yy494; }
{ yygotominor.yy498 = yymsp[0].minor.yy498; }
break;
case 73: /* cache ::= CACHE INTEGER */
case 74: /* replica ::= REPLICA INTEGER */ yytestcase(yyruleno==74);
......@@ -2242,101 +1893,83 @@ static void yy_reduce(
case 82: /* fsync ::= FSYNC INTEGER */ yytestcase(yyruleno==82);
case 83: /* comp ::= COMP INTEGER */ yytestcase(yyruleno==83);
case 84: /* prec ::= PRECISION STRING */ yytestcase(yyruleno==84);
{ yymsp[-1].minor.yy0 = yymsp[0].minor.yy0; }
{ yygotominor.yy0 = yymsp[0].minor.yy0; }
break;
case 85: /* db_optr ::= */
{setDefaultCreateDbOption(&yymsp[1].minor.yy158);}
{setDefaultCreateDbOption(&yygotominor.yy268);}
break;
case 86: /* db_optr ::= db_optr cache */
{ yylhsminor.yy158 = yymsp[-1].minor.yy158; yylhsminor.yy158.cacheBlockSize = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
yymsp[-1].minor.yy158 = yylhsminor.yy158;
{ yygotominor.yy268 = yymsp[-1].minor.yy268; yygotominor.yy268.cacheBlockSize = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
break;
case 87: /* db_optr ::= db_optr replica */
case 100: /* alter_db_optr ::= alter_db_optr replica */ yytestcase(yyruleno==100);
{ yylhsminor.yy158 = yymsp[-1].minor.yy158; yylhsminor.yy158.replica = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
yymsp[-1].minor.yy158 = yylhsminor.yy158;
{ yygotominor.yy268 = yymsp[-1].minor.yy268; yygotominor.yy268.replica = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
break;
case 88: /* db_optr ::= db_optr quorum */
case 101: /* alter_db_optr ::= alter_db_optr quorum */ yytestcase(yyruleno==101);
{ yylhsminor.yy158 = yymsp[-1].minor.yy158; yylhsminor.yy158.quorum = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
yymsp[-1].minor.yy158 = yylhsminor.yy158;
{ yygotominor.yy268 = yymsp[-1].minor.yy268; yygotominor.yy268.quorum = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
break;
case 89: /* db_optr ::= db_optr days */
{ yylhsminor.yy158 = yymsp[-1].minor.yy158; yylhsminor.yy158.daysPerFile = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
yymsp[-1].minor.yy158 = yylhsminor.yy158;
{ yygotominor.yy268 = yymsp[-1].minor.yy268; yygotominor.yy268.daysPerFile = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
break;
case 90: /* db_optr ::= db_optr minrows */
{ yylhsminor.yy158 = yymsp[-1].minor.yy158; yylhsminor.yy158.minRowsPerBlock = strtod(yymsp[0].minor.yy0.z, NULL); }
yymsp[-1].minor.yy158 = yylhsminor.yy158;
{ yygotominor.yy268 = yymsp[-1].minor.yy268; yygotominor.yy268.minRowsPerBlock = strtod(yymsp[0].minor.yy0.z, NULL); }
break;
case 91: /* db_optr ::= db_optr maxrows */
{ yylhsminor.yy158 = yymsp[-1].minor.yy158; yylhsminor.yy158.maxRowsPerBlock = strtod(yymsp[0].minor.yy0.z, NULL); }
yymsp[-1].minor.yy158 = yylhsminor.yy158;
{ yygotominor.yy268 = yymsp[-1].minor.yy268; yygotominor.yy268.maxRowsPerBlock = strtod(yymsp[0].minor.yy0.z, NULL); }
break;
case 92: /* db_optr ::= db_optr blocks */
case 103: /* alter_db_optr ::= alter_db_optr blocks */ yytestcase(yyruleno==103);
{ yylhsminor.yy158 = yymsp[-1].minor.yy158; yylhsminor.yy158.numOfBlocks = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
yymsp[-1].minor.yy158 = yylhsminor.yy158;
{ yygotominor.yy268 = yymsp[-1].minor.yy268; yygotominor.yy268.numOfBlocks = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
break;
case 93: /* db_optr ::= db_optr ctime */
{ yylhsminor.yy158 = yymsp[-1].minor.yy158; yylhsminor.yy158.commitTime = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
yymsp[-1].minor.yy158 = yylhsminor.yy158;
{ yygotominor.yy268 = yymsp[-1].minor.yy268; yygotominor.yy268.commitTime = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
break;
case 94: /* db_optr ::= db_optr wal */
case 105: /* alter_db_optr ::= alter_db_optr wal */ yytestcase(yyruleno==105);
{ yylhsminor.yy158 = yymsp[-1].minor.yy158; yylhsminor.yy158.walLevel = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
yymsp[-1].minor.yy158 = yylhsminor.yy158;
{ yygotominor.yy268 = yymsp[-1].minor.yy268; yygotominor.yy268.walLevel = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
break;
case 95: /* db_optr ::= db_optr fsync */
case 106: /* alter_db_optr ::= alter_db_optr fsync */ yytestcase(yyruleno==106);
{ yylhsminor.yy158 = yymsp[-1].minor.yy158; yylhsminor.yy158.fsyncPeriod = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
yymsp[-1].minor.yy158 = yylhsminor.yy158;
{ yygotominor.yy268 = yymsp[-1].minor.yy268; yygotominor.yy268.fsyncPeriod = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
break;
case 96: /* db_optr ::= db_optr comp */
case 104: /* alter_db_optr ::= alter_db_optr comp */ yytestcase(yyruleno==104);
{ yylhsminor.yy158 = yymsp[-1].minor.yy158; yylhsminor.yy158.compressionLevel = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
yymsp[-1].minor.yy158 = yylhsminor.yy158;
{ yygotominor.yy268 = yymsp[-1].minor.yy268; yygotominor.yy268.compressionLevel = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
break;
case 97: /* db_optr ::= db_optr prec */
{ yylhsminor.yy158 = yymsp[-1].minor.yy158; yylhsminor.yy158.precision = yymsp[0].minor.yy0; }
yymsp[-1].minor.yy158 = yylhsminor.yy158;
{ yygotominor.yy268 = yymsp[-1].minor.yy268; yygotominor.yy268.precision = yymsp[0].minor.yy0; }
break;
case 98: /* db_optr ::= db_optr keep */
case 102: /* alter_db_optr ::= alter_db_optr keep */ yytestcase(yyruleno==102);
{ yylhsminor.yy158 = yymsp[-1].minor.yy158; yylhsminor.yy158.keep = yymsp[0].minor.yy494; }
yymsp[-1].minor.yy158 = yylhsminor.yy158;
{ yygotominor.yy268 = yymsp[-1].minor.yy268; yygotominor.yy268.keep = yymsp[0].minor.yy498; }
break;
case 99: /* alter_db_optr ::= */
{ setDefaultCreateDbOption(&yymsp[1].minor.yy158);}
{ setDefaultCreateDbOption(&yygotominor.yy268);}
break;
case 107: /* typename ::= ids */
{
yymsp[0].minor.yy0.type = 0;
tSQLSetColumnType (&yylhsminor.yy181, &yymsp[0].minor.yy0);
tSQLSetColumnType (&yygotominor.yy223, &yymsp[0].minor.yy0);
}
yymsp[0].minor.yy181 = yylhsminor.yy181;
break;
case 108: /* typename ::= ids LP signed RP */
{
if (yymsp[-1].minor.yy271 <= 0) {
if (yymsp[-1].minor.yy207 <= 0) {
yymsp[-3].minor.yy0.type = 0;
tSQLSetColumnType(&yylhsminor.yy181, &yymsp[-3].minor.yy0);
tSQLSetColumnType(&yygotominor.yy223, &yymsp[-3].minor.yy0);
} else {
yymsp[-3].minor.yy0.type = -yymsp[-1].minor.yy271; // negative value of name length
tSQLSetColumnType(&yylhsminor.yy181, &yymsp[-3].minor.yy0);
yymsp[-3].minor.yy0.type = -yymsp[-1].minor.yy207; // negative value of name length
tSQLSetColumnType(&yygotominor.yy223, &yymsp[-3].minor.yy0);
}
}
yymsp[-3].minor.yy181 = yylhsminor.yy181;
break;
case 109: /* signed ::= INTEGER */
{ yylhsminor.yy271 = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
yymsp[0].minor.yy271 = yylhsminor.yy271;
break;
case 110: /* signed ::= PLUS INTEGER */
{ yymsp[-1].minor.yy271 = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
case 110: /* signed ::= PLUS INTEGER */ yytestcase(yyruleno==110);
{ yygotominor.yy207 = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
break;
case 111: /* signed ::= MINUS INTEGER */
{ yymsp[-1].minor.yy271 = -strtol(yymsp[0].minor.yy0.z, NULL, 10);}
{ yygotominor.yy207 = -strtol(yymsp[0].minor.yy0.z, NULL, 10);}
break;
case 112: /* cmd ::= CREATE TABLE ifnotexists ids cpxName create_table_args */
{
......@@ -2346,61 +1979,54 @@ static void yy_reduce(
break;
case 113: /* create_table_args ::= LP columnlist RP */
{
yymsp[-2].minor.yy374 = tSetCreateSQLElems(yymsp[-1].minor.yy449, NULL, NULL, NULL, NULL, TSQL_CREATE_TABLE);
setSQLInfo(pInfo, yymsp[-2].minor.yy374, NULL, TSDB_SQL_CREATE_TABLE);
yygotominor.yy470 = tSetCreateSQLElems(yymsp[-1].minor.yy523, NULL, NULL, NULL, NULL, TSQL_CREATE_TABLE);
setSQLInfo(pInfo, yygotominor.yy470, NULL, TSDB_SQL_CREATE_TABLE);
}
break;
case 114: /* create_table_args ::= LP columnlist RP TAGS LP columnlist RP */
{
yymsp[-6].minor.yy374 = tSetCreateSQLElems(yymsp[-5].minor.yy449, yymsp[-1].minor.yy449, NULL, NULL, NULL, TSQL_CREATE_STABLE);
setSQLInfo(pInfo, yymsp[-6].minor.yy374, NULL, TSDB_SQL_CREATE_TABLE);
yygotominor.yy470 = tSetCreateSQLElems(yymsp[-5].minor.yy523, yymsp[-1].minor.yy523, NULL, NULL, NULL, TSQL_CREATE_STABLE);
setSQLInfo(pInfo, yygotominor.yy470, NULL, TSDB_SQL_CREATE_TABLE);
}
break;
case 115: /* create_table_args ::= USING ids cpxName TAGS LP tagitemlist RP */
{
yymsp[-5].minor.yy0.n += yymsp[-4].minor.yy0.n;
yymsp[-6].minor.yy374 = tSetCreateSQLElems(NULL, NULL, &yymsp[-5].minor.yy0, yymsp[-1].minor.yy494, NULL, TSQL_CREATE_TABLE_FROM_STABLE);
setSQLInfo(pInfo, yymsp[-6].minor.yy374, NULL, TSDB_SQL_CREATE_TABLE);
yygotominor.yy470 = tSetCreateSQLElems(NULL, NULL, &yymsp[-5].minor.yy0, yymsp[-1].minor.yy498, NULL, TSQL_CREATE_TABLE_FROM_STABLE);
setSQLInfo(pInfo, yygotominor.yy470, NULL, TSDB_SQL_CREATE_TABLE);
}
break;
case 116: /* create_table_args ::= AS select */
{
yymsp[-1].minor.yy374 = tSetCreateSQLElems(NULL, NULL, NULL, NULL, yymsp[0].minor.yy150, TSQL_CREATE_STREAM);
setSQLInfo(pInfo, yymsp[-1].minor.yy374, NULL, TSDB_SQL_CREATE_TABLE);
yygotominor.yy470 = tSetCreateSQLElems(NULL, NULL, NULL, NULL, yymsp[0].minor.yy414, TSQL_CREATE_STREAM);
setSQLInfo(pInfo, yygotominor.yy470, NULL, TSDB_SQL_CREATE_TABLE);
}
break;
case 117: /* columnlist ::= columnlist COMMA column */
{yylhsminor.yy449 = tFieldListAppend(yymsp[-2].minor.yy449, &yymsp[0].minor.yy181); }
yymsp[-2].minor.yy449 = yylhsminor.yy449;
{yygotominor.yy523 = tFieldListAppend(yymsp[-2].minor.yy523, &yymsp[0].minor.yy223); }
break;
case 118: /* columnlist ::= column */
{yylhsminor.yy449 = tFieldListAppend(NULL, &yymsp[0].minor.yy181);}
yymsp[0].minor.yy449 = yylhsminor.yy449;
{yygotominor.yy523 = tFieldListAppend(NULL, &yymsp[0].minor.yy223);}
break;
case 119: /* column ::= ids typename */
{
tSQLSetColumnInfo(&yylhsminor.yy181, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy181);
tSQLSetColumnInfo(&yygotominor.yy223, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy223);
}
yymsp[-1].minor.yy181 = yylhsminor.yy181;
break;
case 120: /* tagitemlist ::= tagitemlist COMMA tagitem */
{ yylhsminor.yy494 = tVariantListAppend(yymsp[-2].minor.yy494, &yymsp[0].minor.yy312, -1); }
yymsp[-2].minor.yy494 = yylhsminor.yy494;
{ yygotominor.yy498 = tVariantListAppend(yymsp[-2].minor.yy498, &yymsp[0].minor.yy134, -1); }
break;
case 121: /* tagitemlist ::= tagitem */
{ yylhsminor.yy494 = tVariantListAppend(NULL, &yymsp[0].minor.yy312, -1); }
yymsp[0].minor.yy494 = yylhsminor.yy494;
{ yygotominor.yy498 = tVariantListAppend(NULL, &yymsp[0].minor.yy134, -1); }
break;
case 122: /* tagitem ::= INTEGER */
case 123: /* tagitem ::= FLOAT */ yytestcase(yyruleno==123);
case 124: /* tagitem ::= STRING */ yytestcase(yyruleno==124);
case 125: /* tagitem ::= BOOL */ yytestcase(yyruleno==125);
{toTSDBType(yymsp[0].minor.yy0.type); tVariantCreate(&yylhsminor.yy312, &yymsp[0].minor.yy0); }
yymsp[0].minor.yy312 = yylhsminor.yy312;
{toTSDBType(yymsp[0].minor.yy0.type); tVariantCreate(&yygotominor.yy134, &yymsp[0].minor.yy0); }
break;
case 126: /* tagitem ::= NULL */
{ yymsp[0].minor.yy0.type = 0; tVariantCreate(&yylhsminor.yy312, &yymsp[0].minor.yy0); }
yymsp[0].minor.yy312 = yylhsminor.yy312;
{ yymsp[0].minor.yy0.type = 0; tVariantCreate(&yygotominor.yy134, &yymsp[0].minor.yy0); }
break;
case 127: /* tagitem ::= MINUS INTEGER */
case 128: /* tagitem ::= MINUS FLOAT */ yytestcase(yyruleno==128);
......@@ -2410,372 +2036,321 @@ static void yy_reduce(
yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n;
yymsp[-1].minor.yy0.type = yymsp[0].minor.yy0.type;
toTSDBType(yymsp[-1].minor.yy0.type);
tVariantCreate(&yylhsminor.yy312, &yymsp[-1].minor.yy0);
tVariantCreate(&yygotominor.yy134, &yymsp[-1].minor.yy0);
}
yymsp[-1].minor.yy312 = yylhsminor.yy312;
break;
case 131: /* select ::= SELECT selcollist from where_opt interval_opt fill_opt sliding_opt groupby_opt orderby_opt having_opt slimit_opt limit_opt */
case 131: /* delete ::= DELETE from where_opt */
{
yylhsminor.yy150 = tSetQuerySQLElems(&yymsp[-11].minor.yy0, yymsp[-10].minor.yy224, yymsp[-9].minor.yy494, yymsp[-8].minor.yy66, yymsp[-4].minor.yy494, yymsp[-3].minor.yy494, &yymsp[-7].minor.yy314, &yymsp[-5].minor.yy0, yymsp[-6].minor.yy494, &yymsp[0].minor.yy188, &yymsp[-1].minor.yy188);
yygotominor.yy175 = tSetDelSQLElems(yymsp[-1].minor.yy498, yymsp[0].minor.yy64);
}
yymsp[-11].minor.yy150 = yylhsminor.yy150;
break;
case 132: /* union ::= select */
{ yylhsminor.yy25 = setSubclause(NULL, yymsp[0].minor.yy150); }
yymsp[0].minor.yy25 = yylhsminor.yy25;
case 132: /* cmd ::= delete */
{ setSQLInfo(pInfo, yymsp[0].minor.yy175, NULL, TSDB_SQL_DELETE); }
break;
case 133: /* union ::= LP union RP */
{ yymsp[-2].minor.yy25 = yymsp[-1].minor.yy25; }
case 133: /* select ::= SELECT selcollist from where_opt interval_opt fill_opt sliding_opt groupby_opt orderby_opt having_opt slimit_opt limit_opt */
{
yygotominor.yy414 = tSetQuerySQLElems(&yymsp[-11].minor.yy0, yymsp[-10].minor.yy290, yymsp[-9].minor.yy498, yymsp[-8].minor.yy64, yymsp[-4].minor.yy498, yymsp[-3].minor.yy498, &yymsp[-7].minor.yy532, &yymsp[-5].minor.yy0, yymsp[-6].minor.yy498, &yymsp[0].minor.yy216, &yymsp[-1].minor.yy216);
}
break;
case 134: /* union ::= select */
{ yygotominor.yy231 = setSubclause(NULL, yymsp[0].minor.yy414); }
break;
case 134: /* union ::= union UNION ALL select */
{ yylhsminor.yy25 = appendSelectClause(yymsp[-3].minor.yy25, yymsp[0].minor.yy150); }
yymsp[-3].minor.yy25 = yylhsminor.yy25;
case 135: /* union ::= LP union RP */
{ yygotominor.yy231 = yymsp[-1].minor.yy231; }
break;
case 135: /* union ::= union UNION ALL LP select RP */
{ yylhsminor.yy25 = appendSelectClause(yymsp[-5].minor.yy25, yymsp[-1].minor.yy150); }
yymsp[-5].minor.yy25 = yylhsminor.yy25;
case 136: /* union ::= union UNION ALL select */
{ yygotominor.yy231 = appendSelectClause(yymsp[-3].minor.yy231, yymsp[0].minor.yy414); }
break;
case 136: /* cmd ::= union */
{ setSQLInfo(pInfo, yymsp[0].minor.yy25, NULL, TSDB_SQL_SELECT); }
case 137: /* union ::= union UNION ALL LP select RP */
{ yygotominor.yy231 = appendSelectClause(yymsp[-5].minor.yy231, yymsp[-1].minor.yy414); }
break;
case 137: /* select ::= SELECT selcollist */
case 138: /* cmd ::= union */
{ setSQLInfo(pInfo, yymsp[0].minor.yy231, NULL, TSDB_SQL_SELECT); }
break;
case 139: /* select ::= SELECT selcollist */
{
yylhsminor.yy150 = tSetQuerySQLElems(&yymsp[-1].minor.yy0, yymsp[0].minor.yy224, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
yygotominor.yy414 = tSetQuerySQLElems(&yymsp[-1].minor.yy0, yymsp[0].minor.yy290, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
}
yymsp[-1].minor.yy150 = yylhsminor.yy150;
break;
case 138: /* sclp ::= selcollist COMMA */
{yylhsminor.yy224 = yymsp[-1].minor.yy224;}
yymsp[-1].minor.yy224 = yylhsminor.yy224;
case 140: /* sclp ::= selcollist COMMA */
{yygotominor.yy290 = yymsp[-1].minor.yy290;}
break;
case 139: /* sclp ::= */
{yymsp[1].minor.yy224 = 0;}
case 141: /* sclp ::= */
{yygotominor.yy290 = 0;}
break;
case 140: /* selcollist ::= sclp expr as */
case 142: /* selcollist ::= sclp expr as */
{
yylhsminor.yy224 = tSQLExprListAppend(yymsp[-2].minor.yy224, yymsp[-1].minor.yy66, yymsp[0].minor.yy0.n?&yymsp[0].minor.yy0:0);
yygotominor.yy290 = tSQLExprListAppend(yymsp[-2].minor.yy290, yymsp[-1].minor.yy64, yymsp[0].minor.yy0.n?&yymsp[0].minor.yy0:0);
}
yymsp[-2].minor.yy224 = yylhsminor.yy224;
break;
case 141: /* selcollist ::= sclp STAR */
case 143: /* selcollist ::= sclp STAR */
{
tSQLExpr *pNode = tSQLExprIdValueCreate(NULL, TK_ALL);
yylhsminor.yy224 = tSQLExprListAppend(yymsp[-1].minor.yy224, pNode, 0);
yygotominor.yy290 = tSQLExprListAppend(yymsp[-1].minor.yy290, pNode, 0);
}
yymsp[-1].minor.yy224 = yylhsminor.yy224;
break;
case 142: /* as ::= AS ids */
{ yymsp[-1].minor.yy0 = yymsp[0].minor.yy0; }
break;
case 143: /* as ::= ids */
{ yylhsminor.yy0 = yymsp[0].minor.yy0; }
yymsp[0].minor.yy0 = yylhsminor.yy0;
case 144: /* as ::= AS ids */
case 145: /* as ::= ids */ yytestcase(yyruleno==145);
{ yygotominor.yy0 = yymsp[0].minor.yy0; }
break;
case 144: /* as ::= */
{ yymsp[1].minor.yy0.n = 0; }
case 146: /* as ::= */
{ yygotominor.yy0.n = 0; }
break;
case 145: /* from ::= FROM tablelist */
{yymsp[-1].minor.yy494 = yymsp[0].minor.yy494;}
case 147: /* from ::= FROM tablelist */
case 162: /* orderby_opt ::= ORDER BY sortlist */ yytestcase(yyruleno==162);
case 170: /* groupby_opt ::= GROUP BY grouplist */ yytestcase(yyruleno==170);
{yygotominor.yy498 = yymsp[0].minor.yy498;}
break;
case 146: /* tablelist ::= ids cpxName */
case 148: /* tablelist ::= ids cpxName */
{
toTSDBType(yymsp[-1].minor.yy0.type);
yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n;
yylhsminor.yy494 = tVariantListAppendToken(NULL, &yymsp[-1].minor.yy0, -1);
yylhsminor.yy494 = tVariantListAppendToken(yylhsminor.yy494, &yymsp[-1].minor.yy0, -1); // table alias name
yygotominor.yy498 = tVariantListAppendToken(NULL, &yymsp[-1].minor.yy0, -1);
yygotominor.yy498 = tVariantListAppendToken(yygotominor.yy498, &yymsp[-1].minor.yy0, -1); // table alias name
}
yymsp[-1].minor.yy494 = yylhsminor.yy494;
break;
case 147: /* tablelist ::= ids cpxName ids */
case 149: /* tablelist ::= ids cpxName ids */
{
toTSDBType(yymsp[-2].minor.yy0.type);
toTSDBType(yymsp[0].minor.yy0.type);
yymsp[-2].minor.yy0.n += yymsp[-1].minor.yy0.n;
yylhsminor.yy494 = tVariantListAppendToken(NULL, &yymsp[-2].minor.yy0, -1);
yylhsminor.yy494 = tVariantListAppendToken(yylhsminor.yy494, &yymsp[0].minor.yy0, -1);
yygotominor.yy498 = tVariantListAppendToken(NULL, &yymsp[-2].minor.yy0, -1);
yygotominor.yy498 = tVariantListAppendToken(yygotominor.yy498, &yymsp[0].minor.yy0, -1);
}
yymsp[-2].minor.yy494 = yylhsminor.yy494;
break;
case 148: /* tablelist ::= tablelist COMMA ids cpxName */
case 150: /* tablelist ::= tablelist COMMA ids cpxName */
{
toTSDBType(yymsp[-1].minor.yy0.type);
yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n;
yylhsminor.yy494 = tVariantListAppendToken(yymsp[-3].minor.yy494, &yymsp[-1].minor.yy0, -1);
yylhsminor.yy494 = tVariantListAppendToken(yylhsminor.yy494, &yymsp[-1].minor.yy0, -1);
yygotominor.yy498 = tVariantListAppendToken(yymsp[-3].minor.yy498, &yymsp[-1].minor.yy0, -1);
yygotominor.yy498 = tVariantListAppendToken(yygotominor.yy498, &yymsp[-1].minor.yy0, -1);
}
yymsp[-3].minor.yy494 = yylhsminor.yy494;
break;
case 149: /* tablelist ::= tablelist COMMA ids cpxName ids */
case 151: /* tablelist ::= tablelist COMMA ids cpxName ids */
{
toTSDBType(yymsp[-2].minor.yy0.type);
toTSDBType(yymsp[0].minor.yy0.type);
yymsp[-2].minor.yy0.n += yymsp[-1].minor.yy0.n;
yylhsminor.yy494 = tVariantListAppendToken(yymsp[-4].minor.yy494, &yymsp[-2].minor.yy0, -1);
yylhsminor.yy494 = tVariantListAppendToken(yylhsminor.yy494, &yymsp[0].minor.yy0, -1);
yygotominor.yy498 = tVariantListAppendToken(yymsp[-4].minor.yy498, &yymsp[-2].minor.yy0, -1);
yygotominor.yy498 = tVariantListAppendToken(yygotominor.yy498, &yymsp[0].minor.yy0, -1);
}
yymsp[-4].minor.yy494 = yylhsminor.yy494;
break;
case 150: /* tmvar ::= VARIABLE */
{yylhsminor.yy0 = yymsp[0].minor.yy0;}
yymsp[0].minor.yy0 = yylhsminor.yy0;
case 152: /* tmvar ::= VARIABLE */
{yygotominor.yy0 = yymsp[0].minor.yy0;}
break;
case 151: /* interval_opt ::= INTERVAL LP tmvar RP */
{yymsp[-3].minor.yy314.interval = yymsp[-1].minor.yy0; yymsp[-3].minor.yy314.offset.n = 0; yymsp[-3].minor.yy314.offset.z = NULL; yymsp[-3].minor.yy314.offset.type = 0;}
case 153: /* interval_opt ::= INTERVAL LP tmvar RP */
{yygotominor.yy532.interval = yymsp[-1].minor.yy0; yygotominor.yy532.offset.n = 0; yygotominor.yy532.offset.z = NULL; yygotominor.yy532.offset.type = 0;}
break;
case 152: /* interval_opt ::= INTERVAL LP tmvar COMMA tmvar RP */
{yymsp[-5].minor.yy314.interval = yymsp[-3].minor.yy0; yymsp[-5].minor.yy314.offset = yymsp[-1].minor.yy0;}
case 154: /* interval_opt ::= INTERVAL LP tmvar COMMA tmvar RP */
{yygotominor.yy532.interval = yymsp[-3].minor.yy0; yygotominor.yy532.offset = yymsp[-1].minor.yy0;}
break;
case 153: /* interval_opt ::= */
{memset(&yymsp[1].minor.yy314, 0, sizeof(yymsp[1].minor.yy314));}
case 155: /* interval_opt ::= */
{memset(&yygotominor.yy532, 0, sizeof(yygotominor.yy532));}
break;
case 154: /* fill_opt ::= */
{yymsp[1].minor.yy494 = 0; }
case 156: /* fill_opt ::= */
{yygotominor.yy498 = 0; }
break;
case 155: /* fill_opt ::= FILL LP ID COMMA tagitemlist RP */
case 157: /* fill_opt ::= FILL LP ID COMMA tagitemlist RP */
{
tVariant A = {0};
toTSDBType(yymsp[-3].minor.yy0.type);
tVariantCreate(&A, &yymsp[-3].minor.yy0);
tVariantListInsert(yymsp[-1].minor.yy494, &A, -1, 0);
yymsp[-5].minor.yy494 = yymsp[-1].minor.yy494;
tVariantListInsert(yymsp[-1].minor.yy498, &A, -1, 0);
yygotominor.yy498 = yymsp[-1].minor.yy498;
}
break;
case 156: /* fill_opt ::= FILL LP ID RP */
case 158: /* fill_opt ::= FILL LP ID RP */
{
toTSDBType(yymsp[-1].minor.yy0.type);
yymsp[-3].minor.yy494 = tVariantListAppendToken(NULL, &yymsp[-1].minor.yy0, -1);
yygotominor.yy498 = tVariantListAppendToken(NULL, &yymsp[-1].minor.yy0, -1);
}
break;
case 157: /* sliding_opt ::= SLIDING LP tmvar RP */
{yymsp[-3].minor.yy0 = yymsp[-1].minor.yy0; }
break;
case 158: /* sliding_opt ::= */
{yymsp[1].minor.yy0.n = 0; yymsp[1].minor.yy0.z = NULL; yymsp[1].minor.yy0.type = 0; }
case 159: /* sliding_opt ::= SLIDING LP tmvar RP */
{yygotominor.yy0 = yymsp[-1].minor.yy0; }
break;
case 159: /* orderby_opt ::= */
case 167: /* groupby_opt ::= */ yytestcase(yyruleno==167);
{yymsp[1].minor.yy494 = 0;}
case 160: /* sliding_opt ::= */
{yygotominor.yy0.n = 0; yygotominor.yy0.z = NULL; yygotominor.yy0.type = 0; }
break;
case 160: /* orderby_opt ::= ORDER BY sortlist */
case 168: /* groupby_opt ::= GROUP BY grouplist */ yytestcase(yyruleno==168);
{yymsp[-2].minor.yy494 = yymsp[0].minor.yy494;}
case 161: /* orderby_opt ::= */
case 169: /* groupby_opt ::= */ yytestcase(yyruleno==169);
{yygotominor.yy498 = 0;}
break;
case 161: /* sortlist ::= sortlist COMMA item sortorder */
case 163: /* sortlist ::= sortlist COMMA item sortorder */
{
yylhsminor.yy494 = tVariantListAppend(yymsp[-3].minor.yy494, &yymsp[-1].minor.yy312, yymsp[0].minor.yy82);
yygotominor.yy498 = tVariantListAppend(yymsp[-3].minor.yy498, &yymsp[-1].minor.yy134, yymsp[0].minor.yy46);
}
yymsp[-3].minor.yy494 = yylhsminor.yy494;
break;
case 162: /* sortlist ::= item sortorder */
case 164: /* sortlist ::= item sortorder */
{
yylhsminor.yy494 = tVariantListAppend(NULL, &yymsp[-1].minor.yy312, yymsp[0].minor.yy82);
yygotominor.yy498 = tVariantListAppend(NULL, &yymsp[-1].minor.yy134, yymsp[0].minor.yy46);
}
yymsp[-1].minor.yy494 = yylhsminor.yy494;
break;
case 163: /* item ::= ids cpxName */
case 165: /* item ::= ids cpxName */
{
toTSDBType(yymsp[-1].minor.yy0.type);
yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n;
tVariantCreate(&yylhsminor.yy312, &yymsp[-1].minor.yy0);
tVariantCreate(&yygotominor.yy134, &yymsp[-1].minor.yy0);
}
yymsp[-1].minor.yy312 = yylhsminor.yy312;
break;
case 164: /* sortorder ::= ASC */
{yymsp[0].minor.yy82 = TSDB_ORDER_ASC; }
case 166: /* sortorder ::= ASC */
{yygotominor.yy46 = TSDB_ORDER_ASC; }
break;
case 165: /* sortorder ::= DESC */
{yymsp[0].minor.yy82 = TSDB_ORDER_DESC;}
case 167: /* sortorder ::= DESC */
{yygotominor.yy46 = TSDB_ORDER_DESC;}
break;
case 166: /* sortorder ::= */
{yymsp[1].minor.yy82 = TSDB_ORDER_ASC;}
case 168: /* sortorder ::= */
{yygotominor.yy46 = TSDB_ORDER_ASC;}
break;
case 169: /* grouplist ::= grouplist COMMA item */
case 171: /* grouplist ::= grouplist COMMA item */
{
yylhsminor.yy494 = tVariantListAppend(yymsp[-2].minor.yy494, &yymsp[0].minor.yy312, -1);
yygotominor.yy498 = tVariantListAppend(yymsp[-2].minor.yy498, &yymsp[0].minor.yy134, -1);
}
yymsp[-2].minor.yy494 = yylhsminor.yy494;
break;
case 170: /* grouplist ::= item */
case 172: /* grouplist ::= item */
{
yylhsminor.yy494 = tVariantListAppend(NULL, &yymsp[0].minor.yy312, -1);
yygotominor.yy498 = tVariantListAppend(NULL, &yymsp[0].minor.yy134, -1);
}
yymsp[0].minor.yy494 = yylhsminor.yy494;
break;
case 171: /* having_opt ::= */
case 181: /* where_opt ::= */ yytestcase(yyruleno==181);
case 219: /* expritem ::= */ yytestcase(yyruleno==219);
{yymsp[1].minor.yy66 = 0;}
case 173: /* having_opt ::= */
case 183: /* where_opt ::= */ yytestcase(yyruleno==183);
case 221: /* expritem ::= */ yytestcase(yyruleno==221);
{yygotominor.yy64 = 0;}
break;
case 172: /* having_opt ::= HAVING expr */
case 182: /* where_opt ::= WHERE expr */ yytestcase(yyruleno==182);
{yymsp[-1].minor.yy66 = yymsp[0].minor.yy66;}
case 174: /* having_opt ::= HAVING expr */
case 184: /* where_opt ::= WHERE expr */ yytestcase(yyruleno==184);
case 220: /* expritem ::= expr */ yytestcase(yyruleno==220);
{yygotominor.yy64 = yymsp[0].minor.yy64;}
break;
case 173: /* limit_opt ::= */
case 177: /* slimit_opt ::= */ yytestcase(yyruleno==177);
{yymsp[1].minor.yy188.limit = -1; yymsp[1].minor.yy188.offset = 0;}
case 175: /* limit_opt ::= */
case 179: /* slimit_opt ::= */ yytestcase(yyruleno==179);
{yygotominor.yy216.limit = -1; yygotominor.yy216.offset = 0;}
break;
case 174: /* limit_opt ::= LIMIT signed */
case 178: /* slimit_opt ::= SLIMIT signed */ yytestcase(yyruleno==178);
{yymsp[-1].minor.yy188.limit = yymsp[0].minor.yy271; yymsp[-1].minor.yy188.offset = 0;}
case 176: /* limit_opt ::= LIMIT signed */
case 180: /* slimit_opt ::= SLIMIT signed */ yytestcase(yyruleno==180);
{yygotominor.yy216.limit = yymsp[0].minor.yy207; yygotominor.yy216.offset = 0;}
break;
case 175: /* limit_opt ::= LIMIT signed OFFSET signed */
case 179: /* slimit_opt ::= SLIMIT signed SOFFSET signed */ yytestcase(yyruleno==179);
{yymsp[-3].minor.yy188.limit = yymsp[-2].minor.yy271; yymsp[-3].minor.yy188.offset = yymsp[0].minor.yy271;}
case 177: /* limit_opt ::= LIMIT signed OFFSET signed */
case 181: /* slimit_opt ::= SLIMIT signed SOFFSET signed */ yytestcase(yyruleno==181);
{yygotominor.yy216.limit = yymsp[-2].minor.yy207; yygotominor.yy216.offset = yymsp[0].minor.yy207;}
break;
case 176: /* limit_opt ::= LIMIT signed COMMA signed */
case 180: /* slimit_opt ::= SLIMIT signed COMMA signed */ yytestcase(yyruleno==180);
{yymsp[-3].minor.yy188.limit = yymsp[0].minor.yy271; yymsp[-3].minor.yy188.offset = yymsp[-2].minor.yy271;}
case 178: /* limit_opt ::= LIMIT signed COMMA signed */
case 182: /* slimit_opt ::= SLIMIT signed COMMA signed */ yytestcase(yyruleno==182);
{yygotominor.yy216.limit = yymsp[0].minor.yy207; yygotominor.yy216.offset = yymsp[-2].minor.yy207;}
break;
case 183: /* expr ::= LP expr RP */
{yymsp[-2].minor.yy66 = yymsp[-1].minor.yy66; }
case 185: /* expr ::= LP expr RP */
{yygotominor.yy64 = yymsp[-1].minor.yy64; }
break;
case 184: /* expr ::= ID */
{yylhsminor.yy66 = tSQLExprIdValueCreate(&yymsp[0].minor.yy0, TK_ID);}
yymsp[0].minor.yy66 = yylhsminor.yy66;
case 186: /* expr ::= ID */
{yygotominor.yy64 = tSQLExprIdValueCreate(&yymsp[0].minor.yy0, TK_ID);}
break;
case 185: /* expr ::= ID DOT ID */
{yymsp[-2].minor.yy0.n += (1+yymsp[0].minor.yy0.n); yylhsminor.yy66 = tSQLExprIdValueCreate(&yymsp[-2].minor.yy0, TK_ID);}
yymsp[-2].minor.yy66 = yylhsminor.yy66;
case 187: /* expr ::= ID DOT ID */
{yymsp[-2].minor.yy0.n += (1+yymsp[0].minor.yy0.n); yygotominor.yy64 = tSQLExprIdValueCreate(&yymsp[-2].minor.yy0, TK_ID);}
break;
case 186: /* expr ::= ID DOT STAR */
{yymsp[-2].minor.yy0.n += (1+yymsp[0].minor.yy0.n); yylhsminor.yy66 = tSQLExprIdValueCreate(&yymsp[-2].minor.yy0, TK_ALL);}
yymsp[-2].minor.yy66 = yylhsminor.yy66;
case 188: /* expr ::= ID DOT STAR */
{yymsp[-2].minor.yy0.n += (1+yymsp[0].minor.yy0.n); yygotominor.yy64 = tSQLExprIdValueCreate(&yymsp[-2].minor.yy0, TK_ALL);}
break;
case 187: /* expr ::= INTEGER */
{yylhsminor.yy66 = tSQLExprIdValueCreate(&yymsp[0].minor.yy0, TK_INTEGER);}
yymsp[0].minor.yy66 = yylhsminor.yy66;
case 189: /* expr ::= INTEGER */
{yygotominor.yy64 = tSQLExprIdValueCreate(&yymsp[0].minor.yy0, TK_INTEGER);}
break;
case 188: /* expr ::= MINUS INTEGER */
case 189: /* expr ::= PLUS INTEGER */ yytestcase(yyruleno==189);
{yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; yymsp[-1].minor.yy0.type = TK_INTEGER; yylhsminor.yy66 = tSQLExprIdValueCreate(&yymsp[-1].minor.yy0, TK_INTEGER);}
yymsp[-1].minor.yy66 = yylhsminor.yy66;
case 190: /* expr ::= MINUS INTEGER */
case 191: /* expr ::= PLUS INTEGER */ yytestcase(yyruleno==191);
{yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; yymsp[-1].minor.yy0.type = TK_INTEGER; yygotominor.yy64 = tSQLExprIdValueCreate(&yymsp[-1].minor.yy0, TK_INTEGER);}
break;
case 190: /* expr ::= FLOAT */
{yylhsminor.yy66 = tSQLExprIdValueCreate(&yymsp[0].minor.yy0, TK_FLOAT);}
yymsp[0].minor.yy66 = yylhsminor.yy66;
case 192: /* expr ::= FLOAT */
{yygotominor.yy64 = tSQLExprIdValueCreate(&yymsp[0].minor.yy0, TK_FLOAT);}
break;
case 191: /* expr ::= MINUS FLOAT */
case 192: /* expr ::= PLUS FLOAT */ yytestcase(yyruleno==192);
{yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; yymsp[-1].minor.yy0.type = TK_FLOAT; yylhsminor.yy66 = tSQLExprIdValueCreate(&yymsp[-1].minor.yy0, TK_FLOAT);}
yymsp[-1].minor.yy66 = yylhsminor.yy66;
case 193: /* expr ::= MINUS FLOAT */
case 194: /* expr ::= PLUS FLOAT */ yytestcase(yyruleno==194);
{yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; yymsp[-1].minor.yy0.type = TK_FLOAT; yygotominor.yy64 = tSQLExprIdValueCreate(&yymsp[-1].minor.yy0, TK_FLOAT);}
break;
case 193: /* expr ::= STRING */
{yylhsminor.yy66 = tSQLExprIdValueCreate(&yymsp[0].minor.yy0, TK_STRING);}
yymsp[0].minor.yy66 = yylhsminor.yy66;
case 195: /* expr ::= STRING */
{yygotominor.yy64 = tSQLExprIdValueCreate(&yymsp[0].minor.yy0, TK_STRING);}
break;
case 194: /* expr ::= NOW */
{yylhsminor.yy66 = tSQLExprIdValueCreate(&yymsp[0].minor.yy0, TK_NOW); }
yymsp[0].minor.yy66 = yylhsminor.yy66;
case 196: /* expr ::= NOW */
{yygotominor.yy64 = tSQLExprIdValueCreate(&yymsp[0].minor.yy0, TK_NOW); }
break;
case 195: /* expr ::= VARIABLE */
{yylhsminor.yy66 = tSQLExprIdValueCreate(&yymsp[0].minor.yy0, TK_VARIABLE);}
yymsp[0].minor.yy66 = yylhsminor.yy66;
case 197: /* expr ::= VARIABLE */
{yygotominor.yy64 = tSQLExprIdValueCreate(&yymsp[0].minor.yy0, TK_VARIABLE);}
break;
case 196: /* expr ::= BOOL */
{yylhsminor.yy66 = tSQLExprIdValueCreate(&yymsp[0].minor.yy0, TK_BOOL);}
yymsp[0].minor.yy66 = yylhsminor.yy66;
case 198: /* expr ::= BOOL */
{yygotominor.yy64 = tSQLExprIdValueCreate(&yymsp[0].minor.yy0, TK_BOOL);}
break;
case 197: /* expr ::= ID LP exprlist RP */
{ yylhsminor.yy66 = tSQLExprCreateFunction(yymsp[-1].minor.yy224, &yymsp[-3].minor.yy0, &yymsp[0].minor.yy0, yymsp[-3].minor.yy0.type); }
yymsp[-3].minor.yy66 = yylhsminor.yy66;
case 199: /* expr ::= ID LP exprlist RP */
{ yygotominor.yy64 = tSQLExprCreateFunction(yymsp[-1].minor.yy290, &yymsp[-3].minor.yy0, &yymsp[0].minor.yy0, yymsp[-3].minor.yy0.type); }
break;
case 198: /* expr ::= ID LP STAR RP */
{ yylhsminor.yy66 = tSQLExprCreateFunction(NULL, &yymsp[-3].minor.yy0, &yymsp[0].minor.yy0, yymsp[-3].minor.yy0.type); }
yymsp[-3].minor.yy66 = yylhsminor.yy66;
case 200: /* expr ::= ID LP STAR RP */
{ yygotominor.yy64 = tSQLExprCreateFunction(NULL, &yymsp[-3].minor.yy0, &yymsp[0].minor.yy0, yymsp[-3].minor.yy0.type); }
break;
case 199: /* expr ::= expr IS NULL */
{yylhsminor.yy66 = tSQLExprCreate(yymsp[-2].minor.yy66, NULL, TK_ISNULL);}
yymsp[-2].minor.yy66 = yylhsminor.yy66;
case 201: /* expr ::= expr IS NULL */
{yygotominor.yy64 = tSQLExprCreate(yymsp[-2].minor.yy64, NULL, TK_ISNULL);}
break;
case 200: /* expr ::= expr IS NOT NULL */
{yylhsminor.yy66 = tSQLExprCreate(yymsp[-3].minor.yy66, NULL, TK_NOTNULL);}
yymsp[-3].minor.yy66 = yylhsminor.yy66;
case 202: /* expr ::= expr IS NOT NULL */
{yygotominor.yy64 = tSQLExprCreate(yymsp[-3].minor.yy64, NULL, TK_NOTNULL);}
break;
case 201: /* expr ::= expr LT expr */
{yylhsminor.yy66 = tSQLExprCreate(yymsp[-2].minor.yy66, yymsp[0].minor.yy66, TK_LT);}
yymsp[-2].minor.yy66 = yylhsminor.yy66;
case 203: /* expr ::= expr LT expr */
{yygotominor.yy64 = tSQLExprCreate(yymsp[-2].minor.yy64, yymsp[0].minor.yy64, TK_LT);}
break;
case 202: /* expr ::= expr GT expr */
{yylhsminor.yy66 = tSQLExprCreate(yymsp[-2].minor.yy66, yymsp[0].minor.yy66, TK_GT);}
yymsp[-2].minor.yy66 = yylhsminor.yy66;
case 204: /* expr ::= expr GT expr */
{yygotominor.yy64 = tSQLExprCreate(yymsp[-2].minor.yy64, yymsp[0].minor.yy64, TK_GT);}
break;
case 203: /* expr ::= expr LE expr */
{yylhsminor.yy66 = tSQLExprCreate(yymsp[-2].minor.yy66, yymsp[0].minor.yy66, TK_LE);}
yymsp[-2].minor.yy66 = yylhsminor.yy66;
case 205: /* expr ::= expr LE expr */
{yygotominor.yy64 = tSQLExprCreate(yymsp[-2].minor.yy64, yymsp[0].minor.yy64, TK_LE);}
break;
case 204: /* expr ::= expr GE expr */
{yylhsminor.yy66 = tSQLExprCreate(yymsp[-2].minor.yy66, yymsp[0].minor.yy66, TK_GE);}
yymsp[-2].minor.yy66 = yylhsminor.yy66;
case 206: /* expr ::= expr GE expr */
{yygotominor.yy64 = tSQLExprCreate(yymsp[-2].minor.yy64, yymsp[0].minor.yy64, TK_GE);}
break;
case 205: /* expr ::= expr NE expr */
{yylhsminor.yy66 = tSQLExprCreate(yymsp[-2].minor.yy66, yymsp[0].minor.yy66, TK_NE);}
yymsp[-2].minor.yy66 = yylhsminor.yy66;
case 207: /* expr ::= expr NE expr */
{yygotominor.yy64 = tSQLExprCreate(yymsp[-2].minor.yy64, yymsp[0].minor.yy64, TK_NE);}
break;
case 206: /* expr ::= expr EQ expr */
{yylhsminor.yy66 = tSQLExprCreate(yymsp[-2].minor.yy66, yymsp[0].minor.yy66, TK_EQ);}
yymsp[-2].minor.yy66 = yylhsminor.yy66;
case 208: /* expr ::= expr EQ expr */
{yygotominor.yy64 = tSQLExprCreate(yymsp[-2].minor.yy64, yymsp[0].minor.yy64, TK_EQ);}
break;
case 207: /* expr ::= expr AND expr */
{yylhsminor.yy66 = tSQLExprCreate(yymsp[-2].minor.yy66, yymsp[0].minor.yy66, TK_AND);}
yymsp[-2].minor.yy66 = yylhsminor.yy66;
case 209: /* expr ::= expr AND expr */
{yygotominor.yy64 = tSQLExprCreate(yymsp[-2].minor.yy64, yymsp[0].minor.yy64, TK_AND);}
break;
case 208: /* expr ::= expr OR expr */
{yylhsminor.yy66 = tSQLExprCreate(yymsp[-2].minor.yy66, yymsp[0].minor.yy66, TK_OR); }
yymsp[-2].minor.yy66 = yylhsminor.yy66;
case 210: /* expr ::= expr OR expr */
{yygotominor.yy64 = tSQLExprCreate(yymsp[-2].minor.yy64, yymsp[0].minor.yy64, TK_OR); }
break;
case 209: /* expr ::= expr PLUS expr */
{yylhsminor.yy66 = tSQLExprCreate(yymsp[-2].minor.yy66, yymsp[0].minor.yy66, TK_PLUS); }
yymsp[-2].minor.yy66 = yylhsminor.yy66;
case 211: /* expr ::= expr PLUS expr */
{yygotominor.yy64 = tSQLExprCreate(yymsp[-2].minor.yy64, yymsp[0].minor.yy64, TK_PLUS); }
break;
case 210: /* expr ::= expr MINUS expr */
{yylhsminor.yy66 = tSQLExprCreate(yymsp[-2].minor.yy66, yymsp[0].minor.yy66, TK_MINUS); }
yymsp[-2].minor.yy66 = yylhsminor.yy66;
case 212: /* expr ::= expr MINUS expr */
{yygotominor.yy64 = tSQLExprCreate(yymsp[-2].minor.yy64, yymsp[0].minor.yy64, TK_MINUS); }
break;
case 211: /* expr ::= expr STAR expr */
{yylhsminor.yy66 = tSQLExprCreate(yymsp[-2].minor.yy66, yymsp[0].minor.yy66, TK_STAR); }
yymsp[-2].minor.yy66 = yylhsminor.yy66;
case 213: /* expr ::= expr STAR expr */
{yygotominor.yy64 = tSQLExprCreate(yymsp[-2].minor.yy64, yymsp[0].minor.yy64, TK_STAR); }
break;
case 212: /* expr ::= expr SLASH expr */
{yylhsminor.yy66 = tSQLExprCreate(yymsp[-2].minor.yy66, yymsp[0].minor.yy66, TK_DIVIDE);}
yymsp[-2].minor.yy66 = yylhsminor.yy66;
case 214: /* expr ::= expr SLASH expr */
{yygotominor.yy64 = tSQLExprCreate(yymsp[-2].minor.yy64, yymsp[0].minor.yy64, TK_DIVIDE);}
break;
case 213: /* expr ::= expr REM expr */
{yylhsminor.yy66 = tSQLExprCreate(yymsp[-2].minor.yy66, yymsp[0].minor.yy66, TK_REM); }
yymsp[-2].minor.yy66 = yylhsminor.yy66;
case 215: /* expr ::= expr REM expr */
{yygotominor.yy64 = tSQLExprCreate(yymsp[-2].minor.yy64, yymsp[0].minor.yy64, TK_REM); }
break;
case 214: /* expr ::= expr LIKE expr */
{yylhsminor.yy66 = tSQLExprCreate(yymsp[-2].minor.yy66, yymsp[0].minor.yy66, TK_LIKE); }
yymsp[-2].minor.yy66 = yylhsminor.yy66;
case 216: /* expr ::= expr LIKE expr */
{yygotominor.yy64 = tSQLExprCreate(yymsp[-2].minor.yy64, yymsp[0].minor.yy64, TK_LIKE); }
break;
case 215: /* expr ::= expr IN LP exprlist RP */
{yylhsminor.yy66 = tSQLExprCreate(yymsp[-4].minor.yy66, (tSQLExpr*)yymsp[-1].minor.yy224, TK_IN); }
yymsp[-4].minor.yy66 = yylhsminor.yy66;
case 217: /* expr ::= expr IN LP exprlist RP */
{yygotominor.yy64 = tSQLExprCreate(yymsp[-4].minor.yy64, (tSQLExpr*)yymsp[-1].minor.yy290, TK_IN); }
break;
case 216: /* exprlist ::= exprlist COMMA expritem */
{yylhsminor.yy224 = tSQLExprListAppend(yymsp[-2].minor.yy224,yymsp[0].minor.yy66,0);}
yymsp[-2].minor.yy224 = yylhsminor.yy224;
case 218: /* exprlist ::= exprlist COMMA expritem */
{yygotominor.yy290 = tSQLExprListAppend(yymsp[-2].minor.yy290,yymsp[0].minor.yy64,0);}
break;
case 217: /* exprlist ::= expritem */
{yylhsminor.yy224 = tSQLExprListAppend(0,yymsp[0].minor.yy66,0);}
yymsp[0].minor.yy224 = yylhsminor.yy224;
case 219: /* exprlist ::= expritem */
{yygotominor.yy290 = tSQLExprListAppend(0,yymsp[0].minor.yy64,0);}
break;
case 218: /* expritem ::= expr */
{yylhsminor.yy66 = yymsp[0].minor.yy66;}
yymsp[0].minor.yy66 = yylhsminor.yy66;
break;
case 220: /* cmd ::= RESET QUERY CACHE */
case 222: /* cmd ::= RESET QUERY CACHE */
{ setDCLSQLElems(pInfo, TSDB_SQL_RESET_CACHE, 0);}
break;
case 221: /* cmd ::= ALTER TABLE ids cpxName ADD COLUMN columnlist */
case 223: /* cmd ::= ALTER TABLE 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.yy449, NULL, TSDB_ALTER_TABLE_ADD_COLUMN);
SAlterTableSQL* pAlterTable = tAlterTableSQLElems(&yymsp[-4].minor.yy0, yymsp[0].minor.yy523, NULL, TSDB_ALTER_TABLE_ADD_COLUMN);
setSQLInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE);
}
break;
case 222: /* cmd ::= ALTER TABLE ids cpxName DROP COLUMN ids */
case 224: /* cmd ::= ALTER TABLE ids cpxName DROP COLUMN ids */
{
yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n;
......@@ -2786,14 +2361,14 @@ static void yy_reduce(
setSQLInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE);
}
break;
case 223: /* cmd ::= ALTER TABLE ids cpxName ADD TAG columnlist */
case 225: /* cmd ::= ALTER TABLE 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.yy449, NULL, TSDB_ALTER_TABLE_ADD_TAG_COLUMN);
SAlterTableSQL* pAlterTable = tAlterTableSQLElems(&yymsp[-4].minor.yy0, yymsp[0].minor.yy523, NULL, TSDB_ALTER_TABLE_ADD_TAG_COLUMN);
setSQLInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE);
}
break;
case 224: /* cmd ::= ALTER TABLE ids cpxName DROP TAG ids */
case 226: /* cmd ::= ALTER TABLE ids cpxName DROP TAG ids */
{
yymsp[-4].minor.yy0.n += yymsp[-3].minor.yy0.n;
......@@ -2804,7 +2379,7 @@ static void yy_reduce(
setSQLInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE);
}
break;
case 225: /* cmd ::= ALTER TABLE ids cpxName CHANGE TAG ids ids */
case 227: /* cmd ::= ALTER TABLE ids cpxName CHANGE TAG ids ids */
{
yymsp[-5].minor.yy0.n += yymsp[-4].minor.yy0.n;
......@@ -2818,48 +2393,55 @@ static void yy_reduce(
setSQLInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE);
}
break;
case 226: /* cmd ::= ALTER TABLE ids cpxName SET TAG ids EQ tagitem */
case 228: /* cmd ::= ALTER TABLE ids cpxName SET TAG ids EQ tagitem */
{
yymsp[-6].minor.yy0.n += yymsp[-5].minor.yy0.n;
toTSDBType(yymsp[-2].minor.yy0.type);
tVariantList* A = tVariantListAppendToken(NULL, &yymsp[-2].minor.yy0, -1);
A = tVariantListAppend(A, &yymsp[0].minor.yy312, -1);
A = tVariantListAppend(A, &yymsp[0].minor.yy134, -1);
SAlterTableSQL* pAlterTable = tAlterTableSQLElems(&yymsp[-6].minor.yy0, NULL, A, TSDB_ALTER_TABLE_UPDATE_TAG_VAL);
setSQLInfo(pInfo, pAlterTable, NULL, TSDB_SQL_ALTER_TABLE);
}
break;
case 227: /* cmd ::= KILL CONNECTION INTEGER */
case 229: /* cmd ::= KILL CONNECTION INTEGER */
{setKillSQL(pInfo, TSDB_SQL_KILL_CONNECTION, &yymsp[0].minor.yy0);}
break;
case 228: /* cmd ::= KILL STREAM INTEGER COLON INTEGER */
case 230: /* cmd ::= KILL STREAM INTEGER COLON INTEGER */
{yymsp[-2].minor.yy0.n += (yymsp[-1].minor.yy0.n + yymsp[0].minor.yy0.n); setKillSQL(pInfo, TSDB_SQL_KILL_STREAM, &yymsp[-2].minor.yy0);}
break;
case 229: /* cmd ::= KILL QUERY INTEGER COLON INTEGER */
case 231: /* cmd ::= KILL QUERY INTEGER COLON INTEGER */
{yymsp[-2].minor.yy0.n += (yymsp[-1].minor.yy0.n + yymsp[0].minor.yy0.n); setKillSQL(pInfo, TSDB_SQL_KILL_QUERY, &yymsp[-2].minor.yy0);}
break;
default:
break;
/********** End reduce actions ************************************************/
};
assert( yyruleno<sizeof(yyRuleInfo)/sizeof(yyRuleInfo[0]) );
yygoto = yyRuleInfo[yyruleno].lhs;
yysize = yyRuleInfo[yyruleno].nrhs;
yyact = yy_find_reduce_action(yymsp[yysize].stateno,(YYCODETYPE)yygoto);
/* There are no SHIFTREDUCE actions on nonterminals because the table
** generator has simplified them to pure REDUCE actions. */
assert( !(yyact>YY_MAX_SHIFT && yyact<=YY_MAX_SHIFTREDUCE) );
/* It is not possible for a REDUCE to be followed by an error */
assert( yyact!=YY_ERROR_ACTION );
yymsp += yysize+1;
yypParser->yytos = yymsp;
yypParser->yyidx -= yysize;
yyact = yy_find_reduce_action(yymsp[-yysize].stateno,(YYCODETYPE)yygoto);
if( yyact < YYNSTATE ){
#ifdef NDEBUG
/* If we are not debugging and the reduce action popped at least
** one element off the stack, then we can push the new element back
** onto the stack here, and skip the stack overflow test in yy_shift().
** That gives a significant speed improvement. */
if( yysize ){
yypParser->yyidx++;
yymsp -= yysize-1;
yymsp->stateno = (YYACTIONTYPE)yyact;
yymsp->major = (YYCODETYPE)yygoto;
yyTraceShift(yypParser, yyact, "... then shift");
yymsp->minor = yygotominor;
}else
#endif
{
yy_shift(yypParser,yyact,yygoto,&yygotominor);
}
}else{
assert( yyact == YYNSTATE + YYNRULE + 1 );
yy_accept(yypParser);
}
}
/*
......@@ -2875,11 +2457,9 @@ static void yy_parse_failed(
fprintf(yyTraceFILE,"%sFail!\n",yyTracePrompt);
}
#endif
while( yypParser->yytos>yypParser->yystack ) yy_pop_parser_stack(yypParser);
while( yypParser->yyidx>=0 ) yy_pop_parser_stack(yypParser);
/* Here code is inserted which will be executed whenever the
** parser fails */
/************ Begin %parse_failure code ***************************************/
/************ End %parse_failure code *****************************************/
ParseARG_STORE; /* Suppress warning about unused %extra_argument variable */
}
#endif /* YYNOERRORRECOVERY */
......@@ -2890,11 +2470,10 @@ static void yy_parse_failed(
static void yy_syntax_error(
yyParser *yypParser, /* The parser */
int yymajor, /* The major type of the error token */
ParseTOKENTYPE yyminor /* The minor type of the error token */
YYMINORTYPE yyminor /* The minor type of the error token */
){
ParseARG_FETCH;
#define TOKEN yyminor
/************ Begin %syntax_error code ****************************************/
#define TOKEN (yyminor.yy0)
pInfo->valid = false;
int32_t outputBufLen = tListLen(pInfo->pzErrMsg);
......@@ -2917,7 +2496,6 @@ static void yy_syntax_error(
}
assert(len <= outputBufLen);
/************ End %syntax_error code ******************************************/
ParseARG_STORE; /* Suppress warning about unused %extra_argument variable */
}
......@@ -2933,15 +2511,10 @@ static void yy_accept(
fprintf(yyTraceFILE,"%sAccept!\n",yyTracePrompt);
}
#endif
#ifndef YYNOERRORRECOVERY
yypParser->yyerrcnt = -1;
#endif
assert( yypParser->yytos==yypParser->yystack );
while( yypParser->yyidx>=0 ) yy_pop_parser_stack(yypParser);
/* Here code is inserted which will be executed whenever the
** parser accepts */
/*********** Begin %parse_accept code *****************************************/
/*********** End %parse_accept code *******************************************/
ParseARG_STORE; /* Suppress warning about unused %extra_argument variable */
}
......@@ -2971,52 +2544,50 @@ void Parse(
ParseARG_PDECL /* Optional %extra_argument parameter */
){
YYMINORTYPE yyminorunion;
unsigned int yyact; /* The parser action. */
#if !defined(YYERRORSYMBOL) && !defined(YYNOERRORRECOVERY)
int yyact; /* The parser action. */
int yyendofinput; /* True if we are at the end of input */
#endif
#ifdef YYERRORSYMBOL
int yyerrorhit = 0; /* True if yymajor has invoked an error */
#endif
yyParser *yypParser; /* The parser */
/* (re)initialize the parser, if necessary */
yypParser = (yyParser*)yyp;
assert( yypParser->yytos!=0 );
#if !defined(YYERRORSYMBOL) && !defined(YYNOERRORRECOVERY)
yyendofinput = (yymajor==0);
if( yypParser->yyidx<0 ){
#if YYSTACKDEPTH<=0
if( yypParser->yystksz <=0 ){
/*memset(&yyminorunion, 0, sizeof(yyminorunion));*/
yyminorunion = yyzerominor;
yyStackOverflow(yypParser, &yyminorunion);
return;
}
#endif
yypParser->yyidx = 0;
yypParser->yyerrcnt = -1;
yypParser->yystack[0].stateno = 0;
yypParser->yystack[0].major = 0;
}
yyminorunion.yy0 = yyminor;
yyendofinput = (yymajor==0);
ParseARG_STORE;
#ifndef NDEBUG
if( yyTraceFILE ){
int stateno = yypParser->yytos->stateno;
if( stateno < YY_MIN_REDUCE ){
fprintf(yyTraceFILE,"%sInput '%s' in state %d\n",
yyTracePrompt,yyTokenName[yymajor],stateno);
}else{
fprintf(yyTraceFILE,"%sInput '%s' with pending reduce %d\n",
yyTracePrompt,yyTokenName[yymajor],stateno-YY_MIN_REDUCE);
}
fprintf(yyTraceFILE,"%sInput %s\n",yyTracePrompt,yyTokenName[yymajor]);
}
#endif
do{
yyact = yy_find_shift_action(yypParser,(YYCODETYPE)yymajor);
if( yyact >= YY_MIN_REDUCE ){
yy_reduce(yypParser,yyact-YY_MIN_REDUCE,yymajor,yyminor);
}else if( yyact <= YY_MAX_SHIFTREDUCE ){
yy_shift(yypParser,yyact,yymajor,yyminor);
#ifndef YYNOERRORRECOVERY
if( yyact<YYNSTATE ){
assert( !yyendofinput ); /* Impossible to shift the $ token */
yy_shift(yypParser,yyact,yymajor,&yyminorunion);
yypParser->yyerrcnt--;
#endif
yymajor = YYNOCODE;
}else if( yyact==YY_ACCEPT_ACTION ){
yypParser->yytos--;
yy_accept(yypParser);
return;
}else if( yyact < YYNSTATE + YYNRULE ){
yy_reduce(yypParser,yyact-YYNSTATE);
}else{
assert( yyact == YY_ERROR_ACTION );
yyminorunion.yy0 = yyminor;
#ifdef YYERRORSYMBOL
int yymx;
#endif
......@@ -3046,9 +2617,9 @@ void Parse(
**
*/
if( yypParser->yyerrcnt<0 ){
yy_syntax_error(yypParser,yymajor,yyminor);
yy_syntax_error(yypParser,yymajor,yyminorunion);
}
yymx = yypParser->yytos->major;
yymx = yypParser->yystack[yypParser->yyidx].major;
if( yymx==YYERRORSYMBOL || yyerrorhit ){
#ifndef NDEBUG
if( yyTraceFILE ){
......@@ -3056,26 +2627,26 @@ void Parse(
yyTracePrompt,yyTokenName[yymajor]);
}
#endif
yy_destructor(yypParser, (YYCODETYPE)yymajor, &yyminorunion);
yy_destructor(yypParser, (YYCODETYPE)yymajor,&yyminorunion);
yymajor = YYNOCODE;
}else{
while( yypParser->yytos >= yypParser->yystack
&& yymx != YYERRORSYMBOL
&& (yyact = yy_find_reduce_action(
yypParser->yytos->stateno,
YYERRORSYMBOL)) >= YY_MIN_REDUCE
while(
yypParser->yyidx >= 0 &&
yymx != YYERRORSYMBOL &&
(yyact = yy_find_reduce_action(
yypParser->yystack[yypParser->yyidx].stateno,
YYERRORSYMBOL)) >= YYNSTATE
){
yy_pop_parser_stack(yypParser);
}
if( yypParser->yytos < yypParser->yystack || yymajor==0 ){
if( yypParser->yyidx < 0 || yymajor==0 ){
yy_destructor(yypParser,(YYCODETYPE)yymajor,&yyminorunion);
yy_parse_failed(yypParser);
#ifndef YYNOERRORRECOVERY
yypParser->yyerrcnt = -1;
#endif
yymajor = YYNOCODE;
}else if( yymx!=YYERRORSYMBOL ){
yy_shift(yypParser,yyact,YYERRORSYMBOL,yyminor);
YYMINORTYPE u2;
u2.YYERRSYMDT = 0;
yy_shift(yypParser,yyact,YYERRORSYMBOL,&u2);
}
}
yypParser->yyerrcnt = 3;
......@@ -3088,7 +2659,7 @@ void Parse(
** Applications can set this macro (for example inside %include) if
** they intend to abandon the parse upon the first syntax error seen.
*/
yy_syntax_error(yypParser,yymajor, yyminor);
yy_syntax_error(yypParser,yymajor,yyminorunion);
yy_destructor(yypParser,(YYCODETYPE)yymajor,&yyminorunion);
yymajor = YYNOCODE;
......@@ -3103,31 +2674,16 @@ void Parse(
** three input tokens have been successfully shifted.
*/
if( yypParser->yyerrcnt<=0 ){
yy_syntax_error(yypParser,yymajor, yyminor);
yy_syntax_error(yypParser,yymajor,yyminorunion);
}
yypParser->yyerrcnt = 3;
yy_destructor(yypParser,(YYCODETYPE)yymajor,&yyminorunion);
if( yyendofinput ){
yy_parse_failed(yypParser);
#ifndef YYNOERRORRECOVERY
yypParser->yyerrcnt = -1;
#endif
}
yymajor = YYNOCODE;
#endif
}
}while( yymajor!=YYNOCODE && yypParser->yytos>yypParser->yystack );
#ifndef NDEBUG
if( yyTraceFILE ){
yyStackEntry *i;
char cDiv = '[';
fprintf(yyTraceFILE,"%sReturn. Stack=",yyTracePrompt);
for(i=&yypParser->yystack[1]; i<=yypParser->yytos; i++){
fprintf(yyTraceFILE,"%c%s", cDiv, yyTokenName[i->major]);
cDiv = ' ';
}
fprintf(yyTraceFILE,"]\n");
}
#endif
}while( yymajor!=YYNOCODE && yypParser->yyidx>=0 );
return;
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册