提交 f9e1ca94 编写于 作者: Y yihaoDeng

TD-1589

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